/* ==========================================================================
   PAGE: Games listing (Games-.html) + Game detail (Games-details-.html)
   ========================================================================== */

/* ------------------------------ Filter bar -------------------------------- */
.filters {
  display: grid;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
  padding: var(--s-4);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(10px);
  border: 1px solid var(--c-line);
  position: sticky;
  top: calc(var(--header-h) + 8px);
  z-index: var(--z-sticky);
}

@media (min-width: 860px) {
  .filters {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0.5rem 1rem;
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-pill);
  background: var(--c-surface);
  color: var(--c-text-2);
  font-family: var(--f-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  white-space: nowrap;
  transition: all var(--t-base);
}

.chip:hover {
  color: var(--c-text);
  border-color: rgba(225, 6, 0, 0.5);
  transform: translateY(-2px);
}

.chip__count {
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.7rem;
  color: var(--c-text-muted);
}

.chip[aria-pressed="true"] {
  background: var(--g-red);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--glow-red-sm);
}

.chip[aria-pressed="true"] .chip__count {
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
}

/* Search */
.search {
  position: relative;
  min-width: 240px;
}

.search__input {
  width: 100%;
  padding: 0.65rem var(--s-4) 0.65rem 2.6rem;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-pill);
  color: var(--c-text);
  transition: border-color var(--t-base), box-shadow var(--t-base);
}

.search__input::placeholder { color: var(--c-text-muted); }

.search__input:focus {
  outline: none;
  border-color: var(--c-red);
  box-shadow: var(--glow-red-sm);
}

.search__icon {
  position: absolute;
  left: var(--s-4);
  top: 50%;
  translate: 0 -50%;
  color: var(--c-text-muted);
  pointer-events: none;
}

/* Result count + empty state */
.results-count {
  margin-bottom: var(--s-4);
  color: var(--c-text-muted);
  font-size: var(--fs-sm);
}

.results-count strong { color: var(--c-text); }

.empty {
  display: none;
  padding: var(--s-8) var(--s-5);
  text-align: center;
  border: 1px dashed var(--c-line-strong);
  border-radius: var(--r-lg);
}

.empty.is-visible { display: block; }

.empty__title {
  font-size: var(--fs-lg);
  margin-bottom: var(--s-2);
}

.empty__text {
  color: var(--c-text-2);
  font-size: var(--fs-sm);
  margin-bottom: var(--s-4);
}

/* ========================================================================
   Game detail
   ======================================================================== */

.gd {
  display: grid;
  gap: clamp(1.5rem, 1rem + 3vw, 3rem);
  align-items: start;
}

@media (min-width: 900px) {
  .gd { grid-template-columns: 320px 1fr; }
}

/* Poster */
.gd__poster {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid rgba(225, 6, 0, 0.3);
  box-shadow: var(--glow-red), var(--sh-3);
  background: var(--c-surface);
}

.gd__poster img {
  width: 100%;
  aspect-ratio: 211 / 260;
  object-fit: cover;
}

.gd__poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(10, 10, 12, 0.7));
  pointer-events: none;
}

.gd__title {
  font-size: var(--fs-3xl);
  margin-bottom: var(--s-3);
  text-wrap: balance;
}

.gd__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-5);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-pill);
  background: var(--c-surface-2);
  border: 1px solid var(--c-line-strong);
  color: var(--c-text-2);
  font-family: var(--f-display);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
}

.pill--red {
  background: var(--g-red-soft);
  border-color: rgba(225, 6, 0, 0.4);
  color: var(--c-red-hot);
}

.pill--green {
  background: rgba(0, 210, 106, 0.1);
  border-color: rgba(0, 210, 106, 0.4);
  color: var(--c-win);
}

.gd__desc {
  color: var(--c-text-2);
  font-size: var(--fs-md);
  margin-bottom: var(--s-6);
  max-width: 62ch;
}

/* Sticky play CTA (mobile: docked to the bottom of the viewport) */
.gd__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--r-lg);
  background: var(--g-surface);
  border: 1px solid rgba(225, 6, 0, 0.3);
  box-shadow: var(--sh-2);
}

@media (min-width: 900px) {
  .gd__cta {
    position: sticky;
    top: calc(var(--header-h) + 16px);
  }
}

.playbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--gutter);
  padding-bottom: calc(var(--s-3) + env(safe-area-inset-bottom, 0px));
  background: rgba(13, 13, 16, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(225, 6, 0, 0.35);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  transform: translateY(100%);
  transition: transform var(--t-base);
}

.playbar.is-visible { transform: translateY(0); }

@media (min-width: 900px) { .playbar { display: none; } }

.playbar__name {
  flex: 1;
  min-width: 0;
  font-family: var(--f-display);
  font-weight: 700;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playbar__meta {
  display: block;
  font-family: var(--f-body);
  font-size: var(--fs-xs);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--c-text-muted);
}

/* Give the page room so the docked bar never covers the footer content */
@media (max-width: 899px) {
  .gd-page { padding-bottom: 84px; }
}
