/* ============================================================
   tuned — refined editorial minimalism
   ============================================================ */

:root {
  --bg: #0a0a0d;
  --bg-grad: radial-gradient(ellipse at 50% 0%, #15151c 0%, #0a0a0d 60%);
  --card: #131318;
  --card-2: #1a1a21;
  --card-3: #22222a;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #ededf0;
  --text-dim: #8c8c95;
  --text-faint: #4a4a52;
  --accent: #ededf0;
  --accent-text: #0a0a0d;
  --success: #84e198;
  --error: #ff6b7a;
  --warn: #ffc857;
  --shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border);
  --grain-opacity: 0.025;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f4f4f2;
  --bg-grad: radial-gradient(ellipse at 50% 0%, #fafaf6 0%, #efefea 70%);
  --card: #ffffff;
  --card-2: #f7f7f4;
  --card-3: #ececea;
  --border: rgba(0, 0, 0, 0.07);
  --border-strong: rgba(0, 0, 0, 0.16);
  --text: #131316;
  --text-dim: #6c6c70;
  --text-faint: #b5b5b0;
  --accent: #131316;
  --accent-text: #f4f4f2;
  --success: #2a7a3e;
  --error: #b8333f;
  --warn: #b07000;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--border);
  --grain-opacity: 0.04;
  color-scheme: light;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

body {
  background: var(--bg-grad);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background 0.4s ease;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='1'/></svg>");
}

a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}
input {
  font: inherit;
  color: inherit;
}

/* ============================================================
   Topbar
   ============================================================ */
.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.02em;
  cursor: pointer;
}

.brand-mark {
  font-size: 18px;
  color: var(--text);
  display: inline-block;
  animation: spin-slow 8s linear infinite;
}

@keyframes spin-slow {
  to {
    transform: rotate(360deg);
  }
}

.topnav {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 600px;
  margin: 0 auto;
}

.topnav a {
  font-size: 12px;
  padding: 6px 10px;
  color: var(--text-dim);
  border-radius: 999px;
  transition:
    color 0.2s,
    background 0.2s;
  letter-spacing: 0.02em;
}
.topnav a:hover {
  color: var(--text);
}
.topnav a.active {
  color: var(--text);
  background: var(--card-2);
}

.topbar-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--text-dim);
  transition:
    color 0.18s,
    background 0.18s;
}
.icon-btn:hover {
  color: var(--text);
  background: var(--card-2);
}

[data-sound="off"] .sound-on {
  display: none;
}
/* When volume is low, hide just the outer wave so the icon hints at level. */
[data-volume-level="low"] .sound-wave-2 {
  display: none;
}

/* Volume popover — appears on hover/focus over the sound icon */
.volume-wrap {
  position: relative;
}
.volume-popover {
  position: absolute;
  top: 100%;
  right: 0;
  /* invisible bridge so cursor traveling from button into popover keeps :hover */
  padding-top: 8px;
  z-index: 12;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}
.volume-popover-inner {
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 12px 14px 10px;
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
}
.volume-wrap:hover .volume-popover,
.volume-wrap:focus-within .volume-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.volume-slider {
  width: 110px;
  margin: 0;
}
.volume-num {
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  width: 22px;
  text-align: right;
}

/* ============================================================
   Stage + Card
   ============================================================ */
.stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 48px;
  position: relative;
  z-index: 2;
}

.card {
  width: 100%;
  max-width: 480px;
  min-height: 620px;
  background: var(--card);
  border-radius: 18px;
  padding: 32px 32px 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--border-strong),
    transparent
  );
  pointer-events: none;
}

/* ============================================================
   Card head (back button + round indicator)
   ============================================================ */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  min-height: 28px;
}

.back-btn {
  font-size: 12px;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 6px;
  margin-left: -8px;
  border-radius: 8px;
  transition:
    color 0.18s,
    background 0.18s;
}
.back-btn:hover {
  color: var(--text);
  background: var(--card-2);
}

.head-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* round indicator (during a session) */
.round-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.round-label {
  text-transform: lowercase;
}
.round-dots {
  display: inline-flex;
  gap: 4px;
}
.round-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--card-3);
  transition:
    background 0.2s,
    transform 0.2s;
}
.round-dot.done {
  background: var(--text-dim);
}
.round-dot.current {
  background: var(--text);
  transform: scale(1.4);
}
.round-tally {
  padding: 3px 8px;
  background: var(--card-2);
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 500;
}

/* ============================================================
   Home view
   ============================================================ */
.home-hero {
  margin-bottom: 28px;
}
.home-hero h1 {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: 64px;
  line-height: 0.95;
  letter-spacing: -0.02em;
  font-style: italic;
}
.home-hero p {
  margin-top: 14px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.55;
  max-width: 340px;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex: 1;
  align-content: start;
}

.tile {
  position: relative;
  background: var(--card-2);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition:
    background 0.18s,
    border-color 0.18s,
    transform 0.18s;
}
.tile:hover {
  background: var(--card-3);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.tile-name {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.tile-desc {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
}
.tile-num {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
}

/* ============================================================
   Game view shared
   ============================================================ */
.game-title {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-style: italic;
  font-size: 52px;
  line-height: 0.9;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.game-tagline {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 20px;
  max-width: 340px;
}

.game-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.game-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.task-prompt {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-align: center;
}

.game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border);
  transition:
    background 0.18s,
    border-color 0.18s,
    transform 0.06s;
}
.btn:hover {
  background: var(--card-3);
  border-color: var(--border-strong);
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
}
.btn-primary:hover {
  background: var(--accent);
  opacity: 0.9;
  border-color: transparent;
}
.btn-block {
  width: 100%;
}
.btn-lg {
  padding: 16px 24px;
  font-size: 14px;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* inputs */
.input {
  width: 100%;
  padding: 14px 16px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: "Geist Mono", monospace;
  font-size: 16px;
  letter-spacing: 0.02em;
  transition:
    border-color 0.18s,
    background 0.18s;
}
.input:focus {
  outline: none;
  border-color: var(--border-strong);
  background: var(--card-3);
}
.input.input-lg {
  font-size: 24px;
  padding: 18px 20px;
  text-align: center;
  font-weight: 500;
}

/* sliders */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--card-3);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--text);
  border-radius: 50%;
  border: 3px solid var(--card);
  box-shadow: 0 0 0 1px var(--border-strong);
  cursor: grab;
  transition: transform 0.1s;
}
.slider::-webkit-slider-thumb:active {
  transform: scale(1.15);
  cursor: grabbing;
}
.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--text);
  border-radius: 50%;
  border: 3px solid var(--card);
  box-shadow: 0 0 0 1px var(--border-strong);
  cursor: grab;
}

/* ============================================================
   SESSION PREP screen (difficulty + start)
   ============================================================ */
.session-prep {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}
.session-prep-lead {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  text-align: center;
}
.session-prep-diffs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.diff-card {
  text-align: left;
  padding: 16px 18px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition:
    background 0.18s,
    border-color 0.18s;
}
.diff-card:hover {
  background: var(--card-3);
  border-color: var(--border-strong);
}
.diff-card.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
}
.diff-card-name {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.diff-card-meta {
  font-size: 11px;
  letter-spacing: 0.02em;
  opacity: 0.7;
}

/* ============================================================
   Countdown (flash) wrap — used by shade, hex, angle, and text
   ============================================================ */
.flash-wrap {
  flex: 1;
  min-height: 320px;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.06s linear;
  overflow: hidden;
}
.flash-wrap.minimal {
  background: var(--card-2);
}
.flash-wrap.target {
  /* steady, no transition */
}

.flash-num {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 120px;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.04em;
}
.flash-num.small-num {
  font-size: 80px;
  position: absolute;
  bottom: 16px;
  right: 22px;
  color: var(--text-dim);
}
.flash-num.pop {
  animation: pop 0.32s ease;
}
@keyframes pop {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  60% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.flash-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-family: "Geist Mono", monospace;
}
.flash-label.angle-flash-label {
  position: absolute;
  bottom: 16px;
  left: 22px;
  color: var(--text-dim);
}

.flash-wrap.angle-flash {
  background: var(--card-2);
  padding: 0;
}
.flash-wrap.angle-flash svg {
  width: 100%;
  max-width: 360px;
}

/* ============================================================
   ROUND RESULT (between rounds)
   ============================================================ */
.round-result {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}
.round-result-sub {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  text-align: center;
}
.round-result-score {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 84px;
  line-height: 1;
  text-align: center;
  letter-spacing: -0.02em;
}

.detail-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
}
.detail-k {
  letter-spacing: 0.02em;
}
.detail-v {
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}
.detail-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
}

/* score colors */
.score.good {
  color: var(--success);
}
.score.mid {
  color: var(--warn);
}
.score.bad {
  color: var(--error);
}

/* ============================================================
   SESSION FINAL summary
   ============================================================ */
.session-final {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}
.session-final-heading {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  text-align: center;
}
.session-final-total {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 88px;
  line-height: 1;
  text-align: center;
  letter-spacing: -0.02em;
}
.session-final-sub {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  text-align: center;
  font-size: 18px;
  color: var(--text-dim);
  letter-spacing: -0.01em;
  margin-top: -6px;
  margin-bottom: 4px;
}
.session-breakdown {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.breakdown-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 12px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}
.breakdown-row:first-child {
  border-top: none;
}
.breakdown-label {
  letter-spacing: 0.02em;
}
.breakdown-value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.session-final-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

/* share button — small icon + label, sits between play-again and home */
.share-btn {
  /* Inherits .btn — we just tighten the gap and align the icon */
  gap: 8px;
}
.share-btn svg {
  flex-shrink: 0;
  color: var(--text-dim);
  transition: color 0.18s;
}
.share-btn:hover svg {
  color: var(--text);
}
.share-btn:disabled svg {
  color: var(--text-faint);
}
.share-btn-label {
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   GAME: shade
   ============================================================ */
.shade-yours-swatch {
  height: 110px;
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: background 0.05s;
}
.shade-sliders {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}
.shade-row {
  display: grid;
  grid-template-columns: 14px 1fr 44px;
  align-items: center;
  gap: 12px;
}
.shade-row .label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.shade-row .value {
  font-size: 12px;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.slider-r::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, #000, #f00);
  height: 4px;
  border-radius: 999px;
}
.slider-g::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, #000, #0f0);
  height: 4px;
  border-radius: 999px;
}
.slider-b::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, #000, #00f);
  height: 4px;
  border-radius: 999px;
}
.slider-r::-moz-range-track {
  background: linear-gradient(90deg, #000, #f00);
  height: 4px;
  border-radius: 999px;
}
.slider-g::-moz-range-track {
  background: linear-gradient(90deg, #000, #0f0);
  height: 4px;
  border-radius: 999px;
}
.slider-b::-moz-range-track {
  background: linear-gradient(90deg, #000, #00f);
  height: 4px;
  border-radius: 999px;
}

/* ============================================================
   GAME: bpm
   ============================================================ */
.bpm-listen-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 320px;
}
.bpm-pulse-area {
  position: relative;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bpm-pulse {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--text-faint);
  transform: scale(1);
  transition:
    transform 0.06s,
    background 0.4s,
    opacity 0.4s;
  opacity: 0.4;
}
.bpm-pulse.beat {
  transform: scale(1.4);
  background: var(--text);
  opacity: 1;
  transition:
    transform 0s,
    background 0s;
}
.bpm-pulse-ring {
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 1px solid var(--border);
  pointer-events: none;
}
.bpm-pulse-ring.r2 {
  width: 170px;
  height: 170px;
  opacity: 0.6;
}

.bpm-value {
  text-align: center;
}
.bpm-num {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 56px;
  line-height: 1;
}
.bpm-unit {
  font-family: "Geist Mono", monospace;
  font-size: 16px;
  color: var(--text-dim);
  margin-left: 4px;
}

.pitch-display {
  text-align: center;
  padding: 8px 0;
}

/* ============================================================
   GAME: timer
   ============================================================ */
.timer-target {
  text-align: center;
  margin-bottom: 4px;
}
.timer-target-num {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 72px;
  line-height: 1;
  letter-spacing: -0.03em;
}
.timer-target-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 6px;
}
.timer-stage {
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.timer-pad {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  background: var(--card-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s;
}
.timer-pad:hover {
  background: var(--card-3);
}
.timer-pad.running {
  background: var(--card-3);
  border-color: var(--border-strong);
}
.timer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
}
.timer-result {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 56px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-transform: none;
}
.timer-pad .timer-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text);
  animation: pulse-soft 1.6s ease-in-out infinite;
}
@keyframes pulse-soft {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.4);
  }
}

/* ============================================================
   GAME: hex
   ============================================================ */
.input-wrap {
  position: relative;
}
.hex-input {
  padding-left: 38px;
  text-transform: uppercase;
}
.input-wrap::before {
  content: "#";
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 24px;
  font-weight: 500;
  pointer-events: none;
}

/* ============================================================
   GAME: angle
   ============================================================ */
.angle-svg {
  width: 100%;
  max-width: 320px;
  height: 220px;
  display: block;
  margin: 0 auto;
}
.angle-line {
  stroke: var(--text);
  stroke-width: 2;
  stroke-linecap: round;
}
.angle-arc {
  stroke: var(--text-dim);
  fill: none;
  stroke-width: 1;
}
.angle-vertex {
  fill: var(--text);
}

.angle-control-big {
  display: flex;
  align-items: center;
  justify-content: center;
}
.angle-value {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 56px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ============================================================
   GAME: pitch
   ============================================================ */
.pitch-listen-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 320px;
}
.pitch-listen-icon {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 96px;
  line-height: 1;
  color: var(--text);
}
.pitch-listen-text {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.pitch-freq {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 56px;
  line-height: 1;
}
.pitch-num {
  font-variant-numeric: tabular-nums;
}
.pitch-freq-unit {
  font-family: "Geist Mono", monospace;
  font-size: 18px;
  color: var(--text-dim);
  font-style: normal;
  margin-left: 4px;
}

/* ============================================================
   GAME: bisect
   ============================================================ */
.bisect-stage {
  height: 280px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  cursor: crosshair;
}
.bisect-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.bisect-line {
  fill: none;
  stroke: var(--text);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bisect-end {
  fill: var(--text);
}

.time-bar {
  height: 4px;
  background: var(--card-3);
  border-radius: 999px;
  overflow: hidden;
}
.time-bar-fill {
  width: 100%;
  height: 100%;
  background: var(--text);
  transform-origin: left;
  transform: scaleX(1);
  border-radius: 999px;
}

/* ============================================================
   GAME: count
   ============================================================ */
.count-stage {
  height: 240px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.count-prompt {
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
.count-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text);
}
.count-dot.review {
  opacity: 0.6;
}

/* ============================================================
   GAME: reaction
   ============================================================ */
.react-stage {
  height: 320px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.react-stage.idle {
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.react-stage.wait {
  background: #b8333f;
  color: #fff;
  border: 1px solid transparent;
}
.react-stage.go {
  background: #2a7a3e;
  color: #fff;
  border: 1px solid transparent;
}

.react-stage h3 {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 44px;
  line-height: 1;
  margin-bottom: 6px;
}
.react-stage p {
  font-size: 12px;
  opacity: 0.85;
}

/* ============================================================
   GAME: interval
   ============================================================ */
.interval-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.interval-options.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.interval-opt {
  padding: 12px 10px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.interval-opt:hover {
  background: var(--card-3);
  border-color: var(--border-strong);
}
.interval-opt.correct {
  border-color: var(--success);
  background: rgba(132, 225, 152, 0.08);
}
.interval-opt.wrong {
  border-color: var(--error);
  background: rgba(255, 107, 122, 0.08);
}
.interval-opt.disabled {
  pointer-events: none;
  opacity: 0.4;
}
.interval-opt-name {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 18px;
  line-height: 1;
}
.interval-opt-desc {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

/* ============================================================
   Footer
   ============================================================ */
.bottombar {
  position: relative;
  z-index: 4;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.bottombar .dot {
  color: var(--text-faint);
}
.bottombar a:hover {
  color: var(--text);
}
.bottombar .muted {
  color: var(--text-faint);
}

/* ============================================================
   Helpers + animations
   ============================================================ */
.muted {
  color: var(--text-dim);
}
.faint {
  color: var(--text-faint);
}

.fade-in {
  animation: fadeIn 0.32s ease both;
}
.slide-up {
  animation: slideUp 0.3s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.shake {
  animation: shake 0.32s;
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 520px) {
  .topbar {
    padding: 16px 18px;
    gap: 12px;
  }
  .topnav {
    display: none;
  }
  .bottombar {
    padding: 14px 18px;
    flex-wrap: wrap;
  }
  .card {
    padding: 24px 22px 22px;
    min-height: 580px;
    border-radius: 14px;
  }
  .home-hero h1 {
    font-size: 50px;
  }
  .game-title {
    font-size: 42px;
  }
  .timer-target-num {
    font-size: 56px;
  }
  .round-result-score {
    font-size: 68px;
  }
  .session-final-total {
    font-size: 72px;
  }
  .flash-num {
    font-size: 96px;
  }
  .pitch-listen-icon {
    font-size: 80px;
  }
  .bpm-num {
    font-size: 44px;
  }
  .pitch-freq {
    font-size: 44px;
  }
  .angle-value {
    font-size: 44px;
  }
}

@media (max-width: 380px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
  .interval-options.cols-3 {
    grid-template-columns: 1fr 1fr;
  }
}
