/* Bundled OFL fonts (assets/fonts). The canvas styles draw with the same family names. */
@font-face { font-family: "Barlow Condensed"; src: url("assets/fonts/BarlowCondensed-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("assets/fonts/BarlowCondensed-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("assets/fonts/BarlowCondensed-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("assets/fonts/BarlowCondensed-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("assets/fonts/Inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Barlow Semi Condensed"; src: url("assets/fonts/BarlowSemiCondensed-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow Semi Condensed"; src: url("assets/fonts/BarlowSemiCondensed-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Semi Condensed"; src: url("assets/fonts/BarlowSemiCondensed-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow Semi Condensed"; src: url("assets/fonts/BarlowSemiCondensed-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("assets/fonts/Barlow-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("assets/fonts/Barlow-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("assets/fonts/Barlow-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("assets/fonts/Barlow-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* Focused (default) wears the brakegod site tokens (ADR-0001). :root.arena (Arcade) swaps them to neon.
   A base rule Arcade also renders changes for Focused only via a token :root.arena restores, or :root:not(.arena). */
:root {
  --font: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif; /* also read by the canvas styles */
  --bg: #12100e;
  --text: #f1e9de;
  --dim: #aea395;
  --faint: #938a7d;
  --line: rgba(255, 214, 170, 0.17);
  --panel: rgba(26, 23, 20, 0.78);
  --chip: rgba(255, 214, 170, 0.05);
  --tint: 255 214 170; /* the hue of light fills and tracks: rgb(var(--tint) / a) */
  --brake: #ff4d5e;
  --throttle: #3ddc84;
  --steer: #6fa8ff;
  --gold: #ffb35c; /* amber: a data mark only */
  --epic: #c39bff;
  --gain: #9be15d;
  --coral: #ff8f7e;
  --accent: #ff4d5e; /* lamp red: the one action, focus and on-state */
  --accent-2: #ff6b79;
  --ink: #12100e; /* text on the accent */
  --veil: rgba(18, 16, 14, 0.8);
  --veil-edge: rgba(18, 16, 14, 0.5);
  --display: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --out: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --beat: 0; /* 1 on the beat of the music, decays to 0 (ui.js tick) */
}
:root.arena {
  --bg: #07030e;
  --text: #f6f0ff;
  --dim: rgba(236, 226, 255, 0.64);
  --faint: rgba(236, 226, 255, 0.36);
  --line: rgba(255, 110, 235, 0.2);
  --panel: rgba(16, 6, 28, 0.78);
  --chip: rgba(255, 60, 220, 0.08);
  --accent: #ff2bd6;
  --accent-2: #22e8ff;
  --ink: #fff;
  --veil: rgba(9, 3, 18, 0.8);
  --veil-edge: rgba(9, 3, 18, 0.46);
  --tint: 255 255 255;
  --brake: #ff3355;
  --throttle: #2dffa0;
  --steer: #3fc5ff;
  --gold: #ffcf5a;
  --epic: #d58cff;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: var(--body); user-select: none; cursor: default; -webkit-font-smoothing: antialiased;
}
#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }

/* The veil: the demo shows through, softly blurred; the text sits on the darker centre. */
#ui { position: fixed; inset: 0; display: none; place-items: center; }
#ui.on {
  display: grid; transition: opacity 0.22s ease;
  background: radial-gradient(ellipse 72% 82% at 50% 48%, var(--veil) 38%, var(--veil-edge));
}
/* The blur sits on its own layer under the screens: a backdrop-filter on #ui itself boxes the glowing text. */
#ui.on::after { content: ""; position: absolute; inset: 0; z-index: -1; backdrop-filter: blur(3px); pointer-events: none; }
/* ADR-0007 try step: the lane shows unveiled; the line sits left of the ball's column (CURSOR_X 760 of the 1920x1080 frame). */
#ui.on.bare { background: none; }
#ui.on.bare::before, #ui.on.bare::after { display: none; }
.try {
  --u: min(100vw / 1920, 100vh / 1080);
  position: fixed; right: calc(100vw - (100vw - 1920 * var(--u)) / 2 - 700 * var(--u)); top: calc(50vh - 40px);
  text-align: right; max-width: calc(640 * var(--u));
}
.try .row { justify-content: flex-end; }
#ui.leaving { opacity: 0; pointer-events: none; }
/* Results: a heavier veil and blur, so callouts left from the run do not compete with the card. */
#ui.on.deep { background: radial-gradient(ellipse 85% 95% at 50% 48%, var(--veil) 55%, rgba(7, 4, 14, 0.8)); }
#ui.on.deep::after { backdrop-filter: blur(14px) saturate(0.7); }
:root:not(.arena) #ui.on.deep { background: radial-gradient(ellipse 85% 95% at 50% 48%, var(--veil) 55%, rgba(18, 16, 14, 0.85)); }
/* Arena: the edges glow on the beat. Opacity only, so the pulse costs no repaint. */
:root.arena #ui.on::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 90% at 50% 50%, transparent 55%, rgba(255, 43, 214, 0.22) 85%, rgba(34, 232, 255, 0.18));
  opacity: calc(0.35 + 0.65 * var(--beat));
}

/* Screens share one grid cell, so the old one fades out under the new one. */
.screen { grid-area: 1 / 1; position: relative; width: min(1240px, 94vw); max-height: 94dvh; overflow-y: auto; overflow-x: hidden; padding: 8px 12px; }
.screen.enter { animation: scr-in 0.28s ease both; }
.screen.out { animation: scr-out 0.18s ease both; pointer-events: none; }
@keyframes scr-in { from { opacity: 0; } }
@keyframes scr-out { to { opacity: 0; transform: translateY(-8px) scale(0.99); } }
/* Staggered entry (ui.js sets .st and --i). Casual rises a little; arena slides in fast. */
.screen.enter .st { animation: st-in 0.46s var(--out) both; animation-delay: calc(40ms + var(--i) * 34ms); }
@keyframes st-in { from { opacity: 0; transform: translateY(12px); } }
:root.arena .screen.enter .st { animation-name: st-arena; animation-duration: 0.38s; animation-delay: calc(30ms + var(--i) * 28ms); }
@keyframes st-arena { from { opacity: 0; transform: translateX(-26px) skewX(-6deg); } 60% { opacity: 1; } }
.screen.enter .cards > .st { animation-name: st-card; }
@keyframes st-card { from { opacity: 0; transform: translateY(26px) scale(0.94); } }
/* A skipped result reveal: every staged part at its end state at once. */
.screen.skip .st, .screen.skip [data-stage], .screen.skip .res, .screen.skip .res-grade::before, .screen.skip .res-grade::after { animation: none !important; transition: none !important; }
.screen::-webkit-scrollbar { width: 8px; }
.screen::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* ---------------------------------------------------------------- type */
h1.logo {
  font-family: var(--display); font-weight: 800; font-size: clamp(44px, min(7vw, 11vh), 112px); letter-spacing: 0.12em;
  margin: 0; line-height: 0.9; color: var(--text); padding-bottom: 12px; display: inline-block; position: relative;
}
/* The pedal cross sits in the word (apps/web/src/components/brand-mark.module.css); Focused sets the lockup, no underline. */
h1.logo svg { width: 0.56em; height: 0.902em; margin: 0 0.04em; vertical-align: -0.202em; fill: var(--brake); }
:root:not(.arena) h1.logo { letter-spacing: -0.015em; line-height: 1; padding-bottom: 0; white-space: nowrap; }
:root.arena h1.logo {
  color: #fff;
  text-shadow: 0 0 2px #fff, 0 0 calc(10px + 10px * var(--beat)) var(--accent), 0 0 calc(28px + 24px * var(--beat)) rgba(255, 43, 214, 0.7), 3px 0 18px rgba(34, 232, 255, 0.5);
}
:root.arena h1.logo { transform: scale(calc(1 + var(--beat) * 0.012)); }
:root.arena h1.logo::after {
  content: ""; position: absolute; left: 0; right: 0.12em; bottom: 0; height: 4px; border-radius: 2px; opacity: calc(0.7 + 0.3 * var(--beat));
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 calc(10px + 16px * var(--beat)) var(--accent);
}
h1.logo + h2 { margin-top: 30px; }
/* The first screen after load (main.js boot): one big line that breathes until a click or key. */
.gate { text-align: center; }
.gate .lead { margin: 0 auto 32px; max-width: 34ch; font-size: 18px; text-wrap: balance; }
.gate button { margin: 0 auto; }
.gate .hint { margin-inline: auto; }
.press {
  font-family: var(--display); font-weight: 700; font-size: clamp(30px, min(5vw, 8vh), 72px); letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text); line-height: 1.1; text-wrap: balance; max-width: none; margin: 0; padding-bottom: 18px;
  display: inline-block; position: relative; animation: breathe 1.4s ease-in-out infinite alternate;
}
.press::after { content: ""; position: absolute; left: 20%; right: calc(20% + 0.14em); bottom: 0; height: 3px; border-radius: 2px; background: var(--accent); }
@keyframes breathe { from { opacity: 0.45; } }
:root.arena .press { color: #fff; text-shadow: 0 0 2px #fff, 0 0 18px var(--accent), 0 0 40px rgba(255, 43, 214, 0.6); }
:root.arena .press::after { background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 14px var(--accent); }
.tag { letter-spacing: 0.24em; color: var(--dim); font-size: 14px; margin: 10px 0 40px 4px; text-transform: uppercase; }
h2 { font-family: var(--display); font-weight: 700; font-size: clamp(32px, 3.2vw, 52px); letter-spacing: 0.05em; text-transform: uppercase; margin: 0 0 26px; line-height: 1; }
:root.arena h2 { text-shadow: 0 0 22px rgba(255, 43, 214, 0.45); }
/* ADR-0007: a Drills section is a group: more air above its heading than between it and its cards. */
h3.sec { margin-top: 48px; }
h3.sec:first-of-type { margin-top: 28px; }
h3 { font-family: var(--display); font-size: 15px; letter-spacing: 0.16em; color: var(--dim); margin: 28px 0 10px; text-transform: uppercase; font-weight: 600; }
p { color: var(--dim); font-size: 16px; line-height: 1.5; margin: 6px 0; max-width: 75ch; }
b { font-weight: 600; }
.sub { font-family: var(--display); font-weight: 600; color: var(--dim); letter-spacing: 0.16em; font-size: 16px; text-transform: uppercase; }
.gold { color: var(--gold); } .red { color: var(--brake); } .green { color: var(--throttle); } .blue { color: var(--steer); }
.alert { color: var(--coral); font-size: 19px; max-width: 70ch; }

.row { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; }
.menu { display: grid; grid-template-columns: minmax(300px, 460px) minmax(0, 580px); gap: 88px; align-items: start; margin-top: clamp(28px, 6vh, 60px); }
.actions { margin-top: 36px; }
.hows { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; max-width: 900px; }
.how { display: flex; flex-direction: column; gap: 4px; }
.how .pic { width: 100%; max-width: 220px; height: auto; margin-bottom: 10px; }
.how b { font-family: var(--display); font-size: 24px; letter-spacing: 0.04em; font-weight: 700; text-transform: uppercase; }
.how span { color: var(--dim); font-size: 15px; }
.keys { gap: 18px; margin-top: 18px; }
.key { color: var(--dim); font-size: 14px; }
kbd { font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--text); border: 1px solid var(--line); border-radius: 5px; padding: 2px 8px; margin-right: 8px; letter-spacing: 0.06em; }
/* Options: grouped cards, two columns (Sound and Display left, Controls right), Advanced across the bottom. */
.opts { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: dense; gap: 16px; width: min(1180px, 92vw); align-items: start; }
.oset { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 22px 12px; }
.oset > h3:first-child { margin: 0 0 8px; }
.oset:nth-child(3) { grid-column: 2; grid-row: 1 / span 2; }
.oset.wide { grid-column: 1 / -1; }
.opts summary { font-family: var(--display); font-size: 15px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; color: var(--dim); padding: 2px 0 6px; }
details.oset[open] > summary { margin-bottom: 8px; }
:root.arena .oset {
  border: 1px solid transparent;
  background: linear-gradient(160deg, rgba(30, 8, 46, 0.86), rgba(10, 4, 22, 0.86)) padding-box, linear-gradient(120deg, rgba(255, 43, 214, 0.55), rgba(122, 60, 255, 0.3) 50%, rgba(34, 232, 255, 0.45)) border-box;
  box-shadow: 0 0 28px rgba(255, 43, 214, 0.12);
}
/* Segmented control: few choices side by side, the chosen one filled. */
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 10px; background: rgb(var(--tint) / 0.05); border: 1px solid var(--line); justify-self: start; }
.seg button { white-space: nowrap; font-size: 16px; padding: 7px 16px; border-radius: 7px; background: transparent; color: var(--dim); letter-spacing: 0.06em; }
.seg button:hover:not(:disabled) { color: var(--text); background: rgb(var(--tint) / 0.06); }
.seg button.on { background: var(--accent); color: var(--ink); }
:root.arena .seg button.on { background: linear-gradient(90deg, var(--accent), #7a3cff); color: #fff; box-shadow: 0 0 16px rgba(255, 43, 214, 0.55); }
.seg button:disabled { opacity: 0.35; cursor: not-allowed; }
/* On/off switch. */
.switch { justify-self: start; width: 52px; height: 28px; padding: 0; border-radius: 14px; background: rgb(var(--tint) / 0.1); border: 1px solid var(--line); position: relative; }
.switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--dim); transition: transform 0.18s var(--out), background 0.18s; }
.switch.on { background: var(--accent); border-color: transparent; }
.switch.on i { transform: translateX(24px); background: #fff; }
:root.arena .switch.on { background: linear-gradient(90deg, var(--accent), #7a3cff); box-shadow: 0 0 14px rgba(255, 43, 214, 0.55); }
.switch:hover:not(.on) { background: rgb(var(--tint) / 0.16); }
.instr { font-size: clamp(20px, 2.2vw, 30px); color: var(--text); margin: 0 0 28px; }
.bar.big { height: 22px; border-radius: 11px; max-width: 760px; }
/* Three groups by distance: the fixes sit at the bar, the step buttons below, the way out at the far end. */
.fix { gap: 8px; margin-top: 12px; }
button.quiet { margin-left: auto; background: transparent; color: var(--dim); }
button.quiet:hover { color: var(--text); background: transparent; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.tile { border: 1px solid var(--line); background: var(--chip); border-radius: 10px; padding: 16px 18px; cursor: pointer; opacity: 0.7; transition: opacity 0.12s, border-color 0.12s, background 0.12s; }
.tile:hover { opacity: 1; }
.tile.on { opacity: 1; border-color: var(--accent); background: rgba(255, 77, 94, 0.08); box-shadow: inset 3px 0 0 var(--accent); }
:root.arena .tile.on { background: rgba(255, 43, 214, 0.1); box-shadow: inset 3px 0 0 var(--accent), 0 0 22px rgba(255, 43, 214, 0.25); }
.tile b { display: block; font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.tile span { display: block; margin-top: 4px; font-size: 14px; color: var(--dim); }
.a { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; cursor: pointer; }
.acct { margin-top: 12px; line-height: 2.2; } .acct .small { margin-left: 10px; } /* the account line (ui.js) */
.opt.acct-row { grid-template-columns: 190px 1fr auto; } /* "Full stats ↗" is wider than the value column */

/* Main menu (casual): a clean list; the line in focus slides right behind an accent bar. */
.nav { gap: 2px; }
.nav button { text-align: left; background: transparent; white-space: nowrap; position: relative; }
.nav .primary, .nav .weekly { font-size: 28px; padding: 16px 24px; }
.nav .weekly { background: rgb(var(--tint) / 0.05); margin-top: 6px; }
.nav .link { font-size: 26px; font-weight: 600; color: var(--dim); padding: 8px 24px; transition: color 0.15s, padding 0.2s var(--out), background 0.15s; }
.nav button:not(.primary)::before {
  content: ""; position: absolute; left: 0; top: 20%; bottom: 20%; width: 4px; border-radius: 2px; background: var(--accent);
  transform: translateX(-10px) scaleY(0.2); opacity: 0; transition: transform 0.2s var(--out), opacity 0.15s;
}
.nav button:not(.primary):is(:hover, .sel)::before { transform: none; opacity: 1; }
.nav button:not(.primary):is(:hover, .sel) { color: var(--text); background: linear-gradient(90deg, rgba(255, 77, 94, 0.1), transparent 80%); }
.nav .link:is(:hover, .sel) { padding-left: 34px; }
.nav .primary.sel { box-shadow: 0 0 0 2px var(--text), 0 0 0 calc(2px + var(--beat) * 5px) rgba(255, 77, 94, 0.3), 0 6px 24px rgba(255, 77, 94, 0.25); }
.nav .gap { height: 20px; }
.nav .exits { margin-top: 18px; }
/* The dashboard cards of the menu. */
.dash { gap: 18px; }
.mcard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px 26px; text-align: left; }
.mcard > .lab { margin-bottom: 14px; }
.stats4 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 32px; }
.stats4 .stat b { font-size: 42px; }
.mcard .pedals { grid-template-columns: 110px 1fr; }

/* Main menu (gamified): a centred neon title, a hero START, a row of links, two glowing cards. */
.menu-arena { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 0 16px; }
.menu-arena h1.logo { font-size: clamp(64px, min(10vw, 14vh), 168px); }
.herobtns { display: flex; flex-direction: column; gap: 12px; width: min(560px, 90vw); margin-top: clamp(24px, 4vh, 44px); }
.herobtns button { justify-content: center; position: relative; overflow: hidden; }
.herobtns .k { position: absolute; right: 20px; }
.herobtns .primary { font-size: 36px; padding: 20px 28px; letter-spacing: 0.14em; }
.herobtns .primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent); animation: shine 3.2s ease-in-out infinite;
}
@keyframes shine { 0%, 55% { left: -40%; } 100% { left: 130%; } }
.herobtns .primary:is(:hover, .sel) { transform: scale(1.02); }
.herobtns .primary.sel { box-shadow: 0 0 0 2px #fff, 0 0 calc(22px + 22px * var(--beat)) rgba(255, 43, 214, 0.7), 0 0 60px rgba(34, 232, 255, 0.25); }
.herobtns .weekly { font-size: 23px; background: rgba(255, 43, 214, 0.06); border: 1px solid var(--line); }
.herobtns .weekly:is(:hover, .sel) { border-color: var(--accent-2); box-shadow: 0 0 20px rgba(34, 232, 255, 0.35); background: rgba(34, 232, 255, 0.08); }
:root:not(.arena) .herobtns .primary.sel { box-shadow: 0 0 0 2px var(--text), 0 0 calc(22px + 22px * var(--beat)) rgba(255, 77, 94, 0.5); }
:root:not(.arena) .herobtns .weekly { background: rgb(var(--tint) / 0.05); }
:root:not(.arena) .herobtns .weekly:is(:hover, .sel) { box-shadow: 0 0 20px rgba(255, 77, 94, 0.3); background: rgba(255, 77, 94, 0.08); }
.linkrow { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; margin-top: 22px; }
.linkrow .link { background: transparent; font-size: 22px; color: var(--dim); padding: 8px 14px; position: relative; transition: color 0.15s, text-shadow 0.15s; }
.linkrow .link::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; border-radius: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 10px var(--accent); transform: scaleX(0); transition: transform 0.22s var(--out);
}
.linkrow .link:is(:hover, .sel) { color: #fff; background: transparent; text-shadow: 0 0 14px var(--accent); }
.linkrow .link:is(:hover, .sel)::after { transform: none; }
:root.arena .linkrow { gap: 6px 10px; margin-top: 26px; }
:root.arena .linkrow .link { font-size: 27px; font-weight: 800; letter-spacing: 0.1em; color: rgba(255, 236, 252, 0.78); padding: 10px 18px; }
:root.arena .linkrow .link::after { height: 3px; bottom: 0; box-shadow: 0 0 12px var(--accent), 0 0 4px var(--accent-2); }
:root.arena .linkrow .link:is(:hover, .sel) { text-shadow: 0 0 18px var(--accent), 0 0 4px rgba(255, 255, 255, 0.6); transform: translateY(-1px); }
/* The drills button: a paler sibling of Weekly; the bottom exit links: small and quiet (ADR-0007). */
.weekly .note { display: block; margin-top: 4px; font-size: 13px; font-weight: 400; line-height: 1.3; text-transform: none; letter-spacing: 0; }
.weekly.drills { opacity: 0.68; transition: opacity 0.15s; }
.weekly.drills:is(:hover, .sel) { opacity: 1; }
.exits { display: flex; flex-direction: column; align-items: center; margin-top: 6px; }
.exits .link { background: transparent; font-size: 15px; color: var(--dim); padding: 2px 14px; }
.exits .link:is(:hover, .sel) { color: var(--text); background: transparent; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.nav .exits { align-items: flex-start; }
.nav .exits .link { font-size: 18px; padding: 4px 24px; }
/* The menu's top-right icon buttons (ADR-0007). Last in the arrow order, so Start run keeps the first focus. */
.topbar { position: fixed; top: calc(3dvh + 8px); right: calc((100vw - min(1240px, 94vw)) / 2 + 12px); display: flex; gap: 6px; z-index: 1; }
.topbar .icon { width: 44px; height: 44px; padding: 0; display: flex; align-items: center; justify-content: center; background: transparent; color: var(--dim); font-family: var(--display); font-size: 24px; font-weight: 800; border-radius: 50%; transition: color 0.15s, box-shadow 0.15s; }
/* ADR-0007: every topbar (menu icons, tutorial speaker, Drills close) sits at one fixed spot; the screen scrolls under it */
.topbar.pin .icon { width: auto; gap: 6px; padding: 0 10px 0 12px; border-radius: 22px; background: var(--veil); }
.topbar .icon svg { width: 24px; height: 24px; }
.topbar .icon:is(:hover, .sel) { color: var(--text); box-shadow: 0 0 0 2px var(--accent); }
:is(.topbar, #runbar) .vol .off, :is(.topbar, #runbar) .vol.muted .on { display: none; }
:is(.topbar, #runbar) .vol.muted .off { display: inline; }
.volpop { position: absolute; top: 100%; right: 0; margin-top: 6px; width: min(300px, 88vw); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px 16px; backdrop-filter: blur(10px); animation: volin 0.15s ease-out; }
.volpop[hidden] { display: none; }
.volpop .opt { grid-template-columns: 62px 1fr 52px; gap: 10px; }
.volpop .opt > span:last-child { font-size: 17px; }
:root.arena .volpop { border-color: rgba(255, 43, 214, 0.5); box-shadow: 0 0 24px rgba(255, 43, 214, 0.2); }
@keyframes volin { from { opacity: 0; transform: translateY(-4px); } }
@keyframes volfade { from { opacity: 0; } }

/* Run bar (runbar.js): the in-run controls over the canvas. Idle at --faint; a pointer move wakes it (.awake). */
/* Placed on the 16:9 game frame, as the canvas letterboxes it (style-1 Renderer.resize): px per logical unit --u,
   the bar's centre on the title row (y 46 of 1080), right inset 24. */
#runbar {
  --u: min(100vw / 1920, 100vh / 1080);
  position: fixed; top: calc((100vh - 1080 * var(--u)) / 2 + 46 * var(--u) - 22px); right: calc((100vw - 1920 * var(--u)) / 2 + 24 * var(--u)); z-index: 2; pointer-events: none; color: var(--faint); transition: color 0.15s; }
#runbar[hidden] { display: none; }
#runbar.awake { color: var(--text); }
#runbar .rb { position: relative; display: flex; align-items: center; gap: 4px; }
#runbar button {
  pointer-events: auto; height: 44px; min-width: 44px; padding: 0; justify-content: center; gap: 8px; border-radius: 22px;
  background: transparent; color: inherit; transition: color 0.15s, box-shadow 0.15s, background-color 0.08s;
}
#runbar button svg { width: 22px; height: 22px; }
#runbar button.pause { padding: 0 12px 0 10px; }
.topbar.pin kbd, #runbar kbd { margin: 0; padding: 1px 5px 3px; border-color: currentColor; border-radius: 4px; color: inherit; font-weight: 600; font-size: 12px; letter-spacing: 0.08em; opacity: 0.85; }
#runbar .sep { width: 1px; height: 20px; margin: 0 6px; background: var(--line); }
#runbar button:hover { color: var(--text); background: transparent; box-shadow: 0 0 0 2px var(--accent); }
#runbar button:active { transform: none; background: rgb(var(--tint) / 0.1); }
#runbar button[aria-expanded="true"] { color: var(--text); background: rgb(var(--tint) / 0.08); box-shadow: inset 0 0 0 1px rgb(var(--tint) / 0.3); }
#runbar .say { position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 14px; font-weight: 500; color: var(--text); }
#runbar .say span { color: var(--dim); }
#runbar .volpop { pointer-events: auto; margin-top: 8px; width: 300px; padding: 4px 16px 10px; border-radius: 4px; background: rgba(24, 21, 18, 0.97); backdrop-filter: none; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45); color: var(--text); }
#runbar .volpop .opt + .opt { border-top-color: rgb(var(--tint) / 0.05); }
#runbar .volpop .note { margin: 6px 0 0; padding-top: 8px; border-top: 1px solid rgb(var(--tint) / 0.05); font-size: 13px; color: var(--faint); }
:root.arena #runbar button:hover { color: #fff; box-shadow: 0 0 0 2px var(--accent), 0 0 14px var(--accent); }
:root.arena .topbar .icon:is(:hover, .sel) { color: #fff; box-shadow: 0 0 0 2px var(--accent), 0 0 14px var(--accent); }
.cardrow { display: grid; grid-template-columns: 1fr; width: min(560px, 94vw); margin-top: 28px; }
:root.arena .mcard {
  border: 1px solid transparent;
  background: linear-gradient(160deg, rgba(30, 8, 46, 0.88), rgba(10, 4, 22, 0.88)) padding-box, linear-gradient(120deg, rgba(255, 43, 214, 0.7), rgba(122, 60, 255, 0.4) 50%, rgba(34, 232, 255, 0.6)) border-box;
  box-shadow: 0 0 34px rgba(255, 43, 214, 0.16);
}

.set { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: center; margin-top: 24px; font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: 0.14em; color: var(--dim); text-transform: uppercase; }
.set .row { gap: 6px; }

/* ---------------------------------------------------------------- controls */
button {
  font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: 0.07em; color: var(--text);
  background: rgb(var(--tint) / 0.06); border: 0; border-radius: 8px; padding: 11px 20px; cursor: pointer;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s, transform 0.08s; text-transform: uppercase;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
}
button:hover, button.sel { background: rgb(var(--tint) / 0.13); }
button:active { transform: scale(0.97); }
button:focus-visible, select:focus-visible, input:focus-visible, .card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.primary {
  background: var(--accent); color: var(--ink);
  box-shadow: 0 0 0 calc(var(--beat) * 4px) rgba(255, 77, 94, 0.22), 0 6px 24px rgba(255, 77, 94, 0.18);
}
button.primary:hover { background: var(--accent); filter: brightness(1.1); }
:root:not(.arena) button.primary:hover { background: var(--accent-2); filter: none; }
:root.arena button.primary {
  background: linear-gradient(100deg, #ff2bd6, #9a3cff 58%, #3d7bff); color: #fff; text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 calc(14px + 18px * var(--beat)) rgba(255, 43, 214, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
button.small { font-size: 15px; padding: 7px 12px; letter-spacing: 0.08em; white-space: nowrap; }
button.small.sel { background: var(--text); color: var(--bg); }
:root.arena button.small.sel { background: var(--accent); color: #fff; box-shadow: 0 0 16px rgba(255, 43, 214, 0.45); }
button:disabled { opacity: 0.35; cursor: default; transform: none; }
button .k { font-family: var(--body); color: var(--dim); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; }
button.primary .k { color: currentColor; opacity: 0.7; }

/* A panel is a group, not a box. Space and a small heading separate the groups. */
.panel { min-width: 0; }
.row:has(> .panel) { gap: 24px 56px; }
.panel.coach { border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); border-radius: 10px; padding: 18px 22px; background: color-mix(in srgb, var(--gold) 4%, transparent); }
.panel.coach > h3:first-child { margin-top: 0; }
details { margin-top: 10px; }
summary { font-family: var(--display); font-weight: 600; letter-spacing: 0.12em; color: var(--dim); font-size: 15px; cursor: pointer; text-transform: uppercase; }
summary:hover { color: var(--text); }
.stat { min-width: 140px; }
.stat b { display: block; font-family: var(--display); font-weight: 700; font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-family: var(--display); font-weight: 600; color: var(--dim); font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; }

/* Cards: the style picker, the hardware choice and the perks of the pit. */
.cards { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 18px; margin: 18px 0; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 22px; cursor: pointer; min-height: 210px;
  transition: transform 0.16s var(--out), border-color 0.12s, box-shadow 0.16s; position: relative;
}
.card:hover, .card.sel { border-color: var(--accent); box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5), inset 0 2px 0 var(--accent); }
:root.arena .card:hover, :root.arena .card.sel { box-shadow: 0 0 0 1px var(--accent), 0 0 34px rgba(255, 43, 214, 0.35), inset 0 0 40px rgba(255, 43, 214, 0.1); }
.card .badge { width: 62px; height: 62px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 28px; font-weight: 800; border: 2px solid currentColor; margin-bottom: 14px; }
.card .name { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.card .rar { font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: 0.24em; margin: 3px 0 10px; }
.card .key { position: absolute; top: 14px; right: 16px; color: var(--dim); font-family: var(--display); font-weight: 700; font-size: 15px; border: 1px solid var(--line); border-radius: 5px; padding: 1px 8px; }
.card p { color: var(--text); opacity: 0.82; font-size: 15px; }
.r0 { color: #9fb0c8; } .r1 { color: #58b7ff; } .r2 { color: var(--epic); }
:root:not(.arena) .r0 { color: var(--faint); } :root:not(.arena) .r1 { color: var(--text); }
.card.r1 { border-color: rgba(88, 183, 255, 0.45); box-shadow: inset 0 0 30px rgba(88, 183, 255, 0.07); }
.card.r2 { border-color: rgba(213, 140, 255, 0.55); box-shadow: inset 0 0 36px rgba(213, 140, 255, 0.1); }
:root.arena .card.r1 { box-shadow: 0 0 22px rgba(88, 183, 255, 0.25), inset 0 0 30px rgba(88, 183, 255, 0.1); }
:root.arena .card.r2 { box-shadow: 0 0 28px rgba(213, 140, 255, 0.35), inset 0 0 36px rgba(213, 140, 255, 0.14); }
.card.r1.sel, .card.r1:hover { border-color: #58b7ff; } .card.r2.sel, .card.r2:hover { border-color: var(--epic); }
/* The style picker: each card wears the look of its own style. */
.card.look-casual .name { color: #f1e9de; text-decoration: underline 3px #ff4d5e; text-underline-offset: 8px; }
.card.look-arena .name { color: #fff; text-shadow: 0 0 14px #ff2bd6, 0 0 3px #fff; }
/* A strip of each look at the foot of its card: a calm teal grid, or a neon horizon. */
.card.look-casual, .card.look-arena { padding-bottom: 96px; }
.card.look-casual::after, .card.look-arena::after { content: ""; position: absolute; left: 22px; right: 22px; bottom: 22px; height: 56px; border-radius: 8px; }
.card.look-casual::after {
  border: 1px solid rgba(255, 77, 94, 0.3);
  background: linear-gradient(180deg, transparent 60%, rgba(255, 77, 94, 0.5) 60% 62%, transparent 62%), repeating-linear-gradient(90deg, rgba(255, 214, 170, 0.06) 0 1px, transparent 1px 26px), linear-gradient(180deg, #16130f, #1a1714);
}
.card.look-arena::after {
  border: 1px solid rgba(255, 43, 214, 0.45); box-shadow: 0 0 18px rgba(255, 43, 214, 0.25);
  background: radial-gradient(ellipse 30% 70% at 50% 100%, rgba(255, 140, 60, 0.75), transparent 70%), linear-gradient(180deg, transparent 58%, #ff2bd6 58% 61%, transparent 61%), repeating-linear-gradient(90deg, rgba(34, 232, 255, 0.25) 0 1px, transparent 1px 22px), linear-gradient(180deg, #12031f, #2a0638);
}

.bar { height: 8px; background: rgb(var(--tint) / 0.09); border-radius: 7px; overflow: hidden; position: relative; }
.bar i { display: block; height: 100%; border-radius: 7px; background: var(--text); }
.bar.brake i { background: var(--brake); } .bar.throttle i { background: var(--throttle); } .bar.steer i { background: var(--steer); }
.bar .mark { position: absolute; top: 0; width: 2px; height: 100%; background: #fff; box-shadow: 0 0 0 2px var(--bg); }
.skill { display: grid; grid-template-columns: 150px 1fr 54px 60px; gap: 12px; align-items: center; margin: 9px 0; font-size: 16px; }
.skill > span:first-child { font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: 0.04em; }
.skill .v { text-align: right; font-family: var(--display); font-weight: 700; font-size: 24px; font-variant-numeric: tabular-nums; }
.skill .d { font-family: var(--display); font-weight: 600; font-size: 17px; text-align: right; font-variant-numeric: tabular-nums; }

.ctl { display: grid; grid-template-columns: 110px minmax(0, 1fr) 120px auto; gap: 10px; align-items: center; margin: 8px 0; }
.ctl label { font-family: var(--display); font-weight: 700; letter-spacing: 0.1em; font-size: 19px; }
select { font-family: var(--body); font-size: 14px; background-color: rgb(var(--tint) / 0.05); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; }
select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
select:hover { border-color: var(--accent); }
select:disabled { opacity: 0.4; cursor: not-allowed; border-color: var(--line); }
/* Lanes: Arcade always draws one lane, so the option only applies to the casual style. */
.segwrap { display: flex; align-items: center; gap: 12px; }
.segwrap > .seg { flex: none; }
.lvl { display: inline-block; margin-top: 6px; font-style: normal; font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.tile .lvl { display: block; }
.lvl.here { color: var(--accent); }
:root:not(.arena) .lvl.here { color: var(--text); } /* one red per view: the tile in focus */
summary.sel, .opts button.sel { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; } /* keyboard/pad focus; .on seg and switch buttons hide the plain .sel fill */
.opt-note { display: block; font-style: normal; font-family: var(--display); font-weight: 500; font-size: 13px; line-height: 1.25; color: var(--dim); }
.casual-only { font-style: normal; font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); white-space: nowrap; display: none; text-shadow: none; }
:root.arena .casual-only { display: inline; }
select option { background: #10151d; }
:root:not(.arena) select option { background: #1a1714; }
/* Range: a thin track filled up to the thumb (--p from ui.js), a round thumb that glows in the arena. */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0; padding: 0; background: transparent; cursor: pointer; --p: 50%; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--p), rgb(var(--tint) / 0.1) var(--p)); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: #fff; border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 77, 94, 0.14); transition: transform 0.12s;
}
input[type=range]:is(:hover, :focus-visible)::-webkit-slider-thumb { transform: scale(1.18); }
input[type=range]:focus-visible { outline: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(255, 77, 94, 0.35); }
:root.arena input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--accent), var(--accent-2) var(--p), rgba(255, 255, 255, 0.1) var(--p)); box-shadow: 0 0 10px rgba(255, 43, 214, 0.25); }
:root.arena input[type=range]::-webkit-slider-thumb { border-color: var(--accent-2); box-shadow: 0 0 12px var(--accent), 0 0 4px #fff; }
input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: rgb(var(--tint) / 0.1); }
input[type=range]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); }
/* The axis / button pick is empty until a device is chosen: hidden in the Advanced grid (keeps the column), gone in the stacked Controls rows (the device pick spans to the meter). */
select[id^="in-"]:disabled { visibility: hidden; }
.oset:not(.wide) .ctl select[id^="in-"]:disabled { display: none; }
.opt { display: grid; grid-template-columns: 190px 1fr 74px; gap: 14px; align-items: center; min-height: 44px; margin: 2px 0; font-size: 15px; }
.opt + .opt { border-top: 1px solid rgb(var(--tint) / 0.04); }
.opt > span:first-child { color: var(--text); }
.opt > span:last-child { font-family: var(--display); font-weight: 700; font-size: 20px; text-align: right; font-variant-numeric: tabular-nums; }
:root.arena .opt > span:last-child { text-shadow: 0 0 10px rgba(255, 43, 214, 0.5); }
.note { font-size: 14px; color: var(--dim); }
.list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 56px; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
/* Drills: one card per drill. */
.list:has(> .item) { gap: 12px 16px; }
.list > .item, .item.custom { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 14px 18px; transition: border-color 0.15s, box-shadow 0.15s; }
.list > .item:hover, .item.custom:hover { border-color: var(--accent); }
:root.arena :is(.list > .item, .item.custom):hover { box-shadow: 0 0 22px rgba(255, 43, 214, 0.25); }
/* Start is an outline in the accent; it fills when its card is in focus, so twelve buttons do not shout at once. */
:is(.list > .item, .item.custom) > button:not(:disabled) { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
:is(.list > .item, .item.custom):is(:hover, :focus-within) > button:not(:disabled) { background: var(--accent); color: var(--ink); }
:root.arena :is(.list > .item, .item.custom):is(:hover, :focus-within) > button:not(:disabled) { background: linear-gradient(90deg, var(--accent), #7a3cff); color: #fff; box-shadow: 0 0 18px rgba(255, 43, 214, 0.5); }
/* Custom Corner: the text, then its settings, then Start at the bottom right. */
.item.custom { margin-top: 12px; align-items: end; }
.item.custom > .tune { grid-column: 1; max-width: 760px; }
.item.custom > button { grid-column: 2; grid-row: 2; }
/* Profile and drills settings: blocks sit on cards, like the menu. */
.screen > .panel, .screen > .row > .panel.grow { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 22px; }
.screen > .row > .panel.grow .skill .bar i { background: var(--accent); }
:root.arena .screen > .row > .panel.grow .skill .bar i { background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 10px var(--accent); }
.screen > .panel > h3:first-child, .screen > .row > .panel.grow > h3:first-child { margin-top: 0; }
:root.arena .screen > .panel, :root.arena .screen > .row > .panel.grow {
  border-color: transparent;
  background: linear-gradient(160deg, rgba(30, 8, 46, 0.86), rgba(10, 4, 22, 0.86)) padding-box, linear-gradient(120deg, rgba(255, 43, 214, 0.5), rgba(122, 60, 255, 0.28) 50%, rgba(34, 232, 255, 0.4)) border-box;
}
.item b { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }
.item p { margin: 2px 0 0; font-size: 14px; }
.stars { color: var(--gold); letter-spacing: 0.1em; font-size: 16px; margin-top: 4px; }
button.pick.sel { box-shadow: 0 0 0 2px var(--accent); }
.coach b { font-size: 19px; color: var(--text); }
.pedals { display: grid; grid-template-columns: 130px 1fr; gap: 10px 12px; align-items: center; font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: 0.14em; color: var(--dim); }
.hint { color: var(--faint); font-size: 14px; margin-top: 14px; }
#detect-pct { font-family: var(--display); font-size: 22px; color: var(--text); margin-right: 12px; font-variant-numeric: tabular-nums; }
/* Post-drive screens (ui.js drillView, summary): the drill card, a drill's results and the warm-up end share one grid. */
.post { display: grid; grid-template-columns: minmax(300px, 440px) minmax(0, 1fr); grid-template-rows: auto auto; gap: 40px 80px; align-items: start; }
.post > .fig { grid-column: 2; grid-row: 1 / span 2; min-width: 0; }
.post > .foot { grid-column: 1; grid-row: 2; align-self: end; display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.post .lab { font-family: var(--font); font-weight: 600; font-size: 13px; letter-spacing: 0.18em; color: var(--dim); text-transform: uppercase; }
.post .name { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1; letter-spacing: 0.05em; text-transform: uppercase; margin: 0; }
.post .where { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-family: var(--font); font-weight: 600; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); }
.post .ticks { display: flex; gap: 4px; }
.post .ticks i { width: 18px; height: 4px; border-radius: 1px; background: rgb(var(--tint) / 0.14); }
.post .ticks i.done { background: var(--text); }
.post .ticks i.now { background: transparent; box-shadow: inset 0 0 0 1px var(--text); }
.post .hero { font-family: var(--display); font-weight: 700; font-size: 168px; line-height: 0.86; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin: 34px 0 0; }
.post .hero small { font-size: 0.36em; color: var(--dim); margin-left: 0.08em; letter-spacing: 0; }
.post .hero:has(> .word) { font-size: 84px; text-transform: uppercase; letter-spacing: 0.02em; } /* "Stopped" */
.post .cap { font-size: 15px; color: var(--dim); margin: 14px 0 0; }
.post .who > .note { margin-top: 18px; }
.post .next { font-size: 16px; color: var(--dim); margin: 0; }
.post .next b { color: var(--text); }
.post .rules { font-size: 13px; color: var(--faint); margin: 0; }
.post .actions { gap: 14px; margin-top: 8px; }
/* One comparison in the in-run VS LAST grammar (styles/style-1/hud.js): gain ahead, coral behind. */
.vs { margin-top: 30px; width: 100%; max-width: 340px; }
.vs .top { display: flex; align-items: baseline; justify-content: space-between; }
.vs b { font-family: var(--display); font-weight: 700; font-size: 34px; font-variant-numeric: tabular-nums; }
.vs b small { font-family: var(--font); font-size: 14px; color: var(--dim); margin-left: 4px; }
.vs.ahead { --tone: var(--gain); } .vs.behind { --tone: var(--coral); }
.vs.ahead b, .vs.behind b { color: var(--tone); }
.zbar { position: relative; height: 18px; margin-top: 6px; }
.zbar::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 6px; background: rgb(var(--tint) / 0.14); }
.zbar .q { position: absolute; top: 3px; width: 1px; height: 12px; background: rgb(var(--tint) / 0.22); }
.zbar .fill { position: absolute; top: 6px; height: 6px; background: var(--tone); transform-origin: left; }
.vs.behind .zbar .fill { transform-origin: right; }
.zbar .end { position: absolute; top: 1px; width: 2px; height: 16px; background: var(--tone); right: 0; }
.vs.behind .zbar .end { right: auto; left: 0; }
.zbar .zero { position: absolute; left: calc(50% - 1px); top: 0; width: 2px; height: 18px; background: var(--text); }
.vs .why { font-size: 13px; color: var(--faint); margin: 6px 0 0; }
/* Drill pass picture (ADR-0009). One band, a target hairline, thin passes, coral out of the band. */
.fighead { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.pp-key { display: flex; gap: 18px; font-size: 13px; color: var(--faint); }
.pp-key span { display: inline-flex; align-items: center; gap: 7px; }
.pp-key i { display: inline-block; width: 18px; }
.pp-key .k-pass { height: 2px; background: rgb(var(--tint) / 0.6); }
.pp-key .k-tgt { height: 1px; background: rgb(var(--tint) / 0.45); }
.pp-key .k-out { height: 2px; background: var(--coral); }
.pp-key .k-band { height: 10px; background: rgb(var(--tint) / 0.2); }
.pp { display: block; width: 100%; max-width: 736px; height: auto; margin-top: 14px; overflow: visible; }
.pp .band { fill: rgb(var(--tint) / 0.1); }
.pp .band-red { fill: var(--coral); fill-opacity: 0.22; }
.pp .tgt { fill: none; stroke: var(--text); stroke-opacity: 0.35; stroke-width: 1; vector-effect: non-scaling-stroke; }
.pp .ln { fill: none; stroke: var(--text); stroke-opacity: 0.45; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.pp .out { fill: none; stroke: var(--coral); stroke-opacity: 0.95; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pp .sep { stroke: rgb(var(--tint) / 0.12); stroke-width: 1; }
.pp .seg { font-family: var(--font); font-weight: 600; font-size: 13px; letter-spacing: 0.16em; fill: var(--faint); text-transform: uppercase; }
.pp .rail-red { fill: var(--coral); } .pp .rail-green { fill: var(--gain); }
.pp :is(.ln, .out) { stroke-dasharray: 1; animation: pp-draw 0.6s var(--out) both; animation-delay: calc(var(--i, 0) * 30ms); }
@keyframes pp-draw { from { stroke-dashoffset: 1; } }
.zbar .fill, .track i { animation: bar-grow 0.4s var(--out) 0.2s both; }
@keyframes bar-grow { from { transform: scaleX(0); } }
.fig .say { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.fig .say li { display: flex; gap: 10px; align-items: baseline; font-size: 16px; color: var(--dim); }
.fig .say li::before { content: ""; flex: none; width: 14px; height: 3px; transform: translateY(-4px); }
.fig .say li.red::before { background: var(--coral); } .fig .say li.green::before { background: var(--gain); }
.fig .say b { font-family: var(--display); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 15px; }
.fig .say .red b { color: var(--coral); } .fig .say .green b { color: var(--gain); }
.fig .say .n { color: var(--faint); font-variant-numeric: tabular-nums; }
.fig .more { margin: 10px 0 0; font-size: 14px; color: var(--dim); }
/* Skill bars of the warm-up end: today's %, a tick at your usual, the signed delta. */
.skills { display: flex; flex-direction: column; gap: 18px; margin-top: 18px; }
.sk { display: grid; grid-template-columns: 150px minmax(0, 1fr) 64px 58px; gap: 18px; align-items: center; }
.sk .nm { font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: 0.03em; }
.sk .nm em { display: block; font-family: var(--body); font-style: normal; font-weight: 400; font-size: 13px; color: var(--faint); letter-spacing: 0; margin-top: 2px; }
.sk .v { font-family: var(--display); font-weight: 700; font-size: 26px; text-align: right; font-variant-numeric: tabular-nums; }
.sk .v small { font-size: 14px; color: var(--dim); margin-left: 2px; }
.sk .d { font-family: var(--display); font-weight: 700; font-size: 16px; text-align: right; font-variant-numeric: tabular-nums; color: var(--dim); }
.sk .d.ahead { color: var(--gain); } .sk .d.behind { color: var(--coral); }
.track { position: relative; height: 8px; background: rgb(var(--tint) / 0.09); }
.track i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--text); transform-origin: left; }
.track .usual { position: absolute; top: -6px; width: 2px; height: 20px; background: var(--text); box-shadow: 0 0 0 2px var(--bg); }
.legend { margin-top: 20px; font-size: 13px; color: var(--faint); display: flex; align-items: center; gap: 8px; }
.legend i { display: inline-block; width: 2px; height: 14px; background: var(--text); }
/* The account block (ui.js acctBlock): the end screen, a drill's results and the licence results. */
.acctb { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 4px; background: rgb(var(--tint) / 0.035); width: 100%; max-width: 440px; }
.acctb:not(:has(.av)) { padding-left: 18px; }
.acctb .av { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: rgb(var(--tint) / 0.08); }
.acctb .id { flex: 1; min-width: 0; }
.acctb .t { font-family: var(--display); font-weight: 700; font-size: 21px; letter-spacing: 0.03em; color: var(--text); line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acctb .s { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 14px; line-height: 1.35; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acctb:not(:has(.av)) .s { white-space: normal; } /* a guest's storage note is long: it wraps */
.acctb .s svg { width: 15px; height: 15px; color: var(--gain); flex: none; }
.acctb button { flex: none; font-size: 17px; padding: 9px 14px; gap: 8px; background: transparent; box-shadow: inset 0 0 0 1px rgb(var(--tint) / 0.38); }
.acctb button:hover { background: rgb(var(--tint) / 0.08); }
.detect { font-size: 26px; color: var(--text); text-align: center; padding: 30px; }
.detect b { color: var(--accent); }

/* ---------------------------------------------------------------- pit */
.pitstats { gap: 20px 44px; }

/* ---------------------------------------------------------------- results */
.over-top { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.over-top h2 { margin: 0 0 10px; font-size: clamp(36px, 3.6vw, 58px); }
.over-top .actions { justify-content: center; margin-top: 26px; }
.chips { justify-content: center; gap: 10px; margin-top: 14px; }
.chip { font-family: var(--display); font-weight: 600; background: var(--chip); border: 1px solid var(--line); border-radius: 8px; padding: 7px 14px; font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.chip b { color: var(--text); font-size: 20px; margin-left: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.coachline { max-width: 900px; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 17px; margin-top: 12px; }
details.more { margin-top: 24px; }
details.more > summary { text-align: center; }
.over-top ~ #reclog { margin-inline: auto; }
.lab { display: block; font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: 0.22em; color: var(--dim); text-transform: uppercase; }

/* The result card. Casual: a clean stat card. Arena: a neon rank card with a gradient rim. */
.res {
  display: grid; grid-template-columns: 230px 1fr; gap: 10px 40px; align-items: center; text-align: left;
  width: min(900px, 92vw); padding: 26px 34px 24px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}
:root.arena .res {
  border: 2px solid transparent;
  background: linear-gradient(160deg, rgba(30, 8, 46, 0.92), rgba(10, 4, 22, 0.92)) padding-box, linear-gradient(120deg, #ff2bd6, #7a3cff 50%, #22e8ff) border-box;
  box-shadow: 0 0 50px rgba(255, 43, 214, 0.28), 0 0 120px rgba(34, 232, 255, 0.12), 0 24px 70px rgba(0, 0, 0, 0.5);
}
.res-grade { text-align: center; position: relative; }
.grade {
  --gc: var(--accent); font-family: var(--display); font-weight: 800; font-size: 188px; line-height: 0.86; letter-spacing: -0.02em;
  color: var(--gc); opacity: 0; margin-top: 6px; display: inline-block;
}
.grade.g-SS { --gc: #ffe9a8; } .grade.g-S { --gc: var(--gold); } .grade.g-B { --gc: #9be7ff; } .grade.g-C { --gc: #ffad5c; } .grade.g-D { --gc: var(--brake); }
/* Focused grades: the site stat colours (best, amber, gain, text, slow, coral); never lamp red. */
:root:not(.arena) .grade.g-SS { --gc: var(--epic); } :root:not(.arena) .grade.g-S { --gc: var(--gold); } :root:not(.arena) .grade.g-A { --gc: var(--gain); }
:root:not(.arena) .grade.g-B { --gc: var(--text); } :root:not(.arena) .grade.g-C { --gc: #f0e05a; } :root:not(.arena) .grade.g-D { --gc: var(--coral); }
.grade.g-none { --gc: var(--faint); }
.grade.on, .grade.still { opacity: 1; }
.grade.on { animation: slam 0.42s var(--out) both; }
/* The grade slot before the letter lands: an empty spinning ring, never a letter that could be read as the grade. */
.gslot { display: grid; place-items: center; min-height: 170px; }
.gslot > * { grid-area: 1 / 1; }
.grade-ph {
  width: 132px; height: 132px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite; transition: opacity 0.12s;
}
:root.arena .grade-ph { width: 150px; height: 150px; border-color: rgba(255, 43, 214, 0.18); border-top-color: var(--accent); border-right-color: var(--accent-2); box-shadow: 0 0 24px rgba(255, 43, 214, 0.3); }
@keyframes spin { to { transform: rotate(1turn); } }
.gslot:has(.grade.on) .grade-ph { opacity: 0; animation: none; }
/* An early stop: a dash in the grade slot with this tag; no slam, flare or burst. */
.unrated-tag { display: inline-block; margin-top: 12px; font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; }
/* A final value with a dim dash in its place until its stage (ui.js late()). */
.late { display: inline-grid; }
.late > * { grid-area: 1 / 1; justify-self: end; }
.late > i {
  align-self: center; width: 1.3em; height: 0.36em; border-radius: 4px; transition: opacity 0.2s;
  background: linear-gradient(90deg, var(--line) 30%, var(--faint) 50%, var(--line) 70%) 0 0 / 300% 100%; animation: shimmer 1.1s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
.late > .on + i { opacity: 0; }
@keyframes slam { 0% { opacity: 0; transform: scale(1.45); } 100% { opacity: 1; transform: none; } }
:root.arena .grade { font-size: 236px; background: linear-gradient(180deg, #fff 8%, var(--gc) 52%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 16px var(--gc)) drop-shadow(0 0 40px rgba(255, 43, 214, 0.55)); }
/* No grade (early stop): a quiet plain dash, not a giant glowing glyph. */
:root .grade.g-none { font-size: 72px; background: none; color: var(--faint); filter: none; }
:root.arena .grade.g-A { --gc: var(--accent-2); }
:root.arena .grade.on { animation: slam-arena 0.55s var(--spring) both; }
@keyframes slam-arena { 0% { opacity: 0; transform: scale(3) rotate(-10deg); } 45% { opacity: 1; transform: scale(0.9) rotate(2deg); } 100% { opacity: 1; transform: none; } }
/* The shock ring as the letter lands (arena). */
:root.arena .res-grade::after {
  content: ""; position: absolute; left: 50%; top: 56%; width: 200px; height: 200px; margin: -100px 0 0 -100px; border-radius: 50%;
  border: 3px solid var(--accent-2); opacity: 0; pointer-events: none;
}
:root.arena .res-grade:has(.grade.on)::after { animation: ring 0.6s var(--out) 0.12s both; }
@keyframes ring { 0% { opacity: 0.9; transform: scale(0.3); } 100% { opacity: 0; transform: scale(1.9); border-width: 1px; } }
/* The flare behind the letter as it lands (arena; off with Flashes: Reduced). */
:root.arena .res-grade::before {
  content: ""; position: absolute; left: 50%; top: 56%; width: 340px; height: 340px; margin: -170px 0 0 -170px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.75), rgba(255, 43, 214, 0.35) 35%, transparent 68%); opacity: 0; pointer-events: none;
}
:root.arena:not(.noflash) .res-grade:has(.grade.on)::before { animation: flare 0.5s ease-out 0.1s both; }
@keyframes flare { 0% { opacity: 1; transform: scale(0.6); } 100% { opacity: 0; transform: scale(1.3); } }
/* The card kicks once as the letter lands. Declared after the stagger rule so it wins. */
:root.arena .screen.enter .res:has(.grade.on) { animation: kick 0.45s var(--out) 0.1s both; }
@keyframes kick { 0% { transform: scale(1.03); box-shadow: 0 0 110px rgba(255, 43, 214, 0.7), 0 0 160px rgba(34, 232, 255, 0.3); } }
.res-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.res-top { display: flex; align-items: flex-end; gap: 40px; flex-wrap: wrap; }
.res-num b { display: block; font-family: var(--display); font-weight: 700; font-size: 76px; line-height: 0.95; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.res-num.acc b { font-size: 52px; }
.res-num b small { font-size: 0.55em; margin-left: 2px; color: var(--dim); }
:root.arena .res-num:first-child b { font-size: 96px; text-shadow: 0 0 24px rgba(255, 43, 214, 0.45); }
/* Gamified: the coaching is one short line. */
.coachline .lab { display: inline; }
:root.arena .coachline b { font-family: var(--display); font-size: 20px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); }
.tally { display: flex; gap: 18px; font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: 0.12em; color: var(--dim); text-transform: uppercase; }
.tally b { font-size: 20px; margin-right: 5px; font-variant-numeric: tabular-nums; }
:root:not(.arena) .tally .red { color: var(--coral); } :root:not(.arena) .tally .green { color: var(--gain); } /* canvas grade ramp */
.res-skills { border-top: 1px solid var(--line); padding-top: 8px; }
.res-skills .skill { margin: 6px 0; grid-template-columns: 140px 1fr 44px 44px; }
.res-skills .bar { height: 6px; }
.res-skills .bar i { width: 0; background: var(--accent); }
/* Focused: a skill level is data, not an action, so it stays off the lamp red. */
:root:not(.arena) :is(.res-skills, .screen > .row > .panel.grow .skill) .bar i { background: var(--text); }
:root.arena .res-skills .bar i { background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 10px var(--accent); }
.res-skills .note { margin: 4px 0 0; }
/* Staged parts of the reveal: hidden until ui.js adds .on. */
[data-stage] { opacity: 0; }
[data-stage].on { opacity: 1; transition: opacity 0.3s ease; }
.newbest {
  align-self: flex-start; font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: 0.22em; padding: 4px 12px; border-radius: 6px;
  background: var(--gold); color: #2a1d00; margin-bottom: 8px;
}
.newbest.on { animation: pop 0.6s var(--spring) both; }
:root.arena .newbest { background: linear-gradient(90deg, var(--gold), #fff3c4, var(--gold)); box-shadow: 0 0 26px rgba(255, 207, 90, 0.7); }
@keyframes pop { 0% { opacity: 0; transform: scale(0.3) rotate(-6deg); } 60% { opacity: 1; transform: scale(1.18); } 100% { opacity: 1; transform: none; } }
.up {
  font-family: var(--display); font-weight: 700; font-size: 23px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); max-width: none;
  margin: 10px 0 0; padding: 6px 20px; border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); border-radius: 8px; background: color-mix(in srgb, var(--gold) 8%, transparent);
}
.up.on { animation: pop 0.6s var(--spring) both; }
:root.arena .up { text-shadow: 0 0 18px rgba(255, 207, 90, 0.7); box-shadow: 0 0 26px rgba(255, 207, 90, 0.3), inset 0 0 18px rgba(255, 207, 90, 0.12); }

/* Focused corners: 4px blocks, 2px inner parts, round stays round (ADR-0001). */
:root:not(.arena) :where(button:not(.icon, .switch), select, .oset, .seg, .tile, .mcard, .volpop, .panel.coach, .card, .card .badge, .list > .item, .item.custom, .screen > .panel, .chip, .res, .unrated-tag, .newbest, .up),
:root:not(.arena) .screen > .row > .panel.grow, :root:not(.arena) :is(summary, .opts button).sel { border-radius: 4px; }
:root:not(.arena) :is(.seg button, kbd, .card .key) { border-radius: 2px; }

/* Focused polish (ADR-0001): a selected tile is a full 2px accent edge, not a side stripe. */
:root:not(.arena) .tile.on { box-shadow: inset 0 0 0 1px var(--accent); }
:root:not(.arena) :is(.newbest, .up).on { animation-timing-function: var(--out); } /* settle, no overshoot */
/* Options: both columns hold their track; wide rows wrap inside it instead of running off-screen. */
:root:not(.arena) .opts { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(1180px, 100%); }
/* A seg stays on one line; the Lanes note drops below it instead of squeezing it; a seg of 3+ choices stacks as equal full-width rows. */
:root:not(.arena) .segwrap { flex-wrap: wrap; }
.opts .seg.many { flex-direction: column; justify-self: stretch; }
:root:not(.arena) .oset:nth-child(3) .opt { grid-template-columns: 150px minmax(0, 1fr); } /* Controls has no value column */
:root:not(.arena) .oset:nth-child(3) .opt > span:last-child:empty { display: none; }
:root:not(.arena) .list .lvl { display: block; } /* the level tag sits under the drill name, never glued to it */
:root:not(.arena) .oset:not(.wide) .ctl { grid-template-columns: 110px minmax(0, 1fr); }
:root:not(.arena) .oset:not(.wide) .ctl > :is(.bar, .row:last-child) { grid-column: 2; }
@media (min-width: 721px) { :root:not(.arena) .oset.wide .ctl { grid-template-columns: 194px minmax(0, 1fr) 120px auto; } } /* select column lines up with the sliders below */
@media (min-width: 721px) { :root:not(.arena) .oset:nth-child(3) .ctl { grid-template-columns: 150px minmax(0, 1fr); } } /* same label column as the .opt rows */
:root:not(.arena) .ctl label { font-family: inherit; font-weight: inherit; font-size: 15px; letter-spacing: normal; text-transform: lowercase; } /* the .opt label type; CH_NAME is upper-case */
:root:not(.arena) .ctl label::first-letter { text-transform: uppercase; }

/* Reduced motion: no stagger, no slam, no pulse; the reveal shows at once (ui.js). */
@media (prefers-reduced-motion: reduce) {
  .volpop, .screen.enter, .screen.out, .screen .st, .grade.on, .newbest.on, .up.on, .res, .res-grade::before, .res-grade::after, .grade-ph, .late > i { animation: none !important; }
  button, .card, .tile, .weekly.drills, .nav button::before, .linkrow .link::after { transition: none; }
  #runbar .volpop { animation: volfade 0.15s ease-out !important; } /* opacity only */
  h1.logo::after, .herobtns .primary::after, .press, .band.in { animation: none !important; }
  :root.arena h1.logo { transform: none; }
  #ui.on { transition: none; }
  .pp :is(.ln, .out), .zbar .fill, .track i { animation: none; }
}

/* Browser window: the layout folds to one column in a narrow window and gets tighter in a short one. */
@media (max-width: 900px) {
  .menu { grid-template-columns: 1fr; gap: 36px; }
  .post { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: 22px; }
  .post > :is(.fig, .foot) { grid-column: auto; grid-row: auto; }
  .pp-key { display: none; }
  .list { grid-template-columns: 1fr; }
  .row > .panel.grow { flex-basis: 100%; }
  .res { grid-template-columns: 1fr; text-align: center; }
  .res-top, .tally { justify-content: center; }
  .newbest { align-self: center; }
  :root:not(.arena) .opts { grid-template-columns: minmax(0, 1fr); }
  :root:not(.arena) .oset:nth-child(3) { grid-column: auto; grid-row: auto; }
}
@media (max-width: 720px) {
  .topbar .icon { width: 36px; height: 36px; }
  .post .name { font-size: 24px; }
  .post .hero { font-size: 104px; margin-top: 18px; }
  .post .hero:has(> .word) { font-size: 52px; }
  .acctb { flex-wrap: wrap; } /* a phone: the button takes its own row */
  .acctb button { flex: 1 0 100%; justify-content: center; }
  .vs { margin-top: 18px; max-width: none; }
  .pp { margin-top: 10px; }
  .fig .say li { font-size: 14px; }
  .sk { grid-template-columns: 104px minmax(0, 1fr) 46px 44px; gap: 10px; }
  .sk .d { font-size: 14px; }
  .sk .nm { font-size: 16px; }
  .sk .v { font-size: 22px; }
  .skills { gap: 16px; }
  .post .actions { gap: 10px; }
  .post .actions button { flex: 1 1 auto; }
  .post .actions button.primary { flex-basis: 100%; }
  button { font-size: 18px; padding: 10px 16px; }
  .cards { grid-auto-flow: row; }
  .card { min-height: 0; }
  .set { grid-template-columns: 1fr; gap: 8px; }
  .opt { grid-template-columns: minmax(110px, 1fr) 1fr 54px; }
  .ctl { grid-template-columns: 1fr; }
  .skill, .res-skills .skill { grid-template-columns: 100px 1fr 40px 44px; font-size: 15px; }
  /* Focused: the Semi Condensed face is wider, so labels get room and the tally wraps. */
  :root:not(.arena) :is(.skill, .res-skills .skill) { grid-template-columns: 124px 1fr 40px 44px; }
  :root:not(.arena) .tally { flex-wrap: wrap; gap: 6px 14px; }
  /* Focused Controls: each row stacks, label then control at full width; nothing passes the panel edge. */
  .opt:has(> :is(.seg, .segwrap)) { grid-template-columns: minmax(0, 1fr); gap: 6px; } /* label above its choices: they get the whole row */
  .opt:has(> :is(.seg, .segwrap)) > span:last-child:empty { display: none; }
  :root:not(.arena) .oset:nth-child(3) :is(.opt, .ctl) { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  :root:not(.arena) .oset:nth-child(3) :is(.opt, .ctl) > * { min-width: 0; }
  :root:not(.arena) .oset:nth-child(3) .ctl > :is(.bar, .row:last-child) { grid-column: auto; }
  :root:not(.arena) .oset:nth-child(3) .opt > button.small { width: 100%; }
  :root:not(.arena) .oset:nth-child(3) .ctl .row { flex-wrap: wrap !important; }
  :root:not(.arena) .oset:nth-child(3) .ctl select { min-width: 0; }
  :root:not(.arena) .oset:nth-child(3) .ctl select[id^="in-"] { width: auto !important; flex: 0 1 130px; }
  :root:not(.arena) .screen:has(> .topbar) { padding-top: 56px; } /* the logo clears the icon row */
  .stat { min-width: 110px; }
  .stat b { font-size: 26px; }
  .res-num b, :root.arena .res-num:first-child b { font-size: 56px; }
  .grade, :root.arena .grade { font-size: 140px; }
  .gslot { min-height: 130px; }
  .grade-ph, :root.arena .grade-ph { width: 104px; height: 104px; }
}
@media (max-height: 760px) {
  .grade, :root.arena .grade { font-size: 140px; }
  .gslot { min-height: 130px; }
  .grade-ph, :root.arena .grade-ph { width: 104px; height: 104px; }
  .menu-arena h1.logo { font-size: clamp(56px, 12vh, 110px); }
  .herobtns .primary { font-size: 30px; padding: 14px 24px; }
  .res { padding: 18px 26px; }
  .res-num b, :root.arena .res-num:first-child b { font-size: 64px; }
}
@media (max-height: 620px) {
  .topbar .icon { width: 36px; height: 36px; }
  h2 { margin-bottom: 16px; }
  .nav .gap { height: 6px; }
  .nav .link { padding: 4px 24px; font-size: 22px; }
  .nav .primary, .nav .weekly { padding: 10px 24px; font-size: 24px; }
  .actions { margin-top: 22px; }
  .set { margin-top: 14px; }
}
.screen ol.note { margin: 10px 0 0; padding-left: 20px; line-height: 1.7; }

/* ADR-0007 pedal check: the target band on the live bar (edge marks, not only colour), the fill ring, the findings. */
.chk { display: flex; align-items: center; gap: 24px; max-width: 860px; }
.chk .bar { flex: 1; }
.band { position: absolute; top: 0; height: 100%; background: rgb(var(--tint) / 0.22); border-inline: 3px solid var(--text); box-sizing: border-box; }
.band.in { background: rgb(var(--tint) / 0.4); animation: bandin 0.7s ease-in-out infinite alternate; }
@keyframes bandin { from { opacity: 0.6; } }
.ring { width: 56px; height: 56px; transform: rotate(-90deg); flex: none; }
.ring circle { fill: none; stroke-width: 4; }
.ring .rt { stroke: var(--line); }
.ring .rf { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.finds { margin: 18px 0 8px; max-width: 760px; }
.finds h3 { margin-top: 0; }
.finds ul { margin: 6px 0; padding-left: 20px; color: var(--dim); font-size: 16px; line-height: 1.5; }
.finds li + li { margin-top: 6px; }
.finds details { margin-top: 8px; font-size: 14px; color: var(--dim); }
