:root {
  color-scheme: light;
  --ink: #21312b;
  --muted: #596b62;
  --panel: #fffdf6;
  --line: #c9d7cf;
  --leaf: #2d8a57;
  --leaf-dark: #17613a;
  --leaf-bright: #66c36f;
  --berry: #c7434f;
  --berry-bright: #f05f78;
  --sun: #f4bd3f;
  --orange: #f18b32;
  --grape: #6f4bb8;
  --sky: #d9edf6;
  --wrong: #b73535;
  --right-bg: #e3f5e9;
  --wrong-bg: #fde8e2;
  --counter-dark: #17231f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(217, 237, 246, 0.92), rgba(255, 253, 246, 0.94) 44%, rgba(244, 189, 63, 0.2)),
    repeating-linear-gradient(135deg, rgba(240, 95, 120, 0.12) 0 3px, transparent 3px 28px),
    repeating-linear-gradient(45deg, rgba(102, 195, 111, 0.14) 0 2px, transparent 2px 34px),
    linear-gradient(120deg, rgba(111, 75, 184, 0.18), rgba(241, 139, 50, 0.18));
}

button {
  font: inherit;
}

.is-hidden {
  display: none !important;
}

.activity-shell {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

.activity-panel {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  min-height: min(720px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 18px;
  padding: clamp(18px, 4vw, 34px);
  border: 3px solid rgba(45, 138, 87, 0.18);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.96);
  box-shadow: 0 24px 60px rgba(33, 49, 43, 0.18), 0 0 0 8px rgba(255, 255, 255, 0.42);
}

.splash-screen {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  min-height: min(720px, calc(100vh - 48px));
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(380px, 1.28fr);
  align-items: center;
  gap: clamp(22px, 4vw, 44px);
  padding: clamp(20px, 4vw, 40px);
  border: 2px solid rgba(33, 49, 43, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 253, 246, 0.98), rgba(255, 245, 222, 0.96)),
    rgba(255, 253, 246, 0.96);
  box-shadow: 0 24px 60px rgba(33, 49, 43, 0.18), 0 0 0 8px rgba(255, 255, 255, 0.42);
}

.splash-copy {
  display: grid;
  gap: 18px;
}

.splash-copy h1 {
  max-width: 520px;
  color: var(--leaf-dark);
  font-size: clamp(2.5rem, 6vw, 5.2rem);
}

.splash-text {
  max-width: 520px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 700;
  line-height: 1.42;
}

.splash-image {
  display: block;
  width: 100%;
  max-height: 640px;
  object-fit: contain;
}

.start-button {
  width: fit-content;
  min-width: 180px;
}

.top-bar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow,
.question-count {
  margin: 0 0 8px;
  color: var(--leaf-dark);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

h1 {
  max-width: 660px;
  font-size: clamp(1.45rem, 3.6vw, 2.65rem);
}

h2 {
  font-size: clamp(2rem, 7vw, 4.9rem);
}

.score-board {
  min-width: 340px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.score-counter {
  min-height: 118px;
  display: grid;
  align-content: center;
  padding: 14px 18px;
  border: 3px solid var(--line);
  border-radius: 8px;
  color: #ffffff;
  background: var(--counter-dark);
  text-align: center;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 8px 18px rgba(33, 49, 43, 0.14);
}

.correct-counter {
  border-color: rgba(102, 195, 111, 0.78);
}

.wrong-counter {
  border-color: rgba(240, 95, 120, 0.78);
}

.score-counter span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.score-counter strong {
  display: block;
  margin-top: 4px;
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 4rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.correct-counter strong {
  color: #7dffa7;
}

.wrong-counter strong {
  color: #ff9a91;
}

.progress-wrap {
  height: 12px;
  overflow: hidden;
  border: 2px solid rgba(33, 49, 43, 0.12);
  border-radius: 999px;
  background: #ffffff;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--leaf), var(--sun), var(--orange), var(--berry-bright), var(--grape));
  transition: width 260ms ease;
}

.fruit-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(7px, 1.2vw, 12px);
  min-height: 64px;
  padding: 4px 8px;
  overflow: hidden;
}

.fruit-strip img {
  width: clamp(34px, 5vw, 54px);
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(33, 49, 43, 0.16);
  object-fit: cover;
}

.fruit-strip img:nth-child(2n) {
  transform: rotate(-5deg);
}

.fruit-strip img:nth-child(2n + 1) {
  transform: rotate(6deg);
}

.question-area {
  display: grid;
  align-content: center;
  gap: 22px;
}

.question-area.results-mode {
  align-content: start;
  gap: 16px;
}

.choices {
  display: grid;
  gap: 14px;
}

.choice-button {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 96px;
  padding: 16px;
  border: 2px solid rgba(45, 138, 87, 0.28);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.choice-button:hover:not(:disabled),
.choice-button:focus-visible {
  border-color: var(--leaf);
  box-shadow: 0 8px 18px rgba(45, 138, 87, 0.16);
  transform: translateY(-1px);
  outline: none;
}

.choice-button:disabled {
  cursor: default;
}

.choice-button.correct {
  border-color: var(--leaf);
  background: var(--right-bg);
}

.choice-button.incorrect {
  border-color: var(--wrong);
  background: var(--wrong-bg);
}

.choice-label {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, var(--leaf-dark), var(--leaf-bright));
  font-weight: 900;
}

.choice-text {
  font-size: clamp(1rem, 2.1vw, 1.35rem);
  line-height: 1.35;
}

.feedback {
  min-height: 34px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 800;
}

.feedback.good {
  color: var(--leaf-dark);
}

.feedback.bad {
  color: var(--wrong);
}

.final-feedback {
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  line-height: 1.25;
}

.thank-you-graphic {
  display: block;
  width: min(100%, 720px);
  justify-self: center;
  border-radius: 8px;
  object-fit: contain;
}

.results-mode .thank-you-graphic {
  margin-top: 4px;
}

.controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.primary-button,
.secondary-button {
  min-height: 50px;
  padding: 0 22px;
  border-radius: 8px;
  border: 2px solid transparent;
  font-weight: 900;
  cursor: pointer;
}

.primary-button {
  color: #ffffff;
  background: linear-gradient(135deg, var(--leaf-dark), var(--leaf), var(--orange));
  box-shadow: 0 8px 18px rgba(45, 138, 87, 0.18);
}

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

.secondary-button {
  color: var(--ink);
  border-color: var(--line);
  background: #ffffff;
}

.primary-button:focus-visible,
.secondary-button:focus-visible {
  outline: 3px solid rgba(244, 189, 63, 0.72);
  outline-offset: 2px;
}

.fruit-layer {
  pointer-events: none;
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 3;
}

.falling-fruit {
  position: absolute;
  top: -72px;
  width: var(--size);
  height: var(--size);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(33, 49, 43, 0.2);
  object-fit: cover;
  animation: fruit-fall var(--duration) cubic-bezier(0.2, 0.72, 0.42, 1) forwards;
  transform: translateX(0) rotate(0deg);
}

@keyframes fruit-fall {
  0% {
    transform: translate3d(0, -80px, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--drift), calc(100vh + 120px), 0) rotate(var(--spin));
    opacity: 0.96;
  }
}

@media (max-width: 660px) {
  .activity-shell {
    padding: 12px;
  }

  .activity-panel {
    min-height: calc(100vh - 24px);
    gap: 16px;
  }

  .splash-screen {
    min-height: calc(100vh - 24px);
    grid-template-columns: 1fr;
    align-content: center;
    gap: 18px;
  }

  .splash-copy {
    gap: 14px;
  }

  .splash-image {
    max-height: 380px;
  }

  .start-button {
    width: 100%;
  }

  .top-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .score-board {
    width: 100%;
    min-width: 0;
  }

  .score-counter strong {
    font-size: 3.05rem;
  }

  .score-counter {
    min-height: 100px;
    padding: 12px;
  }

  .fruit-strip {
    justify-content: flex-start;
  }

  .choice-button {
    min-height: 118px;
    grid-template-columns: 38px 1fr;
    gap: 12px;
    padding: 14px;
  }

  .choice-label {
    width: 38px;
    height: 38px;
  }

  .thank-you-graphic {
    max-height: 220px;
  }

  .controls {
    flex-direction: column-reverse;
  }

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