:root {
  color-scheme: light;
  --page: #f6fbf8;
  --surface: #ffffff;
  --surface-strong: #ecf8f2;
  --text: #17352b;
  --muted: #61776e;
  --line: #d9e9e1;
  --accent: #118366;
  --accent-strong: #0a6d55;
  --accent-soft: #d9f4ea;
  --danger: #c64b4b;
  --danger-soft: #fde8e8;
  --shadow: 0 22px 55px rgba(24, 74, 58, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 16% 12%, rgba(35, 151, 111, 0.12), transparent 24rem),
    linear-gradient(135deg, #f8fffb 0%, #eef8f3 100%);
}

button {
  font: inherit;
}

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

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

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(24, 74, 58, 0.1);
}

.brand-mark svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

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

h1 {
  font-size: clamp(2rem, 5vw, 3.15rem);
  line-height: 1;
  font-weight: 850;
}

.brand-lockup p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.98rem;
}

.score-chip {
  min-width: 82px;
  padding: 11px 14px;
  color: var(--accent-strong);
  font-weight: 800;
  text-align: center;
  background: var(--accent-soft);
  border: 1px solid #bde9db;
  border-radius: 8px;
}

.progress-wrap,
.question-panel,
.results-panel {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.progress-wrap {
  padding: 16px;
  margin-bottom: 16px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.progress-track {
  height: 10px;
  margin-top: 12px;
  overflow: hidden;
  background: #dfefe8;
  border-radius: 999px;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #48b48f);
  border-radius: inherit;
  transition: width 220ms ease;
}

.question-panel,
.results-panel {
  padding: clamp(22px, 4vw, 38px);
}

.question-meta,
.result-kicker {
  margin-bottom: 12px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

#question-text,
.result-summary h2 {
  max-width: 760px;
  font-size: clamp(1.45rem, 3.6vw, 2.45rem);
  line-height: 1.14;
  font-weight: 850;
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.choice-button {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  min-height: 84px;
  padding: 16px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.choice-button:hover {
  transform: translateY(-1px);
  border-color: #acdccc;
  box-shadow: 0 12px 28px rgba(24, 74, 58, 0.1);
}

.choice-button[aria-pressed="true"] {
  background: var(--surface-strong);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.choice-letter {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--accent-strong);
  font-weight: 850;
  background: var(--accent-soft);
  border-radius: 8px;
}

.choice-copy {
  align-self: center;
  min-width: 0;
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.selection-note {
  min-height: 24px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 650;
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  min-height: 48px;
  padding: 0 18px;
  cursor: pointer;
  border-radius: 8px;
  font-size: 0.98rem;
  font-weight: 850;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.primary-button {
  color: #ffffff;
  background: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: 0 12px 26px rgba(17, 131, 102, 0.24);
}

.primary-button:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
}

.ghost-button {
  color: var(--accent-strong);
  background: transparent;
  border: 1px solid var(--line);
}

.ghost-button:hover {
  background: var(--surface);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none;
  box-shadow: none;
}

.hidden {
  display: none;
}

.result-summary {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

#result-message {
  max-width: 640px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.answer-list-wrap {
  margin-top: 24px;
}

.answer-list-wrap h3 {
  font-size: 1.1rem;
}

.answer-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.answer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.answer-row.correct {
  border-color: #bce3d5;
}

.answer-row.incorrect {
  border-color: #f2c7c7;
  background: #fffafa;
}

.answer-question {
  font-weight: 800;
  line-height: 1.35;
}

.answer-detail {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.answer-status {
  white-space: nowrap;
  padding: 7px 10px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 850;
  background: var(--accent-soft);
  border-radius: 999px;
}

.answer-row.incorrect .answer-status {
  color: var(--danger);
  background: var(--danger-soft);
}

.retry-button {
  width: 100%;
  margin-top: 24px;
}

@media (max-width: 680px) {
  .quiz-shell {
    width: min(100% - 24px, 920px);
    padding: 18px 0;
  }

  .topbar,
  .progress-copy,
  .actions,
  .answer-row {
    align-items: stretch;
  }

  .topbar,
  .progress-copy {
    flex-direction: column;
  }

  .score-chip {
    width: 100%;
  }

  .choices {
    grid-template-columns: 1fr;
    margin-top: 20px;
  }

  .choice-button {
    min-height: 74px;
  }

  .actions {
    flex-direction: column-reverse;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .answer-row {
    grid-template-columns: 1fr;
  }

  .answer-status {
    width: fit-content;
  }
}
