:root[data-theme="dark"] {
  --bg: #111111;
    --link: #5B9BD5;
  --panel: #1a1a1a;
  --panel2: #222222;
  --accent: #5B9BD5;
  --accent2: #3d7bb8;
  --good: #34c759;
  --bad: #ff453a;
  --text: #e8e8f0;
  --muted: rgba(232,232,240,0.60);
  --border: rgba(232,232,240,0.10);
}
:root[data-theme="light"] {
  --bg: #ffffff;
  --panel: #f5f5f5;
  --panel2: #ededed;
  --accent: #3d7bb8;
  --link: #3b77b2;
  --accent2: #2c5f8f;
  --good: #248a3d;
  --bad: #d70015;
  --text: #111111;
  --muted: rgba(17,17,17,0.60);
  --border: rgba(17,17,17,0.10);
}
#settings-btn { background: none; border: none; cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--muted); padding: 0 4px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 0.75rem 0; }
/* genre colors: [icon, color, text] */
:root {
  --g-action: #ff6b35; --g-action-text: #111;
  --g-comedy: #ffd23f; --g-comedy-text: #111;
  --g-drama: #3d5aa8; --g-drama-text: #fff;
  --g-scifi: #b3312c; --g-scifi-text: #fff;
  --g-classic: #c9a24b; --g-classic-text: #111;
  --g-pop: #ff6fae; --g-pop-text: #111;
  --g-rock: #6b7280; --g-rock-text: #fff;
  --g-hiphop: #2e8b57; --g-hiphop-text: #fff;
  --g-rnb: #b8860b; --g-rnb-text: #111;
  --g-country: #8b5a2b; --g-country-text: #fff;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  /* matches index.html: SF on Apple, Helvetica elsewhere. 'DM Sans' used to lead here but is never loaded. */
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  transition: background 0.2s ease, color 0.2s ease;
}
.topbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo { width: 32px; height: 32px; border-radius: 8px; }
/* The mark's own lettering is unreadable at this size, so the name is real text. */
.wordmark { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.stats { display: flex; align-items: center; gap: 18px; font-size: 1.05rem; color: var(--link, var(--accent)); font-weight: 600; }
#settings-btn { display: flex; align-items: center; color: var(--muted); }
.wrap {
  width: 100%;
  max-width: 720px;
  padding: 20px 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.panel {
  background: var(--panel);
  border-radius: 16px;
  padding: 28px 28px;
  text-align: center;
}
.prompt { color: var(--muted); font-weight: 600; margin: -8px 0 20px; }
.hidden { display: none; }
.genre-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--badge-text, #111);
}
button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 22px;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 6px;
  cursor: pointer;
  transition: transform 0.1s ease;
  font-family: inherit;  /* form controls do not inherit it; without this every button falls back to the UA font */
}
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: var(--panel2)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23888' d='M4 6l4 4 4-4z'/%3E%3C/svg%3E")
    no-repeat right 16px center / 12px;
  color: var(--text);
  border: none;
  border-radius: 10px;
  padding: 14px 40px 14px 22px;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 6px;
  cursor: pointer;
  font-family: inherit;
}
#start-speed { background: var(--accent2); }
button:active { transform: scale(0.96); }
blockquote {
  font-size: 1.5rem;
  line-height: 1.4;
  font-style: italic;
  margin: 0 0 28px;
  animation: slide-in 0.25s ease;
}
@keyframes slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.options { display: grid; gap: 12px; }
.options button {
  background: var(--panel2);
  color: var(--text);
  text-align: left;
  margin: 0;
  font-size: 1.05rem;
  padding: 16px 20px;
}
.options button.correct { background: var(--good); color: #fff; animation: pulse 0.4s ease; }
.options button.wrong { background: var(--bad); color: #fff; animation: shake 0.4s ease; }
@keyframes pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
#feedback { min-height: 1.4em; margin-top: 12px; font-weight: 600; font-size: 1.1rem; }
.timer-ring {
  position: relative;
  width: 60px;
  height: 60px;
  margin: 0 auto 12px;
}
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg, .ring-fg { fill: none; stroke-width: 3; }
.ring-bg { stroke: var(--border); }
.ring-fg { stroke: var(--accent); stroke-dasharray: 100 100; transition: stroke-dashoffset 0.2s linear; }
.timer-ring span {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 0.9rem; font-weight: 700;
}

/* Poster/album mosaic behind the game, built from quotes.json by game.js. Deliberately
   static — the speed round is a timed attention task, so motion here would fight the clock.
   Held at a low opacity instead of using a scrim, so the game UI keeps flat backgrounds. */
#backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 10px;
  padding: 10px;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  opacity: 0.14;
}
:root[data-theme="dark"] #backdrop { opacity: 0.22; }
.bcol { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bcol img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.bcol img.sq { aspect-ratio: 1/1; }

#art-flash {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}
#art-flash.show { opacity: 0.35; }
