:root {
  --ink: #142029;
  --muted: #5d6870;
  --paper: #fff9ed;
  --panel: #ffffff;
  --line: #d9e0d7;
  --green: #4a9b65;
  --green-dark: #277349;
  --yellow: #f5c84b;
  --blue: #66a9d9;
  --pink: #e5739d;
  --red: #d95545;
  --shadow: 0 18px 45px rgba(24, 45, 54, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    linear-gradient(180deg, rgba(102, 169, 217, 0.32), rgba(255, 249, 237, 0.92)),
    var(--paper);
}

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

a {
  color: var(--green-dark);
  font-weight: 800;
}

.app {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.hero {
  position: relative;
  display: grid;
  min-height: 330px;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: linear-gradient(180deg, #86d2f0 0%, #d8f3ce 72%, #7dbc63 100%);
  box-shadow: var(--shadow);
}

.hero-copy {
  z-index: 2;
  align-self: end;
  max-width: 680px;
  padding: 44px;
}

.eyebrow,
.label,
.tag,
.question-number {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 620px;
  margin-bottom: 14px;
  font-size: clamp(2.6rem, 8vw, 5.8rem);
  line-height: 0.92;
}

.hero-copy p:last-child {
  max-width: 560px;
  margin-bottom: 0;
  font-size: 1.08rem;
  font-weight: 700;
}

.hero-art {
  position: absolute;
  inset: 0;
}

.sun {
  position: absolute;
  top: 34px;
  right: 9%;
  width: 86px;
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
}

.hill {
  position: absolute;
  bottom: -62px;
  border: 3px solid var(--ink);
  border-radius: 50% 50% 0 0;
}

.hill-back {
  right: -90px;
  width: 480px;
  height: 210px;
  background: #80bd62;
}

.hill-front {
  left: -120px;
  width: 680px;
  height: 180px;
  background: #5aa65c;
}

.tree-house {
  position: absolute;
  right: 24%;
  bottom: 64px;
  width: 150px;
  height: 185px;
}

.trunk {
  position: absolute;
  bottom: 0;
  left: 63px;
  width: 25px;
  height: 118px;
  border: 3px solid var(--ink);
  background: #8b5a36;
}

.crown {
  position: absolute;
  top: 0;
  left: 8px;
  width: 134px;
  height: 122px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #3f8f4f;
}

.room {
  position: absolute;
  top: 48px;
  left: 40px;
  width: 72px;
  height: 52px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #f0c15b;
}

.quiz-shell {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.panel {
  border: 2px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px rgba(24, 45, 54, 0.08);
}

.progress-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px;
}

.progress-panel strong {
  display: block;
  margin-top: 6px;
  font-size: 1.65rem;
}

.progress-track {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #eff4e9;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--yellow));
  transition: width 180ms ease;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.question-panel {
  padding: 28px;
}

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

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f4edcf;
  color: #6a4d08;
}

#questionText {
  min-height: 96px;
  margin-bottom: 20px;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  line-height: 1.12;
}

#questionText:empty::before {
  content: "";
  display: block;
  min-height: 96px;
}

.answers {
  display: grid;
  gap: 12px;
}

.answer {
  min-height: 58px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  background: #fffdf8;
  color: var(--ink);
  text-align: left;
  transition:
    border-color 140ms ease,
    transform 140ms ease,
    background 140ms ease;
}

.answer:empty::before {
  content: "";
  display: block;
  min-height: 26px;
}

.answer:hover:not(:disabled) {
  border-color: var(--blue);
  transform: translateY(-1px);
}

.answer.correct {
  border-color: var(--green-dark);
  background: #dcf3df;
}

.answer.wrong {
  border-color: var(--red);
  background: #ffe1dc;
}

.feedback {
  min-height: 48px;
  margin: 16px 0 0;
  color: var(--muted);
  font-weight: 700;
}

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

.primary,
.ghost {
  min-height: 46px;
  padding: 0 18px;
}

.primary {
  background: var(--ink);
  color: white;
}

.ghost {
  border: 2px solid var(--line);
  background: white;
  color: var(--ink);
}

.result-panel {
  margin-top: 18px;
  padding: 26px;
  border-color: var(--green);
}

.result-panel h2 {
  margin: 8px 0 8px;
  font-size: 2rem;
}

.sources {
  max-width: 860px;
  margin-top: 24px;
  color: var(--muted);
}

.sources h2 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1.1rem;
}

@media (max-width: 780px) {
  .app {
    width: min(100% - 20px, 1120px);
    padding-top: 10px;
  }

  .hero {
    min-height: 420px;
  }

  .hero-copy {
    padding: 24px;
  }

  .tree-house {
    right: 10%;
  }

  .quiz-shell {
    grid-template-columns: 1fr;
  }

  .progress-panel {
    gap: 16px;
  }

  #questionText {
    min-height: auto;
  }
}
