/* ==========================================================================
   Y1 Game — Game detail page
   One template (games-details.html) renders every title via ?game=<slug>,
   filled by assets/js/components/game-detail.js. Layout: a hero built from
   the game's own art (blurred backdrop + poster), a facts strip overlapping
   its bottom edge, a two-column body (article + sticky sidebar), then a
   related-games strip using the shared .games-grid/.gcard components.
   ========================================================================== */

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */
.gdhero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(2.6rem, 1.8rem + 3vw, 4.4rem) clamp(3.5rem, 2.6rem + 3.2vw, 5.5rem);
  background: var(--surface);
}
.gdhero__bg-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.gdhero__bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(38px) saturate(1.3) brightness(0.5);
  transform: scale(1.2);
  opacity: 0.55;
}
.gdhero__bg-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 8, 7, 0.55) 0%, rgba(8, 8, 7, 0.86) 68%, var(--surface-base) 100%),
    var(--wash-ruby);
}

.gdhero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: clamp(1.8rem, 1.2rem + 2.4vw, 3rem);
  align-items: center;
}
@media (min-width: 900px) {
  .gdhero__inner { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); }
}

.gdhero__copy { min-width: 0; }

.gdhero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h1);
  line-height: 1.04;
  letter-spacing: var(--ls-tight);
  color: var(--ink);
  margin-top: 0.6rem;
  word-break: break-word;
}

.gdhero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.gdhero__poster {
  position: relative;
  margin-inline: auto;
  max-width: 240px;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 211 / 260;
  background: var(--surface-lift);
  box-shadow: inset 0 0 0 1px var(--line-gold-strong), var(--shadow-lg);
}
.gdhero__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gdhero__poster::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px var(--line-gold-faint);
  border-radius: inherit;
  pointer-events: none;
}
.gdhero__ribbon {
  position: absolute;
  top: 14px;
  left: -34px;
  z-index: 2;
  transform: rotate(-40deg);
  background: var(--ruby-plate);
  color: var(--ivory);
  font-family: var(--font-label);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.32rem 2.6rem;
  box-shadow: var(--shadow-sm);
}

/* ---------------------------------------------------------------------
   Facts strip — overlaps the hero's bottom edge
   --------------------------------------------------------------------- */
.gdfacts {
  position: relative;
  z-index: 2;
  margin-top: clamp(-3.4rem, -2.6rem - 1.5vw, -2.4rem);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line-gold-faint);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line-gold), var(--shadow-lg);
}
@media (min-width: 640px) {
  .gdfacts { grid-template-columns: repeat(4, 1fr); }
}
.gdfacts__item {
  background: var(--surface-lift);
  padding: clamp(1rem, 0.8rem + 0.6vw, 1.4rem) 1rem;
  text-align: center;
  display: grid;
  gap: 0.3rem;
}
.gdfacts__item b {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.4rem);
  color: var(--gold-bright);
}
.gdfacts__item span {
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------------------
   Body — article + sticky rail
   --------------------------------------------------------------------- */
.gdbody {
  display: grid;
  gap: clamp(2.2rem, 1.6rem + 2vw, 3.4rem);
}
@media (min-width: 960px) {
  .gdbody { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
}

.gdmain { min-width: 0; }
.gdmain > * + * { margin-top: clamp(2.2rem, 1.7rem + 1.6vw, 3.2rem); }

.gdsection__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h3);
  color: var(--ink);
  margin-bottom: 0.9rem;
}

.gdprose { display: grid; gap: 1rem; }
.gdprose p {
  font-size: var(--fs-body);
  line-height: 1.72;
  color: var(--ink-muted);
}

/* Numbered steps */
.gdsteps {
  display: grid;
  gap: 0.9rem;
  counter-reset: gdstep;
}
.gdsteps li {
  position: relative;
  list-style: none;
  display: grid;
  gap: 0.3rem;
  padding: 1.05rem 1.2rem 1.05rem 3.4rem;
  border-radius: var(--r-md);
  background: var(--surface-lift);
  box-shadow: inset 0 0 0 1px var(--line-ink);
}
.gdsteps li::before {
  counter-increment: gdstep;
  content: counter(gdstep);
  position: absolute;
  left: 1rem;
  top: 1.05rem;
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-plate);
  color: var(--ink-invert);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.82rem;
}
.gdsteps li b {
  font-family: var(--font-display);
  font-size: 1.08rem;
  color: var(--ink);
}
.gdsteps li span {
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--ink-soft);
}

/* Warning callout */
.gdcallout {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: clamp(1.2rem, 1rem + 0.6vw, 1.6rem);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(155, 17, 30, 0.16), rgba(155, 17, 30, 0.05));
  box-shadow: inset 0 0 0 1px rgba(155, 17, 30, 0.4);
}
.gdcallout__icon {
  flex: none;
  width: 2.3rem;
  height: 2.3rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(196, 30, 58, 0.24);
  color: var(--ruby-bright);
}
.gdcallout__icon svg { width: 1.2rem; height: 1.2rem; }
.gdcallout h3 {
  font-family: var(--font-display);
  font-size: 1.14rem;
  color: var(--ink);
  margin-bottom: 0.3rem;
}
.gdcallout p {
  font-size: var(--fs-sm);
  line-height: 1.66;
  color: var(--ink-muted);
}

/* ---------------------------------------------------------------------
   Sidebar
   --------------------------------------------------------------------- */
.gdrail {
  display: grid;
  gap: 1.2rem;
}
@media (min-width: 960px) {
  .gdrail { position: sticky; top: calc(var(--sp-8) + 1rem); }
}

.gdcta {
  padding: 1.5rem;
  border-radius: var(--r-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.015) 45%, rgba(255, 255, 255, 0) 100%),
    var(--surface-lift);
  box-shadow: inset 0 0 0 1px var(--line-gold), var(--shadow-md);
}
.gdcta h3 {
  font-family: var(--font-display);
  font-size: 1.24rem;
  color: var(--ink);
  margin-bottom: 0.3rem;
}
.gdcta p {
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  margin-bottom: 1.1rem;
  line-height: 1.6;
}
.gdcta .btn { width: 100%; margin-bottom: 0.6rem; }

.gdglance {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem 1rem;
  margin-top: 1.2rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line-ink);
}
.gdglance dt {
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.gdglance dd {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--gold-bright);
  text-align: right;
}

.gdsupport {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1.2rem 1.4rem;
  border-radius: var(--r-lg);
  background: var(--surface-lift);
  box-shadow: inset 0 0 0 1px var(--line-ink);
}
.gdsupport svg { width: 2.1rem; height: 2.1rem; flex: none; }
.gdsupport b { display: block; color: var(--ink); font-size: 0.92rem; }
.gdsupport span { display: block; color: var(--ink-soft); font-size: var(--fs-xs); }

/* ---------------------------------------------------------------------
   Related games
   --------------------------------------------------------------------- */
.gdrelated { border-top: 1px solid var(--line-ink-soft); }
