/* ==========================================================================
   VCT Krillion — play & guide
   Pixel-HUD design system: deep navy, VCT red, scoreboard cyan.
   ========================================================================== */

:root {
  --bg: #070c18;
  --bg-2: #0b1222;
  --panel: #0f182b;
  --panel-2: #142039;
  --panel-3: #1a2846;
  --line: #1f2d4a;
  --line-2: #2c3e63;
  --text: #e9eef8;
  --muted: #9aa8c4;
  --dim: #5f6f90;

  --red: #ff4655;
  --red-2: #ff6b78;
  --red-deep: #8a1f2b;
  --cyan: #5ad7ea;
  --teal: #3fd6a8;
  --gold: #f4c452;
  --violet: #b892ff;
  --orange: #ff9f4a;
  --pink: #ff7ac6;

  --rank-miss: #3a4766;
  --rank-iron: #8f9bb3;
  --rank-gold: #f4c452;
  --rank-diamond: #c08cff;
  --rank-immortal: #ff4d6d;
  --rank-radiant: #fff1a6;

  --font-pixel: 'Silkscreen', ui-monospace, monospace;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --side-w: 264px;
  --radius: 4px;
  --notch: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #9ae9f5; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
::selection { background: var(--red); color: #fff; }
code { font: 500 .88em var(--font-mono); background: var(--panel-2); padding: .1em .4em; border-radius: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 300; background: var(--red); color: #fff; padding: 10px 14px; font: 700 13px var(--font-mono); text-decoration: none; transition: top .2s; }
.skip:focus { top: 12px; }

/* ---------- background --------------------------------------------------- */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg__grid {
  position: absolute; inset: -2px;
  background-image:
    linear-gradient(rgba(90, 215, 234, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 215, 234, .045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 70% at 60% 0%, #000 30%, transparent 80%);
}
.bg__glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(600px 380px at 85% -5%, rgba(255, 70, 85, .16), transparent 70%),
    radial-gradient(700px 460px at 20% 10%, rgba(90, 215, 234, .08), transparent 70%),
    radial-gradient(900px 600px at 50% 110%, rgba(63, 214, 168, .06), transparent 70%);
}
.bg__scan {
  position: absolute; inset: 0; opacity: .35;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .18) 0 1px, transparent 1px 3px);
}

/* ---------- krill mascot ------------------------------------------------- */
.krill { image-rendering: pixelated; height: auto; }
.float { animation: float 3.2s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- shell -------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.main { padding: 28px clamp(20px, 3.2vw, 48px) 0; max-width: 1180px; width: 100%; outline: none; }

.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 18px;
  padding: 24px 18px 22px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 24, 43, .92), rgba(7, 12, 24, .92));
  backdrop-filter: blur(8px);
  scrollbar-width: thin;
}
.side::after { content: ''; position: absolute; top: 0; right: -1px; width: 1px; height: 100%; background: linear-gradient(180deg, var(--red), transparent 40%); opacity: .7; }

.brand { display: grid; grid-template-columns: 54px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-decoration: none; color: var(--text); padding: 4px 4px 14px; border-bottom: 1px dashed var(--line-2); }
.brand__krill { grid-row: span 2; width: 54px; filter: drop-shadow(0 4px 10px rgba(255, 70, 85, .35)); }
.brand__name { font: 700 19px/1.02 var(--font-pixel); letter-spacing: .02em; }
.brand__sub { font: 400 11px var(--font-pixel); color: var(--red); letter-spacing: .14em; text-transform: uppercase; }

.nav { display: grid; gap: 8px; }
.nav__item {
  --n: 10px;
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  font: 400 13px var(--font-pixel); letter-spacing: .08em; text-transform: uppercase;
  color: var(--text); text-decoration: none;
  background: var(--panel);
  border: 1px solid var(--line-2);
  clip-path: polygon(0 0, calc(100% - var(--n)) 0, 100% var(--n), 100% 100%, 0 100%);
  transition: background .18s, border-color .18s, transform .18s var(--ease), color .18s;
}
.nav__item:hover { background: var(--panel-3); border-color: var(--cyan); color: #fff; transform: translateX(3px); }
.nav__item.is-active { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 8px 24px -8px rgba(255, 70, 85, .7); }
.nav__item.is-active::before { content: ''; position: absolute; left: -18px; top: 50%; width: 6px; height: 6px; background: var(--red); transform: translateY(-50%); }
.nav__glyph { width: 16px; text-align: center; font-family: var(--font-mono); font-size: 14px; }

.dots { display: flex; gap: 8px; justify-content: center; padding: 2px 0; }
.dots i { width: 6px; height: 6px; background: var(--gold); opacity: .8; animation: blink 2.4s infinite; }
.dots i:nth-child(2n) { animation-delay: .3s; }
.dots i:nth-child(3n) { animation-delay: .6s; background: var(--red); }
@keyframes blink { 0%, 100% { opacity: .85; } 50% { opacity: .25; } }

.clock { margin-top: auto; padding: 14px; border: 1px solid var(--line-2); background: repeating-linear-gradient(135deg, rgba(90, 215, 234, .05) 0 6px, transparent 6px 12px), var(--panel); position: relative; }
.clock::before, .clock::after { content: ''; position: absolute; width: 10px; height: 10px; border-color: var(--cyan); border-style: solid; }
.clock::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.clock::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.clock__label { margin: 0; font: 600 10px var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.clock__time { margin: 2px 0 4px; font: 700 28px/1.1 var(--font-pixel); color: var(--cyan); letter-spacing: .04em; font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgba(90, 215, 234, .35); }
.clock__meta { margin: 0; font: 500 11px var(--font-mono); color: var(--dim); }
.side__ext { font: 600 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-decoration: none; text-align: center; padding: 6px; }
.side__ext:hover { color: var(--red-2); }

.topbar { display: none; }
.scrim { display: none; }

/* ---------- buttons ------------------------------------------------------ */
.btn {
  --n: 8px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px;
  font: 700 12px var(--font-mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--text); text-decoration: none; cursor: pointer;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  clip-path: polygon(0 0, calc(100% - var(--n)) 0, 100% var(--n), 100% 100%, var(--n) 100%, 0 calc(100% - var(--n)));
  transition: background .16s, border-color .16s, transform .16s var(--ease), color .16s;
}
.btn:hover { background: var(--panel-3); border-color: var(--cyan); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-2); border-color: var(--red-2); }
.btn--danger { background: transparent; border-color: var(--red); color: var(--red-2); }
.btn--danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn--ghost { background: transparent; }
.btn--sm { padding: 8px 12px; font-size: 11px; }
.linkish { background: none; border: 0; padding: 0; color: var(--cyan); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font: inherit; }
.linkish:hover { color: #fff; }
kbd { font: 600 10px var(--font-mono); padding: 2px 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 3px; color: var(--muted); background: var(--bg-2); }

/* ---------- typography bits ---------------------------------------------- */
.kicker { margin: 0 0 8px; font: 700 11px var(--font-mono); letter-spacing: .22em; text-transform: uppercase; color: var(--red-2); display: flex; align-items: center; gap: 10px; }
.kicker::before { content: ''; width: 18px; height: 2px; background: currentColor; }
.lead { font-size: clamp(16px, 1.4vw, 18px); color: var(--muted); max-width: 64ch; margin-top: 14px; }
.fine { font-size: 13px; color: var(--dim); margin-top: 14px; }
.fine a { color: var(--muted); }
.sep { color: var(--dim); margin: 0 4px; }
.tag { display: inline-block; padding: 2px 8px; font: 700 10px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; background: var(--panel-3); border: 1px solid var(--line-2); color: var(--muted); vertical-align: middle; }
.tag--live { background: rgba(63, 214, 168, .12); border-color: rgba(63, 214, 168, .45); color: var(--teal); }

/* ---------- hero (home) -------------------------------------------------- */
.hero {
  position: relative; text-align: center;
  padding: 30px 24px 26px;
  border: 1px solid var(--line-2);
  background:
    linear-gradient(180deg, rgba(255, 70, 85, .08), transparent 60%),
    var(--panel);
  outline: 1px solid rgba(244, 196, 82, .35); outline-offset: 5px;
}
.hero__ticks { display: flex; gap: 12px; justify-content: center; margin-bottom: 14px; }
.hero__ticks i { width: 6px; height: 6px; background: var(--gold); }
.hero__title { font: 700 clamp(38px, 6.4vw, 76px)/1 var(--font-pixel); letter-spacing: .03em; }
.glitch { position: relative; display: inline-block; color: #f4f7ff; text-shadow: 0 4px 0 var(--red-deep), 0 0 40px rgba(255, 70, 85, .25); }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.glitch::before { color: var(--cyan); transform: translate(-2px, 0); clip-path: inset(10% 0 60% 0); }
.glitch::after { color: var(--red); transform: translate(2px, 0); clip-path: inset(55% 0 15% 0); }
.hero:hover .glitch::before, .hero:hover .glitch::after { animation: glitch .9s steps(2) 1; }
@keyframes glitch { 0% { opacity: .9; } 30% { transform: translate(3px, -1px); } 60% { transform: translate(-3px, 1px); } 100% { opacity: 0; } }
.hero__sub { margin: 14px 0 18px; font: 700 13px var(--font-mono); letter-spacing: .3em; text-transform: uppercase; color: var(--cyan); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chips li { padding: 6px 12px; font: 500 12px var(--font-mono); color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); }
.chips b { color: var(--text); font-weight: 700; }
.chips__live { display: inline-flex; align-items: center; gap: 8px; border-color: rgba(63, 214, 168, .4) !important; }
.chips__live i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 0 rgba(63, 214, 168, .6); animation: ping 2s infinite; }
.chips__live b { font-variant-numeric: tabular-nums; color: var(--teal); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(63, 214, 168, .6); } 80%, 100% { box-shadow: 0 0 0 8px rgba(63, 214, 168, 0); } }

/* ---------- play zone ---------------------------------------------------- */
.play { margin-top: 28px; padding: 14px; background: linear-gradient(180deg, #16233f, #0f182b); border: 1px solid var(--line-2); box-shadow: var(--shadow); position: relative; }
.play::before, .play::after { content: ''; position: absolute; width: 18px; height: 18px; border: 2px solid var(--red); pointer-events: none; }
.play::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.play::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }
.play__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 4px 12px; font: 500 13px var(--font-mono); color: var(--muted); }
.play__bar p { margin: 0; }
.play__bar a { color: var(--text); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; font: 700 10px var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-2); background: var(--bg-2); white-space: nowrap; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.pill[data-state="loading"] i { background: var(--gold); animation: blink .8s infinite; }
.pill[data-state="playing"] { color: var(--teal); border-color: rgba(63, 214, 168, .45); }
.pill[data-state="playing"] i { background: var(--teal); animation: ping 2s infinite; }
.pill[data-state="popup"] { color: var(--cyan); border-color: rgba(90, 215, 234, .45); }
.pill[data-state="popup"] i { background: var(--cyan); }

.stage {
  position: relative; overflow: hidden; isolation: isolate;
  height: clamp(560px, 76vh, 820px);
  background: #0b1120;
  border: 1px solid #070b14;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03);
}
.stage__poster, .stage__loading, .stage__frame, .stage__popup { position: absolute; inset: 0; }
.stage__top { display: none; }

/* poster */
.stage__poster { display: grid; place-items: center; overflow: hidden; background: radial-gradient(ellipse 80% 60% at 50% 30%, #13213d, #0a1020 70%); transition: opacity .45s var(--ease), transform .6s var(--ease); }
.sky, .sky i { position: absolute; inset: 0; }
.sky__stars { background-image:
  radial-gradient(1.5px 1.5px at 12% 18%, #fff 50%, transparent 51%),
  radial-gradient(1px 1px at 28% 42%, #cfe 50%, transparent 51%),
  radial-gradient(1.5px 1.5px at 44% 12%, #fff 50%, transparent 51%),
  radial-gradient(1px 1px at 63% 30%, #9be 50%, transparent 51%),
  radial-gradient(2px 2px at 78% 16%, #ff8a95 50%, transparent 51%),
  radial-gradient(1px 1px at 88% 40%, #fff 50%, transparent 51%),
  radial-gradient(1.5px 1.5px at 6% 52%, #5ad7ea 50%, transparent 51%),
  radial-gradient(1px 1px at 52% 54%, #fff 50%, transparent 51%),
  radial-gradient(1px 1px at 35% 6%, #fff 50%, transparent 51%);
  opacity: .7; animation: twinkle 5s ease-in-out infinite; }
.sky__stars--2 { transform: scale(-1, 1) translateY(4%); animation-delay: -2.5s; opacity: .45; }
@keyframes twinkle { 50% { opacity: .25; } }
.sky__beam { background: repeating-linear-gradient(135deg, rgba(90, 215, 234, .06) 0 14px, transparent 14px 28px); width: 34%; height: 9%; inset: 9% auto auto 62% !important; }
.sky__beam::after { content: ''; position: absolute; left: -110%; top: 360%; width: 70%; height: 100%; background: inherit; }

.terrain { position: absolute; left: 0; right: 0; bottom: 34px; width: 100%; height: 28%; }
.terrain__back { fill: #0f2234; }
.terrain__front { fill: #12332e; }
.terrain__edge { fill: none; stroke: var(--teal); stroke-width: 2; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 6px rgba(63, 214, 168, .5)); }

.poster__hero { position: relative; z-index: 2; display: grid; justify-items: center; text-align: center; padding: 0 20px 60px; }
.poster__krill { width: clamp(84px, 11vw, 120px); margin-bottom: 18px; filter: drop-shadow(0 10px 24px rgba(255, 70, 85, .45)); }
.poster__kicker { margin: 0; font: 700 12px var(--font-mono); letter-spacing: .32em; text-transform: uppercase; color: var(--cyan); }
.poster__title { margin: 8px 0 6px; font: 700 clamp(34px, 5.4vw, 64px)/1 var(--font-pixel); color: #f4f7ff; text-shadow: 0 4px 0 var(--red-deep); }
.poster__lead { margin: 0 0 26px; color: var(--muted); font: 500 14px var(--font-mono); }
.queue {
  --n: 14px;
  position: relative;
  display: inline-flex; align-items: center; gap: 18px;
  min-width: min(420px, 82vw); justify-content: center;
  padding: 20px 34px;
  font: 700 clamp(18px, 2.2vw, 24px) var(--font-pixel); letter-spacing: .14em; text-transform: uppercase;
  color: #fff; cursor: pointer;
  background: linear-gradient(180deg, #182746, #0f1830);
  border: 2px solid var(--cyan);
  clip-path: polygon(0 0, calc(100% - var(--n)) 0, 100% var(--n), 100% 100%, var(--n) 100%, 0 calc(100% - var(--n)));
  box-shadow: inset 0 -4px 0 rgba(90, 215, 234, .25), 0 0 0 4px rgba(90, 215, 234, .12);
  transition: transform .18s var(--ease), background .18s, border-color .18s, box-shadow .18s;
}
.queue::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .18) 50%, transparent 70%); transform: translateX(-120%); animation: sheen 3.6s 1s infinite; }
@keyframes sheen { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.queue:hover { background: var(--red); border-color: var(--red-2); transform: translateY(-2px); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .2), 0 14px 40px -10px rgba(255, 70, 85, .8); }
.queue:active { transform: translateY(1px); }
.queue__tri { font-size: .8em; transition: transform .2s var(--ease); }
.queue:hover .queue__tri { transform: translateY(-3px); }
.poster__fine { margin: 16px 0 0; font: 500 12px var(--font-mono); color: var(--dim); }

.ticker { position: absolute; left: 0; right: 0; bottom: 0; height: 34px; overflow: hidden; border-top: 1px solid var(--line); background: rgba(7, 12, 24, .85); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker__track { display: flex; gap: 40px; width: max-content; height: 100%; align-items: center; animation: marquee 48s linear infinite; }
.ticker span { display: inline-flex; gap: 10px; font: 500 11px var(--font-mono); letter-spacing: .16em; color: var(--dim); white-space: nowrap; }
.ticker b { color: var(--muted); font-weight: 700; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* loading / frame / popup */
.stage__loading { display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; background: #0b1120; opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s; z-index: 3; }
.stage__loading .krill { width: 72px; }
.stage__loading p { margin: 0; font: 600 13px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.bar { width: 220px; height: 6px; background: var(--panel-3); overflow: hidden; }
.bar i { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, var(--red), var(--cyan)); animation: load 1.2s var(--ease) infinite; }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

.stage__frame { z-index: 1; }
.stage__frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #0b1120; }

.stage__popup { display: grid; place-content: center; justify-items: center; text-align: center; gap: 6px; padding: 24px; background: radial-gradient(ellipse at 50% 40%, #13213d, #0a1020 70%); opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s; z-index: 2; }
.stage__popup .krill { width: 84px; margin-bottom: 12px; }
.stage__popup-title { font: 700 clamp(18px, 2.4vw, 26px) var(--font-pixel); margin: 0 0 18px; }
.stage__popup-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.stage__fallback { position: absolute; z-index: 5; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; width: min(640px, calc(100% - 28px)); padding: 12px 14px; background: rgba(15, 24, 43, .96); border: 1px solid var(--gold); box-shadow: var(--shadow); font-size: 13px; animation: rise .4s var(--ease); }
.stage__fallback p { margin: 0; flex: 1 1 260px; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 12px); } }

.stage[data-state="loading"] .stage__poster,
.stage[data-state="playing"] .stage__poster,
.stage[data-state="popup"] .stage__poster { opacity: 0; transform: scale(1.04); pointer-events: none; visibility: hidden; }
.stage[data-state="loading"] .stage__loading { opacity: 1; visibility: visible; }
.stage[data-state="popup"] .stage__popup { opacity: 1; visibility: visible; }

.play__tools { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; }
.tool { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; font: 600 12px var(--font-mono); color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.tool:hover { color: #fff; border-color: var(--cyan); background: var(--panel-2); }
.tool[aria-pressed="true"] { color: #fff; border-color: var(--red); background: rgba(255, 70, 85, .12); }
.tool--end { margin-left: auto; }

/* focus mode: the stage itself goes fixed, so the iframe never reloads */
body.is-focus { overflow: hidden; }
body.is-focus .stage { position: fixed; inset: 0; z-index: 200; height: auto; border: 0; display: grid; grid-template-rows: 48px 1fr; }
body.is-focus .stage__top { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 16px; background: var(--panel); border-bottom: 1px solid var(--line-2); position: relative; z-index: 6; }
body.is-focus .stage__poster, body.is-focus .stage__loading, body.is-focus .stage__frame, body.is-focus .stage__popup { top: 48px; }
.stage__title { display: flex; align-items: center; gap: 10px; font: 700 14px var(--font-pixel); letter-spacing: .06em; }
.stage__title .krill { width: 30px; }
.stage__top-actions { display: flex; gap: 6px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); cursor: pointer; font-size: 16px; transition: border-color .15s, background .15s; }
.icon-btn:hover { border-color: var(--cyan); background: var(--panel-2); }
.icon-btn--exit:hover { border-color: var(--red); background: var(--red); }
.stage:fullscreen { height: 100%; }

/* ---------- blocks ------------------------------------------------------- */
.block { margin-top: 64px; }
.block__head { margin-bottom: 22px; }
.block h2 { font: 700 clamp(24px, 2.8vw, 34px)/1.1 var(--font-pixel); letter-spacing: .01em; }
.block h3 { font: 700 16px/1.3 var(--font-body); }
.prose { max-width: 72ch; color: #cfd7e8; }
.prose p { margin-bottom: 1.1em; }
.prose b, .prose em { color: var(--text); }

/* ---------- page header -------------------------------------------------- */
.page-head { padding: 26px 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 32px; }
.page-head__row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.page-title { font: 700 clamp(34px, 5vw, 60px)/1.02 var(--font-pixel); letter-spacing: .01em; text-shadow: 0 4px 0 var(--red-deep); }
.page-head__krill { width: clamp(90px, 12vw, 150px); flex: none; filter: drop-shadow(0 12px 30px rgba(255, 70, 85, .4)); }
.crumbs { display: flex; gap: 8px; margin-bottom: 18px; font: 500 12px var(--font-mono); color: var(--dim); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--cyan); }
.crumbs [aria-current] { color: var(--text); }

/* ---------- board / prompts ---------------------------------------------- */
.board { position: relative; border: 1px solid var(--line-2); background: var(--panel); }
.board__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); font: 500 13px var(--font-mono); color: var(--muted); flex-wrap: wrap; }
.board__head p { margin: 0; }
.board .prompts { transition: filter .45s var(--ease); }
.board.is-veiled .prompts { filter: blur(9px) saturate(.6); user-select: none; pointer-events: none; }
.board__veil { position: absolute; left: 0; right: 0; top: 56px; bottom: 0; display: none; place-content: center; text-align: center; gap: 6px; background: linear-gradient(180deg, rgba(15, 24, 43, .35), rgba(15, 24, 43, .75)); }
.board.is-veiled .board__veil { display: grid; }
.board__veil p { margin: 0; font: 700 18px var(--font-pixel); letter-spacing: .06em; }
.board__veil span { font: 500 13px var(--font-mono); color: var(--muted); }

.prompts { list-style: none; margin: 0; padding: 6px 0; counter-reset: p; }
.prompt { display: grid; grid-template-columns: 54px 1fr; gap: 6px; padding: 14px 18px; border-bottom: 1px dashed var(--line); transition: background .15s; }
.prompt:last-child { border-bottom: 0; }
.prompt:hover { background: rgba(90, 215, 234, .03); }
.prompt__n { font: 700 22px var(--font-pixel); color: var(--line-2); line-height: 1.2; }
.prompt__q { margin: 6px 0 2px; font: 600 16px/1.4 var(--font-body); }
.prompt__hint { margin: 0; font: 600 11px var(--font-mono); letter-spacing: .12em; color: var(--dim); }
.prompts--tight .prompt { padding: 12px 16px; }

.fam { --fc: var(--cyan); display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; font: 700 10px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--fc); background: color-mix(in srgb, var(--fc) 12%, transparent); border: 1px solid color-mix(in srgb, var(--fc) 40%, transparent); }
.fam--meta { --fc: var(--cyan); }
.fam--rivals { --fc: var(--red-2); }
.fam--links { --fc: var(--violet); }
.fam--feats { --fc: var(--gold); }
.fam--rosters { --fc: var(--teal); }
.fam--agents { --fc: var(--orange); }
.fam--pools { --fc: var(--pink); }

/* ---------- rank ladder & calculator ------------------------------------- */
.ladder { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: end; height: 230px; padding: 16px 16px 0; border: 1px solid var(--line); border-bottom: 2px solid var(--line-2); background: repeating-linear-gradient(0deg, transparent 0 45px, rgba(255, 255, 255, .03) 45px 46px), var(--bg-2); }
.rung { display: grid; grid-template-rows: 1fr auto auto; height: 100%; text-align: center; }
.rung__bar { display: flex; align-items: flex-end; }
.rung__bar i { width: 100%; height: var(--h); background: linear-gradient(180deg, var(--c), color-mix(in srgb, var(--c) 30%, transparent)); box-shadow: 0 0 24px -4px color-mix(in srgb, var(--c) 60%, transparent); transform-origin: bottom; transform: scaleY(0); transition: transform .9s var(--ease) calc(var(--i) * 90ms); }
.ladder.is-in .rung__bar i, .no-io .rung__bar i { transform: scaleY(1); }
.rung__rr { padding-top: 10px; font: 700 18px var(--font-pixel); color: var(--c); }
.rung__rr small { font: 600 10px var(--font-mono); margin-left: 3px; color: var(--muted); }
.rung__name { padding: 4px 0 12px; font: 700 11px var(--font-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

.calc { margin-top: 18px; padding: 20px; border: 1px solid var(--line-2); background: var(--panel); }
.calc__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; }
.calc__title { margin: 0; font: 700 18px var(--font-body); }
.calc__total { font: 700 clamp(30px, 4vw, 44px)/1 var(--font-pixel); color: var(--text); font-variant-numeric: tabular-nums; text-align: right; }
.calc__total small { display: block; margin-top: 4px; font: 600 11px var(--font-mono); color: var(--dim); letter-spacing: .1em; }
.calc__slots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.slot { --c: var(--rank-miss); position: relative; display: grid; gap: 4px; padding: 12px 6px 10px; text-align: center; cursor: pointer; background: var(--bg-2); border: 1px solid var(--line-2); border-top: 3px solid var(--c); transition: transform .15s var(--ease), border-color .15s, background .15s; }
.slot:hover { transform: translateY(-3px); background: var(--panel-2); }
.slot.bump { animation: bump .3s var(--ease); }
@keyframes bump { 40% { transform: translateY(-6px) scale(1.04); } }
.slot__n { font: 600 10px var(--font-mono); color: var(--dim); letter-spacing: .14em; }
.slot__rank { font: 700 12px var(--font-pixel); color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot__rr { font: 600 12px var(--font-mono); color: var(--muted); }
.slot[data-rank="iron"] { --c: var(--rank-iron); }
.slot[data-rank="gold"] { --c: var(--rank-gold); }
.slot[data-rank="diamond"] { --c: var(--rank-diamond); }
.slot[data-rank="immortal"] { --c: var(--rank-immortal); }
.slot[data-rank="radiant"] { --c: var(--rank-radiant); background: linear-gradient(180deg, rgba(255, 241, 166, .1), var(--bg-2)); }
.calc__meter { height: 8px; margin: 16px 0 12px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; }
.calc__meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--rank-iron), var(--rank-gold), var(--rank-diamond), var(--rank-immortal), var(--rank-radiant)); background-size: 700px 100%; transition: width .5s var(--ease); }
.calc__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.calc__foot p { margin: 0; font: 500 13px var(--font-mono); color: var(--muted); }
.calc__presets { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- cards -------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card { --n: 14px; position: relative; display: grid; gap: 8px; align-content: start; min-height: 168px; padding: 20px; text-decoration: none; color: var(--text); background: var(--panel); border: 1px solid var(--line-2); clip-path: polygon(0 0, calc(100% - var(--n)) 0, 100% var(--n), 100% 100%, 0 100%); transition: transform .2s var(--ease), border-color .2s, background .2s; }
.card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--red); transform: scaleY(0); transform-origin: top; transition: transform .25s var(--ease); }
.card:hover { transform: translateY(-4px); border-color: var(--cyan); background: var(--panel-2); color: var(--text); }
.card:hover::before { transform: scaleY(1); }
.card__glyph { width: 38px; height: 38px; display: grid; place-items: center; font: 700 17px var(--font-mono); color: var(--red-2); background: rgba(255, 70, 85, .1); border: 1px solid rgba(255, 70, 85, .35); }
.card__title { margin-top: 6px; font: 700 17px var(--font-pixel); letter-spacing: .02em; }
.card__text { font-size: 14px; color: var(--muted); line-height: 1.5; }
.card__go { position: absolute; right: 18px; bottom: 14px; font: 700 18px var(--font-mono); color: var(--dim); transition: transform .2s var(--ease), color .2s; }
.card:hover .card__go { transform: translateX(4px); color: var(--cyan); }

/* ---------- tables, notes ------------------------------------------------ */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-2); background: var(--panel); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table caption { text-align: left; padding: 12px 16px; color: var(--muted); }
.table th, .table td { padding: 13px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table thead th { font: 700 11px var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); background: var(--bg-2); white-space: nowrap; }
.table tbody th { font-weight: 600; color: var(--text); }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tbody tr:hover { background: rgba(90, 215, 234, .03); }
.table .num { font: 600 14px var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr.hl { background: rgba(255, 70, 85, .07); }
.table tr.hl th { color: var(--red-2); }
.table--compact th, .table--compact td { padding: 9px 14px; }
.table--ranks .rank-dot { display: inline-block; width: 10px; height: 10px; margin-right: 10px; background: var(--c); box-shadow: 0 0 10px var(--c); vertical-align: 0; }
.table--ranks td.num { color: var(--c); }
.table--ranks tr.total { background: var(--bg-2); }
.table--ranks tr.total th, .table--ranks tr.total .num { color: var(--rank-radiant); }
.status { display: inline-block; font: 600 11px var(--font-mono); color: var(--teal); white-space: nowrap; }
.status::before { content: '● '; }
.note { display: flex; gap: 14px; align-items: flex-start; margin-top: 18px; padding: 14px 16px; font-size: 14px; color: var(--muted); border-left: 3px solid var(--gold); background: rgba(244, 196, 82, .05); }
.note__tag { flex: none; margin-top: 2px; padding: 2px 8px; font: 700 10px var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); border: 1px solid rgba(244, 196, 82, .4); }

/* ---------- FAQ ---------------------------------------------------------- */
.faq { border-top: 1px solid var(--line-2); }
.faq__item { border-bottom: 1px solid var(--line-2); }
.faq__item summary { list-style: none; display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 18px 4px; cursor: pointer; font: 600 17px var(--font-body); transition: color .15s; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary:hover { color: var(--cyan); }
.faq__item summary i { position: relative; flex: none; width: 22px; height: 22px; border: 1px solid var(--line-2); }
.faq__item summary i::before, .faq__item summary i::after { content: ''; position: absolute; left: 50%; top: 50%; width: 10px; height: 2px; background: currentColor; transform: translate(-50%, -50%); transition: transform .25s var(--ease); }
.faq__item summary i::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq__item[open] summary i { border-color: var(--red); color: var(--red-2); }
.faq__item[open] summary i::after { transform: translate(-50%, -50%) rotate(0deg); }
.faq__a { padding: 0 4px 20px; color: var(--muted); max-width: 72ch; animation: fadeDown .3s var(--ease); }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-6px); } }

.sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sources li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.sources li span:last-child { font: 500 12px var(--font-mono); color: var(--dim); }

/* ---------- guide components --------------------------------------------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.steps li { display: grid; gap: 10px; align-content: start; padding: 20px; background: var(--panel); border: 1px solid var(--line-2); position: relative; }
.steps__n { font: 700 30px var(--font-pixel); color: var(--red); line-height: 1; }
.steps h3 { margin-bottom: 6px; }
.steps p { margin: 0; color: var(--muted); font-size: 15px; }
.steps--compact { grid-template-columns: 1fr; }
.steps--compact li { grid-template-columns: 64px 1fr; align-items: start; }

.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: start; }
.callout { margin: 0; padding: 24px; border: 1px solid var(--red); background: linear-gradient(160deg, rgba(255, 70, 85, .12), transparent 70%), var(--panel); }
.callout__k { font: 700 11px var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--red-2); }
.callout__big { margin: 0; font: 700 clamp(18px, 2vw, 22px)/1.55 var(--font-pixel); }

.budget { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0 0; border: 1px solid var(--line-2); }
.budget__step { padding: 20px; background: var(--panel); border-right: 1px solid var(--line-2); position: relative; }
.budget__step:last-child { border-right: 0; }
.budget__step::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--c); }
.budget__t { display: block; font: 700 22px var(--font-pixel); color: var(--c); }
.budget__k { display: block; margin: 4px 0 8px; font: 700 11px var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--text); }
.budget p { margin: 0; color: var(--muted); font-size: 14px; }

.ticks { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding: 14px 16px 14px 44px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.ticks li::before { content: '▸'; position: absolute; left: 18px; top: 13px; color: var(--red-2); font-family: var(--font-mono); }
.ticks b { color: var(--text); }

.fam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: 16px; }
.fam-card { display: grid; gap: 10px; align-content: start; padding: 18px; background: var(--panel); border: 1px solid var(--line-2); transition: border-color .2s, transform .2s var(--ease); }
.fam-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.fam-card .fam { justify-self: start; }
.fam-card h3 { font-size: 15px; }
.fam-card p { margin: 0; color: var(--muted); font-size: 14px; }
.fam-card__q { color: var(--text) !important; font-style: italic; }
.fam-card__hint { font: 600 10.5px var(--font-mono) !important; letter-spacing: .1em; color: var(--dim) !important; }

.reset-grid { display: grid; grid-template-columns: minmax(220px, .8fr) 1.2fr; gap: 14px; margin-top: 18px; align-items: start; }
.reset-card { padding: 22px; border: 1px solid var(--cyan); background: linear-gradient(160deg, rgba(90, 215, 234, .1), transparent 70%), var(--panel); position: sticky; top: 24px; }
.reset-card__time { margin: 4px 0; font: 700 54px/1 var(--font-pixel); color: var(--cyan); font-variant-numeric: tabular-nums; }
.reset-card__zone { font: 500 13px var(--font-mono); color: var(--muted); }
.reset-card__count { margin: 14px 0 0; padding-top: 12px; border-top: 1px dashed var(--line-2); font: 500 13px var(--font-mono); color: var(--muted); }
.reset-card__count b { color: var(--teal); font-variant-numeric: tabular-nums; }

/* ---------- prompt archive ----------------------------------------------- */
.filters { display: grid; gap: 12px; margin-bottom: 18px; position: sticky; top: 0; z-index: 5; padding: 12px 0; background: linear-gradient(180deg, var(--bg) 70%, transparent); }
.search { display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--panel); border: 1px solid var(--line-2); transition: border-color .15s; }
.search:focus-within { border-color: var(--cyan); }
.search span[aria-hidden] { color: var(--dim); font-size: 18px; }
.search input { flex: 1; min-width: 0; padding: 13px 0; background: transparent; border: 0; outline: 0; color: var(--text); font: 500 15px var(--font-body); }
.search input::placeholder { color: var(--dim); }
.chiprow { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; font: 600 12px var(--font-mono); color: var(--muted); background: var(--panel); border: 1px solid var(--line-2); cursor: pointer; transition: all .15s; }
.chip:hover { color: #fff; border-color: var(--cyan); }
.chip.is-on { color: #fff; background: var(--red); border-color: var(--red); }
.days { display: grid; gap: 18px; }
.day { border: 1px solid var(--line-2); background: var(--panel); }
.day__head { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.day__head h3 { font: 700 16px var(--font-pixel); }
.day__meta { margin-left: auto; font: 500 12px var(--font-mono); color: var(--dim); }
.empty { padding: 30px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); }

/* ---------- coverage ----------------------------------------------------- */
.window { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 22px; margin-bottom: 16px; background: var(--panel); border: 1px solid var(--line-2); }
.window__end { display: grid; gap: 2px; }
.window__end:last-child { text-align: right; }
.window__end:last-child .kicker { justify-content: flex-end; }
.window__end b { font: 700 18px var(--font-pixel); }
.window__end span:last-child { font: 500 12px var(--font-mono); color: var(--muted); }
.window__rail { position: relative; display: flex; justify-content: space-between; height: 4px; background: linear-gradient(90deg, var(--cyan), var(--red)); }
.window__rail i { position: relative; width: 10px; height: 10px; margin-top: -3px; background: var(--bg); border: 2px solid var(--text); }
.window__rail i::after { content: attr(data-y); position: absolute; top: 14px; left: 50%; transform: translateX(-50%); font: 600 10px var(--font-mono); color: var(--dim); }
.timeline { display: grid; gap: 0; border-left: 2px solid var(--line-2); margin-left: 8px; }
.timeline__year { position: relative; padding: 0 0 24px 26px; }
.timeline__year::before { content: ''; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; background: var(--red); box-shadow: 0 0 0 4px var(--bg); }
.timeline__y { margin: 0 0 10px; font: 700 22px var(--font-pixel); }
.timeline ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ev { --ec: var(--cyan); display: grid; gap: 2px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line-2); border-left: 3px solid var(--ec); transition: transform .2s var(--ease); }
.ev:hover { transform: translateX(3px); }
.ev--champs { --ec: var(--gold); }
.ev--lockin { --ec: var(--violet); }
.ev__tier { font: 700 10px var(--font-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--ec); }
.ev__name { font: 700 15px var(--font-body); }
.ev__city { font: 500 12px var(--font-mono); color: var(--dim); }

/* ---------- contact / 404 ------------------------------------------------ */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.contact-card { display: grid; gap: 8px; align-content: start; padding: 22px; text-decoration: none; color: var(--text); background: var(--panel); border: 1px solid var(--line-2); transition: border-color .2s, transform .2s var(--ease); }
.contact-card:hover { border-color: var(--cyan); transform: translateY(-3px); color: var(--text); }
.contact-card b { font: 700 16px var(--font-pixel); margin-top: 6px; }
.contact-card span { color: var(--muted); font-size: 14px; }
.contact-card .contact-card__mail { margin-top: 6px; font: 600 13px var(--font-mono); color: var(--cyan); }
.lost { display: grid; justify-items: center; text-align: center; padding: 12vh 0 8vh; }
.lost__krill { width: 140px; margin-bottom: 24px; }
.lost .lead { margin-inline: auto; }
.lost__actions { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; justify-content: center; }

/* ---------- footer ------------------------------------------------------- */
.foot { margin-top: 96px; padding: 36px 0 30px; border-top: 1px solid var(--line-2); }
.foot__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 28px; }
.foot__grid nav, .foot__grid > div:last-child { display: grid; gap: 8px; align-content: start; }
.foot__grid a { color: var(--muted); text-decoration: none; font-size: 14px; }
.foot__grid a:hover { color: var(--cyan); }
.foot__brand { display: flex; align-items: center; gap: 10px; font: 700 16px var(--font-pixel); color: var(--text) !important; }
.foot__krill { width: 40px; }
.foot__tag { margin-top: 12px; font-size: 14px; color: var(--muted); max-width: 34ch; }
.foot__h { margin: 0 0 4px; font: 700 11px var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }
.foot__legal { margin-top: 30px; padding-top: 18px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--dim); }

/* ---------- dialogs & toast ---------------------------------------------- */
.dlg { width: min(520px, calc(100vw - 32px)); padding: 0; color: var(--text); background: var(--panel); border: 1px solid var(--cyan); box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .8), 0 0 0 6px rgba(90, 215, 234, .08); }
.dlg--sm { width: min(420px, calc(100vw - 32px)); border-color: var(--red); }
.dlg::backdrop { background: rgba(4, 7, 15, .72); backdrop-filter: blur(4px); }
.dlg[open] { animation: pop .28s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.dlg__body { padding: 28px 26px 24px; }
.dlg h2 { font: 700 22px/1.2 var(--font-pixel); margin-bottom: 12px; }
.dlg p { color: var(--muted); font-size: 15px; }
.dlg__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.dlg__fine { margin-top: 16px !important; font-size: 12px !important; color: var(--dim) !important; }
.dlg__x { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; background: transparent; border: 1px solid var(--line-2); color: var(--muted); cursor: pointer; }
.dlg__x:hover { color: #fff; border-color: var(--red); }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 400; transform: translate(-50%, 20px); opacity: 0; padding: 12px 18px; font: 600 13px var(--font-mono); background: var(--panel-3); border: 1px solid var(--teal); color: var(--text); box-shadow: var(--shadow); pointer-events: none; transition: opacity .25s, transform .25s var(--ease); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- reveal ------------------------------------------------------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- responsive --------------------------------------------------- */
@media (max-width: 1080px) {
  .foot__grid { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --side-w: 0px; }
  .shell { display: block; }
  .topbar {
    position: sticky; top: 0; z-index: 120;
    display: flex; align-items: center; gap: 12px;
    height: 58px; padding: 0 12px 0 16px;
    background: rgba(11, 18, 34, .9); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line-2);
  }
  .topbar__brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 700 15px var(--font-pixel); }
  .topbar__krill { width: 34px; }
  .topbar__clock { margin-left: auto; font: 700 13px var(--font-mono); color: var(--cyan); font-variant-numeric: tabular-nums; }
  .topbar__menu { width: 42px; height: 42px; display: grid; place-content: center; gap: 5px; background: var(--panel); border: 1px solid var(--line-2); cursor: pointer; }
  .topbar__menu i { display: block; width: 18px; height: 2px; background: var(--text); transition: transform .25s var(--ease), opacity .2s; }
  .topbar__menu[aria-expanded="true"] i:nth-child(2) { transform: translateY(7px) rotate(45deg); }
  .topbar__menu[aria-expanded="true"] i:nth-child(3) { opacity: 0; }
  .topbar__menu[aria-expanded="true"] i:nth-child(4) { transform: translateY(-7px) rotate(-45deg); }
  .side { position: fixed; top: 0; left: 0; bottom: 0; z-index: 150; width: min(300px, 84vw); height: 100%; transform: translateX(-102%); transition: transform .32s var(--ease); background: var(--bg-2); }
  .side.is-open { transform: none; box-shadow: 30px 0 80px rgba(0, 0, 0, .6); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 140; background: rgba(4, 7, 15, .6); backdrop-filter: blur(2px); }
  .scrim[hidden] { display: none; }
  .main { padding: 18px 16px 0; }
  .page-head__krill { width: 76px; }
  .stage { height: min(640px, 78svh); }
  .reset-grid { grid-template-columns: 1fr; }
  .reset-card { position: static; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .hero { padding: 22px 14px; outline-offset: 3px; }
  .hero__sub { letter-spacing: .18em; font-size: 11px; }
  .play { padding: 10px; margin-inline: -6px; }
  .play__bar { flex-direction: column; align-items: flex-start; font-size: 12px; }
  .tool--end { margin-left: 0; }
  .tool kbd { display: none; }
  .ladder { height: 190px; gap: 6px; padding: 12px 8px 0; }
  .rung__rr { font-size: 13px; }
  .rung__name { font-size: 9px; letter-spacing: .06em; }
  .calc { padding: 14px; }
  .calc__slots { grid-template-columns: repeat(4, 1fr); }
  .budget { grid-template-columns: 1fr; }
  .budget__step { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .steps--compact li { grid-template-columns: 1fr; }
  .window { grid-template-columns: 1fr; text-align: center; }
  .window__end:last-child { text-align: center; }
  .window__end .kicker { justify-content: center; }
  .window__rail { margin: 8px 0 22px; }
  .foot__grid { grid-template-columns: 1fr; }
  .prompt { grid-template-columns: 38px 1fr; padding: 12px 14px; }
  .prompt__n { font-size: 16px; }
  .page-head__row { align-items: flex-start; }
  .table th, .table td { padding: 11px 12px; }
  .table--stack thead { display: none; }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack th, .table--stack td { display: block; width: 100%; }
  .table--stack tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .table--stack tbody tr:last-child { border-bottom: 0; }
  .table--stack th, .table--stack td { padding: 2px 0; border: 0; }
  .table--stack tbody th { font: 700 11px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
  .table--stack td:last-child { margin-top: 6px; }
  .hero__title { font-size: clamp(28px, 9.4vw, 40px); }
  .poster__title { font-size: clamp(26px, 9vw, 40px); }
  .page-title { font-size: clamp(28px, 9vw, 40px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}
