:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #667085;
  --primary: #3b5bdb;
  --correct: #2f9e44;
  --wrong: #e03131;
  --border: #d0d5dd;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: system-ui, "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
}

#app { max-width: 640px; margin: 0 auto; padding: 24px 16px; }
.screen { background: var(--card); border-radius: 12px; padding: 24px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); }
h1 { margin-top: 0; }
.student-info { margin: 0 0 12px; font-weight: 700; color: var(--primary); }
h2 { font-size: 1rem; color: var(--muted); }

button {
  font: inherit;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--primary); }
button:disabled { cursor: default; opacity: 0.6; }

.button-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; }
.notice { color: var(--muted); font-size: 0.9rem; }

.quiz-header { display: flex; justify-content: space-between; color: var(--muted); margin-bottom: 12px; }
.question { font-size: 1.15rem; font-weight: 600; }
.choices { display: grid; gap: 8px; }
.choice { text-align: left; }
.choice:disabled { opacity: 1; }
.choice.correct { background: #ebfbee; border-color: var(--correct); color: var(--correct); font-weight: 600; }
.choice.wrong { background: #fff5f5; border-color: var(--wrong); color: var(--wrong); }

.feedback { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.feedback-result.is-correct { color: var(--correct); font-weight: 700; }
.feedback-result.is-wrong { color: var(--wrong); font-weight: 700; }
.source { font-size: 0.85rem; color: var(--muted); }
.big-score { font-size: 2.5rem; font-weight: 700; margin: 8px 0; }

.mode-list { display: grid; gap: 8px; margin-bottom: 16px; }
.mode-option { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.mode-name { font-weight: 700; }
.mode-rule { color: var(--muted); font-size: 0.9rem; }
.mode-notice { color: var(--muted); font-size: 0.85rem; }

.timer { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.timer-bar { flex: 1; height: 8px; background: #e9ecef; border-radius: 4px; overflow: hidden; }
.timer-fill { height: 100%; background: var(--primary); transition: width 1s linear; }
.timer.urgent #timer-text { color: var(--wrong); font-weight: 700; }
.timer.urgent .timer-fill { background: var(--wrong); }

.hint-button { margin-bottom: 12px; }
.choice.removed { display: none; }
