/* ANTEFALL interface. The scene is a full-screen canvas; this is the text and buttons laid over it.
   Colours come from the same palette as the pixel art (js/art.js). */

@font-face { font-family: 'Jersey 20'; src: url('../fonts/jersey-20-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2013-2014, U+2018-201D, U+2026, U+00D7; }
@font-face { font-family: 'Jersey 20'; src: url('../fonts/jersey-20-latin-ext-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0100-02AF, U+1E00-1EFF; }
@font-face { font-family: 'Jersey 10'; src: url('../fonts/jersey-10-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2013-2014, U+2018-201D, U+2026, U+00D7; }
@font-face { font-family: 'Jersey 10'; src: url('../fonts/jersey-10-latin-ext-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0100-02AF, U+1E00-1EFF; }

:root {
  --ink: #2b1830;
  --abyss: #2e1d3a;
  --deep: #3b2040;
  --plum: #582942;
  --plum-l: #6d3550;
  --butter: #fdf0c8;
  --paper: #f6e8c4;
  --dim: #c9aeb4;
  --sun: #ffd84a;
  --sun-d: #d99a2a;
  --rock: #cf6c3e;
  --red: #e0452f;
  --ok: #7fd66b;
  --text: 'Jersey 20', ui-monospace, 'Courier New', monospace;
  --display: 'Jersey 10', 'Jersey 20', ui-monospace, monospace;
  --step: 4px;
  --corner: polygon(0 var(--step), var(--step) var(--step), var(--step) 0, calc(100% - var(--step)) 0, calc(100% - var(--step)) var(--step), 100% var(--step), 100% calc(100% - var(--step)), calc(100% - var(--step)) calc(100% - var(--step)), calc(100% - var(--step)) 100%, var(--step) 100%, var(--step) calc(100% - var(--step)), 0 calc(100% - var(--step)));
  --panel-w: 580px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #d97a5c; overflow: hidden; overscroll-behavior: none; }
body { font-family: var(--text); font-size: 19px; line-height: 1.25; font-weight: 400; font-synthesis: none; font-variant-ligatures: none; letter-spacing: .2px; color: var(--butter); -webkit-font-smoothing: none; -webkit-text-size-adjust: 100%; touch-action: manipulation; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
b, strong, h1, h2, h3 { font-weight: 400; }

#app { position: fixed; left: 0; top: 0; width: 100%; height: 100%; overflow: hidden; }

/* ---------- stage: the whole screen ---------- */
#stage { position: absolute; inset: 0; overflow: hidden; background: #d97a5c; }
#scene { position: absolute; left: 0; top: 0; image-rendering: pixelated; image-rendering: crisp-edges; }

#hud {
  position: absolute; left: 0; right: 0; top: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
  color: var(--ink);
}
.hud-btn { background: none; border: 0; padding: 4px 2px; display: inline-flex; align-items: baseline; gap: 6px; color: var(--ink); }
.hud-btn.icon { width: 38px; height: 38px; justify-content: center; align-items: center; background: var(--butter); clip-path: var(--corner); box-shadow: inset 0 -3px 0 #e8c98a; }
.hud-btn.icon:active { transform: translateY(1px); }
.hud-btn.icon[aria-pressed="false"] { background: rgba(253, 240, 200, .45); box-shadow: none; }
.hud-btn.icon[aria-pressed="false"] .wave { display: none; }
.wordmark { font-family: var(--display); font-size: 30px; line-height: 1; letter-spacing: 1px; }
#hud-day { font-size: 16px; }
.hud-right { display: flex; align-items: center; gap: 10px; }
#hud-score { font-family: var(--display); font-size: 28px; line-height: 1; min-width: 1ch; text-align: right; }
#pips { display: flex; gap: 6px; align-items: center; }
#pips i { width: 13px; height: 13px; background: rgba(43, 24, 48, .2); display: block; }
#pips i.now { background: var(--butter); box-shadow: 0 0 0 2px var(--ink); }
#pips i.done { box-shadow: 0 0 0 2px var(--ink); }
#pips i.push { outline: 2px solid var(--butter); outline-offset: 2px; }
/* a 100 is a star, not a square: a pixel star with a dark rim, so it never reads as Close Call yellow */
#pips i.done.edge { box-shadow: none; background: none !important; position: relative; width: 15px; height: 15px; margin: -1px; }
#pips i.done.edge::before, #pips i.done.edge::after { content: ''; position: absolute; inset: 0; clip-path: polygon(50% 0, 63% 34%, 100% 38%, 71% 61%, 81% 100%, 50% 79%, 19% 100%, 29% 61%, 0 38%, 37% 34%); }
#pips i.done.edge::before { background: var(--ink); transform: scale(1.32); }
#pips i.done.edge::after { background: #ffe066; box-shadow: inset 0 -3px 0 #e0a020; }
[data-view="menu"] #pips, [data-view="menu"] #hud-score, [data-view="menu"] #btn-home, [data-view="boot"] #hud { visibility: hidden; }

#title { position: absolute; left: 0; right: 0; top: calc(max(54px, 8vh) + env(safe-area-inset-top)); z-index: 2; text-align: center; pointer-events: none; opacity: 0; visibility: hidden; color: var(--ink); }
[data-view="menu"] #title { opacity: 1; visibility: visible; }
.logo { font-family: var(--display); font-size: clamp(64px, min(30vw, 16vh), 180px); line-height: .8; letter-spacing: 2px; display: inline-flex; padding-right: .12em; }
.logo span { display: inline-block; text-shadow: .05em .05em 0 var(--butter); }
.logo span:last-child { transform-origin: 0% 100%; animation: tip 5.5s steps(1) infinite; }
@keyframes tip {
  0%, 52% { transform: rotate(0deg); }
  56% { transform: rotate(7deg) translateY(1px); }
  60% { transform: rotate(3deg); }
  64%, 100% { transform: rotate(14deg) translate(2px, 3px); }
}
.tagline { margin: 10px 0 0; font-size: 21px; }

/* the score that counts up after a roll */
#pop { position: absolute; left: 0; right: 0; top: 23%; z-index: 4; text-align: center; pointer-events: none; opacity: 0; }
#pop.on { opacity: 1; }
.pop-num { font-family: var(--display); font-size: clamp(96px, 26vw, 150px); line-height: .78; color: var(--ink); text-shadow: 5px 5px 0 var(--butter); font-variant-numeric: tabular-nums; }
.pop-tier { display: inline-block; margin-top: 12px; padding: 4px 14px 5px; font-size: 23px; color: var(--ink); background: var(--sun); clip-path: var(--corner); visibility: hidden; }
#pop.stamp .pop-tier { visibility: visible; animation: stamp .32s steps(4) both; }
#pop.stamp .pop-num { animation: thump .32s steps(3) both; }
@keyframes stamp { 0% { transform: scale(2.1) rotate(-8deg); } 60% { transform: scale(.9) rotate(2deg); } 100% { transform: none; } }
@keyframes thump { 0% { transform: scale(1.12); } 100% { transform: none; } }

#toast { position: absolute; left: 50%; top: calc(60px + env(safe-area-inset-top)); z-index: 6; transform: translateX(-50%); background: var(--ink); color: var(--butter); padding: 7px 14px; font-size: 17px; clip-path: var(--corner); opacity: 0; pointer-events: none; max-width: calc(100% - 24px); text-align: center; }
#toast.on { opacity: 1; }
#studio-flag { position: absolute; left: 8px; top: calc(52px + env(safe-area-inset-top)); z-index: 5; background: var(--red); color: #fff; font-size: 13.5px; padding: 2px 6px; }

/* timeline text, placed by js/timeline.js */
.tl-box { position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none; opacity: 0; color: var(--ink); }
.tl-box.on { opacity: 1; }
.tl-label { position: absolute; white-space: nowrap; line-height: 1.1; text-shadow: 1px 1px 0 var(--butter), -1px 1px 0 var(--butter), 1px -1px 0 var(--butter), -1px -1px 0 var(--butter), 0 2px 0 var(--butter), 2px 0 0 var(--butter), -2px 0 0 var(--butter), 0 -2px 0 var(--butter); }
.tl-flag, .tl-ans { display: flex; gap: 5px; font-size: 16.5px; }
.tl-flag b, .tl-ans b { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tl-flag span, .tl-ans span { flex: none; }
.tl-flag b { color: #a52a33; }
.tl-ans b { color: #183f6c; }
.tl-gap { left: 0; right: 0; text-align: center; font-family: var(--display); font-size: 30px; line-height: .9; letter-spacing: .5px; }
.tl-gap.good { color: #2c6e3a; }
.tl-gap.bad { color: #b4281f; }
.tl-tick { transform: translateX(-50%); font-size: 14px; opacity: .85; }
.tl-ctx { transform: translateX(-50%); font-size: 14px; max-width: 31%; overflow: hidden; text-overflow: ellipsis; color: #833741; }
.tl-ctx:not(:empty)::before { content: '\25C6\00a0'; font-size: 11px; }
.tl-scale { left: 0; right: 0; text-align: center; font-size: 14.5px; }

/* ---------- panel: a slab laid over the bottom of the scene ---------- */
#panel {
  position: absolute; left: 50%; bottom: 0; z-index: 5; transform: translateX(-50%);
  width: 100%; max-height: 74%; overflow-y: auto; overscroll-behavior: contain;
  padding: 12px max(16px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: var(--abyss);
  box-shadow: 0 -3px 0 var(--plum), 0 -6px 0 var(--ink);
  scrollbar-width: none;
}
#panel::-webkit-scrollbar { display: none; }
@media (min-width: 640px) {
  #panel { width: min(var(--panel-w), calc(100% - 32px)); bottom: calc(18px + env(safe-area-inset-bottom)); padding: 14px 20px 16px; box-shadow: 0 0 0 3px var(--plum), 0 0 0 6px var(--ink), 0 10px 0 6px rgba(43, 24, 48, .28); }
}
[data-view="boot"] #panel { visibility: hidden; }
.view { display: none; }
[data-view="menu"] .view[data-for="menu"],
[data-view="prompt"] .view[data-for="prompt"],
[data-view="rolling"] .view[data-for="rolling"],
[data-view="reveal"] .view[data-for="reveal"],
[data-view="results"] .view[data-for="results"] { display: block; animation: viewIn .18s steps(3) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.btn {
  display: block; width: 100%; margin: 10px 0 0; padding: 12px 14px 15px; border: 0;
  font-size: 21px; text-align: center; color: var(--butter);
  background: var(--plum); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .28), inset 0 3px 0 rgba(255, 255, 255, .06);
  clip-path: var(--corner);
}
.btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .28); }
.btn.primary { background: var(--sun); color: var(--ink); box-shadow: inset 0 -4px 0 var(--sun-d), inset 0 3px 0 rgba(255, 255, 255, .35); font-size: 23px; }
.btn.small { font-size: 18px; padding: 9px 8px 12px; }
.btn.danger { background: var(--red); color: #fff; box-shadow: inset 0 -4px 0 #a52a33, inset 0 3px 0 rgba(255, 255, 255, .25); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--dim); text-decoration: underline; text-underline-offset: 3px; }
.btn-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.btn-row.two { grid-template-columns: 1.4fr 1fr; }
.btn:focus-visible, .hud-btn:focus-visible, .link:focus-visible, a:focus-visible, .chip:focus-visible, #answer:focus-visible, #suggest li:focus-visible { outline: 3px solid #8fe0ee; outline-offset: 2px; }
.fine { margin: 12px 0 0; font-size: 15.5px; color: var(--dim); text-align: center; }
.fine a, .link, .rv-links a { color: var(--dim); text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; padding: 0; font-size: inherit; }

.prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 26px; }
.lead { margin: 2px 0 0; color: var(--dim); font-size: 18px; }
.lead .dir { color: var(--sun); font-weight: normal; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; white-space: nowrap; }
.lead .dir svg { width: 15px; height: 15px; margin-right: 4px; vertical-align: -1px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: square; shape-rendering: crispEdges; }
#app.typing.has-dir .lead { display: block; font-size: 16px; }
.chip { flex: none; border: 0; padding: 4px 10px 6px; font-size: 17px; color: var(--butter); background: var(--plum); clip-path: var(--corner); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .3); }
.chip::before { content: '\25B6\25B6\00a0'; font-size: 10px; vertical-align: 2px; letter-spacing: -2px; }
.chip[aria-pressed="true"] { background: var(--sun); color: var(--ink); box-shadow: inset 0 -3px 0 var(--sun-d); animation: armed 1.2s steps(2) infinite; }
@keyframes armed { 50% { background: #ffe680; } }
.target { margin: 2px 0 0; font-family: var(--display); font-size: clamp(36px, 10.5vw, 50px); line-height: .88; letter-spacing: .5px; color: var(--butter); text-wrap: balance; overflow-wrap: anywhere; }
.target-date { margin: 6px 0 0; font-size: 21px; color: var(--sun); }
.target-where { margin: 2px 0 0; font-size: 17px; color: var(--dim); }
.target-date:empty, .target-note:empty, .target-where:empty { display: none; }
.target-note { margin: 2px 0 0; font-size: 15.5px; color: var(--dim); }

.timer { height: 8px; margin: 10px 0 0; background: var(--deep); position: relative; }
.timer i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: var(--sun); transform-origin: 0 50%; }
.timer.low i { background: var(--red); }
.timer.off { display: none; }
.timer.paused i { background: var(--dim); }

#push-bar { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 8px 10px; background: var(--deep); clip-path: var(--corner); }
#push-bar .btn { width: auto; margin: 0; padding: 9px 16px 12px; font-size: 20px; flex: none; }
.pb-now { flex: 1 1 auto; min-width: 0; }
.pb-label { display: block; font-size: 14.5px; color: var(--dim); }
.pb-val { display: flex; align-items: center; gap: 8px; }
.pb-val b { font-family: var(--display); font-size: 34px; line-height: .8; color: var(--butter); }
.pb-tier { padding: 1px 8px 3px; font-size: 16px; color: var(--ink); background: var(--sun); clip-path: var(--corner); white-space: nowrap; }

.entry { margin-top: 10px; }
#answer {
  display: block; width: 100%; padding: 12px 12px 13px; border: 0; border-radius: 0;
  background: var(--paper); color: var(--ink); font-size: 22px;
  clip-path: var(--corner); outline-offset: -3px; box-shadow: inset 0 3px 0 rgba(43, 24, 48, .12);
}
#answer::placeholder { color: rgba(43, 24, 48, .48); }
#answer:disabled { opacity: .6; }
#suggest { list-style: none; margin: 6px 0 0; padding: 0; min-height: 0; }
#suggest li { display: flex; align-items: baseline; gap: 8px; padding: 9px 10px 10px; margin-top: 4px; background: var(--deep); cursor: pointer; min-height: 44px; }
#suggest li b { font-size: 19.5px; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#suggest li span { flex: 1 1 0; min-width: 0; font-size: 15px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#suggest li.active { background: var(--sun); color: var(--ink); }
#suggest li.active span { color: rgba(43, 24, 48, .7); }
#suggest li.near b { opacity: .55; text-decoration: line-through; text-decoration-thickness: 2px; }
#suggest li.near span { color: var(--red); }
#suggest li.none { background: transparent; color: var(--dim); cursor: default; font-size: 16.5px; padding-left: 2px; }
.prompt-foot { display: flex; justify-content: flex-end; margin-top: 6px; font-size: 16px; }
.prompt-foot:has(> [hidden]:only-child) { display: none; }

/* compact while the phone keyboard is open: keep the target readable, drop the extras */
#app.typing #title, #app.typing .lead, #app.typing .target-note, #app.typing .prompt-foot { display: none; }
#app.typing .prompt-head { min-height: 0; justify-content: flex-end; }
#app.typing .prompt-head .chip { position: absolute; right: 14px; top: 8px; font-size: 15px; }
#app.typing .target { font-size: 28px; line-height: .9; margin-top: 0; padding-right: 92px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#app.typing .target-date { font-size: 17px; margin-top: 3px; }
#app.typing .target-where { font-size: 15px; margin-top: 1px; }
#app.typing .timer { margin-top: 6px; }
#app.typing .entry { margin-top: 7px; }
#app.typing #suggest li { min-height: 40px; padding: 7px 10px 8px; }
#app.typing #panel { padding-top: 8px; padding-bottom: 8px; max-height: 82%; }
#app.typing #hud { padding-top: calc(4px + env(safe-area-inset-top)); }

.score-line { display: flex; align-items: center; gap: 12px; margin-top: 2px; flex-wrap: wrap; }
.score-num { font-family: var(--display); font-size: 66px; line-height: .8; color: var(--butter); min-width: 1.1ch; }
.score-tier { padding: 3px 10px 4px; font-size: 20px; color: var(--ink); background: var(--sun); clip-path: var(--corner); }
.score-push { font-size: 16px; color: var(--sun); }
.rv-line { margin: 8px 0 0; font-size: 18.5px; color: var(--paper); }
.rv-line b { color: var(--butter); }
.rv-line.dim { color: var(--dim); margin-top: 3px; font-size: 17px; }
.edge-line { margin-top: 8px; padding: 6px 9px 7px; background: var(--deep); font-size: 16.5px; color: var(--paper); clip-path: var(--corner); }
.edge-line:empty { display: none; }
.edge-line em { font-style: normal; color: var(--sun); }
.rv-actions { display: flex; align-items: center; gap: 14px; margin-top: 2px; }
.rv-actions .btn { flex: 1 1 auto; }
.rv-links { display: flex; flex-direction: column; gap: 4px; font-size: 15.5px; align-items: flex-end; flex: 0 0 auto; padding-top: 10px; }

.res-head { display: flex; align-items: baseline; gap: 8px; }
.res-total { font-family: var(--display); font-size: 88px; line-height: .8; color: var(--sun); }
.res-of { font-family: var(--display); font-size: 32px; color: var(--dim); }
.lanes { list-style: none; margin: 10px 0 2px; padding: 0; }
.lanes li { margin-top: 10px; }
.lane-top { display: flex; justify-content: space-between; gap: 10px; font-size: 17px; }
.lane-top span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane-top .pts { flex: none; white-space: nowrap; font-family: var(--display); font-size: 24px; line-height: .8; }
.lane-track { position: relative; height: 12px; margin-top: 4px; background: linear-gradient(90deg, var(--plum) 0 86%, transparent 86%); }
.lane-track::before { content: ''; position: absolute; left: 0; width: 86%; top: 0; height: 3px; background: #dcc79b; }
.lane-track::after { content: ''; position: absolute; left: 86%; top: -4px; width: 3px; height: 16px; background: var(--red); }
.lane-ball { position: absolute; top: -3px; left: var(--x); width: 10px; height: 10px; margin-left: -10px; background: #3aa6cf; box-shadow: inset 0 -3px 0 #fff4d6, 0 0 0 2px var(--ink); animation: laneRoll .9s cubic-bezier(.2, .7, .25, 1) both; animation-delay: calc(.25s + var(--i, 0) * .14s); }
@keyframes laneRoll { from { left: 0; } to { left: var(--x); } }
.res-total.land { animation: totalLand .32s steps(4) both; }
@keyframes totalLand { 0% { transform: scale(1.18); } 60% { transform: scale(.96); } 100% { transform: none; } }
.res-moment { margin: 8px 0 0; font-size: 17px; line-height: 1.25; color: var(--paper); }
.res-moment b { color: var(--sun); font-weight: normal; }
.res-moment strong { color: var(--sun); font-weight: normal; text-transform: none; }
.res-share { margin: 10px 0 0; font-size: 22px; letter-spacing: 2px; line-height: 1; }
.lane-ball.over { top: 7px; background: var(--red); box-shadow: 0 0 0 2px var(--ink); margin-left: 0; animation-name: laneOver; }
@keyframes laneOver { 0% { left: 0; top: -3px; } 75% { left: var(--x); top: -3px; } 100% { left: var(--x); top: 7px; } }
.lane-sub { margin-top: 5px; font-size: 15.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane-sub em { font-style: normal; color: var(--sun); }
.lane-btn { display: block; width: 100%; padding: 2px 0 4px; margin: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.lane-btn:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }
.chev { display: inline-block; width: 0; height: 0; margin-left: 10px; vertical-align: middle; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 8px solid var(--paper); opacity: .75; transition: transform .15s; }
.lane-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.lane-more { margin: 4px 0 6px; padding: 8px 10px 6px; background: rgba(0, 0, 0, .22); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .06); }
.lanes-hint { margin: 12px 0 -2px; font-size: 15px; color: var(--dim); }
.runners-head { margin: 0 0 6px; font-size: 15px; color: var(--dim); }
.runners-head b { color: var(--sun); font-weight: normal; }
.runners-you span { color: var(--dim); }
.runners { list-style: none; margin: 0; padding: 0; }
.runners li { display: flex; align-items: baseline; gap: 10px; padding: 4px 0; font-size: 16px; }
.runners li + li { border-top: 1px solid rgba(255, 255, 255, .07); }
.runners .rk { width: 16px; flex: none; color: var(--dim); text-align: center; }
.runners li:first-child .rk { color: var(--sun); }
.runners .nm { flex: 1; min-width: 0; }
.runners .nm small { display: block; color: var(--dim); font-size: 14px; }
.runners b { font-family: var(--display); font-weight: normal; font-size: 21px; color: var(--sun); }
.runners li.me .nm { color: var(--sun); }
.runners li.me .nm::after { content: ' \2190 you'; color: var(--dim); font-size: 14px; }
.runners-you, .runners-none { margin: 6px 0 0; font-size: 15px; color: var(--dim); }
.runners-you b { color: var(--paper); font-weight: normal; }
.lanes li.perfect .lane-top span:first-child { background: linear-gradient(100deg, var(--paper) 40%, #fff2a8 50%, var(--paper) 60%); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 1.6s ease-out 1.4s 1 both; }
@keyframes shine { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- sheets ---------- */
#sheet { position: absolute; inset: 0; z-index: 10; background: rgba(29, 18, 38, .72); display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { width: 100%; max-width: 620px; max-height: 88%; display: flex; flex-direction: column; background: var(--abyss); box-shadow: 0 -3px 0 var(--plum), 0 -6px 0 var(--ink); }
@media (min-width: 640px) { #sheet { align-items: center; } .sheet-card { box-shadow: 0 0 0 3px var(--plum), 0 0 0 6px var(--ink); max-height: 80%; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 4px; }
.sheet-head h2 { margin: 0; font-family: var(--display); font-size: 40px; line-height: .9; }
.sheet-head .btn { width: auto; margin: 0; padding-left: 14px; padding-right: 14px; }
.sheet-body { overflow-y: auto; padding: 4px 16px calc(18px + env(safe-area-inset-bottom)); font-size: 18.5px; }
.sheet-body p { margin: 10px 0 0; }
.sheet-body h3 { margin: 18px 0 0; font-size: 18px; color: var(--sun); }
.sheet-body b { color: var(--sun); }
.ladder { list-style: none; margin: 8px 0 0; padding: 0; }
.ladder li { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center; padding: 5px 0; }
.ladder i { width: 14px; height: 14px; display: block; }
.ladder span:last-child { font-family: var(--display); font-size: 23px; line-height: .8; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; text-align: center; }
.stat-grid b { display: block; font-family: var(--display); font-size: 46px; line-height: .85; color: var(--sun); }
.stat-grid span { font-size: 15px; color: var(--dim); }
.bars { margin-top: 8px; }
.bar { display: grid; grid-template-columns: 110px 1fr 28px; gap: 8px; align-items: center; font-size: 16px; padding: 3px 0; }
.bar i { display: block; height: 12px; min-width: 2px; }
.bar em { font-style: normal; text-align: right; }
.bars.runs .bar { grid-template-columns: 1fr auto; }
.daylist { list-style: none; margin: 8px 0 0; padding: 0; }
.daylist li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 2px solid var(--deep); }
.daylist .btn { width: auto; margin: 0; }
.daylist small { display: block; color: var(--dim); font-size: 15px; }
.daylist .pts { font-family: var(--display); font-size: 28px; line-height: .8; color: var(--sun); }
/* categories: one card per theme, its own colour and scene */
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.cat-card { display: block; padding: 0 0 10px; text-align: left; color: var(--butter); background: var(--deep); border: 0; clip-path: var(--corner); box-shadow: inset 0 0 0 3px var(--cc); cursor: pointer; }
.cat-card svg { display: block; width: 100%; height: auto; aspect-ratio: 64 / 28; image-rendering: pixelated; border-bottom: 3px solid var(--cc); }
.cat-card b { display: block; margin: 7px 10px 0; font-size: 20px; line-height: 1.05; color: var(--cc); }
.cat-card span { display: block; margin: 2px 10px 0; font-size: 15px; line-height: 1.15; color: var(--dim); }
.cat-card:active { transform: translateY(2px); }
@media (hover: hover) { .cat-card:hover b { text-decoration: underline; text-underline-offset: 3px; } }
#sheet-body a { color: var(--sun); text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .logo span:last-child { animation: none; transform: rotate(14deg) translate(2px, 3px); }
  #pop.stamp .pop-tier, #pop.stamp .pop-num, .chip[aria-pressed="true"], .view, .lane-ball, .res-total.land, .lanes li.perfect .lane-top span:first-child { animation: none !important; }
}

/* Studio feel-lab preview: just the scene */
#app.feel-mode #panel, #app.feel-mode #title, #app.feel-mode #hud { display: none; }

/* ---------- first game, timeline, calendar ---------- */
.coach { margin: 10px 0 4px; padding: 9px 12px; font-size: 16px; line-height: 1.3; color: var(--paper); background: rgba(255, 216, 74, .08); box-shadow: inset 3px 0 0 var(--sun); }
.coach b { color: var(--sun); font-weight: normal; }
.btn.small.wide { width: 100%; margin-top: 8px; }
.tl-era { margin: 14px 0 4px; font-family: var(--display); font-size: 26px; line-height: 1; color: var(--sun); }
.tl-list { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 3px solid var(--plum); }
.tl-list li { position: relative; display: flex; gap: 10px; align-items: baseline; padding: 3px 0; font-size: 16px; }
.tl-list li::before { content: ''; position: absolute; left: -20px; top: 9px; width: 9px; height: 9px; background: var(--plum-l); }
.tl-list li.seen2::before { background: var(--dim); }
.tl-list li.seen3::before { background: var(--sun); }
.tl-list .d { flex: none; width: 96px; color: var(--dim); font-size: 14.5px; }
.tl-list .n { flex: 1; min-width: 0; }
.tl-list .x { flex: none; color: var(--dim); font-size: 14px; }
.cal-head { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 0 6px; }
.cal-head b { font-family: var(--display); font-size: 26px; font-weight: normal; color: var(--paper); }
.cal-nav { display: flex; gap: 6px; }
.cal-nav button { width: 34px; height: 30px; padding: 0; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal span { font-size: 13px; color: var(--dim); text-align: center; }
.cal i { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; font-style: normal; font-size: 14px; color: var(--dim); background: var(--deep); }
.cal i.played { color: var(--ink); }
.cal i.today { box-shadow: inset 0 0 0 2px var(--paper); }
.cal i.empty { background: none; }

/* ---------- search ---------- */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#suggest li b { font-weight: normal; }
#suggest li mark { background: none; color: var(--sun); }
#suggest li.active mark { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
#suggest li.none { display: block; line-height: 1.3; }
#suggest li.none .link { font-size: inherit; color: var(--sun); }
.rv-fact { margin: 8px 0 2px; padding: 9px 12px; font-size: 16.5px; line-height: 1.32; background: var(--deep); box-shadow: inset 3px 0 0 var(--plum-l); animation: fact-in .45s steps(4) .5s both; }
@keyframes fact-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rv-fact { animation: none; } }

/* ---------- results ---------- */
.res-verdict { margin: 2px 0 0; font-family: var(--display); font-size: 30px; line-height: 1; color: var(--paper); }
.lane-top .pts .tg { font-style: normal; font-size: 13px; margin-right: 5px; vertical-align: 3px; opacity: .9; }
.tagline { text-shadow: 1px 1px 0 var(--butter), -1px 1px 0 var(--butter), 1px -1px 0 var(--butter), -1px -1px 0 var(--butter), 0 2px 0 var(--butter), 2px 0 0 var(--butter), -2px 0 0 var(--butter), 0 -2px 0 var(--butter); }

/* ---------- wardrobe ---------- */
.btn-row.two-eq { grid-template-columns: 1fr 1fr; }
.btn { position: relative; }
.new-dot { position: absolute; right: 8px; top: 8px; width: 10px; height: 10px; background: var(--sun); box-shadow: 0 0 0 2px var(--ink); animation: armed 1.2s steps(2) infinite; }
.wr-stage { display: flex; align-items: center; gap: 14px; margin: 2px 0 6px; }
.wr-stage canvas { width: 126px; height: 150px; image-rendering: pixelated; flex: none; background: var(--deep); clip-path: var(--corner); }
.wr-stage p { margin: 0; color: var(--dim); }
.wr-stage b { color: var(--butter); display: block; font-size: 24px; }
.wr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.wr-grid.times { grid-template-columns: repeat(3, 1fr); }
.wr-item { border: 0; background: var(--plum); clip-path: var(--corner); padding: 6px 4px 8px; min-height: 44px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; box-shadow: inset 0 -3px 0 rgba(0,0,0,.3); }
.wr-item canvas { image-rendering: pixelated; width: 63px; height: 72px; }
.wr-item.time img { width: 100%; height: auto; aspect-ratio: 300 / 190; image-rendering: auto; }
.wr-item .wn { font-size: 17px; }
.wr-item .wq { font-size: 14px; color: var(--dim); line-height: 1.05; }
.wr-item .wbar { width: 80%; height: 4px; background: var(--plum-l); margin-top: 3px; }
.wr-item .wbar i { display: block; height: 100%; background: var(--sun); }
.wr-item.on { background: var(--sun); color: var(--ink); box-shadow: inset 0 -3px 0 var(--sun-d); }
.wr-item.on .wq { color: var(--plum); }
.wr-item.locked { background: var(--deep); cursor: default; }
.wr-item.locked img { filter: brightness(.18) saturate(0); }
.wr-item.fresh::after { content: 'New'; position: absolute; top: 3px; right: 6px; font-size: 13px; color: var(--ink); background: var(--sun); padding: 0 4px 1px; }
.wr-item { position: relative; }
.wr-dev { margin-top: 16px; font-size: 16px; color: var(--dim); display: flex; gap: 8px; align-items: center; }
/* the unlock moment on the results screen */
.res-unlock { display: flex; align-items: center; gap: 12px; margin: 6px 0 10px; padding: 8px 10px; background: var(--deep); clip-path: var(--corner); animation: unlockIn .5s steps(5) both; }
.res-unlock canvas { width: 56px; height: 56px; image-rendering: pixelated; flex: none; }
.res-unlock .ru-tag { display: inline-block; background: var(--sun); color: var(--ink); font-size: 15px; padding: 0 6px 2px; margin-bottom: 2px; }
.res-unlock p { margin: 0; }
.res-unlock button { margin-left: auto; }
@keyframes unlockIn { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .res-unlock, .new-dot { animation: none !important; } }

/* the share button after a personal best: a little sparkle */
#btn-share.pb { animation: pbGlow 1.4s steps(2) 3; }
#btn-share.pb::after { content: ''; position: absolute; right: 10px; top: -6px; width: 10px; height: 10px; background: #fffdf2; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: pbStar .9s steps(3) infinite; }
@keyframes pbGlow { 50% { box-shadow: inset 0 -3px 0 var(--sun-d), 0 0 0 3px #fffdf2; } }
@keyframes pbStar { 0% { transform: scale(.4); } 50% { transform: scale(1.2) rotate(45deg); } 100% { transform: scale(.4); } }
@media (prefers-reduced-motion: reduce) { #btn-share.pb, #btn-share.pb::after { animation: none; } }

/* 44 px tap targets for the small links */
/* the links sit on their own row under Next */
.rv-actions { flex-wrap: wrap; }
.rv-actions .btn { flex: 1 1 100%; }
.rv-actions .rv-links { flex-direction: row; flex: 1 1 100%; justify-content: space-between; align-items: center; padding-top: 0; gap: 0 10px; font-size: 16px; }
.rv-links a, .rv-links .link, #menu-fine .link, #menu-fine a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; }
.report-pick { display: flex; flex-direction: column; align-items: flex-start; text-align: left; margin-top: 8px; width: 100%; }
.report-pick small { color: var(--dim); font-size: 16px; }
#answer.shake { animation: shake .32s steps(4); }
@keyframes shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
@media (prefers-reduced-motion: reduce) { #answer.shake { animation: none; } }

/* ---------- your timeline: clearing it ---------- */
.tl-clear { margin: 18px 0 4px; text-align: center; }
.tl-warn { text-align: left; background: var(--deep); color: var(--paper); padding: 10px 12px 12px; clip-path: var(--corner); }
.tl-warn p { margin: 0 0 10px; font-size: 16.5px; }
.tl-warn-btns { display: flex; gap: 8px; }
.tl-warn-btns .btn { flex: 1; }
