:root {
  color-scheme: dark;
  --forest: #153d36;
  --forest-dark: #0b2827;
  --leaf: #3caa67;
  --leaf-light: #8bd47f;
  --mint: #bcead0;
  --cream: #fff8df;
  --paper: #fffdf2;
  --ink: #172329;
  --brown: #8b5a38;
  --gold: #ffd451;
  --coral: #f27f68;
  --lavender: #b7a6e6;
  --shadow: 0 18px 45px rgba(4, 24, 25, .25);
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--forest-dark);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--cream);
  background:
    radial-gradient(circle at 10% 0%, rgba(139, 212, 127, .2), transparent 26rem),
    radial-gradient(circle at 90% 5%, rgba(242, 127, 104, .16), transparent 24rem),
    linear-gradient(145deg, #173e38, #0a2426 70%, #142f3c);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 4px solid var(--gold);
  outline-offset: 4px;
}

a {
  color: inherit;
}

.garden-texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .2;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.32) 0 1px, transparent 1.8px),
    linear-gradient(90deg, transparent 49%, rgba(255,255,255,.05) 50%, transparent 51%);
  background-size: 24px 24px, 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.garden-shell {
  position: relative;
  width: min(1240px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}

.portal-bar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(255,255,255,.15);
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  color: var(--cream);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(.9rem, 2vw, 1.08rem);
  letter-spacing: .06em;
  text-decoration: none;
}

.portal-brand strong {
  color: var(--gold);
  font-weight: inherit;
}

.mini-ball {
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  display: block;
  border: 2px solid #101114;
  border-radius: 50%;
  background: #f58220;
  box-shadow: inset 7px -4px 0 rgba(255,255,255,.12);
  transform: rotate(-15deg);
}

.portal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.language-chip,
.help-button,
.sound-button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
}

.language-chip {
  color: var(--gold);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .12em;
}

.help-button {
  color: var(--cream);
  transition: background .2s ease, transform .2s ease;
}

.sound-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cream);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.sound-button:hover {
  background: rgba(255,255,255,.15);
  transform: translateY(-1px);
}

.help-button:hover {
  background: rgba(255,255,255,.15);
  transform: translateY(-1px);
}

.garden-main {
  flex: 1;
  display: grid;
  align-items: center;
  padding: clamp(18px, 4vw, 46px) 0;
}

.screen {
  width: 100%;
}

.start-screen,
.results-screen {
  min-height: 640px;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 28px;
  background: rgba(10, 31, 31, .84);
  box-shadow: var(--shadow);
}

.intro-panel,
.results-panel {
  padding: clamp(28px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.intro-panel {
  background:
    radial-gradient(circle at 16% 10%, rgba(188,234,208,.18), transparent 15rem),
    linear-gradient(160deg, rgba(21,61,54,.95), rgba(11,40,39,.94));
}

.back-link {
  width: max-content;
  margin-bottom: 25px;
  color: var(--mint);
  font-size: .85rem;
  font-weight: 900;
  text-decoration: none;
}

.back-link:hover {
  color: var(--gold);
}

.eyebrow,
.prompt-kicker {
  margin: 0;
  color: var(--gold);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

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

h1 {
  margin: 10px 0 0;
  color: var(--cream);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(3.7rem, 7vw, 6.4rem);
  line-height: .85;
  letter-spacing: .035em;
}

h1 span {
  color: var(--leaf-light);
}

.intro-tagline {
  max-width: 23rem;
  margin: 26px 0 8px;
  color: var(--gold);
  font-size: clamp(1.1rem, 2.3vw, 1.45rem);
  font-weight: 900;
}

.intro-copy {
  max-width: 29rem;
  margin-bottom: 22px;
  color: var(--mint);
  line-height: 1.5;
}

.study-goal {
  width: min(100%, 360px);
  margin-bottom: 18px;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid rgba(188,234,208,.25);
  border-left: 5px solid var(--leaf-light);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
}

.study-goal span {
  color: var(--gold);
  font-size: .64rem;
  font-weight: 900;
  letter-spacing: .12em;
}

.study-goal strong {
  font-size: 1.02rem;
}

.study-goal small {
  color: rgba(255,248,223,.68);
  font-size: .77rem;
}

.family-preview {
  max-width: 360px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 25px;
}

.family-preview span {
  padding: 5px 7px;
  color: var(--forest-dark);
  border-radius: 5px;
  background: var(--mint);
  font-size: .65rem;
  font-weight: 900;
}

.name-entry {
  margin: 17px 0 15px;
  padding: 13px 15px 14px;
  display: grid;
  gap: 7px;
  border: 1px solid rgba(188,234,208,.2);
  border-radius: 13px;
  background: rgba(255,255,255,.06);
}

.name-entry label {
  color: var(--gold);
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.name-entry input {
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  color: var(--cream);
  border: 2px solid rgba(255,255,255,.22);
  border-radius: 9px;
  outline: 0;
  background: rgba(8,27,28,.58);
  font-weight: 800;
}

.name-entry input::placeholder { color: rgba(255,248,223,.5); }
.name-entry input:focus { border-color: var(--gold); }
.name-entry span { color: rgba(255,248,223,.62); font-size: .74rem; font-weight: 700; }

.start-leaderboard-panel,
.leaderboard-panel {
  margin: 16px 0 18px;
  padding: 14px 15px 13px;
  border: 1px solid rgba(188,234,208,.18);
  border-radius: 14px;
  background: rgba(4,24,25,.3);
}

.start-leaderboard-heading,
.leaderboard-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.shelf-kicker {
  display: block;
  color: var(--gold);
  font-size: .64rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.start-leaderboard-heading h2,
.leaderboard-heading h3 {
  margin: 2px 0 0;
  color: var(--cream);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  letter-spacing: .03em;
}

.leaderboard-player-note {
  color: var(--mint);
  font-size: .68rem;
  font-weight: 800;
  text-align: right;
}

.leaderboard-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard-row {
  min-height: 41px;
  padding: 5px 8px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-left: 3px solid rgba(188,234,208,.28);
  border-radius: 7px;
  background: rgba(255,255,255,.07);
}

.leaderboard-row.is-current { border-left-color: var(--gold); background: rgba(255,212,81,.13); }
.leader-rank { color: rgba(255,248,223,.6); font-weight: 900; }
.leader-copy { min-width: 0; display: grid; }
.leader-name { overflow: hidden; color: var(--cream); font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.leader-meta { color: rgba(255,248,223,.57); font-size: .64rem; font-weight: 700; }
.leader-score { color: var(--gold); font-size: .98rem; }
.leaderboard-empty { padding: 8px; color: rgba(255,248,223,.6); font-size: .75rem; text-align: center; }

.start-button,
.secondary-button,
.next-button {
  min-height: 53px;
  border-radius: 13px;
  font-weight: 900;
  letter-spacing: .035em;
}

.start-button {
  width: 100%;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--forest-dark);
  border: 2px solid var(--forest-dark);
  background: var(--gold);
  box-shadow: 6px 6px 0 var(--coral);
  text-transform: uppercase;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.start-button:hover {
  filter: brightness(1.06);
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--coral);
}

.start-button:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--coral);
}

.start-button > span:last-child {
  font-size: 1.45rem;
}

.intro-art,
.results-art {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  background:
    linear-gradient(180deg, #bcead0 0 41%, #77c879 41% 65%, #3caa67 65% 100%);
}

.intro-art::after,
.results-art::after {
  content: "";
  position: absolute;
  inset: 41% 0 auto;
  height: 2px;
  background: rgba(21,61,54,.2);
}

.intro-sun {
  position: absolute;
  top: 11%;
  right: 12%;
  width: 98px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff0a8;
  box-shadow: 0 0 50px rgba(255,240,168,.58);
}

.intro-cloud {
  position: absolute;
  width: 105px;
  height: 23px;
  border-radius: 999px;
  background: rgba(255,255,255,.7);
}

.intro-cloud::before,
.intro-cloud::after {
  content: "";
  position: absolute;
  bottom: 0;
  border-radius: 50%;
  background: inherit;
}

.intro-cloud::before { left: 18px; width: 42px; height: 42px; }
.intro-cloud::after { left: 53px; width: 32px; height: 32px; }
.intro-cloud-one { top: 19%; left: 12%; transform: scale(.7); }
.intro-cloud-two { top: 29%; right: 10%; transform: scale(.5); opacity: .65; }

.intro-house {
  position: absolute;
  z-index: 2;
  bottom: 39%;
  font-size: 4.5rem;
  filter: drop-shadow(4px 5px 0 rgba(21,61,54,.18));
}

.intro-house-one { left: 7%; }
.intro-house-two { right: 9%; bottom: 35%; font-size: 3.8rem; }

.intro-tree {
  position: absolute;
  z-index: 3;
  display: grid;
  justify-items: center;
  filter: drop-shadow(6px 8px 0 rgba(21,61,54,.2));
}

.intro-tree span {
  font-size: 10rem;
  line-height: .8;
}

.intro-tree-back { left: 8%; bottom: 12%; opacity: .65; transform: scale(.72); }
.intro-tree-front { right: 24%; bottom: 9%; transform: rotate(-4deg); }

.intro-tree b {
  margin-top: 6px;
  padding: 5px 9px;
  color: var(--cream);
  border-radius: 5px;
  background: var(--brown);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 1rem;
  letter-spacing: .12em;
}

.intro-helper,
.game-helper {
  position: absolute;
  z-index: 6;
  width: 110px;
  height: 148px;
  color: #f9c8a6;
  text-align: center;
  filter: drop-shadow(4px 6px 0 rgba(21,61,54,.25));
}

.intro-helper { right: 8%; bottom: 7%; transform: rotate(7deg); }

.helper-hat,
.helper-face,
.helper-body,
.helper-basket {
  position: absolute;
  display: block;
}

.helper-hat {
  top: 3px;
  left: 13px;
  width: 83px;
  height: 34px;
  color: #fff0a8;
  border-bottom: 8px solid #e8a73e;
  border-radius: 50% 50% 18% 18%;
  font-size: 3.5rem;
  line-height: 1;
}

.helper-face {
  top: 29px;
  left: 27px;
  width: 55px;
  height: 54px;
  display: grid;
  place-items: center;
  color: #482d29;
  border: 3px solid #6c4032;
  border-radius: 48% 48% 45% 45%;
  background: #f8c5a5;
  font-size: 1rem;
  font-weight: 900;
}

.helper-body {
  left: 25px;
  bottom: 10px;
  width: 61px;
  height: 63px;
  color: #286e82;
  border-radius: 45% 45% 22% 22%;
  background: #f08a5d;
  font-size: 4rem;
  line-height: .85;
}

.helper-basket {
  right: -4px;
  bottom: 10px;
  width: 42px;
  height: 29px;
  color: #fff0a8;
  border: 4px solid #9c6039;
  border-top: 0;
  border-radius: 0 0 45% 45%;
  font-size: 1.7rem;
  line-height: 1;
  transform: rotate(-10deg);
}

.intro-sign {
  position: absolute;
  z-index: 8;
  left: 9%;
  bottom: 14%;
  color: var(--coral);
  font-family: "Comic Sans MS", cursive;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 900;
  transform: rotate(-8deg);
  text-shadow: 2px 2px 0 var(--cream);
}

.game-hud {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 18px 18px 0 0;
  background: rgba(7, 27, 28, .86);
  box-shadow: var(--shadow);
}

.hud-stat {
  min-height: 77px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  border-right: 1px solid rgba(255,255,255,.13);
  text-align: center;
}

.hud-stat:last-child { border-right: 0; }
.hud-stat span { color: rgba(255,248,223,.63); font-size: .67rem; font-weight: 900; letter-spacing: .13em; }
.hud-stat strong { color: var(--mint); font-size: clamp(1.35rem, 4vw, 2.05rem); line-height: 1; }
.hud-score-stat strong { color: var(--gold); }
.hud-family-stat strong { color: var(--leaf-light); }

.prompt-area {
  position: relative;
  z-index: 4;
  padding: 17px 18px 16px;
  color: var(--ink);
  text-align: center;
  background:
    radial-gradient(circle at 15% 30%, rgba(60,170,103,.1) 0 3px, transparent 4px),
    radial-gradient(circle at 85% 70%, rgba(242,127,104,.12) 0 3px, transparent 4px),
    var(--paper);
  background-size: 24px 24px, 28px 28px, auto;
  box-shadow: 0 8px 20px rgba(4,24,25,.25);
}

.prompt-kicker {
  color: #58716a;
  letter-spacing: .14em;
}

.word-card {
  min-width: min(430px, 90%);
  margin: 9px auto 0;
  padding: 9px 18px 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: var(--forest-dark);
  border: 3px solid var(--forest);
  border-radius: 14px;
  background: #fff1ae;
  box-shadow: 5px 5px 0 var(--coral);
  font-size: clamp(1.45rem, 4vw, 2.25rem);
  line-height: 1;
  transition: transform .18s ease, box-shadow .18s ease;
}

.word-card:hover,
.word-card.is-selected {
  transform: translate(-2px, -2px) rotate(-1deg);
  box-shadow: 8px 8px 0 var(--coral);
}

.word-card-seed {
  color: var(--leaf);
  font-size: 1rem;
}

.instruction {
  margin: 10px 0 0;
  color: #58716a;
  font-size: .9rem;
  font-weight: 800;
}

.round-remaining {
  margin: 5px 0 0;
  color: #7c958e;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .04em;
}

.garden-board {
  position: relative;
  min-height: 540px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.15);
  border-top: 0;
  border-radius: 0 0 20px 20px;
  background: linear-gradient(180deg, #bcead0 0 34%, #83cf80 34% 54%, #3caa67 54% 100%);
  box-shadow: var(--shadow);
}

.garden-board::before {
  content: "";
  position: absolute;
  inset: 34% 0 auto;
  height: 2px;
  background: rgba(21,61,54,.2);
}

.garden-houses {
  position: absolute;
  inset: 20% 3% auto;
  display: flex;
  justify-content: space-around;
  opacity: .73;
  font-size: clamp(2.3rem, 6vw, 4rem);
  filter: drop-shadow(3px 5px 0 rgba(21,61,54,.17));
}

.helper-stage {
  position: absolute;
  z-index: 5;
  left: 3%;
  bottom: 6%;
  width: 103px;
  height: 142px;
}

.game-helper {
  inset: 0 auto auto 0;
  transform: scale(.78) rotate(-5deg);
  transform-origin: bottom left;
}

.game-helper::after {
  content: attr(data-word);
  position: absolute;
  right: -62px;
  bottom: 36px;
  max-width: 92px;
  padding: 5px 7px;
  color: var(--forest-dark);
  border: 2px solid var(--forest);
  border-radius: 7px;
  background: #fff1ae;
  box-shadow: 2px 3px 0 rgba(21,61,54,.22);
  font-size: .67rem;
  font-weight: 900;
  opacity: 0;
  transform: rotate(4deg) scale(.7);
}

.game-helper.is-carrying::after {
  animation: carried-word .7s ease forwards;
}

.game-helper.is-carrying {
  animation: helper-bounce .55s ease-in-out;
}

.tree-grid {
  position: relative;
  z-index: 4;
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 63px 30px 30px 140px;
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 14px;
}

.tree-button {
  min-height: 190px;
  padding: 10px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  color: var(--forest-dark);
  border: 3px solid rgba(21,61,54,.55);
  border-radius: 17px;
  background: rgba(255,253,242,.82);
  box-shadow: 4px 5px 0 rgba(21,61,54,.2);
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.tree-button:hover,
.tree-button.is-selected {
  border-color: var(--gold);
  background: #fff7c9;
  box-shadow: 6px 7px 0 rgba(21,61,54,.23);
  transform: translateY(-4px);
}

.tree-button.is-correct {
  border-color: var(--leaf);
  background: #dcf5cb;
  animation: tree-grow .55s ease;
}

.tree-button.is-wrong {
  border-color: var(--coral);
  background: #ffe0d3;
  animation: shake .35s ease;
}

.tree-button.is-answer {
  border-color: var(--leaf);
  box-shadow: 0 0 0 5px rgba(139,212,127,.42), 4px 5px 0 rgba(21,61,54,.2);
}

.tree-art {
  position: relative;
  width: 92px;
  height: 109px;
  display: grid;
  place-items: center;
  transform-origin: 50% 100%;
  transition: transform .45s cubic-bezier(.2,1.4,.4,1), filter .35s ease;
}

.tree-art i {
  font-size: 5.1rem;
  font-style: normal;
  line-height: 1;
  filter: drop-shadow(3px 4px 0 rgba(21,61,54,.22));
  transition: font-size .35s ease, filter .35s ease;
}

.tree-art b {
  position: absolute;
  top: 15px;
  right: 6px;
  color: var(--coral);
  font-size: 1.1rem;
  transition: opacity .25s ease, transform .35s ease;
}

.tree-button[data-level="0"] .tree-art { transform: scale(.6); filter: saturate(.72); }
.tree-button[data-level="1"] .tree-art { transform: scale(.74); }
.tree-button[data-level="2"] .tree-art { transform: scale(.88); }
.tree-button[data-level="3"] .tree-art { transform: scale(.98); }
.tree-button[data-level="4"] .tree-art { transform: scale(1.08); filter: saturate(1.18); }
.tree-button[data-level="0"] .tree-art b,
.tree-button[data-level="1"] .tree-art b,
.tree-button[data-level="2"] .tree-art b { opacity: 0; }
.tree-button[data-level="3"] .tree-art b { opacity: 1; }
.tree-button[data-level="4"] .tree-art b { opacity: 1; transform: scale(1.15); }

.tree-button strong {
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 1.03rem;
  letter-spacing: .08em;
}

.tree-button small {
  margin-top: 4px;
  color: #55716a;
  font-size: .72rem;
  font-weight: 900;
}

.feedback {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 17px;
  width: min(520px, calc(100% - 32px));
  padding: 12px 15px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px 10px;
  color: var(--forest-dark);
  border: 2px solid var(--forest);
  border-radius: 14px;
  background: rgba(255,253,242,.95);
  box-shadow: 5px 6px 0 rgba(21,61,54,.26);
  text-align: center;
  transform: translateX(-50%);
}

.feedback strong {
  color: var(--leaf);
  font-size: 1.1rem;
}

.feedback span {
  font-size: .9rem;
  font-weight: 800;
}

.feedback.is-wrong strong { color: #d34f42; }

.next-button {
  min-height: 38px;
  padding: 7px 12px;
  color: var(--forest-dark);
  border: 2px solid var(--forest-dark);
  background: var(--gold);
}

.garden-tip {
  margin: 12px 0 0;
  color: rgba(255,248,223,.72);
  font-size: .82rem;
  font-weight: 800;
  text-align: center;
}

.results-panel {
  background: linear-gradient(160deg, rgba(21,61,54,.96), rgba(11,40,39,.94));
}

.results-sprout {
  font-size: 3.2rem;
}

.results-panel h2 {
  margin: 10px 0;
  color: var(--leaf-light);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(2.7rem, 5vw, 4.5rem);
  line-height: .95;
}

.results-panel > p:not(.eyebrow) {
  color: var(--mint);
  font-size: 1.05rem;
}

.results-stats {
  margin: 24px 0 29px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.results-stats div {
  min-height: 90px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(188,234,208,.2);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  text-align: center;
}

.results-stats span { color: rgba(255,248,223,.65); font-size: .7rem; font-weight: 900; }
.results-stats strong { color: var(--gold); font-size: 1.45rem; }

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.secondary-button {
  min-height: 53px;
  padding: 13px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cream);
  border: 2px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.06);
  text-decoration: none;
}

.secondary-button:hover {
  background: rgba(255,255,255,.13);
}

.results-art {
  display: grid;
  place-items: center;
}

.results-tree {
  position: absolute;
  bottom: 12%;
  font-size: 14rem;
  filter: drop-shadow(8px 10px 0 rgba(21,61,54,.2));
}

.results-helper {
  position: absolute;
  right: 13%;
  bottom: 8%;
  z-index: 2;
  font-size: 6rem;
  transform: rotate(6deg);
  filter: drop-shadow(4px 6px 0 rgba(21,61,54,.2));
}

.results-art > span {
  position: absolute;
  top: 18%;
  color: var(--coral);
  font-family: "Comic Sans MS", cursive;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 900;
  transform: rotate(-8deg);
  text-shadow: 2px 2px 0 var(--cream);
}

.garden-footer {
  min-height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  color: rgba(255,248,223,.55);
  font-size: .72rem;
  font-weight: 800;
}

dialog {
  width: min(510px, calc(100% - 26px));
  padding: 28px;
  color: var(--ink);
  border: 0;
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 22px 70px rgba(0,0,0,.45);
}

dialog::backdrop {
  background: rgba(5, 21, 23, .76);
}

dialog h2 {
  margin: 8px 0 13px;
  color: var(--forest);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 2.7rem;
}

dialog ol {
  margin: 0;
  padding-left: 22px;
  line-height: 1.65;
}

.dialog-close {
  position: absolute;
  top: 9px;
  right: 12px;
  width: 34px;
  height: 34px;
  color: var(--forest);
  border: 0;
  background: transparent;
  font-size: 1.8rem;
}

.dialog-button {
  margin-top: 20px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes tree-grow {
  0% { transform: scale(1); }
  45% { transform: scale(1.06) rotate(-2deg); }
  100% { transform: scale(1); }
}

@keyframes helper-bounce {
  0%, 100% { transform: scale(.78) rotate(-5deg); }
  50% { transform: scale(.82) rotate(4deg) translateY(-8px); }
}

@keyframes carried-word {
  0% { opacity: 0; transform: translate(-12px, 6px) rotate(4deg) scale(.7); }
  35% { opacity: 1; transform: translate(0, -8px) rotate(4deg) scale(1); }
  100% { opacity: 0; transform: translate(48px, -36px) rotate(4deg) scale(.78); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-6px); }
  70% { transform: translateX(6px); }
}

@media (max-width: 900px) {
  .start-screen,
  .results-screen {
    grid-template-columns: 1fr;
  }

  .intro-art,
  .results-art {
    min-height: 360px;
  }

  .intro-tree span { font-size: 8rem; }
  .tree-grid { grid-template-columns: repeat(3, minmax(135px, 1fr)); }
}

@media (max-width: 680px) {
  .portal-actions .help-button,
  .portal-actions .sound-button {
    padding-inline: 10px;
    font-size: .75rem;
  }

  .portal-actions .language-chip { display: none; }

  .garden-main { padding-block: 13px 20px; }

  .intro-panel,
  .results-panel { padding: 27px 20px 31px; }

  h1 { font-size: clamp(3.1rem, 14vw, 4.8rem); }

  .intro-art,
  .results-art { min-height: 300px; }

  .intro-sun { width: 65px; }
  .intro-house { font-size: 3.1rem; }
  .intro-house-two { font-size: 2.6rem; }
  .intro-tree span { font-size: 6.2rem; }
  .intro-helper { transform: scale(.72) rotate(7deg); transform-origin: bottom right; }

  .game-hud { grid-template-columns: repeat(4, 1fr); border-radius: 14px 14px 0 0; }
  .hud-stat { min-height: 64px; padding: 8px 4px; }
  .hud-stat span { font-size: .55rem; letter-spacing: .06em; }
  .hud-stat strong { font-size: clamp(1.05rem, 5vw, 1.45rem); }

  .prompt-area { padding: 13px 10px 14px; }
  .word-card { min-width: min(340px, 95%); gap: 10px; font-size: clamp(1.25rem, 7vw, 1.8rem); }
  .instruction { font-size: .76rem; }

  .garden-board { min-height: 630px; }
  .garden-houses { inset-block-start: 13%; font-size: 2.1rem; }
  .helper-stage { left: 1%; bottom: 1%; transform: scale(.75); transform-origin: bottom left; }
  .tree-grid { padding: 52px 9px 108px 78px; grid-template-columns: repeat(2, minmax(110px, 1fr)); gap: 9px; }
  .tree-button { min-height: 192px; padding-inline: 4px; }
  .tree-art { transform: scale(.86); margin-block: -6px; }
  .tree-button strong { font-size: .88rem; }
  .tree-button small { font-size: .65rem; }
  .feedback { bottom: 12px; width: calc(100% - 18px); }

  .results-stats { gap: 5px; }
  .results-stats div { min-height: 82px; padding-inline: 3px; }
  .results-stats span { font-size: .59rem; }
  .results-stats strong { font-size: 1.15rem; }
  .result-actions { grid-template-columns: 1fr; }
  .results-tree { font-size: 9rem; }
  .results-helper { font-size: 4.5rem; right: 8%; }
}

@media (max-width: 390px) {
  .portal-bar { min-height: 52px; }
  .portal-brand { font-size: .82rem; }
  .mini-ball { width: 25px; height: 25px; flex-basis: 25px; }
  .help-button,
  .sound-button { min-height: 36px; padding: 7px 8px !important; font-size: .66rem !important; }
  .tree-grid { padding-left: 67px; }
  .tree-button { min-height: 176px; }
  .tree-art { transform: scale(.75); margin-block: -12px; }
}

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