* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: #0d1117;
  color: #c9d1d9;
  line-height: 1.6;
}

.topbar {
  padding: 24px 16px 16px;
  text-align: center;
  background: linear-gradient(135deg, #161b22 0%, #0d1117 100%);
  border-bottom: 1px solid #30363d;
}

.topbar h1 { margin: 0; font-size: 1.5rem; font-weight: 600; }
.topbar .sub { margin: 4px 0 0; font-size: 0.85rem; color: #8b949e; }

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

.setup, .quiz, .result, .about {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.setup h2, .result h2, .about h2 { margin-top: 0; font-size: 1.05rem; }

.opts { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }

.opt > label:first-child {
  display: block;
  font-size: 0.85rem;
  color: #8b949e;
  font-weight: 600;
  margin-bottom: 4px;
}

.radio-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.radio-group input { accent-color: #1f6feb; }

#count {
  background: #0d1117;
  border: 1px solid #30363d;
  color: #c9d1d9;
  border-radius: 4px;
  padding: 4px 8px;
  font-family: inherit;
}

button.primary {
  background: #1f6feb;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 24px;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
}

button.primary:hover { background: #388bfd; }

.progress {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #8b949e;
  margin-bottom: 16px;
  font-family: ui-monospace, monospace;
}

.prompt-label {
  font-size: 0.85rem;
  color: #8b949e;
  margin-bottom: 6px;
}

.prompt {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  padding: 18px 8px;
  background: #0d1117;
  border-radius: 8px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.prompt.small { font-size: 1.1rem; font-weight: 500; }

.choices { display: flex; flex-direction: column; gap: 8px; }

.choice {
  background: #21262d;
  border: 1px solid #30363d;
  color: #c9d1d9;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  line-height: 1.5;
  transition: background 0.12s, border-color 0.12s;
}

.choice:hover:not(:disabled) { background: #30363d; border-color: #58a6ff; }
.choice:disabled { cursor: default; }
.choice.correct { background: #12351f; border-color: #2ea043; }
.choice.wrong { background: #3d1418; border-color: #f85149; }

.feedback {
  margin-top: 14px;
  padding: 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #0d1117;
}

.feedback .word { font-weight: 700; }
.feedback .reading { color: #8b949e; margin-left: 6px; }

#next { margin-top: 14px; }

.score-big {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
}

.score-pct {
  text-align: center;
  color: #ffd33d;
  font-size: 1.2rem;
  font-family: ui-monospace, monospace;
  margin-bottom: 16px;
}

#review {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
}

#review li {
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.9rem;
}

#review li.ok { background: rgba(46, 160, 67, 0.15); }
#review li.ng { background: rgba(248, 81, 73, 0.15); }

.about p, .about ol { font-size: 0.9rem; }
.about li { margin-bottom: 4px; }

footer {
  border-top: 1px solid #30363d;
  padding: 16px;
  text-align: center;
  font-size: 0.85rem;
  color: #8b949e;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 720px;
  margin: 24px auto 0;
}

footer a, .about a { color: #58a6ff; }
