:root {
  --bg-primary: #000000; /* pure black = transparent on additive display */
  --bg-secondary: #0a0a0f;
  --bg-tertiary: #14141f;
  --bg-card: #1a1a2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent-primary: #00d4ff;
  --accent-good: #00ff88;
  --accent-bad: #ff5c5c;
  --accent-warm: #ffd166;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  width: 600px;
  height: 600px;
  overflow: hidden;
}

#app { width: 100%; height: 100%; position: relative; }

/* --- Screens --- */
.screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
}
.screen.hidden { display: none; }

/* --- Header --- */
.header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-secondary);
  gap: 12px;
  flex-shrink: 0;
}
.header h1 { font-size: 22px; font-weight: 600; flex: 1; }
.header-meta {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-primary);
  background: var(--bg-tertiary);
  padding: 4px 14px;
  border-radius: 20px;
  min-width: 32px;
  text-align: center;
}
.header-meta.low-time { color: var(--accent-bad); }

/* --- Content --- */
.content {
  flex: 1;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* --- Focus states --- */
.focusable {
  transition: all 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 44px;
}
.focusable:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
}

/* --- Nav bar --- */
.nav-bar {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.nav-item {
  flex: 1;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}
.nav-item:focus { background: var(--bg-card); }
.nav-item.primary { background: var(--accent-primary); color: #0a0a0f; }
.nav-item.primary:focus { background: #33ddff; }

/* --- Home screen --- */
.home-content { justify-content: center; text-align: center; gap: 16px; }
.home-icon { display: flex; justify-content: center; }
.home-desc { font-size: 15px; color: var(--text-secondary); line-height: 1.6; padding: 0 12px; }
.home-best { font-size: 14px; color: var(--accent-warm); font-weight: 600; }

/* --- Quiz screen --- */
.quiz-content { justify-content: flex-start; padding-top: 16px; gap: 14px; }
.streak-readout {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}
.problem {
  font-size: 46px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  letter-spacing: 1px;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 360px;
}
.choice-btn {
  width: 100%;
  height: 56px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 700;
}
.choice-btn:focus { background: var(--bg-card); }
.choice-btn.correct { background: var(--accent-good); color: #06210f; border-color: var(--accent-good); }
.choice-btn.wrong { background: var(--accent-bad); color: #2a0505; border-color: var(--accent-bad); }

/* --- Result screen --- */
.result-content { justify-content: center; text-align: center; gap: 6px; }
.result-label { font-size: 16px; color: var(--text-secondary); font-weight: 600; }
.result-score { font-size: 84px; font-weight: 800; color: var(--accent-primary); line-height: 1; }
.result-best { font-size: 15px; color: var(--accent-warm); font-weight: 600; margin-top: 12px; }

.hidden { display: none !important; }
