:root {
  --bg: #f6f0e8;
  --ink: #1f1a17;
  --muted: #5b534c;
  --accent: #0f766e;
  --accent-soft: #c4ede7;
  --accent-2: #d08a39;
  --card: #ffffff;
  --border: #e4d7c7;
  --shadow: 0 22px 60px rgba(24, 20, 16, 0.12);
  --radius: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 20% 20%, #fdf8f1 0, #f6f0e8 30%, #f0e5d8 100%);
  color: var(--ink);
  line-height: 1.6;
}

.page {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: center;
}

.hero__text h1 {
  font-family: 'Playfair Display', 'Manrope', serif;
  font-size: clamp(34px, 5vw, 46px);
  margin: 6px 0 8px;
  letter-spacing: -0.03em;
}

.hero__text .lede {
  max-width: 56ch;
  color: var(--muted);
  margin-bottom: 14px;
}

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

.hero__actions {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.length-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fdf9f3;
}

.length-picker span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 700;
}

.pill-group {
  display: flex;
  gap: 6px;
}

.pill {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}

.pill.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.15);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.stat-card strong {
  display: block;
  font-size: 26px;
  margin-top: 6px;
  font-weight: 700;
}

.quiz {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 28px;
  margin-top: 28px;
  align-items: start;
}

.canvas {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.image-wrap {
  position: relative;
  background: linear-gradient(120deg, #f9f4eb, #f2e8dd);
  padding: 18px;
}

.image-wrap img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border-radius: 14px;
  display: block;
  background: #fdfaf4;
}

.badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 30px rgba(15, 118, 110, 0.18);
}

.caption {
  padding: 14px 18px 18px;
  color: var(--muted);
  font-size: 15px;
  background: linear-gradient(90deg, rgba(208, 138, 57, 0.1), transparent);
  border-top: 1px solid var(--border);
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  padding: 18px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel__main,
.panel__secondary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prompt {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  font-family: 'Playfair Display', 'Manrope', serif;
}

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

.option {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fdf9f3;
  padding: 14px 12px;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.option:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(24, 20, 16, 0.12);
}

.option.correct {
  border-color: var(--accent);
  background: #e6f5f2;
  color: #0d6159;
}

.option.wrong {
  border-color: #f47264;
  background: #fff3f1;
  color: #b02314;
}

.option:disabled {
  opacity: 0.8;
  cursor: not-allowed;
  transform: none;
}

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

.actions-primary {
  margin-top: 4px;
}

.actions-secondary {
  margin-top: 6px;
}

.hint {
  margin-top: 8px;
  padding: 12px 12px 10px;
  border-radius: 12px;
  background: #f5ede3;
  color: var(--muted);
  border: 1px dashed #d9c9b6;
  display: none;
}

.hint.is-visible {
  display: block;
}

.hint__title {
  margin: 0 0 4px;
  font-weight: 700;
  color: var(--ink);
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
  font-size: 15px;
  transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn-primary {
  background: linear-gradient(120deg, #0f766e, #0a5b54);
  color: #fefcf9;
  box-shadow: 0 12px 30px rgba(15, 118, 110, 0.25);
}

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

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.footer {
  margin-top: 28px;
  padding: 16px 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer__counts {
  font-weight: 700;
}

.footer__controls {
  display: none;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

code {
  background: #f3e7d8;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 90%;
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .quiz {
    grid-template-columns: 1fr;
  }
  .options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .image-wrap img {
    max-height: 420px;
  }
  .page {
    width: min(100%, calc(100% - 20px));
  }
}

@media (max-width: 720px) {
  .page {
    padding: 16px 0 28px;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .hero {
    display: contents;
  }
  .hero__text {
    order: 1;
  }
  .stat-grid {
    order: 3;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .stat-card {
    padding: 10px 12px;
  }
  .stat-card span {
    font-size: 11px;
  }
  .stat-card strong {
    font-size: 18px;
    margin-top: 4px;
  }
  .hero__text h1 {
    font-size: 28px;
    margin: 4px 0 6px;
  }
  .eyebrow {
    display: none;
  }
  .hero__text .lede {
    display: none;
  }
  .hero__actions {
    display: none;
  }
  .footer__controls {
    display: flex;
    width: 100%;
  }
  .quiz {
    order: 2;
    margin-top: 6px;
  }
  .footer {
    order: 4;
    margin-top: 4px;
  }
  .stat-card:nth-child(2),
  .stat-card:nth-child(3),
  .stat-card:nth-child(6) {
    display: none;
  }
  .image-wrap {
    padding: 8px;
  }
  .image-wrap img {
    max-height: 30vh;
  }
  .caption {
    padding: 10px 14px 14px;
    font-size: 13px;
  }
  .panel {
    padding: 12px;
    gap: 10px;
  }
  .panel__secondary {
    margin-top: 8px;
  }
  .prompt {
    font-size: 16px;
    margin: 0;
  }
  .options {
    gap: 8px;
  }
  .option {
    padding: 9px 10px;
    font-size: 13px;
    line-height: 1.2;
  }
  .btn {
    padding: 9px 12px;
    font-size: 13px;
  }
}
