/* WINTER ARC: a PS2 game you can scroll. Palette taken from the key art: snow, sky, hoodie black, puppy gold. */
:root {
  --snow: oklch(0.975 0.012 240);
  --frost: oklch(0.925 0.032 240);
  --ice: oklch(0.85 0.07 240);
  --sky: oklch(0.76 0.115 248);
  --sky-deep: oklch(0.53 0.15 258);
  --navy: oklch(0.24 0.06 262);
  --night: oklch(0.17 0.04 262);
  --hood: oklch(0.22 0.012 265);
  --hood-2: oklch(0.30 0.014 265);
  --hood-line: oklch(0.42 0.016 265);
  --ink: oklch(0.19 0.015 265);
  --ink-2: oklch(0.38 0.02 262);
  --fur: oklch(0.81 0.135 76);
  --fur-deep: oklch(0.68 0.15 62);
  --toy: oklch(0.57 0.21 27);
  --g-x: oklch(0.72 0.12 250);
  --g-o: oklch(0.68 0.19 25);
  --g-t: oklch(0.76 0.13 165);
  --g-s: oklch(0.74 0.13 350);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);        /* ease-out-quint */
  --ease-q: cubic-bezier(0.25, 1, 0.5, 1);       /* ease-out-quart */
  --hud-h: 64px;
  --gut: clamp(16px, 4vw, 56px);
  --f: "Archivo", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--snow); color: var(--ink);
  font-family: var(--f); font-size: 17px; line-height: 1.5; font-stretch: 100%;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--fur); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ── type ── */
h1, h2 { margin: 0; }
h2 {
  font-weight: 900; font-style: italic; font-stretch: 125%;
  font-size: clamp(38px, 6.4vw, 92px); line-height: 0.92; letter-spacing: -0.015em;
}
.lede { margin: 14px 0 0; font-size: clamp(18px, 1.6vw, 22px); color: var(--ink-2); font-weight: 500; }
.fine { margin: 12px 0 0; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.chrome-k {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px;
  padding: 7px 12px 6px; background: var(--hood); color: var(--snow); border-radius: 2px;
  font-size: 12px; font-weight: 800; font-stretch: 125%; letter-spacing: 0.16em;
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.1), 0 2px 0 oklch(0.1 0.01 265 / 0.35);
}
.chrome-k::before { content: ""; width: 8px; height: 8px; background: var(--fur); }

/* ── buttons & glyphs ── */
.glyph { width: 22px; height: 22px; flex: none; }
.glyph-x { color: var(--g-x); } .glyph-o { color: var(--g-o); }
.btn {
  --bg: var(--hood); --fg: var(--snow); --edge: oklch(0.12 0.01 265);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 20px 0 12px; border: 0; border-radius: 3px;
  background: var(--bg); color: var(--fg); text-decoration: none;
  font-weight: 800; font-stretch: 112%; font-size: 17px; letter-spacing: 0.01em;
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.28), inset 0 -2px 0 oklch(0 0 0 / 0.16), 0 4px 0 var(--edge);
  transform: translateY(0); transition: transform 0.12s var(--ease-q), box-shadow 0.12s var(--ease-q), filter 0.2s;
}
.btn .glyph { width: 26px; height: 26px; padding: 3px; border-radius: 50%; background: var(--hood); box-shadow: inset 0 0 0 1.5px oklch(1 0 0 / 0.14); }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.2), 0 1px 0 var(--edge); }
.btn[aria-disabled="true"], .btn:disabled { filter: saturate(0.35) brightness(0.92); cursor: not-allowed; }
.btn[aria-disabled="true"]:active, .btn:disabled:active { transform: none; box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.28), inset 0 -2px 0 oklch(0 0 0 / 0.16), 0 4px 0 var(--edge); }
.btn-gold { --bg: var(--fur); --fg: var(--ink); --edge: var(--fur-deep); }
.btn-dark { --bg: var(--hood-2); }
.btn-big { width: 100%; min-height: 58px; font-size: 21px; font-style: italic; font-weight: 900; font-stretch: 125%; }

/* ── PS2 window ── */
.win {
  position: relative; background: oklch(0.22 0.012 265 / 0.94); color: var(--snow);
  border-radius: 3px; padding: 18px;
  box-shadow: inset 0 0 0 1px var(--hood-line), inset 0 1px 0 1px oklch(1 0 0 / 0.07), 0 18px 50px oklch(0.25 0.05 260 / 0.28);
}
.win::after { content: ""; position: absolute; inset: 5px; border: 1px solid oklch(0.85 0.07 240 / 0.16); border-radius: 2px; pointer-events: none; }
.win-k {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
  font-size: 12px; font-weight: 800; font-stretch: 125%; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ice);
}
.win-k span { padding: 2px 6px; background: var(--fur); color: var(--ink); border-radius: 2px; letter-spacing: 0.06em; }

/* window-open reveal, once: the box opens from a sliver, like a PS2 menu window
   (transform, not clip-path: a zero-area clip makes IntersectionObserver report 0 and it never opens) */
.reveal { transform: scaleY(0.06); opacity: 0; transform-origin: 50% 50%; transition: transform 0.45s var(--ease), opacity 0.25s linear; }
.reveal.is-in { transform: none; opacity: 1; }

/* ── HUD ── */
.hud {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--hud-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 var(--gut); padding-top: env(safe-area-inset-top);
  transition: background 0.3s, box-shadow 0.3s;
}
.hud.is-solid { background: oklch(0.22 0.012 265 / 0.92); box-shadow: 0 1px 0 var(--hood-line), 0 8px 30px oklch(0.2 0.03 260 / 0.25); backdrop-filter: blur(10px); }
.hud-logo { opacity: 0; transform: translateY(-6px); transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); pointer-events: none; }
.hud.is-solid .hud-logo { opacity: 1; transform: none; pointer-events: auto; }
.hud-logo img { height: 30px; width: auto; }
.hud-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.hud-ca, .ending-ca {
  display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px 0 6px;
  border: 0; border-radius: 3px; background: oklch(0.22 0.012 265 / 0.86); color: var(--snow);
  box-shadow: inset 0 0 0 1px var(--hood-line); font-weight: 700; font-size: 14px; max-width: 46vw;
}
.hud-ca-k { padding: 4px 6px 3px; border-radius: 2px; background: var(--fur); color: var(--ink); font-size: 11px; font-weight: 900; letter-spacing: 0.08em; font-stretch: 125%; }
.hud-ca-v, #ca2-v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hud-sound { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 3px; background: oklch(0.22 0.012 265 / 0.86); color: var(--snow); box-shadow: inset 0 0 0 1px var(--hood-line); }
.hud-sound svg { width: 22px; height: 22px; }
.hud-sound .sound-on { display: none; }
.hud-sound[aria-pressed="true"] .sound-on { display: inline; }
.hud-sound[aria-pressed="true"] .sound-off { display: none; }
.hud-buy { min-height: 42px; padding-right: 16px; }
.hud-buy .glyph { width: 24px; height: 24px; }

/* ── TITLE SCREEN ── */
.title { position: relative; height: 100svh; min-height: 560px; overflow: hidden; background: var(--sky); isolation: isolate; }
.title-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; z-index: -2; }
.title-shade { position: absolute; inset: 0; z-index: -1; background:
  linear-gradient(180deg, oklch(0.55 0.13 255 / 0.32) 0%, transparent 24%, transparent 58%, oklch(0.18 0.02 262 / 0.62) 100%); }
.title-stack {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: calc(var(--hud-h) + 1vh) var(--gut) calc(64px + env(safe-area-inset-bottom));
}
.title-logo { width: min(980px, 92vw); filter: drop-shadow(0 10px 18px oklch(0.25 0.08 260 / 0.35)); animation: logo-in 0.9s var(--ease) both 0.15s; }
.title-logo img { width: 100%; height: auto; }
@keyframes logo-in { from { opacity: 0; transform: translateY(-18px) scale(0.96); } to { opacity: 1; transform: none; } }

.press-start {
  border: 0; background: none; padding: 14px 26px;
  font-size: clamp(22px, 2.6vw, 34px); font-weight: 900; font-style: italic; font-stretch: 125%; letter-spacing: 0.06em;
  color: var(--snow); text-shadow: 0 3px 0 var(--hood), 0 0 1px var(--hood), 2px 0 0 var(--hood), -2px 0 0 var(--hood);
}
.press-start span { animation: blink 1.1s steps(2, jump-none) infinite; }
@keyframes blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0.12; } }

.menu { width: min(560px, 100%); animation: menu-in 0.45s var(--ease) both; }
@keyframes menu-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.menu ul { margin: 0; padding: 14px 0; list-style: none;
  background: linear-gradient(90deg, transparent, oklch(0.2 0.012 265 / 0.86) 18%, oklch(0.2 0.012 265 / 0.86) 82%, transparent); }
.menu li { animation: item-in 0.38s var(--ease-q) both; }
.menu li:nth-child(2) { animation-delay: 0.04s; } .menu li:nth-child(3) { animation-delay: 0.08s; }
.menu li:nth-child(4) { animation-delay: 0.12s; } .menu li:nth-child(5) { animation-delay: 0.16s; }
@keyframes item-in { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.menu a {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 7px 24px; text-decoration: none; color: var(--snow);
  font-size: clamp(22px, 2.4vw, 30px); font-weight: 900; font-style: italic; font-stretch: 125%; letter-spacing: -0.005em;
}
.menu a .cur { width: 0; height: 0; border-left: 13px solid var(--fur); border-top: 9px solid transparent; border-bottom: 9px solid transparent; opacity: 0; }
.menu a.is-sel { color: var(--fur); }
.menu a.is-sel .cur { opacity: 1; animation: nudge 0.6s var(--ease-q) infinite alternate; }
@keyframes nudge { to { transform: translateX(4px); } }
.menu-hint { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 10px 0 0; color: var(--snow);
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; text-shadow: 0 1px 0 var(--hood); }
.menu-hint .glyph { width: 20px; height: 20px; padding: 2px; border-radius: 50%; background: var(--hood); margin-left: 8px; }
.title-legal { position: absolute; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom)); margin: 0; text-align: center;
  font-size: 12px; font-weight: 600; letter-spacing: 0.1em; color: oklch(0.95 0.02 240 / 0.8); }

/* ── STORY ── */
.story { position: relative; height: 420vh; background: var(--night); }
.story-pin { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.story-scenes .scene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06);
  transition: opacity 0.9s var(--ease), transform 9s linear; }
.story-scenes .scene.is-on { opacity: 1; transform: scale(1.12); }
.bars i { position: absolute; left: 0; right: 0; height: 0; background: var(--night); z-index: 2; transition: height 0.7s var(--ease); }
.bars i:first-child { top: 0; } .bars i:last-child { bottom: 0; }
.story.is-live .bars i { height: 7.5vh; }
.dialog {
  position: absolute; z-index: 3; left: 50%; bottom: calc(7.5vh + 22px); transform: translateX(-50%);
  width: min(1000px, calc(100vw - 2 * var(--gut))); display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center;
  padding: 16px 22px 16px 16px; border-radius: 4px; color: var(--snow);
  background: linear-gradient(180deg, oklch(0.26 0.04 262 / 0.95), oklch(0.18 0.03 262 / 0.95));
  box-shadow: inset 0 0 0 2px oklch(0.85 0.07 240 / 0.55), inset 0 0 0 5px oklch(0.2 0.03 262 / 0.9), inset 0 0 0 6px oklch(0.85 0.07 240 / 0.2), 0 20px 50px oklch(0.1 0.03 262 / 0.5);
}
.dialog-face { width: clamp(76px, 10vw, 124px); aspect-ratio: 1; border-radius: 3px; overflow: hidden; box-shadow: inset 0 0 0 2px var(--ice); background: var(--sky); }
.dialog-face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transform: scale(1.5); transform-origin: 50% 36%; }
.dialog-body { position: relative; min-height: clamp(76px, 10vw, 124px); display: flex; flex-direction: column; justify-content: center; }
.dialog-name { margin: 0 0 6px; color: var(--fur); font-size: 13px; font-weight: 900; font-stretch: 125%; letter-spacing: 0.14em; text-transform: uppercase; }
.dialog-line { margin: 0; min-height: 1.2em; font-size: clamp(22px, 3.1vw, 42px); line-height: 1.12; font-weight: 800; font-stretch: 108%; letter-spacing: -0.01em; }
.dialog-next { position: absolute; right: 0; bottom: 0; width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 11px solid var(--fur); opacity: 0; }
.dialog.is-done .dialog-next { opacity: 1; animation: bob 0.7s var(--ease-q) infinite alternate; }
@keyframes bob { to { transform: translateY(4px); } }
.dialog-beats { position: absolute; right: 14px; top: -16px; display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.dialog-beats li { width: 22px; height: 6px; border-radius: 1px; background: oklch(0.85 0.07 240 / 0.3); transition: background 0.3s; }
.dialog-beats li.is-on { background: var(--fur); }

/* ── CREATE CHARACTER ── */
.create { position: relative; padding: clamp(84px, 11vw, 150px) var(--gut) clamp(80px, 10vw, 140px);
  background: linear-gradient(180deg, var(--frost) 0%, var(--snow) 46%, var(--frost) 100%); }
.create-head { max-width: 1240px; margin: 0 auto clamp(32px, 4vw, 56px); }
.create-grid { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 560px) minmax(240px, 280px); gap: clamp(18px, 2.4vw, 34px); justify-content: center; align-items: start; }
.slot { position: relative; display: grid; place-items: center; aspect-ratio: 1; margin-bottom: 16px; border-radius: 3px; cursor: pointer; overflow: hidden;
  background: repeating-linear-gradient(135deg, oklch(0.26 0.014 265), oklch(0.26 0.014 265) 10px, oklch(0.24 0.013 265) 10px, oklch(0.24 0.013 265) 20px);
  box-shadow: inset 0 0 0 1px var(--hood-line); transition: box-shadow 0.2s; }
.slot:hover, .slot.is-over { box-shadow: inset 0 0 0 2px var(--fur); }
.slot-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot-empty { display: grid; justify-items: center; gap: 12px; text-align: center; color: var(--ice); font-weight: 700; font-size: 15px; line-height: 1.3; padding: 18px; }
.slot-empty svg { width: 46px; height: 46px; color: var(--fur); }
.slot-win .fine { color: oklch(0.8 0.03 245); text-align: center; }

.frame-wrap { display: grid; gap: 14px; }
.frame { position: relative; aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: var(--sky);
  box-shadow: 0 0 0 10px var(--hood), 0 0 0 12px var(--hood-line), 0 0 0 13px oklch(0.85 0.07 240 / 0.6), 0 26px 60px oklch(0.3 0.06 258 / 0.35); }
.frame-demo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.5s var(--ease); }
.frame-demo img.is-on { opacity: 1; }
.frame-result { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.loading { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 16px; padding: 24px;
  background: oklch(0.17 0.03 262 / 0.9); color: var(--snow); text-align: center; }
.loading-k { margin: 0; font-size: clamp(22px, 3vw, 34px); font-weight: 900; font-style: italic; font-stretch: 125%; letter-spacing: 0.04em; }
.loading-k::after { content: ""; display: inline-block; width: 1.4em; text-align: left; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.loading-bar { width: min(340px, 80%); height: 18px; padding: 3px; border-radius: 2px; background: var(--night); box-shadow: inset 0 0 0 1px var(--hood-line); }
.loading-bar i { display: block; height: 100%; width: 0%; border-radius: 1px;
  background: repeating-linear-gradient(90deg, var(--fur) 0 14px, transparent 14px 17px); transition: width 0.4s linear; }
.loading-tip { margin: 0; min-height: 1.4em; font-size: 15px; font-weight: 700; color: var(--ice); }
.flash { position: absolute; inset: 0; background: var(--snow); opacity: 0; pointer-events: none; }
.flash.is-on { animation: flash 0.7s var(--ease) both; }
@keyframes flash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
.frame-status { margin: 4px 0 0; min-height: 1.5em; text-align: center; font-weight: 900; font-style: italic; font-stretch: 125%; font-size: clamp(20px, 2.2vw, 28px); color: var(--ink); }
.frame-status.is-err { color: var(--toy); font-size: 18px; font-style: normal; font-stretch: 100%; font-weight: 800; }
.frame-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

.stats { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.stats li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "n v" "b b"; gap: 6px 10px; align-items: end; }
.stats span { grid-area: n; font-size: 13px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ice); font-stretch: 112%; }
.stats em { grid-area: v; font-style: normal; text-align: right; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--snow); }
.stats b { grid-area: b; display: block; height: 14px; padding: 2px; border-radius: 2px; background: var(--night); box-shadow: inset 0 0 0 1px var(--hood-line); }
.stats b i { display: block; height: 100%; width: calc(var(--v) * 100%); border-radius: 1px;
  background: repeating-linear-gradient(90deg, var(--g-t) 0 9px, transparent 9px 11px); transition: width 0.12s linear; }
.stats li.neg b i { background: repeating-linear-gradient(90deg, var(--g-o) 0 9px, transparent 9px 11px); }

/* ── SIDE QUEST ── */
.quest { position: relative; min-height: 100svh; display: flex; align-items: center; padding: clamp(90px, 10vw, 140px) var(--gut); overflow: hidden; background: var(--night); isolation: isolate; }
.quest-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; z-index: -2; }
.quest-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, oklch(0.15 0.03 262 / 0.9) 0%, oklch(0.15 0.03 262 / 0.6) 38%, transparent 70%); }
.quest-win { width: min(600px, 100%); padding: clamp(22px, 3vw, 34px); }
.quest-k { background: oklch(0.3 0.014 265); }
.quest-k::before { display: none; }
.quest-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--g-t); box-shadow: 0 0 0 3px oklch(0.76 0.13 165 / 0.25); }
.quest-win h2 { font-size: clamp(34px, 4.6vw, 64px); color: var(--snow); margin-bottom: 18px; }
.quest-line { margin: 0 0 6px; font-size: clamp(17px, 1.5vw, 20px); font-weight: 600; color: oklch(0.92 0.025 240); }
.quest-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0 14px; }
.quest-nums div { padding: 14px 16px; border-radius: 3px; background: var(--night); box-shadow: inset 0 0 0 1px var(--hood-line); }
.quest-nums b { display: block; font-size: clamp(34px, 4vw, 52px); line-height: 1; font-weight: 900; font-stretch: 112%; color: var(--fur); font-variant-numeric: tabular-nums; }
.quest-nums span { display: block; margin-top: 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ice); }
.receipts { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; max-height: 210px; overflow: auto; }
.receipts li a { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 2px; background: oklch(0.26 0.014 265); text-decoration: none; font-size: 14px; font-weight: 700; }
.receipts li a:hover { background: oklch(0.3 0.016 265); }
.receipts .r-sol { color: var(--fur); font-variant-numeric: tabular-nums; }
.receipts .r-tx { color: var(--ice); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.receipts .r-at { color: oklch(0.75 0.03 245); font-weight: 600; }
.receipts-empty { margin: 0; padding: 12px 14px; border-radius: 2px; background: oklch(0.26 0.014 265); color: var(--ice); font-size: 14px; font-weight: 600; }
.t4t { display: inline-flex; align-items: center; gap: 14px; margin-top: 22px; text-decoration: none; font-weight: 800; font-size: 15px; color: var(--snow); }
.t4t img { width: 96px; height: 96px; border-radius: 3px; background: var(--snow); object-fit: contain; box-shadow: 0 0 0 1px var(--hood-line); }
.t4t span { border-bottom: 2px solid var(--fur); }
.quest-win .fine { color: oklch(0.78 0.03 245); }

/* ── MEMORY CARD ── */
.wall { position: relative; padding: clamp(84px, 11vw, 150px) var(--gut); color: var(--snow);
  background: radial-gradient(120% 70% at 50% 0%, oklch(0.36 0.09 258) 0%, var(--navy) 46%, var(--night) 100%); }
.wall-head { max-width: 1240px; margin: 0 auto clamp(30px, 4vw, 54px); }
.wall-head .chrome-k { background: oklch(0.3 0.04 262); }
.saves { max-width: 1240px; margin: 0 auto; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: clamp(16px, 2vw, 26px); perspective: 900px; }
.save { display: grid; gap: 10px; width: 100%; padding: 0; border: 0; background: none; text-align: left; text-decoration: none; color: var(--ice); transform-style: preserve-3d; }
.save img, .save-plus { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 3px;
  box-shadow: 0 0 0 2px oklch(0.85 0.07 240 / 0.35), 0 14px 30px oklch(0.08 0.03 262 / 0.6); transition: transform 0.45s var(--ease), box-shadow 0.3s; }
.save > span:last-child { font-size: 13px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.save:hover img, .save:focus-visible img { transform: translateY(-6px) rotateY(18deg); box-shadow: 0 0 0 2px var(--fur), 0 24px 40px oklch(0.08 0.03 262 / 0.7); }
.save:hover > span:last-child, .save:focus-visible > span:last-child { color: var(--fur); }
.save-plus { display: grid; place-items: center; background: oklch(0.26 0.04 262); position: relative; }
.save-plus::before, .save-plus::after { content: ""; position: absolute; background: var(--fur); }
.save-plus::before { width: 34%; height: 6px; } .save-plus::after { width: 6px; height: 34%; }
.save-new:hover .save-plus { transform: translateY(-6px); box-shadow: 0 0 0 2px var(--fur), 0 24px 40px oklch(0.08 0.03 262 / 0.7); }

/* ── ENDING ── */
.ending { position: relative; min-height: 100svh; display: grid; place-items: center; padding: clamp(90px, 10vw, 140px) var(--gut); overflow: hidden; isolation: isolate; background: var(--sky); text-align: center; }
.ending-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; z-index: -2; }
.ending-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, oklch(0.2 0.03 262 / 0.15) 0%, oklch(0.18 0.03 262 / 0.55) 55%, oklch(0.16 0.03 262 / 0.9) 100%); }
.credits { display: grid; justify-items: center; gap: 22px; color: var(--snow); align-self: end; }
.credits h2 { font-size: clamp(76px, 15vw, 220px); line-height: 0.85; text-shadow: 0 6px 0 var(--hood), 0 20px 40px oklch(0.1 0.03 262 / 0.6); }
.ending-ca { height: 48px; font-size: 16px; max-width: 92vw; }
.ending-links { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.credits .fine { color: oklch(0.9 0.02 240 / 0.85); max-width: 60ch; }

.screen-flash { position: fixed; inset: 0; z-index: 70; background: var(--snow); pointer-events: none; animation: flash 0.6s var(--ease) both; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60; transform: translateX(-50%);
  padding: 12px 18px; border-radius: 3px; background: var(--hood); color: var(--snow); font-weight: 800; box-shadow: inset 0 0 0 1px var(--hood-line), 0 10px 30px oklch(0.15 0.02 262 / 0.4);
  animation: toast-in 0.3s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ── responsive ── */
@media (max-width: 1080px) {
  .create-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .frame-wrap { grid-column: 1 / -1; order: -1; max-width: 560px; justify-self: center; width: 100%; }
}
@media (max-width: 760px) {
  :root { --hud-h: 58px; }
  .hud-sound { display: none; }
  .hud-ca { max-width: 40vw; height: 38px; font-size: 13px; }
  .hud-buy { min-height: 38px; }
  .title-video { object-position: 50% 70%; }
  .title-stack { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .create-grid { grid-template-columns: 1fr; }
  .frame { box-shadow: 0 0 0 7px var(--hood), 0 0 0 9px var(--hood-line), 0 0 0 10px oklch(0.85 0.07 240 / 0.6), 0 20px 40px oklch(0.3 0.06 258 / 0.3); }
  .stats-win { display: none; }
  .dialog { grid-template-columns: 1fr; gap: 10px; padding: 14px 16px 18px; }
  .dialog-face { display: none; }
  .dialog-body { min-height: 96px; }
  .quest { align-items: end; }
  .quest-shade { background: linear-gradient(180deg, transparent 0%, oklch(0.15 0.03 262 / 0.75) 34%, oklch(0.15 0.03 262 / 0.95) 100%); }
  .quest-bg { object-position: 30% 50%; height: 62%; }
  .story-scenes .sc-grind { object-position: 78% 50%; }
  .story-scenes .sc-tree { object-position: 72% 50%; }
  .saves { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .save > span:last-child { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .press-start span { opacity: 1; }
  .reveal { clip-path: none; opacity: 1; }
  .story-scenes .scene.is-on { transform: none; }
}
