/* Engine styles. Character colors arrive as --c-* custom properties from character.json. */
:root {
  --c-primary: #754329;
  --c-cream: #F1DFC0;
  --c-accent: #244936;
  --c-dark: #30251F;
  --bg: #1b3628;
  --panel: #fbf3e4;
  --danger: #c0392b;
  --warn: #e08a1e;
  --ok: #4f9a55;
  --radius: 18px;
  --font: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-display: "Arial Black", "Segoe UI Black", Impact, system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* No grey/blue flash on tap (Android); keyboard focus still gets the outline below. */
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
a, button, label, summary, .stage, .actor-body, .slot-btn { -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--c-dark);
  background:
    radial-gradient(ellipse at top, #2c5a3f 0%, transparent 60%),
    var(--bg);
  touch-action: manipulation;
  overflow-x: hidden;
}

a { color: inherit; }

:focus-visible { outline: 3px solid #ffd166; outline-offset: 3px; }
/* Mouse and touch focus: no outline. Keyboard focus keeps :focus-visible above. */
:focus:not(:focus-visible) { outline: none; }

/* ---------- header ---------- */
.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 6px;
}
.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  line-height: 1;
}
.logo-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 7vw, 2.6rem);
  color: var(--c-cream);
  letter-spacing: .01em;
  text-shadow: 0 3px 0 var(--c-primary), 0 5px 0 var(--c-dark);
  transform: rotate(-2deg);
}
.logo-tagline {
  margin-top: 8px;
  font-size: .8rem;
  color: #b9d3bf;
  letter-spacing: .08em;
}
.menu {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, .25);
  border-radius: 999px;
  padding: 4px;
}
.menu a {
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--c-cream);
  text-decoration: none;
  font-weight: 700;
  font-size: .9rem;
}
.menu a[aria-current="page"] { background: var(--c-cream); color: var(--c-accent); }

/* Sound on/off: next to the menu on phones (same row, so the header doesn't grow),
   at the end of the header row on desktop. */
.site-header { flex-flow: row wrap; justify-content: center; column-gap: 8px; }
.site-header .logo { flex-basis: 100%; }
.sound-toggle {
  flex: none;
  width: 36px;
  height: 36px;
  padding: 7px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, .25);
  color: var(--c-cream);
  cursor: pointer;
}
.sound-icon { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sound-speaker { fill: currentColor; }
.sound-toggle[aria-pressed="true"] .sound-off,
.sound-toggle[aria-pressed="false"] .sound-waves { display: none; }
.sound-toggle[aria-pressed="false"] { opacity: .75; }

/* ---------- game column ---------- */
/* Header + game fill exactly one screen; the stage takes whatever height is left. */
.screen {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
.game {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.game > .hud, .game > .poke { flex: none; }

/* ---------- stage ---------- */
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: var(--radius);
  border: 4px solid var(--c-dark);
  box-shadow: 0 6px 0 var(--c-dark), inset 0 0 0 3px rgba(255, 255, 255, .25);
  background: #cfe6d4 center bottom / cover no-repeat;
  overflow: hidden;
  padding: 12px 12px 0;
  user-select: none;
  -webkit-user-select: none;
  flex: 1 1 auto;
  min-height: 0;
}
/* The bear is a square sized from the space left under the bubble. */
.actor-area {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  container-type: size;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.bubble {
  position: relative;
  z-index: 3;
  margin: 0;
  width: 100%;
  min-height: 3.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* Extra room at the bottom: the tail's tip reaches about 13px up into the bubble. */
  padding: 10px 14px 16px;
  background: #fff;
  border: 3px solid var(--c-dark);
  border-radius: 16px;
  font-weight: 700;
  font-size: clamp(1rem, 4.2vw, 1.15rem);
  line-height: 1.25;
}
.bubble::after {
  content: "";
  position: absolute;
  bottom: -14px;
  left: 50%;
  width: 22px;
  height: 22px;
  background: #fff;
  border-right: 3px solid var(--c-dark);
  border-bottom: 3px solid var(--c-dark);
  transform: translateX(-50%) rotate(45deg);
  z-index: -1; /* under the text, still over the bubble's own border so the join looks seamless */
}
.bubble.is-new { animation: bubble-pop .22s ease-out; }
.bubble.is-loud { font-family: var(--font-display); letter-spacing: .02em; }

.actor {
  position: relative;
  width: min(100cqw, 102cqh, 520px);
  aspect-ratio: 1 / 1;
  flex: none;
}
.actor-body {
  position: absolute;
  inset: 0;
  transform-origin: 50% 96%;
  cursor: pointer;
}
.actor-body img {
  display: block;
  width: 100%;
  height: 100%;
  -webkit-user-drag: none;
  pointer-events: none;
}
.actor-props {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.overlay-text {
  font-family: var(--font-display);
  fill: var(--c-dark);
  text-anchor: middle;
  dominant-baseline: central;
}
.prop-twitch { animation: blink-twitch .5s steps(2, jump-none) infinite; }
.actor-zones {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: none;
}
.show-zones .actor-zones { display: block; }
.actor-zones ellipse { fill: rgba(255, 0, 128, .18); stroke: #ff0080; stroke-width: 4; }
.actor-zones text { font: 700 28px sans-serif; fill: #ff0080; text-anchor: middle; }

.actor-shadow {
  position: absolute;
  top: 93.5%;
  height: 5%;
  left: 25%;
  width: 50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(30, 20, 10, .35), transparent);
  transition: left .15s, width .15s;
}

.actor-fx { position: absolute; inset: 0; pointer-events: none; }

.zzz {
  position: absolute;
  font-family: var(--font-display);
  color: #fff;
  -webkit-text-stroke: 2px var(--c-dark);
  paint-order: stroke;
  font-size: clamp(1.2rem, 5vw, 1.8rem);
  animation: zzz 2.4s ease-in infinite;
  opacity: 0;
}
.zzz:nth-child(2) { animation-delay: .8s; font-size: clamp(1rem, 4vw, 1.4rem); }
.zzz:nth-child(3) { animation-delay: 1.6s; font-size: clamp(.8rem, 3vw, 1.1rem); }

.zone-pop {
  position: absolute;
  z-index: 4;
  transform: translate(-50%, -50%);
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--c-dark);
  color: var(--c-cream);
  font-weight: 800;
  font-size: .85rem;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  animation: pop-up .7s ease-out forwards;
}

.stage-tag:not([hidden]) { animation: tag-pop 1.8s ease-out forwards; }
.stage-tag {
  /* Pinned to the speech bubble's corner so it never covers the character. */
  position: absolute;
  z-index: 5;
  top: 2px;
  right: 6px;
  margin: 0;
  padding: 3px 10px;
  background: #ffd166;
  border: 3px solid var(--c-dark);
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: .8rem;
  transform: rotate(4deg);
}

/* ---------- HUD ---------- */
.hud {
  background: var(--panel);
  border: 4px solid var(--c-dark);
  border-radius: var(--radius);
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hud-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.counter { margin: 0; font-size: 1rem; white-space: nowrap; }
.counter strong { font-family: var(--font-display); font-size: 1.6rem; color: var(--c-primary); }
.patience { flex: 1; display: flex; align-items: center; gap: 8px; max-width: 240px; }
.patience-label { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.meter {
  flex: 1;
  height: 14px;
  border: 2px solid var(--c-dark);
  border-radius: 999px;
  background: #e8dcc6;
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  width: 100%;
  background: var(--ok);
  transition: width .2s ease-out, background-color .3s;
}

.progress {
  position: relative;
  display: flex;
  height: 30px;
  border: 2px solid var(--c-dark);
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(90deg, #8fb996, #e7b05a 35%, #d9663c 65%, #8e2c6b);
}
/* Covers the not-yet-reached part, so the gradient stays fixed to the phases. */
.progress-rest {
  position: absolute;
  inset: 0 0 0 auto;
  width: 100%;
  background: #e8dcc6;
  transition: width .15s ease-out;
}
.progress-seg {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 2px solid rgba(48, 37, 31, .5);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .05em;
  color: rgba(48, 37, 31, .55);
}
.progress-seg:first-of-type { border-left: 0; }
.progress-seg.is-active { color: var(--c-dark); font-size: .8rem; }

/* ---------- POKE button ---------- */
.poke {
  font-family: var(--font-display);
  font-size: clamp(2rem, 10vw, 2.8rem);
  letter-spacing: .06em;
  color: #fff;
  background: linear-gradient(#e0603a, #b8391f);
  border: 4px solid var(--c-dark);
  border-radius: 999px;
  padding: 14px 24px 18px;
  box-shadow: 0 8px 0 var(--c-dark);
  cursor: pointer;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .3);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .05s, box-shadow .05s;
}
.poke:active, .poke.is-pressed { transform: translateY(6px); box-shadow: 0 2px 0 var(--c-dark); }
.poke:disabled { filter: grayscale(.7); cursor: default; }
.poke-small { font-size: 1.2rem; padding: 12px 22px 14px; box-shadow: 0 6px 0 var(--c-dark); }

/* ---------- end screen ---------- */
.end {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 25, 20, .72);
}
.end[hidden] { display: none; }
.end-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 4px solid var(--c-dark);
  border-radius: var(--radius);
  padding: 22px 18px;
  text-align: center;
  animation: bubble-pop .3s ease-out;
}
.end-art {
  width: 150px;
  aspect-ratio: 1 / 1;
  margin: -6px auto 4px;
  position: relative;
}
.end-art .actor-body { cursor: default; animation: none; }
.end-ending { margin: 0 0 8px; font-weight: 800; font-size: 1.1rem; }
.end-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--c-accent);
  color: var(--c-cream);
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  vertical-align: 2px;
}
.end-badge.is-new { background: #ffd166; color: var(--c-dark); }
.end-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--danger);
}
.end-line { margin: 0 0 14px; font-weight: 700; }
.end-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 18px;
}
.end-stats div { background: #efe3cb; border-radius: 10px; padding: 8px; }
.end-stats dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
.end-stats dd { margin: 2px 0 0; font-family: var(--font-display); font-size: 1.3rem; }

/* ---------- daily bonus ---------- */
.bonus {
  position: absolute;
  z-index: 3;
  left: 8px;
  bottom: 8px;
  margin: 0;
  max-width: calc(100% - 16px);
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff3c4;
  border: 2px solid #e0a92e;
  font-size: .72rem;
  line-height: 1.25;
  pointer-events: none;
}
.bonus span { color: #6b4a10; }
@media (max-width: 420px) { .bonus span { display: none; } }
.bonus strong { text-transform: uppercase; letter-spacing: .04em; color: #9a6a10; margin-right: 4px; }

/* ---------- badges ---------- */
.badge { display: block; width: 100%; height: auto; overflow: visible; }
.badge-qm { font: 900 54px var(--font-display); fill: #6b5a4a; text-anchor: middle; }
.badge-shine { animation: badge-shine 3.2s ease-in-out infinite; }
.badge-smoke { animation: smoke 4s ease-in-out infinite alternate; transform-origin: 120px 120px; }
.badge-super-rare .badge-glow, .badge-iconic .badge-glow { animation: glow 2.4s ease-in-out infinite alternate; }
@keyframes badge-shine { 0%, 40% { transform: translateX(0); } 100% { transform: translateX(480px); } }
@keyframes smoke { from { transform: rotate(-8deg) scale(1); opacity: .8; } to { transform: rotate(8deg) scale(1.05); opacity: 1; } }
@keyframes glow { from { opacity: .45; } to { opacity: .9; } }

/* ---------- reward (badge unlock) ---------- */
.end-card { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; }
.reward {
  margin: 0 0 16px;
  padding: 12px 10px 14px;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 35%, #fff 0%, #f1e4cb 70%);
  border: 3px solid var(--c-dark);
}
.reward-kicker { margin: 0 0 6px; font-family: var(--font-display); font-size: 1.05rem; color: var(--c-accent); }
.reward-stage {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 0 auto 6px;
  display: grid;
  place-items: center;
}
.reward-rarity { margin: 0; font-weight: 900; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; }
.reward-name { margin: 2px 0 4px; font-family: var(--font-display); font-size: 1.25rem; }
.reward-desc { margin: 0 0 10px; font-style: italic; }
.rarity-common { color: #7a4f2c; }
.rarity-rare { color: #2f6aa8; }
.rarity-super-rare { color: #7b3fc4; }
.rarity-iconic { color: #b07a10; }
.rarity-secret { color: #5a2c9a; }
.fact {
  text-align: left;
  background: #e9f2e4;
  border: 2px solid var(--c-accent);
  border-radius: 10px;
  padding: 8px 10px;
}
.fact-label {
  display: inline-block;
  margin-bottom: 2px;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-accent);
}
.fact p { margin: 0; font-size: .9rem; line-height: 1.35; }
.btn-secondary {
  margin-top: 12px;
  font: 800 1rem var(--font);
  padding: 8px 18px;
  border-radius: 999px;
  border: 3px solid var(--c-dark);
  background: var(--c-cream);
  cursor: pointer;
}

/* Sealed badge, coloured by rarity so the rarity is clear before it opens. */
.seal {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 5px solid var(--c-dark);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, .18), 0 6px 0 var(--c-dark);
  padding: 0;
}
.seal-common { background: radial-gradient(circle at 35% 30%, #c48a57, #6b4326); }
.seal-rare { background: radial-gradient(circle at 35% 30%, #e3f0fb, #5d86b3); }
.seal-super-rare { background: radial-gradient(circle at 35% 30%, #d9b3ff, #5b2a9a); box-shadow: 0 0 28px #b07cf0, 0 6px 0 var(--c-dark); }
.seal-iconic { background: radial-gradient(circle at 35% 30%, #fff1b0, #c9922b); box-shadow: 0 0 36px #ffd25a, 0 6px 0 var(--c-dark); }
.seal-secret { background: radial-gradient(circle at 35% 30%, #5a4870, #15101d); box-shadow: 0 0 36px #8b4dff, 0 6px 0 var(--c-dark); }
.seal-mark { font: 900 64px var(--font-display); color: rgba(255, 255, 255, .85); text-shadow: 0 4px 0 rgba(0, 0, 0, .25); }
.seal-crack { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.seal-crack path { fill: none; stroke: var(--c-dark); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 160; stroke-dashoffset: 160; }
.seal.is-shaking { animation: seal-shake .3s ease-in-out 3; }
.seal.is-shaking-long { animation: seal-shake .3s ease-in-out 6, seal-grow 1.8s ease-in forwards; }
.seal.is-cracking .seal-crack { opacity: 1; }
.seal.is-cracking .seal-crack path { animation: crack .35s ease-out forwards; }
.seal.is-cracking { animation: seal-shake .12s linear infinite; }
@keyframes seal-shake {
  0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg) translateX(-3px); } 75% { transform: rotate(8deg) translateX(3px); }
}
@keyframes seal-grow { to { scale: 1.08; } }
@keyframes crack { to { stroke-dashoffset: 0; } }

.reveal { position: relative; width: 168px; animation: reveal .5s cubic-bezier(.2, .8, .3, 1.3) both; }
.reveal::before {
  /* burst of rays behind the badge */
  content: "";
  position: absolute;
  inset: -40px;
  z-index: -1;
  background: repeating-conic-gradient(rgba(255, 210, 90, .55) 0 10deg, transparent 10deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%);
  mask: radial-gradient(circle, #000 30%, transparent 70%);
  animation: rays 6s linear infinite;
}
.reveal-rare::before { background: repeating-conic-gradient(rgba(110, 160, 220, .5) 0 10deg, transparent 10deg 24deg); }
.reveal-super-rare::before { background: repeating-conic-gradient(rgba(176, 124, 240, .55) 0 10deg, transparent 10deg 24deg); }
.reveal-secret::before { background: repeating-conic-gradient(rgba(139, 77, 255, .55) 0 10deg, transparent 10deg 24deg); }
.reveal-common::before { opacity: .5; }
.reveal-big { animation: reveal-big .9s cubic-bezier(.2, .8, .3, 1.2) both; }
@keyframes reveal { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes reveal-big {
  0% { transform: scale(.1); opacity: 0; filter: brightness(3); }
  60% { transform: scale(1.15); opacity: 1; filter: brightness(1.6); }
  100% { transform: scale(1); filter: brightness(1); }
}
@keyframes rays { to { transform: rotate(360deg); } }

.site-footer { text-align: center; color: #9dbba5; font-size: .8rem; padding: 12px 16px 28px; }
.noscript { text-align: center; color: #fff; }

/* ---------- animations ---------- */
@keyframes bubble-pop { from { transform: scale(.92); } to { transform: scale(1); } }
@keyframes pop-up {
  from { opacity: 1; transform: translate(-50%, -50%) scale(.8); }
  to { opacity: 0; transform: translate(-50%, -160%) scale(1.1); }
}
@keyframes zzz {
  0% { opacity: 0; transform: translate(0, 0) rotate(-10deg); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(36px, -70px) rotate(10deg); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-2.5%); } 40% { transform: translateX(2.5%); }
  60% { transform: translateX(-1.5%); } 80% { transform: translateX(1.5%); }
}
@keyframes shake-hard {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  15% { transform: translate(-4%, 1%) rotate(-3deg); } 30% { transform: translate(4%, -1%) rotate(3deg); }
  45% { transform: translate(-3%, 0) rotate(-2deg); } 60% { transform: translate(3%, 1%) rotate(2deg); }
  80% { transform: translate(-1%, 0) rotate(-1deg); }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  30% { transform: translateY(-6%) scale(.97, 1.04); }
  60% { transform: translateY(0) scale(1.04, .96); }
}
@keyframes tilt {
  0%, 100% { transform: rotate(0); } 40% { transform: rotate(-4deg); } 75% { transform: rotate(2deg); }
}
@keyframes squash {
  0%, 100% { transform: scale(1, 1); } 35% { transform: scale(1.06, .92); } 70% { transform: scale(.97, 1.03); }
}
@keyframes wobble {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-5deg); } 40% { transform: rotate(4deg); }
  60% { transform: rotate(-3deg); } 80% { transform: rotate(2deg); }
}
@keyframes twitch {
  0%, 100% { transform: translateY(0); } 30% { transform: translateY(-1%); } 60% { transform: translateY(.5%); }
}
@keyframes tag-pop {
  0% { opacity: 0; transform: rotate(4deg) scale(.4); }
  12% { opacity: 1; transform: rotate(4deg) scale(1.2); }
  22% { transform: rotate(4deg) scale(1); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: rotate(4deg) scale(1); }
}
@keyframes stomp {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5%) rotate(-2deg); }
  50% { transform: translateY(1%) scale(1.03, .96); }
  65% { transform: translateY(0) translateX(-1%); }
  80% { transform: translateX(1%); }
}
/* Rule: no animation rotates the character more than ~25deg. */
@keyframes tip-over {
  0% { transform: rotate(0); }
  25% { transform: rotate(-4deg); }
  100% { transform: translateX(6%) rotate(22deg); }
}
@keyframes land {
  0% { transform: translate(-4%, -9%) rotate(12deg); }
  45% { transform: translate(0, 0) rotate(0) scale(1.04, .95); }
  62% { transform: translateY(-3%) rotate(-1.5deg) scale(1); }
  78% { transform: translateY(0) rotate(0) scale(1.01, .99); }
  100% { transform: translateY(0) rotate(0) scale(1); }
}
@keyframes eye-twitch {
  0%, 82%, 100% { transform: translate(0, 0); }
  85% { transform: translate(.6%, -.4%); }
  88% { transform: translate(-.6%, .3%); }
  91% { transform: translate(.4%, 0); }
}
@keyframes walk-off {
  0% { transform: translateX(0) rotate(0); }
  15% { transform: translateX(8%) translateY(-2%) rotate(2deg); }
  30% { transform: translateX(22%) rotate(-2deg); }
  45% { transform: translateX(38%) translateY(-2%) rotate(2deg); }
  60% { transform: translateX(56%) rotate(-2deg); }
  75% { transform: translateX(76%) translateY(-2%) rotate(2deg); }
  100% { transform: translateX(130%) rotate(0); }
}
@keyframes drop-in {
  0% { transform: translateY(-110%); }
  60% { transform: translateY(3%); }
  75% { transform: translateY(-3%); }
  100% { transform: translateY(0); }
}
@keyframes blink-twitch { 0% { opacity: 1; } 100% { opacity: 0; } }
.anim-stomp { animation: stomp .45s ease-out; }
.anim-tip-over { animation: tip-over .5s ease-in forwards; }
.anim-land { animation: land .8s cubic-bezier(.3, .7, .4, 1) both; }
.anim-eye-twitch { animation: eye-twitch 1.1s linear infinite; }
.anim-walk-off { animation: walk-off 1.6s ease-in forwards; }
.anim-drop-in { animation: drop-in .7s cubic-bezier(.3, .7, .4, 1) both; }
.anim-shake { animation: shake .35s ease-in-out; }
.anim-shake-hard { animation: shake-hard .5s ease-in-out; }
.anim-bounce { animation: bounce .4s ease-out; }
.anim-tilt { animation: tilt .45s ease-in-out; }
.anim-squash { animation: squash .35s ease-out; }
.anim-wobble { animation: wobble .55s ease-in-out; }
.anim-twitch { animation: twitch .25s ease-out; }
/* Barely holding in a laugh: a little hop with a jiggle (at most 4°). */
.anim-giggle { animation: giggle .42s ease-out; }
@keyframes giggle {
  0%, 100% { transform: translateY(0) rotate(0) scale(1, 1); }
  20% { transform: translateY(-2.5%) rotate(-3deg) scale(.98, 1.03); }
  45% { transform: translateY(0) rotate(4deg) scale(1.04, .96); }
  70% { transform: translateY(-1%) rotate(-2deg) scale(.99, 1.01); }
}
/* Belly Laugh: he gives in and shakes with laughter (at most 6°). */
.anim-belly-laugh { animation: belly-laugh 1s ease-in-out; }
@keyframes belly-laugh {
  0%, 100% { transform: translateY(0) rotate(0) scale(1, 1); }
  10% { transform: translateY(-5%) rotate(-6deg) scale(.97, 1.04); }
  25% { transform: translateY(0) rotate(5deg) scale(1.05, .95); }
  40% { transform: translateY(-4%) rotate(-5deg) scale(.98, 1.03); }
  55% { transform: translateY(0) rotate(4deg) scale(1.04, .96); }
  70% { transform: translateY(-2%) rotate(-3deg); }
  85% { transform: translateY(0) rotate(2deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .zzz { opacity: 1; animation: none !important; }
  .zzz:nth-child(n+2) { display: none; }
}

@media (min-width: 720px) {
  .site-header { flex-direction: row; justify-content: space-between; max-width: 960px; margin: 0 auto; padding: 18px 24px 8px; }
  .logo { align-items: flex-start; }
  .game { max-width: 600px; }
  .site-header { flex-wrap: nowrap; }
  .site-header .logo { flex-basis: auto; }
  .site-header .menu { margin-left: auto; }
  .sound-toggle { margin-left: 2px; width: 40px; height: 40px; padding: 8px; }
}

/* Short screens: tighten everything around the stage so POKE stays on screen. */
@media (max-height: 760px) {
  .site-header { padding-top: 8px; gap: 4px; }
  .logo-title { font-size: clamp(1.3rem, 5.5vw, 2rem); }
  .logo-tagline { margin-top: 5px; font-size: .7rem; }
  .menu a { padding: 4px 12px; font-size: .82rem; }
  .game { gap: 8px; padding-bottom: 12px; }
  .bubble { min-height: 2.9em; padding: 6px 12px 16px; font-size: .95rem; }
  .hud { padding: 6px 12px 8px; gap: 6px; }
  .counter strong { font-size: 1.3rem; }
  .progress { height: 24px; }
  .poke { font-size: clamp(1.6rem, 8vw, 2.2rem); padding: 8px 20px 11px; box-shadow: 0 6px 0 var(--c-dark); }
}

/* ---------- buttons, toast ---------- */
.btn-primary {
  font: 800 1rem var(--font);
  padding: 8px 18px;
  border-radius: 999px;
  border: 3px solid var(--c-dark);
  background: var(--c-accent);
  color: var(--c-cream);
  cursor: pointer;
}
.btn-primary:disabled, .btn-secondary:disabled { opacity: .6; cursor: progress; }
label.btn-secondary { display: inline-block; margin-top: 0; }
.mini-btn {
  font: 800 .75rem var(--font);
  padding: 4px 10px;
  border-radius: 999px;
  border: 2px solid var(--c-dark);
  background: #fff;
  cursor: pointer;
}
.reward-actions, .end-actions, .detail-actions, .backup-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}
.reward-actions .btn-secondary, .end-actions .btn-secondary { margin-top: 0; }
.end-actions { margin: 0 0 16px; }
.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--c-dark);
  color: var(--c-cream);
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
}
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- album ---------- */
.view-album .screen { height: auto; }
.album {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.album-head, .album-page, .album-section {
  background: var(--panel);
  border: 4px solid var(--c-dark);
  border-radius: var(--radius);
  padding: 14px 14px 16px;
}
.album-head { text-align: center; }
.album-title { margin: 0; font-family: var(--font-display); font-size: 1.8rem; color: var(--c-primary); }
.album-count { margin: 6px 0; font-size: 1.05rem; }
.album-count strong { font-family: var(--font-display); font-size: 1.4rem; }
.album-bar { height: 14px; border: 2px solid var(--c-dark); border-radius: 999px; background: #e8dcc6; overflow: hidden; }
.album-bar-fill { height: 100%; background: linear-gradient(90deg, #8fb996, #e7b05a); }
.album-facts { margin: 8px 0 12px; font-size: .9rem; color: var(--c-accent); font-weight: 700; }
.album-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.chip {
  font: 800 .8rem var(--font);
  padding: 5px 12px;
  border-radius: 999px;
  border: 2px solid var(--c-dark);
  background: #fff;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--c-dark); color: var(--c-cream); }

.album-page { position: relative; }
.album-page-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.album-page-head h2 { margin: 0; flex: 1; font-size: 1.15rem; font-family: var(--font-display); }
.album-page-no { font: 800 .75rem var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--c-primary); display: block; }
.album-page-actions { display: flex; gap: 6px; }
.album-page-count { font-family: var(--font-display); background: #efe3cb; border-radius: 999px; padding: 2px 10px; }
.album-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 8px;
}
.slot.is-filtered { opacity: .18; filter: grayscale(1); }
.slot-btn {
  position: relative;
  width: 100%;
  padding: 6px 4px 8px;
  border: 2px dashed #c9b894;
  border-radius: 14px;
  background: #fffaf0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.slot-unlocked .slot-btn { border-style: solid; border-color: transparent; background: transparent; }
.slot-btn:hover { background: #fff3d9; }
.slot-no { position: absolute; top: 2px; left: 6px; font: 800 .68rem var(--font); color: #9b8b78; }
.slot-name { font-size: .72rem; font-weight: 800; line-height: 1.15; text-align: center; min-height: 2.3em; }
.slot-locked .slot-name, .slot-hidden .slot-name { color: #9b8b78; }
.album-page.is-complete { border-color: #c9922b; box-shadow: 0 0 0 3px #ffd25a inset; }
.page-sticker {
  position: absolute;
  top: -12px;
  right: 14px;
  padding: 4px 12px;
  background: #ffd166;
  border: 3px solid var(--c-dark);
  border-radius: 8px;
  font: 900 .8rem var(--font-display);
  transform: rotate(6deg);
}
.album-page.is-new-complete .page-sticker { animation: sticker-slap .7s cubic-bezier(.2, .9, .3, 1.4) .3s both; }
.album-page.is-new-complete { animation: page-glow 1.6s ease-out .3s; }
@keyframes sticker-slap { from { transform: rotate(-20deg) scale(3); opacity: 0; } to { transform: rotate(6deg) scale(1); opacity: 1; } }
@keyframes page-glow { 0% { box-shadow: 0 0 0 3px #ffd25a inset, 0 0 0 0 #ffd25a; } 40% { box-shadow: 0 0 0 3px #ffd25a inset, 0 0 40px 10px #ffd25a; } 100% { box-shadow: 0 0 0 3px #ffd25a inset, 0 0 0 0 transparent; } }

.album-section h2 { margin: 0 0 10px; font-family: var(--font-display); font-size: 1.15rem; }
.album-stats dl { margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.album-stats dl div { background: #efe3cb; border-radius: 10px; padding: 8px 10px; }
.album-stats dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.album-stats dd { margin: 2px 0 0; font-family: var(--font-display); font-size: 1.25rem; }
.backup-note { margin: 0 0 10px; font-size: .9rem; }
.backup-block { border-top: 2px dashed #d8c8a6; padding-top: 10px; margin-top: 10px; text-align: center; }
.backup-block h3 { margin: 0 0 4px; font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; }
.backup-code { width: 100%; margin-top: 10px; font: .8rem/1.3 ui-monospace, Consolas, monospace; border: 2px solid var(--c-dark); border-radius: 10px; padding: 8px; word-break: break-all; resize: vertical; }
.backup-error { color: var(--danger); font-weight: 700; margin: 8px 0 0; }
.backup-error:empty { display: none; }

/* ---------- badge detail dialog ---------- */
.badge-dialog {
  width: min(420px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 4px solid var(--c-dark);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--c-dark);
}
.badge-dialog::backdrop { background: rgba(15, 25, 20, .72); }
.badge-detail { position: relative; padding: 20px 18px; text-align: center; }
.detail-art { width: 200px; margin: 0 auto 8px; }
.detail-name { margin: 2px 0 6px; font-family: var(--font-display); font-size: 1.35rem; }
.detail-date { margin: 10px 0 0; font-size: .8rem; color: #7a6a58; }
.detail-hint { margin: 8px 0; font-weight: 700; }
.detail-locked { margin: 0; font-size: .85rem; color: #7a6a58; }
.dialog-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  font: 900 1.8rem/1 var(--font);
  cursor: pointer;
}
@media (min-width: 560px) {
  .album-stats dl { grid-template-columns: repeat(4, 1fr); }
  .slot-name { font-size: .8rem; }
}

/* album refinements */
.slot-btn .badge { max-width: 132px; }
.page-sticker { right: auto; left: 50%; translate: -50% 0; }
.detail-actions .btn-secondary, .detail-actions .btn-primary,
.backup-row .btn-secondary, .reward-actions .btn-primary { margin-top: 0; }
@media (max-width: 520px) {
  .album-page-head h2 { flex: 1 1 60%; }
  .album-page-actions { flex-basis: 100%; justify-content: flex-end; }
}

/* ---------- shiny variants ---------- */
.badge-shiny .badge-glow { animation: glow 2s ease-in-out infinite alternate; }
.badge-sheen { animation-duration: 2.6s; }
.badge-sparkle { transform-box: fill-box; transform-origin: center; animation: twinkle 1.8s ease-in-out infinite; }
.badge-sparkle-1 { animation-delay: .5s; }
.badge-sparkle-2 { animation-delay: 1s; }
.badge-sparkle-3 { animation-delay: 1.4s; }
@keyframes twinkle { 0%, 100% { opacity: .2; transform: scale(.5); } 50% { opacity: 1; transform: scale(1.1); } }
.rarity-shiny { color: #a36d00; }
.seal-shiny { background: radial-gradient(circle at 35% 30%, #fffbe0, #e3a51c 60%, #8a5a08); box-shadow: 0 0 40px #ffd25a, 0 0 80px #fff1b0, 0 6px 0 var(--c-dark); }
.reveal-shiny::before { background: repeating-conic-gradient(rgba(255, 205, 70, .65) 0 10deg, transparent 10deg 24deg); }
.slot.is-shiny .slot-btn { background: radial-gradient(circle at 50% 40%, #fff6cf, transparent 70%); }
.album-shiny { margin: 0 0 12px; font-weight: 700; color: #8a5a08; }
.album-shiny-star { color: #e3a51c; font-size: 1.1em; }
.album-shiny-note { font-weight: 600; }
.chip-shiny[aria-pressed="false"] { background: #fff4c9; }
.album-facts a { color: inherit; }

/* ---------- extras: coffee, shop, ad (below the game, only when switched on) ---------- */
.extras {
  width: 100%;
  max-width: 600px;
  margin: 8px auto 0;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.coffee-card, .shop {
  background: var(--panel);
  border: 4px solid var(--c-dark);
  border-radius: var(--radius);
  box-shadow: 0 6px 0 var(--c-dark);
}
.coffee-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.coffee-art { flex: none; width: 104px; height: 104px; overflow: hidden; border-radius: 50%; background: #e8d2ad; border: 3px solid var(--c-dark); }
.coffee-art img { display: block; width: 100%; height: 100%; transform: scale(1.9); transform-origin: 50% 30%; }
.coffee-text { flex: 1; min-width: 0; text-align: center; }
.coffee-title { margin: 0 0 10px; font-weight: 800; font-size: 1rem; line-height: 1.3; }
.coffee-btn { display: inline-block; text-decoration: none; }
.coffee-note { margin: 8px 0 0; font-size: .78rem; color: #6d5d4c; }
@media (max-width: 380px) { .coffee-card { flex-direction: column; } }

.shop { padding: 12px 14px 14px; }
.shop-title { margin: 0 0 10px; font-family: var(--font-display); font-size: 1.15rem; text-align: center; }
.shop-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; background: #fffaf0; border: 2px solid #e2d3b4; border-radius: 12px; padding: 8px; }
.shop-img { width: 100%; max-width: 120px; height: auto; aspect-ratio: 1; object-fit: contain; }
.shop-name { margin: 0; font-weight: 800; font-size: .85rem; line-height: 1.2; }
.shop-btn { text-decoration: none; color: var(--c-dark); }
.shop-aff { margin: 0; font-size: .68rem; color: #7a6a58; }
.shop-foot { margin: 10px 0 0; font-size: .75rem; text-align: center; color: #7a6a58; }

.ad-slot { text-align: center; }
.ad-label { margin: 0 0 4px; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: #9dbba5; }
.ad-box { min-height: 250px; display: grid; place-items: center; border-radius: 12px; background: rgba(0, 0, 0, .15); overflow: hidden; }
@media (min-width: 720px) { .ad-box { min-height: 120px; } }
.ad-box .adsbygoogle { width: 100%; }
.ad-sample { color: #9dbba5; font-weight: 700; border: 2px dashed #5d8a6b; border-radius: 10px; padding: 10px 16px; }

.end-coffee { margin: 0 0 14px; font-weight: 700; font-size: .9rem; }
.end-coffee a { display: inline-block; margin-top: 4px; color: var(--c-accent); }

/* ---------- footer ---------- */
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-bottom: 8px; }
.footer-links a { color: #cfe3d4; font-weight: 700; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.site-footer p { margin: 0; }

/* ---------- content pages (privacy, about, bear facts) ---------- */
.doc {
  width: 100%;
  max-width: 760px;
  margin: 8px auto 24px;
  padding: 0 16px;
}
.doc-card {
  background: var(--panel);
  border: 4px solid var(--c-dark);
  border-radius: var(--radius);
  box-shadow: 0 6px 0 var(--c-dark);
  padding: 18px 18px 22px;
  line-height: 1.55;
}
.doc-card + .doc-card { margin-top: 16px; }
.doc h1 { margin: 0 0 8px; font-family: var(--font-display); font-size: clamp(1.6rem, 6vw, 2.2rem); color: var(--c-primary); line-height: 1.15; }
.doc h2 { margin: 22px 0 6px; font-family: var(--font-display); font-size: 1.2rem; line-height: 1.25; }
.doc p, .doc li { font-size: 1rem; }
.doc a { color: var(--c-accent); font-weight: 700; }
/* Buttons that are links keep their own colors inside content pages. */
.doc a.poke { color: #fff; }
.doc a.btn-primary { color: var(--c-cream); }
.doc a.btn-secondary { color: var(--c-dark); }
.doc-updated { margin: 0 0 14px; font-size: .85rem; color: #7a6a58; }
.doc-lead { font-size: 1.08rem; }
.crumbs { max-width: 760px; margin: 4px auto 8px; padding: 0 16px; font-size: .85rem; color: #b9d3bf; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs li + li::before { content: "›"; margin-right: 4px; opacity: .7; }
.crumbs a { color: var(--c-cream); }
.back-to-game { text-align: center; margin: 18px 0 0; }
.back-to-game .poke { display: inline-block; text-decoration: none; font-size: 1.4rem; padding: 10px 26px 13px; }
.bear-note { border-left: 6px solid var(--c-primary); background: #f3e5cc; border-radius: 10px; padding: 8px 12px; font-style: italic; }
.bear-note::before { content: "Bear's note: "; font-style: normal; font-weight: 900; color: var(--c-primary); }

/* Bear Facts list */
.facts-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.facts-toc a { text-decoration: none; }
.facts-progress { margin: 10px 0 0; font-weight: 700; color: var(--c-accent); }
.fact-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.fact-item { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; background: #fffaf0; border: 2px solid #e2d3b4; border-radius: 14px; padding: 10px 12px; }
.fact-art { width: 72px; height: 72px; border-radius: 50%; background: #e8dcc6; }
.fact-art .badge { width: 72px; }
.fact-text { margin: 0; }
.fact-meta { margin: 4px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .8rem; color: #7a6a58; }
.fact-badge { font-weight: 800; }
.fact-item.is-owned .fact-badge { color: var(--c-dark); }
.fact-share { margin-left: auto; display: flex; gap: 6px; }
.doc-card > h2:first-child { margin-top: 0; }
@media (min-width: 560px) { .fact-item { grid-template-columns: 88px 1fr; } .fact-art, .fact-art .badge { width: 88px; height: 88px; } }

/* ---------- All About Bears: articles, index, myths vs. facts ---------- */
.article h2 { margin-top: 28px; }
.article h3 { margin: 18px 0 4px; font-size: 1.05rem; font-family: var(--font-display); }
.article ul, .article ol { padding-left: 1.3em; }
.article li { margin: 4px 0; }
.article figure { margin: 16px 0; }
.article figure img { width: 100%; height: auto; border-radius: 12px; }
.article blockquote { margin: 14px 0; padding: 4px 14px; border-left: 4px solid #d8c8a6; color: #5a4a3a; }
.table-wrap { overflow-x: auto; margin: 14px 0; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .92rem; background: #fffaf0; }
.table-wrap th, .table-wrap td { border: 1px solid #e2d3b4; padding: 7px 9px; text-align: left; vertical-align: top; }
.table-wrap thead th { background: #efe3cb; }
.table-wrap tbody th { font-weight: 800; background: #f7ecd7; }
.sources { font-size: .9rem; }
.article .sources { margin-top: 26px; border-top: 2px dashed #d8c8a6; }
.article .sources h2 { margin-top: 14px; font-size: 1rem; }
.sources li { word-break: break-word; }
.test-list { padding-left: 1.2em; }
.test-list li { margin: 6px 0; }
.test-list a { white-space: nowrap; }
.test-cta { margin: 14px 0 0; }
.test-cta .btn-primary, .quiz-end-actions .btn-primary { display: inline-block; text-decoration: none; }
.cards { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 620px) { .cards { grid-template-columns: repeat(2, 1fr); } }
.card a { display: block; height: 100%; padding: 12px 14px; border: 2px solid #e2d3b4; border-radius: 14px; background: #fffaf0; text-decoration: none; color: var(--c-dark); font-weight: 400; }
.card a:hover { border-color: var(--c-accent); }
.card-title { display: block; font-family: var(--font-display); font-size: 1.05rem; color: var(--c-accent); margin-bottom: 4px; }
.card-desc { display: block; font-size: .9rem; line-height: 1.4; }
.mf-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.mf-item { background: #fffaf0; border: 2px solid #e2d3b4; border-radius: 14px; padding: 10px 12px; scroll-margin-top: 16px; }
.mf-item:target { border-color: var(--c-accent); box-shadow: 0 0 0 3px #ffd166; }
.doc .mf-statement { margin: 0; font-weight: 800; font-size: 1.07rem; line-height: 1.35; color: var(--c-dark); }
.doc .mf-explain { margin: 6px 0 0; padding-top: 6px; border-top: 1px dashed #e2d3b4; font-weight: 400; font-size: .94rem; line-height: 1.5; color: #5d4c3c; }
.mf-label { display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 999px; font: 900 .72rem var(--font); letter-spacing: .08em; vertical-align: 2px; color: #fff; }
.mf-myth { background: #c0392b; }
.mf-fact { background: #2f7a45; }
.ad-end { margin-top: 20px; }
.detail-learn { margin: 10px 0 0; font-size: .88rem; }
.detail-learn a { color: var(--c-accent); font-weight: 800; }

/* ---------- quiz ---------- */
.quiz-intro { margin: 0 0 12px; }
.quiz-top { display: flex; justify-content: space-between; font-weight: 800; font-size: .9rem; color: #7a6a58; }
.quiz-dots { list-style: none; display: flex; gap: 5px; margin: 8px 0 12px; padding: 0; }
.quiz-dots li { flex: 1; height: 8px; border-radius: 999px; background: #e8dcc6; }
.quiz-dots li.is-now { background: #c9b894; }
.quiz-dots li.is-right { background: #2f7a45; }
.quiz-dots li.is-wrong { background: #c0392b; }
.quiz-stage { display: flex; align-items: center; gap: 10px; }
.quiz-bear { flex: none; width: 110px; height: 110px; object-fit: contain; }
.quiz-statement { position: relative; flex: 1; margin: 0; padding: 14px 16px; background: #fff; border: 3px solid var(--c-dark); border-radius: 16px; font-weight: 800; font-size: clamp(1.02rem, 4.4vw, 1.25rem); line-height: 1.3; }
.quiz-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.quiz-btn {
  font: 900 clamp(1.3rem, 6vw, 1.8rem) var(--font-display);
  letter-spacing: .04em;
  padding: 14px 10px 16px;
  border: 4px solid var(--c-dark);
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--c-dark);
  -webkit-tap-highlight-color: transparent;
}
.quiz-btn-myth { background: #c0392b; }
.quiz-btn-fact { background: #2f7a45; }
.quiz-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--c-dark); }
.quiz-btn:disabled { cursor: default; opacity: .35; transform: none; box-shadow: 0 6px 0 var(--c-dark); }
.quiz-btn.is-answer { opacity: 1; outline: 4px solid #ffd166; outline-offset: 3px; }
.quiz-result { margin-top: 18px; padding: 12px 14px; border-radius: 14px; border: 3px solid var(--c-dark); }
.quiz-result.is-right { background: #e4f3e6; }
.quiz-result.is-wrong { background: #fbe4df; }
.quiz-verdict { margin: 0; font: 900 1.15rem var(--font-display); }
.quiz-verdict span { font: 800 1rem var(--font); }
.quiz-explain { margin: 6px 0 0; }
.quiz-reaction { margin: 8px 0 0; font-style: italic; font-weight: 700; color: var(--c-primary); }
.quiz-next { margin-top: 12px; }
.quiz-end { display: flex; align-items: center; gap: 12px; }
.quiz-end .quiz-bear { width: 130px; height: 130px; }
.quiz-final { margin: 0; font: 900 3rem var(--font-display); color: var(--c-primary); line-height: 1; }
.quiz-line { margin: 6px 0 0; font-weight: 800; }
.quiz-best { margin: 6px 0 0; font-size: .9rem; color: #7a6a58; font-weight: 700; }
.quiz-end-actions { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.quiz-end-actions .btn-secondary { margin-top: 0; }
.quiz-again { text-align: center; margin: 16px 0 0; }
.quiz-all { text-align: center; margin: 14px 0 0; }
.doc .quiz-all a { color: var(--c-cream); font-weight: 700; }
.quiz-status { margin: 8px 0; color: #7a6a58; font-weight: 700; }
.quiz-error { padding: 12px 14px; border: 3px solid var(--danger); border-radius: 14px; background: #fbe4df; }
.quiz-error p { margin: 0 0 8px; }
.quiz-error p:last-child { margin: 0; }
@media (max-width: 380px) {
  .quiz-stage { flex-direction: column; }
  .quiz-bear { width: 90px; height: 90px; }
}

/* Four menu tabs (+ sound button on the game) must fit a 320 px phone. */
@media (max-width: 420px) {
  .menu a { padding: 5px 9px; font-size: .84rem; }
}
@media (max-width: 350px) {
  .menu a { padding: 4px 7px; font-size: .78rem; }
}
