/* AWS Cloud Quest — styles
 * Order: tokens → base → HUD → question panel → field → characters →
 *        answers → overlays → effects → keyframes → reduced motion.
 * Palette follows a "candy" look; text colors were chosen for WCAG AA
 * contrast (see docs/DECISIONS.md).
 */

/* ── Tokens ─────────────────────────────────────────────────────────── */
:root {
  --red: #e8272d;
  --red-dark: #c41e24;
  --orange: #f7931e;
  --yellow: #fbd51a;
  --green: #6cc24a;
  --green-dark: #2f7d1f;
  --blue: #2b9fdc;
  --purple: #a64ca6;
  --pink: #ff8fd0;
  --ink: #3a1459;
  --ink-2: #5a2278;
  --cream: #fff7ec;
  --white: #fff;
  --gray: #b9b3c2;

  --card-top: #c2459b;
  --card-bottom: #7a2d8c;
  --sky-top: #8fd3ff;
  --sky-bottom: #ffd1ec;

  --ground-h: 42px; /* thick enough to hold the power-up buttons */
  --ground-border: 6px;
  --radius: 18px;
  --candy-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.25);
  --text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  --font: "Trebuchet MS", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ── Base ───────────────────────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

html,
body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body { overflow: hidden; }

button { font: inherit; }

:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 2px;
}

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

.app {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 860px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  background: var(--ink);
  overflow: hidden;
}

/* ── 1. HUD ─────────────────────────────────────────────────────────── */
.hud {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: linear-gradient(var(--ink-2), var(--ink));
  border-bottom: 4px solid var(--yellow);
  text-shadow: var(--text-shadow);
  font-weight: 700;
}

.hud-title {
  margin-right: auto;
  font-size: 1.05rem;
  white-space: nowrap;
}

.hud-title b { color: var(--yellow); }

.hud-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.icon {
  display: inline-block;
  flex: none;
  vertical-align: middle;
}

.hud-icon { display: inline-flex; }
.icon-gold { color: var(--yellow); }
.icon-trophy { color: #b77800; }
.icon-trophy .icon,
.icon.icon-trophy { filter: drop-shadow(0 0 3px rgba(251, 213, 26, 0.6)); }

.hud-lives { gap: 2px; }
.heart-full { color: #ff4d6d; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.35)); }
.heart-empty { color: rgba(255, 255, 255, 0.55); }

.hud-fast { gap: 5px; }

#hud-fast {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hud-btn {
  justify-content: center;
  min-width: 36px;
  border: 0;
  color: var(--white);
  cursor: pointer;
}

.hud-btn:hover { background: rgba(0, 0, 0, 0.4); }
.hud-btn.is-muted { color: rgba(255, 255, 255, 0.6); }

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.dot.is-on {
  background: var(--yellow);
  box-shadow: 0 0 6px var(--yellow);
}

.hud-best .trophy {
  display: block;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.45));
}

/* Pulses while the current score beats the best score. */
.hud-best.is-record {
  background: rgba(251, 213, 26, 0.28);
  box-shadow: 0 0 0 2px var(--yellow);
  animation: record-glow 0.9s ease-in-out infinite alternate;
}

/* ── World: one sky behind the question balloon and the field ──────── */
.world {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 170px;
  overflow: hidden;
  background: linear-gradient(var(--sky-top), var(--sky-bottom));
}

.sky {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Day/night: js/ambient.js sets --night from 0 (day) to 1 (night). */
.sky-night {
  position: absolute;
  inset: 0;
  background: linear-gradient(#0b1638, #2c2160 70%, #4a2d6e);
  opacity: var(--night, 0);
}

.stars {
  position: absolute;
  inset: 0 0 35% 0;
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 27% 42%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 41% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 58% 33%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 69% 9%, #fff6c0 50%, transparent 51%),
    radial-gradient(1px 1px at 83% 27%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 93% 52%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 5% 60%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 35% 70%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 76% 64%, #fff 50%, transparent 51%);
  opacity: var(--night, 0);
  animation: twinkle 3s ease-in-out infinite alternate;
}

.sun,
.moon {
  position: absolute;
  top: 9%;
  right: 9%;
  width: 46px;
  height: 46px;
  border-radius: 50%;
}

.sun {
  background: radial-gradient(circle, #fff7b0 0 45%, var(--yellow) 60%);
  box-shadow: 0 0 30px 10px rgba(251, 213, 26, 0.55);
  opacity: calc(1 - var(--night, 0));
  transform: translateY(calc(var(--night, 0) * 60px));
}

.moon {
  background: transparent;
  box-shadow: inset -11px 3px 0 0 #f4f1d0;
  filter: drop-shadow(0 0 8px rgba(244, 241, 208, 0.6));
  opacity: var(--night, 0);
  transform: translateY(calc((1 - var(--night, 0)) * 60px));
}

/* Rain dims the sky and greys the clouds. */
.sky-rain {
  position: absolute;
  inset: 0;
  background: #5d6b80;
  opacity: 0;
  transition: opacity 2.5s;
}

.world.is-rain .sky-rain { opacity: 0.4; }
.world.is-rain .cloud { background: #b8c0cc; }
.world.is-rain .sun { opacity: 0; }
.world.is-night .cloud { background: rgba(200, 200, 230, 0.35); }

.rain {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2.5s;
}

.rain::before,
.rain::after {
  content: "";
  position: absolute;
  inset: -120px 0 0 -60px;
  background: repeating-linear-gradient(100deg, transparent 0 18px, rgba(255, 255, 255, 0.45) 18px 19px);
  background-size: 100% 70px;
  animation: rain-fall 0.45s linear infinite;
}

.rain::after {
  background-size: 100% 110px;
  opacity: 0.6;
  animation-duration: 0.7s;
}

.world.is-rain .rain { opacity: 1; }

.lightning {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: #fff;
  opacity: 0;
}

.world.is-lightning .lightning { animation: lightning 0.6s ease-out; }

/* The field (hills, hero, monsters) darkens a little at night. */
.field { filter: brightness(calc(1 - var(--night, 0) * 0.3)); }

.bird {
  position: absolute;
  left: 0;
  color: var(--ink);
  animation: fly var(--dur, 12s) linear forwards;
}

.world.is-night .bird { color: #1a1030; }

/* Bunnies and squirrels run along the ground, left → right, behind the hero. */
.critters {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--ground-h) + var(--ground-border) - 2px);
  z-index: 1;
  height: 24px;
  pointer-events: none;
}

.critter {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 24px;
  animation: run var(--dur, 8s) linear forwards;
}

.critter svg {
  display: block;
  width: 100%;
  height: auto;
}

.critter-bunny svg { animation: hop-small 0.42s ease-in-out infinite; }
.critter-squirrel { width: 22px; }
.critter-squirrel svg { animation: scurry 0.22s ease-in-out infinite alternate; }

.bird svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.bird-wing {
  transform-box: fill-box;
  transform-origin: center;
  animation: flap var(--flap, 0.28s) ease-in-out infinite alternate;
}

/* Danger vignette over the whole world when the monster is close. */
.world::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 70px 24px rgba(232, 39, 45, 0.6);
  transition: opacity 0.3s;
}

.world.is-danger::after {
  opacity: 1;
  animation: danger-pulse 0.7s ease-in-out infinite alternate;
}

/* ── 2. Question balloon (floats over the sky, on top of the field) ──── */
.qpanel {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 6;
  border: 4px solid var(--yellow);
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--ink);
  overflow: hidden;
  box-shadow: 0 5px 0 rgba(58, 20, 89, 0.35), 0 14px 24px rgba(58, 20, 89, 0.25);
  animation: float 3.2s ease-in-out infinite alternate;
}

.qpanel-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 6px 8px 9px 12px;
  border: 0;
  background: var(--orange);
  color: var(--ink);
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.qpanel-label { letter-spacing: 0.08em; }

.qpanel-topic {
  overflow: hidden;
  max-width: 40%;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gray);
  color: var(--ink);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chip.is-fast { background: var(--green); }

/* Big open/close pill: easy to hit with a thumb (the whole header is the button). */
.qpanel-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 4px 12px 4px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.35);
}

.qpanel-head:hover .qpanel-arrow,
.qpanel-head:focus-visible .qpanel-arrow { background: var(--ink-2); }

.qpanel-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--white);
  transform-origin: left center;
}

.qpanel-body {
  max-height: 32dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.qpanel.is-closed .qpanel-body { display: none; }

.qpanel-text {
  margin: 0;
  padding: 10px 14px 12px;
  font-size: clamp(14px, 1.2vw + 10px, 18px);
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* ── 3. Field ───────────────────────────────────────────────────────── */
.field {
  position: relative;
  flex: 1 1 auto;
  min-height: 170px;
  overflow: hidden;
}

.field.is-shaking { animation: shake 0.35s ease-in-out; }

/* ── Power-ups on the ground strip ─────────────────────────────────── */
.powers {
  position: absolute;
  right: 8px;
  bottom: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--ground-h);
}

.power {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 3px 6px 5px 10px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 800;
  text-shadow: var(--text-shadow);
  box-shadow: var(--candy-shadow);
  cursor: pointer;
  transition: transform 0.1s, filter 0.15s, opacity 0.2s;
}

.power-freeze { background: linear-gradient(#5ec4f2, #1d7fb8); }
.power-skip { background: linear-gradient(#c56ac5, #7a2d8c); }

.power:hover:not(:disabled) { filter: brightness(1.1); }
.power:active:not(:disabled) { transform: translateY(2px); }
.power:disabled { cursor: default; opacity: 0.45; filter: grayscale(0.6); }
.power.is-active { opacity: 1; filter: none; box-shadow: 0 0 0 3px #bdeeff, var(--candy-shadow); }

.power-count {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  font-size: 0.8rem;
  text-shadow: none;
}

/* ── Ice cube (Gelo) ────────────────────────────────────────────────── */
.monster.is-frozen .m-svg,
.monster.is-frozen .m-jaw,
.monster.is-frozen .m-wing,
.monster.is-frozen .m-tongue { animation-play-state: paused; }

.monster.is-frozen .m-art { filter: saturate(0.5) brightness(1.1) hue-rotate(160deg); }
.monster.is-frozen::before { display: none; } /* no speed lines while frozen */

.m-ice {
  position: absolute;
  inset: -8px -6px -4px;
  z-index: 2;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  background:
    linear-gradient(125deg, transparent 0 18%, rgba(255, 255, 255, 0.75) 19% 24%, transparent 25% 60%, rgba(255, 255, 255, 0.45) 61% 64%, transparent 65%),
    linear-gradient(rgba(214, 244, 255, 0.72), rgba(140, 205, 245, 0.5));
  box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.9), 0 0 16px rgba(120, 200, 255, 0.85);
  animation: ice-in 0.3s ease-out;
}

.m-ice.is-cracking { animation: ice-crack 0.4s ease-in forwards; }

.m-ice-time {
  position: absolute;
  left: 50%;
  top: -24px;
  padding: 1px 10px;
  border: 2px solid var(--white);
  border-radius: 999px;
  background: #1d7fb8;
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 800;
  text-shadow: var(--text-shadow);
  transform: translateX(-50%);
}

.monster.is-frozen .m-speed { display: none; }

/* Pular: the monster vanishes in a puff. */
.monster.is-skipped .m-art { animation: poof 0.5s ease-in forwards; }

.cloud {
  position: absolute;
  width: 90px;
  height: 28px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.85);
}

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

.cloud::before { width: 40px; height: 40px; left: 14px; top: -20px; }
.cloud::after { width: 30px; height: 30px; left: 44px; top: -14px; }
.cloud-1 { top: 8%; left: 6%; animation: drift 40s linear infinite alternate; }
.cloud-2 { top: 45%; left: 55%; animation: drift 55s linear infinite alternate-reverse; }
.cloud-3 { top: 4%; left: 78%; animation: drift 48s linear infinite alternate; }
.cloud-4 { top: 32%; left: 22%; opacity: 0.7; animation: drift 62s linear infinite alternate-reverse; }

.hill {
  position: absolute;
  bottom: calc(var(--ground-h) - 10px);
  border-radius: 50% 50% 0 0;
}

.hill-1 { left: -10%; width: 55%; height: 32%; background: #9fd88a; }
.hill-2 { left: 30%; width: 50%; height: 24%; background: #f7b6dd; }
.hill-3 { right: -12%; width: 50%; height: 38%; background: #c79ae0; }

.sprinkle {
  position: absolute;
  width: 12px;
  height: 4px;
  border-radius: 2px;
  opacity: 0.85;
}

.s1 { top: 12%; left: 30%; background: var(--red); transform: rotate(30deg); }
.s2 { top: 40%; left: 20%; background: var(--yellow); transform: rotate(-20deg); }
.s3 { top: 22%; left: 70%; background: var(--blue); transform: rotate(60deg); }
.s4 { top: 50%; left: 88%; background: var(--green); transform: rotate(10deg); }
.s5 { top: 8%; left: 48%; background: var(--purple); transform: rotate(-45deg); }
.s6 { top: 35%; left: 42%; background: var(--orange); transform: rotate(80deg); }
.s7 { top: 58%; left: 62%; background: var(--pink); transform: rotate(-70deg); }
.s8 { top: 18%; left: 92%; background: var(--red); transform: rotate(15deg); }

.ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--ground-h) + var(--ground-border));
  border-top: var(--ground-border) solid var(--pink);
  background: var(--green);
}

.fx {
  position: absolute;
  inset: 0;
  z-index: 7; /* above the question balloon (6) */
  overflow: hidden;
  pointer-events: none;
}

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero {
  position: absolute;
  bottom: calc(var(--ground-h) + var(--ground-border));
  z-index: 2;
  width: 67px;
  height: 72px;
}

.h-svg,
.h-coils {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.h-svg {
  transform-origin: 30% 100%;
  transition: transform 0.45s ease-in, opacity 0.45s ease-in, filter 0.5s;
}

.h-eyes-x { display: none; }

.h-ponytail {
  transform-box: fill-box;
  transform-origin: 100% 0;
  animation: sway 1.4s ease-in-out infinite alternate;
}

.h-coils {
  opacity: 0;
  transform: scale(1.5);
  transform-origin: 37% 60%;
}

.hero.is-shooting .h-svg { animation: recoil 0.12s ease-out; }
.hero.is-blinking { animation: blink var(--blink-ms, 1300ms) steps(1) both; }

.hero.fate-eaten .h-svg { transform: scale(0.1) translateX(80px); opacity: 0; }

/* Burned: falls forward (towards the dragon) so it stays inside the field. */
.hero.fate-burned .h-svg {
  filter: brightness(0.3) saturate(0.4);
  transform-origin: 75% 100%;
  transform: rotate(80deg);
}

.hero.fate-squeezed .h-svg {
  filter: sepia(0.6) hue-rotate(50deg) saturate(1.6);
  transform: scale(0.74, 0.94);
}

.hero.fate-squeezed .h-coils {
  opacity: 1;
  transform: scale(1);
  transition: transform 0.4s ease-out, opacity 0.2s;
  animation: squeeze 0.4s ease-in-out 0.45s 3 alternate;
}

/* Bonked by the gorilla: flattened, with dizzy stars circling the head. */
.h-stars {
  position: absolute;
  left: 4px;
  top: -14px;
  opacity: 0;
  pointer-events: none;
}

.hero.fate-bonked .h-svg {
  transform-origin: 40% 100%;
  transform: scale(1.08, 0.62);
  transition: transform 0.12s ease-in;
}

.hero.fate-bonked .h-stars {
  top: 6px;
  opacity: 1;
  transition: opacity 0.15s 0.1s, top 0.12s;
  animation: dizzy 0.9s linear infinite;
}

.hero.fate-burned .h-eyes,
.hero.fate-squeezed .h-eyes,
.hero.fate-bonked .h-eyes,
.hero.fate-burned .h-mouth,
.hero.fate-squeezed .h-mouth,
.hero.fate-bonked .h-mouth { display: none; }

.hero.fate-burned .h-eyes-x,
.hero.fate-squeezed .h-eyes-x,
.hero.fate-bonked .h-eyes-x { display: inline; }

/* ── Monsters ───────────────────────────────────────────────────────── */
.monster {
  position: absolute;
  left: 0;
  bottom: calc(var(--ground-h) + var(--ground-border) - 4px);
  z-index: 3;
  will-change: transform;
}

.monster[hidden] { display: none; }

.m-art {
  width: 100%;
  height: 100%;
  transform-origin: 85% 100%;
}

.m-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: bob 0.6s ease-in-out infinite alternate;
}

.m-jaw {
  transform-box: fill-box;
  transform-origin: 100% 0;
  animation: jaw-idle 1.2s ease-in-out infinite alternate;
}

.m-tongue { animation: tongue 0.9s steps(1) infinite; }

.m-wing {
  transform-box: fill-box;
  transform-origin: 0 100%;
  animation: wing 0.5s ease-in-out infinite alternate;
}

.m-art.is-jolt { animation: jolt 0.22s ease-out; }

.monster.is-dying .m-art { animation: die 0.6s ease-in forwards; }

/* Enraged after a miss: red glow, faster bob, speed lines and a speed badge. */
.monster.is-enraged .m-svg {
  animation-duration: 0.28s;
  filter: drop-shadow(0 0 7px rgba(232, 39, 45, 0.95));
}

.monster.is-enraged::before {
  content: "";
  position: absolute;
  left: 78%;
  top: 25%;
  width: 45%;
  height: 50%;
  background: repeating-linear-gradient(transparent 0 7px, rgba(255, 255, 255, 0.85) 7px 9px);
  border-radius: 4px;
  animation: speed-lines 0.25s linear infinite;
}

.m-speed {
  position: absolute;
  left: 50%;
  top: -22px;
  padding: 1px 9px;
  border: 2px solid var(--yellow);
  border-radius: 999px;
  background: var(--red-dark);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
  text-shadow: var(--text-shadow);
  transform: translateX(-50%);
  animation: badge-pop 0.35s ease-out;
}

.m-speed[hidden] { display: none; }

.m-art.atk-jump { animation: jump 0.4s ease-out; }
.m-art.atk-chomp .m-jaw { animation: chomp 0.2s ease-in-out 6 alternate; }
.m-art.atk-rear { transform: rotate(12deg); transition: transform 0.3s ease-out; }
.m-art.jaw-open .m-jaw { animation: none; transform: rotate(-22deg); transition: transform 0.2s; }
.m-art.atk-roll { animation: roll 0.32s ease-in-out 0.3s 4 alternate; }

/* Gorilla: the front arm pivots at the shoulder (60, 48 in the 120×100 box). */
.m-arm {
  transform-box: view-box;
  transform-origin: 60px 48px;
  animation: arm-swing 1.2s ease-in-out infinite alternate;
}

.m-art.atk-punch .m-arm { animation: punch 0.7s ease-in forwards; }

/* ── 4. Answers ─────────────────────────────────────────────────────── */
.answers-wrap {
  position: relative;
  flex: none;
  background: var(--ink);
}

/* Post-miss lockout: covers the options with a countdown. */
.lock {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  background: rgba(58, 20, 89, 0.55);
  font-size: 1.15rem;
  font-weight: 800;
  text-shadow: var(--text-shadow);
}

.lock[hidden] { display: none; }

.lock-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px 10px;
  border: 3px solid var(--yellow);
  border-radius: 999px;
  background: var(--red-dark);
  box-shadow: var(--candy-shadow);
}

.lock-icon {
  display: inline-flex;
  color: var(--yellow);
  animation: lock-shake 0.5s ease-in-out;
}

.answers.is-locked .answer { filter: grayscale(0.7) brightness(0.85); }

.answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 38dvh;
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--ink);
}

.answers:empty { padding: 0; }

.answer {
  --bg: var(--gray);
  --fg: var(--ink);
  flex: none; /* never shrink inside the scrolling list: long text must push, not overlap */
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 8px 14px 11px;
  border: 0;
  border-radius: 16px;
  background: var(--bg);
  color: var(--fg);
  box-shadow: var(--candy-shadow);
  font-size: clamp(14px, 0.9vw + 11px, 17px);
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: transform 0.08s, filter 0.15s;
}

.answer:hover:not(:disabled) { filter: brightness(1.06); }
.answer:active:not(:disabled) { transform: translateY(2px); }

/* Text colors picked for AA contrast on each fill. */
.answer-0 { --bg: var(--red-dark); --fg: var(--white); }
.answer-1 { --bg: var(--orange); --fg: var(--ink); }
.answer-2 { --bg: var(--yellow); --fg: var(--ink); }
.answer-3 { --bg: var(--green); --fg: var(--ink); }
.answer-4 { --bg: var(--blue); --fg: var(--ink); }
.answer-5 { --bg: var(--purple); --fg: var(--white); }

.answer-key {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  font-weight: 800;
}

.answer-text { flex: 1; }

.answer:disabled { cursor: default; }

.answer.is-out {
  --bg: var(--gray);
  --fg: #4a3d5c;
  box-shadow: none;
  opacity: 0.75;
}

.answer.is-out .answer-text { text-decoration: line-through; }

.answer.is-right { outline: 4px solid var(--white); outline-offset: -4px; }

.answer.is-answer {
  outline: 4px solid var(--white);
  outline-offset: 2px;
}

/* ── 5. Overlays ────────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(30, 8, 50, 0.6);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.overlay[hidden] { display: none; }

.card {
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - 32px);
  padding: 20px 18px;
  overflow-y: auto;
  border: 4px solid var(--yellow);
  border-radius: 26px;
  background: linear-gradient(var(--card-top), var(--card-bottom));
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.3);
  text-align: center;
  text-shadow: var(--text-shadow);
  animation: card-in 0.25s ease-out;
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 5vw, 2rem);
  line-height: 1.2;
}

.card-title .accent { color: var(--yellow); }
.card-title.is-record .icon { animation: record-glow 0.9s ease-in-out infinite alternate; }

.card-lead { margin: 0 0 12px; line-height: 1.45; }
.card-meta { margin: 8px 0; opacity: 0.95; }

/* Boxes group related content inside a card. */
.box {
  margin: 0 0 12px;
  padding: 10px 12px 12px;
  border: 0;
  border-radius: 18px;
  background: rgba(40, 10, 60, 0.45);
  text-align: left;
}

.box-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  color: var(--yellow);
  font-size: 1rem;
  font-weight: 800;
}

legend.box-title {
  float: left; /* lets the legend sit inside the box padding like a heading */
  width: 100%;
  margin-bottom: 8px;
}

/* "Como jogar" accordion: a button that opens a list. */
.box-toggle {
  width: 100%;
  min-height: 36px;
  border: 0;
  background: none;
  text-align: left;
  text-shadow: inherit;
  cursor: pointer;
}

.box-hint {
  margin-left: auto;
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.85;
}

.box-chevron {
  display: inline-flex;
  color: var(--white);
  transition: transform 0.2s;
}

.howto.is-open .box-chevron { margin-left: auto; transform: rotate(180deg); }
.howto.is-open .box-hint { display: none; }
.howto .rules[hidden] { display: none; }

/* When open, the box takes the card's leftover height and the list scrolls
   inside it, so the purple card never grows past the screen. */
.card > .howto.is-open {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  min-height: 140px;
}

.howto .rules {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 8px;
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: card-in 0.2s ease-out;
}

/* Visible, thin scrollbars for the inner scroll areas. */
.howto .rules,
.card > .qa,
.qpanel-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(251, 213, 26, 0.7) transparent;
}

/* Character picker */
.pick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  clear: both;
}

.pick-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px 8px;
  border: 3px solid transparent;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.pick-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pick-card:hover { background: rgba(255, 255, 255, 0.18); }

.pick-card:has(input:checked) {
  border-color: var(--yellow);
  background: rgba(251, 213, 26, 0.22);
  transform: translateY(-2px);
}

.pick-card:has(input:focus-visible) { outline: 3px solid var(--white); outline-offset: 2px; }

.pick-art .h-svg {
  position: static;
  display: block;
  width: 72px;
  height: 78px;
}

.pick-card:has(input:checked) .pick-art .h-svg { animation: hop 0.5s ease-out; }

.pick-hint {
  margin: 8px 0 0;
  color: var(--yellow);
  font-size: 0.9rem;
  text-align: center;
}

.pick-hint[hidden] { display: none; }

/* "How to play": one icon per rule. */
.rules {
  margin: 0;
  padding: 0;
  list-style: none;
  line-height: 1.4;
}

.rules li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.95rem;
}

.rules li + li { margin-top: 6px; }
.rules .icon { flex: none; margin-top: 2px; color: var(--yellow); }

/* Small labelled numbers: last game, best score. */
.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 12px;
}

.stat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 6px;
  border-radius: 16px;
  background: rgba(40, 10, 60, 0.45);
}

.stat-tile strong { font-size: 1.15rem; }

/* Cards are flex columns: the question/answer block takes the leftover
   height and scrolls inside, so numbers and buttons fit without scrolling. */
.card {
  display: flex;
  flex-direction: column;
}

.card > * { flex: none; }

.card > .qa {
  flex: 0 1 auto;
  min-height: 90px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.stat-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0.95;
}

/* Game Over / history numbers. */
.score-big {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 12px;
  font-size: 1.1rem;
  font-weight: 700;
}

.score-big strong { font-size: 2.4rem; line-height: 1; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 12px;
}

.stat-grid div {
  padding: 6px 4px;
  border-radius: 14px;
  background: rgba(40, 10, 60, 0.45);
}

.stat-grid dt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
}

.stat-grid dt .icon { color: var(--yellow); }
.stat-grid dd { margin: 2px 0 0; font-size: 1.3rem; font-weight: 800; }

.lives-left {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 0 10px;
  font-weight: 700;
}

.lives-hearts { display: inline-flex; gap: 2px; }

.warn {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(58, 20, 89, 0.7);
  color: var(--yellow);
  font-weight: 700;
}

.qa { margin: 0 0 12px; }

.qa h3 {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 8px 0 2px;
  color: var(--yellow);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

.qa h3:first-child { margin-top: 0; }

.qa p {
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.qa-answer {
  color: #c8f5a8;
  font-weight: 800;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 140px;
  min-height: 48px;
  padding: 10px 22px 13px;
  border: 0;
  border-radius: 999px;
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 800;
  text-shadow: var(--text-shadow);
  box-shadow: var(--candy-shadow);
  cursor: pointer;
}

.card-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  padding-left: 12px;
  padding-right: 12px;
}

.btn .icon { filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.3)); }

.card-actions-small {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr; /* "Compartilhar" needs the most room */
  margin-top: 8px;
  gap: 8px;
}

.card-actions .btn { white-space: nowrap; }

.btn-small {
  min-height: 44px;
  padding: 6px 10px 9px;
  background: rgba(40, 10, 60, 0.55);
  font-size: 0.9rem;
  gap: 6px;
}

.btn-small:hover { background: rgba(40, 10, 60, 0.75); }
.btn:disabled { cursor: not-allowed; opacity: 0.55; }
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn-go { background: linear-gradient(#3f9a2c, var(--green-dark)); }
.btn-alt { background: var(--ink-2); }
.btn-danger { background: var(--red-dark); }

.confirm {
  margin: 0;
  border: 3px solid var(--yellow);
  text-align: center;
  animation: card-in 0.2s ease-out;
}

.confirm[hidden],
.card-actions[hidden] { display: none; }

.confirm p { margin: 0 0 10px; font-weight: 700; line-height: 1.4; }

.hist-list {
  margin: 8px 0 12px;
  padding: 0;
  list-style: none;
  text-align: left;
}

.hist-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.hist-label { flex: 1 1 60%; }

.hist-actions {
  display: flex;
  flex-basis: 100%;
  justify-content: flex-end;
  gap: 6px;
}

.hist-export {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 2px 10px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(40, 10, 60, 0.5);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.hist-export:hover { background: rgba(40, 10, 60, 0.8); }

/* The list scrolls inside the history card instead of growing it. */
.card > .hist-list {
  flex: 0 1 auto;
  min-height: 80px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.hist-item + .hist-item { margin-top: 4px; }
.hist-item.is-latest { background: rgba(251, 213, 26, 0.25); font-weight: 800; }
.hist-score { white-space: nowrap; }

.noscript {
  position: fixed;
  inset: auto 0 0;
  margin: 0;
  padding: 12px;
  background: var(--red-dark);
  text-align: center;
}

/* ── Effects ────────────────────────────────────────────────────────── */
.bullet {
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--orange), var(--yellow));
  box-shadow: 0 0 8px var(--yellow);
}

.confetti {
  position: absolute;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  animation: confetti 0.9s ease-out forwards;
}

.pop {
  position: absolute;
  color: var(--white);
  font-size: 1.4rem;
  font-weight: 900;
  white-space: nowrap;
  text-shadow: 0 2px 0 var(--ink), 0 0 6px var(--ink);
  transform: translateX(-50%);
  animation: pop-up 1.05s ease-out forwards;
}

.pop-points { color: var(--yellow); }
.pop-miss { color: var(--red); font-size: 2rem; }
.pop-skip { color: #f0c8ff; }
.pop-attack { color: var(--yellow); font-size: 1.6rem; letter-spacing: 0.04em; }

.balloon {
  position: absolute;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 90%;
  white-space: nowrap;
  padding: 8px 16px;
  border: 3px solid var(--yellow);
  border-radius: 999px;
  background: var(--ink-2);
  font-weight: 800;
  text-align: center;
  text-shadow: var(--text-shadow);
  animation: balloon 2.3s ease-out forwards;
}

.muzzle {
  position: absolute;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -6px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 20%, var(--yellow) 45%, rgba(247, 147, 30, 0) 70%);
  animation: flash 0.16s ease-out forwards;
}

/* "Downgrade" sign after a miss. */
.penalty {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transform: translate(-50%, -50%);
  animation: penalty 1.7s ease-out forwards;
}

.balloon-icon-heart { color: #ff4d6d; }
.balloon-icon-star { color: var(--yellow); }

.penalty-title,
.penalty-speed {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.penalty-title {
  padding: 4px 16px;
  border: 3px solid var(--white);
  border-radius: 999px;
  background: var(--red-dark);
  font-size: 1.5rem;
  font-weight: 900;
  text-shadow: var(--text-shadow);
  box-shadow: var(--candy-shadow);
}

.penalty-speed {
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--yellow);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  white-space: nowrap;
  animation: arrow-up 0.5s ease-in-out 3 alternate;
}

.fire {
  position: absolute;
  height: 18px;
  border-radius: 9px;
  background: linear-gradient(to left, #fff59a, var(--yellow) 20%, var(--orange) 55%, var(--red));
  box-shadow: 0 0 14px var(--orange);
  transform-origin: right center;
  animation: fire-grow 0.5s ease-out forwards, flicker 0.12s linear infinite alternate;
}

/* ── Keyframes ──────────────────────────────────────────────────────── */
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-4px); } }
@keyframes jaw-idle { from { transform: rotate(0); } to { transform: rotate(-5deg); } }
@keyframes chomp { from { transform: rotate(0); } to { transform: rotate(-24deg); } }
@keyframes wing { from { transform: rotate(0); } to { transform: rotate(-14deg); } }
@keyframes tongue { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes jolt {
  0% { transform: translateX(0); }
  30% { transform: translateX(-10px) rotate(-4deg); }
  100% { transform: translateX(0); }
}
@keyframes die { to { transform: rotate(-200deg) scale(0.2); opacity: 0; } }
@keyframes jump {
  0% { transform: translateY(0); }
  45% { transform: translateY(-28px) rotate(-6deg); }
  100% { transform: translateY(0); }
}
@keyframes roll { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
@keyframes squeeze { from { transform: scale(1); } to { transform: scale(0.86, 0.94); } }
@keyframes recoil { 50% { transform: translateX(-4px); } }
@keyframes blink { 0%, 20%, 40%, 60%, 80% { opacity: 0.15; } 10%, 30%, 50%, 70%, 90%, 100% { opacity: 1; } }
@keyframes danger-pulse { from { opacity: 0.45; } to { opacity: 1; } }
@keyframes drift { to { transform: translateX(40px); } }
@keyframes confetti {
  to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}
@keyframes pop-up {
  0% { transform: translate(-50%, 6px) scale(0.7); opacity: 0; }
  20% { transform: translate(-50%, 0) scale(1.1); opacity: 1; }
  100% { transform: translate(-50%, -46px) scale(1); opacity: 0; }
}
@keyframes balloon {
  0% { transform: translate(-50%, -12px) scale(0.6); opacity: 0; }
  12% { transform: translate(-50%, 0) scale(1.06); opacity: 1; }
  20% { transform: translate(-50%, 0) scale(1); }
  80% { opacity: 1; }
  100% { transform: translate(-50%, -8px); opacity: 0; }
}
@keyframes fire-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes flicker { from { opacity: 0.85; } to { opacity: 1; } }
@keyframes card-in { from { transform: scale(0.92); opacity: 0; } }
@keyframes float { from { transform: translateY(0); } to { transform: translateY(-4px); } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}
@keyframes record-glow { from { transform: scale(1); } to { transform: scale(1.08); } }
@keyframes speed-lines { from { transform: translateX(0); opacity: 0.9; } to { transform: translateX(14px); opacity: 0.4; } }
@keyframes badge-pop { from { transform: translateX(-50%) scale(0.4); } 70% { transform: translateX(-50%) scale(1.15); } }
@keyframes lock-shake { 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
@keyframes flash { from { transform: scale(0.4); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
@keyframes penalty {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  12% { transform: translate(-50%, -50%) scale(1.12); opacity: 1; }
  22% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { transform: translate(-50%, -80%) scale(0.95); opacity: 0; }
}
@keyframes arrow-up { from { transform: translateY(0); } to { transform: translateY(-4px); } }
@keyframes sway { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
@keyframes hop { 40% { transform: translateY(-8px); } }
@keyframes twinkle { from { filter: brightness(0.8); } to { filter: brightness(1.3); } }
@keyframes rain-fall { to { transform: translate(-12px, 70px); } }
@keyframes lightning { 0%, 30% { opacity: 0.75; } 15%, 45% { opacity: 0.1; } 100% { opacity: 0; } }
@keyframes fly {
  from { transform: translateX(var(--from)); }
  to { transform: translateX(var(--to)); }
}
@keyframes flap { from { transform: scaleY(1); } to { transform: scaleY(0.35); } }
@keyframes run {
  from { transform: translateX(var(--from)); }
  to { transform: translateX(var(--to)); }
}
@keyframes hop-small {
  0%, 100% { transform: translateY(0) rotate(0); }
  40% { transform: translateY(-9px) rotate(-8deg); }
  70% { transform: translateY(-3px) rotate(4deg); }
}
@keyframes scurry { from { transform: translateY(0); } to { transform: translateY(-2px); } }
@keyframes ice-in { from { transform: scale(1.3); opacity: 0; } }
@keyframes arm-swing { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
@keyframes punch {
  0% { transform: rotate(0); }
  55% { transform: rotate(125deg); }   /* wind up: fist over the head */
  72% { transform: rotate(-35deg); }   /* slam down on the hero's head */
  100% { transform: rotate(-20deg); }
}
@keyframes dizzy {
  from { transform: rotate(0) translateX(0); }
  50% { transform: rotate(8deg) translateX(3px); }
  to { transform: rotate(0) translateX(0); }
}
@keyframes ice-crack {
  30% { transform: scale(1.06) rotate(-2deg); opacity: 1; }
  100% { transform: scale(1.25); opacity: 0; }
}
@keyframes poof {
  30% { transform: scale(1.1); opacity: 1; filter: blur(0); }
  100% { transform: translateY(-20px) scale(0.2); opacity: 0; filter: blur(4px); }
}

/* ── Printable report (Game Over → PDF) ─────────────────────────────── */
.report { display: none; }

@media print {
  @page { margin: 14mm; }

  html,
  body {
    height: auto;
    overflow: visible;
    background: #fff;
    color: #1f1a24;
  }

  .app,
  .overlay,
  .sr-only,
  .noscript { display: none !important; }

  .report {
    display: block;
    font-family: var(--font);
    font-size: 11pt;
    line-height: 1.45;
  }

  .report h1 { margin: 0 0 2pt; font-size: 20pt; color: var(--ink); }
  .report h2 { margin: 16pt 0 6pt; font-size: 13pt; color: var(--ink); }
  .report-meta { margin: 0; color: #5b5266; }

  .report-stats {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6pt;
    margin: 12pt 0 0;
  }

  .report-stats div {
    padding: 6pt;
    border: 1px solid #d9d2e0;
    border-radius: 6pt;
    text-align: center;
  }

  .report-stats dt { font-size: 8pt; color: #5b5266; }
  .report-stats dd { margin: 0; font-size: 14pt; font-weight: 700; }

  .report-bar { display: block; width: 100%; height: auto; }

  .report-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4pt 14pt;
    margin: 8pt 0 0;
    padding: 0;
    list-style: none;
  }

  .report-swatch {
    display: inline-grid;
    place-items: center;
    width: 14pt;
    height: 14pt;
    border-radius: 3pt;
    color: #1f1a24;
    font-size: 9pt;
    font-weight: 700;
    vertical-align: -2pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .report-bar rect { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .report-list { padding-left: 18pt; }

  .report-item {
    margin-bottom: 9pt;
    break-inside: avoid;
  }

  .report-badge {
    display: inline-block;
    padding: 0 6pt;
    border: 1.5pt solid;
    border-radius: 99pt;
    font-size: 8.5pt;
    font-weight: 700;
  }

  .report-item p { margin: 2pt 0 0; }
  .report-q { font-weight: 700; }
  .report-wrong { color: #a12626; }
  .report-a { color: #006300; font-weight: 700; }
  .report-why { color: #3d3546; }
  .report-footer { margin-top: 16pt; font-size: 8.5pt; color: #5b5266; }
}

/* ── Small screens ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .hud-title { display: none; }
  .hud { justify-content: space-between; gap: 4px; }
  .hud-item { gap: 3px; padding: 2px 6px; font-size: 0.86rem; }
  .hud-lives .icon { width: 15px; height: 15px; }
  .hud-icon .icon { width: 16px; height: 16px; }
  .dot { width: 8px; height: 8px; }
  .hud-btn { min-width: 32px; }
  .card { padding: 16px 12px; }
  .card-actions { gap: 8px; }
  .card-actions .btn { gap: 6px; font-size: 0.95rem; padding-left: 8px; padding-right: 8px; }
  .card-actions .btn:first-child:nth-last-child(2) { flex-grow: 1.3; } /* "Jogar de novo" beside "Histórico" */
  .card-actions-small .btn { font-size: 0.82rem; gap: 4px; }
  .qpanel-label { letter-spacing: 0.04em; font-size: 0.9rem; }
  .qpanel-topic { display: none; }
}

/* ── Reduced motion: no bobbing, tremors or confetti; the game stays playable ── */
@media (prefers-reduced-motion: reduce) {
  .m-svg,
  .m-jaw,
  .m-wing,
  .m-tongue,
  .cloud,
  .m-art.is-jolt,
  .m-art.atk-jump,
  .m-art.atk-roll,
  .m-arm,
  .hero.fate-bonked .h-stars,
  .m-art.atk-chomp .m-jaw,
  .hero.fate-squeezed .h-coils,
  .world.is-danger::after,
  .qpanel,
  .field.is-shaking,
  .monster.is-enraged::before,
  .h-ponytail,
  .hud-best.is-record,
  .card-title .trophy,
  .penalty-speed,
  .lock-icon,
  .stars,
  .bird-wing,
  .critter svg,
  .rain::before,
  .rain::after { animation: none; }
  .card { animation: none; }
}
