:root {
  --bg: #f3f0e8;
  --card: #fffdf8;
  --ink: #35413d;
  --muted: #718078;
  --sage: #8aa398;
  --sage-dark: #577166;
  --peach: #ead2bd;
  --blue: #dbe8ea;
  --good: #5e8c73;
  --try: #a6735b;
  --shadow: 0 18px 50px rgba(68, 80, 72, 0.13);
  --radius: 30px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-rounded, "Nunito", "Arial Rounded MT Bold", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 12%, rgba(219, 232, 234, 0.75), transparent 32%),
    radial-gradient(circle at 85% 85%, rgba(234, 210, 189, 0.6), transparent 30%),
    var(--bg);
  display: grid;
  place-items: center;
  padding: 22px;
}

.app {
  width: min(760px, 100%);
}

.card {
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(87, 113, 102, 0.14);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 46px);
  text-align: center;
}

.hidden { display: none !important; }

.leaf {
  width: 92px;
  height: 92px;
  border-radius: 36% 64% 40% 60%;
  background: linear-gradient(145deg, var(--blue), #eff6f3);
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  color: var(--sage-dark);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.08em;
}

.leaf.success {
  letter-spacing: 0;
  color: #fff;
  background: linear-gradient(145deg, #8fb29f, #638b76);
}

h1, h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

h1 { font-size: clamp(2.1rem, 8vw, 4rem); }
h2 { font-size: clamp(1.8rem, 5vw, 3rem); }

.subtitle {
  max-width: 520px;
  margin: 18px auto 28px;
  color: var(--muted);
  font-size: clamp(1rem, 3vw, 1.22rem);
  line-height: 1.55;
}

.settings {
  display: grid;
  gap: 12px;
  max-width: 420px;
  margin: 0 auto 26px;
}

.toggle-row {
  min-height: 58px;
  border-radius: 18px;
  background: #f7f4ec;
  border: 1px solid rgba(87, 113, 102, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  color: #4d5c55;
  font-weight: 700;
}

select, input[type="checkbox"] {
  accent-color: var(--sage-dark);
}

select {
  border: 1px solid rgba(87, 113, 102, 0.18);
  background: #fffdf8;
  color: var(--ink);
  border-radius: 14px;
  padding: 10px 12px;
  font: inherit;
}

input[type="checkbox"] {
  width: 24px;
  height: 24px;
}

button {
  font: inherit;
  border: 0;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 4px solid rgba(138, 163, 152, 0.35);
  outline-offset: 3px;
}

button:active { transform: scale(0.98); }

.primary-btn, .secondary-btn, .speak-btn, .quiet-btn {
  min-height: 56px;
  border-radius: 999px;
  padding: 0 26px;
  font-weight: 800;
}

.primary-btn {
  background: var(--sage-dark);
  color: #fff;
  box-shadow: 0 10px 24px rgba(87, 113, 102, 0.24);
}

.primary-btn:hover { background: #4d665c; }

.secondary-btn {
  background: #eaf1ed;
  color: var(--sage-dark);
}

.quiet-btn {
  background: transparent;
  color: var(--muted);
}

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

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 900;
}

.score-pill {
  flex: 0 0 auto;
  background: #f1eee5;
  color: var(--sage-dark);
  border-radius: 999px;
  padding: 12px 17px;
  font-weight: 900;
  font-size: 1.05rem;
}

.prompt-panel {
  background: linear-gradient(135deg, #f7f4ec, #eef6f3);
  border: 1px solid rgba(87, 113, 102, 0.12);
  border-radius: 26px;
  padding: 22px;
  margin-bottom: 22px;
}

.speak-btn {
  background: #fffdf8;
  color: var(--sage-dark);
  box-shadow: inset 0 0 0 1px rgba(87, 113, 102, 0.12);
}

.sound-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.status {
  min-height: 28px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.4;
}

.status.correct { color: var(--good); font-weight: 800; }
.status.incorrect { color: var(--try); font-weight: 800; }

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 16px;
}

.option-btn {
  min-height: clamp(94px, 18vw, 128px);
  border-radius: 24px;
  background: #fbf8f0;
  color: var(--ink);
  border: 2px solid transparent;
  font-size: clamp(2.3rem, 10vw, 4.2rem);
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(87, 113, 102, 0.1);
}

.option-btn:hover:not(:disabled) {
  background: #f7f1e5;
  border-color: rgba(87, 113, 102, 0.18);
}

.option-btn:disabled { cursor: default; opacity: 0.88; }
.option-btn.correct { background: #e7f1ea; border-color: #7da38e; color: #3f6c55; }
.option-btn.incorrect { background: #f5e7dd; border-color: #cfaa91; color: #8b604e; }

.game-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

@media (max-width: 540px) {
  body { padding: 14px; }
  .card { border-radius: 24px; }
  .topbar { align-items: center; }
  .options { gap: 12px; }
  .toggle-row { align-items: flex-start; flex-direction: column; }
  select { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
