/* Banana game styles — loaded only on /play/ */

.lede, .play-lead {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  font-weight: 500;
  max-width: 32rem;
  color: var(--ink);
}

.play-block {
  background: #fff8e8;
  border: 4px solid var(--ink);
  box-shadow: var(--desk);
  padding: 1.1rem 1.15rem 1.2rem;
  margin: 0 0 1.2rem;
  max-width: 40rem;
}

.quiz-progress { font-weight: 650; margin: 0 0 0.45rem; }

.quiz-question { font-size: 1.15rem; font-weight: 600; margin: 0 0 0.7rem; }

.quiz-choices {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.quiz-choices button {
  text-align: left;
  font: inherit;
  font-weight: 600;
  padding: 0.65rem 0.8rem;
  min-height: 2.8rem;
  border: 3px solid var(--ink);
  background: var(--marble);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
}

.quiz-choices button:hover { background: var(--banana); }

.quiz-result h3 { font-size: 1.4rem; }

.game-frame {
  position: relative;
  height: 16.5rem;
  border: 4px solid var(--ink);
  background:
    linear-gradient(#9ec5d6, #efd3a2 70%, #87a96b);
  overflow: hidden;
  touch-action: none;
}

.game-catcher {
  position: absolute;
  bottom: 0.3rem;
  left: 50%;
  width: 4.2rem;
  height: 4.2rem;
  margin-left: -2.1rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  background: #f3d3a4;
  pointer-events: none;
}

.game-catcher img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-banana {
  position: absolute;
  font-size: 1.7rem;
  line-height: 1;
  width: 2rem;
  height: 2rem;
  margin-left: -1rem;
  pointer-events: none;
  user-select: none;
}

.game-hud {
  position: absolute;
  top: 0.4rem;
  left: 0.45rem;
  right: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.15rem 0.55rem;
  font-weight: 650;
  font-size: 0.88rem;
  color: var(--ink);
  text-shadow: 0 1px 0 #fff4e3;
  pointer-events: none;
  z-index: 2;
}

#game-mult[data-tier="2"] { color: #8a6718; }

#game-mult[data-tier="3"],
#game-mult[data-tier="5"] { color: #8e2d1c; }

.game-overlay[hidden] { display: none !important; }

.game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(243, 230, 196, 0.58);
  padding: 1rem;
  text-align: center;
}

.game-overlay p {
  margin: 0 0 0.85rem;
  font-weight: 600;
  max-width: 16rem;
}

.game-still {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin: 0 0 0.85rem;
}

.game-still button {
  font-size: 2rem;
  line-height: 1;
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  background: var(--marble);
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}

.game-still button:hover { background: #ffe8c6; }

.game-still button.is-gone { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .portrait { transform: none; }
  .portrait.is-tipping { animation: none; }
  .ticker-track.is-rolling { animation: none; }
  .trade-inner { transition: none; }
  .quiz-choices button, .btn, .floors a { transition: none; }
  .stamp-btn { transition: none; }
}

.game-catcher.is-hot {
  box-shadow: 0 0 0 3px var(--ink), 0 0 16px 4px #f4c430;
}

.game-catcher.is-flame,
.game-catcher.is-blaze {
  box-shadow: 0 0 0 3px var(--ink), 0 0 22px 6px #e35d3a, 0 0 8px 2px #f4c430;
}

.game-catcher.is-flame::after,
.game-catcher.is-blaze::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 85%;
  height: 1.6rem;
  background: linear-gradient(180deg, transparent, #f4c430 35%, #e35d3a);
  border-radius: 50% 50% 40% 40%;
  pointer-events: none;
  z-index: -1;
  opacity: 0.9;
}

.game-catcher.is-blaze::after {
  height: 2.1rem;
  background: linear-gradient(180deg, transparent, #f4c430 25%, #e35d3a 70%, #8e2d1c);
}

.game-catcher.is-soot {
  filter: brightness(0.45) grayscale(0.35) contrast(1.15);
}

.game-catcher.is-soot img { filter: contrast(1.1); }

.game-hazard {
  z-index: 1;
  width: 2.5rem;
  height: auto;
  margin-left: -1.25rem;
  font-size: 0;
  line-height: 0;
}

.game-haz-cherry { width: 2.15rem; margin-left: -1.08rem; }

.game-haz-dynamite { width: 2.15rem; margin-left: -1.08rem; }

.game-haz-crate { width: 2.85rem; margin-left: -1.42rem; }

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

.haz-shadow { fill: rgba(35, 23, 15, 0.4); }

.haz-wick { fill: none; stroke: #23170f; stroke-width: 1.7; stroke-linecap: round; }

.haz-spark { fill: #f4c430; stroke: #23170f; stroke-width: 0.7; transform-origin: center; animation: spark-flicker 0.16s steps(2, end) infinite; }

.haz-spark-core { fill: #fff8e8; }

.haz-label {
  font-family: Fredoka, system-ui, sans-serif;
  font-size: 5.2px;
  font-weight: 700;
  fill: #23170f;
}

.haz-smoke { opacity: 0; }

.game-hazard.is-telegraph .haz-smoke,
.game-hazard.is-armed .haz-smoke { opacity: 1; }

.smoke-puff {
  fill: #cfc4b0;
  stroke: #23170f;
  stroke-width: 0.7;
  opacity: 0.85;
  animation: smoke-rise 0.7s ease-out infinite;
}

.smoke-puff.delay { animation-delay: 0.2s; opacity: 0.65; }

.game-hazard.is-telegraph { filter: drop-shadow(0 0 4px #f4c430); }

.game-hazard.is-armed { z-index: 3; }

.blast-ring {
  position: absolute;
  left: 50%;
  top: 70%;
  width: 5.5rem;
  height: 5.5rem;
  margin-left: -2.75rem;
  margin-top: -2.75rem;
  border: 3px dashed #c4452c;
  border-radius: 50%;
  pointer-events: none;
  animation: ring-pulse 0.75s ease-out forwards;
  background: rgba(196, 69, 44, 0.12);
}

@keyframes spark-flicker {
  0%, 100% { transform: scale(1); fill: #f4c430; }
  50% { transform: scale(1.45); fill: #fff8e8; }
}

@keyframes smoke-rise {
  0% { transform: translate(0, 0) scale(0.7); opacity: 0.15; }
  100% { transform: translate(-2px, -6px) scale(1.15); opacity: 0; }
}

@keyframes ring-pulse {
  0% { transform: scale(0.4); opacity: 0.9; }
  100% { transform: scale(1); opacity: 0.75; }
}

.game-still .haz-svg { width: 2.1rem; height: auto; margin: 0 auto; }

.streak-banner {
  position: absolute;
  top: 2.3rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  background: var(--banana);
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  padding: 0.2rem 0.7rem;
  pointer-events: none;
}

.streak-banner.is-pop { animation: streak-pop 0.55s cubic-bezier(0.2, 1.2, 0.3, 1); }

.game-blast {
  position: absolute;
  width: 2.4rem;
  height: 2.4rem;
  margin-left: -1.2rem;
  margin-top: -1.2rem;
  border-radius: 50%;
  pointer-events: none;
  z-index: 4;
}

.game-blast.is-pop {
  background: radial-gradient(circle, #fff8e8 0%, #f4c430 40%, transparent 70%);
  animation: blast-pop 0.35s ease-out forwards;
}

.game-blast.is-boom {
  width: 4.2rem;
  height: 4.2rem;
  margin-left: -2.1rem;
  margin-top: -2.1rem;
  background: radial-gradient(circle, #fff4c2 0%, #e35d3a 35%, #23170f 60%, transparent 70%);
  animation: blast-pop 0.45s ease-out forwards;
}

@keyframes blast-pop {
  0% { transform: scale(0.3); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

.game-frame.is-shaking { animation: game-shake 0.35s linear; }

.game-frame.is-flash { outline: 4px solid #c4452c; outline-offset: -4px; }

@keyframes game-shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5px, 2px); }
  40% { transform: translate(6px, -2px); }
  60% { transform: translate(-4px, -1px); }
  80% { transform: translate(3px, 2px); }
}

.game-still button.is-boom { background: #e35d3a; }

@media (prefers-reduced-motion: reduce) {
  .streak-banner.is-pop,
  .game-blast.is-pop,
  .game-blast.is-boom,
  .game-frame.is-shaking,
  .game-catcher.is-flame::after,
  .game-catcher.is-blaze::after { animation: none; }
  .game-blast.is-pop,
  .game-blast.is-boom { opacity: 0; }
}

.play-toy-game { max-width: 48rem; }

.game-shell { margin: 0; }

.game-shell .game-hud {
  position: static;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.4rem;
  margin: 0 0 0.5rem;
  text-shadow: none;
  z-index: auto;
  font-family: Fredoka, "Segoe UI", "Trebuchet MS", sans-serif;
}

.game-frame {
  height: min(28rem, 58vh);
  min-height: 22rem;
  background: #efb45a;
}

.game-world {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  transform: none;
  background-color: #f3c056;
  background-image: url("/assets/game/jungle-a-desktop.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Portrait uses the tall jungle art. Landscape and wide screens keep the desktop art. */
@media (orientation: portrait) {
  .game-world {
    background-image: url("/assets/game/jungle-a-mobile.webp");
  }
}

.game-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  background-repeat: no-repeat;
  transform: none;
  will-change: auto;
}

.game-hud {
  z-index: 3;
  font-family: Fredoka, "Segoe UI", "Trebuchet MS", sans-serif;
  gap: 0.35rem;
}

.hud-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  background: rgba(255, 244, 227, 0.92);
  border: 2px solid var(--ink);
  box-shadow: 0 2px 0 var(--ink);
  padding: 0.15rem 0.45rem 0.12rem;
  font-weight: 650;
  line-height: 1.2;
}

.hud-chip .hud-label {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5c3d22;
}

.game-catcher {
  z-index: 2;
  width: 6.4rem;
  height: 8.15rem;
  margin-left: -3.2rem;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  overflow: visible;
  bottom: 0.2rem;
  transform-origin: 50% 90%;
}

.game-catcher img { display: none; }

.game-catcher-sprite {
  width: 100%;
  height: 100%;
  background-image: image-set(url("/assets/game/basket.webp") type("image/webp"), url("/assets/game/basket.png") type("image/png"));
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center bottom;
  filter: drop-shadow(0 2px 0 rgba(35, 23, 15, 0.35));
  transform-origin: 50% 90%;
}

.game-catcher.is-move .game-catcher-sprite { transform: rotate(11deg); }

.game-catcher.is-left.is-move .game-catcher-sprite { transform: rotate(-11deg); }

.game-catcher.is-catch .game-catcher-sprite { transform: translateY(-0.4rem) scale(1.07, 0.9); }

.game-catcher.is-left { transform: none; }

.game-item {
  position: absolute;
  z-index: 2;
  width: 3.15rem;
  height: 3.15rem;
  margin-left: -1.55rem;
  background-image: image-set(url("/assets/game/items.webp") type("image/webp"), url("/assets/game/items.png") type("image/png"));
  background-repeat: no-repeat;
  background-size: 500% 100%;
  background-position: 0 0;
  pointer-events: none;
  filter: drop-shadow(0 2px 0 rgba(35, 23, 15, 0.3));
}

.game-item.is-banana { background-position: 0 0; }

.game-item.is-bunch { background-position: 25% 0; width: 3.5rem; height: 3.5rem; margin-left: -1.75rem; }

.game-item.is-gold { background-position: 50% 0; }

.game-item.is-bomb { background-position: 75% 0; }

.game-item.is-dynamite { background-position: 100% 0; }

.game-banana { /* keep old class as alias */ }

.play-toy[hidden] { display: none !important; }

.desk-toy {
  position: relative;
  height: 16rem;
  border: 4px solid var(--ink);
  background: #efe0c4;
  overflow: hidden;
  touch-action: none;
}

.desk-toy canvas { display: block; width: 100%; height: 100%; }

@media (prefers-reduced-motion: reduce) {
  .game-layer { will-change: auto; }
}

.game-frame { isolation: isolate; }

.game-overlay { z-index: 20; }

.streak-banner { z-index: 15; }

.game-blast { z-index: 8; }

.game-catcher.is-hot {
  box-shadow: none;
  filter: drop-shadow(0 0 10px #f4c430);
}

.game-catcher.is-flame,
.game-catcher.is-blaze {
  box-shadow: none;
  filter: drop-shadow(0 0 14px #e35d3a) drop-shadow(0 0 6px #f4c430);
}

.game-catcher.is-flame::after,
.game-catcher.is-blaze::after {
  left: 22%;
  right: 22%;
  bottom: 46%;
  height: 1.15rem;
  z-index: 0;
  border-radius: 50% 50% 40% 40%;
}

.game-catcher.is-blaze::after { height: 1.45rem; }

.game-catcher.is-soot { filter: none; }

.game-catcher.is-soot .game-catcher-sprite {
  filter: brightness(0.52) grayscale(0.4) contrast(1.2) drop-shadow(0 2px 0 rgba(35, 23, 15, 0.35));
}

.game-catcher.is-soot::before {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 10%;
  height: 40%;
  background:
    radial-gradient(ellipse at 32% 40%, rgba(20, 12, 8, 0.62) 0 30%, transparent 58%),
    radial-gradient(ellipse at 68% 62%, rgba(20, 12, 8, 0.45) 0 24%, transparent 52%),
    radial-gradient(ellipse at 50% 80%, rgba(20, 12, 8, 0.3) 0 20%, transparent 48%);
  pointer-events: none;
  z-index: 1;
  border-radius: 50%;
}

.game-catcher.is-soot img { filter: none; }

.streak-banner { top: 0.7rem; }

.game-overlay {
  background: rgba(35, 23, 15, 0.42);
  padding: 0.9rem;
}

.game-card {
  background: #fff8e8;
  border: 4px solid var(--ink);
  box-shadow: 0 5px 0 var(--ink);
  padding: 1.05rem 1.15rem 1.15rem;
  width: min(20.5rem, 100%);
}

.game-card-kicker {
  margin: 0 0 0.35rem;
  font-family: Fredoka, "Segoe UI", "Trebuchet MS", sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.game-overlay p { max-width: none; }

.game-best-line {
  margin: 0 0 0.95rem;
  font-weight: 650;
  font-family: Fredoka, "Segoe UI", "Trebuchet MS", sans-serif;
}

.game-best-line.is-new { color: #8a6718; }

.btn-game {
  min-height: 3.25rem;
  min-width: 10.5rem;
  padding: 0.45rem 1.5rem;
  font-family: Fredoka, "Segoe UI", "Trebuchet MS", sans-serif;
  font-size: 1.28rem;
  font-weight: 700;
}

@media (max-width: 520px) {
  .play-toy-game { max-width: none; }
  .game-frame {
    height: min(32rem, 64vh);
    min-height: 22rem;
  }
  .game-catcher {
    width: 5.8rem;
    height: 7.4rem;
    margin-left: -2.9rem;
  }
  .game-shell .game-hud { gap: 0.3rem; }
  .hud-chip { padding: 0.12rem 0.38rem 0.1rem; font-size: 0.92rem; }
  .btn-game { width: 100%; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .game-catcher.is-move .game-catcher-sprite,
  .game-catcher.is-left.is-move .game-catcher-sprite,
  .game-catcher.is-catch .game-catcher-sprite { transform: none; }
}

/* juice pass */
.game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  pointer-events: none;
  display: block;
}
.game-catcher[hidden] { display: none !important; }
.game-shell .game-hud.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.play-toy-game { max-width: 52rem; }
.game-frame {
  height: min(32rem, 64dvh);
  min-height: 22rem;
}
.game-countdown {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: grid;
  place-items: center;
  font-family: Fredoka, "Segoe UI", "Trebuchet MS", sans-serif;
  font-weight: 700;
  font-size: clamp(5rem, 18vw, 8rem);
  letter-spacing: -0.06em;
  color: var(--banana);
  text-shadow:
    0 0 0 3px var(--ink),
    3px 4px 0 var(--ink);
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  pointer-events: none;
}
.game-countdown[hidden] { display: none !important; }
.game-countdown.is-pop { animation: count-pop 0.45s cubic-bezier(0.2, 1.4, 0.3, 1) both; }
@keyframes count-pop {
  from { transform: scale(0.55); opacity: 0; }
  55% { transform: scale(1.08); opacity: 1; }
  to { transform: scale(1); opacity: 1; }
}
.game-overlay {
  background: rgba(28, 51, 72, 0.28);
  backdrop-filter: blur(2px);
}
.game-card {
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: 0 8px 0 var(--ink);
  border-radius: 1rem 1rem 0.4rem 0.4rem;
  padding: 1.15rem 1.25rem 1.25rem;
  text-align: center;
  max-width: 22rem;
  width: calc(100% - 2rem);
}
.game-card-kicker {
  margin: 0 0 0.25rem;
  font-weight: 650;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.game-card-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.7rem, 4vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.game-final-score {
  margin: 0.15rem 0 0.35rem;
  font-size: clamp(3rem, 10vw, 4.1rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--ink);
}
.game-final-score[hidden] { display: none !important; }
.game-card .game-best-line {
  font-weight: 650;
  margin: 0.35rem 0 0.95rem;
  color: var(--ink-soft);
}
.game-card .game-best-line.is-new { color: var(--jungle); }
.game-card [data-end] {
  margin: 0 0 0.15rem;
  color: var(--ink-soft);
  font-weight: 500;
}
.btn-game {
  min-width: 10rem;
  min-height: 3.1rem;
  font-weight: 700;
}
.game-frame.is-flash::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 16;
  background: rgba(196, 69, 44, 0.28);
  pointer-events: none;
  animation: miss-flash 0.28s ease-out both;
}
@keyframes miss-flash {
  from { opacity: 1; }
  to { opacity: 0; }
}
@media (max-width: 520px) {
  .game-frame {
    height: min(24.5rem, 62dvh);
    min-height: 19.5rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .game-countdown.is-pop,
  .game-frame.is-flash::after { animation: none; }
}

/* Law quiz */
.quiz-lab {
  margin: 2.5rem 0 0;
  max-width: 52rem;
}
.quiz-lab > h2 {
  font-size: clamp(1.6rem, 1.4rem + 1vw, 2.15rem);
  letter-spacing: -0.035em;
  margin: 0 0 0.4rem;
}
.quiz-shell { position: relative; }
.quiz-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 1rem;
  margin: 0 0 0.85rem;
}
.quiz-progress-label, .quiz-streak {
  font-weight: 650;
  font-size: 0.95rem;
}
.quiz-streak { color: var(--ink-soft); }
.quiz-streak[data-hot="1"] { color: var(--jungle); }
.quiz-bar {
  position: relative;
  width: 100%;
  height: 0.7rem;
  margin: 0 0 1.1rem;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 2px 0 var(--ink);
}
.quiz-bar > span {
  display: block;
  height: 100%;
  width: var(--p, 0%);
  background: var(--banana);
  border-radius: inherit;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.quiz-art {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 1rem;
  background: var(--walnut);
  border: 3px solid var(--ink);
  border-radius: 0.95rem 0.95rem 0.4rem 0.4rem;
  box-shadow: var(--desk);
  overflow: hidden;
}
.quiz-art img {
  width: 12rem;
  max-width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  object-position: center;
  background: var(--walnut);
}
.quiz-art-card {
  display: grid;
  place-items: center;
  gap: 0.35rem;
  min-height: 9.5rem;
  padding: 1.2rem 1rem;
  background:
    repeating-linear-gradient(-45deg, var(--marble), var(--marble) 14px, #f7e7c2 14px, #f7e7c2 28px);
  color: var(--ink);
  text-align: center;
}
.quiz-art-card .quiz-glyph {
  font-size: 3.2rem;
  line-height: 1;
}
.quiz-art-card p {
  margin: 0;
  font-weight: 650;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}
.quiz-question {
  font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.55rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.3;
  margin: 0 0 0.9rem;
}
.quiz-lab, .quiz-shell, .quiz-choices {
  min-width: 0;
  max-width: 100%;
}
.quiz-shell {
  overflow-x: hidden;
}
.quiz-choices {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  width: 100%;
  box-sizing: border-box;
}
.quiz-choices li {
  min-width: 0;
  max-width: 100%;
}
.quiz-choices button {
  display: flex;
  align-items: center;
  text-align: left;
  font: inherit;
  font-weight: 600;
  line-height: 1.3;
  padding: 0.85rem 0.95rem;
  min-height: 4.25rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  color: var(--ink);
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 0.85rem 0.85rem 0.3rem 0.3rem;
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.14s cubic-bezier(0.22, 1, 0.36, 1), background 0.14s ease;
}
.quiz-choices button:hover {
  background: #fff3c9;
  transform: translateY(-3px);
  box-shadow: 0 7px 0 var(--ink);
}
.quiz-choices button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}
.quiz-choices button[aria-disabled="true"] { cursor: default; }
.quiz-choices button.is-correct {
  background: #c8e8b8;
  box-shadow: 0 5px 0 var(--jungle);
}
.quiz-choices button.is-wrong {
  background: #f3c4b8;
  animation: quiz-shake 0.42s ease;
}
@keyframes quiz-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
.quiz-feedback {
  margin: 1rem 0 0;
  padding: 0.9rem 1rem;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 0.75rem;
  box-shadow: 0 3px 0 var(--ink);
}
.quiz-feedback[hidden] { display: none !important; }
.quiz-feedback p { margin: 0 0 0.55rem; }
.quiz-feedback .quiz-why { color: var(--ink-soft); font-weight: 500; }
.quiz-feedback .quiz-verdict { font-weight: 700; }
.quiz-feedback .quiz-verdict.is-yes { color: var(--jungle); }
.quiz-feedback .quiz-verdict.is-no { color: var(--seal); }
.quiz-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 0.7rem 0 0; }
.quiz-actions.is-center { justify-content: center; }
.quiz-start, .quiz-result {
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 0.95rem 0.95rem 0.4rem 0.4rem;
  box-shadow: var(--desk);
  padding: 1.25rem 1.2rem 1.35rem;
  text-align: center;
}
.quiz-start h3, .quiz-result h3 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  letter-spacing: -0.04em;
}
.quiz-result .quiz-score {
  margin: 0.15rem 0 0.25rem;
  font-size: clamp(3rem, 9vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
}
.quiz-result .quiz-rank {
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0 0 0.7rem;
}
.quiz-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}
.quiz-confetti i {
  position: absolute;
  top: -8px;
  width: 8px;
  height: 12px;
  border-radius: 1px;
  animation: quiz-confetti 0.9s ease-out forwards;
}
@keyframes quiz-confetti {
  to { transform: translateY(18rem) rotate(220deg); opacity: 0; }
}
@media (max-width: 640px) {
  .quiz-choices { grid-template-columns: 1fr; }
  .quiz-choices button { min-height: 3.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .quiz-choices button,
  .quiz-bar > span { transition: none; }
  .quiz-choices button.is-wrong,
  .quiz-choices button.is-correct,
  .quiz-confetti i { animation: none; transform: none; }
}

/* Static backdrop — never follows the basket */
.game-layer {
  left: 0;
  width: 100%;
  transform: none;
  will-change: auto;
}
.game-frame.is-shaking {
  animation: none;
}

/* Control hints */
.game-controls-hint,
.game-controls-live {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.2rem 0.25rem;
  margin: 0.7rem 0 0.85rem;
  font-family: Fredoka, "Segoe UI", "Trebuchet MS", sans-serif;
  font-weight: 650;
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.3;
}
.game-controls-live {
  position: absolute;
  z-index: 17;
  left: 50%;
  bottom: 0.85rem;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.35rem 0.65rem;
  background: rgba(255, 248, 232, 0.92);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  white-space: nowrap;
  pointer-events: none;
}
.game-controls-live.is-soft {
  left: 0.7rem;
  right: auto;
  bottom: 0.7rem;
  transform: none;
  opacity: 0.9;
  font-size: 0.8rem;
  padding: 0.28rem 0.55rem;
  box-shadow: 0 2px 0 var(--ink);
}
.game-controls-live.is-fade {
  opacity: 0;
  transition: opacity 0.45s ease;
}
.game-controls-hint kbd,
.game-controls-live kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  height: 1.55rem;
  padding: 0 0.28rem;
  margin: 0 0.08rem;
  border: 2px solid var(--ink);
  border-radius: 0.4rem;
  background: var(--cream);
  box-shadow: 0 2px 0 var(--ink);
  font: 700 0.85rem Fredoka, "Segoe UI", sans-serif;
  line-height: 1;
  color: var(--ink);
}
.game-controls-live.is-soft kbd {
  min-width: 1.25rem;
  height: 1.25rem;
  font-size: 0.72rem;
  box-shadow: 0 1px 0 var(--ink);
}
.game-mouse {
  width: 0.95rem;
  height: 1.3rem;
  display: inline-block;
  vertical-align: -0.28em;
  margin: 0 0.15rem;
}
.game-controls-live[hidden],
.game-controls-hint[hidden],
.game-best-pop[hidden] {
  display: none !important;
}
.game-controls-hint kbd svg,
.game-controls-live kbd svg {
  width: 0.72rem;
  height: 0.72rem;
  display: block;
}
.game-mouse-label { white-space: nowrap; }
.game-controls-touch { display: none; }
@media (pointer: coarse) {
  .game-controls-desktop { display: none; }
  .game-controls-touch { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  .game-controls-live.is-fade { transition: none; }
}

/* Mid-run new-best badge */
.game-best-pop {
  position: absolute;
  z-index: 18;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.28rem 0.85rem;
  font-family: Fredoka, "Segoe UI", "Trebuchet MS", sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  background: var(--banana);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--ink);
  pointer-events: none;
}
.game-best-pop.is-in {
  animation: best-pop-in 0.48s cubic-bezier(0.2, 1.4, 0.3, 1) both;
}
.game-best-pop.is-out {
  animation: best-pop-out 0.28s ease both;
}
@keyframes best-pop-in {
  0% { transform: translateX(-50%) scale(0.4, 1.35); opacity: 0; }
  40% { transform: translateX(-50%) scale(1.18, 0.82); opacity: 1; }
  62% { transform: translateX(-50%) scale(0.92, 1.08); }
  80% { transform: translateX(-50%) scale(1.06, 0.96); }
  100% { transform: translateX(-50%) scale(1, 1); opacity: 1; }
}
@keyframes best-pop-out {
  from { transform: translateX(-50%) scale(1); opacity: 1; }
  to { transform: translateX(-50%) scale(0.9); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .game-best-pop.is-in { animation: best-fade-in 0.25s ease both; }
  .game-best-pop.is-out { animation: best-fade-out 0.2s ease both; }
}
@keyframes best-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes best-fade-out { from { opacity: 1; } to { opacity: 0; } }

/* Game-over high-score celebration */
.game-card.is-highscore {
  position: relative;
  overflow: hidden;
  padding-top: 1.35rem;
}
.game-highscore {
  position: relative;
  z-index: 1;
  text-align: center;
  margin: 0 0 0.85rem;
}
.game-highscore[hidden] { display: none !important; }
.game-highscore-glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 8rem;
  background: radial-gradient(circle, rgba(244, 196, 48, 0.55), rgba(244, 196, 48, 0) 68%);
  pointer-events: none;
  animation: highscore-glow 1.6s ease-in-out infinite;
}
.game-highscore-fx {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.game-highscore-fx i,
.game-highscore-fx b {
  position: absolute;
  top: -8px;
  display: block;
  pointer-events: none;
  animation: highscore-fall 1.1s linear forwards;
}
.game-highscore-fx i {
  width: 0.55rem;
  height: 0.85rem;
  border: 1.5px solid var(--ink);
  border-radius: 0.15rem;
}
.game-highscore-fx b {
  width: 1.05rem;
  height: 0.7rem;
  background: #ffd24a;
  border: 2px solid var(--ink);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  transform: rotate(-25deg);
}
.game-highscore-banner {
  position: relative;
  margin: 0 0 0.45rem;
  font-family: Fredoka, "Segoe UI", "Trebuchet MS", sans-serif;
  font-weight: 700;
  font-size: clamp(1.45rem, 5vw, 1.85rem);
  letter-spacing: -0.04em;
  color: var(--ink);
  text-shadow: 0 2px 0 rgba(244, 196, 48, 0.8);
  animation: highscore-drop 0.7s cubic-bezier(0.2, 1.45, 0.3, 1) both;
}
.game-highscore-count {
  position: relative;
  margin: 0 0 0.8rem;
  font-family: Fredoka, "Segoe UI", "Trebuchet MS", sans-serif;
  font-weight: 700;
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  letter-spacing: -0.05em;
  color: var(--ink);
}
.game-highscore-count [data-highscore-from] {
  color: var(--ink-soft);
  font-size: 0.55em;
}
.game-highscore-arrow {
  display: inline-block;
  margin: 0 0.25rem;
  font-size: 0.55em;
  color: var(--brass-dark);
}
.game-highscore-count [data-highscore-roll] {
  color: var(--jungle);
}
.game-highscore .btn { min-width: 8.5rem; }
.game-share-status {
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--jungle);
}
@keyframes highscore-drop {
  0% { transform: translateY(-2.4rem) scale(0.86); opacity: 0; }
  58% { transform: translateY(0.28rem) scale(1.06); opacity: 1; }
  78% { transform: translateY(-0.12rem) scale(0.98); }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes highscore-glow {
  0%, 100% { opacity: 0.65; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}
@keyframes highscore-fall {
  to { transform: translateY(14rem) rotate(220deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .game-highscore-banner,
  .game-highscore-glow,
  .game-highscore-fx i,
  .game-highscore-fx b {
    animation: none;
  }
  .game-highscore-banner { opacity: 1; }
  .game-highscore-glow { opacity: 0.5; }
  .game-highscore-fx { display: none; }
}
