/* =========================================================
   ANIMAL EXPLORER — Musical animal world theme
   ========================================================= */
:root {
  --purple: #3a1670;
  --purple-2: #5b2a9e;
  --midnight: #12163f;
  --lavender: #c3b2ff;
  --turq: #2ed3c6;
  --coral: #ff6f91;
  --peach: #ffb88c;
  --gold: #ffd23f;
  --cream: #fff8ea;
  --ink: #26164a;
  --ink-soft: #5a4b7a;
  --ok: #1fa971;
  --bad: #e2445c;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(10, 6, 40, .35);
  --font-head: 'Baloo 2', 'Comic Sans MS', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
  color: var(--cream);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255, 111, 145, .25), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(46, 211, 198, .14), transparent 60%),
    linear-gradient(180deg, var(--midnight) 0%, var(--purple) 55%, #2a1050 100%);
  background-attachment: fixed;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.1; margin: 0 0 .4em; }
button { font: inherit; }
:focus-visible { outline: 4px solid var(--gold); outline-offset: 3px; border-radius: 10px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--gold); color: var(--ink); padding: 8px 14px; border-radius: 10px; font-weight: 800; }
.skip:focus { left: 8px; }

.wrap { width: min(1180px, 100% - 32px); margin: 0 auto; padding: 28px 0 56px; }
.wrap.narrow { width: min(860px, 100% - 32px); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 48px; padding: 10px 22px; border-radius: 999px; border: 0;
  font-family: var(--font-head); font-weight: 800; font-size: 1.05rem; letter-spacing: .02em;
  text-decoration: none; cursor: pointer; color: var(--ink);
  box-shadow: 0 5px 0 rgba(0, 0, 0, .25), 0 10px 20px rgba(0, 0, 0, .2);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; filter: grayscale(.4); }
.btn-gold { background: linear-gradient(180deg, #ffe373, var(--gold)); }
.btn-turq { background: linear-gradient(180deg, #6ff0e5, var(--turq)); }
.btn-coral { background: linear-gradient(180deg, #ff9ab2, var(--coral)); }
.btn-lav { background: linear-gradient(180deg, #e1d8ff, var(--lavender)); }
.btn-ghost { background: rgba(255, 255, 255, .14); color: var(--cream); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .45); }
.card .btn-ghost, .game .btn-ghost, dialog .btn-ghost { background: #efe8ff; color: var(--ink); box-shadow: inset 0 0 0 2px #cbbcf5; }
.btn-xl { min-height: 60px; padding: 14px 34px; font-size: 1.3rem; }
.btn.small { min-height: 40px; padding: 6px 16px; font-size: .95rem; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 16px;
  background: rgba(18, 22, 63, .88);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid rgba(255, 210, 63, .35);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--font-head); font-size: 1.35rem; font-weight: 700; white-space: nowrap; }
.brand b { color: var(--gold); }
.brand-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--coral), var(--gold)); }
.nav { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.nav a {
  padding: 8px 12px; border-radius: 999px; text-decoration: none; font-weight: 800; font-size: .92rem;
  text-transform: uppercase; letter-spacing: .03em; color: var(--cream);
}
.nav a:hover { background: rgba(255, 255, 255, .12); }
.nav a[aria-current="page"] { background: var(--gold); color: var(--ink); }
.nav-stars { font-size: .8em; background: rgba(255, 255, 255, .18); padding: 1px 6px; border-radius: 99px; margin-left: 2px; }
.nav a[aria-current="page"] .nav-stars { background: rgba(0, 0, 0, .1); }
.nav-toggle { display: none; margin-left: auto; min-height: 44px; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--gold); background: transparent; color: var(--cream); font-weight: 800; cursor: pointer; }

.music { display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .1); border-radius: 999px; padding: 4px 10px 4px 4px; }
.music-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; min-width: 40px; padding: 4px 12px; border-radius: 999px; border: 0; background: var(--turq); color: var(--ink); font-weight: 800; cursor: pointer; }
.music-btn.icon-only { padding: 4px; justify-content: center; background: rgba(255, 255, 255, .85); }
.music.playing .music-btn:first-child { background: var(--gold); }
.music-vol input { width: 90px; accent-color: var(--gold); }

@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: 6px; }
  .nav { order: 10; width: 100%; flex-direction: column; display: none; padding: 6px 0 10px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; font-size: 1rem; }
  .music { order: 5; }
}
@media (max-width: 560px) {
  .brand-text { font-size: 1.1rem; }
  .music-label { display: none; }
  .music-vol input { width: 70px; }
}

/* ---------- Pages ---------- */
.page { animation: pageIn .45s ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head > div { flex: 1; min-width: 240px; }
.page-title { font-size: clamp(2rem, 5vw, 3.2rem); color: var(--gold); text-shadow: 0 4px 0 rgba(0, 0, 0, .25); margin: 0; }
.section-title { font-size: clamp(1.6rem, 3.5vw, 2.3rem); margin-top: 40px; color: var(--cream); }
.section-sub, .lead { color: var(--lavender); margin: -6px 0 16px; font-weight: 700; }
.card { background: var(--cream); color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: min(86vh, 760px); overflow: hidden; display: flex; align-items: flex-start; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(18, 22, 63, .78) 0%, rgba(18, 22, 63, .35) 38%, transparent 60%), linear-gradient(0deg, rgba(42, 16, 80, .9) 0%, transparent 25%); pointer-events: none; }
.hero-copy { position: relative; z-index: 2; padding: clamp(28px, 7vh, 80px) clamp(20px, 5vw, 72px); max-width: 620px; }
.hero-kicker { display: inline-block; margin: 0 0 10px; padding: 6px 14px; background: rgba(255, 111, 145, .9); color: #fff; border-radius: 999px; font-weight: 800; }
.hero-title { font-size: clamp(3rem, 9vw, 6.4rem); line-height: .9; letter-spacing: .02em; color: var(--cream); text-shadow: 0 6px 0 var(--purple), 0 12px 30px rgba(0, 0, 0, .5); margin: 0; }
.hero-title span { color: var(--gold); animation: glow 3s ease-in-out infinite; }
@keyframes glow { 50% { text-shadow: 0 6px 0 var(--purple), 0 0 34px rgba(255, 210, 63, .85); } }
.hero-tag { font-family: var(--font-head); font-size: clamp(1.2rem, 2.6vw, 1.8rem); font-weight: 800; letter-spacing: .14em; color: var(--turq); margin: 14px 0 26px; text-shadow: 0 3px 10px rgba(0, 0, 0, .6); }
.spotlights span { position: absolute; z-index: 1; top: -20%; width: 22vw; height: 140%; background: linear-gradient(180deg, rgba(255, 230, 150, .28), transparent 75%); filter: blur(8px); transform-origin: top center; pointer-events: none; mix-blend-mode: screen; }
.spotlights span:nth-child(1) { left: 30%; animation: sweep 9s ease-in-out infinite; }
.spotlights span:nth-child(2) { left: 62%; animation: sweep 11s ease-in-out infinite reverse; }
@keyframes sweep { 0%, 100% { transform: rotate(18deg); } 50% { transform: rotate(-18deg); } }
.notes span { position: absolute; z-index: 1; bottom: -40px; font-size: 2rem; color: var(--gold); opacity: 0; animation: float 10s linear infinite; text-shadow: 0 0 12px rgba(255, 210, 63, .8); pointer-events: none; }
.notes span:nth-child(1) { left: 55%; animation-delay: 0s; }
.notes span:nth-child(2) { left: 68%; animation-delay: 2s; color: var(--turq); }
.notes span:nth-child(3) { left: 80%; animation-delay: 4s; color: var(--coral); }
.notes span:nth-child(4) { left: 90%; animation-delay: 6s; }
.notes span:nth-child(5) { left: 45%; animation-delay: 8s; color: var(--lavender); }
@keyframes float { 0% { transform: translateY(0) rotate(0); opacity: 0; } 15% { opacity: .9; } 100% { transform: translateY(-80vh) rotate(25deg); opacity: 0; } }
@media (max-width: 700px) {
  .hero { min-height: 78vh; align-items: flex-end; }
  .hero-img { object-position: 72% 50%; }
  .hero::after { background: linear-gradient(0deg, rgba(18, 22, 63, .95) 0%, rgba(18, 22, 63, .55) 45%, transparent 75%); }
  .hero-copy { padding-bottom: 40px; }
}

/* ---------- Hosts & speech bubbles ---------- */
.host { flex: none; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; }
.host img { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 4px solid var(--gold); box-shadow: 0 0 0 6px rgba(255, 210, 63, .2), var(--shadow); animation: bob 4s ease-in-out infinite; background: var(--purple-2); }
.host:hover img { animation-duration: 1.2s; }
.host.bounce img { animation: hop .6s ease; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-2deg); } }
@keyframes hop { 30% { transform: translateY(-16px) scale(1.06); } 60% { transform: translateY(0) scale(.98); } }
.bubble { position: relative; background: #fff; color: var(--ink); padding: 14px 18px; border-radius: 20px; font-weight: 700; margin: 8px 0 0; max-width: 640px; box-shadow: var(--shadow); }
.bubble::before { content: ''; position: absolute; left: -12px; top: 22px; border: 8px solid transparent; border-right: 14px solid #fff; border-left: 0; }
.host-row { display: flex; align-items: center; gap: 18px; margin: -10px 0 8px; position: relative; z-index: 3; flex-wrap: wrap; }
.host-row .bubble { flex: 1; min-width: 220px; }
.host-stack { display: flex; }
.host-stack img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); margin-right: -16px; background: var(--purple-2); }

/* ---------- Home map ---------- */
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.map-card { position: relative; display: block; text-decoration: none; background: var(--cream); color: var(--ink); border-radius: var(--radius); padding: 18px 18px 20px 124px; min-height: 128px; box-shadow: var(--shadow); border-bottom: 6px solid var(--c); transition: transform .2s; }
.map-card:hover { transform: translateY(-4px) rotate(-.5deg); }
.map-card img { position: absolute; left: 14px; top: 16px; width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 4px solid var(--c); }
.map-card h3 { font-size: 1.35rem; margin: 2px 0 4px; }
.map-card p { margin: 0; font-size: .98rem; color: var(--ink-soft); }
.map-step { display: inline-block; font-size: .75rem; font-weight: 800; text-transform: uppercase; background: var(--c); padding: 2px 10px; border-radius: 99px; }

.progress-strip { display: grid; grid-template-columns: 1fr 1.2fr auto; align-items: center; gap: 18px; margin-top: 28px; }
.progress-strip h3 { margin: 0; font-size: 1.3rem; }
.progress-strip p { margin: 0; color: var(--ink-soft); font-weight: 700; }
@media (max-width: 760px) { .progress-strip { grid-template-columns: 1fr; } }

.pbar { height: 22px; border-radius: 99px; background: #e5dcff; overflow: hidden; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .15); }
.pbar span { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--turq), var(--gold), var(--coral)); transition: width .6s cubic-bezier(.2, .9, .3, 1.2); }
.pbar.small { height: 12px; }

.dlo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.dlo { background: rgba(255, 255, 255, .08); border: 2px solid rgba(195, 178, 255, .35); border-radius: var(--radius); padding: 18px; }
.dlo h3 { color: var(--gold); font-size: 1.3rem; margin: 6px 0; }
.dlo p { margin: 0; font-size: .98rem; }
.dlo a { color: var(--turq); font-weight: 800; }
.dlo-ico { font-size: 2rem; }

/* ---------- Meet the Animals ---------- */
.meet-tools { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 2px solid var(--lavender); background: transparent; color: var(--cream); font-weight: 800; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--lavender); color: var(--ink); }
.explored { min-width: 200px; font-weight: 800; color: var(--gold); }
.animal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.animal-card { position: relative; padding: 0; border: 0; text-align: left; cursor: pointer; background: var(--cream); color: var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.animal-card:hover { transform: translateY(-5px) scale(1.02); box-shadow: 0 16px 34px rgba(10, 6, 40, .5); }
.animal-card img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--purple-2); }
.animal-card .ac-body { padding: 10px 14px 14px; }
.animal-card h3 { font-size: 1.35rem; margin: 0; }
.animal-card p { margin: 0; font-size: .9rem; color: var(--ink-soft); font-weight: 700; }
.animal-card .seen { position: absolute; top: 10px; right: 10px; background: var(--gold); color: var(--ink); font-size: .78rem; font-weight: 800; padding: 3px 9px; border-radius: 99px; box-shadow: 0 3px 8px rgba(0, 0, 0, .3); }
.animal-card[hidden] { display: none; }

.word-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.word { perspective: 800px; height: 130px; padding: 0; border: 0; background: none; cursor: pointer; }
.word-in { position: relative; display: block; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; }
.word.flipped .word-in { transform: rotateY(180deg); }
.word-front, .word-back { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; border-radius: 18px; backface-visibility: hidden; text-align: center; box-shadow: var(--shadow); }
.word-front { background: linear-gradient(135deg, var(--coral), var(--peach)); color: var(--ink); font-family: var(--font-head); font-weight: 800; font-size: 1.5rem; }
.word-back { background: var(--cream); color: var(--ink); transform: rotateY(180deg); font-weight: 700; font-size: .98rem; }
.next-stage { margin-top: 36px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.next-stage p { margin: 0; font-weight: 800; font-size: 1.15rem; }

/* Animal dialog */
.animal-dialog { width: min(920px, 96vw); max-height: 92vh; padding: 0; border: 0; border-radius: 28px; background: var(--cream); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.animal-dialog::backdrop { background: rgba(10, 6, 40, .75); backdrop-filter: blur(4px); }
.dlg-inner { position: relative; display: grid; grid-template-columns: 1fr 1.15fr; }
.dlg-art img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; background: var(--purple-2); }
.dlg-info { padding: 24px 26px; }
.dlg-info h2 { font-size: 2.4rem; color: var(--purple); margin: 0; }
.dlg-char { margin: 0; font-weight: 800; color: var(--coral); text-transform: uppercase; letter-spacing: .05em; font-size: .9rem; }
.dlg-hello { font-style: italic; background: #f1ebff; padding: 8px 12px; border-radius: 12px; font-weight: 700; }
.facts { display: grid; gap: 8px; margin: 12px 0; }
.facts div { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }
.facts dt { font-weight: 800; }
.facts dd { margin: 0; }
.dlg-label { font-weight: 800; margin: 8px 0 4px; }
.vocab { display: flex; flex-wrap: wrap; gap: 6px; }
.vocab span { background: var(--turq); color: var(--ink); padding: 4px 12px; border-radius: 99px; font-weight: 800; font-size: .95rem; }
.fun-fact { background: #fff3c4; border-left: 6px solid var(--gold); padding: 10px 12px; border-radius: 12px; }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.dlg-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-size: 1.2rem; cursor: pointer; }
@media (max-width: 720px) {
  .dlg-inner { grid-template-columns: 1fr; }
  .dlg-art img { min-height: 0; aspect-ratio: 16/10; object-position: 50% 30%; }
  .dlg-info h2 { font-size: 1.9rem; }
}

/* ---------- Games ---------- */
.game { background: var(--cream); color: var(--ink); border-radius: 30px; box-shadow: var(--shadow); overflow: hidden; }
.g-stage { padding: clamp(18px, 4vw, 36px); }
.g-intro { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; background: linear-gradient(135deg, var(--purple) 0%, var(--purple-2) 60%, var(--coral) 140%); color: var(--cream); }
.g-intro .g-host { width: clamp(150px, 22vw, 240px); aspect-ratio: 1; border-radius: 50%; object-fit: cover; border: 6px solid var(--gold); box-shadow: 0 0 0 10px rgba(255, 210, 63, .2), var(--shadow); animation: bob 4s ease-in-out infinite; }
.g-intro h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); color: var(--gold); margin: 0; text-shadow: 0 4px 0 rgba(0, 0, 0, .25); }
.g-intro .g-desc { font-size: 1.15rem; font-weight: 700; }
.g-intro .bubble { color: var(--ink); }
.g-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.howto { margin-top: 18px; background: rgba(255, 255, 255, .12); border: 2px dashed rgba(255, 255, 255, .5); border-radius: 18px; padding: 14px 18px; }
.howto h2 { font-size: 1.5rem; margin: 0 0 6px; color: var(--turq); }
.howto ol { margin: 0; padding-left: 1.3em; }
.howto li { margin: 4px 0; font-weight: 700; }
@media (max-width: 700px) { .g-intro { grid-template-columns: 1fr; text-align: center; } .g-intro .g-host { margin: 0 auto; } .g-buttons { justify-content: center; } .howto { text-align: left; } .g-intro .bubble::before { display: none; } }

.g-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; justify-content: space-between; padding: 14px clamp(18px, 4vw, 36px); background: var(--purple); color: var(--cream); }
.g-progress { font-family: var(--font-head); font-weight: 800; font-size: 1.25rem; }
.g-score { background: var(--gold); color: var(--ink); font-weight: 800; padding: 4px 14px; border-radius: 99px; }
.g-top .pbar { flex: 1 1 200px; height: 14px; background: rgba(255, 255, 255, .2); }
.g-quit { color: var(--lavender); font-weight: 800; background: none; border: 0; text-decoration: underline; cursor: pointer; min-height: 40px; }
.g-question { font-size: clamp(1.5rem, 3.6vw, 2.2rem); text-align: center; color: var(--purple); margin: 4px 0 18px; }
.g-mini-host { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 14px; }
.g-mini-host img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); }
.g-mini-host .bubble { margin: 0; background: #f1ebff; box-shadow: none; }
.g-mini-host .bubble::before { border-right-color: #f1ebff; top: 14px; }
.host-cheer img { animation: hop .6s ease; }

.vs-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; max-width: 820px; margin: 0 auto; }
.vs-badge { font-family: var(--font-head); font-weight: 800; font-size: 2rem; color: #fff; background: var(--coral); width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; box-shadow: var(--shadow); }
.choice-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 820px) { .choice-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .vs-row { grid-template-columns: 1fr 1fr; } .vs-badge { display: none; } }

.choice { position: relative; display: flex; flex-direction: column; align-items: stretch; padding: 0; border: 4px solid #e2d8ff; border-radius: 22px; background: #fff; color: var(--ink); cursor: pointer; overflow: hidden; text-align: center; transition: transform .15s, border-color .15s, box-shadow .15s; box-shadow: 0 6px 0 #d8ccf9; }
.choice:hover:not([disabled]) { transform: translateY(-4px); border-color: var(--turq); }
.choice img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--purple-2); }
.choice .c-name { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; padding: 8px; }
.choice[disabled] { cursor: default; }
.choice.correct { border-color: var(--ok); box-shadow: 0 6px 0 #138a5a, 0 0 0 6px rgba(31, 169, 113, .25); }
.choice.wrong { border-color: var(--bad); box-shadow: 0 6px 0 #b02a40; }
.choice.dim { opacity: .5; }
.choice .mark { position: absolute; top: 8px; right: 8px; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; font-weight: 900; color: #fff; }
.choice.correct .mark { background: var(--ok); }
.choice.wrong .mark { background: var(--bad); }

.text-choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; max-width: 860px; margin: 0 auto; }
@media (max-width: 600px) { .text-choices { grid-template-columns: 1fr; } }
.text-choice { min-height: 70px; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 16px; text-align: left; font-weight: 800; font-size: 1.15rem; }
.text-choice .letter { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--lavender); color: var(--ink); font-family: var(--font-head); }
.text-choice .mark { top: 50%; transform: translateY(-50%); }

.clues { max-width: 720px; margin: 0 auto 18px; display: grid; gap: 10px; padding: 0; list-style: none; }
.clues li { background: #f1ebff; border-radius: 14px; padding: 10px 14px 10px 50px; position: relative; font-weight: 800; font-size: 1.15rem; }
.clues li::before { content: '🔎'; position: absolute; left: 14px; }
.clues li.hint-clue { background: #fff3c4; }
.clues li.hint-clue::before { content: '💡'; }
.clue-tools { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }

.feedback { max-width: 820px; margin: 22px auto 0; border-radius: 18px; padding: 14px 18px; font-weight: 700; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; animation: pop .35s ease; }
.feedback.good { background: #d9f7e8; border: 3px solid var(--ok); }
.feedback.bad { background: #ffe1e6; border: 3px solid var(--bad); }
.feedback .fb-ico { font-size: 2.2rem; }
.feedback .fb-title { font-family: var(--font-head); font-size: 1.4rem; margin: 0; }
.feedback p { margin: 0; }
@media (max-width: 640px) { .feedback { grid-template-columns: auto 1fr; } .feedback .btn { grid-column: 1 / -1; } }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

.results { text-align: center; }
.results h1 { color: var(--purple); font-size: clamp(2rem, 5vw, 3rem); margin: 6px 0; }
.res-host { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; margin: 0 auto; border: 5px solid var(--gold); animation: hop 1s ease 2; }
.res-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 760px; margin: 18px auto; }
@media (max-width: 600px) { .res-stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: #f1ebff; border-radius: 18px; padding: 12px; }
.stat b { display: block; font-family: var(--font-head); font-size: 2rem; color: var(--purple); }
.stat.ok b { color: var(--ok); } .stat.no b { color: var(--bad); }
.res-msg { font-size: 1.25rem; font-weight: 800; }
.review { max-width: 860px; margin: 22px auto; text-align: left; }
.review h2 { text-align: center; color: var(--purple); }
.review ol { padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: r; }
.review li { counter-increment: r; background: #fff; border-radius: 14px; padding: 12px 14px 12px 56px; position: relative; border-left: 6px solid var(--ok); box-shadow: 0 3px 10px rgba(0, 0, 0, .06); }
.review li.no { border-left-color: var(--bad); }
.review li::before { content: counter(r); position: absolute; left: 14px; top: 12px; width: 30px; height: 30px; border-radius: 50%; background: var(--lavender); display: grid; place-items: center; font-weight: 800; }
.review .rq { font-weight: 800; margin: 0 0 4px; }
.review .ra { margin: 0; font-size: .96rem; }
.review .ra .y { color: var(--ok); font-weight: 800; } .review .ra .n { color: var(--bad); font-weight: 800; }

/* ---------- Missions ---------- */
.star-board { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; }
@media (max-width: 760px) { .star-board { grid-template-columns: 1fr; text-align: center; } .stars { justify-content: center; } }
.stars { display: flex; gap: 6px; }
.star { font-size: 3rem; color: #d7cdf3; transition: color .3s, transform .3s; line-height: 1; }
.star.on { color: var(--gold); text-shadow: 0 0 16px rgba(255, 210, 63, .9); animation: starPop .6s ease; }
@keyframes starPop { 40% { transform: scale(1.5) rotate(20deg); } }
.star-count { margin: 0 0 6px; font-weight: 800; font-size: 1.15rem; }
.star-msg { margin: 6px 0 0; font-weight: 800; color: var(--purple); }
.celebrate { margin-top: 16px; text-align: center; background: linear-gradient(135deg, #fff3c4, #ffd9e2); border: 4px solid var(--gold); }
.celebrate-big { font-family: var(--font-head); font-size: clamp(1.6rem, 4vw, 2.4rem); color: var(--purple); margin: 0; }

.mission-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; }
.mission-tabs button { flex: 1 1 140px; min-height: 54px; border: 0; border-radius: 18px 18px 0 0; background: rgba(255, 255, 255, .14); color: var(--cream); font-family: var(--font-head); font-weight: 800; font-size: 1.15rem; cursor: pointer; }
.mission-tabs button[aria-selected="true"] { background: var(--cream); color: var(--ink); }
.mission-tabs button.done::after { content: ' ⭐'; }
.mission { border-top-left-radius: 0; }
.m-head { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; margin-bottom: 16px; }
.m-head img { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 4px solid var(--gold); }
.m-head h2 { color: var(--purple); font-size: 1.9rem; margin: 0; }
.m-goal { display: inline-block; background: var(--turq); padding: 3px 12px; border-radius: 99px; font-weight: 800; font-size: .95rem; margin: 4px 0; }
.m-example { background: #f1ebff; border-radius: 14px; padding: 10px 14px; font-weight: 700; }
.m-activity { margin: 16px 0; }
.m-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; border-top: 2px dashed #d8ccf9; padding-top: 16px; }
.m-status { font-weight: 800; }
.m-status.ok { color: var(--ok); }
@media (max-width: 540px) { .m-head { grid-template-columns: 1fr; text-align: center; } .m-head img { margin: 0 auto; } }

.riddle { display: grid; gap: 10px; background: #fff; border-radius: 18px; padding: 14px; margin-bottom: 12px; border: 3px solid #e2d8ff; }
.riddle.solved { border-color: var(--ok); background: #effbf5; }
.riddle-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.riddle-text { font-weight: 800; background: #fff3c4; padding: 8px 12px; border-radius: 12px; }
.riddle .mini-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.mini { display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: 999px; border: 3px solid #e2d8ff; background: #fff; cursor: pointer; font-weight: 800; min-height: 52px; color: var(--ink); }
.mini img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.mini.correct { border-color: var(--ok); background: #d9f7e8; }
.mini.wrong { border-color: var(--bad); background: #ffe1e6; }
.mini[disabled] { cursor: default; }
.r-msg { font-weight: 800; margin: 0; }

.frame { font-size: 1.25rem; font-weight: 800; background: #fff; border-radius: 16px; padding: 14px 16px; border: 3px solid #e2d8ff; }
.frame mark { background: #fff3c4; padding: 0 6px; border-radius: 6px; color: var(--purple); }
.speak-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; align-items: center; }
.picker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.picker .mini[aria-pressed="true"] { border-color: var(--gold); background: #fff3c4; }

.passage { background: #fff; border-radius: 16px; padding: 16px 20px; border: 3px solid #e2d8ff; font-size: 1.15rem; }
.passage p { margin: 0 0 8px; }
.tf { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: #fff; padding: 10px 14px; border-radius: 14px; margin-top: 10px; border: 3px solid #e2d8ff; }
.tf.solved { border-color: var(--ok); background: #effbf5; }
.tf p { margin: 0; font-weight: 800; }
.tf .tf-btns { display: flex; gap: 8px; }
.tf .tf-msg { grid-column: 1 / -1; margin: 0; font-weight: 700; }
@media (max-width: 520px) { .tf { grid-template-columns: 1fr; } }

.bank { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px; background: #f1ebff; border-radius: 16px; min-height: 74px; }
.tile { min-height: 46px; padding: 6px 16px; border-radius: 12px; border: 0; background: linear-gradient(180deg, #ffe373, var(--gold)); color: var(--ink); font-weight: 800; font-size: 1.1rem; cursor: grab; box-shadow: 0 4px 0 #c9a21c; touch-action: none; }
.tile.selected { outline: 4px solid var(--purple); }
.tile.dragging { opacity: .5; }
.sentences { display: grid; gap: 12px; margin: 14px 0; padding: 0; list-style: none; }
.sentences li { font-size: 1.2rem; font-weight: 800; background: #fff; border-radius: 14px; padding: 12px 14px; border: 3px solid #e2d8ff; line-height: 2.2; }
.sentences li.ok { border-color: var(--ok); background: #effbf5; }
.sentences li.no { border-color: var(--bad); }
.slot { display: inline-flex; align-items: center; justify-content: center; min-width: 120px; min-height: 44px; margin: 0 4px; vertical-align: middle; border-radius: 12px; border: 3px dashed var(--purple-2); background: #f7f3ff; color: var(--purple); font-weight: 800; font-size: 1.05rem; cursor: pointer; padding: 2px 10px; }
.slot.filled { border-style: solid; background: #fff3c4; }
.slot.over { background: #d9f7e8; border-color: var(--ok); }
.write-own { margin-top: 16px; }
.write-own label { font-weight: 800; display: block; margin-bottom: 6px; }
.write-own textarea { width: 100%; min-height: 80px; border-radius: 14px; border: 3px solid #e2d8ff; padding: 10px 12px; font: inherit; }
.checklist { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-weight: 700; }
.checklist li::before { content: '○ '; color: var(--ink-soft); }
.checklist li.ok { color: var(--ok); }
.checklist li.ok::before { content: '✔ '; }

/* ---------- Feedback form ---------- */
.feedback-form { display: grid; gap: 18px; }
.form-note { margin: 0; background: #f1ebff; padding: 10px 14px; border-radius: 12px; font-weight: 700; }
.req { color: var(--bad); }
.opt { color: var(--ink-soft); font-weight: 600; font-size: .9em; }
.q { border: 0; margin: 0; padding: 0; }
.q legend, .q > label { font-weight: 800; font-size: 1.1rem; margin-bottom: 8px; padding: 0; }
.q > label { display: block; }
.q input[type="text"], .q textarea { width: 100%; border-radius: 14px; border: 3px solid #e2d8ff; padding: 12px 14px; font: inherit; color: var(--ink); background: #fff; }
.q input[type="text"]:focus, .q textarea:focus { border-color: var(--turq); outline: none; }
.opts { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 16px; border-radius: 999px; border: 3px solid #e2d8ff; background: #fff; cursor: pointer; font-weight: 800; }
.pill input { width: 20px; height: 20px; accent-color: var(--purple-2); }
.pill:has(input:checked) { border-color: var(--purple-2); background: #efe8ff; }
.pill:has(input:focus-visible) { outline: 4px solid var(--gold); outline-offset: 2px; }
.rating { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.rating input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating label { font-size: 2.8rem; line-height: 1; color: #d7cdf3; cursor: pointer; padding: 0 2px; transition: transform .15s, color .15s; }
.rating label:hover, .rating label:hover ~ label, .rating input:checked ~ label { color: var(--gold); }
.rating label:hover { transform: scale(1.15); }
.rating input:focus-visible + label { outline: 4px solid var(--purple-2); border-radius: 8px; }
.err { display: none; color: var(--bad); font-weight: 800; margin: 6px 0 0; }
.q.invalid .err { display: block; }
.q.invalid .opts .pill, .q.invalid .rating { border-color: var(--bad); }
.hidden-field { position: absolute; left: -9999px; }
.form-status:empty { display: none; }
.form-status { padding: 14px 16px; border-radius: 14px; font-weight: 800; }
.form-status.sending { background: #f1ebff; }
.form-status.ok { background: #d9f7e8; border: 3px solid var(--ok); }
.form-status.fail { background: #ffe1e6; border: 3px solid var(--bad); }

/* ---------- Footer & toast ---------- */
.footer { background: rgba(10, 8, 36, .7); border-top: 2px solid rgba(255, 210, 63, .25); color: var(--lavender); font-size: .95rem; }
.footer .wrap { padding: 26px 0; }
.footer p { margin: 0 0 6px; }
.footer-brand { font-family: var(--font-head); font-size: 1.3rem; color: var(--gold); }
.credits summary { cursor: pointer; font-weight: 800; color: var(--cream); min-height: 40px; display: inline-flex; align-items: center; }
.credits ul { margin: 6px 0 0; padding-left: 1.2em; }
.credits li { margin: 4px 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: var(--gold); color: var(--ink); padding: 12px 22px; border-radius: 999px; font-weight: 800; box-shadow: var(--shadow); transition: transform .35s ease; z-index: 80; max-width: 92vw; text-align: center; }
.toast.show { transform: translate(-50%, 0); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .notes, .spotlights { display: none; }
}
