:root {
  color-scheme: light;
  --ink: #17342b;
  --forest: #0b6e4f;
  --forest-dark: #084b39;
  --sun: #ffd84d;
  --coral: #ff7043;
  --sky: #dff5ff;
  --cream: #fffdf2;
  --white: #ffffff;
  --shadow: 0 18px 45px rgba(8, 54, 41, 0.24);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background: linear-gradient(180deg, #c8efff 0%, #efffd7 100%);
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
}

button { font: inherit; }
button:focus-visible { outline: 4px solid #1d78d6; outline-offset: 4px; }
[hidden] { display: none !important; }

.game-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }

.topbar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
  align-items: center;
  gap: clamp(1rem, 3vw, 3rem);
  padding: 0.85rem clamp(1rem, 4vw, 4rem);
  border-bottom: 4px solid rgba(8, 75, 57, 0.16);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 24px rgba(8, 75, 57, 0.12);
}

.brand { display: flex; align-items: center; gap: 0.8rem; }
.brand-flower { font-size: clamp(2.25rem, 5vw, 3.4rem); filter: drop-shadow(0 4px 2px rgba(0,0,0,.14)); }
.eyebrow { margin: 0 0 0.05rem; color: var(--forest); font-weight: 700; font-size: 0.92rem; letter-spacing: 0.06em; text-transform: uppercase; }
h1 { margin: 0; font-family: "Fredoka", system-ui, sans-serif; font-size: clamp(1.5rem, 3.2vw, 2.4rem); line-height: 1; color: var(--forest-dark); }

.health-card { min-width: 0; }
.health-label { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.35rem; font-weight: 700; font-size: 1.1rem; }
.health-label strong { color: var(--forest); font-family: "Fredoka", system-ui, sans-serif; font-size: 1.45rem; }
.meter { position: relative; height: 28px; overflow: visible; border: 3px solid var(--forest-dark); border-radius: 999px; background: #e6e5d8; box-shadow: inset 0 3px 6px rgba(0,0,0,.14); }
.meter-fill { width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7fcf4d, #ffd84d); transition: width 700ms cubic-bezier(.2,.8,.2,1); }
.meter-sun { position: absolute; top: 50%; left: 0%; transform: translate(-45%, -50%); font-size: 2.15rem; filter: drop-shadow(0 2px 2px rgba(0,0,0,.22)); transition: left 700ms cubic-bezier(.2,.8,.2,1); }

.garden {
  position: relative;
  min-height: 650px;
  isolation: isolate;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  overflow: hidden;
}

.garden-dull, .garden-colour, .garden-shade {
  position: absolute;
  inset: 0;
  z-index: -3;
}
.garden-dull, .garden-colour { background: url("assets/pollinator-garden.png") center center / cover no-repeat; }
.garden-dull { filter: grayscale(1) saturate(.45) brightness(.78); transform: scale(1.01); }
.garden-colour { clip-path: inset(0 100% 0 0); transition: clip-path 900ms cubic-bezier(.2,.75,.2,1); }
.garden-shade { z-index: -2; background: linear-gradient(180deg, rgba(8,48,37,.08), rgba(8,48,37,.25)); }

.start-panel, .challenge-panel, .success-panel {
  width: min(720px, 100%);
  padding: clamp(1.25rem, 4vw, 2.4rem);
  border: 4px solid rgba(11,110,79,.26);
  border-radius: 30px;
  background: rgba(255, 253, 242, 0.96);
  box-shadow: var(--shadow), inset 0 0 0 2px rgba(255,255,255,.85);
  backdrop-filter: blur(8px);
  text-align: center;
}

.start-panel { max-width: 610px; }
.mascot { display: inline-grid; place-items: center; width: 86px; height: 86px; margin-top: -4.5rem; border: 4px solid white; border-radius: 50%; background: var(--sun); box-shadow: 0 9px 22px rgba(79,63,0,.22); font-size: 3.3rem; animation: bob 2.1s ease-in-out infinite; }
.step-pill { display: inline-block; margin: 0.35rem 0 0.65rem; padding: 0.38rem 0.9rem; border-radius: 999px; color: var(--forest-dark); background: #dff3bd; font-weight: 700; font-size: 1rem; }
h2 { margin: 0; font-family: "Fredoka", system-ui, sans-serif; font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.04; color: var(--forest-dark); }
.start-panel > p:not(.step-pill) { margin: 0.9rem auto 1.3rem; font-size: clamp(1.1rem, 2.4vw, 1.4rem); }

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 60px;
  padding: 0.8rem 1.45rem;
  border: 0;
  border-bottom: 5px solid #064b37;
  border-radius: 18px;
  color: white;
  background: var(--forest);
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease;
}
.primary-button:hover { transform: translateY(-2px); filter: brightness(1.08); }
.primary-button:active { transform: translateY(3px); border-bottom-width: 2px; }

.challenge-panel { text-align: left; }
.challenge-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.challenge-panel h2 { margin-bottom: 1.2rem; font-size: clamp(1.75rem, 4vw, 2.7rem); }
.sound-button { width: 54px; height: 54px; flex: 0 0 auto; border: 3px solid #b5d987; border-radius: 16px; background: white; font-size: 1.45rem; cursor: pointer; }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.85rem; }
.choice-button {
  min-height: 128px;
  padding: 1rem 0.75rem;
  border: 3px solid #c7d9c7;
  border-bottom-width: 6px;
  border-radius: 20px;
  color: var(--ink);
  background: white;
  font-weight: 700;
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.18;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}
.choice-button:hover { transform: translateY(-3px); border-color: #64a83f; background: #f6ffe8; }
.choice-button .choice-icon { display: block; margin-bottom: 0.45rem; font-size: 2.2rem; }
.choice-button.good { border-color: #178653; background: #e7ffe1; animation: pop .45s ease; }
.choice-button.try-again { border-color: #f2b23c; background: #fff4cd; animation: shake .38s ease; }
.choice-button:disabled { cursor: default; opacity: .58; transform: none; }
.choice-button.good:disabled { opacity: 1; }

.feedback { display: flex; gap: 0.8rem; align-items: center; margin-top: 1rem; padding: 0.8rem 1rem; border-radius: 16px; background: #fff2c8; font-size: 1.05rem; }
.feedback.success { background: #dcf7d3; }
.feedback-icon { flex: 0 0 auto; font-size: 2rem; }
.feedback strong { display: block; font-size: 1.15rem; }
.feedback p { margin: 0.08rem 0 0; line-height: 1.3; }
.next-button { margin-top: 1rem; float: right; }

.wildlife { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .8s ease; }
.garden.complete .wildlife { opacity: 1; }
.flyer, .bird { position: absolute; font-size: clamp(2rem, 5vw, 4rem); filter: drop-shadow(0 4px 3px rgba(0,0,0,.2)); }
.bee-one { top: 18%; left: 8%; animation: fly-a 8s ease-in-out infinite; }
.bee-two { top: 58%; left: 76%; animation: fly-b 7s ease-in-out infinite .8s; }
.butterfly-one { top: 25%; left: 76%; animation: flutter 4s ease-in-out infinite; }
.butterfly-two { top: 67%; left: 20%; animation: flutter 5s ease-in-out infinite 1s; }
.bird { top: 10%; right: 8%; animation: bob 2.4s ease-in-out infinite; }

.success-panel { max-width: 700px; }
.success-panel h2 span { color: var(--coral); }
.celebration { margin: -1rem 0 0.5rem; font-size: clamp(2rem, 6vw, 4.2rem); animation: pop .7s ease; }
.recap { display: grid; gap: 0.55rem; margin: 1.2rem 0; text-align: left; }
.recap p { margin: 0; padding: 0.7rem 0.9rem; border-radius: 15px; background: white; box-shadow: 0 5px 15px rgba(8,75,57,.1); font-size: clamp(1rem, 2vw, 1.2rem); font-weight: 700; }
.recap span { display: inline-block; width: 2rem; }

@keyframes bob { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
@keyframes pop { 0% { transform: scale(.88); } 70% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 30% { transform: translateX(-7px); } 60% { transform: translateX(7px); } }
@keyframes fly-a { 0%,100% { transform: translate(0,0) rotate(-8deg); } 35% { transform: translate(240px, 70px) rotate(8deg); } 70% { transform: translate(480px, -20px) rotate(-5deg); } }
@keyframes fly-b { 0%,100% { transform: translate(0,0) scaleX(-1); } 50% { transform: translate(-360px, -130px) scaleX(-1); } }
@keyframes flutter { 0%,100% { transform: translate(0,0) rotate(-8deg); } 50% { transform: translate(70px,-70px) rotate(10deg); } }

@media (max-width: 720px) {
  .topbar { grid-template-columns: 1fr; gap: 0.7rem; padding: 0.7rem 1rem 0.85rem; }
  .brand-flower { font-size: 2.3rem; }
  .eyebrow { font-size: .78rem; }
  .health-label { font-size: 1rem; }
  .garden { min-height: calc(100vh - 150px); padding: 1rem; align-items: center; }
  .start-panel, .challenge-panel, .success-panel { border-radius: 24px; padding: 1.15rem; }
  .choices { grid-template-columns: 1fr; }
  .choice-button { min-height: 76px; display: grid; grid-template-columns: 3rem 1fr; align-items: center; text-align: left; }
  .choice-button .choice-icon { margin: 0; text-align: center; }
  .challenge-panel h2 { margin-bottom: .8rem; }
  .next-button { float: none; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
