:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --panel: #111827;
  --card: #151c26;
  --card-2: #1b2532;
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: #263241;
  --accent: #26c6a8;
  --accent-2: #58a6ff;
  --good: #38d996;
  --bad: #ff8a7a;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Pretendard, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.topbar,
.panel,
.question-card,
.feedback-card,
.wrong-note {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  margin-bottom: 20px;
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: 0;
}

.muted {
  color: var(--muted);
}

.hero-copy {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 18px;
}

.panel {
  padding: 22px;
}

.hero {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stack {
  display: grid;
  gap: 18px;
}

.primary-button,
.secondary-button,
.choice-button,
.tab-button,
.listen-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--card);
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.primary-button {
  background: var(--accent);
  color: #06110f;
  border-color: transparent;
  padding: 14px 18px;
  font-weight: 800;
}

.secondary-button,
.tab-button,
.listen-button {
  padding: 11px 14px;
}

.choice-button {
  width: 100%;
  padding: 14px;
  text-align: left;
}

.primary-button:hover,
.secondary-button:hover,
.choice-button:hover,
.tab-button:hover,
.listen-button:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.stats,
.mode-grid,
.choices,
.examples,
.actions {
  display: grid;
  gap: 10px;
}

.stats {
  grid-template-columns: repeat(3, 1fr);
  margin: 22px 0;
}

.stat,
.mode-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.stat strong {
  display: block;
  font-size: 24px;
}

.stat small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.mode-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mode-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.preview-list {
  display: grid;
  gap: 8px;
}

.preview-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.preview-item span {
  color: var(--muted);
}

.notice {
  padding: 14px;
  border: 1px solid rgba(38, 198, 168, 0.3);
  border-radius: 8px;
  background: rgba(38, 198, 168, 0.08);
}

.progress {
  height: 10px;
  background: var(--card);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.question-card,
.feedback-card {
  padding: 22px;
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.question-text {
  font-size: clamp(24px, 5vw, 44px);
  font-weight: 850;
  line-height: 1.15;
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 13px;
}

.result-good {
  color: var(--good);
}

.result-bad {
  color: var(--bad);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tab-button.active {
  background: var(--accent);
  color: #06110f;
  border-color: transparent;
  font-weight: 800;
}

.wrong-note {
  padding: 14px;
  margin-bottom: 10px;
}

.listen-button {
  margin: 4px 0 16px;
}

.example-card {
  text-align: left;
}

@media (max-width: 820px) {
  .layout,
  .stats,
  .mode-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .quiz-meta,
  .preview-item {
    align-items: flex-start;
    flex-direction: column;
  }
}
