:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#app { width: 100%; height: 100%; position: relative; }
.screen { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; flex-direction: column; }
.screen.hidden { display: none; }
.focusable { transition: all 0.15s ease; border: 2px solid transparent; cursor: pointer; outline: none; }
.focusable:focus { border-color: var(--focus-ring); box-shadow: 0 0 20px var(--focus-glow); }
.hidden { display: none !important; }

/* Buttons */
.btn {
  width: 100%;
  min-height: 72px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 22px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 18px;
  border: 2px solid transparent;
}
.btn-primary {
  background: linear-gradient(135deg, #00d4ff, #00a0c4);
  color: #001019;
}

/* HOME */
#home { padding: 28px 28px 18px; }
.app-header { text-align: center; }
.logo {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--accent);
  text-shadow: 0 0 24px rgba(0, 212, 255, 0.35);
}
h1 { font-size: 30px; font-weight: 800; margin-top: 4px; }
.subtitle {
  color: var(--text-secondary);
  letter-spacing: 8px;
  text-transform: uppercase;
  font-size: 13px;
  margin-top: 4px;
}
.home-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
}
.home-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 14px;
}
#home-best { color: var(--accent-secondary); font-weight: 600; }

/* QUIZ */
#quiz { padding: 20px; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.pill {
  background: var(--bg-tertiary);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 700;
}
.question {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 16px 18px;
  text-align: center;
  margin-bottom: 16px;
}
.q-label {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.q-value {
  font-size: 52px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  word-break: break-word;
}
.q-value.roman { color: var(--accent); letter-spacing: 3px; }
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  width: 100%;
  min-height: 58px;
  background: var(--bg-tertiary);
  border-radius: 12px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  word-break: break-word;
  border: 2px solid transparent;
}
.option.answered { cursor: default; }
.option.correct {
  background: rgba(0, 255, 136, 0.15);
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
}
.option.wrong {
  background: rgba(255, 68, 102, 0.15);
  border-color: var(--danger);
  color: var(--danger);
}
.feedback {
  margin-top: 14px;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.feedback-text { font-size: 20px; font-weight: 700; min-height: 24px; }
.feedback-text.ok { color: var(--accent-secondary); }
.feedback-text.no { color: var(--danger); }
#next-btn { max-width: 320px; min-height: 56px; }

/* RESULT */
#result { padding: 28px; }
.result-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.result-score {
  font-size: 72px;
  font-weight: 800;
  color: var(--accent);
  text-shadow: 0 0 28px rgba(0, 212, 255, 0.35);
}
.result-acc { font-size: 24px; color: var(--text-primary); font-weight: 600; }
.result-best { font-size: 18px; color: var(--accent-secondary); }
.result-msg { font-size: 18px; color: var(--text-secondary); margin-top: 10px; text-align: center; max-width: 460px; }
.result-actions { display: flex; flex-direction: column; gap: 14px; }

/* LEARN */
#learn { padding: 20px; }
.learn-title { font-size: 24px; font-weight: 800; }
.learn-body { flex: 1; overflow: hidden; margin: 14px 0; }
.chart { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.chart .row {
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sym { color: var(--accent); font-weight: 800; font-size: 22px; }
.val { color: var(--text-secondary); font-size: 18px; }
.examples {
  margin-top: 14px;
  background: var(--bg-tertiary);
  border-radius: 12px;
  padding: 12px 16px;
}
.examples h2 {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.examples .ex {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  padding: 4px 0;
}
.examples .ex .r { color: var(--accent); font-weight: 700; }
.learn-actions { }
