:root {
  color-scheme: light;
  --bg: #f5efe6;
  --bg-alt: #fbf8f2;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --text: #1f2430;
  --muted: #6d7280;
  --border: rgba(31, 36, 48, 0.1);
  --accent: #2f5d62;
  --accent-strong: #21474b;
  --success: #2c7a5c;
  --danger: #c24747;
  --shadow: 0 18px 60px rgba(31, 36, 48, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(47, 93, 98, 0.12), transparent 36%),
    radial-gradient(circle at top right, rgba(194, 125, 79, 0.16), transparent 28%),
    linear-gradient(180deg, #f7f1e9 0%, #f2eadf 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body {
  padding: 20px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(100%, 980px);
  max-width: 980px;
  margin: 0 auto;
  min-width: 0;
}

.hero {
  display: grid;
  gap: 16px;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: stretch;
  margin-bottom: 20px;
}

.hero-copy,
.hero-card,
.panel {
  backdrop-filter: blur(20px);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  min-width: 0;
}

.hero-copy {
  border-radius: var(--radius-xl);
  padding: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  color: var(--accent);
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  max-width: 12ch;
}

.subtitle {
  margin: 14px 0 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.hero-card {
  border-radius: var(--radius-xl);
  padding: 22px;
  display: grid;
  gap: 18px;
  align-content: space-between;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hero-stats > div,
.label,
.badge,
.chip {
  border-radius: 999px;
}

.hero-stats > div {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  padding: 14px 12px;
}

.label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-card strong {
  font-size: 1.2rem;
}

.content {
  display: grid;
  gap: 16px;
}

.panel {
  border-radius: var(--radius-xl);
  padding: 20px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.chip-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip {
  white-space: nowrap;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
  color: var(--text);
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.chip:hover {
  transform: translateY(-1px);
}

.chip.is-active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

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

.badge {
  background: rgba(47, 93, 98, 0.1);
  color: var(--accent-strong);
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 700;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(31, 36, 48, 0.08);
  overflow: hidden;
  margin-bottom: 18px;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #6aa8a5);
  transition: width 0.25s ease;
}

.question-card {
  border-radius: calc(var(--radius-xl) - 4px);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  padding: 20px;
}

.question-text {
  margin: 0 0 18px;
  font-size: clamp(1.12rem, 3vw, 1.45rem);
  line-height: 1.45;
  letter-spacing: -0.02em;
}

.options-list {
  display: grid;
  gap: 12px;
}

.option-button {
  text-align: left;
  width: 100%;
  padding: 16px 15px;
  border-radius: 18px;
  border: 1px solid rgba(31, 36, 48, 0.12);
  background: #fff;
  color: var(--text);
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.option-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(31, 36, 48, 0.08);
}

.option-button:disabled {
  cursor: default;
  opacity: 1;
}

.option-button .letter {
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  margin-right: 10px;
  border-radius: 999px;
  background: rgba(47, 93, 98, 0.08);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.option-button.is-correct {
  border-color: rgba(44, 122, 92, 0.35);
  background: rgba(44, 122, 92, 0.08);
}

.option-button.is-wrong {
  border-color: rgba(194, 71, 71, 0.35);
  background: rgba(194, 71, 71, 0.08);
}

.option-button.is-muted {
  opacity: 0.6;
}

.result-card {
  margin-top: 16px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(47, 93, 98, 0.08), rgba(47, 93, 98, 0.02));
  border: 1px solid rgba(47, 93, 98, 0.12);
}

.result-headline {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 800;
}

.result-detail {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button {
  min-height: 52px;
  padding: 0 18px;
  border-radius: 16px;
  font-weight: 700;
}

.primary-button {
  color: #fff;
  background: var(--accent);
}

.primary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  border: 1px solid var(--border);
}

.is-success {
  border-color: rgba(44, 122, 92, 0.45) !important;
  box-shadow: 0 0 0 1px rgba(44, 122, 92, 0.12) inset;
}

.is-error {
  border-color: rgba(194, 71, 71, 0.45) !important;
  box-shadow: 0 0 0 1px rgba(194, 71, 71, 0.12) inset;
}

.shake {
  animation: shake 0.34s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

@media (max-width: 860px) {
  body {
    padding: 14px;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .hero-card,
  .panel {
    border-radius: 24px;
  }

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

@media (max-width: 560px) {
  body {
    padding: 10px;
  }

  .hero {
    gap: 12px;
    margin-bottom: 14px;
  }

  .hero-copy {
    padding: 18px;
  }

  .hero-card {
    padding: 14px;
    gap: 12px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .hero-stats > div {
    padding: 12px 12px 10px;
  }

  .panel {
    padding: 14px;
  }

  .question-card {
    padding: 16px;
  }

  .actions {
    flex-direction: column;
  }

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

  .hero h1 {
    font-size: clamp(1.65rem, 7.5vw, 2.15rem);
    line-height: 1.08;
    max-width: none;
  }

  .subtitle {
    margin-top: 10px;
    font-size: 0.95rem;
  }

  .section-head h2 {
    font-size: 0.98rem;
  }

  .section-head p {
    font-size: 0.84rem;
  }

  .question-text {
    font-size: 1.02rem;
  }

  .option-button {
    padding: 14px 13px;
    border-radius: 16px;
  }
}

@media (max-width: 420px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  .hero-copy {
    padding: 16px;
  }

  .hero-card {
    padding: 13px;
  }

  .question-meta {
    gap: 8px;
  }

  .badge {
    padding: 7px 10px;
    font-size: 0.78rem;
  }
}
