:root {
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --border: rgba(0, 0, 0, 0.08);
  --accent: #ff7a3d;
  --accent-2: #0071e3;
  --accent-3: #22a06b;
  --accent-4: #a855f7;
  --accent-5: #e0357a;
  --accent-6: #f2b705;
  --accent-7: #0891b2;
  --accent-8: #92400e;
  --accent-9: #dc2626;
  --accent-10: #2563eb;
  --accent-11: #059669;
  --logo-start: #ffc257;
  --logo-mid: #ff8438;
  --logo-end: #d83c1c;
  --logo-navy: #223462;
  --logo-tan: #d9ac7c;
  --logo-teal: #279489;
  --good: #1fb15b;
  --bad: #e0303f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.16);
  --radius: 22px;
  --radius-sm: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: rgba(28, 28, 30, 0.72);
    --surface-solid: #1c1c1e;
    --text: #f5f5f7;
    --text-secondary: #98989d;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme="dark"] {
  --bg: #000000;
  --surface: rgba(28, 28, 30, 0.72);
  --surface-solid: #1c1c1e;
  --text: #f5f5f7;
  --text-secondary: #98989d;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
}

:root[data-theme="light"] {
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.16);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--accent) 8%, var(--bg)) 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 60px;
}

.wrap {
  width: 100%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* ---------- Typography ---------- */
.brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.brand-logo {
  width: clamp(34px, 5vw, 44px);
  height: clamp(34px, 5vw, 44px);
  flex-shrink: 0;
}
h1.brand {
  font-size: clamp(34px, 6vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
  background: linear-gradient(135deg, var(--logo-start) 0%, var(--logo-mid) 45%, var(--logo-end) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  color: var(--text-secondary);
  font-size: 17px;
  margin: 0;
  text-align: center;
}

.game-settings-line {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.65;
}

.brand-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
}
.brand-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.brand-dots span:nth-child(1) { background: var(--logo-navy); }
.brand-dots span:nth-child(2) { background: var(--logo-tan); }
.brand-dots span:nth-child(3) { background: var(--logo-teal); }

h2.screen-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  text-align: center;
}

/* ---------- Card ---------- */
.card {
  width: 100%;
  background: var(--surface);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Buttons ---------- */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

.btn {
  appearance: none;
  border-radius: 999px;
  padding: 15px 30px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, background 0.15s ease;
  background: var(--text);
  color: var(--bg);
}
.btn:active { transform: translateY(0) scale(0.97); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }
/* Same look as :disabled, but the button stays clickable underneath - for
   cases like Start Game where a click while "incomplete" should still fire
   and explain what's missing, rather than doing nothing at all. */
.btn-look-disabled { opacity: 0.35; box-shadow: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ff8c5a);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-lg {
  padding: 20px 44px;
  font-size: 19px;
}

.replay-expired-banner {
  width: 100%;
  background: color-mix(in srgb, var(--accent-6) 14%, var(--surface-solid));
  border: 1px solid var(--accent-6);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.choice-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- Length picker ---------- */
.length-card {
  width: 180px;
  padding: 28px 20px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--surface-solid);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.length-card.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-solid));
  box-shadow: var(--shadow);
}
.length-num { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; }
.length-label { color: var(--text-secondary); font-size: 14px; }

/* ---------- Wheel ---------- */
.wheel-stage {
  position: relative;
  width: min(460px, 90vw);
  height: min(460px, 90vw);
  display: flex;
  align-items: center;
  justify-content: center;
}
.wheel-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 28px solid var(--text);
  z-index: 3;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}
.wheel {
  width: 94%;
  height: 94%;
  border-radius: 50%;
  position: relative;
  box-shadow: var(--shadow-lg), inset 0 0 0 6px rgba(255,255,255,0.15);
  transition: transform 4.2s cubic-bezier(0.12, 0.85, 0.13, 1);
}
.wheel-hub {
  position: absolute;
  top: 50%; left: 50%;
  width: 72px; height: 72px;
  transform: translate(-50%, -50%);
  background: var(--surface-solid);
  border-radius: 50%;
  box-shadow: var(--shadow);
  z-index: 2;
}
.wheel-label {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.35);
  text-align: center;
}

.spin-result {
  font-size: 22px;
  font-weight: 700;
  min-height: 30px;
  text-align: center;
}

/* ---------- Score badge ---------- */
.score-badge {
  position: sticky;
  top: 10px;
  z-index: 5;
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #ff8c5a);
  box-shadow: var(--shadow-lg);
}
.score-badge-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.85);
}
.score-badge-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* ---------- Status bar ---------- */
.status-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.status-pill {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-pill strong { color: var(--text); font-size: 15px; }
.score-positive { color: var(--good) !important; }
.score-negative { color: var(--bad) !important; }

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ---------- Wager ---------- */
.wager-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  width: 100%;
}
.wager-btn {
  aspect-ratio: 1;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--surface-solid);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  transition: all 0.15s ease;
}
.wager-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  text-decoration: line-through;
}
.wager-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Topic badge ---------- */
.topic-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}

/* ---------- Question ---------- */
.question-block {
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.question-text {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.question-text .hl {
  color: var(--accent);
}
.wager-reminder {
  font-size: 15px;
  color: var(--text-secondary);
}

.hint-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.hint-row-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-2);
}
.hint-row-label .hint-icon { font-size: 13px; }
.hint-row {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}
.hint-btn {
  border-radius: 14px;
  border: 1.5px solid color-mix(in srgb, var(--accent-2) 45%, var(--border));
  background: color-mix(in srgb, var(--accent-2) 7%, transparent);
  color: var(--text-secondary);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s ease;
  min-width: 160px;
}
.hint-btn:disabled { cursor: default; }
.hint-btn.revealed {
  border-style: solid;
  border-color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 8%, transparent);
  color: var(--text);
  opacity: 1;
}
.hint-btn .hint-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
  margin-bottom: 2px;
}
.hint-btn .hint-value {
  font-size: 15px;
  font-weight: 700;
}

.hint-confirm-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
}
.hint-confirm-actions .btn { flex: 1 1 auto; max-width: 200px; }

.stakes-table {
  width: 100%;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 16px;
  font-size: 13px;
}
.stakes-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.stakes-row:last-child { border-bottom: none; }
.stakes-row-head {
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.stakes-row-current {
  font-weight: 800;
  background: color-mix(in srgb, var(--accent-2) 18%, transparent);
  border-radius: 8px;
  border-bottom: none;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
}
.stakes-row-current .stakes-hints { color: var(--text); }
.stakes-hints { color: var(--text-secondary); }
.stakes-win, .stakes-lose { font-weight: 600; }

/* ---------- Search dropdown ---------- */
.search-wrap {
  width: 100%;
  position: relative;
}
.search-input {
  width: 100%;
  padding: 16px 18px;
  font-size: 17px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s ease;
}
.search-input:focus { border-color: var(--accent-2); }
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 10;
}
.search-result-item {
  padding: 12px 18px;
  font-size: 15px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item.active {
  background: color-mix(in srgb, var(--accent-2) 10%, transparent);
}
.selected-player {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent-2) 12%, transparent);
  border: 1.5px solid var(--accent-2);
  font-weight: 700;
  font-size: 16px;
}
.selected-player button {
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
}

/* ---------- Result ---------- */
.result-icon {
  font-size: 56px;
  line-height: 1;
}
.result-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.result-title.correct { color: var(--good); }
.result-title.wrong { color: var(--bad); }
.result-detail {
  color: var(--text-secondary);
  font-size: 16px;
  text-align: center;
  line-height: 1.5;
}
.result-detail strong { color: var(--text); }
.points-delta {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ---------- End screen ---------- */
.final-score {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.round-history {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}
.round-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  font-size: 14px;
}
.rr-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.round-row .rr-topic { color: var(--text-secondary); flex: 1; text-align: left; }
.round-row .rr-delta { font-weight: 700; }
.rr-guess { font-size: 12px; color: var(--text-secondary); }

.round-row-replay {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  font-size: 14px;
}
.rrr-topic { color: var(--text-secondary); font-size: 13px; }
.rrr-side {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.rrr-side-main {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rrr-who { font-weight: 700; width: 74px; flex-shrink: 0; }
.rrr-wager { color: var(--text-secondary); flex: 1; }
.rrr-delta { font-weight: 700; }
.rrr-guess {
  padding-left: 82px;
  font-size: 12px;
  color: var(--text-secondary);
}

.replay-scorecard {
  width: 100%;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.replay-scorecard-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  text-align: center;
}
.replay-scorecard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
}

.replay-outcome {
  width: 100%;
  background: color-mix(in srgb, var(--accent-6) 14%, var(--surface-solid));
  border: 1px solid var(--accent-6);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.replay-outcome-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.replay-outcome-compare {
  font-size: 14px;
  color: var(--text-secondary);
}
.replay-outcome-compare strong { color: var(--text); }

.share-row {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}
.share-row .btn { flex: 1 1 160px; }

.share-popover {
  position: fixed;
  z-index: 50;
  width: 200px;
  display: flex;
  flex-direction: column;
  padding: 6px;
  border-radius: 14px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.share-popover-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.share-popover-item svg { flex-shrink: 0; }
.share-status {
  min-height: 18px;
  font-size: 13px;
  color: var(--accent-2);
  font-weight: 600;
  text-align: center;
}

/* ---------- Rooms ---------- */
.form-field { margin-bottom: 14px; }
.room-code-input {
  text-transform: uppercase;
  letter-spacing: 3px;
  text-align: center;
  font-weight: 700;
}
.room-code-display {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 6px;
  text-align: center;
  color: var(--accent-2);
  margin: 8px 0 16px;
}
.room-player-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.room-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  font-size: 14px;
}
.room-player-progress {
  color: var(--text-secondary);
  font-size: 12px;
  flex-shrink: 0;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

/* ---------- Player Career table ---------- */
.career-table-wrap {
  width: 100%;
  max-height: 340px;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
}
.career-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}
.career-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-solid);
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}
.career-table thead th:first-child,
.career-table tbody td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--surface-solid);
}
.career-table tbody td {
  padding: 8px 12px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.career-table tbody tr:last-child td { border-bottom: none; }
.career-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--text) 3%, transparent);
}
.career-table tbody tr:nth-child(even) td:first-child {
  background: color-mix(in srgb, var(--surface-solid) 100%, var(--text) 3%);
}

/* ---------- Fill in the Blank ---------- */
.fill-blank-table td, .fill-blank-table th { text-align: left; }
.fill-blank-table td:last-child, .fill-blank-table th:last-child { text-align: right; }
.fb-blank-row td { font-weight: 700; }
.fb-blank {
  color: var(--accent-6);
  letter-spacing: 0.05em;
}

/* ---------- This or That ---------- */
.tot-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tot-row-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-align: center;
}
.tot-matchup {
  position: relative;
  width: 100%;
  display: flex;
  gap: 16px;
  align-items: stretch;
}
.tot-choice {
  flex: 1;
  background: var(--surface-solid);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}
.tot-choice-selected {
  border-color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 12%, var(--surface-solid));
}
.tot-choice:disabled { cursor: default; opacity: 1; }
.tot-choice:disabled .tot-name { color: var(--text); }
.tot-choice-correct {
  border-color: var(--good);
  background: color-mix(in srgb, var(--good) 12%, var(--surface-solid));
}
.tot-choice-wrong {
  border-color: var(--bad);
  background: color-mix(in srgb, var(--bad) 10%, var(--surface-solid));
}
.tot-name {
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}
.tot-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}
.tot-hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-3);
}
.tot-vs {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-secondary);
}

/* ---------- Timer ---------- */
.timer-display {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* ---------- How to Play ---------- */
.app-header {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.how-to-play-btn {
  align-self: center;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  order: -1;
  margin-bottom: 4px;
}
.app-footer {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 16px 4px 4px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}
.footer-copyright { white-space: nowrap; }
.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-link {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}
.footer-social {
  display: flex;
  gap: 10px;
  align-items: center;
}
.footer-icon-link {
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  transition: all 0.15s ease;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.modal-close-btn {
  position: sticky;
  align-self: flex-end;
  top: 0;
  margin-bottom: -36px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  flex-shrink: 0;
}
.modal-body {
  width: 100%;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  text-align: left;
}
.modal-body p { margin: 0 0 12px; }

/* ---------- Difficulty picker ---------- */
.difficulty-card {
  width: 150px;
}
.difficulty-label {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

@media (max-width: 480px) {
  #app { padding: 14px 14px 24px; }
  .wrap { gap: 14px; }

  .brand-logo { width: 30px; height: 30px; }
  h1.brand { font-size: 28px; }
  .tagline { font-size: 14px; }
  .app-header { gap: 4px; }
  .brand-dots { margin-top: 0; }
  .how-to-play-btn { padding: 6px 14px; font-size: 12px; margin-bottom: 0; }

  .app-footer { justify-content: center; text-align: center; font-size: 12px; }

  .card { padding: 18px 16px; gap: 12px; }
  h2.screen-title { font-size: 21px; }

  .score-badge { padding: 9px 18px; top: 6px; }
  .score-badge-value { font-size: 24px; }
  .score-badge-label { font-size: 11px; }

  .status-pill { padding: 6px 12px; font-size: 12px; }
  .status-pill strong { font-size: 13px; }

  .wager-grid { grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .length-card { width: 130px; padding: 16px 14px; gap: 3px; }
  .length-num { font-size: 30px; }
  .length-label { font-size: 12px; }
  .difficulty-card { width: 96px; padding: 14px 10px; }
  .difficulty-label { font-size: 16px; }
  .choice-row { gap: 10px; }

  .question-text { font-size: 18px; }
  .question-block { gap: 8px; }
  .wager-reminder { font-size: 13px; }

  .hint-row { gap: 8px; }
  .hint-btn { min-width: 0; flex: 1 1 130px; padding: 8px 12px; font-size: 13px; }
  .hint-btn .hint-value { font-size: 13px; }

  .stakes-table { font-size: 12px; padding: 2px 12px; }
  .stakes-row { padding: 5px 0; }

  .search-input { padding: 11px 14px; font-size: 15px; }
  .selected-player { padding: 10px 14px; }

  .btn-lg { padding: 14px 32px; font-size: 16px; }

  .tot-matchup { gap: 8px; }
  .tot-choice { padding: 10px 8px; gap: 4px; }
  .tot-name { font-size: 13px; line-height: 1.2; }
  .tot-hint { font-size: 10px; }
  .tot-vs { width: 24px; height: 24px; font-size: 9px; }
  .tot-row-label { margin-bottom: 4px; font-size: 11px; }
  .tot-list { gap: 8px; }

  .career-table-wrap, .fill-blank-table { max-height: 220px; }

  .timer-display { font-size: 22px; }
  .wheel-stage { width: min(320px, 80vw); height: min(320px, 80vw); }
  .wheel-hub { width: 54px; height: 54px; }
}

/* ---------- Hover-only enhancements ----------
   Gated behind (hover: hover) so these never trigger on touchscreens - a tap
   has no "unhover" event, so on mobile Safari a plain `:hover` rule stays
   visually stuck on (looking like the button/card/hint is still selected or
   pressed) until the user happens to tap something else entirely. Real
   mouse/trackpad devices get the hover feedback as normal. */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,0.18); }
  .length-card:hover { border-color: var(--accent); transform: translateY(-2px); }
  .wager-btn:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-2px); }
  .hint-btn:hover:not(:disabled) { border-color: var(--accent-2); color: var(--accent-2); }
  .search-result-item:hover { background: color-mix(in srgb, var(--accent-2) 10%, transparent); }
  .share-popover-item:hover { background: color-mix(in srgb, var(--accent-2) 10%, transparent); }
  .tot-choice:hover:not(:disabled) { border-color: var(--accent-2); transform: translateY(-2px); }
  .how-to-play-btn:hover { color: var(--text); border-color: var(--accent-2); }
  .footer-link:hover { color: var(--accent-2); text-decoration: underline; }
  .footer-icon-link:hover { color: var(--accent-2); border-color: var(--accent-2); }
  .modal-close-btn:hover { color: var(--text); border-color: var(--accent-2); }
}
