/* Cartoon Spelling Zoo — chunky, high-contrast tiles a small finger can hit,
   in the same violet-and-amber comic palette as the rest of the site. */

:root {
  --spell-tile: #3a2569;
  --spell-tile-lit: #ffc93c;
  --spell-drop: rgba(11, 6, 26, 0.7);
}

.zoo-wrap {
  width: min(1080px, 100% - 1.6rem);
  margin: 1.4rem auto 3.5rem;
}

.zoo-head {
  position: relative;
  padding: 1.4rem 1.4rem 1.6rem;
  background:
    radial-gradient(700px 320px at 88% -30%, rgba(89, 224, 181, 0.24), transparent 65%),
    linear-gradient(150deg, #3a2170, #241650 70%);
  border: 3px solid var(--line);
  border-radius: 14px 34px 14px 34px;
  box-shadow: 10px 12px 0 rgba(8, 5, 18, 0.5);
  overflow: hidden;
}
.zoo-head::after {
  /* A row of paw prints running off the corner, for a bit of playground. */
  content: "🐾 🐾 🐾";
  position: absolute;
  right: -0.4rem;
  bottom: -0.6rem;
  font-size: 2.2rem;
  opacity: 0.16;
  transform: rotate(-12deg);
  pointer-events: none;
}
.zoo-head h1 {
  margin: 0.35rem 0 0.2rem;
  font-family: "Chewy", var(--font);
  font-weight: 400;
  font-size: clamp(2.2rem, 6.5vw, 3.7rem);
  color: #fff0c8;
  text-shadow: 0 5px 0 #8b3949, 0 9px 0 rgba(0, 0, 0, 0.3);
  transform: rotate(-1.4deg);
}
.zoo-head p {
  max-width: 56ch;
  margin: 0;
  color: #ddd0ff;
  font-weight: 600;
}

.zoo-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
  margin: 1rem 0 0;
}
.stat-chip {
  padding: 0.55rem 0.8rem;
  background: rgba(13, 8, 33, 0.6);
  border: 2px solid var(--line);
  border-radius: 12px;
}
.stat-chip small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.stat-chip b {
  font-family: "Chewy", var(--font);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--amber);
}

.zoo-meter {
  margin-top: 0.9rem;
}
.zoo-meter .bar {
  height: 16px;
  background: rgba(13, 8, 33, 0.7);
  border: 2px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.zoo-meter .bar::before {
  content: "";
  display: block;
  width: var(--fill, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--amber));
  transition: width 0.4s ease;
}
.zoo-meter span {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.pad-pill {
  display: inline-block;
  margin-top: 0.8rem;
  padding: 0.35rem 0.75rem;
  background: rgba(13, 8, 33, 0.65);
  border: 2px dashed var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}
.pad-pill.live {
  border-style: solid;
  border-color: var(--mint);
  color: #0b3823;
  background: var(--mint);
}

.zoo-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1.2rem 0 0.9rem;
}
.zoo-tab {
  padding: 0.65rem 1.1rem;
  background: var(--panel-2);
  border: 3px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 5px 0 var(--spell-drop);
  color: var(--ink);
  font: 800 1rem/1 var(--font);
  cursor: pointer;
}
.zoo-tab.active {
  background: var(--pink);
  border-color: var(--amber);
  color: #2a0f2a;
}
.zoo-tab:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--spell-drop);
}

.zoo-panel {
  padding: 1.1rem;
  background: rgba(14, 9, 34, 0.62);
  border: 2px solid var(--line);
  border-radius: 16px;
}
.zoo-panel[hidden] {
  display: none;
}

.cheer-banner {
  margin: 0 0 0.9rem;
  padding: 0.6rem 0.9rem;
  background: rgba(89, 224, 181, 0.16);
  border-left: 5px solid var(--mint);
  border-radius: 6px;
  color: #d7fff1;
  font-weight: 800;
  transition: opacity 0.3s ease;
}
.cheer-banner.hidden {
  opacity: 0;
  pointer-events: none;
}

/* --- board 1: letter sounds ---------------------------------------- */

.letter-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 1.2rem;
  align-items: start;
}
#letterBoard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 0.55rem;
}
.letter-tile {
  display: grid;
  place-items: center;
  gap: 0;
  padding: 0.5rem 0.3rem 0.4rem;
  background: var(--spell-tile);
  border: 3px solid #1b1136;
  border-radius: 14px;
  box-shadow: 0 6px 0 var(--spell-drop);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.15s ease;
}
.letter-tile b {
  font-family: "Chewy", var(--font);
  font-size: 1.9rem;
  font-weight: 400;
  line-height: 1;
  color: #fff0c8;
}
.letter-tile small {
  font-size: 1rem;
  font-weight: 800;
  color: var(--sky);
  line-height: 1;
}
.letter-tile .tile-word {
  margin-top: 0.2rem;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.letter-tile.team {
  background: #43286d;
  border-color: #ffc93c66;
}
.letter-tile:hover {
  background: #4a2f85;
}
.letter-tile.lit {
  background: var(--spell-tile-lit);
  border-color: #8b5a00;
}
.letter-tile.lit b,
.letter-tile.lit small,
.letter-tile.lit .tile-word {
  color: #3a2400;
}
.letter-tile:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--spell-drop);
}

.letter-card {
  display: grid;
  place-items: center;
  gap: 0.5rem;
  min-height: 230px;
  padding: 1rem;
  background: linear-gradient(160deg, rgba(255, 201, 60, 0.14), rgba(89, 201, 240, 0.1));
  border: 3px dashed var(--amber);
  border-radius: 18px;
  text-align: center;
}
.letter-card-text strong {
  display: block;
  font-family: "Chewy", var(--font);
  font-size: 2.4rem;
  font-weight: 400;
  color: var(--amber);
  line-height: 1;
}
.letter-card-text span {
  font-weight: 800;
  color: #ddd0ff;
}

/* --- board 2: spell the zoo --------------------------------------- */

.zoo-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.3rem;
  align-items: start;
}
.animal-stage {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 0.8rem;
  background: radial-gradient(ellipse at 50% 88%, rgba(95, 183, 131, 0.35) 0 32%, transparent 34%), rgba(13, 8, 33, 0.55);
  border: 3px solid var(--line);
  border-radius: 20px;
}
.animal-stage.pop {
  animation: critter-pop 0.55s ease;
}
@keyframes critter-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.11) rotate(-2deg); }
  100% { transform: scale(1); }
}
.critter-canvas {
  display: block;
}
.critter-glyph {
  display: block;
  line-height: 1;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.45));
}
.animal-meta {
  margin-top: 0.6rem;
  text-align: center;
}
.animal-meta .counter {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.animal-meta .note {
  margin: 0.2rem 0 0;
  color: #ddd0ff;
  font-weight: 700;
}
.animal-done {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.15rem 0.55rem;
  background: var(--mint);
  border-radius: 999px;
  color: #0b3823;
  font-size: 0.72rem;
  font-weight: 800;
}
.animal-done[hidden] {
  display: none;
}

#wordSlots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.1rem;
}
.word-slot {
  display: grid;
  place-items: center;
  width: 62px;
  height: 72px;
  background: rgba(13, 8, 33, 0.75);
  border: 3px dashed rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  font-family: "Chewy", var(--font);
  font-size: 2.2rem;
  color: #fff0c8;
}
#wordSlots[data-long="true"] .word-slot {
  width: 50px;
  height: 60px;
  font-size: 1.8rem;
}
.word-slot.filled {
  background: var(--mint);
  border-style: solid;
  border-color: #157a58;
  color: #06301f;
}
.word-slot.next {
  border-color: var(--amber);
  box-shadow: 0 0 0 4px rgba(255, 201, 60, 0.2);
}
.word-slot.shake,
.pick-card.shake {
  animation: slot-shake 0.4s ease;
}
@keyframes slot-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px) rotate(-2deg); }
  75% { transform: translateX(7px) rotate(2deg); }
}

#letterBank {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.bank-tile {
  width: 62px;
  height: 62px;
  background: linear-gradient(180deg, #ffd76a, #eaa71b);
  border: 3px solid #8b5a00;
  border-radius: 14px;
  box-shadow: 0 6px 0 #6d4600;
  color: #3a2400;
  font: 800 1.7rem/1 var(--font);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.bank-tile:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #6d4600;
}
.bank-tile.spent {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: none;
  color: rgba(255, 255, 255, 0.25);
  cursor: default;
}
.bank-tile.hinted {
  animation: hint-glow 0.6s ease 3;
}
@keyframes hint-glow {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.08); }
}

.zoo-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.2rem;
}
.hint-line {
  min-height: 1.4rem;
  margin: 0.7rem 0 0;
  color: var(--amber);
  font-weight: 800;
  text-align: center;
}

/* --- board 3: listen and pick ------------------------------------- */

#pickRow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem;
  margin: 1rem 0;
}
.pick-card {
  display: grid;
  place-items: center;
  gap: 0.4rem;
  padding: 1rem 0.6rem;
  background: rgba(58, 37, 105, 0.85);
  border: 3px solid #1b1136;
  border-radius: 18px;
  box-shadow: 0 7px 0 var(--spell-drop);
  color: var(--ink);
  font: 800 1.1rem/1 var(--font);
  letter-spacing: 0.06em;
  cursor: pointer;
}
.pick-card:active {
  transform: translateY(4px);
  box-shadow: 0 3px 0 var(--spell-drop);
}
.pick-card.won {
  background: var(--mint);
  border-color: #0f5f45;
  color: #06301f;
}
.pick-line {
  min-height: 1.5rem;
  color: #ddd0ff;
  font-weight: 800;
  text-align: center;
}

/* --- the controller highlight ------------------------------------- */

[data-cursor].cursor {
  outline: 4px solid var(--sky);
  outline-offset: 3px;
}

/* --- the stars footer -------------------------------------------- */

.stars-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: center;
  margin-top: 1.4rem;
  padding: 1rem;
  background: rgba(255, 201, 60, 0.08);
  border: 2px dashed var(--amber);
  border-radius: 14px;
}
.stars-bar input {
  padding: 0.6rem 0.8rem;
  background: #0d0821;
  border: 2px solid var(--amber);
  border-radius: 10px;
  color: var(--ink);
  font: 800 1rem/1 var(--font);
}
.stars-bar p {
  flex: 1 1 260px;
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.grown-ups {
  margin-top: 1.4rem;
  padding: 1rem 1.1rem;
  background: rgba(13, 8, 33, 0.5);
  border: 2px solid var(--line);
  border-radius: 14px;
}
.grown-ups h2 {
  font-family: "Chewy", var(--font);
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--sky);
}
.grown-ups ul {
  margin: 0;
  padding-left: 1.1rem;
  color: #ddd0ff;
  font-weight: 600;
  line-height: 1.6;
}

@media (max-width: 880px) {
  .letter-layout,
  .zoo-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .letter-card {
    min-height: 180px;
  }
  #letterBoard {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  }
  .word-slot {
    width: 48px;
    height: 58px;
    font-size: 1.7rem;
  }
  .bank-tile {
    width: 54px;
    height: 54px;
    font-size: 1.45rem;
  }
}
