/* Amazing Animals quiz — warm modern app design (matches artifact) */
:root {
  --radius: 22px;
  --font: "Nunito", ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
[data-theme="light"] {
  --bg: #f2efe3;
  --card: #ffffff;
  --ink: #1f2d26;
  --muted: #7d8474;
  --deep: #22392b;
  --deep-ink: #f4f1e6;
  --lime: #b9e72f;
  --track: #e4ddc6;
  --chip: #f0ebda;
  --line: #e7e1cd;
  --green: #2e9e5b;
  --green-bg: #e2f3e8;
  --red: #df5b4f;
  --red-bg: #fbe9e6;
  --shadow: 0 14px 34px rgba(70, 58, 20, .10);
  --shadow-sm: 0 4px 14px rgba(70, 58, 20, .08);
}
[data-theme="dark"] {
  --bg: #0f1a13;
  --card: #182619;
  --ink: #eef3e6;
  --muted: #93a08d;
  --deep: #b9e72f;
  --deep-ink: #1c2a12;
  --lime: #b9e72f;
  --track: #2a3a2c;
  --chip: #243420;
  --line: #2a3a2c;
  --green: #4ade80;
  --green-bg: #1d3527;
  --red: #ff8a7a;
  --red-bg: #3a211d;
  --shadow: 0 14px 34px rgba(0, 0, 0, .45);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(440px 440px at 108% -6%, color-mix(in srgb, var(--lime) 30%, transparent), transparent 70%),
    radial-gradient(400px 400px at -12% 106%, color-mix(in srgb, var(--green) 24%, transparent), transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font); min-height: 100dvh;
  display: flex; flex-direction: column;
  transition: background-color .25s ease, color .25s ease;
  font-weight: 600;
}
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
main { flex: 1; width: 100%; max-width: 1020px; margin: 0 auto; padding: 14px 18px 30px; }
.screen { display: none; }
.screen.active { display: block; animation: screenin .38s cubic-bezier(.22,1,.36,1); }
@keyframes screenin { from { opacity: 0; transform: translateY(14px) scale(.995); } to { opacity: 1; transform: none; } }

/* ---------- start: app layout with sidebar ---------- */
#screen-start .app {
  display: grid; grid-template-columns: 296px minmax(0, 1fr); gap: 26px;
  max-width: 1120px; margin: 0 auto; align-items: start;
}
.side {
  background: var(--card); border: 1px solid var(--line); border-radius: 26px;
  box-shadow: var(--shadow); padding: 18px 14px 14px;
  position: sticky; top: 14px; max-height: calc(100dvh - 28px);
  display: flex; flex-direction: column;
}
.side-brand { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 12px; }
.side-brand .icon-btn { width: 38px; height: 38px; font-size: 1rem; }
.side-label {
  font-size: .68rem; font-weight: 1000; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); margin: 2px 6px 8px;
}
.side-foot { margin-top: auto; padding: 10px 6px 0; border-top: 1px solid var(--line); text-align: center; }
.side-foot .linklike { margin-top: 6px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.02rem; letter-spacing: -.01em; cursor: pointer; }
.logo-icon { width: 30px; height: 30px; border-radius: 9px; box-shadow: var(--shadow-sm); }
/* floating logo: no badge background, the icon floats on its own */
.logo-icon.logo-float { border-radius: 0; box-shadow: none; filter: drop-shadow(0 3px 7px rgba(0,0,0,.20)); }
.icon-btn {
  background: var(--card); border: 1px solid var(--line); color: var(--ink);
  width: 42px; height: 42px; border-radius: 50%; font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm);
  font-family: var(--font);
}
.icon-btn:active { transform: scale(.92); }

/* per-quiz accent color */
.quiz-pick[data-quiz="animals"], body[data-quiz="animals"] .hero-main { --acc: #2e9e5b; }
.quiz-pick[data-quiz="flags"], body[data-quiz="flags"] .hero-main { --acc: #3b82f6; }
.quiz-pick[data-quiz="mountains"], body[data-quiz="mountains"] .hero-main { --acc: #8b5cf6; }
.quiz-pick[data-quiz="waters"], body[data-quiz="waters"] .hero-main { --acc: #0ea5e9; }
.quiz-pick[data-quiz="flowers"], body[data-quiz="flowers"] .hero-main { --acc: #ec4899; }
.quiz-pick[data-quiz="landmarks"], body[data-quiz="landmarks"] .hero-main { --acc: #f59e0b; }
.quiz-pick[data-quiz="countries"], body[data-quiz="countries"] .hero-main { --acc: #6366f1; }
.quiz-pick[data-quiz="paintings"], body[data-quiz="paintings"] .hero-main { --acc: #e11d48; }
.quiz-pick[data-quiz="trees"], body[data-quiz="trees"] .hero-main { --acc: #84cc16; }
.quiz-pick[data-quiz="mushrooms"], body[data-quiz="mushrooms"] .hero-main { --acc: #ef4444; }
.quiz-pick[data-quiz="anagrams"], body[data-quiz="anagrams"] .hero-main { --acc: #f97316; }

.quiz-picker { display: flex; flex-direction: column; gap: 8px; margin: -6px -8px 6px; padding: 6px 8px 10px; overflow-y: auto; }
.quiz-pick {
  display: flex; flex-direction: row; align-items: center; gap: 12px; text-align: left;
  padding: 10px 12px; border-radius: 18px; cursor: pointer;
  background: transparent; border: 2px solid transparent;
  font-family: var(--font); color: var(--ink);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.quiz-pick:hover { background: var(--chip); transform: translateX(2px); }
.quiz-pick:active { transform: scale(.98); }
.quiz-pick.active {
  background: var(--card); border-color: var(--acc);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 22%, transparent),
              0 10px 24px color-mix(in srgb, var(--acc) 18%, transparent);
}
.qp-tile {
  flex: none; width: 46px; height: 46px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
  background: color-mix(in srgb, var(--acc) 15%, var(--card));
  transition: transform .25s var(--ease-spring);
}
.qp-tile img { width: 36px; height: 36px; object-fit: contain; }
.quiz-pick.active .qp-tile { transform: scale(1.1) rotate(-4deg); }
.qp-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.qp-name { font-weight: 900; font-size: .98rem; letter-spacing: -.01em; white-space: nowrap; }
.qp-sub { font-size: .76rem; color: var(--muted); font-weight: 700; }

.hero-main { text-align: center; padding: 6px 8px 0; max-width: 640px; margin: 0 auto; width: 100%; }
.hero-art {
  width: 128px; height: 128px; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  background: none; box-shadow: none;
}
.hero-emoji { font-size: 3.6rem; filter: drop-shadow(0 8px 18px rgba(0,0,0,.12)); animation: float 3.2s ease-in-out infinite; }
.hero-emoji .hero-icon { width: 84px; height: 84px; border-radius: 22px; display: block; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.hero-main h1 { font-size: clamp(2.3rem, 4.6vw, 3.1rem); font-weight: 1000; margin: .3em 0 .25em; letter-spacing: -.03em; line-height: 1.04; }
.hero-main h1 em { font-style: normal; }
.tagline { color: var(--muted); margin: 0 auto 1.2em; line-height: 1.6; max-width: 38ch; font-weight: 700; }
.stats { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 10px 20px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
}
.stat b { font-size: 1.4rem; font-weight: 1000; color: var(--ink); }
.stat span { font-size: .7rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.menu { display: grid; gap: 12px; margin-bottom: 14px; }

/* ---------- start: mobile (sidebar becomes a top bar) ---------- */
@media (max-width: 899px) {
  #screen-start .app { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .side, .hero-main { min-width: 0; }
  .side { position: static; max-height: none; padding: 12px 12px 10px; border-radius: 22px; }
  .side-brand { padding-bottom: 10px; }
  .side-label { display: none; }
  .quiz-picker {
    flex-direction: row; overflow-x: auto; overflow-y: hidden;
    padding: 6px 8px 10px; margin-bottom: 0; min-width: 0;
    scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  }
  .quiz-pick { flex: 0 0 auto; scroll-snap-align: start; }
  .quiz-pick:hover { transform: translateY(-1px); }
  .qp-tile { width: 40px; height: 40px; border-radius: 13px; font-size: 1.3rem; }
  .qp-tile img { width: 32px; height: 32px; }
  .side-foot { border-top: none; margin-top: 4px; padding-top: 4px; }
  .hero-art { width: 104px; height: 104px; border-radius: 30px; }
  .hero-emoji { font-size: 3rem; }
  .hero-emoji .hero-icon { width: 68px; height: 68px; border-radius: 18px; }
  .beast-block { margin-top: 18px; }
}

.btn {
  appearance: none; border: 2px solid transparent; background: var(--card); color: var(--ink);
  font-family: var(--font); font-size: 1.02rem; font-weight: 900;
  padding: 15px 22px; border-radius: 18px; cursor: pointer; width: 100%;
  box-shadow: var(--shadow-sm);
  transition: transform .1s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--deep); color: var(--deep-ink); }
.btn.big { font-size: 1.12rem; padding: 17px 22px; }
.btn.next { background: var(--deep); color: var(--deep-ink); }
.q-nav-row { display: flex; gap: 10px; margin-top: 14px; }
.q-nav-row .btn { width: auto; margin-top: 0; }
.q-nav-row .btn.next { flex: 1; }
.btn.back { background: var(--card); color: var(--ink); border: 2px solid var(--line); padding-left: 18px; padding-right: 18px; flex: 0 0 auto; }
.best { color: var(--muted); margin: 14px 0; font-weight: 800; }
.best b { color: var(--ink); }
.linklike { background: none; border: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: .95rem; font-weight: 800; margin-top: 16px; font-family: var(--font); }

/* ---------- ads ---------- */
.ad-wrap {
  margin: 20px auto 4px; min-height: 96px; max-width: 100%;
  background: var(--card); border: 2px dashed var(--line); border-radius: 16px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.ad-wrap:empty::after { content: "advertisement"; color: var(--muted); opacity: .55; font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }

/* ---------- quiz top row ---------- */
.quiz-top { display: flex; align-items: center; gap: 12px; margin: 2px 0 16px; }
.round-label { font-weight: 1000; font-size: .98rem; white-space: nowrap; letter-spacing: -.01em; }
.progress { flex: 1; height: 12px; background: var(--track); border-radius: 999px; overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, #9ed62a, var(--lime));
  transition: width .35s ease;
}
.score-pill {
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; font-weight: 1000; font-size: .95rem; box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

/* ---------- quiz card ---------- */
.quiz-card {
  background: var(--card); border-radius: 28px; box-shadow: var(--shadow);
  overflow: hidden; display: grid; grid-template-columns: 1fr;
  border: 1px solid var(--line);
}
@media (min-width: 760px) {
  .quiz-card { grid-template-columns: 1.35fr 1fr; }
  .quiz-card .photo-wrap { aspect-ratio: auto; align-self: stretch; min-height: 440px; }
  .quiz-card #q-photo { max-width: 94%; max-height: 90%; }
}
.photo-wrap {
  position: relative; margin: 0; aspect-ratio: 16/10; overflow: hidden; background: #20241f;
  display: flex; align-items: center; justify-content: center;
}
/* quotes-round stage: the quotation itself is the visual */
.quote-wrap {
  position: relative; margin: 0; aspect-ratio: 16/10; overflow: hidden; background: var(--deep);
  display: flex; align-items: center; justify-content: center; padding: 44px 34px 30px;
}
.quote-text {
  margin: 0; font-family: Georgia, 'Times New Roman', serif; font-style: italic;
  font-size: clamp(1.12rem, 1rem + 1.4vw, 1.65rem); line-height: 1.5;
  color: var(--deep-ink); text-align: center; max-width: 32em;
}
.quote-text::before { content: ''; }
/* start-screen teaser cards for the quotes quiz (quote only — the speaker stays hidden) */
.beast-quote {
  margin: 0; padding: 14px 12px; font-family: Georgia, 'Times New Roman', serif; font-style: italic;
  font-size: .8rem; line-height: 1.5; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
/* round mode picker (replaces the old single glow button) */
.mode-label { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 12px 2px 8px; }
.mode-picker { display: flex; gap: 8px; margin-bottom: 14px; }
.mode-btn { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 10px 6px 9px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-family: var(--font); cursor: pointer; transition: transform .15s var(--ease-spring), border-color .15s, background .15s; }
.mode-btn .m-icon { font-size: 1.35rem; line-height: 1.25; }
.mode-btn .m-name { font-weight: 800; font-size: .82rem; white-space: nowrap; }
.mode-btn .m-desc { font-size: .68rem; color: var(--muted); white-space: nowrap; }
.mode-btn[aria-pressed="true"] { border-color: var(--lime); background: color-mix(in srgb, var(--lime) 16%, var(--card)); }
.mode-btn:active { transform: scale(.95); }
.mode-tip { font-size: .85rem; color: var(--muted); font-weight: 700; text-align: center; margin: -4px 0 12px; }
/* sound-round stage */
.sound-wrap { position: relative; margin: 0; aspect-ratio: 16/10; overflow: hidden; background: var(--deep); display: flex; align-items: center; justify-content: center; }
.sound-player { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 32px 20px; }
.sound-play { width: 118px; height: 118px; border-radius: 50%; border: none; background: var(--lime); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 8px 30px rgba(0,0,0,.35); transition: transform .15s var(--ease-spring); -webkit-tap-highlight-color: transparent; }
.sound-play:active { transform: scale(.92); }
.eq { display: flex; align-items: flex-end; gap: 5px; height: 44px; }
.eq i { width: 7px; border-radius: 4px; background: #22392b; height: 26%; }
.sound-play.playing .eq i { animation: eqb .9s ease-in-out infinite; }
.sound-play.playing .eq i:nth-child(2) { animation-delay: .15s; }
.sound-play.playing .eq i:nth-child(3) { animation-delay: .3s; }
.sound-play.playing .eq i:nth-child(4) { animation-delay: .45s; }
@keyframes eqb { 0%, 100% { height: 22%; } 50% { height: 100%; } }
@media (prefers-reduced-motion: reduce) { .sound-play.playing .eq i { animation: none; height: 60%; } }
.sound-hint { color: var(--deep-ink); opacity: .7; font-size: .85rem; font-weight: 700; }
.sound-credit { font-size: .72rem; color: var(--deep-ink); opacity: .55; text-align: center; }
.sound-credit a { color: inherit; }
.sound-reveal { position: absolute; inset: 0; }
.sound-reveal img { width: 100%; height: 100%; object-fit: cover; display: block; animation: photoin .45s ease; }
.sound-reveal .reveal-credit { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 10px; background: linear-gradient(transparent, rgba(0,0,0,.55)); opacity: .9; }
.reveal-replay { position: absolute; left: 12px; bottom: 34px; z-index: 2; width: 46px; height: 46px; border-radius: 50%; border: none; background: rgba(0,0,0,.55); color: #fff; font-size: 1.25rem; display: flex; align-items: center; justify-content: center; cursor: pointer; backdrop-filter: blur(4px); -webkit-tap-highlight-color: transparent; transition: transform .15s var(--ease-spring); }
.reveal-replay:active { transform: scale(.9); }
@media (min-width: 760px) {
  .quiz-card .sound-wrap { aspect-ratio: auto; align-self: stretch; min-height: 440px; }
}
.photo-bg {
  position: absolute; inset: -26px; width: calc(100% + 52px); height: calc(100% + 52px);
  object-fit: cover; filter: blur(26px) saturate(1.35) brightness(.9); pointer-events: none;
}
#q-photo {
  position: relative; z-index: 1; max-width: 88%; max-height: 80%;
  border-radius: 18px; box-shadow: 0 14px 34px rgba(0,0,0,.38);
  animation: photoin .4s ease;
}
@keyframes photoin { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
.q-count {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  background: rgba(20, 26, 20, .72); color: #fff;
  font-weight: 900; font-size: .85rem; padding: 7px 14px; border-radius: 999px;
  backdrop-filter: blur(4px);
}
.photo-credit {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 26px 16px 12px; font-size: .78rem; font-weight: 700; color: #fff;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.62));
}
.photo-credit a { color: #fff; }

.quiz-body { padding: 26px 24px; display: flex; flex-direction: column; }
.prompt { font-size: 1.65rem; font-weight: 1000; letter-spacing: -.02em; margin: 0 0 16px; line-height: 1.15; }

.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 13px;
  text-align: left; font-family: var(--font); font-size: 1.02rem; font-weight: 800;
  background: var(--card); border: 2px solid var(--line); color: var(--ink);
  padding: 11px 14px 11px 11px; border-radius: 16px; cursor: pointer;
  transition: transform .1s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.option:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.option:active:not(:disabled) { transform: scale(.98); }
.option:disabled { cursor: default; }
.opt-letter {
  flex: none; width: 38px; height: 38px; border-radius: 12px;
  background: var(--chip); display: flex; align-items: center; justify-content: center;
  font-size: .95rem; font-weight: 1000; color: var(--ink);
}
.option.correct {
  background: var(--green-bg); border-color: var(--green); animation: pop .3s ease;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 22%, transparent), var(--shadow-sm);
}
.option.correct .opt-letter { background: var(--green); color: #fff; }
.option.wrong { background: var(--red-bg); border-color: var(--red); animation: shake .3s ease; }
.option.wrong .opt-letter { background: var(--red); color: #fff; }
.option.dim { opacity: .45; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.025); } 100% { transform: scale(1); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------- fact card ---------- */
.fact {
  margin-top: 16px; background: var(--chip);
  border-radius: 20px; padding: 20px;
  animation: fadein .3s ease;
}
.fact-title { font-size: 1.12rem; font-weight: 1000; margin-bottom: 6px; letter-spacing: -.01em; }
.fact-text { line-height: 1.6; margin: 0 0 8px; font-size: .99rem; font-weight: 600; }
.fact-sci { font-style: italic; color: var(--muted); font-weight: 700; font-size: .92rem; }

/* ---------- quiz nav pills ---------- */
.quiz-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; align-items: center; }
.quiz-nav .icon-btn { width: 46px; height: 46px; }
.results-home-row { display: flex; gap: 10px; align-items: stretch; }
.results-home-row .btn.big { flex: 1; margin-top: 0; }
.results-home-row .icon-btn { flex: none; }
.pill-btn {
  appearance: none; font-family: var(--font); font-weight: 1000; font-size: .95rem;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  padding: 12px 22px; border-radius: 999px; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform .1s ease, box-shadow .15s ease;
}
.pill-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.pill-btn:active { transform: scale(.96); }
.pill-btn.solid { background: var(--deep); color: var(--deep-ink); border-color: transparent; }

/* ---------- results ---------- */
.results-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 28px;
  box-shadow: var(--shadow); text-align: center; padding: 34px 26px; max-width: 560px; margin: 2vh auto 0;
}
.results-emoji { font-size: 4rem; animation: float 3s ease-in-out infinite; }
.results-card h2 { font-size: 1.9rem; font-weight: 1000; letter-spacing: -.02em; margin: .4em 0 .1em; }
.score-big { font-size: 4.6rem; font-weight: 1000; letter-spacing: -.04em; line-height: 1; margin: .12em 0 .3em; color: var(--green); }
.score-total { font-size: 1.9rem; color: var(--muted); font-weight: 800; }
.results-msg { color: var(--muted); line-height: 1.6; margin: 0 auto 1.3em; max-width: 34ch; font-weight: 700; }

/* ---------- start page: sell it ---------- */
.eyebrow {
  display: inline-block; font-size: .72rem; font-weight: 1000; letter-spacing: .16em;
  text-transform: uppercase; color: var(--deep-ink); background: var(--deep);
  padding: 8px 16px; border-radius: 999px; margin: 4px 0 2px;
}
.beast-block { margin: 22px 0 4px; text-align: center; }
.beast-head h2 { font-size: 1.25rem; font-weight: 1000; letter-spacing: -.02em; margin: 0 0 4px; }
.beast-head p { color: var(--muted); font-weight: 700; margin: 0 0 10px; font-size: .95rem; }
.beast-strip {
  display: flex; gap: 12px; overflow-x: auto; padding: 6px 2px 14px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; text-align: left;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 35%, transparent) transparent;
}
.beast-strip::-webkit-scrollbar { height: 6px; }
.beast-strip::-webkit-scrollbar-track { background: transparent; }
.beast-strip::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 35%, transparent);
  border-radius: 999px;
}
.beast-strip::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--muted) 60%, transparent);
}
.beast-card {
  flex: 0 0 148px; scroll-snap-align: start; background: var(--card);
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.beast-card img { width: 148px; height: 108px; object-fit: cover; display: block; background: #111; }
.beast-card span { display: block; padding: 9px 10px; font-weight: 900; font-size: .8rem; text-align: center; }
/* anagram start screen: word chips instead of photo cards */
.beast-card.word-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 16px 8px; min-height: 108px; }
.beast-card.word-chip b { font-weight: 1000; font-size: 1rem; text-align: center; line-height: 1.2; }
.beast-card.word-chip span { padding: 0; font-size: .68rem; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }

/* ---------- credits ---------- */
.credits-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 28px;
  box-shadow: var(--shadow); padding: 26px 22px; max-width: 640px; margin: 0 auto;
}
.credits-top {
  position: sticky; top: 10px; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--card); padding: 6px 0; margin: -6px 0 6px;
}
.credits-card h2 { font-weight: 1000; letter-spacing: -.02em; margin: 0 0 6px; }
.credits-top h2 { margin: 0; }
.muted { color: var(--muted); line-height: 1.6; font-weight: 700; }
.credits { display: grid; gap: 10px; margin: 16px 0 20px; text-align: left; }
.credit {
  display: grid; grid-template-columns: 60px 1fr; gap: 12px; align-items: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: 16px;
  padding: 9px; text-decoration: none; color: var(--ink);
}
.credit img { width: 60px; height: 60px; object-fit: cover; border-radius: 12px; }
.credit .c-name { font-weight: 900; font-size: .95rem; }
.credit .c-by { font-size: .8rem; font-weight: 700; color: var(--muted); }

footer { text-align: center; color: var(--muted); font-size: .8rem; font-weight: 700; padding: 14px 18px max(18px, env(safe-area-inset-bottom)); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- share button ---------- */
.btn.share { background: var(--lime); color: #22392b; border-color: transparent; }

/* ============================================================
   DRIBBBLE-LEVEL ELEVATION — motion system + polish
   ============================================================ */
:root {
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes optin { from { opacity: 0; transform: translateX(22px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes factin { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes cardpop { from { opacity: 0; transform: scale(.93) translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes scorepop { 0% { opacity: 0; transform: scale(.6); } 60% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes sheen { 0%, 55% { left: -70%; } 100% { left: 170%; } }

/* ---------- start screen: staggered entrance ---------- */
.screen.active .hero-main > * { animation: rise .55s var(--ease-out) both; }
.screen.active .hero-main > *:nth-child(1) { animation-delay: .02s; }
.screen.active .hero-main > *:nth-child(2) { animation-delay: .07s; }
.screen.active .hero-main > *:nth-child(3) { animation-delay: .12s; }
.screen.active .hero-main > *:nth-child(4) { animation-delay: .17s; }
.screen.active .hero-main > *:nth-child(5) { animation-delay: .22s; }
.screen.active .hero-main > *:nth-child(6) { animation-delay: .27s; }
.screen.active .hero-main > *:nth-child(7) { animation-delay: .32s; }
.screen.active .hero-main > *:nth-child(8) { animation-delay: .37s; }
.screen.active .hero-main > *:nth-child(n+9) { animation-delay: .42s; }
.screen.active .side { animation: rise .55s var(--ease-out) both; }

/* hero icon (app icon art) */
.hero-icon {
  display: block;
  box-shadow: 0 18px 38px rgba(34, 57, 43, .28), 0 0 0 6px color-mix(in srgb, var(--lime) 30%, transparent);
}

/* gradient headline accent (per-quiz tint) */
.hero-main h1 em {
  background: linear-gradient(115deg, var(--acc, var(--green)), color-mix(in srgb, var(--acc, var(--green)) 55%, var(--lime)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* primary button sheen sweep */
.btn.primary { position: relative; overflow: hidden; }
.btn.primary::after {
  content: ""; position: absolute; top: 0; left: -70%; width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg); animation: sheen 3.8s ease-in-out infinite; pointer-events: none;
}

/* beast cards: lift + image zoom, entrance stagger */
.beast-card { transition: transform .22s var(--ease-out), box-shadow .22s var(--ease-out); }
.beast-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.beast-card img { transition: transform .4s var(--ease-out); }
.beast-card:hover img { transform: scale(1.07); }
.screen.active .beast-card { animation: rise .5s var(--ease-out) both; }
.screen.active .beast-card:nth-child(2) { animation-delay: .05s; }
.screen.active .beast-card:nth-child(3) { animation-delay: .1s; }
.screen.active .beast-card:nth-child(4) { animation-delay: .15s; }
.screen.active .beast-card:nth-child(5) { animation-delay: .2s; }
.screen.active .beast-card:nth-child(n+6) { animation-delay: .25s; }

/* tiny credits link */
.linklike.tiny { font-size: .78rem; font-weight: 800; opacity: .72; margin-top: 10px; }
.quiz-nav .linklike.tiny { margin-top: 0; align-self: center; }

/* ---------- quiz screen: dealt options ---------- */
.options.deal .option { animation: optin .42s var(--ease-out) both; }
.options.deal .option:nth-child(2) { animation-delay: .07s; }
.options.deal .option:nth-child(3) { animation-delay: .14s; }
.options.deal .option:nth-child(4) { animation-delay: .21s; }
.option { transition: transform .14s var(--ease-spring), border-color .15s ease, background .15s ease, box-shadow .2s ease; }
.option:active:not(:disabled) { transform: scale(.96); }

/* score pill bump */
.score-pill.bump { animation: bump .35s var(--ease-spring); }

/* progress shimmer */
.progress-fill { position: relative; overflow: hidden; }
.progress-fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  animation: shimmer 2.4s linear infinite;
}

/* fact card: springy reveal + accent */
.fact {
  animation: factin .45s var(--ease-out);
  border-left: 5px solid var(--lime);
}

/* ---------- results: celebration entrance ---------- */
.screen.active .results-card { animation: cardpop .55s var(--ease-spring) both; }
.screen.active .score-big { animation: scorepop .6s var(--ease-spring) both .12s; }
.screen.active .results-card .menu .btn { animation: rise .45s var(--ease-out) both; }
.screen.active .results-card .menu .btn:nth-child(2) { animation-delay: .1s; }
.screen.active .results-card .menu .btn:nth-child(3) { animation-delay: .18s; }
.screen.active .results-card .menu .btn:nth-child(4) { animation-delay: .26s; }

/* ---------- credits: staggered rows ---------- */
.screen.active .credit { animation: rise .4s var(--ease-out) both; }
.screen.active .credit:nth-child(2) { animation-delay: .04s; }
.screen.active .credit:nth-child(3) { animation-delay: .08s; }
.screen.active .credit:nth-child(4) { animation-delay: .12s; }
.screen.active .credit:nth-child(5) { animation-delay: .16s; }
.screen.active .credit:nth-child(n+6) { animation-delay: .2s; }

/* ============================================================
   PHONE OPTIMIZATION (≤480px) — thumb-first, compact, no fuss
   ============================================================ */
@media (max-width: 480px) {
  main { padding: 10px 12px 24px; }

  /* start: quiz picker is a full-bleed top carousel — big thumb-friendly tiles */
  .side { background: transparent; border: none; box-shadow: none; padding: 0; margin-bottom: 2px; }
  .side-brand { padding: 2px 2px 8px; }
  .logo { font-size: .95rem; }
  .quiz-picker {
    display: grid; grid-template-rows: repeat(2, auto); grid-auto-flow: column;
    grid-auto-columns: 106px; gap: 10px;
    overflow-x: auto; overflow-y: hidden;
    /* full-bleed carousel, but the first tile starts in from the screen edge */
    margin: 0 -12px; padding: 4px 12px 12px 20px;
    min-width: 0;
    scroll-snap-type: x proximity; scroll-padding-left: 20px; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .quiz-picker::-webkit-scrollbar { display: none; }
  .quiz-pick {
    flex: 0 0 106px; scroll-snap-align: start;
    flex-direction: column; align-items: center; text-align: center;
    gap: 8px; padding: 12px 8px 10px; border-radius: 18px;
  }
  .quiz-pick:hover { transform: none; }
  .qp-tile { width: 54px; height: 54px; border-radius: 17px; }
  .qp-tile img { width: 42px; height: 42px; }
  .qp-text { align-items: center; }
  .qp-name { font-size: .78rem; white-space: normal; line-height: 1.3; }
  .qp-sub { font-size: .64rem; }
  .side-foot { margin-top: 0; padding: 2px 2px 0; border: none; }

  /* start: tighter hero so the start button sits near the top */
  .hero-art { width: 84px; height: 84px; border-radius: 26px; margin-bottom: 8px; }
  .hero-emoji .hero-icon { width: 58px; height: 58px; border-radius: 16px; }
  .eyebrow { font-size: .66rem; padding: 7px 13px; }
  .hero-main h1 { font-size: 1.85rem; margin: .25em 0 .2em; }
  .tagline { font-size: .9rem; margin-bottom: 1em; }
  .stats { gap: 8px; margin-bottom: 14px; }
  .stat { padding: 8px 13px; border-radius: 14px; }
  .stat b { font-size: 1.15rem; }
  .stat span { font-size: .62rem; }
  .btn.big { font-size: 1.05rem; padding: 15px 18px; }
  .beast-block { margin-top: 14px; }
  .beast-head h2 { font-size: 1.1rem; }
  .beast-strip {
    margin: 0 -12px; padding: 6px 12px 14px;
    scrollbar-width: none;
  }
  .beast-strip::-webkit-scrollbar { display: none; }
  .beast-card { flex-basis: 132px; }
  .beast-card img { width: 132px; height: 96px; }

  /* quiz: compact top row that always fits */
  .quiz-top { gap: 8px; margin-bottom: 12px; }
  .round-label { font-size: .86rem; }
  .progress { height: 10px; }
  .score-pill { padding: 7px 12px; font-size: .86rem; }

  /* quiz: everything fits the phone viewport — photo capped, nav sticky */
  .quiz-card { border-radius: 22px; }
  .photo-wrap { aspect-ratio: auto; height: 190px; }
  .sound-wrap { aspect-ratio: auto; height: 190px; }
  .quote-wrap { aspect-ratio: auto; min-height: 230px; padding: 40px 22px 26px; }
  .quote-text { font-size: 1.08rem; }
  .sound-play { width: 92px; height: 92px; }
  .mode-picker { gap: 6px; margin-bottom: 10px; }
  .mode-btn { padding: 8px 4px 7px; border-radius: 13px; }
  .mode-btn .m-icon { font-size: 1.15rem; }
  .mode-btn .m-name { font-size: .74rem; }
  .mode-btn .m-desc { font-size: .6rem; }
  #q-photo { max-width: 92%; max-height: 86%; }
  .q-count { top: 10px; left: 10px; font-size: .78rem; padding: 6px 12px; }
  .photo-credit { font-size: .7rem; padding: 22px 12px 10px; }
  .quiz-body { padding: 14px 14px 10px; }
  .prompt { font-size: 1.2rem; margin-bottom: 10px; }
  .options { gap: 8px; }
  .option { font-size: .95rem; padding: 10px 12px 10px 10px; border-radius: 14px; }
  .opt-letter { width: 34px; height: 34px; border-radius: 11px; font-size: .88rem; }
  /* tip becomes a bottom-sheet overlay — never pushes the Next button away.
     Its bottom offset clears the fixed footer (60px bar + iPhone safe area). */
  .fact {
    position: fixed; left: 12px; right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 60;
    margin: 0; padding: 16px; border-radius: 18px;
    max-height: 36vh; overflow-y: auto;
    border: 1px solid var(--line);
    box-shadow: 0 -10px 44px rgba(20, 30, 20, .28), var(--shadow);
    animation: sheetup .32s cubic-bezier(.2, .9, .25, 1.15);
  }
  @keyframes sheetup {
    from { opacity: 0; transform: translateY(28px); }
    to { opacity: 1; transform: none; }
  }
  .fact-title { font-size: 1.02rem; }
  .fact-text { font-size: .92rem; }
  /* bottom nav bar: compact thumb-friendly footer, Back + Next side by side,
     fixed to the viewport bottom with proper home-indicator clearance */
  #screen-quiz { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .q-nav-row {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
    margin: 0; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(transparent, var(--bg) 45%);
    display: flex; gap: 10px;
  }
  .q-nav-row .btn {
    width: auto; max-width: none; margin: 0;
    padding: 12px 18px; font-size: .95rem; border-radius: 16px;
  }
  .q-nav-row .btn.back { flex: 0 0 auto; }
  .q-nav-row .btn.next { flex: 1; }
  /* hide the fixed bar entirely when neither button is showing */
  .q-nav-row:not(:has(.btn:not(.hidden))) { display: none; }
  .quiz-nav { margin-top: 14px; }
  .pill-btn { padding: 10px 18px; font-size: .88rem; }

  /* results: tighter celebration card */
  .results-card { padding: 26px 18px; border-radius: 22px; }
  .results-emoji { font-size: 3.2rem; }
  .results-card h2 { font-size: 1.6rem; }
  .score-big { font-size: 3.6rem; }
  .score-total { font-size: 1.6rem; }

  /* credits */
  .credits-card { padding: 20px 16px; border-radius: 22px; }
}
