/* =============================================================================
   TITLE PAGE — one game's landing page.

   The palette comes from data/games.js: an inline head script writes each
   game's theme onto <html> as custom properties before first paint, so this
   sheet stays generic and every game reskins itself.
   ========================================================================== */

/* -- hero (the "package" block) -------------------------------------------- */
.t-hero {
  position: relative;
  min-height: 100dvh;
  display: grid;
  align-content: center;
  padding: 140px var(--gut) 110px;
  overflow: hidden;
  isolation: isolate;
}

.t-hero .bed {
  position: absolute; inset: -8% 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
  filter: brightness(.62) saturate(.85) contrast(1.06);
  transform: scale(1.08) translateY(var(--par, 0px));
  animation: bedin 1.6s var(--ease) both, drift 26s ease-in-out infinite alternate;
}
@keyframes bedin { from { opacity: 0; transform: scale(1.2); } }
@keyframes drift {
  from { background-position: 48% 50%; }
  to   { background-position: 52% 50%; }
}

.t-hero .bed video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.t-hero .bed::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.85), rgba(0,0,0,.35) 45%, var(--deep) 96%),
    linear-gradient(90deg, rgba(0,0,0,.8), transparent 55%);
}

/* horizontal accent rails, echoing an arcade bezel */
.t-hero .rail {
  position: absolute; left: 0; right: 0; z-index: -1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .35;
}
.t-hero .rail.a { top: 22%; animation: railpulse 5s ease-in-out infinite; }
.t-hero .rail.b { bottom: 18%; animation: railpulse 5s 1.6s ease-in-out infinite; }
@keyframes railpulse { 0%,100% { opacity: .12; } 50% { opacity: .42; } }

.t-hero .inner {
  position: relative; z-index: 2;
  width: 100%; max-width: var(--maxw); margin-inline: auto;
  display: grid;
  gap: clamp(24px, 3vw, 40px);
  justify-items: start;
}

.t-hero .backlink {
  font-family: var(--ui);
  font-size: 11.5px; font-weight: 600; letter-spacing: .26em;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 10px;
  transition: color .3s var(--ease), gap .3s var(--ease);
}
.t-hero .backlink:hover { color: var(--accent); gap: 16px; }

/* big lockup on the hero, larger + left-aligned vs. the tile version */
.t-hero .lock { justify-items: start; text-align: left; width: auto; }
.t-hero .lock .over { padding-bottom: 10px; }
.t-hero .lock .over::after { left: 0; transform: none; max-width: 300px; }
.t-hero .lock .main {
  font-size: clamp(78px, 15vw, 230px);
  filter: drop-shadow(0 0 46px var(--glow)) drop-shadow(0 8px 26px rgba(0,0,0,.9));
}
.t-hero .lock .sub { font-size: clamp(11px, 1.3vw, 17px); }

.t-hero .tagline {
  font-family: var(--display);
  font-size: clamp(14px, 1.5vw, 20px);
  font-weight: 500;
  letter-spacing: .3em;
  color: var(--accent);
  margin: 0;
}

.t-hero .lead {
  /* the hero grid uses justify-items:start, which would otherwise shrink-wrap
     this paragraph well short of its measure */
  width: min(58ch, 100%);
  font-size: clamp(16px, 1.25vw, 19px);
  color: #c2c2ca;
  margin: 0;
}

.t-hero .cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* -- the in-game HUD flourish ---------------------------------------------- */
/* A stylised lifebar + gauge, tinted to the game. Decorative, aria-hidden. */
.hud {
  width: min(560px, 100%);
  display: grid;
  gap: 7px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.25));
  backdrop-filter: blur(3px);
  transform: skewX(calc(var(--skew) / 2));
}
.hud > * { transform: skewX(calc(var(--skew) / -2)); }

.hud .lifebar {
  position: relative;
  height: 11px;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--line);
  overflow: hidden;
}
.hud .lifebar i {
  position: absolute; inset: 0;
  transform-origin: left;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--accent) 55%, #000),
    var(--accent) 55%,
    color-mix(in srgb, var(--accent) 60%, #fff));
  box-shadow: 0 0 14px var(--glow);
  animation: lifefill 1.5s .5s var(--ease) both;
}
@keyframes lifefill { from { transform: scaleX(.06); } to { transform: scaleX(1); } }

.hud .row { display: flex; align-items: center; gap: 8px; }
.hud .lab {
  font-family: var(--display);
  font-size: 10.5px; font-weight: 600; letter-spacing: .26em;
  color: var(--accent2);
  flex: none;
}
.hud .seg { display: flex; gap: 4px; flex: 1; }
.hud .seg span {
  flex: 1; height: 7px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  animation: segfill .4s var(--ease) both;
  animation-delay: calc(1.1s + var(--i, 0) * .11s);
}
@keyframes segfill {
  from { background: rgba(255,255,255,.08); }
  to   { background: var(--accent2); box-shadow: 0 0 10px color-mix(in srgb, var(--accent2) 60%, transparent); }
}
.hud .stat {
  font-family: var(--display);
  font-size: 10px; letter-spacing: .24em;
  color: var(--muted);
  margin-left: auto;
}

/* -- overview -------------------------------------------------------------- */
.t-section { position: relative; padding: clamp(64px, 8vw, 116px) 0; }
.t-section + .t-section { border-top: 1px solid var(--line); }
.t-section.alt { background: var(--deeper); }

.t-head { margin-bottom: clamp(30px, 4vw, 54px); }

.t-overview .cols {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: clamp(30px, 5vw, 76px);
  align-items: start;
}
@media (max-width: 900px) { .t-overview .cols { grid-template-columns: 1fr; } }

.t-overview p { color: #b8b8c1; margin: 0 0 18px; max-width: 62ch; }
.t-overview p.big {
  font-size: clamp(18px, 1.6vw, 24px);
  line-height: 1.5;
  color: var(--ink);
}

/* Right column: optional collage above the spec table. */
.t-overview .side { display: grid; gap: 22px; }
.collage { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.collage figure {
  position: relative; margin: 0; overflow: hidden;
  border: 1px solid var(--line); background: #06060a;
}
.collage figure.wide { grid-column: 1 / -1; aspect-ratio: 16 / 7; }
.collage figure:not(.wide) { aspect-ratio: 10 / 7; }
.collage img { width: 100%; height: 100%; object-fit: cover; }
.collage figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 10px 7px;
  font-family: var(--ui); font-size: 11px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink);
  background: linear-gradient(transparent, rgba(0,0,0,.8));
}
.collage figcaption b { color: var(--accent); font-weight: 600; margin-right: 6px; }

/* Stats row under the overview copy. */
.t-overview .stats {
  display: flex; flex-wrap: wrap; gap: 28px 40px;
  margin-top: 30px; padding-top: 24px;
  border-top: 1px solid var(--line);
}
.t-overview .stats div { display: grid; gap: 4px; }
.t-overview .stats b {
  font-family: var(--display); font-size: clamp(34px, 3.4vw, 48px);
  line-height: 1; color: var(--ink);
}
.t-overview .stats span {
  font-family: var(--ui); font-size: 11px; font-weight: 600; letter-spacing: .24em;
  color: var(--accent);
}

.spectable { border-top: 1px solid var(--line); }
.spectable .r {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--ui);
  font-size: 13.5px;
  letter-spacing: .06em;
}
.spectable .r dt {
  font-size: 10.5px; font-weight: 600; letter-spacing: .24em;
  color: var(--accent);
  padding-top: 2px;
}
.spectable .r dd { margin: 0; color: #c6c6ce; text-transform: uppercase; letter-spacing: .1em; }

/* -- stage divisions (KOF 2000: Neo Geo vs. console) ----------------------- */
/* When a game has labelled groups, #stages switches from a grid to a stack of
   .stagegroup sections, each with its own header and its own grid. */
.stages.grouped { display: block; }
.stagegroup + .stagegroup { margin-top: clamp(38px, 5vw, 68px); }

.grouphead {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 8px 16px;
  padding-bottom: 14px;
  margin-bottom: clamp(16px, 2vw, 26px);
  border-bottom: 1px solid var(--line);
}
.grouphead .gl {
  font-family: var(--display);
  font-size: clamp(20px, 2.4vw, 32px);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink);
  position: relative;
  padding-left: 18px;
}
.grouphead .gl::before {                 /* accent tab */
  content: '';
  position: absolute; left: 0; top: 50%;
  width: 7px; height: 1.1em;
  transform: translateY(-50%) skewX(var(--skew));
  background: var(--accent);
  box-shadow: 0 0 14px var(--glow);
}
.grouphead .gs {
  font-family: var(--ui);
  font-size: 11.5px; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted);
}
.grouphead .gn {
  font-family: var(--display);
  font-size: 12px; letter-spacing: .28em;
  color: var(--muted);
  white-space: nowrap;
}
.grouphead .gn b { color: var(--accent); font-size: 17px; }
.grouphead .gb {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  max-width: 74ch;
  color: #b6b6bf;
  font-size: 14.5px;
}
@media (max-width: 560px) {
  .grouphead { grid-template-columns: 1fr auto; }
  .grouphead .gs { grid-column: 1 / -1; order: 3; }
}

/* -- stage grid ------------------------------------------------------------ */
.stages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: clamp(12px, 1.4vw, 22px);
}

.stage {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #06060a;
  border: 1px solid var(--line);
  isolation: isolate;
  transition: border-color .4s var(--ease), transform .5s var(--slam);
}
.stage:hover, .stage:focus-visible { border-color: var(--accent); transform: translateY(-4px); }
/* IKEMEN select-screen portraits are 476x196; show them whole. */
.stage.portrait { aspect-ratio: 476 / 196; }

.stage img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  filter: brightness(.72) saturate(.85);
  transform: scale(1.02);
  transition: transform 1.1s var(--ease), filter .5s var(--ease);
}
.stage:hover img, .stage:focus-visible img {
  transform: scale(1.11);
  filter: brightness(.95) saturate(1.05);
}

.stage .veil {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 30%, rgba(0,0,0,.92));
  transition: opacity .5s var(--ease);
}

.stage .frame {                    /* accent frame that draws in on hover */
  position: absolute; inset: 8px; z-index: 3;
  pointer-events: none;
  border: 1px solid var(--accent);
  opacity: 0;
  clip-path: inset(0 0 100% 0);
  transition: opacity .3s var(--ease), clip-path .5s var(--ease);
}
.stage:hover .frame, .stage:focus-visible .frame { opacity: .8; clip-path: inset(0 0 0 0); }

.stage .tag {
  position: absolute; top: 10px; left: 10px; z-index: 4;
  font-family: var(--ui);
  font-size: 9.5px; font-weight: 600; letter-spacing: .2em;
  padding: 4px 8px;
  background: rgba(0,0,0,.72);
  border: 1px solid var(--line);
  color: var(--muted);
}
.stage .tag.ph { color: var(--accent2); border-color: color-mix(in srgb, var(--accent2) 40%, transparent); }

.stage .cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  padding: 16px 16px 15px;
  display: grid; gap: 3px;
}
.stage .cap h3 {
  font-size: clamp(19px, 1.8vw, 25px);
  letter-spacing: .04em;
  transition: transform .45s var(--ease);
}
.stage .cap .loc {
  font-family: var(--ui);
  font-size: 11.5px; letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
  transition: color .4s var(--ease);
}
.stage:hover .cap h3 { transform: translateX(4px); }
.stage:hover .cap .loc { color: var(--accent); }

.stage .zoom {
  position: absolute; right: 12px; bottom: 14px; z-index: 5;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 15px;
  opacity: 0;
  transform: scale(.7);
  transition: opacity .4s var(--ease), transform .4s var(--slam);
}
.stage:hover .zoom, .stage:focus-visible .zoom { opacity: 1; transform: none; }

/* -- notes ----------------------------------------------------------------- */
.notelist { list-style: none; margin: 0; padding: 0; max-width: 76ch; }
.notelist li {
  position: relative;
  padding: 15px 0 15px 34px;
  border-bottom: 1px solid var(--line);
  color: #b6b6bf;
}
.notelist li::before {
  content: '';
  position: absolute; left: 4px; top: 25px;
  width: 9px; height: 9px;
  background: var(--accent);
  transform: rotate(45deg);
}

/* -- other titles ---------------------------------------------------------- */
.others {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(12px, 1.5vw, 22px);
}
.other {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  min-height: 132px;
  border: 1px solid var(--line);
  background: #08080b;
  overflow: hidden;
  transition: border-color .4s var(--ease), transform .5s var(--slam);
}
.other:hover { border-color: var(--accent); transform: translateY(-3px); }
.other .art {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  filter: grayscale(1) brightness(.28);
  opacity: .55;
  transform: scale(1.04);
  transition: filter .6s var(--ease), transform 1.2s var(--ease), opacity .6s;
}
.other:hover .art { filter: grayscale(.2) brightness(.42); transform: scale(1.12); opacity: .8; }
.other .txt { position: relative; z-index: 2; }
.other .txt .no {
  font-family: var(--display);
  font-size: 11px; letter-spacing: .28em; color: var(--muted);
  display: block; margin-bottom: 6px;
}
.other .txt h3 { font-size: clamp(20px, 2vw, 28px); }
.other .txt p {
  margin: 5px 0 0;
  font-family: var(--ui);
  font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted);
}
.other .go {
  position: relative; z-index: 2;
  margin-left: auto;
  color: var(--accent);
  font-size: 22px;
  transform: translateX(-8px);
  opacity: .4;
  transition: transform .45s var(--ease), opacity .45s;
}
.other:hover .go { transform: none; opacity: 1; }
.other.current { border-color: var(--accent); opacity: .45; pointer-events: none; }

@media (max-width: 720px) {
  .t-hero { min-height: auto; padding-top: 120px; }
  .stages { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
}
