/* ═══════════════════════════════════════════════════════════════════════════
   ECONOMILLION — art direction
   One building, seen at street level through every page. The scene is the
   "window"; content sits on ink sheets that slide up over it. Materials:
   ink (navy-black), champagne paper, brass hairlines, an engraved rosette
   used sparingly. Serif for voice and big figures; sans for reading; mono
   only for instruments (timer, elevator, codes).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ───────────────────────── Tokens ───────────────────────── */
:root {
  --ink: #070a11;
  --bg: #070a11;
  --bg-2: #0b0f18;
  --sheet: #090c14;
  --surface: #0f1420;
  --surface-2: #151b28;
  --surface-3: #1c2333;
  --line: rgba(236, 229, 213, 0.075);
  --line-2: rgba(236, 229, 213, 0.14);
  --text: #efeadf;
  --text-2: #c4c0b5;
  --muted: #8f9097;
  --faint: #5f6270;
  --accent: #eadcb6;       /* champagne: primary actions */
  --accent-ink: #15120b;
  --gold: #d9b66a;
  --danger: #e8796b;
  --ok: #6cc59a;

  /* Tier palette, lowest -> highest. Muted pigments, not screen colors. */
  --t-consultant: #b2b4b8;
  --t-intern: #7fb4ac;
  --t-ib: #8fa2d2;
  --t-quant: #a897cc;
  --t-angel: #d48f6e;
  --t-hedge_fund: #d9b66a;

  /* Materials */
  --brass: #b8914a;
  --rule-gold: rgba(217, 182, 106, 0.22);
  --panel: rgba(10, 13, 21, 0.95);
  --panel-line: rgba(217, 182, 106, 0.16);
  --well: rgba(236, 229, 213, 0.025);
  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 24px 60px -32px rgba(0, 0, 0, 0.85);
  /* the certificate border: a brass hairline set 5px inside the edge */
  --engrave: inset 0 0 0 5px var(--sheet), inset 0 0 0 6px rgba(217, 182, 106, 0.09);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 .06 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --rosette: url('img/rosette.svg');

  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: clip;
  font-feature-settings: 'ss01', 'cv11';
}
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: rgba(217, 182, 106, 0.32); color: var(--text); }
.num { font-variant-numeric: tabular-nums lining-nums; letter-spacing: -0.01em; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.serif { font-family: var(--font-display); font-weight: 400; }
/* Labels read as quiet sentence-case captions, not shouted micro-caps. */
.eyebrow { font-size: 12.5px; letter-spacing: 0.01em; color: var(--muted); font-weight: 500; }
.hidden { display: none !important; }

/* ───────────────────────── Shell & navigation ───────────────────────── */
.shell { max-width: 1120px; margin: 0 auto; padding: 0 24px 80px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 64px; position: sticky; top: 0; z-index: 20; isolation: isolate;
}
.topbar::before {
  content: ''; position: absolute; z-index: -1; top: 0; bottom: 0; left: -100vw; right: -100vw;
  background: var(--ink) var(--grain); border-bottom: 1px solid var(--rule-gold);
}
.brand { display: flex; align-items: baseline; gap: 14px; text-decoration: none; }
.brand-mark { font-family: var(--font-display); font-size: 27px; letter-spacing: -0.01em; line-height: 1; }
.brand-mark i { font-style: italic; color: var(--gold); }
.brand-tag { font-family: var(--font-display); font-style: italic; font-size: 15px; color: var(--muted); padding-left: 14px; border-left: 1px solid var(--line-2); line-height: 1; }
.nav { display: flex; align-items: center; gap: 6px; height: 100%; }
.nav a {
  position: relative; display: flex; align-items: center; height: 100%; text-decoration: none;
  color: var(--text-2); font-size: 14px; font-weight: 500; padding: 0 12px; letter-spacing: 0.005em;
  transition: color .2s;
}
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); }
/* the active page hangs a brass tab from the rule below the bar */
.nav a.active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--gold); }
.profile-chip { display: inline-flex; align-items: center; gap: 8px; margin-left: 10px; padding-left: 16px; border-left: 1px solid var(--line-2); text-decoration: none; font-size: 13.5px; color: var(--text-2); }
.profile-chip:hover { color: var(--text); }
.streak { display: inline-flex; align-items: center; gap: 4px; color: var(--t-angel); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ───────────────────────── Primitives ───────────────────────── */
/* A plate: the one floating surface, used only where content must sit over the scene. */
.card {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.card-head .card-title { white-space: nowrap; }
.card-title { font-family: var(--font-display); font-weight: 400; font-size: 23px; line-height: 1.1; letter-spacing: -0.005em; color: var(--text); margin: 0; }
.card-meta { font-size: 12.5px; color: var(--muted); }
.card-head a { color: var(--muted); font-size: 13px; text-decoration: none; transition: color .2s; }
.card-head a::after { content: ' →'; }
.card-head a:hover { color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-2); background: transparent; color: var(--text);
  padding: 10px 18px; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none;
  font-weight: 500; font-size: 14px; letter-spacing: 0.005em;
  transition: transform .12s var(--ease), background .2s, border-color .2s, color .2s, opacity .2s;
}
.btn:hover { border-color: rgba(217, 182, 106, 0.5); background: rgba(217, 182, 106, 0.05); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; box-shadow: inset 0 -2px 0 rgba(21, 18, 11, 0.16); }
.btn-primary:hover { background: #f4ead0; border-color: #f4ead0; }
.btn-primary:active { box-shadow: inset 0 -1px 0 rgba(21, 18, 11, 0.16); }
:where(a, button, input, summary, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.input:focus-visible { outline: none; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: transparent; border-color: transparent; color: var(--text); text-decoration: underline; text-decoration-color: var(--brass); text-underline-offset: 5px; }
.btn-lg { padding: 15px 30px; font-size: 15.5px; }
.btn-sm { padding: 7px 13px; font-size: 13px; }

.input {
  width: 100%; background: var(--ink); border: 1px solid var(--line-2); color: var(--text);
  border-radius: var(--radius-sm); padding: 12px 14px; font: inherit; outline: none; transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: var(--faint); }
.input:focus { border-color: rgba(217, 182, 106, 0.6); box-shadow: 0 0 0 3px rgba(217, 182, 106, 0.1); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 3px; font-size: 11.5px; font-weight: 500; letter-spacing: 0.02em; border: 1px solid var(--line-2); color: var(--text-2); }
.badge-demo { color: #e3c486; border-color: rgba(227, 196, 134, 0.35); }
.badge-prov { color: #a9b6dc; border-color: rgba(169, 182, 220, 0.35); }

.avatar {
  display: inline-grid; place-items: center; border-radius: 50%; flex: none; font-weight: 600; letter-spacing: .02em;
  background: hsl(var(--av-h) 22% 20%); color: hsl(var(--av-h) 40% 80%); border: 1px solid hsl(var(--av-h) 22% 30%);
}
.avatar-me { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--gold); }

/* ───────────────────────── Tier marks ───────────────────────── */
/* A tier is a glyph and a name in its pigment, set on a faint tinted tab. */
.chip {
  --c: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 7px; border-radius: 3px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
  color: var(--c); background: color-mix(in srgb, var(--c) 9%, transparent);
}
.chip-sm { font-size: 11px; padding: 2px 6px 2px 5px; gap: 4px; letter-spacing: 0.04em; }
.chip-none { color: var(--faint); background: transparent; }
.tier-consultant { --c: var(--t-consultant); }
.tier-intern { --c: var(--t-intern); }
.tier-ib { --c: var(--t-ib); }
.tier-quant { --c: var(--t-quant); }
.tier-angel { --c: var(--t-angel); }
.tier-hedge_fund { --c: var(--t-hedge_fund); }
.chip.tier-hedge_fund { box-shadow: inset 0 0 0 1px rgba(217, 182, 106, 0.35); }

/* ───────────────────────── The window & the sheet ─────────────────────────
   Every page opens on the street (the scene), then an ink sheet rises over it.
   The box-shadow carries the sheet to the viewport edges and the page bottom
   without adding scrollable overflow. */
.sheet {
  position: relative; isolation: isolate;
  background: var(--sheet);
  box-shadow: 0 0 0 100vmax var(--sheet);
  clip-path: inset(0 -100vmax -100vmax);
  border-top: 1px solid var(--rule-gold);
  padding: 34px 0 10px;
}
.sheet::before { /* the brass rule continues across the full width */
  content: ''; position: absolute; top: -1px; left: -100vmax; right: -100vmax; height: 1px; background: var(--rule-gold);
}
.window { position: relative; }

/* ───────────────────────── Home ───────────────────────── */
.masthead {
  min-height: clamp(460px, calc(100vh - 64px - 96px), 720px);
  display: grid; align-content: center; padding: 40px 0 56px;
}
.mast-copy { max-width: 600px; }
.mast-edition { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; font-size: 13.5px; color: var(--text-2); }
.mast-edition .ed-no { font-family: var(--font-display); font-style: italic; font-size: 19px; color: var(--gold); }
.mast-edition .ed-rule { width: 28px; height: 1px; background: var(--brass); opacity: .6; }
.masthead h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(50px, 7vw, 92px); line-height: .94; letter-spacing: -0.025em; margin: 0 0 22px; text-wrap: balance; }
.masthead h1 em { color: var(--gold); }
.masthead .lede { color: var(--text-2); font-size: 17px; line-height: 1.6; max-width: 44ch; margin: 0 0 32px; }
.hero-actions { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; position: relative; z-index: 1; }
.countdown { font-size: 13.5px; color: var(--muted); }
.countdown b { color: var(--text); font-weight: 500; font-family: var(--font-mono); font-size: 14px; letter-spacing: 0.02em; margin-left: 4px; }
.mast-figures { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 0; margin: 44px 0 0; padding: 0; }
.mast-figures > div { padding: 0 28px; border-left: 1px solid var(--line-2); }
.mast-figures > div:first-child { padding-left: 0; border-left: 0; }
.mast-figures dt { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.mast-figures dd { margin: 0; order: -1; font-family: var(--font-display); font-size: 34px; line-height: 1; color: var(--text); display: flex; align-items: center; gap: 8px; min-height: 34px; }
.mast-figures > div { display: flex; flex-direction: column; }
.mast-figures dd .streak { font-family: var(--font-display); font-weight: 400; }
.mast-figures dd .streak svg { width: 18px; height: 18px; }
.mast-figures dd .tname { font-size: 24px; color: var(--c); }
.mast-desk { margin: 26px 0 0; font-size: 13.5px; line-height: 1.7; color: var(--text-2); max-width: 60ch; }
.mast-desk .k { color: var(--muted); margin-right: 6px; }
.mast-desk .sep { color: var(--brass); margin: 0 7px; }

/* The ledger: three columns ruled apart on the sheet, not three boxes. */
.ledger { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 0; }
.ledger-col { padding: 0 30px; border-left: 1px solid var(--line); min-width: 0; }
.ledger-col:first-child { padding-left: 0; border-left: 0; }
.ledger-col:last-child { padding-right: 0; }

.lb-mini { list-style: none; margin: 0; padding: 0; }
.lb-mini li { display: grid; grid-template-columns: 22px 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.lb-mini li:first-child { border-top: 0; }
.lb-mini .r { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.lb-mini li:first-child .r { color: var(--gold); }
.lb-mini .me { color: var(--accent); }
.lb-mini .s { font-variant-numeric: tabular-nums; font-weight: 500; }
.name-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.name-cell span.n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Distribution: hairline tracks, square ends, a thin tick for the value. */
.dist-bars { display: grid; gap: 11px; padding-top: 14px; }
.dist-bar { display: grid; grid-template-columns: 132px minmax(0, 1fr) 46px; gap: 12px; align-items: center; font-size: 13px; }
.dist-bar .track { position: relative; display: block; height: 6px; background: rgba(236, 229, 213, 0.05); }
.dist-bar .fill { display: block; height: 100%; background: var(--c); width: 0; transition: width .9s var(--ease); }
.dist-bar .lbl { display: flex; align-items: center; gap: 7px; color: var(--c); font-weight: 500; white-space: nowrap; overflow: hidden; }
.dist-bar .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }

.history { list-style: none; padding: 0; margin: 0; }
.history li a { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; text-decoration: none; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; transition: color .15s; }
.history li:first-child a { border-top: 0; }
.history li a:hover .h-date { color: var(--accent); }
.history .num { font-weight: 500; }
.ledger-empty { margin: 14px 0 0; font-size: 14px; line-height: 1.6; color: var(--muted); }

/* The scale: six tiers on one ruled bar, the bar thickening as rarity rises. */
.scale-section { margin-top: 56px; }
.scale-wrap { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 36px; padding-top: 22px; }
.rarity-ladder { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; }
.rung { position: relative; padding: 18px 16px 4px; border-left: 1px solid var(--line); }
.rung:first-child { border-left: 0; padding-left: 0; }
.rung::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: var(--bar, 2px); background: var(--c); opacity: .85; }
.rung:first-child::before { left: 0; }
.rung.tier-consultant { --bar: 1px; }
.rung.tier-intern { --bar: 2px; }
.rung.tier-ib { --bar: 3px; }
.rung.tier-quant { --bar: 4px; }
.rung.tier-angel { --bar: 5px; }
.rung.tier-hedge_fund { --bar: 6px; }
.rung .glyph { color: var(--c); }
.rung .pts { display: block; margin-top: 12px; font-family: var(--font-display); font-size: 30px; line-height: 1; color: var(--text); }
.rung h4 { margin: 8px 0 4px; font-size: 14px; font-weight: 600; letter-spacing: 0; color: var(--c); }
.rung p { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.rung-top { display: flex; justify-content: space-between; align-items: center; }

.tower-panel { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: end; padding-right: 8px;
  --em-fill: #161b27; --em-lit: #3b3426; --em-line: #4a5164; --em-text: #7d879a; }
.tower-panel .emblem { display: block; }
.tower-panel .cap { font-size: 13px; line-height: 1.55; color: var(--text-2); display: grid; gap: 8px; }
.tower-panel .cap b { color: var(--text); font-weight: 600; }
.tower-panel .cap .lvl { font-size: 11.5px; color: var(--muted); line-height: 1.6; }

.home-sheet::after { /* the engraved rosette, half-hidden at the sheet's corner */
  content: ''; position: absolute; z-index: -1; top: -470px; right: -560px; width: 900px; height: 900px;
  background: var(--rosette) center / contain no-repeat; opacity: .07; pointer-events: none;
}

/* ───────────────────────── Play ───────────────────────── */
.play-wrap { max-width: 700px; margin: 28px auto 0; }

.q-card { padding: 34px 36px 30px; position: relative; overflow: hidden; box-shadow: var(--engrave), var(--shadow); background: var(--sheet); }
.q-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.q-cat { font-size: 13.5px; font-weight: 600; color: var(--text); }
.q-diff { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.q-prompt { font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 4.2vw, 44px); line-height: 1.1; letter-spacing: -0.012em; margin: 0 0 32px; min-height: 2.2em; text-wrap: balance; }
.q-form { display: flex; gap: 10px; }
.q-form .input { font-size: 18px; padding: 16px 18px; }
.q-form .btn { padding: 0 24px; white-space: nowrap; }
.q-hint { margin-top: 12px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; }

.timer { position: relative; width: 58px; height: 58px; }
.timer svg { transform: rotate(-90deg); }
.timer .ring-bg { stroke: rgba(236, 229, 213, 0.08); }
.timer .ring { stroke: var(--accent); transition: stroke .3s; }
.timer .t { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-mono); font-size: 18px; }
.timer.warn .ring { stroke: var(--t-angel); }
.timer.crit .ring { stroke: var(--danger); }
.timer.crit .t { color: var(--danger); animation: pulse .5s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .55; } }
.time-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--accent); transform-origin: left; }

.locked-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8, 10, 16, .94); animation: fadeIn .2s var(--ease); text-align: center; }
.locked-overlay .big { font-family: var(--font-display); font-size: 38px; }
.locked-overlay .sub { color: var(--muted); margin-top: 6px; font-size: 14px; }
.locked-overlay .ans { margin-top: 14px; font-family: var(--font-mono); font-size: 14px; color: var(--text-2); padding: 6px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); display: inline-block; }
@keyframes fadeIn { from { opacity: 0; } }

.intro { padding: 44px 44px 40px; text-align: center; position: relative; overflow: hidden; background: var(--sheet); box-shadow: var(--engrave), var(--shadow); }
.intro::before { content: ''; position: absolute; left: 50%; top: -560px; width: 760px; height: 760px; transform: translateX(-50%); background: var(--rosette) center / contain no-repeat; opacity: .08; pointer-events: none; }
.intro > * { position: relative; }
.intro h2 { font-family: var(--font-display); font-weight: 400; font-size: 50px; line-height: 1.02; margin: 12px 0 14px; letter-spacing: -0.02em; text-wrap: balance; }
.rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 34px 0 30px; text-align: left; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.rule { padding: 20px 20px 18px; border-left: 1px solid var(--line); }
.rule:first-child { border-left: 0; }
.rule b { display: block; font-family: var(--font-display); font-size: 30px; font-weight: 400; line-height: 1; margin-bottom: 10px; color: var(--gold); }
.rule span { font-size: 13.5px; line-height: 1.55; color: var(--text-2); }

/* ───────────────────────── Results ───────────────────────── */
.res-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 26px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
body[data-view="results"] main { padding-top: 26px; }
.res-meta .ed-no { font-family: var(--font-display); font-style: italic; font-size: 19px; color: var(--gold); }
.hero-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.statement { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); background: var(--sheet); box-shadow: var(--engrave), var(--shadow); }
.statement::before { content: ''; position: absolute; right: -470px; top: -430px; width: 820px; height: 820px; background: var(--rosette) center / contain no-repeat; opacity: .08; pointer-events: none; }
.score-card { position: relative; padding: 32px 34px 30px; }
.score-big { font-family: var(--font-display); font-size: clamp(88px, 12vw, 132px); line-height: .85; letter-spacing: -0.03em; margin: 14px 0 14px; font-variant-numeric: tabular-nums lining-nums; }
.score-sub { color: var(--text-2); font-size: 14.5px; line-height: 1.6; }
.score-sub .aum { font-family: var(--font-display); font-size: 21px; color: var(--gold); }
.score-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; align-items: center; }
.res-stats { position: relative; display: grid; grid-template-columns: repeat(2, 1fr); align-content: center; padding: 26px 30px; border-left: 1px solid var(--line); }
.res-stats .stat { padding: 16px 0 16px 18px; border-top: 1px solid var(--line); }
.res-stats .stat:nth-child(odd) { padding-left: 0; }
.res-stats .stat:nth-child(even) { border-left: 1px solid var(--line); }
.res-stats .stat:nth-child(-n+2) { border-top: 0; }
.stat .v { font-family: var(--font-display); font-size: 34px; line-height: 1; letter-spacing: -0.01em; font-variant-numeric: tabular-nums lining-nums; }
.stat .k { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.share-grid { font-size: 21px; letter-spacing: 3px; margin: 18px 0 2px; }

.answers { margin-top: 18px; padding: 4px 30px; background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--radius); box-shadow: var(--shadow); }
.ans {
  --c: var(--faint);
  display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; padding: 22px 0 20px 20px; position: relative;
  border-top: 1px solid var(--line);
  opacity: 0; transform: translateY(10px);
}
.ans:first-child { border-top: 0; }
.ans::before { content: ''; position: absolute; left: 0; top: 24px; bottom: 22px; width: 2px; background: var(--c); }
.ans.revealed { animation: rise .55s var(--ease) forwards; }
.ans.instant, .ans.instant .tier-stamp { opacity: 1; transform: none; }
@keyframes rise { to { opacity: 1; transform: none; } }
.ans > * { min-width: 0; }
.ans .yours { overflow-wrap: anywhere; }
.ans .q { font-size: 12.5px; color: var(--muted); grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; }
.ans .q .qn { font-family: var(--font-display); font-style: italic; font-size: 16px; color: var(--text-2); }
.ans .prompt { font-size: 14.5px; color: var(--text-2); margin-bottom: 6px; line-height: 1.5; }
.ans .yours { font-family: var(--font-display); font-size: 27px; line-height: 1.15; letter-spacing: -0.005em; }
.ans .grouped { font-size: 13px; color: var(--muted); margin-top: 4px; }
.ans .right { text-align: right; display: grid; justify-items: end; gap: 6px; align-content: start; }
.ans .pts { font-family: var(--font-display); font-size: 32px; line-height: 1; font-variant-numeric: tabular-nums lining-nums; }
.ans .share { font-size: 12.5px; color: var(--muted); }
.ans.invalid { --c: rgba(232, 121, 107, 0.6); }
.ans.invalid .yours { color: var(--text-2); text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: rgba(232, 121, 107, 0.7); }
.ans.expired { --c: var(--faint); }
.ans .tier-stamp { opacity: 0; transform: scale(1.6) rotate(-6deg); }
.ans.revealed .tier-stamp { animation: stamp .45s .35s var(--ease) forwards; }
@keyframes stamp { to { opacity: 1; transform: none; } }
.ans.tier-hedge_fund { background: linear-gradient(90deg, rgba(217, 182, 106, 0.07), transparent 60%); }
.ans.tier-hedge_fund .pts { color: var(--gold); }

.ans details { grid-column: 1 / -1; margin-top: 8px; }
.ans summary { cursor: pointer; font-size: 13px; color: var(--muted); list-style: none; display: inline-flex; gap: 8px; align-items: center; transition: color .15s; }
.ans summary:hover { color: var(--text); }
.ans summary::-webkit-details-marker { display: none; }
.ans summary::before { content: '+'; font-family: var(--font-mono); color: var(--brass); width: 10px; }
.ans details[open] summary::before { content: '–'; }
.ans .explain { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; margin-top: 14px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.ans .explain p { margin: 0 0 10px; color: var(--text-2); font-size: 14px; line-height: 1.6; }
.ans .src a { color: var(--text-2); font-size: 13px; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.ans .src a:hover { color: var(--text); }
.mini-dist .dist-bars { padding-top: 0; gap: 8px; }
.mini-dist .dist-bar { grid-template-columns: minmax(0, 1fr) 90px 44px; font-size: 12.5px; }
.mini-dist .dist-bar .lbl { color: var(--text-2); font-weight: 400; }
.mini-dist .dist-bar.mine .lbl { color: var(--accent); font-weight: 600; }
.mini-dist .dist-bar .track { height: 4px; }

.res-section { margin-top: 30px; padding: 22px 30px 26px; background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--radius); }
.top-answers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; padding-top: 16px; }
.top-ans { padding: 0 20px; border-left: 1px solid var(--line); min-width: 0; }
.top-ans:first-child { padding-left: 0; border-left: 0; }
.top-ans .a { font-family: var(--font-display); font-size: 23px; line-height: 1.15; margin: 10px 0 4px; overflow-wrap: anywhere; }
.top-ans .p { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* ───────────────────────── Leaderboard ───────────────────────── */
.lb-controls { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; margin: 0 0 6px; }
/* segmented controls read as tabs on a rule */
.seg { display: inline-flex; gap: 22px; }
.seg button { position: relative; border: 0; background: transparent; padding: 6px 0 10px; cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 500; transition: color .15s; }
.seg button:hover { color: var(--text); }
.seg button.on { color: var(--text); }
.seg button.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--gold); }
.lb-board { margin-top: 0; border-top: 1px solid var(--line-2); }
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table th { text-align: left; font-size: 12px; letter-spacing: 0.01em; color: var(--muted); font-weight: 500; padding: 14px 14px 10px; border-bottom: 1px solid var(--line-2); }
.lb-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14.5px; transition: background .15s; }
.lb-table tbody tr:hover td { background: rgba(236, 229, 213, 0.025); }
.lb-table tr.me td { background: rgba(217, 182, 106, 0.06); }
.lb-table tr.me td:first-child { box-shadow: inset 2px 0 0 var(--gold); }
.lb-table td.rank { font-size: 14px; color: var(--muted); width: 72px; font-variant-numeric: tabular-nums; }
.lb-table th:first-child, .lb-table td:first-child { padding-left: 12px; }
.lb-table td.score { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; font-size: 15px; }
.lb-table th.score { text-align: right; }
/* the podium: larger rows, metal-toned numerals */
.lb-table tr[class*="podium"] td { padding-top: 16px; padding-bottom: 16px; }
.lb-table tr[class*="podium"] td.rank { font-size: 19px; font-weight: 600; }
.lb-table tr[class*="podium"] .n { font-size: 15.5px; font-weight: 500; }
.lb-table tr.podium-1 td.rank { color: var(--gold); }
.lb-table tr.podium-2 td.rank { color: #c9ccd2; }
.lb-table tr.podium-3 td.rank { color: #c08a63; }
.star { background: none; border: 0; cursor: pointer; color: var(--faint); font-size: 15px; padding: 2px 6px; transition: color .15s; }
.star:hover { color: var(--text-2); }
.star.on { color: var(--gold); }
.lb-gap td { text-align: center; color: var(--faint); padding: 4px; font-size: 12px; letter-spacing: .3em; }

/* ───────────────────────── Page heads, misc ───────────────────────── */
/* Each inner page opens with its title in the window, over the street. */
.page-head { padding: 64px 0 34px; max-width: 640px; }
.page-head .page-title { margin: 0 0 10px; }
.page-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(48px, 6vw, 72px); line-height: .98; margin: 0; letter-spacing: -0.025em; }
.page-sub { margin: 0; font-size: 16.5px; line-height: 1.55; color: var(--text-2); max-width: 52ch; }
.page-sub b { color: var(--text); font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: var(--surface-2); border: 1px solid var(--panel-line); padding: 10px 18px; border-radius: var(--radius-sm); font-size: 14px; opacity: 0; transition: all .25s var(--ease); pointer-events: none; z-index: 100; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(232, 121, 107, 0.5); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(3, 4, 8, .8); display: grid; place-items: center; z-index: 90; padding: 16px; animation: fadeIn .2s; }
.modal { width: min(440px, 100%); background: var(--sheet); border: 1px solid var(--panel-line); border-radius: var(--radius); padding: 30px; box-shadow: var(--engrave), 0 30px 80px -20px rgba(0, 0, 0, .8); animation: revealIn .3s var(--ease); }
.modal h3 { font-family: var(--font-display); font-weight: 400; font-size: 32px; line-height: 1.05; margin: 6px 0 8px; }
.err-text { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 8px; }
.footer-note { max-width: 720px; margin: 48px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.footer-note:empty { display: none; }
.loading { padding: 80px 0; text-align: center; color: var(--muted); }
.prose { max-width: 680px; color: var(--text-2); }
.prose h3 { color: var(--text); font-size: 15px; margin: 26px 0 6px; }

/* ───────────────────────── Rules ───────────────────────── */
.rules-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.rulebook { padding: 0; }
.rb-sec { display: grid; grid-template-columns: 52px minmax(0, 1fr); padding: 24px 0 22px; border-top: 1px solid var(--line); }
.rb-sec:first-child { border-top: 0; padding-top: 4px; }
.rb-sec h3 { display: contents; }
.rb-n { grid-row: 1 / span 9; font-family: var(--font-display); font-style: italic; font-size: 26px; line-height: 1; color: var(--gold); letter-spacing: 0; }
.rb-sec h3 { font-family: var(--font-display); font-weight: 400; }
.rb-t { font-family: var(--font-display); font-size: 27px; line-height: 1.05; letter-spacing: -0.005em; color: var(--text); margin-bottom: 12px; }
.rb-sec p { grid-column: 2; margin: 0 0 12px 0; max-width: 64ch; font-size: 15.5px; line-height: 1.72; color: var(--text-2); }
.rb-sec p:last-child { margin-bottom: 0; }
/* the lobby directory: tiers listed like the floors of the building */
.tier-table { position: sticky; top: 88px; padding: 26px 26px 18px; background: var(--panel); box-shadow: var(--engrave), var(--shadow); }
.tier-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.tier-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px 0; border-top: 1px solid var(--line); }
.tier-row:first-child { border-top: 0; }
.tr-glyph { color: var(--c); display: grid; place-items: center; padding-top: 2px; }
.tr-body h4 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 400; font-size: 21px; line-height: 1.1; letter-spacing: 0; color: var(--c); }
.tr-body p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-2); }
.tr-pts { text-align: right; display: grid; gap: 4px; }
.tr-pts b { font-family: var(--font-display); font-size: 26px; font-weight: 400; line-height: 1; color: var(--text); letter-spacing: 0; }
.tr-pts span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* ───────────────────────── Responsive ───────────────────────── */
@media (max-width: 920px) {
  .ledger { grid-template-columns: 1fr; }
  .ledger-col { padding: 0; border-left: 0; }
  .ledger-col + .ledger-col { margin-top: 40px; }
  .scale-wrap { grid-template-columns: 1fr; }
  .rarity-ladder { grid-template-columns: repeat(3, 1fr); row-gap: 26px; }
  .rung:nth-child(4) { border-left: 0; padding-left: 0; }
  .rules-layout, .statement { grid-template-columns: 1fr; }
  .res-stats { border-left: 0; border-top: 1px solid var(--line); }
  .tier-table { position: static; }
  .top-answers { grid-template-columns: 1fr; }
  .top-ans { padding: 14px 0; border-left: 0; border-top: 1px solid var(--line); }
  .top-ans:first-child { border-top: 0; padding-top: 0; }
  .ans .explain { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .shell { padding: 0 16px 60px; }
  .topbar { height: 56px; }
  .brand-tag, .nav a.hide-sm { display: none; }
  .nav { gap: 0; }
  .topbar { gap: 8px; }
  .brand-mark { font-size: 22px; }
  .nav a { font-size: 13px; padding: 0 6px; }
  .nav a.active::after { left: 6px; right: 6px; }
  .profile-chip { margin-left: 2px; padding-left: 6px; gap: 4px; border-left: 0; }
  .lb-table td:last-child { width: 26px !important; padding-left: 0; padding-right: 0; }
  .lb-table td.rank { width: 30px; }
  .lb-table .name-cell span.n { max-width: calc(100vw - 290px); }
  .statement::before { display: none; }
  .profile-chip > span:not(.streak):not(.avatar) { display: none; }
  .masthead { min-height: 0; padding: 36px 0 44px; }
  .masthead h1 { font-size: 50px; }
  .masthead .lede { font-size: 16px; }
  .mast-figures > div { padding: 0 16px; }
  .mast-figures dd { font-size: 28px; }
  .mast-figures dd .tname { font-size: 19px; }
  .rarity-ladder { grid-template-columns: repeat(2, 1fr); }
  .rung:nth-child(4) { border-left: 1px solid var(--line); padding-left: 16px; }
  .rung:nth-child(odd) { border-left: 0; padding-left: 0; }
  .rules { grid-template-columns: 1fr; }
  .rule { border-left: 0; border-top: 1px solid var(--line); padding: 16px 4px; }
  .rule:first-child { border-top: 0; }
  .page-head { padding: 40px 0 26px; }
  .page-title { font-size: 46px; }
  .rb-sec { grid-template-columns: 38px minmax(0, 1fr); }
  .rb-n { font-size: 22px; }
  .rb-sec p { font-size: 15px; }
  .tier-table { padding: 20px 18px 12px; }
  .tier-row { grid-template-columns: 22px minmax(0, 1fr); }
  .tr-pts { grid-column: 2; text-align: left; display: flex; gap: 10px; align-items: baseline; }
  .q-card { padding: 24px 20px 22px; }
  .q-form { flex-direction: column; }
  .q-form .btn { padding: 14px; }
  .intro { padding: 30px 20px; }
  .intro h2 { font-size: 40px; }
  .lb-table th, .lb-table td { padding: 11px 8px; }
  .lb-table .hide-sm { display: none; }
  .seg { gap: 16px; }
  .answers { padding: 0 18px; }
  .ans { grid-template-columns: minmax(0, 1fr); padding-left: 16px; }
  .ans .right { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; text-align: left; }
  .ans .share { flex-basis: 100%; }
  .score-card { padding: 26px 22px 24px; }
  .res-stats { padding: 14px 22px 18px; }
  .res-section { padding: 18px 18px 20px; }
  .dist-bar { grid-template-columns: 112px minmax(0, 1fr) 42px; }
}

/* ───────────────────────── Play HUD ───────────────────────── */
/* One instrument strip: AUM · progress & floor · points, ruled apart. */
.hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-bottom: 14px; background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--radius); box-shadow: var(--shadow); }
.hud-aum, .hud-pts { padding: 12px 18px; }
.hud-pts { justify-self: stretch; text-align: right; }
.hud-aum { justify-self: stretch; }
.hud .eyebrow { font-size: 12px; }
.hud .num { font-family: var(--font-display); font-size: 28px; line-height: 1.05; margin-top: 2px; color: var(--gold); display: inline-block; letter-spacing: 0; }
.hud-pts .num { color: var(--text); }
.hud .num.bump { animation: bump .6s var(--ease); }
@keyframes bump { 30% { transform: scale(1.12); } }
.hud-prog { text-align: center; padding: 10px 22px 9px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.squares { display: flex; gap: 4px; justify-content: center; margin-bottom: 7px; }
.squares span { width: 16px; height: 4px; background: rgba(236, 229, 213, 0.12); }
.squares span.done { background: var(--text-2); }
.squares span.exp { background: rgba(232, 121, 107, 0.6); }
.squares span.cur { background: var(--gold); }
.read-bar { position: absolute; left: 0; top: 0; height: 2px; width: 100%; background: var(--t-intern); transform-origin: left; transition: opacity .3s; }
.input.shake { animation: shake .4s; border-color: rgba(232, 121, 107, 0.6); }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.q-hint .nope { color: #eea093; }
.input:disabled { opacity: .55; }

/* ───────────────────────── Reveal card ───────────────────────── */
.reveal {
  position: relative; overflow: hidden; text-align: center; padding: 36px 30px 32px;
  display: grid; justify-items: center; gap: 10px; animation: revealIn .45s var(--ease);
  background: var(--sheet); box-shadow: var(--engrave), var(--shadow);
}
@keyframes revealIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.reveal.rv-expired { --c: #e3958a; }
.rv-glow { position: absolute; inset: -30% 10% auto; height: 70%; background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 14%, transparent), transparent); pointer-events: none; }
.rv-art { width: 120px; height: 120px; color: var(--c); position: relative; animation: artPop .6s .1s var(--ease) both; }
.rv-art .art { width: 100%; height: 100%; overflow: visible; }
@keyframes artPop { from { opacity: 0; transform: scale(.6) rotate(-8deg); } }
.rv-tier { font-family: var(--font-display); font-size: clamp(40px, 6vw, 56px); font-weight: 400; letter-spacing: -0.015em; color: var(--c); line-height: 1; animation: rise .5s .25s var(--ease) both; }
.rv-meter { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-style: italic; font-size: 15px; color: var(--muted); margin: 6px 0 8px; }
.rv-meter .segs { display: flex; gap: 3px; align-items: flex-end; }
.rv-meter .seg { width: 22px; height: 4px; background: rgba(236, 229, 213, 0.1); }
.rv-meter .seg:nth-child(2) { height: 5px; } .rv-meter .seg:nth-child(3) { height: 6px; }
.rv-meter .seg:nth-child(4) { height: 7px; } .rv-meter .seg:nth-child(5) { height: 8px; } .rv-meter .seg:nth-child(6) { height: 9px; }
.rv-meter .seg.on { background: var(--c); animation: segOn .3s var(--ease) both; }
.rv-meter .seg:nth-child(1) { animation-delay: .3s; } .rv-meter .seg:nth-child(2) { animation-delay: .4s; }
.rv-meter .seg:nth-child(3) { animation-delay: .5s; } .rv-meter .seg:nth-child(4) { animation-delay: .6s; }
.rv-meter .seg:nth-child(5) { animation-delay: .7s; } .rv-meter .seg:nth-child(6) { animation-delay: .8s; }
@keyframes segOn { from { background: rgba(236, 229, 213, 0.1); } }
.rv-answer { font-family: var(--font-display); font-size: clamp(26px, 4vw, 34px); line-height: 1.15; overflow-wrap: anywhere; }
.rv-counted { font-size: 13px; color: var(--muted); margin-top: -6px; }
.rv-pts { display: flex; gap: 12px; align-items: baseline; font-size: 14.5px; animation: rise .5s .5s var(--ease) both; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 4px; }
.rv-pts .p { color: var(--c); font-weight: 600; }
.rv-pts .a { color: var(--gold); font-weight: 500; }
.rv-pts .dot { color: var(--faint); }
.rv-pts .zero { color: var(--muted); }
.rv-line { font-family: var(--font-display); font-size: 19px; color: var(--text-2); font-style: italic; animation: rise .5s .65s var(--ease) both; max-width: 40ch; }
.rv-share { font-size: 12.5px; color: var(--muted); }
.rv-next { margin-top: 14px; min-width: 210px; }
.reveal.tier-hedge_fund { box-shadow: inset 0 0 0 5px var(--sheet), inset 0 0 0 6px rgba(217, 182, 106, 0.35), 0 30px 80px -36px rgba(217, 182, 106, 0.45); border-color: rgba(217, 182, 106, 0.45); }
.reveal.tier-hedge_fund::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 240, 200, .12) 50%, transparent 65%); transform: translateX(-100%); animation: sweep 1.6s .6s var(--ease) forwards; pointer-events: none; }
@keyframes sweep { to { transform: translateX(100%); } }
.reveal.tier-consultant .rv-tier { font-style: italic; }

/* art micro-animations */
.fx-hop { animation: hop 1.4s var(--ease) infinite; }
@keyframes hop { 0% { transform: translate(-40px, 40px) scale(.7); opacity: .4; } 45%, 100% { transform: none; opacity: 1; } }
.fx-steam { animation: steam 2.2s ease-in-out infinite; opacity: 0; }
.fx-steam.d2 { animation-delay: .5s; } .fx-steam.d3 { animation-delay: 1s; }
@keyframes steam { 0% { opacity: 0; transform: translateY(8px); } 40% { opacity: .9; } 100% { opacity: 0; transform: translateY(-10px); } }
.fx-glint { animation: glint 2.4s .6s ease-in-out infinite; }
@keyframes glint { 0%, 60%, 100% { opacity: 0; transform: translate(0, 0); } 75% { opacity: .7; transform: translate(14px, 8px); } }
.fx-draw { stroke-dasharray: 160; stroke-dashoffset: 160; animation: draw 1.4s .3s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.fx-blink { animation: blink 1s 1.6s steps(2) infinite; opacity: 0; }
@keyframes blink { 50% { opacity: 1; } }
.fx-float { animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
.fx-wing-l { transform-origin: 44px 60px; animation: flapL .8s ease-in-out infinite; }
.fx-wing-r { transform-origin: 76px 60px; animation: flapR .8s ease-in-out infinite; }
@keyframes flapL { 50% { transform: rotate(14deg); } }
@keyframes flapR { 50% { transform: rotate(-14deg); } }
.fx-halo { animation: halo 2s ease-in-out infinite; }
@keyframes halo { 50% { transform: translateY(-2px); opacity: .6; } }
.fx-rays { transform-origin: 60px 60px; animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fx-twinkle { transform-box: fill-box; transform-origin: center; animation: twinkle 1.6s ease-in-out infinite; }
.fx-twinkle.d2 { animation-delay: .5s; } .fx-twinkle.d3 { animation-delay: 1s; }
@keyframes twinkle { 0%, 100% { transform: scale(.3); opacity: .2; } 50% { transform: scale(1.1); opacity: 1; } }
.fx-ring { transform-origin: 60px 14px; animation: ring 1.2s ease-in-out 2; }
@keyframes ring { 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 75% { transform: none; } }

@media (max-width: 600px) {
  .hud { grid-template-columns: 1fr 1fr; }
  .hud-prog { grid-column: 1 / -1; grid-row: 1; }
  .squares span { width: 12px; height: 12px; }
  .rv-meter .seg { width: 16px; }
  .reveal { padding: 26px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .ans { opacity: 1; transform: none; }
}
.dev-replay { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-2); position: relative; z-index: 1; }
.dev-badge { color: #9fb4ff; border-color: rgba(159,180,255,.35); background: rgba(159,180,255,.06); }

/* ───────────────────────── The Economillion Tower (stage) ───────────────────────── */
.scene { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; background: #1b2034; }
.sky, .stars, .scene-shade, .scene-pulse { position: absolute; inset: 0; }
.stars { opacity: 0; background-image:
  radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent), radial-gradient(1px 1px at 32% 8%, #fff 50%, transparent),
  radial-gradient(1.5px 1.5px at 58% 22%, #fff 50%, transparent), radial-gradient(1px 1px at 74% 12%, #fff 50%, transparent),
  radial-gradient(1px 1px at 88% 30%, #fff 50%, transparent), radial-gradient(1px 1px at 46% 36%, #fff 50%, transparent),
  radial-gradient(1.5px 1.5px at 6% 42%, #fff 50%, transparent), radial-gradient(1px 1px at 92% 6%, #fff 50%, transparent),
  radial-gradient(1px 1px at 24% 30%, #fff 50%, transparent), radial-gradient(1px 1px at 66% 4%, #fff 50%, transparent); }
.city { position: absolute; left: 50%; top: 0; will-change: transform; }
.city svg { display: block; }
.city::after { content: ''; display: block; height: 1400px; margin-top: -1px; background: var(--fill); }
.city.far { --fill: #4b5674; }
.city.near { --fill: #2a3147; }
.city.far { opacity: .55; }
.city.near { opacity: .85; }
.city .lit { opacity: var(--lit, .2); }
.clouds { position: absolute; inset: 0; will-change: transform; }
.cloud { position: absolute; width: calc(180px * var(--s)); height: calc(38px * var(--s)); border-radius: 40px; background: rgba(255,250,240,.5);
  box-shadow: calc(40px * var(--s)) calc(-12px * var(--s)) 0 calc(-2px * var(--s)) rgba(255,250,240,.5), calc(-38px * var(--s)) calc(-6px * var(--s)) 0 calc(-6px * var(--s)) rgba(255,250,240,.45);
  animation: drift linear infinite; }
@keyframes drift { from { transform: translateX(-30vw); } to { transform: translateX(30vw); } }
.tower-cam { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.tower-svg { overflow: visible; display: block; }
/* The veil: the scene is the window, never the wallpaper. Ink gathers where
   text sits and thins toward the lit tower, so the building and the words
   never compete. */
.scene-shade { background:
  linear-gradient(180deg, rgba(7,10,17,.5) 0, rgba(7,10,17,0) 120px),
  radial-gradient(ellipse 120% 90% at 50% 45%, transparent 55%, rgba(7,10,17,.45)); }
.scene::after { content: ''; position: absolute; inset: 0; background: var(--grain); opacity: .8; pointer-events: none; }
@media (min-width: 1080px) {
  body[data-view="home"] .scene-shade, body[data-view="other"] .scene-shade { background:
    linear-gradient(90deg, rgba(7,10,17,.92) 0%, rgba(7,10,17,.86) 34%, rgba(7,10,17,.5) 52%, rgba(7,10,17,.08) 68%, rgba(7,10,17,0) 100%),
    linear-gradient(180deg, rgba(7,10,17,.55) 0, rgba(7,10,17,0) 140px),
    linear-gradient(0deg, rgba(7,10,17,.5) 0, rgba(7,10,17,0) 30%); }
  body[data-view="play"] .scene-shade, body[data-view="results"] .scene-shade { background:
    linear-gradient(270deg, rgba(7,10,17,.7) 0%, rgba(7,10,17,.45) 30%, rgba(7,10,17,0) 55%),
    linear-gradient(180deg, rgba(7,10,17,.5) 0, rgba(7,10,17,0) 140px),
    radial-gradient(ellipse 120% 90% at 30% 50%, transparent 55%, rgba(7,10,17,.4)); }
}
@media (max-width: 1079px) {
  body[data-view="home"] .scene-shade, body[data-view="other"] .scene-shade { background:
    linear-gradient(180deg, rgba(7,10,17,.9) 0%, rgba(7,10,17,.78) 45%, rgba(7,10,17,.35) 75%, rgba(7,10,17,.2) 100%); }
  body[data-view="results"] .scene-shade { background: rgba(7,10,17,.55); }
}
.scene-pulse { opacity: 0; background: radial-gradient(ellipse 60% 50% at var(--px, 30%) 70%, color-mix(in srgb, var(--c, #fff) 30%, transparent), transparent 70%); }
.scene-pulse.go { animation: scenePulse 1.8s var(--ease); }
@keyframes scenePulse { 15% { opacity: 1; } 100% { opacity: 0; } }

/* the player and the people of the tower */
.tw-hero .hero-back { display: none; }
.tw-hero.back .hero-back { display: inline; }
.tw-hero.back .hero-front { display: none; }
.walking .lg.a { animation: legA .32s ease-in-out infinite alternate; }
.walking .lg.b { animation: legB .32s ease-in-out infinite alternate; }
.walking > g, .walking .p > g { animation: bob .16s ease-in-out infinite alternate; }
@keyframes legA { from { translate: -1.6px 0; } to { translate: 1.6px 0; } }
@keyframes legB { from { translate: 1.6px 0; } to { translate: -1.6px 0; } }
@keyframes bob { to { translate: 0 -1px; } }
.n-type .arm { animation: typeArm .5s ease-in-out infinite alternate; }
@keyframes typeArm { to { translate: 0 1.2px; } }
.n-talk > g { animation: talk 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes talk { 30% { rotate: -2deg; } 60% { rotate: 1.5deg; } }
.n-walk { animation-name: pace; animation-timing-function: linear; animation-iteration-count: infinite; }
@keyframes pace { 0%, 100% { translate: 0 0; } 50% { translate: var(--dx) var(--dy); } }
.taxi { animation: taxi 9s linear infinite; }
@keyframes taxi { from { translate: 0 0; } to { translate: var(--dx) var(--dy); } }
.blink { animation: glow 3.6s ease-in-out infinite; }
.blink2 { animation: glow 3s ease-in-out infinite; }
.led { animation: glow 2.8s ease-in-out infinite; }
.scr { animation: scr 6s ease-in-out infinite; }
@keyframes scr { 50% { opacity: .9; } }
@keyframes ledBlink { 50% { opacity: .25; } }
.beacon { animation: glow 2.6s ease-in-out infinite; }
/* lights breathe gently; nothing switches hard on/off (that read as a display glitch) */
@keyframes glow { 50% { opacity: .7; } }
.twinkle { transform-box: fill-box; transform-origin: center; animation: twinkle 2.4s ease-in-out infinite; }

/* elevator indicator + rank reveal: brass instruments on black lacquer */
.lift-ind {
  position: absolute; left: var(--ind-x, 50%); top: 86px; transform: translate(-50%, -8px); opacity: 0; transition: opacity .3s, transform .3s;
  display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 10px; padding: 10px 22px 9px; border-radius: 4px;
  background: #0b0d12; border: 1px solid rgba(184,145,74,.55); box-shadow: inset 0 0 0 3px #0b0d12, inset 0 0 0 4px rgba(184,145,74,.22), 0 14px 34px rgba(0,0,0,.4);
}
.lift-ind.show { opacity: 1; transform: translate(-50%, 0); }
.li-arrow { color: #e6a94a; font-size: 15px; }
.li-fl { font-family: var(--font-mono); font-size: 38px; line-height: 1; color: #f2c96a; min-width: 2.3ch; text-align: center; font-variant-numeric: tabular-nums; text-shadow: 0 0 12px rgba(242,201,106,.25); }
.li-place { grid-column: 1 / -1; justify-self: center; margin-top: 6px; font-family: var(--font-display); font-style: italic; font-size: 15px; color: #cfc6b3; }
.lift-ind.tick .li-place { animation: tick .5s var(--ease); }
.lift-ind.ding { border-color: rgba(242,201,106,.9); }
@keyframes tick { from { color: #f2c96a; transform: scale(1.08); } }
.rank-card {
  position: absolute; left: var(--ind-x, 50%); top: 30%; transform: translate(-50%, 10px); opacity: 0; transition: opacity .3s, transform .35s var(--ease);
  display: grid; justify-items: center; gap: 6px; padding: 24px 40px 22px; border-radius: 6px; text-align: center;
  background: var(--sheet); border: 1px solid color-mix(in srgb, var(--c) 50%, transparent);
  box-shadow: inset 0 0 0 5px var(--sheet), inset 0 0 0 6px color-mix(in srgb, var(--c) 25%, transparent), 0 24px 60px rgba(0,0,0,.5);
}
.rank-card.show { opacity: 1; transform: translate(-50%, 0); }
.rk-eyebrow { font-size: 12.5px; letter-spacing: .01em; color: var(--muted); }
.rk-name { font-family: var(--font-display); font-size: 46px; line-height: 1; font-weight: 400; letter-spacing: -0.01em; color: var(--c); }
.rk-place { font-family: var(--font-display); font-style: italic; font-size: 18px; color: var(--text-2); }

/* page content over the tower */
#app { transition: opacity .3s ease; }
body.climbing #app { opacity: 0; pointer-events: none; }
@media (min-width: 1080px) {
  body[data-view="play"] .play-wrap { max-width: 560px; margin: 28px 0 0 auto; }
  body[data-view="play"] .lift-ind, body[data-view="play"] .rank-card,
  body[data-view="results"] .lift-ind, body[data-view="results"] .rank-card { --ind-x: min(30vw, 470px); }
  body[data-view="results"] main { margin-left: auto; max-width: 660px; }
  body[data-view="results"] .statement { grid-template-columns: 1fr; }
  body[data-view="results"] .res-stats { border-left: 0; border-top: 1px solid var(--line); }
  body[data-view="results"] .top-answers { grid-template-columns: 1fr; }
  body[data-view="results"] .top-ans { padding: 14px 0; border-left: 0; border-top: 1px solid var(--line); }
  body[data-view="results"] .top-ans:first-child { border-top: 0; padding-top: 0; }
  body[data-view="results"] .ans .explain { grid-template-columns: 1fr; }
}

/* floor tag in the HUD */
.hud-floor { display: block; margin-top: 4px; font-size: 12.5px; color: var(--fl, var(--text-2)); font-weight: 600; white-space: nowrap; }
.hud-floor b { font-family: var(--font-mono); font-weight: 500; font-size: 12px; margin-right: 6px; color: var(--text-2); }

@media (max-width: 600px) {
  .li-fl { font-size: 32px; }
  .rv-tier { font-size: 40px; }
  .rv-pts { flex-wrap: wrap; justify-content: center; row-gap: 2px; }
  .profile-chip > span:not(.streak) { display: none; }
  .profile-chip { padding-right: 4px; }
  .rk-name { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .cloud, .taxi, .n-walk { animation: none !important; }
}

.rv-pts .fl { color: #ffcf6a; }
.input.suggest { border-color: rgba(255,207,106,.6); box-shadow: 0 0 0 3px rgba(255,207,106,.12); }
.q-hint .dym { color: #ffd98a; }
.q-hint .dym b { color: var(--text); font-weight: 600; }
.pref { display: inline-flex; align-items: center; gap: 10px; margin: 0 auto 18px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.pref input { width: 34px; height: 20px; appearance: none; -webkit-appearance: none; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.pref input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: transform .2s var(--ease), background .2s; }
.pref input:checked { background: rgba(217,182,106,.28); border-color: rgba(217,182,106,.55); }
.pref input:checked::after { transform: translateX(14px); background: var(--gold); }

/* phones and narrow windows: the tower rides in the top third during play */
@media (max-width: 1079px) {
  body[data-view="play"] .play-wrap { margin-top: calc(31vh - 70px); }
  body[data-view="play"] .rank-card { top: 9vh; }
  body[data-view="play"] .lift-ind { top: 70px; }
}
.rv-counted.fixed { color: #8fd8b0; }
.rv-egg { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--t-quant); border: 1px dashed currentColor; border-radius: 4px; padding: 3px 8px; margin: 2px 0; transform: rotate(-1.5deg); }
body.riding .rv-next:disabled { opacity: .55; }

.fish { animation: fish ease-in-out infinite alternate; }
@keyframes fish { to { translate: var(--fx) -2px; } }
.mote { animation: mote 6s ease-in-out infinite; opacity: 0; }
.bill { animation: bill 5s linear infinite; opacity: 0; transform-box: view-box; }
@keyframes bill { 0% { opacity: 0; translate: 0 -10px; } 10% { opacity: .95; } 85% { opacity: .9; } 100% { opacity: 0; translate: 6px 95px; } }
@keyframes mote { 0%, 100% { opacity: 0; translate: 0 4px; } 50% { opacity: .9; translate: 0 -6px; } }


/* career ladder: a slim gauge at the left edge, always showing how far up the firm you are */
.ladder { position: absolute; left: 12px; top: 92px; bottom: 44px; width: 18px; display: none; flex-direction: column; pointer-events: none; z-index: 1; }
body[data-view="play"] .ladder, body[data-view="results"] .ladder { display: flex; }
.ld-title { display: none; }
.ld-track { position: relative; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.ld-seg { position: relative; width: 8px; margin-left: 5px; border-radius: 3px; background: color-mix(in srgb, var(--c) 22%, rgba(10,13,22,.6)); transition: background .4s, box-shadow .4s, width .3s, margin .3s; min-height: 0; }
.ld-seg span { display: none; }
.ld-seg.done { background: color-mix(in srgb, var(--c) 75%, transparent); }
.ld-seg.now { width: 14px; margin-left: 2px; background: var(--c); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 70%, transparent); }
.ld-mark { position: absolute; left: 0; bottom: 0; transform: translateY(50%); display: flex; align-items: center; transition: bottom .25s linear; }
.ld-mark::before { content: ''; flex: none; width: 18px; height: 3px; background: var(--gold); box-shadow: 0 0 8px rgba(217,182,106,.6); }
.ld-mark b { margin-left: 6px; font: 500 11px var(--font-mono); color: #f2c96a; background: #0b0d12; border: 1px solid rgba(184,145,74,.6); padding: 3px 8px; border-radius: 3px; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.ld-mark b i { font: italic 400 13px var(--font-display); color: #e6dcc6; margin-left: 7px; }
body.riding .ld-mark { transition: none; }
@media (max-width: 1079px) {
  .ladder { left: 6px; top: 64px; bottom: auto; height: calc(31vh - 84px); min-height: 110px; }
  .ld-mark b i { display: none; }
}

/* promotion: a gold burst behind the rank card, and a flash on the player */
.promo-burst { position: absolute; left: var(--ind-x, 50%); top: calc(30% + 50px); width: 0; height: 0; pointer-events: none; }
@media (max-width: 1079px) { body[data-view="play"] .promo-burst { top: calc(9vh + 50px); } }
.promo-burst::before { content: ''; position: absolute; left: -160px; top: -160px; width: 320px; height: 320px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, rgba(255,214,120,.55) 0%, rgba(255,214,120,.12) 45%, transparent 70%); }
.promo-burst i { position: absolute; left: -3px; top: -6px; width: 6px; height: 12px; border-radius: 2px; background: var(--h); opacity: 0; }
.promo-burst.go::before { animation: promo-glow 1.6s ease-out; }
.promo-burst.go i { animation: promo-fly 1.4s cubic-bezier(.15,.7,.3,1) both; }
@keyframes promo-glow { 0% { opacity: 0; transform: scale(.3); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(1.3); } }
@keyframes promo-fly {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(0) rotate(0); }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--d))) rotate(540deg); }
}
.hero-burst circle { fill: #ffd36a; opacity: 0; }
.tw-hero.promoted .hero-burst circle { animation: hero-flash 1.2s ease-out; transform-box: fill-box; transform-origin: center; }
@keyframes hero-flash { 0% { opacity: .9; transform: scale(.2); } 100% { opacity: 0; transform: scale(2.2); } }
.hero-halo { animation: halo 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes halo { 50% { opacity: .28; transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .promo-burst.go i, .promo-burst.go::before, .hero-halo { animation: none !important; } }
