:root[data-theme="dark"] {
  --bg: #171226;
  --panel: #1e1e1e;
  --panel2: #252525;
  --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: #e8ecfb;
  --panel: #ffffff;
  --panel2: #eeeef0;
  --accent: #3d7bb8;
  --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: #9b5de5; --g-scifi-text: #fff;
  --g-classic: #c9a24b; --g-classic-text: #111;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  justify-content: center;
  min-height: 100dvh;
  transition: background 0.2s ease, color 0.2s ease;
}
.wrap {
  width: 100%;
  max-width: 560px;
  padding: 32px 20px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 24px; gap: 12px; }
h1 { font-size: 1.8rem; margin: 0; }
h1 a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.logo { width: 36px; height: 36px; border-radius: 8px; }
.stats { display: flex; align-items: center; gap: 14px; font-size: 1.05rem; color: var(--accent); font-weight: 600; }
.panel {
  background: var(--panel);
  border-radius: 16px;
  padding: 32px 28px;
  text-align: center;
}
.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;
}
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;
}
