:root {
  --bg: #0a0810;
  --bg-2: #130f20;
  --surface: #171223;
  --surface-2: #1f1833;
  --surface-3: #271f42;
  --line: #2e2547;
  --line-soft: #241d3a;
  --text: #f5f2fc;
  --text-dim: #c3bbd9;
  --muted: #8f86ad;
  --accent: #7c5cff;
  --accent-hi: #9d84ff;
  --accent-soft: rgba(124, 92, 255, 0.14);
  --mint: #22d3a6;
  --amber: #ffb02e;
  --bad: #ff5d6c;
  --radius: 16px;
  --radius-sm: 11px;
  --font: "Segoe UI", -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", ui-monospace, Consolas, "SF Mono", Menlo, monospace;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* stage lighting behind everything */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(38vw 38vw at 18% 8%, rgba(124, 92, 255, 0.30), transparent 62%),
    radial-gradient(32vw 32vw at 88% 4%, rgba(34, 211, 166, 0.16), transparent 60%),
    radial-gradient(46vw 46vw at 62% 96%, rgba(124, 92, 255, 0.16), transparent 65%);
  filter: blur(10px);
  animation: drift 26s ease-in-out infinite alternate;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(10, 8, 16, 0.55), var(--bg) 78%);
}
@keyframes drift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
  to   { transform: translate3d(2%, 2%, 0) scale(1.06); }
}

.app {
  max-width: 660px;
  margin: 0 auto;
  padding: 34px 20px 56px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── logo ── */
.topbar {
  display: flex;
  align-items: center;
  margin-bottom: 22px;
}
.logo { display: inline-flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 11px;
  box-shadow: 0 6px 18px rgba(124, 92, 255, 0.4);
}
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.22em;
  background: linear-gradient(100deg, var(--text) 25%, var(--accent-hi) 75%, var(--mint));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo-tag {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

main { flex: 1; }

/* ── screens ── */
.screen { display: none; }
.screen.active { display: block; animation: rise 0.26s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px) scale(0.995); }
  to   { opacity: 1; transform: none; }
}

.panel {
  position: relative;
  background: linear-gradient(180deg, var(--surface), rgba(23, 18, 35, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.panel.centered { text-align: center; padding: 54px 26px; }

h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.section-head {
  margin: 28px 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-hi);
}
.lede { margin: 0 0 24px; color: var(--text-dim); font-size: 16.5px; }
.hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.hint.good { color: var(--mint); }
.hint.bad { color: var(--bad); }
.stat-line { margin: 24px 0 0; font-size: 13px; color: var(--muted); }
.stat-line strong { color: var(--text); font-size: 15px; }

/* ── mode cards ── */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 28px; }
.mode-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  padding: 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.16s, background 0.16s;
}
.mode-card::after {
  content: "";
  position: absolute;
  inset: auto -40% -70% auto;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  filter: blur(30px);
  transition: opacity 0.2s;
}
.mode-card:hover { transform: translateY(-3px); border-color: var(--accent); background: var(--surface-3); }
.mode-card:hover::after { opacity: 0.35; }
.mode-card:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.mode-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.mode-desc { font-size: 13px; color: var(--muted); line-height: 1.45; }

/* ── settings ── */
.settings { display: grid; gap: 20px; }
.setting { margin: 20px 0 0; }
.settings .setting { margin: 0; }
.setting[hidden] { display: none; }
.label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 9px;
}
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}
.seg button:hover { color: var(--text); background: var(--surface-3); }
.seg button.on {
  background: linear-gradient(135deg, var(--accent), var(--accent-hi));
  color: #fff;
  box-shadow: 0 4px 14px rgba(124, 92, 255, 0.4);
}
.seg button.on:hover { background: linear-gradient(135deg, var(--accent), var(--accent-hi)); }

/* ── slider ── */
.slider-row { display: flex; align-items: center; gap: 14px; }
.slider-value {
  min-width: 46px;
  text-align: center;
  font-size: 17px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--accent-hi);
}
input[type="range"] {
  flex: 1;
  min-width: 0;
  height: 26px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) var(--fill, 30%), var(--line-soft) var(--fill, 30%));
}
input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--line-soft);
}
input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent-hi);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s;
}
input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent-hi);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
input[type="range"]:disabled { opacity: 0.5; cursor: default; }

/* ── buttons ── */
.btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 650;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.13s cubic-bezier(0.22, 1, 0.36, 1), background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-2px); background: var(--surface-3); border-color: var(--accent); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hi));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 22px rgba(124, 92, 255, 0.38);
}
.btn.primary:hover { box-shadow: 0 12px 28px rgba(124, 92, 255, 0.5); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { font-size: 13px; padding: 9px 16px; }
.btn.large { font-size: 17px; padding: 15px 38px; margin-top: 20px; }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; box-shadow: none; }
.btn:focus-visible, .seg button:focus-visible, input:focus-visible, .mode-card:focus-visible {
  outline: 2px solid var(--accent-hi);
  outline-offset: 2px;
}

.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.row.end { justify-content: flex-end; margin-top: 26px; }
.row.centered-row { justify-content: center; }

/* ── inputs ── */
.inline-form { display: flex; gap: 9px; margin-top: 12px; }
.inline-form input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 16px;
  padding: 13px 17px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.32);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.inline-form input::placeholder { color: #6d6489; }
.inline-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.inline-form input:disabled { opacity: 0.55; }
.inline-form.shake { animation: shake 0.32s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
.inline-form.hit input { border-color: var(--mint); box-shadow: 0 0 0 4px rgba(34, 211, 166, 0.18); }
@keyframes shake {
  20% { transform: translateX(-7px); }
  45% { transform: translateX(6px); }
  70% { transform: translateX(-3px); }
}

#join-input { font-family: var(--mono); letter-spacing: 0.2em; text-transform: uppercase; }
#join-input::placeholder { font-family: var(--font); letter-spacing: 0; text-transform: none; }

/* ── rows ── */
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.rows li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 11px 15px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 14.5px;
}
/* Only lists that genuinely append one item at a time animate — the lobby and
   scoreboard repaint on every poll, and would otherwise flicker every second. */
#found-list li, #turn-found li, #playlist-results li {
  animation: pop 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: none; }
}
.rows li .meta { color: var(--muted); font-size: 12.5px; text-align: right; flex-shrink: 0; }
.rows li .pts { color: var(--mint); font-weight: 700; }
.rows.muted li { color: var(--text-dim); background: transparent; }
.rows li.pending { opacity: 0.7; border-style: dashed; }

.remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
}
.remove:hover { color: var(--bad); }

.spinner {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 8px;
  vertical-align: -1px;
  border: 2px solid var(--line);
  border-top-color: var(--accent-hi);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── room code ── */
.code-display {
  position: relative;
  font-family: var(--mono);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.36em;
  text-indent: 0.36em;
  text-align: center;
  color: var(--text);
  padding: 22px 12px;
  margin: 14px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, var(--surface-3), rgba(0, 0, 0, 0.25)),
    radial-gradient(60% 120% at 50% 0%, var(--accent-soft), transparent 70%);
  text-shadow: 0 0 28px rgba(124, 92, 255, 0.55);
}
#room-code-2 { margin-bottom: 20px; }

/* ── player chips ── */
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background: var(--accent);
}
.rows li .who, .board li .who { display: flex; align-items: center; gap: 10px; }

/* ── hud ── */
.hud { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.hud-cell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
}
.hud-label {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.hud-val {
  display: block;
  font-size: 20px;
  font-weight: 750;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.hud-val.warn { color: var(--bad); animation: tick 1s steps(2) infinite; }
@keyframes tick { 50% { opacity: 0.55; } }

.timer-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  margin-bottom: 30px;
}
.timer-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint), var(--accent-hi));
  transition: width 0.12s linear;
}

/* ── the word ── */
.word-stage { text-align: center; margin-bottom: 26px; }
.word {
  margin: 6px 0 0;
  font-size: clamp(46px, 14vw, 82px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 0 44px rgba(124, 92, 255, 0.5);
  animation: land 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes land {
  from { opacity: 0; transform: scale(0.9) translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.feedback { min-height: 22px; margin: 12px 0 0; font-size: 14px; text-align: center; color: var(--muted); }
.feedback.good { color: var(--mint); }
.feedback.bad { color: var(--bad); }
.feedback.info { color: var(--accent-hi); }

.list-header {
  display: flex;
  justify-content: space-between;
  margin: 26px 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── music clips ── */
.clip-stage { text-align: center; margin-bottom: 24px; }
.clip-visual { height: 104px; display: flex; align-items: center; justify-content: center; margin: 8px 0 2px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 72px; }
.bars i {
  display: block;
  width: 8px;
  height: 14px;
  border-radius: 4px;
  background: var(--line);
  transition: background 0.25s;
}
.bars.on i {
  background: linear-gradient(180deg, var(--accent-hi), var(--mint));
  animation: bounce 1s ease-in-out infinite;
  box-shadow: 0 0 18px rgba(124, 92, 255, 0.5);
}
.bars.on i:nth-child(2) { animation-delay: 0.12s; }
.bars.on i:nth-child(3) { animation-delay: 0.24s; }
.bars.on i:nth-child(4) { animation-delay: 0.36s; }
.bars.on i:nth-child(5) { animation-delay: 0.18s; }
.bars.on i:nth-child(6) { animation-delay: 0.30s; }
.bars.on i:nth-child(7) { animation-delay: 0.06s; }
@keyframes bounce { 0%, 100% { height: 14px; } 50% { height: 66px; } }

.targets { display: flex; gap: 9px; justify-content: center; margin: 6px 0 2px; }
.target {
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px dashed var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.target::after { content: " — open"; font-weight: 600; opacity: 0.7; }
.target.got {
  border-style: solid;
  border-color: var(--mint);
  background: rgba(34, 211, 166, 0.16);
  color: var(--mint);
  transform: scale(1.04);
}
.target.got::after { content: " — got it"; opacity: 1; }

.chosen {
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 14px;
  color: var(--muted);
}
.chosen.set { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

#playlist-results { max-height: 270px; overflow-y: auto; margin-top: 12px; }
#playlist-results li { cursor: pointer; }
#playlist-results li:hover { border-color: var(--accent); background: var(--surface-3); }
#playlist-results img { width: 36px; height: 36px; border-radius: 7px; flex-shrink: 0; }
#playlist-results .who { flex: 1; font-weight: 600; }

.reveal {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}
.reveal img { width: 60px; height: 60px; border-radius: 9px; flex-shrink: 0; }
.reveal .title { font-weight: 700; font-size: 16px; }
.reveal .artist { color: var(--text-dim); font-size: 13.5px; }

/* ── countdown ── */
.countdown {
  font-size: clamp(84px, 30vw, 150px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 6px 0 10px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, var(--text), var(--accent-hi));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(124, 92, 255, 0.4);
}
.countdown.beat { animation: beat 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes beat {
  from { transform: scale(1.35); opacity: 0.4; }
  to   { transform: scale(1); opacity: 1; }
}

#live-board { margin-top: 28px; }
#live-board .board li { padding: 10px 14px; font-size: 14px; }

/* ── results ── */
.score-figure { text-align: center; margin: 20px 0 6px; }
.score-figure span {
  display: block;
  font-size: 58px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(160deg, var(--text), var(--accent-hi));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: land 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.score-figure small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.breakdown {
  display: grid;
  gap: 6px;
  margin: 20px auto 0;
  max-width: 320px;
  font-size: 13.5px;
  color: var(--muted);
}
.breakdown div { display: flex; justify-content: space-between; }
.breakdown span:last-child { color: var(--text-dim); font-weight: 600; }

/* ── scoreboard ── */
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.board li {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 15px;
  transition: background 0.25s, border-color 0.25s;
}
.board li .rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.board li .who { flex: 1; font-weight: 600; }
.board li .meta { color: var(--muted); font-size: 12.5px; }
.board li .pts { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.board li.leader {
  border-color: var(--accent);
  background: linear-gradient(100deg, var(--accent-soft), var(--surface-2));
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.18);
}
.board li.leader .rank { background: linear-gradient(135deg, var(--accent), var(--accent-hi)); color: #fff; }
.board li.leader .pts { color: var(--accent-hi); }

.pass-name { font-size: 32px; margin: 0 0 12px; font-weight: 750; }

/* ── modal ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 4, 12, 0.74);
  backdrop-filter: blur(3px);
  animation: fadein 0.16s ease both;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.modal-backdrop[hidden] { display: none; }
.modal {
  width: 100%;
  max-width: 410px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.6);
  animation: lift 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes lift {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
.modal h2 { margin-bottom: 4px; }
.modal .row.end { margin-top: 22px; }
.modal-step[hidden] { display: none; }

.choice-grid { display: grid; gap: 11px; margin-top: 16px; }
.choice {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.14s, background 0.14s;
}
.choice:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--surface-3); }
.choice-title { font-size: 16px; font-weight: 700; }
.choice-desc { font-size: 12.5px; color: var(--muted); }

.foot {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 540px) {
  .app { padding: 22px 15px 40px; }
  .mode-grid { grid-template-columns: 1fr; }
  .hud { grid-template-columns: repeat(2, 1fr); }
  .code-display { font-size: 32px; letter-spacing: 0.28em; text-indent: 0.28em; }
  .panel { padding: 21px; }
  h2 { font-size: 21px; }
}

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