:root {
  --ink: #4a3b52;
  --ink-soft: #7a6a85;
  --pink: #ff6b9a;
  --yellow: #ffd166;
  --green: #06c290;
  --blue: #4cc9f0;
  --purple: #9b7bff;
  --orange: #ff9f43;
  --card: #ffffff;
  --shadow: 0 0.35em 0 rgba(74, 59, 82, 0.18);
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  font-family: 'Fredoka', 'Comic Sans MS', system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 15%, rgba(255, 255, 255, .7) 0 4%, transparent 4.2%),
    radial-gradient(circle at 85% 10%, rgba(255, 255, 255, .6) 0 3%, transparent 3.2%),
    radial-gradient(circle at 75% 85%, rgba(255, 255, 255, .5) 0 5%, transparent 5.2%),
    linear-gradient(160deg, #ffe8f3 0%, #e9e4ff 50%, #dff6ff 100%);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  overflow-x: hidden;
}

button { font-family: inherit; color: inherit; cursor: pointer; border: none; }
button:disabled { cursor: default; }

.animal { width: 100%; height: 100%; display: block; overflow: visible; }

.title { font-weight: 700; font-size: 3rem; margin: 0 0 .3em; text-align: center; letter-spacing: .01em; }
.title span { color: var(--pink); }
.title.small { font-size: 2.2rem; }

.hint, .prompt { text-align: center; font-size: 1.3rem; color: var(--ink-soft); margin: .6em 0; font-weight: 600; }

.big-btn {
  font-size: 1.6rem; font-weight: 700; padding: .6em 1.6em; border-radius: 999px;
  background: var(--pink); color: #fff; box-shadow: var(--shadow);
  transition: transform .1s, box-shadow .1s, opacity .2s;
}
.big-btn:active:not(:disabled) { transform: translateY(.2em); box-shadow: 0 .1em 0 rgba(74, 59, 82, .18); }
.big-btn:disabled { opacity: .4; }
.big-btn:focus-visible, .kick:focus-visible { outline: .25em solid var(--yellow); outline-offset: .2em; }

.ghost-btn {
  font-size: 1.1rem; font-weight: 600; padding: .6em 1.2em; border-radius: 999px;
  background: rgba(255, 255, 255, .7); box-shadow: var(--shadow);
}

.bounce { animation: bounce 1.4s ease-in-out infinite; }
@keyframes bounce {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-8%) rotate(2deg); }
}
@keyframes pop-in {
  0% { transform: scale(.3); opacity: 0; }
  70% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-4deg); }
  75% { transform: rotate(4deg); }
}

.net-banner {
  position: fixed; top: .8rem; left: 50%; z-index: 200; padding: .5em 1.2em; border-radius: 999px;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 1.2rem; box-shadow: var(--shadow);
  transform: translate(-50%, -300%); transition: transform .3s ease-out; pointer-events: none;
}
.net-banner.show { transform: translate(-50%, 0); animation: net-pulse 1.4s ease-in-out infinite; }
@keyframes net-pulse { 50% { opacity: .75; } }
body.tv .net-banner { font-size: 2em; }

.confetti { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 100; }

/* Timer bar: animation-delay is set negative so re-renders keep their place. */
.timer { height: 1.4rem; border-radius: 999px; background: rgba(255, 255, 255, .8); overflow: hidden; box-shadow: inset 0 .15em 0 rgba(0, 0, 0, .06); }
.timer-fill {
  height: 100%; width: 100%; border-radius: 999px; transform-origin: left center;
  background: linear-gradient(90deg, var(--green), var(--yellow) 60%, var(--pink));
  background-size: 100% 100%;
  animation-name: drain; animation-timing-function: linear; animation-fill-mode: forwards;
}
.timer.done { visibility: hidden; }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- Home ---------- */

.home { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem 1rem; gap: 1.5rem; }
.home-animals { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; max-width: 42rem; }
.home-animals > div { width: 3.4rem; height: 3.4rem; }
.home-choices { display: flex; flex-wrap: wrap; gap: 1.2rem; justify-content: center; }
.choice {
  display: flex; flex-direction: column; align-items: center; gap: .2rem; width: 13rem; padding: 1.4rem 1rem;
  background: var(--card); border-radius: 1.6rem; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); font-size: 3rem;
}
.choice b { font-size: 1.6rem; }
.choice small { font-size: 1rem; color: var(--ink-soft); }

.home-tagline { font-size: 1.35rem; font-weight: 600; color: var(--ink-soft); text-align: center; margin: -.6rem 0 0; }
.home-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 1.4rem; }
.home-steps li { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: 1.05rem; }
.home-steps b {
  width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--yellow); box-shadow: var(--shadow); font-size: 1rem;
}
.guide-link {
  display: inline-block; padding: .55em 1.3em; border-radius: 999px; background: var(--card); box-shadow: var(--shadow);
  color: var(--purple); font-weight: 700; font-size: 1.15rem; text-decoration: none;
}
.guide-link.small { font-size: .95rem; margin-top: .6rem; }
.site-footer { text-align: center; color: var(--ink-soft); font-size: .95rem; padding: 1rem 1rem 2rem; }
a.big-btn { display: inline-block; text-decoration: none; }
.big-btn.alt { background: var(--purple); }

/* ---------- How to play ---------- */

.guide-top { max-width: 52rem; margin: 0 auto; padding: 1rem 1rem 0; }
.guide-home { color: var(--ink); font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.guide-home span { color: var(--pink); }
.guide { max-width: 52rem; margin: 0 auto; padding: 0 1rem; display: flex; flex-direction: column; gap: 1.2rem; }
.guide-hero { text-align: center; padding-top: .5rem; }
.guide-hero .home-animals { margin: 1rem auto 0; max-width: 46rem; }
.guide-hero .home-animals > div { width: 3.2rem; height: 3.2rem; }
.guide-lead { font-size: 1.2rem; line-height: 1.5; max-width: 38rem; margin: 0 auto; color: var(--ink-soft); font-weight: 500; }
.guide-card {
  background: var(--card); border-radius: 1.6rem; box-shadow: var(--shadow); padding: 1.4rem 1.6rem;
  line-height: 1.55; font-size: 1.05rem;
}
.guide-card h2 { margin: 0 0 .7rem; font-size: 1.6rem; }
.guide-card h3 { margin: 1rem 0 .3rem; font-size: 1.2rem; }
.guide-card p { margin: .4rem 0; }
.guide-card a { color: var(--purple); }
.guide-card em { font-style: normal; font-weight: 700; color: var(--pink); }

.need-list, .rules, .legend { list-style: none; padding: 0; margin: 0; }
.need-list li { display: flex; gap: .8rem; align-items: flex-start; padding: .4rem 0; }
.need-list li > span { font-size: 1.7rem; line-height: 1.2; }
.rules li { padding: .25rem 0; }

.steps { list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; gap: 1rem; align-items: flex-start; padding: .7rem 0; border-top: 2px dashed #efe7f5; scroll-margin-top: 1rem; }
.steps li:first-child { border-top: none; }
.steps h3 { margin: .15rem 0 .2rem; }
.step-num {
  flex: none; width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--pink); color: #fff; font-size: 1.3rem; box-shadow: var(--shadow);
}

.facts { list-style: none; padding: 0; margin: 0 0 .8rem; display: flex; flex-wrap: wrap; gap: .8rem; }
.facts li { flex: 1 1 8rem; text-align: center; background: #fff4c9; border-radius: 1.2rem; padding: .7rem .5rem; }
.facts b { display: block; font-size: 2.2rem; line-height: 1.1; color: var(--ink); }
.facts span { font-weight: 600; color: var(--ink-soft); }

.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .6rem 1.2rem; }
.legend li { display: flex; align-items: center; gap: .7rem; font-weight: 600; }
.lg {
  flex: none; min-width: 2.2rem; height: 2.2rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; font-weight: 700; font-size: .95rem; box-shadow: var(--shadow); padding: 0 .6rem;
}
.lg-score, .lg-fast { background: var(--yellow); }
.lg-dot { width: 2.2rem; padding: 0; color: #fff; border: 3px solid #fff; }
.lg-locked { background: var(--purple); }
.lg-wrong { background: var(--pink); }
.lg-ring { width: 2.2rem; padding: 0; background: #ffc98b; box-shadow: 0 0 0 4px var(--green); }
.lg-net { background: var(--ink); color: #fff; font-size: .85rem; }
.lg-think { background: #fff; gap: .25rem; }
.lg-think i { width: .45rem; height: .45rem; border-radius: 50%; background: var(--ink-soft); animation: think 1.2s infinite ease-in-out; }
.lg-think i:nth-child(2) { animation-delay: .2s; }
.lg-think i:nth-child(3) { animation-delay: .4s; }

.buddy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: .8rem; }
.buddy { margin: 0; text-align: center; background: var(--c); border-radius: 1.2rem; padding: .6rem .3rem .5rem; box-shadow: var(--shadow); }
.buddy svg { width: 70%; height: auto; }
.buddy figcaption { font-weight: 700; font-size: .95rem; }

.guide-card details { border-top: 2px dashed #efe7f5; padding: .6rem 0; }
.guide-card details:first-of-type { border-top: none; }
.guide-card summary { cursor: pointer; font-weight: 700; font-size: 1.1rem; list-style: none; padding-right: 2rem; position: relative; }
.guide-card summary::-webkit-details-marker { display: none; }
.guide-card summary::after {
  content: '+'; position: absolute; right: .2rem; top: -.1rem; font-size: 1.5rem; color: var(--pink); transition: transform .2s;
}
.guide-card details[open] summary::after { transform: rotate(45deg); }
.guide-card summary em { color: inherit; }

.guide-cta { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; padding: .6rem 0 .4rem; }
.guide-cta .big-btn { font-size: 1.3rem; }

@media (max-width: 520px) {
  .guide-card { padding: 1.1rem 1.1rem; border-radius: 1.2rem; }
  .guide-card h2 { font-size: 1.35rem; }
  .title { font-size: 2.4rem; }
}

/* ---------- TV ---------- */
/* Old smart-TV browsers: stick to grid-gap (not flex gap), no inset/aspect-ratio. */

body.tv { font-size: 1.25vw; font-size: min(1.25vw, 2.22vh); overflow: hidden; }
body.tv #app { height: 100vh; padding: 2.5vh 2vw; display: flex; flex-direction: column; }
body.tv .title { font-size: 3em; margin-bottom: .15em; }
body.tv .hint { font-size: 1.8em; margin: .4em 0; }
body.tv .big-btn { font-size: 1.9em; padding: .4em 1.6em; }
body.tv .timer { height: 2.2vh; }

.splash, .lobby, .final, .countdown { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* Arena: floating avatars down both sides, the quiz in the middle. */
.arena { flex: 1; display: grid; grid-template-columns: 17vw minmax(0, 1fr) 17vw; min-height: 0; }
.side { display: flex; flex-direction: column; justify-content: space-evenly; align-items: center; min-height: 0; }
.center { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 0 1vw; }

.avatar { position: relative; display: flex; flex-direction: column; align-items: center; }
.avatar.enter { animation: pop-in .5s ease-out; }
.av-float { position: relative; width: var(--av); height: var(--av); animation: float 3.2s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(-5%) rotate(-2deg); }
  50% { transform: translateY(5%) rotate(2deg); }
}
.av-circle {
  width: 100%; height: 100%; border-radius: 50%; padding: 8%; background: var(--c);
  box-shadow: 0 0 0 .6vh #fff, 0 1.2vh 0 .6vh rgba(74, 59, 82, .15);
  transition: box-shadow .3s, opacity .3s;
}
.is-right .av-circle { box-shadow: 0 0 0 .9vh var(--green), 0 1.2vh 0 .9vh rgba(74, 59, 82, .15); }
.is-wrong .av-circle { opacity: .6; }
.av-label {
  margin-top: 1.6vh; max-width: 16vw; padding: .15em .8em; border-radius: 999px; background: #fff; box-shadow: var(--shadow);
  font-weight: 700; font-size: calc(1vh + var(--av) * .1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.av-score {
  position: absolute; top: -6%; right: -16%; padding: .1em .5em; border-radius: 999px; white-space: nowrap;
  background: var(--yellow); box-shadow: var(--shadow); font-weight: 700; font-size: calc(.8vh + var(--av) * .12);
}
.av-badge {
  position: absolute; bottom: -2%; right: -6%; width: 34%; height: 34%; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: calc(.6vh + var(--av) * .14);
  border: .4vh solid #fff; box-shadow: var(--shadow);
}
.av-badge.ready, .av-badge.right { background: var(--green); }
.av-badge.waiting { background: #cfc5d6; }
.av-badge.is-locked { background: var(--purple); }
.av-badge.wrong { background: var(--pink); }
.av-think {
  position: absolute; bottom: 0; right: -14%; padding: .5vh 1vh; border-radius: 999px; background: #fff; box-shadow: var(--shadow);
  display: flex; align-items: center;
}
.av-think i { width: 1vh; height: 1vh; border-radius: 50%; background: var(--ink-soft); animation: think 1.2s infinite ease-in-out; }
.av-think i + i { margin-left: .5vh; }
.av-think i:nth-child(2) { animation-delay: .2s; }
.av-think i:nth-child(3) { animation-delay: .4s; }
@keyframes think { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-35%); } }
.av-plus {
  position: absolute; top: 0; left: 50%; color: var(--green); font-weight: 700; font-size: calc(1vh + var(--av) * .22);
  text-shadow: 0 0 .3vh #fff, 0 0 .3vh #fff; animation: plus-up 1.6s ease-out forwards; pointer-events: none;
}
@keyframes plus-up {
  0% { transform: translate(-50%, 20%) scale(.5); opacity: 0; }
  25% { transform: translate(-50%, -30%) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -110%) scale(1); opacity: 0; }
}
.av-fast {
  position: absolute; bottom: -2%; left: -24%; padding: .15em .6em; border-radius: 999px; white-space: nowrap;
  background: var(--yellow); box-shadow: var(--shadow); font-weight: 700; font-size: calc(.6vh + var(--av) * .1);
  animation: pop-in .4s ease-out, wiggle .6s ease-in-out .4s 2;
}
.kick {
  position: absolute; top: -4%; left: -8%; width: 2em; height: 2em; border-radius: 50%;
  background: rgba(255, 255, 255, .8); font-size: 1em; opacity: .5; box-shadow: var(--shadow);
}
.kick:focus { opacity: 1; }
.pop { animation: pop-in .35s ease-out; }

/* Lost connection: greyed out, stops floating, "reconnecting" tag. */
.is-offline .av-circle { opacity: .45; }
.is-offline .av-float { animation-play-state: paused; }
.av-offline {
  position: absolute; bottom: -14%; left: 50%; transform: translateX(-50%); white-space: nowrap; z-index: 1;
  padding: .15em .6em; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700;
  font-size: calc(.6vh + var(--av) * .09); animation: net-pulse 1.4s ease-in-out infinite;
}

/* Lobby */
.join-box {
  display: grid; grid-auto-flow: column; align-items: center; grid-gap: 2.5em; gap: 2.5em; background: var(--card); border-radius: 2em;
  padding: 1em 2em; box-shadow: var(--shadow);
}
.join-left { text-align: center; }
.join-label { font-size: 1.8em; font-weight: 600; color: var(--ink-soft); }
.join-url { font-size: 1.6em; font-weight: 600; color: var(--purple); margin-top: .3em; }
.code { display: grid; grid-auto-flow: column; grid-gap: .25em; gap: .25em; justify-content: center; margin-top: .2em; }
.code span {
  width: 1.3em; height: 1.35em; display: grid; place-items: center; font-size: 3.6em; font-weight: 700;
  background: #fff4c9; border-radius: .25em; color: var(--ink); box-shadow: inset 0 -.08em 0 rgba(0, 0, 0, .08);
}
.qr { width: 9em; height: 9em; }
.qr svg { width: 100%; height: 100%; }
.lobby-info { font-size: 1.8em; font-weight: 600; margin-top: 1em; color: var(--ink-soft); }
.lobby-info b { color: var(--purple); }
.lobby-hint { font-size: 2em; font-weight: 700; margin: .4em 0 .6em; text-align: center; }
.lobby-hint.go { color: var(--green); animation: pop-in .4s ease-out; }

/* Quiz */
.countdown .get-ready { font-size: 5em; font-weight: 700; color: var(--purple); }
.countdown .count { font-size: 22em; font-weight: 700; line-height: 1; color: var(--pink); animation: pop-in .5s ease-out; }
.quiz { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.quiz > * + * { margin-top: 2vh; }
.round-label { font-size: 2.6em; font-weight: 600; text-align: center; }
.round-label b { color: var(--pink); }
.question-card {
  flex: 1; min-height: 0; display: grid; place-items: center; padding: 2em 1em;
  background: var(--card); border-radius: 2.5em; box-shadow: var(--shadow);
}
.question { font-size: 7em; font-weight: 700; white-space: nowrap; line-height: 1; }
.q-answer { color: var(--pink); display: inline-block; min-width: 1.2em; text-align: center; }
.quiz-footer { font-size: 2.2em; font-weight: 700; text-align: center; color: var(--ink-soft); }

/* Shared with the tablet result screen */
.fastest {
  display: inline-block; white-space: nowrap; background: var(--yellow); color: var(--ink); font-weight: 700;
  padding: .15em .8em; border-radius: 999px; box-shadow: var(--shadow); animation: pop-in .4s ease-out;
}
.result .fastest { font-size: 1.6rem; margin-top: .6rem; }
.prompt small { font-size: .8em; color: var(--purple); }

/* Final */
.podium { display: grid; grid-auto-flow: column; align-items: end; grid-gap: 3em; gap: 3em; margin: .5em 0; }
.podium-spot { display: flex; flex-direction: column; align-items: center; position: relative; animation: pop-in .6s ease-out both; }
.podium-spot.place-2 { order: -1; animation-delay: .3s; }
.podium-spot.place-3 { animation-delay: .5s; }
.crown { font-size: 3em; line-height: 1; margin-bottom: -.2em; animation: bounce 1.2s infinite; }
.podium-animal { width: 6.5em; height: 6.5em; }
.place-2 .podium-animal, .place-3 .podium-animal { width: 5em; height: 5em; }
.podium-name { font-size: 2.1em; font-weight: 700; }
.podium-score { font-size: 2.4em; font-weight: 700; color: var(--pink); }
.podium-time { font-size: 1.5em; color: var(--ink-soft); font-weight: 600; }
.podium-block {
  margin-top: .3em; width: 4.5em; height: 1.6em; display: grid; place-items: center; font-size: 2.6em; font-weight: 700; color: #fff;
  background: var(--c); border-radius: .4em .4em 0 0; box-shadow: var(--shadow); text-shadow: 0 .06em 0 rgba(0, 0, 0, .2);
}
.place-2 .podium-block { height: 1.1em; }
.place-3 .podium-block { height: .8em; }
.rest { display: flex; flex-wrap: wrap; justify-content: center; max-width: 90vw; margin-bottom: .8em; }
.rest-chip {
  display: grid; grid-auto-flow: column; align-items: center; grid-gap: .5em; gap: .5em; margin: .3em;
  padding: .2em .9em .2em .5em; border-radius: 999px; background: var(--c); box-shadow: var(--shadow); font-size: 1.4em;
}
.rest-chip .mini { width: 1.8em; height: 1.8em; }
.rest-chip b { color: var(--ink-soft); }
.rest-chip i { font-style: normal; font-weight: 700; }
.final .big-btn { margin-top: .4em; }

/* ---------- Tablet ---------- */

body.tablet { padding-bottom: 3.5rem; }
.leave-btn {
  position: fixed; right: .8rem; bottom: .8rem; z-index: 50; padding: .5em 1em; border-radius: 999px;
  background: rgba(255, 255, 255, .85); box-shadow: var(--shadow); font-size: .95rem; font-weight: 600; color: var(--ink-soft);
}
.leave-btn.confirm { background: var(--pink); color: #fff; animation: pop-in .25s ease-out; }
.big-animal.sad { filter: grayscale(.6); transform: rotate(-8deg); opacity: .8; }


body.tablet #app { min-height: 100%; display: flex; }
.screen { width: 100%; max-width: 46rem; margin: 0 auto; padding: 1.2rem 1rem 2rem; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.screen.center { justify-content: center; min-height: 100vh; }

.code-input { margin: .4rem 0 .8rem; }
.code-input span { font-size: 3.2rem; background: rgba(255, 255, 255, .7); }
.code-input span.filled { background: #fff4c9; animation: pop-in .25s ease-out; }
.keypad { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; width: 100%; max-width: 30rem; }
.key {
  aspect-ratio: 1; font-size: 1.8rem; font-weight: 700; border-radius: 1rem;
  background: var(--card); box-shadow: var(--shadow);
}
.key:active { transform: translateY(.15em); box-shadow: 0 .1em 0 rgba(74, 59, 82, .18); }
.key.back { grid-column: span 2; aspect-ratio: auto; background: #ffe1ea; }
.error { color: #d6336c; font-weight: 700; font-size: 1.2rem; text-align: center; margin: 0; }

.name-input {
  font-family: inherit; font-size: 1.8rem; font-weight: 600; text-align: center; color: var(--ink);
  width: 100%; max-width: 22rem; padding: .4em .6em; border-radius: 1rem; border: .2rem solid #e5dcef; background: #fff;
  user-select: text; -webkit-user-select: text;
}
.name-input:focus { outline: none; border-color: var(--pink); }

.animal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; width: 100%; max-width: 40rem; }
.animal-pick {
  display: flex; flex-direction: column; align-items: center; padding: .6rem .3rem .5rem; border-radius: 1.3rem;
  background: var(--c); box-shadow: var(--shadow); font-size: 1.1rem; font-weight: 700; border: .25rem solid transparent;
  transition: transform .15s;
}
.animal-pick svg { width: 70%; aspect-ratio: 1; height: auto; }
.animal-pick.picked { border-color: var(--pink); transform: scale(1.06); background: #fff; }
.animal-pick.picked svg { animation: bounce 1s ease-in-out infinite; }
.animal-pick:disabled { opacity: .3; filter: grayscale(1); }

.me-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .9rem .2rem .3rem; border-radius: 999px; background: var(--c); font-size: 1.2rem; box-shadow: var(--shadow); }
.me-badge .mini { width: 2.2rem; height: 2.2rem; }

.table-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; width: 100%; }
.table-btn {
  font-size: 2.2rem; font-weight: 700; padding: .5em 0; border-radius: 1.2rem; background: var(--card);
  box-shadow: var(--shadow); transition: transform .12s, background .12s;
}
.table-btn.on { background: var(--yellow); transform: scale(1.05); }
.table-btn.mix { font-size: 1.3rem; background: #efe7ff; }
.tables-label { font-size: 1.4rem; font-weight: 700; color: var(--purple); text-align: center; margin: .3rem 0; min-height: 1.4em; }
.tables-label.is-mix { color: var(--orange); }
.row { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; justify-content: center; margin-top: .4rem; }

.big-animal { width: 12rem; height: 12rem; }
.get-ready { font-size: 3rem; font-weight: 700; color: var(--purple); }

.screen.play { min-height: 100vh; }
.play-top { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.play-top .round-label { font-size: 1.3rem; }
.star-score { font-size: 1.6rem; font-weight: 700; background: #fff; padding: .1em .7em; border-radius: 999px; box-shadow: var(--shadow); }
.screen.play .timer { width: 100%; margin-top: .4rem; }
.screen .question { font-size: clamp(3.5rem, 15vw, 6.5rem); margin: .8rem 0; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; width: 100%; flex: 1; max-height: 24rem; }
.answer {
  font-size: clamp(2.6rem, 11vw, 4.5rem); font-weight: 700; color: #fff; border-radius: 1.6rem; min-height: 6rem;
  box-shadow: 0 .18em 0 rgba(0, 0, 0, .18); text-shadow: 0 .05em 0 rgba(0, 0, 0, .15);
  transition: transform .1s, opacity .2s;
}
.answer:active:not(:disabled) { transform: translateY(.08em) scale(.98); }
.answer.a0 { background: var(--pink); }
.answer.a1 { background: var(--blue); }
.answer.a2 { background: var(--green); }
.answer.a3 { background: var(--orange); }
.answer:disabled { opacity: .35; }
.answer.chosen { opacity: 1; transform: scale(1.04); outline: .3rem solid var(--ink); outline-offset: .2rem; }
.locked { font-size: 1.6rem; font-weight: 700; color: var(--purple); margin: .4rem 0 0; }

.result { display: flex; flex-direction: column; align-items: center; font-size: 3rem; font-weight: 700; margin: auto 0; animation: pop-in .4s ease-out; text-align: center; }
.result-emoji { font-size: 6rem; line-height: 1.1; }
.result small { font-size: 1.6rem; color: var(--ink-soft); }
.result.right { color: var(--green); }
.result.wrong { color: var(--pink); }
.result.wrong b { color: var(--ink); font-size: 1.4em; }
.final-score { font-size: 2.4rem; font-weight: 700; margin: .2rem 0; }

@media (max-width: 520px) {
  .animal-grid { gap: .45rem; }
  .animal-pick { font-size: .85rem; }
  .table-btn { font-size: 1.7rem; }
  .keypad { gap: .35rem; }
  .key { font-size: 1.4rem; }
}
