/* hypersurf UI: tokens, components and screens (docs/art-direction.md).
   The in-play HUD and the mini player are in hud.css. */

:root {
  /* surfaces: dark desaturated teal-charcoal */
  --bg-0: #050d10;
  --bg-1: #0b1719;
  --bg-2: #12272a;
  --bg-3: #173236;
  --navy: #071626;
  --panel: rgba(9, 22, 25, .78);
  --panel-solid: #0c1c1f;
  --pad-hud: rgba(5, 13, 16, .58);

  /* accent */
  --cyan: #3fe0d0;
  --cyan-hi: #8ff7ee;
  --cyan-mid: rgba(63, 224, 208, .55);
  --cyan-dim: rgba(63, 224, 208, .28);
  --line: rgba(120, 225, 218, .16);
  --line-2: rgba(120, 225, 218, .30);
  --glow: rgba(63, 224, 208, .45);

  /* ink */
  --text: #d8f4f1;
  --text-2: #9dc0bd;
  --text-3: #7fa3a0;

  /* focus, and nothing else */
  --gold: #ffc940;
  --gold-hi: #ffe08a;
  --gold-glow: rgba(255, 196, 64, .5);

  /* sparse meanings */
  --lime: #c6f04a;
  --warn: #ff8a3d;
  --red: #ff5a4a;
  --overfill: #ff5a2a;

  --i0: #3a2cff; --i1: #0fa3ff; --i2: #19e0a0; --i3: #ffd23a; --i4: #ff7a1a; --i5: #ff1f4b;

  --f-display: 'Oxanium', 'Rajdhani', system-ui, sans-serif;
  --f-ui: 'Rajdhani', 'Oxanium', system-ui, sans-serif;
  --gutter: clamp(16px, 3.2vw, 56px);
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: dark;
}
/* The game is always dark: the scheme guards restate the same surface. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg-1: #0b1719; } }
:root[data-theme="dark"] { --bg-1: #0b1719; }

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg-0);
  color: var(--text);
  font: 500 16px/1.45 var(--f-ui);
  letter-spacing: .02em;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--cyan); }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: inherit; }
.ico { width: 1em; height: 1em; display: block; flex: none; }
.num { font-family: var(--f-display); font-variant-numeric: tabular-nums; }
.micro { font: 600 12px/1.2 var(--f-ui); letter-spacing: .28em; text-transform: uppercase; color: var(--text-3); }
.eyebrow { font: 600 13px/1.3 var(--f-ui); letter-spacing: .32em; text-transform: uppercase; color: var(--text-2); }
.cyan, .eyebrow.cyan { color: var(--cyan); }
.kbd {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin: 0 2px;
  font: 500 11px/1 var(--f-display); font-style: normal; letter-spacing: .06em; color: var(--text-2);
  background: linear-gradient(var(--line-2), var(--line-2)) 0 0 / 100% 1px no-repeat,
    linear-gradient(var(--line-2), var(--line-2)) 0 100% / 100% 1px no-repeat,
    linear-gradient(var(--line-2), var(--line-2)) 0 0 / 1px 100% no-repeat,
    linear-gradient(var(--line-2), var(--line-2)) 100% 0 / 1px 100% no-repeat;
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
  vertical-align: middle;
}
.decode-ghost { visibility: hidden; }
[data-decode], .stage-name, .paused, .res-title { position: relative; }
.decode-over { position: absolute; inset: 0; white-space: nowrap; }
.scramble { color: var(--cyan); opacity: .7; }

/* ---------------------------------------------------------------- layers */
#view {
  position: fixed; inset: 0; width: 100%; height: 100%; display: block;
  touch-action: none; opacity: 0; transition: opacity .4s, filter .3s;
  z-index: 0;
}
body[data-state="play"] #view,
body[data-state="paused"] #view,
body[data-state="results"] #view,
body[data-state="mode"] #view,
body[data-state="vehicle"] #view,
body[data-state="levels"] #view,
body[data-over="game"] #view { opacity: 1; }
/* Panels over a frozen game: a CSS filter on a canvas that is no longer drawn. */
body[data-state="paused"] #view,
body[data-state="results"] #view,
body[data-over="game"] #view { filter: blur(14px) brightness(.42) saturate(.7); transform: scale(1.06); }
body[data-state="play"] { cursor: none; }

#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .4s; }
body.sky #sky { opacity: 1; }
body.sky {
  background:
    radial-gradient(55% 55% at 26% 40%, rgba(18, 92, 104, .45), transparent 70%),
    radial-gradient(90% 40% at 50% 100%, rgba(14, 70, 96, .5), transparent 75%),
    linear-gradient(180deg, #071626 0%, #0a1c22 34%, #0b1f23 70%, #0c2629 100%);
}
#shade { position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, .55)), linear-gradient(180deg, rgba(6, 18, 21, .55), rgba(6, 18, 21, .72)); }
body[data-state="paused"] #shade, body[data-state="results"] #shade, body[data-over="game"] #shade { opacity: 1; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 40; pointer-events: none; }

/* ---------------------------------------------------------------- screens */
.screen { position: fixed; inset: 0; z-index: 5; overflow-x: hidden; overflow-y: auto; }
.screen:not([hidden]) { animation: screen-in 280ms var(--ease-out) both; }
.screen.center { display: grid; place-items: center; padding: 64px var(--gutter) 40px; }
@keyframes screen-in { from { opacity: 0; } }
.screen.center:not([hidden]) > .panel { animation: panel-in 280ms var(--ease-out) both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------------- chamfered button (.cb) */
.cb {
  --h: 64px; --a: 8px; --b: 30px; --p: 46%;
  --o1: var(--cyan); --o2: rgba(63, 224, 208, .25);
  --f1: #0f3239; --f2: #0b242b; --f3: #0a1d22;
  --tc: var(--cyan);
  --shape: polygon(var(--a) 0, 100% 0, 100% 100%, var(--b) 100%, 0 var(--p));
  position: relative; isolation: isolate; display: flex; align-items: center; gap: 16px;
  height: var(--h); padding: 0 28px 0 calc(var(--b) + 26px);
  font: 600 26px/1 var(--f-ui); letter-spacing: .07em; text-transform: uppercase; color: var(--tc);
  text-align: left; white-space: nowrap; outline: none;
  filter: drop-shadow(0 0 7px rgba(63, 224, 208, .28));
  -webkit-mask-image: linear-gradient(90deg, #000 0 62%, rgba(0, 0, 0, .25) 92%, transparent);
  mask-image: linear-gradient(90deg, #000 0 62%, rgba(0, 0, 0, .25) 92%, transparent);
  transition: transform 160ms var(--ease-out), filter 160ms, color 160ms;
}
.cb::before, .cb::after { content: ""; position: absolute; clip-path: var(--shape); z-index: -1; }
.cb::before { inset: 0; background: linear-gradient(90deg, var(--o1) 0 40%, var(--o2)); }
.cb::after { inset: 1.5px; background: linear-gradient(180deg, rgba(255, 255, 255, .05), transparent 45%), linear-gradient(90deg, var(--f1), var(--f2) 45%, var(--f3)); }
.cb .bevel { position: absolute; left: 0; top: 0; height: 100%; width: 40px; pointer-events: none; }
.cb .lbl { position: relative; }
.cb .lbl::before { /* the ◆ focus marker */
  content: ""; position: absolute; left: -19px; top: 50%; width: 7px; height: 7px; margin-top: -4px;
  background: var(--gold); transform: rotate(45deg) scale(0); transition: transform 160ms var(--ease-out); box-shadow: 0 0 6px var(--gold-glow);
}
.cb .meta { margin-left: auto; margin-right: 18%; font: 600 12px/1 var(--f-ui); letter-spacing: .26em; color: var(--text-2); display: inline-flex; align-items: center; gap: 10px; }
.cb .sel-inline { font: 600 17px/1 var(--f-display); letter-spacing: .16em; color: var(--text); }
.cb .sel-inline b { font-weight: 600; min-width: 5.2em; text-align: center; }
.cb .chev { font-size: 14px; color: var(--text-2); }
.cb:hover { filter: drop-shadow(0 0 10px rgba(63, 224, 208, .45)); }
.cb:focus {
  --o1: var(--gold); --o2: rgba(255, 201, 64, .25);
  --f1: #3c3310; --f2: #252612; --f3: #10201d;
  --tc: var(--gold-hi);
  filter: drop-shadow(0 0 10px var(--gold-glow));
  transform: translateX(-10px);
}
.cb:focus::after { inset: 2px; }
.cb:focus .lbl::before { transform: rotate(45deg) scale(1); }
.cb:focus .meta, .cb:focus .chev { color: var(--gold-hi); }
.cb:active { transform: translateX(-10px) scale(.99); }
/* The featured entry (Special levels) stays gold without focus, so it is the first thing people click. */
.cb.featured {
  --o1: var(--gold); --o2: rgba(255, 201, 64, .25);
  --f1: #3c3310; --f2: #252612; --f3: #10201d;
  --tc: var(--gold-hi);
  filter: drop-shadow(0 0 10px var(--gold-glow));
}
.cb.featured .meta { color: var(--gold-hi); }

.stack { display: flex; flex-direction: column; align-items: flex-end; gap: 22px; }
.stack .cb { width: calc(min(40vw, 540px) + var(--i, 0) * 22px); }
.stack .quit-gap { height: clamp(8px, 5vh, 58px); }
.screen:not([hidden]) .stack .cb { animation: stack-in 280ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes stack-in { from { opacity: 0; translate: 24px 0; } }

/* ---------------------------------------------------------------- panel action (.act) */
.act {
  --o: var(--line-2); --t: var(--text);
  --shape: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 150px; height: 46px; padding: 0 22px; white-space: nowrap; outline: none;
  font: 600 17px/1 var(--f-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--t);
  transition: filter 160ms, color 160ms;
}
.act::before, .act::after { content: ""; position: absolute; clip-path: var(--shape); z-index: -1; }
.act::before { inset: 0; background: var(--o); }
.act::after { inset: 1px; background: linear-gradient(180deg, rgba(18, 44, 48, .95), rgba(10, 26, 29, .95)); }
.act .ico { width: 14px; height: 14px; }
.act:hover { --o: var(--cyan-mid); }
.act:focus { --o: var(--gold); --t: var(--gold-hi); filter: drop-shadow(0 0 8px var(--gold-glow)); }
.act:focus::before { inset: -1px; }
.act:focus::after { background: linear-gradient(180deg, rgba(58, 48, 16, .95), rgba(26, 28, 16, .95)); }
.act .mk { width: 6px; height: 6px; margin-right: -2px; background: var(--gold); transform: rotate(45deg) scale(0); transition: transform 160ms var(--ease-out); flex: none; }
.act:focus .mk { transform: rotate(45deg) scale(1); }
.act:not(:focus) .mk { width: 0; margin-right: -10px; }
.cb .bevel polyline { fill: none; stroke: var(--o1); stroke-width: 1.25; opacity: .7; vector-effect: non-scaling-stroke; }
.act:disabled { opacity: .45; cursor: default; filter: none; }
.act .kbd { margin-left: 6px; }
.actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 28px; }

/* ---------------------------------------------------------------- diamond icon button (.dia) */
.dia {
  --o: var(--cyan-mid); --t: var(--cyan);
  position: relative; width: 58px; height: 58px; display: grid; place-items: center; color: var(--t); outline: none;
}
.dia::before {
  content: ""; position: absolute; inset: 8px; transform: rotate(45deg);
  border: 1.5px solid var(--o);
  background: radial-gradient(circle, rgba(63, 224, 208, .16), rgba(10, 34, 40, .85) 70%);
  box-shadow: 0 0 12px rgba(63, 224, 208, .28), inset 0 0 10px rgba(63, 224, 208, .18);
  transition: border-color 160ms, box-shadow 160ms;
}
.dia::after { content: ""; position: absolute; inset: 2px; transform: rotate(45deg); border: 1px solid transparent; border-top-color: var(--line-2); border-left-color: var(--line-2); }
.dia .ico { position: relative; width: 22px; height: 22px; }
.dia .pip { display: none; position: absolute; bottom: -12px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; transform: rotate(45deg); background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.dia[aria-pressed="true"] { --o: var(--cyan); }
.dia[aria-pressed="true"] .pip { display: block; }
.dia:hover { --o: var(--cyan); }
.dia:focus { --o: var(--gold); --t: var(--gold-hi); }
.dia:focus::before { box-shadow: 0 0 14px var(--gold-glow), inset 0 0 10px rgba(255, 201, 64, .2); background: radial-gradient(circle, rgba(255, 201, 64, .16), rgba(34, 32, 14, .85) 70%); }

/* ---------------------------------------------------------------- panel */
.panel { position: relative; background: var(--panel); border: 1px solid var(--line); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.panel .corner { position: absolute; width: 14px; height: 14px; border: 0 solid var(--cyan-mid); }
.panel .corner.tl { top: -1px; left: -1px; border-top-width: 1.5px; border-left-width: 1.5px; }
.panel .corner.tr { top: -1px; right: -1px; border-top-width: 1.5px; border-right-width: 1.5px; }
.panel .corner.bl { bottom: -1px; left: -1px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.panel .corner.br { bottom: -1px; right: -1px; border-bottom-width: 1.5px; border-right-width: 1.5px; }
.dialog { width: min(760px, 100%); padding: clamp(22px, 3.4vw, 40px) clamp(18px, 4vw, 56px) clamp(22px, 3vw, 34px); }
.head { text-align: center; }
.head .title { font: 600 18px/1.2 var(--f-display); letter-spacing: .38em; padding-left: .38em; text-transform: uppercase; color: var(--text); }
.head .sub, .pane > .sub { margin-top: 8px; font: 600 13px/1.3 var(--f-ui); letter-spacing: .32em; text-transform: uppercase; color: var(--cyan); text-align: center; }
.pane > .sub { margin: 18px 0 4px; }

/* tabs */
.tabs { position: relative; display: flex; justify-content: center; gap: 44px; margin-top: 18px; border-bottom: 1px solid var(--line); }
.tab { position: relative; padding: 10px 2px 12px; font: 600 14px/1 var(--f-ui); letter-spacing: .26em; text-transform: uppercase; color: var(--text-3); outline: none; transition: color 180ms; }
.tab[aria-selected="true"] { color: var(--text); }
.tab::after { content: ""; position: absolute; left: 0; right: .26em; bottom: -1px; height: 2px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); transform: scaleX(0); transition: transform 220ms var(--ease-out); }
.tab[aria-selected="true"]::after { transform: scaleX(1); }
.tab:hover { color: var(--text-2); }
.tab:focus { color: var(--gold-hi); }
.tab:focus::before { content: ""; position: absolute; left: -12px; top: 50%; width: 6px; height: 6px; margin-top: -5px; background: var(--gold); transform: rotate(45deg); }
.pane:not([hidden]) { animation: screen-in 180ms var(--ease-out) both; }

/* settings rows and selectors */
.set-rows { margin-top: 12px; }
.srow {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 18px;
  padding: 14px 10px; border-bottom: 1px solid var(--line); outline: none;
}
.srow .name { font: 600 16px/1.2 var(--f-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--text-2); }
.srow .name small { display: block; margin-top: 4px; font: 500 13px/1.35 var(--f-ui); letter-spacing: .03em; text-transform: none; color: var(--text-3); }
.srow .val { font: 600 15px/1 var(--f-display); letter-spacing: .16em; color: var(--text); text-align: center; min-width: 188px; }
.srow:focus, .srow:focus-within { background: linear-gradient(90deg, rgba(255, 201, 64, .08), transparent 70%); }
.srow:focus::before, .srow:focus-within::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; background: var(--gold); box-shadow: 0 0 8px var(--gold-glow); }
.srow:focus .name, .srow:focus-within .name { color: var(--gold-hi); }
.srow:focus .name::before, .srow:focus-within .name::before { content: "◆ "; color: var(--gold); font-size: .7em; letter-spacing: .3em; }
.sel { display: grid; grid-template-columns: 28px 132px 28px; align-items: center; justify-items: center; }
.sel .chev { font-size: 14px; color: var(--text-2); cursor: pointer; padding: 7px; }
.sel .chev .ico { width: 14px; height: 14px; }
.sel output { font: 600 15px/1 var(--f-display); letter-spacing: .16em; text-transform: uppercase; color: var(--text); }
.sel .chev.end { opacity: .3; }
.srow:focus .sel output, .srow:focus .sel .chev { color: var(--gold-hi); }
.sel output.swap { animation: sel-swap 140ms var(--ease-out); }
@keyframes sel-swap { from { opacity: 0; transform: translateX(calc(var(--dir, 1) * 6px)); } }
.set-rows.compact .srow { padding: 10px 8px; }

/* hairline slider */
.slider { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.range-wrap { position: relative; display: block; }
.range-wrap .zero { position: absolute; left: calc(150 / 450 * (100% - 12px) + 6px); top: 50%; width: 1px; height: 13px; margin-top: -6.5px; background: var(--text-2); pointer-events: none; }
input[type=range].hr { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 22px; margin: 0; background: transparent; outline: none; --p: 33%; --c: var(--cyan); cursor: pointer; }
input[type=range].hr:focus { --c: var(--gold); }
input[type=range].hr::-webkit-slider-runnable-track {
  height: 22px;
  background:
    linear-gradient(90deg, var(--c) 0 var(--p), transparent var(--p)) center / 100% 1.5px no-repeat,
    linear-gradient(var(--line-2), var(--line-2)) center / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--line-2) 0 1px, transparent 1px calc(10% - .1px)) center / 100% 9px no-repeat;
}
input[type=range].hr::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: 5px; background: var(--bg-1); border: 1.5px solid var(--cyan); transform: rotate(45deg); box-shadow: 0 0 8px var(--glow); }
input[type=range].hr:focus::-webkit-slider-thumb { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 10px var(--gold-glow); }
input[type=range].hr::-moz-range-track { height: 1px; background: var(--line-2); }
input[type=range].hr::-moz-range-progress { height: 1.5px; background: var(--c); }
input[type=range].hr::-moz-range-thumb { width: 10px; height: 10px; border-radius: 0; background: var(--bg-1); border: 1.5px solid var(--cyan); transform: rotate(45deg); }
input[type=range].hr:focus::-moz-range-thumb { background: var(--gold); border-color: var(--gold); }

/* beat check lane */
.beatcheck { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; height: 28px; }
.beatcheck .lane { position: relative; height: 13px; background: linear-gradient(var(--line-2), var(--line-2)) center / 100% 1px no-repeat; }
.beatcheck .target { position: absolute; left: 70%; top: 0; width: 1px; height: 13px; background: var(--text-2); }
.beatcheck .runner { position: absolute; left: 0; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; background: var(--cyan); box-shadow: 0 0 6px var(--glow); transform: translateX(var(--x, 0px)) rotate(45deg); opacity: 0; }
.beatcheck .beat { display: block; width: 10px; height: 10px; border: 1px solid var(--cyan-mid); transform: rotate(45deg); }
.beatcheck.on .runner { opacity: 1; }
.beatcheck .beat.flash { background: var(--cyan); }

/* INFORMATION block */
.info { margin-top: 22px; border-left: 1px solid var(--cyan-dim); padding: 2px 0 2px 14px; min-height: 52px; }
.info .micro { font-size: 11px; color: var(--text-2); }
.info p { margin-top: 6px; font: 500 15px/1.45 var(--f-ui); letter-spacing: .03em; color: var(--cyan); opacity: .9; max-width: 60ch; }
.hints { text-align: center; margin-top: 16px; }

/* hairline list rows */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); font: 600 14px/1.3 var(--f-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--text-2); }
.rows li b { font-weight: 600; color: var(--text); letter-spacing: .1em; }
.rows.links li { padding: 0; }
.rows.links a, .rows.links .plain { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 10px; color: var(--text-2); text-decoration: none; outline: none; position: relative; letter-spacing: .12em; }
.rows.links .ico { width: 14px; height: 14px; color: var(--text-3); }
.rows.links a:focus, .rows.links .plain:focus { color: var(--gold-hi); background: linear-gradient(90deg, rgba(255, 201, 64, .08), transparent 70%); }
.rows.links a:focus::before, .rows.links .plain:focus::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: var(--gold); }
.rows.links a:focus .ico { color: var(--gold-hi); }
.rows.explain li { justify-content: flex-start; align-items: flex-start; text-transform: none; letter-spacing: .02em; font: 500 15px/1.45 var(--f-ui); color: var(--text-2); }
.rows.explain li > span { font-size: 22px; color: var(--cyan); margin-top: 1px; }
.rows.explain b { color: var(--text); letter-spacing: .04em; }
.rows.keysheet li { text-transform: none; letter-spacing: .04em; font-weight: 500; }
.rows.keysheet .name { font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--text); }
.legal { margin-top: 18px; font: 500 13px/1.5 var(--f-ui); letter-spacing: .06em; color: var(--text-3); text-align: center; }
.legal a { color: var(--text-2); }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 7px; height: 22px; padding: 0 9px 0 8px; font: 700 12px/1 var(--f-ui); letter-spacing: .24em; text-transform: uppercase; color: var(--cyan);
  background: linear-gradient(currentColor, currentColor) 0 0 / 100% 1px no-repeat, linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat, linear-gradient(currentColor, currentColor) 100% 0 / 1px 100% no-repeat;
  clip-path: polygon(6px 0, 100% 0, 100% 100%, 0 100%, 0 6px); position: relative; }
.chip::before { content: ""; width: 5px; height: 5px; background: currentColor; transform: rotate(45deg); }
.chip::after { content: ""; position: absolute; left: 0; top: 6px; bottom: 0; width: 1px; background: currentColor; }
.chip.lime { color: var(--lime); }
.chip.warn { color: var(--warn); }
/* Song presets under the video link: a chip button; the Nyan Cat one glows a little while the NYAN vehicle is chosen. */
.presets { margin-top: 12px; display: flex; align-items: center; gap: 12px; }
button.chip { cursor: pointer; outline: none; transition: color 160ms, text-shadow 160ms; }
button.chip:hover, button.chip:focus-visible { color: var(--gold); }
body[data-vehicle="nyan"] #yt-nyan { color: var(--lime); text-shadow: 0 0 8px var(--lime); }
body[data-vehicle="nyan"] #yt-nyan:hover, body[data-vehicle="nyan"] #yt-nyan:focus-visible { color: var(--gold); }

/* ================================================================= main menu */
.menu { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
.emblem-col { position: relative; display: grid; place-items: center; padding: 48px 0 140px var(--gutter); }
.emblem { position: relative; width: min(38vw, 470px); aspect-ratio: 1; display: grid; place-items: center; }
.emblem .rings { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.emblem .spin-slow { animation: spin 60s linear infinite; transform-origin: 200px 200px; }
.emblem .spin-rev { animation: spin 90s linear infinite reverse; transform-origin: 200px 200px; }
@keyframes spin { to { transform: rotate(360deg); } }
.emblem .flare { position: absolute; left: 14%; right: 14%; bottom: -6%; height: 22px; background: radial-gradient(50% 50% at 50% 50%, rgba(220, 255, 250, .95), rgba(80, 220, 255, .55) 18%, rgba(63, 224, 208, .12) 55%, transparent 75%); }
.emblem .flare::after { content: ""; position: absolute; left: 30%; right: 30%; top: 50%; height: 1px; background: #fff; box-shadow: 0 0 10px #aff; }
.wordmark { position: absolute; left: -24%; right: -24%; top: 50%; transform: translateY(-50%); text-align: center; }
.wordmark .rule { position: relative; height: 1px; background: linear-gradient(90deg, transparent, rgba(143, 247, 238, .55) 25%, #dcfffc 50%, rgba(143, 247, 238, .55) 75%, transparent); }
.wordmark .rule.top { margin-bottom: 14px; opacity: .55; }
.wordmark .rule.bot { margin-top: 16px; }
.wordmark .gem { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 3px; color: #dffcf8; }
.wordmark .gem i { width: 11px; height: 11px; background: #effffd; transform: rotate(45deg); box-shadow: 0 0 10px var(--cyan-hi); }
.wordmark .gem svg { width: 8px; height: 12px; }
.wm {
  font: 800 clamp(40px, 6.1vw, 92px)/1 var(--f-display); letter-spacing: .05em; padding-left: .05em; text-transform: uppercase;
  background:
    linear-gradient(100deg, transparent 42%, rgba(255, 255, 255, .95) 49%, rgba(255, 255, 255, .95) 51%, transparent 58%) -200% 0 / 60% 100% no-repeat,
    linear-gradient(180deg, #fff, #e2fbf8 45%, #9fe3ea);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px rgba(63, 224, 208, .45)) drop-shadow(0 2px 0 rgba(0, 40, 50, .6));
  animation: sweep 9s 1.2s ease-in-out infinite;
}
.wm .scramble { color: var(--cyan-hi); -webkit-text-fill-color: var(--cyan-hi); opacity: .8; }
@keyframes sweep { 0%, 84% { background-position: -200% 0, 0 0; } 100% { background-position: 300% 0, 0 0; } }
.wordmark .tag { margin-top: 18px; font: 600 clamp(12px, 1vw, 15px)/1 var(--f-ui); letter-spacing: .5em; padding-left: .5em; color: var(--cyan); opacity: .85; text-transform: uppercase; }

.stack-col { display: flex; flex-direction: column; justify-content: center; padding: 120px 0 150px; }
.topbar { position: absolute; top: clamp(16px, 3vh, 34px); right: var(--gutter); display: flex; align-items: center; gap: 18px; }
.best-mini { display: grid; justify-items: end; gap: 4px; }
.best-mini .micro { font-size: 11px; }
.best-mini b { font-size: 20px; font-weight: 600; color: var(--text); }
.ringbtn { position: relative; width: 74px; height: 74px; display: grid; place-items: center; color: var(--cyan); }
.ringbtn .ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 5px var(--glow)); }
.ringbtn .seg { animation: spin 26s linear infinite; transform-origin: 37px 37px; }
.ringbtn .ico { width: 26px; height: 26px; }
.dia-row { position: absolute; left: calc(var(--gutter) - 4px); bottom: clamp(24px, 5vh, 52px); display: flex; gap: 22px; }
.keys { position: absolute; right: var(--gutter); bottom: clamp(24px, 5vh, 52px); display: flex; gap: 18px; align-items: center; font: 600 12px/1 var(--f-ui); letter-spacing: .22em; text-transform: uppercase; color: var(--text-3); }
.keys span { display: inline-flex; gap: 6px; align-items: center; }
.pad-only { display: none !important; }
body.pad .pad-only { display: inline-flex !important; }
.credit { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); white-space: nowrap; font: 600 12px/1 var(--f-ui); letter-spacing: .22em; text-transform: uppercase; color: var(--text-3); text-decoration: none; }
.credit:hover, .credit:focus { color: var(--text-2); }

/* ================================================================= file */
.drop { position: relative; margin-top: 26px; display: grid; justify-items: center; gap: 14px; padding: 42px 20px 34px;
  background: repeating-linear-gradient(90deg, rgba(63, 224, 208, .03) 0 1px, transparent 1px 22px), rgba(6, 18, 20, .5);
  border: 1px dashed rgba(63, 224, 208, .28); transition: background 160ms, border-color 160ms; }
.drop .reticle { position: absolute; inset: -1px; pointer-events: none; }
.drop .reticle i { position: absolute; width: 22px; height: 22px; border: 0 solid var(--cyan); transition: transform 160ms var(--ease-out); }
.drop .reticle i:nth-child(1) { left: 0; top: 0; border-top-width: 2px; border-left-width: 2px; }
.drop .reticle i:nth-child(2) { right: 0; top: 0; border-top-width: 2px; border-right-width: 2px; }
.drop .reticle i:nth-child(3) { left: 0; bottom: 0; border-bottom-width: 2px; border-left-width: 2px; }
.drop .reticle i:nth-child(4) { right: 0; bottom: 0; border-bottom-width: 2px; border-right-width: 2px; }
.drop.over { border-style: solid; border-color: var(--cyan-mid); background-color: rgba(63, 224, 208, .06); }
.drop.over .reticle i:nth-child(1) { transform: translate(-6px, -6px); }
.drop.over .reticle i:nth-child(2) { transform: translate(6px, -6px); }
.drop.over .reticle i:nth-child(3) { transform: translate(-6px, 6px); }
.drop.over .reticle i:nth-child(4) { transform: translate(6px, 6px); }
.drop-ico { position: relative; width: 84px; height: 84px; display: grid; place-items: center; color: var(--cyan); }
.drop-ico .r { position: absolute; inset: 0; animation: spin 40s linear infinite; }
.drop-ico .ico { width: 34px; height: 34px; }
.drop-title { font: 600 22px/1.2 var(--f-display); letter-spacing: .22em; padding-left: .22em; text-transform: uppercase; }
.drop-title .touch { display: none; }
.drop .or { font: 600 13px/1 var(--f-ui); letter-spacing: .3em; color: var(--text-3); text-transform: uppercase; }
.formats { font: 600 13px/1.2 var(--f-ui); letter-spacing: .24em; color: var(--cyan); text-transform: uppercase; opacity: .85; text-align: center; }

/* ================================================================= video setup */
.video-panel { width: min(680px, 100%); }
.field { margin-top: 26px; }
.field .input { margin-top: 10px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--cyan-mid); padding: 6px 0 10px; transition: border-color 160ms; }
.field .input:focus-within { border-bottom-color: var(--gold); box-shadow: 0 1px 0 var(--gold); }
.field .input .ico { width: 20px; height: 20px; color: var(--cyan); }
.field input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font: 500 19px/1.2 var(--f-display); letter-spacing: .02em; color: var(--text); }
.field input::placeholder { color: var(--text-3); }
:is(.field, #nyan) .status { min-height: 20px; margin-top: 10px; display: flex; align-items: center; gap: 10px; font: 600 14px/1.2 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
:is(.field, #nyan) .status::before { content: ""; width: 7px; height: 7px; background: currentColor; transform: rotate(45deg); flex: none; }
:is(.field, #nyan) .status:empty::before { display: none; }
:is(.field, #nyan) .status.ok { color: var(--lime); }
:is(.field, #nyan) .status.ok::before { box-shadow: 0 0 6px var(--lime); }
:is(.field, #nyan) .status.bad { color: var(--red); text-transform: none; letter-spacing: .03em; font-weight: 500; font-size: 15px; }
:is(.field, #nyan) .status.wait::before { animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
.note { margin-top: 18px; font: 500 15px/1.45 var(--f-ui); color: var(--text-2); }
#video .no-live { display: none; }
#video.unsupported .no-live { display: revert; }
#video.unsupported .can-live { display: none; }
#video.unsupported .actions .no-live { display: inline-flex; }

/* ================================================================= mode select stage */
.stage-screen { overflow: hidden; }
.stage-head { position: absolute; top: clamp(24px, 5vh, 56px); left: 0; right: 0; }
.stage-area { position: absolute; left: 26%; right: 26%; top: 12%; bottom: 22%; cursor: grab; touch-action: none; display: grid; place-items: center; }
.stage-area:active { cursor: grabbing; }
.stage-fallback { display: none; width: min(24vw, 220px); color: var(--cyan); filter: drop-shadow(0 0 12px var(--glow)); }
.stage-fallback .ico { width: 100%; height: auto; stroke-width: .7; }
body.no3d #view { opacity: 0 !important; }
body.no3d .stage-fallback { display: block; }
.stage-arrow { position: absolute; top: 44%; width: 56px; height: 56px; display: grid; place-items: center; color: var(--cyan); outline: none; }
.stage-arrow::before { content: ""; position: absolute; inset: 10px; transform: rotate(45deg); border: 1px solid var(--line-2); background: rgba(8, 22, 25, .6); transition: border-color 160ms; }
.stage-arrow .ico { position: relative; width: 20px; height: 20px; }
.stage-arrow:hover::before { border-color: var(--cyan); }
.stage-arrow.prev { left: 25%; }
.stage-arrow.next { right: 25%; }
.stage-info { position: absolute; left: var(--gutter); top: 50%; transform: translateY(-50%); width: min(24vw, 400px); }
.stage-name { margin-top: 10px; font: 800 clamp(44px, 5.4vw, 86px)/1 var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--text); text-shadow: 0 0 22px rgba(63, 224, 208, .35); white-space: nowrap; }
#levels .stage-name { font-size: clamp(34px, 3.4vw, 58px); } /* level names run longer than mode names */
.stage-desc { margin-top: 14px; font: 500 17px/1.45 var(--f-ui); color: var(--text-2); min-height: 2.9em; }
.stage-rows { margin-top: 20px; border-top: 1px solid var(--line); }
.stage-rows li { padding: 10px 2px; font-size: 13px; }
.stage-rows li b.lime { color: var(--lime); }
.stage-gauges { position: absolute; right: var(--gutter); top: 50%; transform: translateY(-50%); display: grid; gap: 0; width: 150px; }
.stage-gauges .gauge { padding: 14px 0; border-bottom: 1px solid var(--line); }
.stage-gauges .gauge:first-child { border-top: 1px solid var(--line); }
.stage-foot { position: absolute; left: 0; right: 0; bottom: clamp(18px, 4vh, 40px); display: grid; justify-items: center; gap: 4px; }
.stage-foot .actions { margin-top: 14px; }
.stage-icons { display: flex; gap: 18px; }
.opt { --o: var(--line-2); --t: var(--cyan); position: relative; width: 56px; height: 56px; display: grid; place-items: center; color: var(--t); outline: none; }
.opt::before { content: ""; position: absolute; inset: 9px; transform: rotate(45deg); border: 1.5px solid var(--o); background: rgba(10, 30, 34, .8); transition: border-color 160ms, background 160ms; }
.opt .ico { position: relative; width: 24px; height: 24px; }
.opt:hover { --o: var(--cyan); }
.opt[aria-checked="true"] { --o: var(--gold); --t: #2a2108; }
.opt[aria-checked="true"]::before { background: linear-gradient(135deg, var(--gold-hi), var(--gold)); box-shadow: 0 0 14px var(--gold-glow); }
.opt:focus::after { content: ""; position: absolute; inset: 1px; transform: rotate(45deg); border: 1px solid var(--gold-hi); }
.stage-screen .stage-info > *, .stage-screen .stage-gauges { transition: opacity 200ms, transform 200ms var(--ease-out); }
.stage-screen.swapping .stage-desc, .stage-screen.swapping .stage-rows { opacity: 0; }

/* ring gauge */
.gauge { display: grid; justify-items: center; gap: 8px; }
.gauge .face { position: relative; width: 76px; height: 76px; display: grid; place-items: center; }
.gauge svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.gauge .trk { fill: none; stroke: var(--line-2); stroke-width: 1.5; }
.gauge .tick { fill: none; stroke: var(--line); stroke-width: 1; stroke-dasharray: 1 5; }
.gauge .arc { fill: none; stroke: var(--cyan); stroke-width: 2.5; stroke-dasharray: var(--v, 0) 100; filter: drop-shadow(0 0 4px var(--glow)); transition: stroke-dasharray 400ms var(--ease-out); }
.gauge .face b { position: relative; font: 600 19px/1 var(--f-display); color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gauge .face b small { font-size: 11px; color: var(--text-2); margin-left: 1px; }
.gauge .lbl { font: 600 12px/1.2 var(--f-ui); letter-spacing: .24em; text-transform: uppercase; color: var(--text-2); text-align: center; }
.gauge .sub { font: 500 14px/1 var(--f-display); color: var(--text); }
.gauge .sub small { color: var(--text-3); }

/* ================================================================= loading */
.loading { display: grid; place-items: center; padding: 40px var(--gutter) 110px; }
.load-frame { width: min(1280px, 100%); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 80px; align-items: center; justify-content: center; }
.load-ring { position: relative; width: 360px; height: 360px; display: grid; place-items: center; }
.load-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.load-ring .seg { fill: none; stroke: var(--line); stroke-width: 10; transition: stroke 200ms; }
.load-ring .seg.on { stroke: var(--cyan); filter: drop-shadow(0 0 6px var(--glow)); }
.load-pct { position: relative; display: grid; grid-template-columns: auto auto; align-items: baseline; justify-items: center; }
.load-pct b { font: 600 76px/1 var(--f-display); color: var(--text); }
.load-pct > span:not(.micro) { font: 600 30px/1 var(--f-display); color: var(--cyan); }
.load-pct .micro { grid-column: 1 / -1; margin-top: 8px; }
.load-side { max-width: 520px; min-width: 0; }
.load-title { margin: 12px 0 6px; font: 600 32px/1.15 var(--f-display); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stages { list-style: none; margin: 22px 0 0; padding: 0; border-top: 1px solid var(--line); }
.stages li { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--line); font: 600 14px/1.2 var(--f-ui); letter-spacing: .24em; text-transform: uppercase; color: var(--text-3); }
.stages li::before { content: ""; width: 7px; height: 7px; border: 1px solid var(--text-3); transform: rotate(45deg); }
.stages li.done { color: var(--text-2); }
.stages li.done::before { background: var(--cyan-mid); border-color: var(--cyan-mid); }
.stages li.now { color: var(--text); }
.stages li.now::before { background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 6px var(--cyan); animation: blink 1s ease-in-out infinite; }
.stages li span { font: 500 13px/1 var(--f-display); letter-spacing: .06em; color: var(--text-3); }
.load-stats { margin-top: 18px; letter-spacing: .2em; color: var(--text-2); min-height: 1.2em; }
.tip { position: absolute; left: 50%; bottom: clamp(30px, 6vh, 64px); transform: translateX(-50%); width: min(720px, calc(100% - 32px)); text-align: center; display: grid; gap: 6px; font: 500 16px/1.45 var(--f-ui); color: var(--text-2); }
.loading .esc { position: absolute; left: var(--gutter); bottom: clamp(24px, 5vh, 52px); }

/* ================================================================= pause */
.pause-col { padding: 0 0 0 calc(var(--gutter) + 60px); display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.paused { margin-top: 12px; font: 800 clamp(48px, 7vw, 104px)/1 var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--text); text-shadow: 0 0 26px rgba(63, 224, 208, .3); }
.rule-cy { width: min(520px, 100%); height: 1px; margin: 22px 0; background: linear-gradient(90deg, var(--cyan), transparent); }
.pstats { display: flex; gap: 40px; margin: 0; }
.pstats div { display: grid; gap: 6px; }
.pstats dd { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: .04em; white-space: nowrap; }
.pstats small { font-size: .6em; color: var(--text-3); }
.pause-profile { margin-top: 22px; width: min(520px, 100%); }
.pause .set-rows { width: min(520px, 100%); margin-top: 14px; }
.pause .keys { right: auto; left: var(--gutter); }
.live-only { display: none; }
body[data-live] .live-only { display: block; }

/* ================================================================= results */
.results { width: min(980px, 100%); }
.head.left { text-align: left; }
.res-title { margin-top: 8px; font: 600 32px/1.15 var(--f-display); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-body { display: grid; grid-template-columns: 1.25fr 1fr; gap: 56px; margin-top: 26px; }
.tally { border-top: 1px solid var(--line); }
.trow { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.trow b { font-size: 26px; font-weight: 600; }
.bonuses { list-style: none; margin: 0; padding: 0; }
.bonuses li { display: flex; justify-content: space-between; padding: 10px 2px; border-bottom: 1px solid var(--line); font: 600 14px/1.2 var(--f-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--lime); }
.bonuses li b { font: 600 18px/1 var(--f-display); letter-spacing: .02em; }
.bonuses li.none { color: var(--text-3); }
.trow.final { border-bottom: 0; align-items: center; padding-top: 18px; }
.trow.final b { font: 700 clamp(48px, 6vw, 80px)/1 var(--f-display); letter-spacing: .02em; color: var(--text); text-shadow: 0 0 22px rgba(63, 224, 208, .55); }
.best-line { display: flex; align-items: center; justify-content: flex-end; gap: 14px; min-height: 30px; }
.best-line .micro { color: var(--text-2); }
.badge { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; font: 700 13px/1 var(--f-ui); letter-spacing: .24em; text-transform: uppercase; color: #0f1d05; background: var(--lime); clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); box-shadow: 0 0 16px rgba(198, 240, 74, .5); }
.badge.in { animation: badge-in 200ms var(--ease-out) both; }
@keyframes badge-in { from { opacity: 0; transform: scale(.96); } }
.res-gauges { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.res-gauges .gauge { padding: 18px 8px; border-bottom: 1px solid var(--line); }
.res-gauges .gauge:nth-child(odd) { border-right: 1px solid var(--line); }

/* ================================================================= toasts */
.toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); z-index: 30; display: grid; gap: 10px; pointer-events: none; }
.toast { --k: var(--cyan); position: relative; display: grid; grid-template-columns: 22px 1fr auto; gap: 4px 14px; align-items: start; padding: 14px 16px 16px 18px; background: rgba(10, 22, 24, .94); border: 1px solid color-mix(in srgb, var(--k) 45%, var(--line-2)); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); pointer-events: auto; animation: toast-in 220ms var(--ease-out) both; }
.toast.out { animation: toast-out 180ms var(--ease-in) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-12px); } }
.toast::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 3px; background: var(--k); box-shadow: 0 0 8px var(--k); }
.toast.warn { --k: var(--warn); }
.toast.error { --k: var(--red); }
.toast > .ico { width: 22px; height: 22px; color: var(--k); }
.toast .t-title { font: 700 15px/1.2 var(--f-ui); letter-spacing: .22em; text-transform: uppercase; color: var(--text); }
.toast .t-body { grid-column: 2; font: 500 15px/1.45 var(--f-ui); color: var(--text-2); }
.toast .t-code { grid-column: 2; font: 500 12px/1 var(--f-display); color: var(--text-3); letter-spacing: .08em; }
.toast .t-close { grid-row: 1; grid-column: 3; width: 22px; height: 22px; color: var(--text-3); display: grid; place-items: center; }
.toast .t-close .ico { width: 14px; height: 14px; }
.toast .t-close:focus, .toast .t-close:hover { color: var(--gold-hi); outline: none; }
.toast .t-acts { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 8px; }
.toast .t-acts .act { min-width: 0; height: 38px; font-size: 14px; }
.toast .t-link { font: 600 13px/1 var(--f-ui); letter-spacing: .3em; text-transform: uppercase; color: var(--cyan); border-bottom: 1px solid var(--cyan-dim); padding-bottom: 3px; outline: none; }
.toast .t-link:focus { color: var(--gold-hi); border-color: var(--gold); }
.toast .life { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--k); opacity: .6; transform-origin: 0 50%; animation: life var(--life, 6s) linear both; }
@keyframes life { to { transform: scaleX(0); } }

/* ================================================================= debug */
.debug { position: fixed; left: 12px; bottom: 12px; margin: 0; padding: 8px 10px; background: rgba(5, 13, 16, .8); border: 1px solid var(--line); color: #9fe; font: 11px/1.4 ui-monospace, monospace; letter-spacing: 0; pointer-events: none; z-index: 50; white-space: pre; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; }

/* ================================================================= calm and reduced motion */
body.calm .emblem .spin-slow, body.calm .emblem .spin-rev, body.calm .ringbtn .seg, body.calm .drop-ico .r, body.calm .wm { animation: none; }
body.calm .screen:not([hidden]), body.calm .screen.center:not([hidden]) > .panel { animation: screen-in 120ms linear both; }
body.calm .stack .cb { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .emblem .spin-slow, .emblem .spin-rev, .ringbtn .seg, .drop-ico .r, .wm { animation: none; }
  .screen:not([hidden]), .screen.center:not([hidden]) > .panel { animation: screen-in 120ms linear both; }
  .stack .cb { animation: none !important; }
}

/* ================================================================= tablet: 760–1100 */
@media (max-width: 1100px) {
  .stack .cb { width: calc(min(46vw, 480px) + var(--i, 0) * 18px); --h: 58px; font-size: 23px; }
  .emblem { width: min(34vw, 360px); }
  .stage-info { width: 30vw; }
  .stage-area { left: 30%; right: 22%; }
  .stage-arrow.prev { left: 29%; }
  .stage-arrow.next { right: 21%; }
  .load-frame { gap: 40px; }
  .load-ring { width: 300px; height: 300px; }
}
@media (max-height: 760px) and (min-width: 761px) {
  .stack { gap: 14px; }
  .stack .cb { --h: 54px; font-size: 22px; }
  .stack-col { padding: 90px 0 110px; }
}

/* ================================================================= phone: below 760 */
@media (max-width: 760px) {
  html, body { font-size: 15px; }
  .menu { display: block; overflow-y: auto; }
  .screen { scrollbar-width: none; }
  .emblem-col { padding: 58px 16px 0; }
  .emblem { width: min(56vw, 220px); }
  .wordmark { left: -40%; right: -40%; }
  .stack-col { padding: 64px 0 22px; }
  .stack { gap: 14px; }
  .stack .cb { --h: 54px; --b: 26px; font-size: 19px; width: calc(100% - 24px - (7 - var(--i, 0)) * 8px); }
  .stack .quit-gap { height: 0; }
  .cb .meta:not(.sel-inline) { display: none; }
  .cb .meta { margin-right: 14%; }
  .topbar { top: 12px; right: 12px; flex-direction: column-reverse; align-items: flex-end; gap: 4px; }
  .best-mini { grid-auto-flow: column; align-items: baseline; gap: 6px; }
  .best-mini b { font-size: 13px; }
  .ringbtn { width: 54px; height: 54px; }
  .ringbtn .ico { width: 20px; height: 20px; }
  .dia-row { position: static; justify-content: center; gap: 18px; padding: 4px 0 18px; }
  .dia { width: 52px; height: 52px; }
  .keys { display: none; }
  .credit { position: static; transform: none; display: block; text-align: center; white-space: normal; font-size: 11px; letter-spacing: .12em; padding: 0 16px 16px; }
  .cb { -webkit-mask-image: linear-gradient(90deg, #000 0 80%, rgba(0, 0, 0, .3) 97%, transparent); mask-image: linear-gradient(90deg, #000 0 80%, rgba(0, 0, 0, .3) 97%, transparent); }
  .menu:not([hidden]) { padding-bottom: 0; }

  .screen.center { padding: 56px 16px 24px; place-items: start center; }
  .dialog { width: 100%; }
  .drop { padding: 28px 14px; }
  .drop-title .desk { display: none; }
  .drop-title .touch { display: inline; }
  .tabs { gap: 22px; }
  .tab { font-size: 13px; }
  .srow { padding: 12px 4px; grid-template-columns: 1fr; }
  .srow .sel, .srow .val { justify-self: start; }
  .sel { grid-template-columns: 26px 88px 26px; }
  .srow .val { min-width: 0; }
  .actions { gap: 10px; }
  .actions .act { flex: 1; min-width: 0; padding: 0 12px; height: 48px; }

  .stage-head { top: 18px; }
  .stage-area { left: 0; right: 0; top: 70px; bottom: auto; height: 42vh; }
  .stage-arrow { top: calc(70px + 21vh - 28px); }
  .stage-arrow.prev { left: 6px; }
  .stage-arrow.next { right: 6px; }
  .stage-info { position: absolute; top: calc(70px + 40vh); left: 16px; right: 16px; transform: none; width: auto; text-align: center; }
  .stage-name { font-size: 44px; margin-top: 4px; }
  #levels .stage-name { font-size: 30px; }
  .stage-desc { font-size: 15px; min-height: 0; }
  .stage-rows, .stage-info .eyebrow { display: none; }
  .stage-gauges { position: absolute; top: auto; bottom: 150px; left: 16px; right: 16px; transform: none; width: auto; grid-template-columns: repeat(3, 1fr); }
  .stage-gauges .gauge, .stage-gauges .gauge:first-child { border: 0; padding: 0; }
  .stage-gauges .gauge .face { width: 58px; height: 58px; }
  .stage-gauges .gauge .face b { font-size: 15px; }
  .stage-foot { bottom: 14px; padding: 0 16px; }
  .stage-foot .actions { width: 100%; margin-top: 8px; }
  .opt { width: 50px; height: 50px; }

  .load-frame { grid-template-columns: 1fr; gap: 20px; justify-items: center; }
  .load-ring { width: min(68vw, 260px); height: min(68vw, 260px); }
  .load-pct b { font-size: 54px; }
  .load-side { width: 100%; }
  .load-title { font-size: 24px; }
  .tip { font-size: 14px; bottom: 20px; }
  .loading .esc { display: none; }

  .pause { grid-template-columns: 1fr; align-content: start; overflow-y: auto; }
  .pause-col { padding: 64px 16px 0; }
  .paused { font-size: 52px; }
  .pstats { gap: 20px; }
  .pstats dd { font-size: 19px; }
  .pause .stack-col { padding: 28px 0 40px; }
  .pause .keys { display: none; }

  .res-body { grid-template-columns: 1fr; gap: 20px; }
  .res-gauges { grid-template-columns: repeat(4, 1fr); border-top: 0; }
  .res-gauges .gauge, .res-gauges .gauge:nth-child(odd) { border: 0; padding: 0; }
  .res-gauges .gauge .face { width: 58px; height: 58px; }
  .res-gauges .gauge .face b { font-size: 14px; }
  .res-gauges .gauge .lbl { font-size: 11px; letter-spacing: .12em; }
  .res-title { font-size: 22px; }
}
body:not([data-state="play"]) #zone { display: none; }
