/* Evergreen Facts — bright, friendly, mobile-first. No third-party fonts or trackers. */
:root {
  --ink: #1c2b24;
  --ink-soft: #3b5348;
  --paper: #fff6e8;
  --paper-2: #f3ead3;
  --cedar: #1f5c45;
  --cedar-deep: #143d2e;
  --moss: #3f8f6b;
  --gold: #f4c15d;
  --gold-deep: #e0a12b;
  --berry: #e85d4c;
  --sky: #7ec8c0;
  --sky-deep: #2f8f86;
  --shade: #e85d4c;
  --unshade: #fffaf1;
  --card: #ffffff;
  --line: rgba(28, 43, 36, 0.12);
  --shadow: 0 10px 24px rgba(20, 61, 46, 0.08);
  --radius: 22px;
  --font: "Avenir Next", "Segoe UI", "Trebuchet MS", "Nunito", system-ui, sans-serif;
  --display: "Trebuchet MS", "Avenir Next Condensed", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #ffe7a8 0%, transparent 50%),
    radial-gradient(900px 400px at 110% 0%, #c8efe8 0%, transparent 46%),
    var(--paper);
  min-height: 100vh;
  line-height: 1.5;
  font-size: 1.05rem;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--cedar-deep); }
button, input, select { font: inherit; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus { left: 12px; background: #fff; padding: 8px 12px; z-index: 10; }

.site-header, .site-footer, .wrap { width: min(1080px, calc(100% - 32px)); margin-left: auto; margin-right: auto; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--cedar);
  color: var(--gold);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.3rem;
  box-shadow: 0 6px 0 var(--cedar-deep);
}
.brand-name { font-family: var(--display); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; }
.brand-sub { display: block; font-size: 0.78rem; color: var(--ink-soft); font-weight: 600; }

.header-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.stat, .sound-btn, .text-btn, .choice, .pad button, .grade-btn, .diff-btn, .primary, .secondary, .suggest-item, .game-card, .nav a {
  border: 0;
  cursor: pointer;
}
.stat {
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.sound-btn, .secondary, .text-btn {
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.sound-btn[aria-pressed="true"] { background: var(--gold); }

.primary, .go, .start-btn {
  background: var(--cedar);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 800;
  box-shadow: 0 6px 0 var(--cedar-deep);
  display: inline-block;
  text-decoration: none;
}
.primary:active, .game-card:active { transform: translateY(2px); box-shadow: 0 4px 0 var(--cedar-deep); }
.secondary { text-decoration: none; display: inline-block; }

.hero { padding: 18px 0 10px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--sky-deep);
  margin: 0 0 8px;
}
h1, h2, h3, .brand-name { font-family: var(--display); letter-spacing: -0.03em; }
h1 { font-size: clamp(2rem, 6vw, 3.3rem); line-height: 1.05; margin: 0 0 12px; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 10px; }
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 40rem; }

.picker-card, .panel, .page-card, .alt-card, .feature-card, .game-card, .info-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.picker-card, .panel, .page-card { padding: 22px; margin: 16px 0 28px; }

label, .field-label { font-weight: 800; display: block; margin-bottom: 6px; }
.district-picker { position: relative; margin-bottom: 18px; }
#district-search {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 2px solid var(--cedar);
  background: #fff;
}
.suggest-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 6px;
  position: absolute;
  left: 0; right: 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  z-index: 5;
  max-height: 320px;
  overflow: auto;
}
.suggest-item {
  width: 100%;
  text-align: left;
  background: transparent;
  padding: 10px 12px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.suggest-item:hover, .suggest-item:focus { background: var(--paper-2); }
.badge { font-size: 0.72rem; background: var(--sky); color: var(--cedar-deep); font-weight: 800; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.badge-featured { background: var(--gold); }

.btn-row, .grade-row, .diff-row, .choice-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.grade-btn, .diff-btn, .choice {
  background: var(--paper-2);
  color: var(--ink);
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 800;
  min-height: 44px;
}
.grade-btn[aria-pressed="true"], .diff-btn[aria-pressed="true"] {
  background: var(--cedar);
  color: #fff;
  box-shadow: 0 4px 0 var(--cedar-deep);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 16px 0 28px;
}
.game-card {
  padding: 18px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 170px;
  background: linear-gradient(#fff, #fff) padding-box,
    linear-gradient(160deg, var(--gold), var(--sky)) border-box;
  border: 2px solid transparent;
}
.game-card h3 { margin: 0; }
.game-card p { margin: 0; color: var(--ink-soft); flex: 1; }
.game-card .go { align-self: flex-start; background: var(--cedar); color: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 800; }

.unit-heading { margin-top: 8px; }
.unit-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.unit-list a {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--paper);
  text-decoration: none;
  color: inherit;
}
.unit-list a:hover { background: var(--paper-2); }
.unit-list .unit-current a, .unit-list li.unit-current a {
  background: #e7f6ef;
  outline: 3px solid var(--moss);
}
.unit-list .std { display: block; font-size: 0.8rem; color: var(--ink-soft); font-weight: 600; }
.disclaimer-inline, .fine, .legal { color: var(--ink-soft); font-size: 0.92rem; }

.feature-grid, .info-grid, .alt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin: 12px 0 28px;
}
.feature-card, .info-card, .alt-card { padding: 18px; }
.feature-card.featured { background: linear-gradient(180deg, #fff7d6, #fff); border-color: var(--gold-deep); }
.coming-soon { display: inline-block; background: var(--paper-2); font-weight: 800; font-size: 0.78rem; padding: 2px 8px; border-radius: 999px; }

.site-footer { padding: 28px 0 48px; color: var(--ink-soft); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-bottom: 10px; }
.site-footer a { color: var(--cedar-deep); font-weight: 700; }

/* Play */
.play-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 8px; }
.play-main, .intro-card, .break-card { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin: 12px 0 28px; }
.big-eq { font-size: clamp(2.4rem, 8vw, 4rem); font-weight: 800; text-align: center; margin: 8px 0 18px; font-family: var(--display); }
#prompt { font-size: 1.25rem; font-weight: 800; text-align: center; margin: 0 0 12px; }
#progress-label { font-weight: 800; color: var(--sky-deep); }
#stage { display: flex; justify-content: center; margin: 10px 0 16px; }
.compare { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; width: 100%; }
.model { margin: 0; text-align: center; }
.model svg { width: min(220px, 42vw); height: auto; margin: 0 auto; --shade: #e85d4c; --unshade: #fffaf1; }
.model figcaption { font-weight: 800; margin-top: 6px; }
.vs { font-size: 2rem; font-weight: 800; color: var(--cedar); }
#choices { display: grid; gap: 10px; }
.choice { width: 100%; background: var(--paper); border: 2px solid var(--line); text-align: left; }
.choice:hover { border-color: var(--cedar); }
.feedback { margin: 14px 0 0; padding: 10px 14px; border-radius: 14px; font-weight: 800; text-align: center; }
.feedback.ok { background: #d9f5e5; color: var(--cedar-deep); }
.feedback.no { background: #ffe1db; color: #8a2b1f; }
.star-award { font-size: 1.3rem; font-weight: 800; color: var(--gold-deep); }

.pad-wrap { margin-top: 8px; }
#answer-input {
  width: 100%;
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  padding: 10px;
  border-radius: 16px;
  border: 2px solid var(--cedar);
  margin-bottom: 10px;
}
.pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pad button {
  min-height: 56px;
  border-radius: 16px;
  background: var(--paper-2);
  font-size: 1.4rem;
  font-weight: 800;
}
.pad button[data-key="ok"] { background: var(--cedar); color: #fff; }
.pad button[data-key="del"] { background: var(--gold); }
.ad-slot-box {
  margin: 16px 0;
  min-height: 90px;
  border: 2px dashed var(--line);
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.break-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

.page-card h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.page-card h2 { margin-top: 1.4em; }
.sources { padding-left: 1.2em; }
.sources li { margin: 0.4em 0; }

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .site-header { align-items: flex-start; }
  .model svg { width: min(160px, 70vw); }
  .pad button { min-height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .primary:active, .game-card:active { transform: none; }
}

/* Fun forest upgrades: mascot, pop targets, river, combos, confetti */
.guide {
  display: flex;
  gap: 16px;
  align-items: center;
  margin: 12px 0 18px;
}
.guide-mascot { width: 96px; flex: 0 0 96px; }
.mascot-svg { width: 96px; height: 112px; }
.speech {
  background: var(--card);
  border: 2px solid var(--cedar);
  border-radius: 18px 18px 18px 6px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  flex: 1;
}
.speech-name { margin: 0 0 4px; font-weight: 800; color: var(--cedar); font-size: 0.85rem; }
.speech p { margin: 0; }

.bounce-soft { animation: bounce-soft 2.4s ease-in-out infinite; }
@keyframes bounce-soft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.pop-in { animation: pop-in 0.45s ease-out both; }
@keyframes pop-in {
  0% { transform: scale(0.6) translateY(12px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.grow-in { animation: grow-in 0.4s ease-out both; }
@keyframes grow-in {
  0% { transform: scaleY(0.2); transform-origin: bottom; opacity: 0; }
  100% { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
}

.forest-hud { margin: 0 0 10px; }
.grove { display: flex; align-items: flex-end; gap: 6px; height: 46px; }
.grove-tree {
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 28px solid var(--cedar);
  position: relative;
  display: inline-block;
}
.grove-tree:nth-child(odd) { border-bottom-color: var(--cedar-deep); height: 0; border-bottom-width: 34px; }
.grove-tree:nth-child(3n) { border-bottom-color: var(--moss); border-bottom-width: 24px; }
.forest-meta { margin: 4px 0 0; font-weight: 700; color: var(--sky-deep); font-size: 0.92rem; }

.combo-flag {
  display: inline-block;
  background: var(--gold);
  color: var(--cedar-deep);
  font-weight: 800;
  border-radius: 999px;
  padding: 4px 12px;
  margin: 0 0 8px;
  animation: pop-in 0.3s ease-out;
}

.big-choices, .berry-row, .cone-row, .acorn-field {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}
.big-choice, .choice.big-choice {
  min-width: 88px;
  min-height: 64px;
  font-size: 1.35rem;
  font-weight: 800;
  border-radius: 18px;
  text-align: center;
  padding: 14px 18px;
  background: var(--paper);
  border: 3px solid var(--cedar);
}
.berry-row .big-choice { background: #ffe1db; border-color: var(--berry); }
.cone-row .big-choice { background: #fff3d1; border-color: var(--gold-deep); }

.acorn-btn {
  width: 92px;
  min-height: 108px;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
}
.acorn-cap {
  width: 72px; height: 24px;
  background: #8a5a22;
  border-radius: 18px 18px 8px 8px;
  box-shadow: 0 -2px 0 #6b4a2b inset;
}
.acorn-val {
  width: 64px;
  min-height: 64px;
  margin-top: -6px;
  background: #c9842a;
  border-radius: 0 0 32px 32px;
  color: #fff;
  font-weight: 800;
  font-size: 1.35rem;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 0 #8a5a22;
}
.acorn-btn:active .acorn-val { transform: translateY(2px); box-shadow: 0 3px 0 #8a5a22; }
.acorn-btn:disabled { opacity: 0.55; }

.count-scene {
  position: relative;
  width: min(100%, 520px);
  height: 200px;
  margin: 0 auto 8px;
  background: linear-gradient(#e7f6ef, #fff6e8);
  border-radius: 18px;
  border: 2px solid var(--line);
}
.count-item { position: absolute; width: 36px; height: 40px; }
.count-icon { width: 36px; height: 40px; }
.compare-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.count-group p { margin: 0 0 6px; font-weight: 800; text-align: center; }
.count-group .count-scene { width: 100%; height: 180px; }

.bond-board { text-align: center; margin: 8px auto 12px; }
.bond-circle {
  width: 84px; height: 84px;
  margin: 0 auto;
  border-radius: 50%;
  border: 4px solid var(--cedar);
  background: #fff;
  display: grid; place-items: center;
  font-size: 1.8rem; font-weight: 800;
}
.bond-empty { background: var(--gold); animation: pulse-gold 1.2s ease-in-out infinite; }
@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244, 193, 93, 0.6); }
  50% { box-shadow: 0 0 0 8px rgba(244, 193, 93, 0); }
}
.bond-parts { display: flex; justify-content: center; gap: 28px; margin-top: 10px; }
.bond-eq { font-weight: 800; font-size: 1.2rem; margin: 12px 0 0; }

.river {
  position: relative;
  height: 22px;
  background: #cfeff0;
  border-radius: 999px;
  overflow: hidden;
  margin: 0 0 14px;
  border: 2px solid var(--sky-deep);
}
.river-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sky), var(--sky-deep));
  width: 100%;
  transition: width 0.4s linear;
}
.salmon { position: absolute; top: -10px; font-size: 1.4rem; transition: left 0.4s linear; }

.confetti-layer {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 8;
}
.play-main, .break-card, .intro-card { position: relative; }
.confetti-bit {
  position: absolute;
  top: -8px;
  width: 8px; height: 14px;
  border-radius: 2px;
  animation: confetti-fall 1.2s ease-in forwards;
}
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(320px) rotate(280deg); opacity: 0; }
}

.unlock-list { padding-left: 1.2em; }
.collection-grid, .printable-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 16px 0 28px;
}
.critter-card, .printable-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 16px;
}
.critter-card.locked { opacity: 0.55; filter: grayscale(0.4); }
.critter-card .mascot-svg { margin: 0 auto 8px; }
.printable-card img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
}
.badge-chip {
  display: inline-block;
  background: var(--gold);
  color: var(--cedar-deep);
  font-weight: 800;
  font-size: 0.8rem;
  border-radius: 999px;
  padding: 3px 10px;
  margin: 2px 4px 2px 0;
}

.pad button { min-height: 64px; font-size: 1.5rem; }

@media (prefers-reduced-motion: reduce) {
  .bounce-soft, .pop-in, .grow-in, .bond-empty, .confetti-bit { animation: none; }
}
@media (max-width: 640px) {
  .guide { flex-direction: column; align-items: flex-start; }
  .count-scene { height: 170px; }
  .big-choice, .choice.big-choice { min-width: 72px; min-height: 56px; }
}

/* Keep the hidden attribute ahead of buttons that set display. */
[hidden] { display: none !important; }

.friends-row { display: flex; flex-wrap: wrap; gap: 16px 24px; justify-content: flex-start; margin: 12px 0 8px; padding: 0; }
.friend-card { margin: 0; width: 110px; text-align: center; }
.friend-card .mascot-svg { width: 96px; height: 112px; display: block; margin: 0 auto; }
.friend-card figcaption { margin-top: 4px; }
.friend-card strong { display: block; font-size: 0.95rem; }
.friend-card span { display: block; font-size: 0.8rem; font-weight: 500; color: var(--ink-soft, #3b4a44); }

.game-card .grade-range, .grade-range {
  display: inline-block;
  margin: 4px 0 0;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--cream, #fff6e8);
  border: 2px solid var(--cedar, #1f5c45);
  color: var(--cedar-deep, #143d2e);
  font-weight: 800;
  font-size: 0.8rem;
}
a.grade-btn { text-decoration: none; color: inherit; display: inline-flex; align-items: center; justify-content: center; }

/* Little Forest (K-1) highlight card */
.game-card-kids { background: linear-gradient(135deg, #fff6dc, #e8fff0); border: 3px solid #f4c15d; }
.game-card-kids h3::before { content: "🦝 "; }
