:root {
  --navy: #0d1a30;
  --navy-2: #15274a;
  --night: #070f1d;
  --ice: #eef5f9;
  --house-blue: #1f4e9c;
  --house-red: #b3283a;
  --gold: #d9a93b;
  --gold-light: #f0cf7a;
  --fire: #ff8a2a;
  --ember: #2a0d07;
  --text-on-dark: #e6edf4;
  --muted-on-dark: #a9b8c9;
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--navy);
  color: var(--text-on-dark);
  font: 400 1.0625rem/1.6 var(--body);
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--gold-light); text-underline-offset: 0.2em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--display); font-weight: 900; line-height: 0.92; margin: 0; text-transform: uppercase; }
h2 { font-size: clamp(2.5rem, 5.2vw, 4rem); }
h3 { font-size: 1.6rem; }
.wrap { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }

/* Scenes pin their content while the section scrolls past. --p runs 0 to 1. */
.scene { position: relative; --p: 0; }
.scene > .pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }

/* ---------- Act 1: arena hero ---------- */
.hero { height: 210vh; background: var(--night); }
.stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100vw, 177.8vh);
  aspect-ratio: 1672 / 941;
  transform: translate(-50%, -50%);
}
.layer { position: absolute; will-change: transform; }
.plate { inset: 0; width: 100%; height: 100%; transform: scale(calc(1 + var(--p) * 0.1)); transform-origin: 50% 80%; }
/* The crew from the game's splash art stands right of centre, as it does on the title screen. */
.crew {
  height: 80%;
  width: auto;
  left: 41%;
  top: 11%;
  transform-origin: 50% 100%;
  transform: translate(calc(var(--p) * 9%), calc(var(--p) * 2%)) scale(calc(1 + var(--p) * 0.07));
}
/* The stone starts near the camera and is delivered into the house. */
.stone {
  width: 15%;
  height: auto;
  left: 30%;
  top: 74%;
  transform:
    translate(calc(var(--p) * 83%), calc(var(--p) * -45%))
    scale(calc(1 - var(--p) * 0.62));
  transform-origin: 50% 100%;
  filter: drop-shadow(0 18px 14px rgba(0, 0, 0, 0.55));
}

.hero-copy {
  position: absolute;
  z-index: 2;
  left: max(1.25rem, (100vw - 1240px) / 2);
  top: 12vh;
  width: min(34rem, 42vw);
  transform: translateY(calc(var(--p) * -40vh));
  opacity: calc(1 - var(--p) * 2.2);
}
.hero h1 {
  font-size: clamp(3.6rem, 8.4vw, 8rem);
  color: var(--ice);
  line-height: 0.84;
  text-shadow: 0 3px 0 var(--night), 0 10px 30px rgba(7, 15, 29, 0.7);
}
.lede { max-width: 30ch; margin: 1.1rem 0 0; font-size: 1.2rem; text-shadow: 0 1px 8px rgba(7, 15, 29, 0.9); }
.status { display: inline-block; margin: 1.2rem 0 0; padding: 0.5rem 1rem; border: 2px solid var(--gold); color: var(--gold-light); font-weight: 600; background: rgba(7, 15, 29, 0.55); }
.hero-beat {
  position: absolute;
  z-index: 2;
  left: max(1.25rem, (100vw - 1240px) / 2);
  width: min(34rem, 42vw);
  top: 18vh;
  margin: 0;
  font: 900 clamp(2.4rem, 6vw, 5rem)/0.95 var(--display);
  text-transform: uppercase;
  color: var(--gold-light);
  text-shadow: 0 3px 0 var(--night);
  opacity: clamp(0, (var(--p) - 0.55) * 4, 1);
  transform: translateY(calc((1 - var(--p)) * 6vh));
}

/* ---------- Act 2: the sheet ---------- */
.sheet-scene { height: 280vh; background: var(--ice); color: var(--navy); }
.sheet-scene .pin {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) 1.6fr;
  align-content: center;
  gap: 3rem;
  padding: 0 max(1.25rem, (100vw - 1240px) / 2);
}
.sheet-copy h2 { font-size: clamp(2.2rem, 4vw, 3.4rem); }
.moves { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1.2rem; }
.moves li { border-left: 4px solid #c7d6e1; padding-left: 1rem; opacity: 0.4; transition: opacity 0.3s, border-color 0.3s; }
.moves li.on { opacity: 1; border-color: var(--house-red); }
.moves p { margin: 0.35rem 0 0; color: #2c3a50; font-size: 1rem; }
.sweep-hint { margin: 0 0 1rem; font-weight: 600; color: #3f5068; max-width: 60ch; }
.ice { touch-action: pan-y; cursor: ew-resize; border: 2px solid #9fb6c6; background: #eef5f9; }
.ice svg { display: block; width: 100%; height: auto; }
.meter-row { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }
.meter { width: 220px; height: 14px; background: #d6e2ea; border: 2px solid var(--navy); }
.meter span { display: block; height: 100%; width: 100%; background: #3cae5b; transform-origin: left; transform: scaleX(var(--energy, 1)); }
.meter.mid span { background: #e2b72d; }
.meter.low span { background: var(--house-red); }
.sweep-btn {
  font: 900 1.25rem/1 var(--display);
  text-transform: uppercase;
  padding: 0.6rem 1.2rem;
  border: 0;
  background: var(--navy);
  color: var(--gold-light);
  cursor: pointer;
}
.sweep-btn:active { transform: translateY(2px); }
.result { margin: 0; font-weight: 600; min-height: 1.6em; }

/* ---------- quiet beat ---------- */
.breath { padding: 22vh 1.25rem; background: var(--navy); text-align: center; }
.breath p { margin: 0 auto; max-width: 26ch; font: 700 clamp(1.6rem, 3vw, 2.4rem)/1.15 var(--display); color: var(--muted-on-dark); }

/* ---------- Act 3: on fire (peak) ---------- */
.fire-scene { height: 330vh; background: var(--navy); }
.fire-scene .pin {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 0 max(1.25rem, (100vw - 1240px) / 2);
  position: sticky;
  background: var(--navy);
}
/* The page regrades from arena navy to ember as the streak builds. */
.fire-scene .pin::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ember);
  border-top: 10px solid var(--fire);
  opacity: var(--heat, 0);
}
.fire-stage, .fire-copy { position: relative; }
.fire-stage { height: min(70vh, 560px); display: grid; place-items: end center; }
.flames {
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: 256px;
  height: 256px;
  background: url("assets/flame-strip.webp") 0 0 / 4096px 256px no-repeat;
  transform: translateX(-50%) scale(calc(0.5 + var(--heat, 0) * 2.3));
  transform-origin: 50% 100%;
  opacity: calc(var(--heat, 0) * 1.4);
  animation: flicker 0.9s steps(16) infinite;
  animation-play-state: var(--flame-state, paused);
}
@keyframes flicker { to { background-position: -4096px 0; } }
.fire-stone { position: relative; width: min(44%, 230px); filter: drop-shadow(0 20px 16px rgba(0, 0, 0, 0.6)); }
.fire-copy h2 { color: var(--ice); transition: color 0.4s; font-size: clamp(2.8rem, 6vw, 5.2rem); }
.fire-scene.lit .fire-copy h2 { color: var(--fire); }
.fire-copy p { font-size: 1.2rem; color: #f4d9c6; max-width: 42ch; margin: 1.2rem 0 0; opacity: clamp(0, (var(--p) - 0.55) * 4, 1); }
.fire-copy .heat-label { margin: 0 0 0.8rem; opacity: 1; font: 900 1.6rem/1 var(--display); text-transform: uppercase; color: var(--gold-light); }

/* ---------- Act 4: character select ---------- */
.select { padding: 6rem 0 5rem; background: var(--navy); }
.select-head p { color: var(--muted-on-dark); max-width: 56ch; margin: 1rem 0 0; font-size: 1.125rem; }
.select-body { display: grid; grid-template-columns: 1.35fr 1fr; gap: 2.5rem; margin-top: 2.5rem; align-items: start; }
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 0.6rem; }
.pick {
  padding: 0;
  border: 2px solid transparent;
  background: var(--navy-2);
  cursor: pointer;
  text-align: left;
  color: var(--text-on-dark);
}
.pick img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.pick span { display: block; padding: 0.3rem 0.4rem 0.4rem; font: 700 0.95rem/1.05 var(--display); text-transform: uppercase; }
.pick:hover { border-color: #3b5688; }
.pick[aria-pressed="true"] { border-color: var(--gold); background: #22386a; }
.card { position: sticky; top: 2rem; display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 1.25rem; align-items: end; background: var(--night); padding: 1.5rem 1.5rem 0; border-top: 6px solid var(--gold); min-height: 420px; }
.card-figure { width: 100%; height: 400px; object-fit: contain; object-position: bottom; }
.card-figure.swap { animation: step-in 0.32s cubic-bezier(.2, .8, .2, 1); }
@keyframes step-in { from { opacity: 0; transform: translateX(-24px); } }
.card-info { padding-bottom: 1.5rem; align-self: center; }
.card h3 { font-size: 2.4rem; color: var(--ice); }
.card-rink { margin: 0.5rem 0 0; font-weight: 600; color: var(--gold-light); }
.card-tag { margin: 0.2rem 0 0; color: var(--muted-on-dark); }
.stats { margin: 1.3rem 0 0; display: grid; gap: 0.6rem; }
.stats div { display: grid; grid-template-columns: 5.5rem 1fr 1.6rem; align-items: center; gap: 0.6rem; }
.stats dt { font: 700 1rem/1 var(--display); text-transform: uppercase; color: var(--muted-on-dark); }
.stats dd { margin: 0; text-align: right; font-weight: 600; }
.bar { height: 10px; background: #22325a; }
.bar i { display: block; height: 100%; background: var(--house-red); transform-origin: left; transform: scaleX(var(--v)); transition: transform 0.35s cubic-bezier(.2, .8, .2, 1); }
.stats div:nth-child(2) .bar i { background: #3f86e0; }
.stats div:nth-child(3) .bar i { background: var(--gold); }

/* ---------- modes and close ---------- */
.modes { background: var(--navy-2); padding: 5.5rem 0; }
.mode-list { margin: 2.5rem 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem 3rem; }
.mode-list div { border-left: 4px solid var(--house-red); padding-left: 1.1rem; }
.mode-list div:first-child { border-color: var(--gold); }
.mode-list dt { font: 900 1.7rem/1 var(--display); text-transform: uppercase; color: var(--ice); }
.mode-list dd { margin: 0.5rem 0 0; color: var(--muted-on-dark); max-width: 48ch; }

.close { background: var(--night); padding: 5rem 0 4rem; }
.close-inner { display: grid; grid-template-columns: 220px 1fr; gap: 2.5rem; align-items: center; }
.close-title { margin: 0; font: 900 clamp(2.8rem, 6vw, 4.6rem)/0.9 var(--display); text-transform: uppercase; color: var(--ice); }
.close-sub { margin: 1rem 0 0; font-size: 1.2rem; }
.maker { margin: 2rem 0 0; color: var(--muted-on-dark); }

/* ---------- phones: separate art direction ---------- */
@media (max-width: 820px) {
  .crew { height: 44%; left: 50%; top: 45%; transform: translateX(-50%) scale(calc(1 + var(--p) * 0.07)); }
  .stone { width: 9%; left: 52%; top: 80%; transform: translate(calc(var(--p) * -36%), calc(var(--p) * -40%)) scale(calc(1 - var(--p) * 0.45)); }
  .hero-copy { top: 5vh; left: 1.25rem; width: calc(100% - 2.5rem); text-align: center; }
  .lede { margin-inline: auto; }
  .hero-beat { left: 1.25rem; width: calc(100% - 2.5rem); top: 9vh; text-align: center; }
  .lede { font-size: 1.05rem; }
  .sheet-scene { height: 240vh; }
  .sheet-scene .pin { grid-template-columns: 1fr; gap: 1.2rem; align-content: center; }
  .moves { margin-top: 1rem; gap: 0.6rem; }
  .moves li:not(.on) { display: none; }
  .fire-scene .pin { grid-template-columns: 1fr; align-content: center; gap: 1rem; text-align: center; }
  .fire-stage { height: 38vh; }
  .fire-copy p { margin-inline: auto; }
  .select-body { grid-template-columns: 1fr; }
  .card { position: relative; top: 0; order: -1; min-height: 0; grid-template-columns: 0.8fr 1.2fr; }
  .card-figure { height: 280px; }
  .card h3 { font-size: 1.9rem; }
  .picks { grid-auto-flow: column; grid-auto-columns: 84px; grid-template-columns: none; overflow-x: auto; padding-bottom: 0.5rem; }
  .mode-list { grid-template-columns: 1fr; }
  .close-inner { grid-template-columns: 110px 1fr; gap: 1.25rem; }
}

/* ---------- reduced motion: no pinning, every scene shown in its settled state ---------- */
.rm .scene { height: auto; }
.rm .scene > .pin { position: relative; height: auto; min-height: 100vh; }
.rm .hero .pin { height: 100vh; }
.rm .hero-beat { display: none; }
.rm .sheet-scene .pin, .rm .fire-scene .pin { padding-block: 5rem; }
.rm .moves li { opacity: 1; display: block; }
.rm .flames { animation: none; }
.rm .card-figure.swap { animation: none; }

/* ---------- help and legal links ---------- */
.legal-links { margin: 0.8rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
