/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0f1117;
  --surface:  #1a1d27;
  --border:   #2e3148;
  --accent:   #6c63ff;
  --accent2:  #ff6b6b;
  --text:     #e8e9f3;
  --muted:    #7b7e9e;
  --correct:  #4caf82;
  --wrong:    #e05c5c;
  --radius:   12px;
  --mono:     'JetBrains Mono', 'Fira Mono', 'Courier New', monospace;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 600px;
}

h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.5rem; }
h2 { font-size: 1.4rem; font-weight: 600; margin-bottom: 1rem; }
p  { line-height: 1.7; color: var(--muted); margin-bottom: 1rem; }
p strong { color: var(--text); }

/* ── Progress bar ─────────────────────────────────────────────────────────── */
.progress-wrap {
  margin-bottom: 1.5rem;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* ── Question display ─────────────────────────────────────────────────────── */
.question-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
}
.question-text {
  font-family: var(--mono);
  font-size: 1.6rem;
  letter-spacing: 0.04em;
  word-break: break-all;
  line-height: 1.5;
  color: var(--text);
}

/* ── Answer input ─────────────────────────────────────────────────────────── */
.answer-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}
.answer-row input[type="number"] {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 1.2rem;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
  /* hide browser spinners */
  -moz-appearance: textfield;
}
.answer-row input[type="number"]::-webkit-inner-spin-button,
.answer-row input[type="number"]::-webkit-outer-spin-button { display: none; }
.answer-row input[type="number"]:focus { border-color: var(--accent); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { opacity: 0.85; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover:not(:disabled) { opacity: 0.75; }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
}
.btn-ghost:hover { color: var(--text); }

/* ── Feedback ─────────────────────────────────────────────────────────────── */
.feedback {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  display: none;
  align-items: center;
  gap: 0.5rem;
}
.feedback.correct { background: #1a3327; color: var(--correct); border: 1px solid var(--correct); display: flex; }
.feedback.wrong   { background: #2d1a1a; color: var(--wrong);   border: 1px solid var(--wrong);   display: flex; }
.feedback.skip    { background: #1e2030; color: var(--muted);    border: 1px solid var(--border);   display: flex; }

/* ── Results chart ────────────────────────────────────────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}
.stat-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.stat-value { font-size: 2rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }

svg.chart { width: 100%; overflow: visible; }

/* ── Landing ──────────────────────────────────────────────────────────────── */
.example-list {
  list-style: none;
  margin: 1rem 0;
}
.example-list li {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.eps-badge {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--muted);
  background: var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  float: right;
  margin-top: 2px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

footer {
  margin-top: 3rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
