/* =========================================================
   RADIAL RUSH — visual system
   Warm transit poster meets arcade scoreboard.
   ========================================================= */

@font-face {
  font-family: "Archivo Black";
  src: url("../assets/fonts/archivo-black.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../assets/fonts/space-grotesk.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/ibm-plex-mono-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  --paper: #f3e8d5;
  --paper-light: #fbf5e9;
  --paper-deep: #e7d4b6;
  --ink: #1b1610;
  --ink-2: #403528;
  --muted: #655441;
  --orange: #ef5b26;
  --orange-deep: #bc3508;
  --acid: #d8ef4a;
  --acid-deep: #98b514;
  --red: #cc2b1d;
  --line: rgba(27, 22, 16, 0.16);
  --line-strong: rgba(27, 22, 16, 0.4);
  --font-display: "Archivo Black", "Arial Black", Impact, sans-serif;
  --font-body: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --shadow-card: 0 24px 64px rgba(44, 32, 17, 0.22), 0 3px 0 rgba(27, 22, 16, 0.06);
  --ease-out: cubic-bezier(0.22, 0.8, 0.24, 1);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html,
body {
  height: 100%;
  min-height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.4;
  background:
    radial-gradient(ellipse at 50% 14%, rgba(255, 253, 246, 0.9), transparent 54%),
    linear-gradient(135deg, #f7eedf 0%, #f1e4ce 48%, #e9d7ba 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 46%, transparent 48%, rgba(75, 51, 24, 0.12) 100%);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button {
  color: inherit;
  font: inherit;
}

button:not(:disabled),
a {
  cursor: pointer;
}

a {
  color: inherit;
}

svg {
  display: block;
  width: 1em;
  height: 1em;
}

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

::selection {
  color: var(--paper-light);
  background: var(--orange);
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.paper-noise {
  position: fixed;
  inset: -20%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
}

/* ---------- desktop set dressing ---------- */

.side-type {
  position: fixed;
  z-index: 0;
  top: 50%;
  color: transparent;
  font-family: var(--font-display);
  font-size: clamp(150px, 16vw, 280px);
  line-height: 0.76;
  letter-spacing: -0.06em;
  -webkit-text-stroke: 1.5px rgba(27, 22, 16, 0.11);
  writing-mode: vertical-rl;
  pointer-events: none;
  user-select: none;
}
.side-type--left {
  left: max(18px, 2.4vw);
  transform: translateY(-50%) rotate(180deg);
}
.side-type--right {
  right: max(18px, 2.4vw);
  transform: translateY(-50%);
}

.desktop-credit {
  position: fixed;
  z-index: 2;
  bottom: 20px;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  pointer-events: none;
}
.desktop-credit--left { left: 26px; }
.desktop-credit--right { right: 26px; }

/* ---------- shell / cabinet ---------- */

.shell {
  position: relative;
  z-index: 3;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: 20px;
}

.cabinet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(480px, calc(100vw - 40px));
  height: min(900px, calc(100vh - 40px));
  height: min(900px, calc(100dvh - 40px));
  overflow: hidden;
  isolation: isolate;
  border: 1.5px solid var(--ink);
  border-radius: 26px;
  background: var(--paper-light);
  box-shadow: var(--shadow-card);
}

/* ---------- top bar ---------- */

.topbar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 15px 10px;
  background: var(--paper-light);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  user-select: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: var(--acid);
  background: var(--ink);
}
.brand-mark svg {
  width: 16px;
  height: 16px;
}

.brand-word {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 10px;
  line-height: 0.92;
  letter-spacing: 0.055em;
}

.timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  gap: 1px;
}

.timer-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.12em;
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--orange);
}
.timer.is-urgent .live-dot {
  animation: livePulse 0.7s steps(2, end) infinite;
}

.timer-digits {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: -0.04em;
}
.timer.is-urgent .timer-digits {
  color: var(--red);
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.icon-btn {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  background: var(--paper-light);
  transition: background 0.16s var(--ease-out), transform 0.16s var(--ease-out), opacity 0.16s;
}
.icon-btn svg {
  width: 19px;
  height: 19px;
}
.icon-btn:hover:not(:disabled) {
  background: var(--acid);
  transform: translateY(-1px);
}
.icon-btn:active:not(:disabled) {
  transform: scale(0.94);
}
.icon-btn:disabled {
  cursor: default;
  opacity: 0.28;
}
.icon-btn .icon-off { display: none; }
.icon-btn.is-muted .icon-on { display: none; }
.icon-btn.is-muted .icon-off { display: block; }

.icon-btn--dark {
  width: 44px;
  height: 44px;
  border-color: var(--ink);
  background: var(--paper);
}
.icon-btn--dark svg {
  width: 17px;
  height: 17px;
}

.timebar {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 3px;
  flex: 0 0 3px;
  overflow: hidden;
  background: rgba(27, 22, 16, 0.12);
}
.timebar span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: var(--orange);
  will-change: transform;
}
.timebar.is-urgent span {
  background: var(--red);
}
.timebar.is-complete span {
  background: var(--acid-deep);
}
.timebar.is-failed span {
  background: var(--red);
}

/* ---------- stage ---------- */

.stage {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.42), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 34%);
}

#board {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}
#board:hover { cursor: default; }
#board.is-hovering { cursor: pointer; }
#board:focus-visible {
  outline: none;
}

.board-meta {
  position: absolute;
  z-index: 2;
  top: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.1em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s var(--ease-out);
}
.cabinet[data-state="playing"] .board-meta,
.cabinet[data-state="paused"] .board-meta {
  opacity: 0.92;
}
.board-meta--left { left: 14px; }
.board-meta--right { right: 14px; }

/* game hint */
.hint {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--paper-light);
  background: var(--ink);
  box-shadow: 0 4px 14px rgba(27, 22, 16, 0.18);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.24s var(--ease-out), transform 0.24s var(--ease-out);
  pointer-events: none;
}
.hint svg {
  width: 12px;
  height: 12px;
  color: var(--acid);
}
.hint.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* central toast */
.toast {
  position: absolute;
  z-index: 7;
  top: 37%;
  left: 50%;
  padding: 8px 13px;
  border: 1.5px solid var(--ink);
  border-radius: 9px;
  color: var(--ink);
  background: var(--acid);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 6px) rotate(-1deg);
  pointer-events: none;
}
.toast.show {
  animation: toastPop 0.62s var(--ease-out) both;
}
.toast.is-bad {
  color: var(--paper-light);
  background: var(--red);
}
.toast.is-perfect {
  color: var(--paper-light);
  background: var(--orange);
}

/* ---------- overlays ---------- */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  overflow-x: clip;
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s var(--ease-out), visibility 0.22s;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.overlay::-webkit-scrollbar {
  display: none;
}
.overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.overlay--menu {
  background:
    linear-gradient(180deg, rgba(251, 245, 233, 0.98) 0%, rgba(243, 232, 213, 0.98) 58%, var(--paper) 100%);
}
.overlay--menu::before {
  content: "";
  position: absolute;
  top: -215px;
  right: 0;
  width: 525px;
  height: 525px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(27, 22, 16, 0.085) 0deg 0.9deg, transparent 0.9deg 30deg);
  -webkit-mask: radial-gradient(circle, transparent 0 24%, #000 24.7% 100%);
  mask: radial-gradient(circle, transparent 0 24%, #000 24.7% 100%);
  pointer-events: none;
}
.menu-sheet {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: center;
  gap: clamp(18px, 4vh, 32px);
  padding: 56px 20px 16px;
}

.menu-topline {
  position: absolute;
  top: 15px;
  left: 20px;
  right: 20px;
}

.menu-topline,
.over-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.menu-topline b {
  color: var(--ink);
  font-weight: 600;
}
.menu-main {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  padding-top: 2px;
}

.menu-stamp {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  display: grid;
  width: 68px;
  height: 68px;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 3px 3px 0 rgba(27, 22, 16, 0.18);
  transform: rotate(8deg);
  user-select: none;
}
.menu-stamp__num {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.06em;
}
.menu-stamp__txt {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--orange-deep);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero {
  max-width: 100%;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(33px, 10.2vw, 49px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.hero em {
  position: relative;
  color: var(--orange);
  font-style: normal;
}

.lede {
  max-width: 34ch;
  margin: 16px 0 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
  text-wrap: pretty;
}
.lede strong {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.rule-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid var(--ink);
}
.rule {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}
.rule-num {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--orange-deep);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
}
.rule-txt {
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.challenge {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
  padding: 8px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: var(--acid);
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-0.6deg);
}
.challenge__label {
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.challenge__score {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.035em;
}
.challenge__cta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.challenge__cta svg {
  width: 11px;
  height: 11px;
}

.challenge__note {
  flex-basis: 100%;
  margin-top: 2px;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.menu-bottom {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

/* buttons */
.btn {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  border: 1.5px solid var(--ink);
  border-radius: var(--r-md);
  color: var(--ink);
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.03em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 0.16s var(--ease-out), background 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out);
}
.btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(2px);
}
.btn--primary {
  justify-content: space-between;
  padding: 6px 6px 6px 17px;
  color: var(--paper-light);
  background: var(--ink);
  box-shadow: 0 5px 0 rgba(27, 22, 16, 0.15);
}
.btn--primary:hover {
  background: var(--ink-2);
  box-shadow: 0 6px 0 rgba(27, 22, 16, 0.12);
}
.btn__arrow {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 9px;
  color: var(--ink);
  background: var(--acid);
}
.btn__arrow svg {
  width: 18px;
  height: 18px;
}
.btn--ghost {
  background: transparent;
}
.btn--ghost:hover {
  background: rgba(27, 22, 16, 0.055);
}
.btn--x {
  justify-content: flex-start;
  padding-left: 18px;
}
.btn--x > svg:first-child {
  width: 17px;
  height: 17px;
}
.btn--x > span:nth-child(2) {
  flex: 1 1 auto;
  text-align: left;
}
.btn--x .btn__arrow {
  margin-left: auto;
}
.btn--small {
  min-height: 46px;
  padding: 0 11px;
  font-size: 10px;
  letter-spacing: 0.02em;
}
.btn--small svg {
  width: 15px;
  height: 15px;
}
.btn:disabled {
  cursor: default;
  opacity: 0.4;
  transform: none;
}

.text-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 12px 0;
  border: 0;
  color: var(--muted);
  background: none;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-transform: uppercase;
}
.text-btn:hover {
  color: var(--ink);
}

.menu-foot,
.over-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.menu-foot b,
.over-foot b {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- game over ---------- */

.overlay--over {
  background:
    linear-gradient(180deg, rgba(251, 245, 233, 0.99), rgba(243, 232, 213, 0.99));
}
.overlay--over::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 7px;
  background: repeating-linear-gradient(90deg, var(--orange) 0 16px, var(--ink) 16px 32px);
  opacity: 0.9;
}
.overlay--over.is-clear::before {
  background: repeating-linear-gradient(90deg, var(--acid) 0 16px, var(--ink) 16px 32px);
}
.overlay--over.is-fail::before {
  background: repeating-linear-gradient(90deg, var(--red) 0 16px, var(--ink) 16px 32px);
}

.over-sheet {
  position: relative;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: center;
  gap: 11px;
  padding: 21px 20px 16px;
}

#overRank {
  padding: 3px 6px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  color: var(--ink);
  background: var(--acid);
  font-weight: 600;
  white-space: nowrap;
}
#overRank.is-fail {
  border-color: var(--red);
  color: var(--paper-light);
  background: var(--red);
}
.final-score.is-fail {
  color: var(--red);
}

.over-score-wrap {
  padding: 3px 0 1px;
}
.over-score-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
}
.final-score {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(64px, 20vw, 90px);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.055em;
  padding-top: 3px;
}
.new-best {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  color: var(--orange-deep);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.new-best__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  animation: livePulse 0.9s steps(2, end) infinite;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.stat {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}
.stat__val {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.045em;
}
.stat__label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.challenge-result {
  padding: 7px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  color: var(--paper-light);
  background: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}
.challenge-result.is-win {
  color: var(--ink);
  background: var(--acid);
  box-shadow: 3px 3px 0 var(--ink);
}

.over-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.over-actions .btn {
  min-height: 51px;
}

/* ---------- pause ---------- */

.overlay--pause {
  background: rgba(243, 232, 213, 0.92);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.pause-sheet {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 30px;
  text-align: center;
}
.pause-sheet .eyebrow {
  margin-bottom: 0;
}
.pause-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(48px, 15vw, 68px);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.05em;
}
.pause-title span {
  color: var(--orange);
}
.pause-copy {
  max-width: 26ch;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.pause-sheet .btn {
  max-width: 310px;
}
.pause-sheet .btn--primary {
  justify-content: center;
}

/* ---------- HUD ---------- */

.hud {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) auto minmax(0, 0.8fr);
  align-items: end;
  gap: 8px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--paper-light);
}

.hud-score,
.hud-combo {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}
.hud-combo {
  align-items: flex-end;
}
.hud-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.1em;
}
.hud-value {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.055em;
}
.hud-value--combo {
  color: var(--orange-deep);
}
.hud-value--hold {
  color: var(--orange-deep);
  font-variant-numeric: tabular-nums;
}
.hud-value.is-hot {
  color: var(--red);
}
.hud-score.is-pumped .hud-value {
  animation: scorePump 0.3s var(--ease-out);
}
.hud-combo.is-pumped .hud-value {
  animation: scorePump 0.3s var(--ease-out);
}

.hud-lives {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-bottom: 1px;
}
.lives {
  display: flex;
  align-items: center;
  gap: 3px;
}
.life {
  width: 17px;
  height: 17px;
  color: var(--orange);
  transition: color 0.2s, opacity 0.2s, transform 0.2s;
}
.life.is-lost {
  color: var(--muted);
  opacity: 0.22;
  transform: scale(0.92);
}

/* ---------- share dialog ---------- */

.share-dialog {
  position: fixed;
  inset: 0;
  width: min(430px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  margin: auto;
  padding: 16px;
  overflow-y: auto;
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  color: var(--ink);
  background: var(--paper-light);
  box-shadow: 0 28px 80px rgba(27, 22, 16, 0.35);
  z-index: 100;
}
.share-dialog:focus-visible {
  outline: none;
}
.share-dialog::backdrop {
  background: rgba(27, 22, 16, 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.share-dialog[open] {
  animation: dialogIn 0.22s var(--ease-out) both;
}

.dialog-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.dialog-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
}
.dialog-top h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 31px;
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.04em;
}
.share-preview {
  position: relative;
  margin: 12px 0 8px;
  overflow: hidden;
  border: 1.5px solid var(--ink);
  border-radius: 11px;
  background: var(--paper-deep);
}
.share-preview img {
  display: block;
  width: 100%;
  height: auto;
}
.share-ready {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 9px;
  padding: 4px 7px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--acid);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.share-ready__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--orange);
}
.dialog-copy {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.dialog-actions {
  display: flex;
  gap: 7px;
  margin-top: 7px;
}
.dialog-actions .btn {
  flex: 1 1 0;
}
.share-url {
  margin: 9px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- extras ---------- */

.rotate-note {
  display: none;
}

.noscript {
  position: fixed;
  z-index: 100;
  inset: auto 16px 16px;
  padding: 14px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  color: var(--paper-light);
  background: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
}

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  .side-type,
  .desktop-credit {
    display: none;
  }
}

@media (max-width: 600px) {
  .shell {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    padding: 0;
  }
  .cabinet {
    width: 100%;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .topbar {
    padding-right: 13px;
    padding-left: 13px;
  }
  .hud {
    padding-right: 16px;
    padding-left: 16px;
  }
  .overlay--menu::before {
    top: -260px;
    right: 0;
  }
}

@media (min-width: 601px) and (max-width: 1000px) {
  .cabinet {
    height: min(880px, calc(100dvh - 24px));
  }
  .shell {
    padding: 12px;
  }
}

@media (max-width: 360px) {
  .menu-stamp {
    display: none;
  }
  .menu-sheet {
    padding-left: 16px;
    padding-right: 16px;
  }
  .menu-topline {
    left: 16px;
    right: 16px;
  }
}

@media (max-height: 760px) {
  .menu-sheet {
    gap: 12px;
    padding: 48px 18px 12px;
  }
  .menu-main {
    padding-top: 0;
  }
  .menu-stamp {
    width: 62px;
    height: 62px;
  }
  .menu-stamp__num {
    font-size: 22px;
  }
  .hero {
    font-size: clamp(33px, 9.9vw, 45px);
  }
  .lede {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.42;
  }
  .rule-row {
    margin-top: 12px;
    padding-top: 8px;
  }
  .challenge {
    margin-top: 10px;
    padding: 6px 9px;
  }
  .challenge__score {
    font-size: 22px;
  }
  .btn {
    min-height: 49px;
  }
  .btn__arrow {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }
  .over-sheet {
    gap: 8px;
    padding: 16px 18px 13px;
  }
  .final-score {
    font-size: clamp(56px, 17vw, 80px);
  }
  .stats {
    padding: 8px 0;
  }
  .over-actions .btn {
    min-height: 47px;
  }
  .topbar {
    padding-top: calc(7px + env(safe-area-inset-top));
    padding-bottom: 7px;
  }
  .hud {
    padding-top: 9px;
    padding-bottom: calc(9px + env(safe-area-inset-bottom));
  }
  .hud-value {
    font-size: 22px;
  }
}

@media (max-height: 640px) {
  .rule-row {
    display: none;
  }
  .menu-main {
    padding-top: 2px;
  }
  .menu-stamp {
    top: -4px;
    width: 58px;
    height: 58px;
  }
  .menu-stamp__num {
    font-size: 21px;
  }
  .hero {
    font-size: clamp(32px, 10.6vw, 41px);
  }
  .lede {
    max-width: 38ch;
    font-size: 12.5px;
  }
  .menu-foot,
  .over-foot {
    font-size: 10px;
  }
  .final-score {
    font-size: clamp(50px, 15vw, 68px);
  }
  .stat__val {
    font-size: 19px;
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  .cabinet {
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .shell {
    padding: 0;
  }
  .hint,
  .board-meta {
    display: none;
  }
  .hud {
    padding-left: max(18px, calc((100vw - 680px) / 2));
    padding-right: max(18px, calc((100vw - 680px) / 2));
  }
  .menu-sheet {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.75fr);
    align-items: center;
    gap: 22px;
    padding: 12px 24px;
  }
  .menu-main {
    padding-top: 0;
  }
  .menu-stamp,
  .rule-row {
    display: none;
  }
  .hero {
    font-size: clamp(34px, 6.2vw, 46px);
  }
  .lede {
    margin-top: 8px;
    font-size: 12px;
  }
  .menu-bottom {
    gap: 10px;
  }
  .over-sheet {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(250px, 0.85fr);
    align-content: center;
    gap: 6px 20px;
    padding: 10px 24px;
  }
  .overlay--over.is-clear #challengeResult {
    display: none;
  }
  .over-topline {
    grid-column: 1 / -1;
  }
  .over-score-wrap {
    grid-row: span 2;
  }
  .stats {
    margin-top: 2px;
  }
  .over-actions {
    grid-column: 2;
    grid-row: 2 / span 2;
  }
  .over-foot {
    grid-column: 2;
  }
  .pause-sheet {
    gap: 6px;
  }
  .pause-title {
    font-size: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@keyframes toastPop {
  0% { opacity: 0; transform: translate(-50%, 8px) rotate(-1deg) scale(0.96); }
  14% { opacity: 1; transform: translate(-50%, 0) rotate(-1deg) scale(1); }
  70% { opacity: 1; transform: translate(-50%, -2px) rotate(-1deg) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -12px) rotate(-1deg) scale(0.98); }
}

@keyframes scorePump {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

@keyframes dialogIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
