:root {
  --bg: #fff8ef;
  --bg-soft: #fffdf8;
  --panel: #fffdf9;
  --line: #f0dcc5;
  --text: #3f2f2a;
  --muted: #7d675f;
  --accent: #ffb347;
  --accent-strong: #f48c3a;
  --mint: #dff6e7;
  --mint-strong: #3f9b66;
  --rose: #ffe4de;
  --rose-strong: #d35f49;
  --sky: #deefff;
  --shadow: 0 1.25rem 3rem rgba(167, 117, 74, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 196, 120, 0.28), transparent 28%),
    radial-gradient(circle at bottom right, rgba(144, 208, 255, 0.22), transparent 26%),
    linear-gradient(180deg, #fffaf3 0%, #fff5e8 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

.page-shell {
  width: min(100%, 72rem);
  margin: 0 auto;
  padding: 1rem;
}

.hero-card,
.app-card {
  background: rgba(255, 253, 249, 0.92);
  border: 1px solid var(--line);
  border-radius: 2rem;
  box-shadow: var(--shadow);
}

.app-card {
  padding: 1.25rem;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffbe5c 0%, #f79343 100%);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(247, 147, 67, 0.25);
}

.logo-emoji {
  font-size: 1.25rem;
}

.logo-text {
  font-family: "Baloo 2", "Trebuchet MS", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #4a2e19;
  letter-spacing: 0.02em;
}

.eyebrow,
.section-label,
.question-number {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.app-card h2,
.questions-head h3 {
  margin: 0.45rem 0 0;
  font-family: "Baloo 2", "Trebuchet MS", sans-serif;
  line-height: 1;
  color: #45342e;
}

.app-card h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.questions-head h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.exercise-level,
.footer-note {
  color: var(--muted);
  line-height: 1.65;
}

.top-row,
.questions-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.question-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.status-pill {
  min-height: 2.75rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--sky);
  border: 1px solid #c8e3ff;
  color: #255d88;
  font-weight: 800;
}

.controls-grid {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.control-card,
.audio-card,
.story-panel,
.question-card,
.summary-card {
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: var(--bg-soft);
}

.control-card,
.audio-card,
.summary-card {
  padding: 1rem;
}

.control-title,
.text-label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
}

select,
textarea,
.question-input {
  width: 100%;
  margin-top: 0.65rem;
  border: 1px solid #ead8c3;
  border-radius: 1rem;
  background: #fff;
  color: var(--text);
}

select,
.question-input {
  min-height: 3rem;
  padding: 0.8rem 1rem;
}

textarea {
  min-height: 13rem;
  padding: 1rem;
  line-height: 1.7;
  resize: vertical;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

button {
  min-height: 3rem;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 160ms ease,
    opacity 160ms ease,
    background-color 160ms ease;
}

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

button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.primary-button {
  background: linear-gradient(135deg, #ffbe5c 0%, #f79343 100%);
  color: #4a2e19;
  font-weight: 800;
}

.ghost-button {
  background: #fff;
  border-color: #ead8c3;
  color: var(--text);
}

.small-button {
  min-height: 2.75rem;
}

.audio-card {
  margin-top: 1.2rem;
}

.audio-card audio {
  width: 100%;
  margin-top: 0.75rem;
}

.story-panel {
  margin-top: 1.2rem;
  overflow: hidden;
}

.story-panel summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 1.1rem;
  font-weight: 800;
  color: #5b4338;
}

.story-panel summary::-webkit-details-marker {
  display: none;
}

.story-panel[open] summary {
  border-bottom: 1px solid var(--line);
}

.story-panel .text-label,
.story-panel textarea {
  margin-left: 1rem;
  margin-right: 1rem;
}

.story-panel textarea {
  margin-bottom: 1rem;
}

.questions-panel {
  margin-top: 1.25rem;
}

.summary-card {
  margin-top: 1rem;
}

.summary-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.4rem;
}

.questions-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.question-card {
  padding: 1rem;
}

.question-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.question-prompt {
  display: block;
  margin-top: 0.55rem;
  line-height: 1.55;
}

.choice-list {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.choice-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid #ead8c3;
  border-radius: 1rem;
  background: #fff;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.choice-option:hover {
  transform: translateY(-1px);
  border-color: #dbb890;
}

.choice-option input {
  margin: 0;
  accent-color: var(--accent-strong);
}

.choice-option.selected {
  border-color: #d7b387;
  background: #fff8ee;
}

.choice-option.correct {
  border-color: #a6dabb;
  background: var(--mint);
}

.choice-option.wrong {
  border-color: #efb3a5;
  background: var(--rose);
}

.result-badge {
  min-width: 5.5rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 800;
}

.result-badge.neutral {
  background: #f6eee5;
  color: #80665a;
}

.result-badge.correct {
  background: var(--mint);
  color: var(--mint-strong);
}

.result-badge.wrong {
  background: var(--rose);
  color: var(--rose-strong);
}

.result-inline {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.8rem;
  padding: 0.8rem 0.9rem;
  border-radius: 1rem;
  font-size: 0.95rem;
}

.result-inline.correct {
  background: var(--mint);
  color: #295b42;
}

.result-inline.wrong {
  background: var(--rose);
  color: #7d3f33;
}

.footer-note {
  margin-top: 1rem;
  font-size: 0.95rem;
}

@media (min-width: 48rem) {
  .page-shell {
    padding: 2rem;
  }

  .app-card {
    padding: 2rem;
  }

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