:root {
  --bg-top: #f5d68a;
  --bg-bot: #c98a4b;
  --ink: #2b1b0d;
  --paper: #fff7e6;
  --accent: #7a4a1f;
  --accent-hi: #a3651e;
  --gold: #f6c453;
  --gem: #6dd6ff;

  /* Cartoon candy palette */
  --pink: #ff3d8a;
  --pink-dk: #b81d61;
  --cyan: #00d4ff;
  --cyan-dk: #0077a8;
  --lime: #b8ff3c;
  --lime-dk: #5d8a13;
  --sun: #ffd23f;
  --sun-dk: #b8870a;
  --violet: #b15bff;
  --violet-dk: #6b21d4;

  --cartoon-font: 'Luckiest Guy', 'Fredoka', 'Arial Black', Impact, system-ui, sans-serif;
  --body-font: 'Fredoka', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(circle at 50% 30%, #ffe4a8 0%, #c98a4b 60%, #6b3a14 100%);
  font-family: var(--body-font);
  color: var(--ink);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

#stage, #stage * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
}

#stage {
  position: relative;
  width: min(480px, 100vw);
  aspect-ratio: 480 / 720;
  max-height: 100dvh;
  box-shadow:
    0 30px 80px rgba(0,0,0,0.45),
    0 0 0 5px var(--ink) inset,
    0 0 0 9px var(--sun) inset;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(to bottom, #ffe4a8, #c98a4b 70%, #6b3a14);
}

canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: auto;
  touch-action: manipulation;
}

/* ============ HUD ============ */
.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 16px;
}

.hud-top {
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 16px 8px;
}

.wallet {
  display: flex;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ink);
  color: var(--paper);
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--cartoon-font);
  font-weight: 400;
  font-size: 18px;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  border: 2.5px solid var(--paper);
  box-shadow: 0 4px 0 rgba(0,0,0,0.5);
}

.chip .ico {
  font-size: 18px;
  line-height: 1;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.4));
}

/* SVG coin icon — used in menus, buttons, and HUD wallet.
   Replaces the 🪙 emoji, which renders as a crescent on many systems. */
.coin-ico {
  display: inline-block;
  vertical-align: -0.18em;
  width: 1.15em;
  height: 1.15em;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='11.5' fill='%232b1b0d'/><circle cx='12' cy='12' r='10.2' fill='%236b3a0a'/><circle cx='12' cy='12' r='9' fill='%23a86f0e'/><circle cx='12' cy='12' r='7.6' fill='%23d49a2b'/><circle cx='12' cy='12' r='6.2' fill='%23f6c453'/><circle cx='9.5' cy='9.5' r='1.6' fill='%23fff2c2' opacity='0.7'/><text x='12' y='16.2' text-anchor='middle' font-family='Arial Black, Impact, sans-serif' font-size='11' font-weight='900' fill='%236b3a0a'>$</text></svg>");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.4));
}

.chip.coin {
  background: linear-gradient(180deg, var(--sun) 0%, var(--sun-dk) 100%);
  color: var(--ink);
  transform: rotate(-2deg);
}
.chip.gem {
  background: linear-gradient(180deg, var(--cyan) 0%, var(--cyan-dk) 100%);
  color: var(--paper);
  transform: rotate(2deg);
}

.score {
  font-family: var(--cartoon-font);
  font-size: 72px;
  font-weight: 900;
  color: var(--paper);
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  text-shadow:
    0 5px 0 var(--pink-dk),
    0 8px 0 var(--ink),
    0 14px 20px rgba(0,0,0,0.5);
  letter-spacing: 3px;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

/* ============ Next-Zone Progress Bar ============
   Chunky pill-shaped bar pinned near the bottom of the play area. Informational
   during a run (pointer-events: none so taps pass through to the canvas for
   flap); switches into a strong "buy now" pulse when the player can afford the
   next zone. Styled to match the cartoon wallet-chip aesthetic. */
.next-zone-bar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 8px;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 4px;
  background: transparent;
  border: none;
  border-radius: 999px;
  box-shadow: none;
  pointer-events: none;
  transition: transform 0.3s ease;
  z-index: 5;
  transform: rotate(-0.3deg);
}

.next-zone-bar.hidden { display: none; }

/* The circular icon "chip" — sits to the LEFT of the progress track, gets
   its own background + border, and pops above the track so it never collides
   with the fill as it grows. */
.next-zone-bar-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  background: linear-gradient(180deg, #5a3a18 0%, #2b1b0d 100%);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.18),
    0 3px 0 var(--ink),
    0 6px 10px rgba(0, 0, 0, 0.45);
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.5));
  -webkit-text-stroke: 0;
}

/* The progress track — its own pill with overflow:hidden so the fill clips
   cleanly inside, independent of the icon. */
.next-zone-bar-track {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 30px;
  background: linear-gradient(180deg, #4a3018 0%, #2b1b0d 100%);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.12),
    inset 0 -3px 0 rgba(0, 0, 0, 0.45),
    0 3px 0 var(--ink),
    0 6px 12px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.next-zone-bar-fill {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: 0%;
  max-width: calc(100% - 4px);
  background: linear-gradient(180deg, var(--cyan) 0%, var(--cyan-dk) 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.45),
    inset 0 -2px 0 rgba(0, 0, 0, 0.3);
  border-radius: 999px;
  transition: width 0.45s cubic-bezier(0.2, 0.9, 0.2, 1), background 0.3s ease;
  pointer-events: none;
}

.next-zone-bar-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  padding: 0 14px;
  font-family: var(--cartoon-font);
  font-size: 14px;
  letter-spacing: 1.4px;
  color: var(--paper);
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--ink);
  white-space: nowrap;
}

.next-zone-bar-label {
  text-transform: uppercase;
}

.next-zone-bar-pct {
  font-variant-numeric: tabular-nums;
  color: var(--sun);
  -webkit-text-stroke: 1.5px var(--ink);
}

/* Affordable state — chunky gold pill that bounces and glows. Bar stays
   pointer-events: none so taps pass through to the canvas mid-flap. The
   purchase happens from a safe decision screen (Zones panel, game over). */
.next-zone-bar.affordable {
  animation: next-zone-bar-bounce 1.4s ease-in-out infinite;
}

.next-zone-bar.affordable .next-zone-bar-track {
  background: linear-gradient(180deg, #ffd23f 0%, #b8770a 100%);
  border-color: var(--ink);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    inset 0 -3px 0 rgba(0, 0, 0, 0.35),
    0 3px 0 var(--ink),
    0 0 18px rgba(255, 210, 63, 0.7),
    0 6px 12px rgba(0, 0, 0, 0.45);
}

.next-zone-bar.affordable .next-zone-bar-icon {
  background: linear-gradient(180deg, #ffd23f 0%, #b8770a 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    0 3px 0 var(--ink),
    0 0 14px rgba(255, 210, 63, 0.85),
    0 6px 10px rgba(0, 0, 0, 0.45);
}

.next-zone-bar.affordable .next-zone-bar-fill {
  background: linear-gradient(180deg, #fff2c4 0%, var(--sun) 50%, #b8770a 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.65),
    inset 0 -3px 0 rgba(0, 0, 0, 0.25);
  animation: next-zone-bar-shimmer 2.4s linear infinite;
}

.next-zone-bar.affordable .next-zone-bar-content {
  color: var(--paper);
  text-shadow: 0 2px 0 var(--pink-dk), 0 3px 0 var(--ink);
  font-size: 14px;
}

.next-zone-bar.affordable .next-zone-bar-pct {
  display: none;
}

@keyframes next-zone-bar-bounce {
  0%, 100% { transform: rotate(-0.3deg) translateY(0); }
  50%      { transform: rotate(0.3deg) translateY(-2px); }
}

@keyframes next-zone-bar-shimmer {
  0%   { filter: brightness(1); }
  50%  { filter: brightness(1.18); }
  100% { filter: brightness(1); }
}

.pet-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, var(--lime) 0%, var(--lime-dk) 100%);
  color: var(--ink);
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--cartoon-font);
  font-weight: 400;
  font-size: 18px;
  letter-spacing: 1px;
  border: 2.5px solid var(--paper);
  box-shadow: 0 4px 0 rgba(0,0,0,0.5);
  transform: rotate(2deg);
}

.pet-badge.hidden { display: none; }
.pet-badge #petBadgeIcon { font-size: 18px; }
.pet-badge.mult-boost {
  animation: multiplier-boost 0.42s cubic-bezier(0.2, 0.9, 0.2, 1.2);
}
.pet-badge.mult-boost::after {
  content: "+0.1";
  position: absolute;
  top: -18px;
  right: -8px;
  color: var(--paper);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--pink-dk), 0 6px 10px rgba(0,0,0,0.35);
  font-size: 17px;
  pointer-events: none;
  animation: multiplier-float 0.62s ease-out forwards;
}

/* ============ Music toggle ============ */
.music-toggle {
  position: absolute;
  left: 14px;
  bottom: 40px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2.5px solid var(--paper);
  background: var(--ink);
  color: var(--paper);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  z-index: 50;
  box-shadow: 0 4px 0 rgba(0,0,0,0.5);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  transition: opacity 0.15s ease;
}
.music-toggle:hover { opacity: 0.85; }
.music-toggle:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.5);
}
.music-toggle.muted { opacity: 0.55; }

/* ============ Overlays ============ */
.overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 210, 63, 0.22), transparent 55%),
    repeating-conic-gradient(from 0deg at 50% 28%,
      rgba(255,255,255,0.06) 0deg 8deg,
      transparent 8deg 16deg),
    linear-gradient(180deg, #5a3617 0%, #2b1b0d 100%);
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--paper);
  padding: 32px 24px;
  gap: 14px;
  transition: opacity 0.2s ease;
  overflow-y: auto;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay.hidden .deco { animation: none; }

/* H1 cartoon treatment (Game Over / Paused) */
.title-logo {
  display: block;
  width: min(100%, 520px);
  height: auto;
  margin: -18px 0 -6px;
  transform: rotate(-1deg);
  filter: drop-shadow(0 10px 0 rgba(43, 27, 13, 0.42)) drop-shadow(0 18px 22px rgba(0,0,0,0.5));
  animation: title-wobble 3.4s ease-in-out infinite;
  flex: 0 1 auto;
}

.overlay h1 {
  font-family: var(--cartoon-font);
  font-weight: 400;
  font-size: clamp(48px, 12vw, 76px);
  margin: 0 0 4px;
  letter-spacing: 3px;
  line-height: 1;
  color: var(--sun);
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  text-shadow:
    0 6px 0 var(--pink-dk),
    0 9px 0 var(--ink),
    0 16px 22px rgba(0,0,0,0.55);
  transform: rotate(-3deg);
  animation: title-wobble 3.4s ease-in-out infinite;
  text-transform: uppercase;
}

#gameover h1 {
  color: var(--pink);
  text-shadow:
    0 6px 0 #6b1338,
    0 9px 0 var(--ink),
    0 16px 22px rgba(0,0,0,0.55);
  animation: title-shake 0.6s ease-in-out infinite;
}

/* "Game [dead poop] Over!" — nestle the shrunken poop between the words. */
.gameover-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-wrap: nowrap;
}
.gameover-title .go-word {
  line-height: 1;
}

#pause h1 {
  color: var(--cyan);
  text-shadow:
    0 6px 0 var(--cyan-dk),
    0 9px 0 var(--ink),
    0 16px 22px rgba(0,0,0,0.55);
  animation: title-float 2.5s ease-in-out infinite;
}

/* Panel h2 — same cartoon treatment, per-panel colors */
.overlay h2 {
  font-family: var(--cartoon-font);
  font-weight: 400;
  font-size: 36px;
  margin: 0;
  letter-spacing: 2px;
  color: var(--sun);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow:
    0 4px 0 var(--pink-dk),
    0 7px 0 var(--ink),
    0 12px 18px rgba(0,0,0,0.5);
  transform: rotate(-2deg);
  text-transform: uppercase;
}

#petsPanel  h2 { color: var(--lime);   text-shadow: 0 4px 0 var(--lime-dk),   0 7px 0 var(--ink), 0 12px 18px rgba(0,0,0,0.5); }
#shopPanel  h2 { color: var(--pink);   text-shadow: 0 4px 0 var(--pink-dk),   0 7px 0 var(--ink), 0 12px 18px rgba(0,0,0,0.5); }
#zonesPanel h2 { color: var(--violet); text-shadow: 0 4px 0 var(--violet-dk), 0 7px 0 var(--ink), 0 12px 18px rgba(0,0,0,0.5); }

/* Tag / result lines */
.overlay .tag {
  margin: 0;
  font-family: var(--body-font);
  font-size: 16px;
  font-weight: 600;
  color: var(--paper);
  background: rgba(255,255,255,0.1);
  padding: 8px 18px;
  border-radius: 999px;
  border: 2.5px dashed rgba(255,255,255,0.35);
  letter-spacing: 0.5px;
  transform: rotate(-1deg);
  max-width: 86%;
}

.overlay .result {
  margin: 0;
  font-family: var(--cartoon-font);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 1.5px;
  color: var(--paper);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink), 0 6px 10px rgba(0,0,0,0.4);
}

.overlay .result span { color: var(--sun); }

.overlay .earned {
  background: linear-gradient(180deg, var(--sun) 0%, var(--sun-dk) 100%);
  color: var(--ink);
  -webkit-text-stroke: 0;
  text-shadow: 0 2px 0 rgba(255,255,255,0.4);
  padding: 8px 18px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  box-shadow: 0 5px 0 var(--ink), 0 10px 16px rgba(0,0,0,0.4);
  font-size: 18px;
  letter-spacing: 1.5px;
  transform: rotate(-2deg);
  animation: badge-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.overlay .earned span { color: var(--ink); }

.overlay .best {
  margin: 12px 0 0;
  font-family: var(--cartoon-font);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: 1.5px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sun) 0%, var(--sun-dk) 100%);
  padding: 6px 16px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink), 0 8px 12px rgba(0,0,0,0.35);
  transform: rotate(2deg);
}

.overlay .best span { color: var(--ink); }

.menu-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

/* ============ Initial loading screen ============
   Sits on top of every other overlay (z-index above sibling overlays which
   default to z auto) until game.js fades it out once PIXI assets resolve. */
.loading-overlay {
  z-index: 100;
  padding: 24px 18px 64px;
  gap: 18px;
  justify-content: flex-start;
  padding-top: 22px;
}

.loading-bar-wrap {
  width: min(86%, 460px);
  margin-top: 18px;
  display: flex;
  align-items: center;
}

.loading-bar-track {
  position: relative;
  flex: 1 1 auto;
  height: 36px;
  background: linear-gradient(180deg, #4a3018 0%, #2b1b0d 100%);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.12),
    inset 0 -3px 0 rgba(0, 0, 0, 0.45),
    0 4px 0 var(--ink),
    0 8px 14px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.loading-bar-fill {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: 0%;
  max-width: calc(100% - 4px);
  background: linear-gradient(180deg, #fff2c4 0%, var(--sun) 50%, #b8770a 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    inset 0 -3px 0 rgba(0, 0, 0, 0.3);
  border-radius: 999px;
  transition: width 0.25s cubic-bezier(0.2, 0.9, 0.2, 1);
  pointer-events: none;
}

.loading-bar-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  padding: 0 16px;
  font-family: var(--cartoon-font);
  font-size: 16px;
  letter-spacing: 1.6px;
  color: var(--paper);
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--ink);
  white-space: nowrap;
  text-transform: uppercase;
}

.loading-bar-pct {
  font-variant-numeric: tabular-nums;
  color: var(--sun);
  -webkit-text-stroke: 1.5px var(--ink);
}

/* ============ New gameover / menu cards (v21) ============ */
.menu-overlay,
.gameover-overlay {
  padding: 24px 18px 64px;
  gap: 12px;
  justify-content: flex-start;
  padding-top: 22px;
}

.gameover-overlay {
  padding-top: 66px;
  padding-bottom: 20px;
  gap: 8px;
}

/* Keep each row at its natural height so the overlay scrolls instead of
   crushing children (the dead-poop graphic was collapsing to ~10px). */
.gameover-overlay > *:not(.deco) {
  flex-shrink: 0;
}

.gameover-overlay h1 {
  font-size: clamp(40px, 10vw, 58px);
  margin-top: -2px;
}

/* Score / Best combo chip */
.score-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: linear-gradient(180deg, #4a2a14 0%, #2b1b0d 100%);
  border: 4px solid var(--ink);
  border-radius: 22px;
  padding: 10px 22px;
  box-shadow: 0 6px 0 var(--ink), 0 12px 18px rgba(0,0,0,0.4);
  width: min(92%, 360px);
  transform: rotate(-0.5deg);
}

.score-card-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.score-card-label {
  font-family: var(--cartoon-font);
  font-size: 16px;
  letter-spacing: 1.5px;
  color: var(--paper);
  -webkit-text-stroke: 1px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 rgba(0,0,0,0.5);
  text-transform: uppercase;
  opacity: 0.92;
}

.score-card-value {
  font-family: var(--cartoon-font);
  font-size: 32px;
  letter-spacing: 1px;
  color: var(--sun);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink), 0 6px 10px rgba(0,0,0,0.4);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.score-card-divider {
  font-size: 30px;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,0.45)) drop-shadow(0 0 8px rgba(255, 210, 63, 0.55));
  animation: trophy-bob 2.4s ease-in-out infinite;
}

.menu-best-card {
  width: min(72%, 240px);
}

@keyframes trophy-bob {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-3px) rotate(6deg); }
}

/* Big "Try Again" / "Play" cta — wider rectangular pill */
.btn-tryagain,
.btn-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(92%, 360px);
  padding: 16px 24px;
  font-size: 30px;
  transform: rotate(-1deg);
  border-radius: 22px;
}

.btn-tryagain .btn-glyph,
.btn-play .btn-glyph {
  font-family: var(--cartoon-font);
  font-size: 28px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  border: 3px solid var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  -webkit-text-stroke: 0;
  text-shadow: 0 2px 0 rgba(0,0,0,0.4);
  color: var(--ink);
}

/* Info row — two side-by-side cards (new pet / zone progress) */
.info-row {
  display: flex;
  gap: 10px;
  width: min(94%, 380px);
  justify-content: center;
}

.info-card {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: linear-gradient(180deg, #4a2a14 0%, #2b1b0d 100%);
  border: 4px solid var(--ink);
  border-radius: 18px;
  padding: 10px 12px 12px;
  box-shadow: 0 5px 0 var(--ink), 0 10px 16px rgba(0,0,0,0.38);
  color: var(--paper);
  font-family: var(--body-font);
  text-align: left;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease;
  position: relative;
}

.info-card:hover { filter: brightness(1.1); transform: translateY(-2px); }
.info-card:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink), 0 4px 8px rgba(0,0,0,0.4); }

.info-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--cartoon-font);
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--sun);
  -webkit-text-stroke: 1px var(--ink);
  paint-order: stroke fill;
  text-transform: uppercase;
}

.info-card-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex: 0 0 auto;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.45));
}

.gameover-zone-icon-img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  display: block;
}

.info-card-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 0 rgba(0,0,0,0.5);
}

.info-card-body {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--paper);
  opacity: 0.95;
}

.info-card-body strong {
  color: var(--sun);
  font-weight: 700;
}

.info-card-cta {
  margin-top: auto;
  font-family: var(--cartoon-font);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--paper);
  background: linear-gradient(180deg, var(--violet) 0%, var(--violet-dk) 100%);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 4px 10px;
  align-self: flex-start;
  text-transform: uppercase;
  box-shadow: 0 3px 0 var(--ink);
}

.info-pet {
  background: linear-gradient(180deg, #5a3aa8 0%, #2b1854 100%);
  animation: pet-card-pulse 1.8s ease-in-out infinite;
}

@keyframes pet-card-pulse {
  0%, 100% { box-shadow: 0 5px 0 var(--ink), 0 10px 16px rgba(0,0,0,0.38), 0 0 0 rgba(177, 91, 255, 0); }
  50%      { box-shadow: 0 5px 0 var(--ink), 0 10px 16px rgba(0,0,0,0.38), 0 0 22px rgba(177, 91, 255, 0.55); }
}

.info-zone {
  background: linear-gradient(180deg, #3a2510 0%, #1a0e05 100%);
  padding-right: 12px;
  overflow: hidden;
}
.info-zone .info-card-cta {
  background: linear-gradient(180deg, var(--lime) 0%, var(--lime-dk) 100%);
  color: var(--ink);
}

/* Progress row: small circular icon chip + progress track, side by side so
   the icon never overlaps the bar fill (was previously absolute-positioned
   on top of the card, which clipped into the bar). */
.zone-card-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.zone-card-chip {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  background: linear-gradient(180deg, #5a3a18 0%, #2b1b0d 100%);
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 2px 0 var(--ink),
    0 4px 8px rgba(0, 0, 0, 0.4);
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.45));
}

.zone-card-progress-row .zone-card-progress {
  flex: 1 1 auto;
  min-width: 0;
  margin-top: 0;
}

.zone-card-progress {
  position: relative;
  height: 14px;
  margin-top: 4px;
  background: rgba(0,0,0,0.55);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.zone-card-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(180deg, var(--lime) 0%, var(--lime-dk) 100%);
  border-radius: 999px 0 0 999px;
  transition: width 0.3s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}

.zone-card-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--cartoon-font);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--paper);
  -webkit-text-stroke: 1px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 1px 0 rgba(0,0,0,0.6);
}

/* "You earned X coins" card */
.earned-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: linear-gradient(180deg, #4a2a14 0%, #2b1b0d 100%);
  border: 4px solid var(--ink);
  border-radius: 18px;
  padding: 10px 18px;
  box-shadow: 0 5px 0 var(--ink), 0 10px 16px rgba(0,0,0,0.38);
  width: min(94%, 380px);
  font-family: var(--cartoon-font);
  letter-spacing: 1px;
  transform: rotate(0.5deg);
}

.earned-col {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: var(--paper);
  -webkit-text-stroke: 1px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 rgba(0,0,0,0.45);
}

.earned-col strong {
  font-size: 22px;
  color: var(--sun);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 var(--ink), 0 4px 8px rgba(0,0,0,0.4);
}

.earned-col-gem strong { color: var(--cyan); }

.earned-icon { font-size: 22px; filter: drop-shadow(0 2px 0 rgba(0,0,0,0.45)); }
.earned-icon .coin-ico { width: 22px; height: 22px; }

.earned-divider {
  width: 2px;
  height: 26px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
}

/* Four big square tile buttons (Pets / Shop / Zones / Tasks) */
.tile-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: min(94%, 380px);
  margin-top: 4px;
}

.tile-btn {
  position: relative;
  appearance: none;
  flex: 0 0 calc((100% - 30px) / 4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  aspect-ratio: 1 / 1;
  padding: 6px 4px 8px;
  border: 4px solid var(--ink);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--pink) 0%, var(--pink-dk) 100%);
  box-shadow: 0 6px 0 var(--ink), 0 10px 16px rgba(0,0,0,0.4);
  cursor: pointer;
  font-family: var(--cartoon-font);
  color: var(--paper);
  -webkit-text-stroke: 1.2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 rgba(0,0,0,0.45);
  transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.08s ease;
}

.tile-btn:hover {
  filter: brightness(1.1) saturate(1.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--ink), 0 14px 20px rgba(0,0,0,0.45);
}

.tile-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--ink), 0 4px 8px rgba(0,0,0,0.4);
}

.tile-icon {
  font-size: 30px;
  line-height: 1;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,0.4));
  -webkit-text-stroke: 0;
}

.tile-label {
  font-size: 14px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  line-height: 1;
}

.tile-pink   { background: linear-gradient(180deg, #ff5ba1 0%, #b81d61 100%); transform: rotate(-1.5deg); }
.tile-cyan   { background: linear-gradient(180deg, var(--cyan) 0%, var(--cyan-dk) 100%); transform: rotate(1deg); }
.tile-lime   {
  background: linear-gradient(180deg, var(--lime) 0%, var(--lime-dk) 100%);
  color: var(--ink);
  -webkit-text-stroke: 0.6px var(--ink);
  text-shadow: 0 2px 0 rgba(255,255,255,0.4);
  transform: rotate(-0.5deg);
}
.tile-orange { background: linear-gradient(180deg, #ff9633 0%, #c95a10 100%); transform: rotate(1.5deg); }
.tile-purple { background: linear-gradient(180deg, #a564ff 0%, #6a2db8 100%); transform: rotate(-1deg); }

.tile-pink:hover   { transform: rotate(-1.5deg) translateY(-2px); }
.tile-cyan:hover   { transform: rotate(1deg) translateY(-2px); }
.tile-lime:hover   { transform: rotate(-0.5deg) translateY(-2px); }
.tile-orange:hover { transform: rotate(1.5deg) translateY(-2px); }
.tile-purple:hover { transform: rotate(-1deg) translateY(-2px); }

.tile-pink:active,
.tile-cyan:active,
.tile-lime:active,
.tile-orange:active,
.tile-purple:active { transform: translateY(4px) rotate(0deg); }

.tile-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff3d3d 0%, #a40e0e 100%);
  border: 2.5px solid var(--ink);
  color: var(--paper);
  -webkit-text-stroke: 0;
  font-family: var(--cartoon-font);
  font-size: 14px;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 3px 0 var(--ink);
  animation: tile-badge-pop 1.4s ease-in-out infinite;
}

@keyframes tile-badge-pop {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50%      { transform: scale(1.15) rotate(8deg); }
}

.tile-badge.hidden { display: none; }

/* Lay the six shortcut tiles out as two rows of three on both the game-over
   and main-menu screens so the two share one consistent grid. */
#gameover .tile-row,
#menu .tile-row {
  flex-wrap: wrap;
  gap: 8px;
  width: min(86%, 330px);
}
#gameover .tile-btn,
#menu .tile-btn {
  flex: 0 0 calc((100% - 16px) / 3);
  min-width: 0;
  aspect-ratio: auto;
  padding: 9px 4px;
  gap: 4px;
  border-width: 3px;
  border-radius: 16px;
}
#gameover .tile-icon,
#menu .tile-icon { font-size: 26px; }
#gameover .tile-label,
#menu .tile-label { font-size: 11px; letter-spacing: 0.4px; }
#gameover .tile-badge,
#menu .tile-badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  font-size: 11px; line-height: 18px; top: -7px; right: -7px;
}

/* ============ Consolidated Run Results card (v26) ============
   Combines score / best / new-best badge / earned coins+gems into one
   visual chunk so the player reads "what just happened" in a single beat. */
.results-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: linear-gradient(180deg, #4a2a14 0%, #2b1b0d 100%);
  border: 4px solid var(--ink);
  border-radius: 22px;
  padding: 14px 22px 12px;
  box-shadow: 0 6px 0 var(--ink), 0 12px 18px rgba(0,0,0,0.42);
  width: min(92%, 380px);
  transform: rotate(-0.5deg);
}

/* Game over: tighten the run-results card, primary CTA and smart cards so the
   whole screen reads as one compact block. */
#gameover .results-card { padding: 9px 22px 8px; gap: 3px; }
#gameover .results-stat-value { font-size: 28px; }
#gameover .results-trophy { font-size: 24px; }
#gameover .results-divider { margin-top: 1px; }
#gameover .btn-tryagain { padding: 11px 24px; }
#gameover .btn-tryagain .btn-glyph { width: 36px; height: 36px; font-size: 24px; }
#gameover .smart-card-row .smart-card { padding: 6px 10px; gap: 7px; }
#gameover .smart-card-row .smart-card-icon { width: 32px; height: 32px; font-size: 18px; }

.results-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.results-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.results-stat-label {
  font-family: var(--cartoon-font);
  font-size: 14px;
  letter-spacing: 1.5px;
  color: var(--paper);
  -webkit-text-stroke: 1px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 rgba(0,0,0,0.5);
  text-transform: uppercase;
  opacity: 0.85;
}

.results-stat-value {
  font-family: var(--cartoon-font);
  font-size: 32px;
  letter-spacing: 1px;
  color: var(--sun);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink), 0 6px 10px rgba(0,0,0,0.4);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.results-trophy {
  font-size: 28px;
  flex: 0 0 auto;
  filter:
    drop-shadow(0 3px 0 rgba(0,0,0,0.45))
    drop-shadow(0 0 8px rgba(255, 210, 63, 0.5));
  animation: trophy-bob 2.4s ease-in-out infinite;
}

/* Hairline divider between score row and earned row — segments without
   adding a lot of vertical weight. */
.results-divider {
  height: 2px;
  margin: 2px 6px 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 210, 63, 0.35) 30%,
    rgba(255, 210, 63, 0.55) 50%,
    rgba(255, 210, 63, 0.35) 70%,
    transparent 100%);
  border-radius: 2px;
}

.results-earned { gap: 18px; padding-top: 2px; }

.results-earned-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--cartoon-font);
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--paper);
  -webkit-text-stroke: 1px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 rgba(0,0,0,0.45);
  text-transform: uppercase;
}

.results-earned-item strong {
  font-size: 22px;
  color: var(--sun);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 var(--ink), 0 4px 8px rgba(0,0,0,0.4);
  margin-left: 2px;
}

.results-earned-gem strong { color: var(--cyan); }

.results-earned-emoji {
  font-size: 20px;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.4));
}

.results-earned-item .coin-ico { width: 22px; height: 22px; }

.results-earned-sep {
  display: inline-block;
  width: 2px;
  height: 22px;
  background: rgba(255,255,255,0.18);
  border-radius: 2px;
}

/* "NEW BEST!" celebratory badge — only shown when player beat previous best. */
.results-newbest {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  font-family: var(--cartoon-font);
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--ink);
  background: linear-gradient(180deg, #fff2c4 0%, var(--sun) 60%, #b8770a 100%);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow:
    0 3px 0 var(--ink),
    0 0 18px rgba(255, 210, 63, 0.7),
    0 6px 12px rgba(0,0,0,0.4);
  text-transform: uppercase;
  z-index: 3;
  animation: newbest-pop 1.4s ease-in-out infinite;
  white-space: nowrap;
}

.results-newbest.hidden { display: none; }

.results-newbest-spark {
  font-size: 12px;
  color: #fff;
  text-shadow: 0 0 6px var(--sun);
  animation: spark-spin 1.4s linear infinite;
}
.results-newbest-spark:last-child { animation-direction: reverse; }

@keyframes newbest-pop {
  0%, 100% { transform: translateX(-50%) rotate(-3deg) scale(1); }
  50%      { transform: translateX(-50%) rotate(3deg)  scale(1.06); }
}

@keyframes spark-spin {
  0%   { transform: rotate(0deg);   opacity: 0.6; }
  50%  { transform: rotate(180deg); opacity: 1; }
  100% { transform: rotate(360deg); opacity: 0.6; }
}

/* ============ Smart contextual card (v26) ============
   Single horizontal card: [icon] [text stack] [chevron]. Replaces the
   dual info-card row so the card has a consistent height and the player
   sees only the most relevant recommendation. */
.smart-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(92%, 380px);
  padding: 10px 14px;
  background: linear-gradient(180deg, #5a3aa8 0%, #2b1854 100%);
  border: 4px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 5px 0 var(--ink), 0 10px 16px rgba(0,0,0,0.4);
  color: var(--paper);
  font-family: var(--body-font);
  text-align: left;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.08s ease;
  animation: smart-card-pulse 1.8s ease-in-out infinite;
}

.smart-card:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--ink), 0 14px 20px rgba(0,0,0,0.45);
}
.smart-card:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink), 0 4px 8px rgba(0,0,0,0.4);
}
.smart-card.hidden { display: none; }

/* Zone variant: green theme, no pulse (zone is a "soft" prompt, not "hot") */
.smart-card.zone-variant {
  background: linear-gradient(180deg, #3a6a18 0%, #1d3a0a 100%);
  animation: none;
}

/* Row container for two side-by-side smart cards (pet | zone).
   Cards inside the row shrink to share width and hide chevron to save space.
   Either card can be hidden independently — the row collapses if both are.
   When only one card is visible it still fills the row width gracefully. */
.smart-card-row {
  display: flex;
  gap: 10px;
  width: min(94%, 380px);
  justify-content: center;
}
.smart-card-row:has(> .smart-card.hidden:nth-child(1):nth-last-child(1)),
.smart-card-row:not(:has(> .smart-card:not(.hidden))) { display: none; }

.smart-card-row .smart-card {
  width: auto;
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 10px;
  gap: 8px;
}
.smart-card-row .smart-card-icon {
  width: 36px;
  height: 36px;
  font-size: 20px;
}
.smart-card-row .smart-card-title {
  font-size: 12px;
  letter-spacing: 0.6px;
  white-space: normal;
  line-height: 1.05;
}
.smart-card-row .smart-card-sub {
  font-size: 11px;
  gap: 6px;
  white-space: normal;
}
.smart-card-row .smart-card-progress {
  flex: 1 1 auto;
  min-width: 24px;
}
.smart-card-row .smart-card-chevron { display: none; }
.smart-card-row .gameover-smart-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.smart-card-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(0,0,0,0.25) 100%);
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.25),
    0 3px 0 var(--ink);
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.4));
}

.smart-card-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.smart-card-title {
  font-family: var(--cartoon-font);
  font-size: 16px;
  letter-spacing: 1.2px;
  color: var(--sun);
  -webkit-text-stroke: 1.2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 rgba(0,0,0,0.5);
  text-transform: uppercase;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.smart-card-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--body-font);
  font-size: 13px;
  font-weight: 600;
  color: var(--paper);
  opacity: 0.95;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
}

.smart-card-sub > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.smart-card-sub strong { color: var(--sun); font-weight: 700; }

.smart-card-progress {
  flex: 0 0 64px;
  position: relative;
  height: 8px;
  background: rgba(0,0,0,0.5);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}
.smart-card-progress.hidden { display: none; }

.smart-card-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(180deg, var(--lime) 0%, var(--lime-dk) 100%);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
  transition: width 0.35s ease;
}

.smart-card-chevron {
  flex: 0 0 auto;
  font-family: var(--cartoon-font);
  font-size: 32px;
  color: var(--paper);
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 rgba(0,0,0,0.5);
  line-height: 1;
  padding-right: 4px;
  opacity: 0.85;
}

@keyframes smart-card-pulse {
  0%, 100% { box-shadow: 0 5px 0 var(--ink), 0 10px 16px rgba(0,0,0,0.4), 0 0 0 rgba(177, 91, 255, 0); }
  50%      { box-shadow: 0 5px 0 var(--ink), 0 10px 16px rgba(0,0,0,0.4), 0 0 22px rgba(177, 91, 255, 0.55); }
}

/* ============ Dead poop icon (game over hero) ============ */
.dead-poop {
  position: relative;
  width: 70px;
  height: 39px;
  margin: 0;
  flex: 0 0 auto;
  z-index: 2;
  animation: dead-poop-tilt 3s ease-in-out infinite;
  pointer-events: none;
}

.dead-poop-body {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: auto;
  display: block;
  filter:
    drop-shadow(0 6px 0 rgba(0,0,0,0.35))
    drop-shadow(0 10px 14px rgba(0,0,0,0.35));
}

.dead-poop-stink {
  position: absolute;
  top: 0;
  border-radius: 50% 50% 45% 55% / 60% 60% 40% 40%;
  background:
    radial-gradient(circle at 38% 30%, #d2ff90 0%, #8ddc54 45%, #4f9a1e 85%, transparent 100%);
  filter: blur(0.4px);
  opacity: 0;
  box-shadow: 0 0 8px rgba(143, 220, 84, 0.45);
}

.stink-1 { left: 24%; width: 7px;  height: 12px; animation: stink-rise 2.4s ease-out infinite; }
.stink-2 { left: 46%; width: 9px;  height: 15px; animation: stink-rise 2.6s ease-out infinite 0.45s; }
.stink-3 { left: 66%; width: 6px;  height: 11px; animation: stink-rise 2.2s ease-out infinite 0.9s; }

@keyframes stink-rise {
  0%   { transform: translateY(8px)  scale(0.85) rotate(-4deg); opacity: 0; }
  18%  { opacity: 0.95; }
  60%  { transform: translateY(-10px) scale(1.05) rotate(4deg); opacity: 0.7; }
  100% { transform: translateY(-22px) scale(1.15) rotate(-2deg); opacity: 0; }
}

@keyframes dead-poop-tilt {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50%      { transform: rotate(3deg)  translateY(-3px); }
}

@media (max-height: 640px) {
  .dead-poop { width: 72px; height: 40px; margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .dead-poop, .dead-poop-stink { animation: none; }
}

/* ============ Buttons ============ */
.btn {
  position: relative;
  margin-top: 8px;
  padding: 16px 32px;
  font-family: var(--cartoon-font);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 2px;
  color: var(--paper);
  background: linear-gradient(180deg, var(--pink) 0%, var(--pink-dk) 100%);
  border: 4px solid var(--ink);
  border-radius: 22px;
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 rgba(0,0,0,0.35);
  box-shadow: 0 7px 0 var(--ink), 0 12px 22px rgba(0,0,0,0.4);
  cursor: pointer;
  transform: rotate(-1.5deg);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
  text-transform: uppercase;
}

.btn:hover {
  filter: brightness(1.1) saturate(1.15);
  transform: rotate(-1deg) translateY(-2px);
  box-shadow: 0 9px 0 var(--ink), 0 16px 26px rgba(0,0,0,0.45);
}

.btn:active {
  transform: rotate(-1deg) translateY(5px);
  box-shadow: 0 2px 0 var(--ink), 0 4px 8px rgba(0,0,0,0.4);
}

/* Big primary CTA — Play / Try Again / Resume */
.btn-cta {
  font-size: 30px;
  padding: 18px 42px;
  background: linear-gradient(180deg, var(--sun) 0%, #f29e1f 100%);
  color: var(--ink);
  -webkit-text-stroke: 2px var(--ink);
  text-shadow: 0 3px 0 rgba(255,255,255,0.5);
  animation: cta-bounce 1.8s ease-in-out infinite;
}

.btn-cta:hover {
  animation-play-state: paused;
  transform: rotate(-1deg) scale(1.06) translateY(-2px);
}

/* Smaller secondary buttons with color variants */
.btn-sm {
  padding: 11px 18px;
  font-size: 17px;
  margin-top: 0;
  border-radius: 16px;
  border-width: 3.5px;
  box-shadow: 0 5px 0 var(--ink), 0 9px 14px rgba(0,0,0,0.35);
  letter-spacing: 1.5px;
}

.btn-sm:active {
  box-shadow: 0 1.5px 0 var(--ink), 0 3px 6px rgba(0,0,0,0.4);
}

.btn-pink {
  background: linear-gradient(180deg, var(--pink) 0%, var(--pink-dk) 100%);
  transform: rotate(-2deg);
}
.btn-cyan {
  background: linear-gradient(180deg, var(--cyan) 0%, var(--cyan-dk) 100%);
  transform: rotate(1.5deg);
}
.btn-lime {
  background: linear-gradient(180deg, var(--lime) 0%, var(--lime-dk) 100%);
  color: var(--ink);
  -webkit-text-stroke: 1px var(--ink);
  text-shadow: 0 2px 0 rgba(255,255,255,0.4);
  transform: rotate(-1deg);
}

.btn-pink:hover { transform: rotate(-1.5deg) translateY(-2px); }
.btn-cyan:hover { transform: rotate(2deg) translateY(-2px); }
.btn-lime:hover { transform: rotate(-0.5deg) translateY(-2px); }

.btn-task {
  background: linear-gradient(180deg, #ff9633 0%, #c95a10 100%);
  transform: rotate(1deg);
}
.btn-task:hover { transform: rotate(-0.5deg) translateY(-2px); }

.btn-egg {
  padding: 13px 20px;
  font-size: 17px;
  margin: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--cyan) 0%, var(--cyan-dk) 100%);
  letter-spacing: 1.5px;
  transform: rotate(-1.5deg);
}

.btn-egg.gold {
  background: linear-gradient(180deg, var(--sun) 0%, #d49a2b 100%);
  color: var(--ink);
  -webkit-text-stroke: 1px var(--ink);
  text-shadow: 0 2px 0 rgba(255,255,255,0.45);
  transform: rotate(1.5deg);
  animation: golden-pulse 1.6s ease-in-out infinite;
}

.btn-egg.cosmic {
  background: linear-gradient(180deg, #7a5af8 0%, #3a2a7a 60%, #1a1042 100%);
  color: var(--paper);
  -webkit-text-stroke: 0;
  text-shadow: 0 0 12px rgba(217,199,255,0.7), 0 2px 0 rgba(0,0,0,0.6);
  transform: rotate(-1deg);
  animation: cosmic-pulse 2.2s ease-in-out infinite;
}
.btn-egg.cosmic.locked {
  background: linear-gradient(180deg, #3a3050 0%, #1c1832 100%);
  animation: none;
  text-shadow: 0 2px 0 rgba(0,0,0,0.5);
}
@keyframes cosmic-pulse {
  0%, 100% { box-shadow: 0 4px 0 var(--ink), 0 0 0 rgba(217,199,255,0); }
  50%      { box-shadow: 0 4px 0 var(--ink), 0 0 18px rgba(217,199,255,0.55); }
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.5);
  animation: none;
}

/* ============ Decorative floating stickers ============ */
.deco {
  position: absolute;
  font-size: 36px;
  pointer-events: none;
  filter: drop-shadow(0 4px 0 rgba(0,0,0,0.4));
  z-index: 1;
}
.deco-tl { top: 8%;   left: 6%;  animation: deco-float-a 3.2s ease-in-out infinite; }
.deco-tr { top: 7%;   right: 6%; animation: deco-float-b 2.8s ease-in-out infinite; font-size: 30px; }
.deco-bl { bottom: 10%; left: 8%; animation: deco-float-b 3.6s ease-in-out infinite; font-size: 28px; }
.deco-br { bottom: 12%; right: 7%; animation: deco-float-a 3.0s ease-in-out infinite; font-size: 32px; }

/* ============ Panels ============ */
.panel {
  justify-content: flex-start;
  padding-top: 56px;
  padding-bottom: 24px;
}

.panel .tag { margin-bottom: 8px; }

.panel-wallet {
  position: absolute;
  top: 14px;
  left: 12px;
  display: flex;
  gap: 8px;
  z-index: 2;
  pointer-events: none;
}
.panel-wallet .chip {
  font-size: 15px;
  padding: 5px 11px;
  border-width: 2px;
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--pink) 0%, var(--pink-dk) 100%);
  border: 3px solid var(--ink);
  color: var(--paper);
  font-family: var(--cartoon-font);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 4px 0 var(--ink), 0 8px 14px rgba(0,0,0,0.4);
  transform: rotate(8deg);
  transition: transform 0.08s ease, filter 0.15s ease;
  z-index: 2;
}

.close-btn:hover {
  filter: brightness(1.15);
  transform: rotate(-8deg) scale(1.05);
}

.close-btn:active {
  transform: rotate(8deg) translateY(3px);
  box-shadow: 0 1px 0 var(--ink), 0 3px 6px rgba(0,0,0,0.4);
}

.hatch-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 4px 0 8px;
}

.pity-hints {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: -2px 0 10px;
  font-family: var(--cartoon-font);
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.5px;
}
.pity-hints:empty { display: none; }
.pity-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: rgba(0,0,0,0.35);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 2px 0 rgba(0,0,0,0.4);
}
.pity-line .pity-egg { font-size: 14px; }
.pity-line b { color: #ffe27a; font-weight: 400; }

.hatch-pity-note {
  margin-top: 6px;
  font-size: 13px;
  color: #ffe27a;
  font-family: var(--cartoon-font);
  letter-spacing: 0.5px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.6);
}

/* ============ Grids & Cells ============ */
.grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  align-content: start;
}

.grid.zones {
  grid-template-columns: 1fr;
  max-width: 360px;
  margin: 0 auto;
}

.cell {
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  position: relative;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, filter 0.15s ease;
  min-height: 96px;
  box-shadow: 0 4px 0 var(--ink);
}

.cell:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.08));
  transform: translateY(-3px) rotate(-1deg);
  box-shadow: 0 7px 0 var(--ink), 0 12px 18px rgba(0,0,0,0.4);
}

.cell:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}

.cell .icon {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,0.35));
}
.cell .label {
  font-family: var(--cartoon-font);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.5px;
  line-height: 1.1;
  text-align: center;
  color: var(--paper);
  text-shadow: 0 2px 0 var(--ink);
}
.cell .cost {
  font-family: var(--cartoon-font);
  font-size: 12px;
  opacity: 0.95;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: var(--sun);
  text-shadow: 0 2px 0 var(--ink);
}

.cell.locked { opacity: 0.5; filter: grayscale(0.7); }
.cell.locked .icon { filter: blur(1.5px) drop-shadow(0 3px 0 rgba(0,0,0,0.35)); }

.cell.owned {
  background: linear-gradient(180deg, rgba(184, 255, 60, 0.32), rgba(93, 138, 19, 0.25));
  border-color: var(--lime-dk);
}
.cell.equipped {
  outline: 3px solid var(--sun);
  outline-offset: 1px;
  background: linear-gradient(180deg, rgba(246, 196, 83, 0.32), rgba(184, 135, 10, 0.2));
  animation: equipped-glow 1.8s ease-in-out infinite;
}

.cell .rarity-tag {
  position: absolute;
  top: 4px;
  left: 4px;
  font-family: var(--cartoon-font);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: #777;
  color: #fff;
  border: 1.5px solid var(--ink);
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
}
.rarity-tag.common    { background: linear-gradient(180deg, #aeaeae, #6a6a6a); }
.rarity-tag.uncommon  { background: linear-gradient(180deg, #6fd96f, #2f9c2f); }
.rarity-tag.rare      { background: linear-gradient(180deg, #59b5f9, #1768b5); }
.rarity-tag.epic      { background: linear-gradient(180deg, #c171e3, #6c1e91); }
.rarity-tag.legendary { background: linear-gradient(180deg, #ffb84d, #c46703); }
.rarity-tag.mythic    {
  background: linear-gradient(45deg, #ff4081, #ff9800, #ffeb3b);
  animation: mythic-shimmer 2.5s linear infinite;
}

.cell.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cell .equip-mark {
  position: absolute;
  top: 4px;
  right: 4px;
  font-family: var(--cartoon-font);
  font-size: 11px;
  background: linear-gradient(180deg, var(--sun) 0%, var(--sun-dk) 100%);
  color: var(--ink);
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.5px;
  border: 1.5px solid var(--ink);
  box-shadow: 0 2px 0 var(--ink);
}

/* Origin-zone glyph on pet cards (top-right, same slot as equip-mark when
   not equipped). Small chip so it doesn't fight rarity-tag on the left. */
.cell .zone-tag {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 13px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1.5px solid var(--ink);
  box-shadow: 0 1px 0 var(--ink);
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.35));
}

/* ============ Pets Collection Panel ============ */
.pets-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 4px 0 10px;
}

.pet-collection {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pet-zone-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pet-zone-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 3px 0 var(--ink);
  font-family: var(--cartoon-font);
  letter-spacing: 0.6px;
}
.pet-zone-header.complete {
  background: linear-gradient(180deg, rgba(246, 196, 83, 0.35), rgba(184, 135, 10, 0.25));
  border-color: var(--sun-dk);
}
.pet-zone-icon { font-size: 18px; }
.pet-zone-name {
  flex: 1;
  font-size: 14px;
  color: var(--paper);
  text-shadow: 0 2px 0 var(--ink);
}
.pet-zone-count {
  font-size: 13px;
  color: var(--sun);
  text-shadow: 0 2px 0 var(--ink);
}

.pet-zone-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.pet-cell {
  min-height: 118px;
}

/* Tier count chips at the bottom of each card */
.cell .tier-chips {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2px;
}
.cell .tier-chip {
  font-family: var(--cartoon-font);
  font-size: 10px;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  box-shadow: 0 1.5px 0 var(--ink);
  color: var(--paper);
  text-shadow: 0 1px 0 rgba(0,0,0,0.5);
}
.cell .tier-chip.tier-normal {
  background: linear-gradient(180deg, #cccccc, #6e6e6e);
  color: #1a1a1a;
  text-shadow: none;
}
.cell .tier-chip.tier-golden {
  background: linear-gradient(180deg, #ffd75f, #c48b0b);
  color: #1a1a1a;
  text-shadow: none;
}
.cell .tier-chip.tier-shiny {
  background: linear-gradient(45deg, #6dd5ed, #b06ad8, #ff7ab6, #ffd75f);
  background-size: 200% 200%;
  animation: tier-shiny-shimmer 3s linear infinite;
  color: #1a1a1a;
  text-shadow: none;
}
@keyframes tier-shiny-shimmer {
  0%   { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

/* READY badge on cards that can combine. Floats top-right; if the card is
   equipped it nudges down so it doesn't collide with the equip mark. */
.cell .ready-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  font-family: var(--cartoon-font);
  font-size: 9px;
  letter-spacing: 0.8px;
  padding: 2px 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #6fd96f, #2f9c2f);
  color: #fff;
  border: 1.5px solid var(--ink);
  box-shadow: 0 2px 0 var(--ink);
  animation: ready-pulse 1.4s ease-in-out infinite;
  z-index: 2;
}
.cell.equipped .ready-badge {
  top: 28px;
}
@keyframes ready-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}

/* Equip mark dot/glyph now indicates which tier is equipped */
.cell .equip-mark.equip-tier-normal {
  background: linear-gradient(180deg, #cccccc, #6e6e6e);
  color: #1a1a1a;
}
.cell .equip-mark.equip-tier-golden {
  background: linear-gradient(180deg, #ffd75f, #c48b0b);
  color: #1a1a1a;
}
.cell .equip-mark.equip-tier-shiny {
  background: linear-gradient(45deg, #6dd5ed, #b06ad8, #ff7ab6, #ffd75f);
  background-size: 200% 200%;
  animation: tier-shiny-shimmer 3s linear infinite;
  color: #1a1a1a;
}

/* Equipped outline color reflects the equipped tier */
.cell.equipped.equipped-golden {
  outline-color: #ffd75f;
  background: linear-gradient(180deg, rgba(255, 215, 95, 0.32), rgba(196, 139, 11, 0.22));
}
.cell.equipped.equipped-shiny {
  outline-color: #b06ad8;
  background: linear-gradient(180deg, rgba(176, 106, 216, 0.32), rgba(255, 122, 182, 0.22));
}

/* ============ Zones Panel ============ */
.zones-panel {
  background:
    radial-gradient(ellipse at 50% 12%, rgba(80, 140, 200, 0.25), transparent 60%),
    radial-gradient(circle at 20% 80%, rgba(120, 60, 200, 0.18), transparent 55%),
    linear-gradient(180deg, #0d1a3a 0%, #060a1f 100%);
  padding-top: 56px;
  padding-bottom: 18px;
  gap: 10px;
}

.grid.zones {
  grid-template-columns: 1fr;
  max-width: 340px;
  width: 100%;
  gap: 12px;
  padding: 4px 0 8px;
}

.zones .cell.zone-card {
  display: grid;
  /* Two-row layout so reward summary and unlock progress get a full-width
     band under the head row. Without this they get squeezed to ~50px on
     narrow viewports. */
  grid-template-columns: 58px minmax(0, 1fr) 36px;
  grid-template-areas:
    "icon text  status"
    "meta meta  meta";
  align-items: center;
  gap: 6px 10px;
  padding: 10px 12px;
  min-height: 82px;
  border-radius: 18px;
  border: 3px solid var(--ink);
  background:
    linear-gradient(180deg, var(--zone-hi, #5fa334) 0%, var(--zone-lo, #2a5a0e) 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.3),
    inset 0 -3px 0 var(--zone-edge, rgba(0,0,0,0.3)),
    0 5px 0 var(--ink),
    0 8px 14px rgba(0,0,0,0.45);
  transform: none;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.zones .cell.zone-card:hover {
  transform: translateY(-2px) rotate(-0.4deg);
  filter: brightness(1.08) saturate(1.1);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.3),
    inset 0 -3px 0 rgba(0,0,0,0.28),
    0 7px 0 var(--ink),
    0 12px 18px rgba(0,0,0,0.5);
}

.zones .cell.zone-card:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.2),
    inset 0 -3px 0 rgba(0,0,0,0.28),
    0 1px 0 var(--ink),
    0 3px 6px rgba(0,0,0,0.4);
}

/* Connecting dotted line between cards */
.zones .cell.zone-card::before {
  content: '';
  position: absolute;
  left: 21px;
  top: -12px;
  width: 4px;
  height: 12px;
  background-image: radial-gradient(circle, rgba(255,255,255,0.55) 1.2px, transparent 1.6px);
  background-size: 4px 4px;
  background-repeat: repeat-y;
  pointer-events: none;
}

.zones .cell.zone-card:first-child::before { display: none; }

/* Soft themed pattern overlay on each card */
.zones .cell.zone-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 50%, rgba(255,255,255,0.18) 0%, transparent 40%),
    radial-gradient(circle at 20% 100%, rgba(0,0,0,0.2) 0%, transparent 40%);
  pointer-events: none;
}

.zone-icon-wrap {
  position: relative;
  z-index: 2;
  grid-area: icon;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zone-icon-img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  display: block;
  filter:
    drop-shadow(0 2px 0 rgba(0,0,0,0.65))
    drop-shadow(0 5px 6px rgba(0,0,0,0.35));
}

.zone-icon-emoji {
  font-size: 38px;
  line-height: 1;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.65));
}

/* Number badge */
.zone-num {
  position: absolute;
  left: -2px;
  bottom: -1px;
  z-index: 3;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.45), transparent 55%),
    linear-gradient(180deg, var(--zone-lo, #2a5a0e), #050a14);
  border: 2.5px solid var(--ink);
  box-shadow:
    inset 0 -2px 0 rgba(0,0,0,0.35),
    0 2px 0 var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--cartoon-font);
  font-size: 13px;
  font-weight: 400;
  color: var(--paper);
  -webkit-text-stroke: 1px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--ink);
}

/* Two-line zone name */
.zone-text {
  position: relative;
  z-index: 2;
  grid-area: text;
  text-align: left;
  line-height: 1;
  min-width: 0;
}

/* Reward summary + unlock progress band, full-width row beneath the head. */
.zone-meta {
  position: relative;
  z-index: 2;
  grid-area: meta;
  min-width: 0;
}
.zone-meta:empty { display: none; }

.zone-name {
  font-family: var(--cartoon-font);
  font-size: 22px;
  letter-spacing: 1.5px;
  color: var(--sun);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink), 0 5px 8px rgba(0,0,0,0.4);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.zone-sub {
  font-family: var(--cartoon-font);
  font-size: 15px;
  letter-spacing: 1.2px;
  color: var(--paper);
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--ink);
  line-height: 1.1;
  margin-top: 2px;
}

/* Reward summary + unlock progress line on zone cards.
   Sits under the name/sub. Always visible on unlocked cards (showing what
   the zone pays); only the progress line appears on locked cards. */
.zone-reward-line {
  font-family: 'Fredoka', Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  color: rgba(255, 248, 230, 0.95);
  text-shadow: 0 1px 0 rgba(0,0,0,0.6), 0 0 2px rgba(0,0,0,0.6);
  margin-top: 6px;
  letter-spacing: 0.3px;
}
.zone-reward-line .coin-ico { width: 11px; height: 11px; vertical-align: -1px; }
.zone-reward-mult {
  color: var(--sun);
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(0,0,0,0.65);
}
.zone-progress {
  font-family: 'Fredoka', Arial, sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.35;
  margin-top: 4px;
  color: rgba(255, 248, 230, 0.88);
  text-shadow: 0 1px 0 rgba(0,0,0,0.6);
  letter-spacing: 0.2px;
}
.zone-progress .req {
  display: inline;
  white-space: nowrap;
}
.zone-progress .req.met    { color: #c2f06a; }
.zone-progress .req.pending{ color: rgba(255, 248, 230, 0.85); }
.zone-progress .req b      { font-weight: 700; }

/* Themed art scene — hidden in the new meta-rich layout (kept in DOM for
   future use; CSS reclaims the column instead). */
.zone-art {
  display: none;
}

.zone-scene {
  position: relative;
  width: 64px;
  height: 56px;
  border-radius: 12px;
  background:
    linear-gradient(160deg, rgba(0,0,0,0.32), rgba(0,0,0,0.55));
  border: 2px solid rgba(0,0,0,0.4);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.12);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zone-scene .art-a {
  font-size: 30px;
  line-height: 1;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.5));
}

.zone-scene .art-b {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 16px;
  line-height: 1;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.5));
}

/* Status badge (lock / check / play) */
.zone-status {
  position: relative;
  z-index: 2;
  grid-area: status;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 2.5px solid var(--ink);
  box-shadow:
    inset 0 -2px 0 rgba(0,0,0,0.35),
    0 2px 0 var(--ink);
  font-family: var(--cartoon-font);
}

.zone-status.locked {
  background: linear-gradient(180deg, #2a2a35, #0e0e18);
  color: var(--paper);
}

.zone-status.active {
  background: linear-gradient(180deg, var(--lime) 0%, var(--lime-dk) 100%);
  color: var(--ink);
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
  font-size: 18px;
  animation: zone-active-pulse 1.6s ease-in-out infinite;
}

.zone-status.available {
  background: linear-gradient(180deg, var(--sun) 0%, var(--sun-dk) 100%);
  color: var(--ink);
  font-size: 13px;
  padding-left: 2px;
}

.zone-lock, .zone-check, .zone-play { line-height: 1; }

/* Per-zone color tokens — bright top, mid-dark bottom for vivid 3D look */
.zone-card.zone-sewer    { --zone-hi: #92e056; --zone-lo: #4ea024; --zone-edge: #2b6510; }
.zone-card.zone-bathroom { --zone-hi: #6fcfe9; --zone-lo: #2f8db5; --zone-edge: #1c5a7c; }
.zone-card.zone-factory  { --zone-hi: #b27cf2; --zone-lo: #6a36c2; --zone-edge: #3e1782; }
.zone-card.zone-lava     { --zone-hi: #ff8a4d; --zone-lo: #d04419; --zone-edge: #7a1d04; }
.zone-card.zone-desert   { --zone-hi: #f5c978; --zone-lo: #c8873e; --zone-edge: #8a5422; }
.zone-card.zone-arctic   { --zone-hi: #dff8ff; --zone-lo: #78c7df; --zone-edge: #1e6d86; }
.zone-card.zone-forest   { --zone-hi: #7fcf6b; --zone-lo: #2f7b45; --zone-edge: #183b22; }
.zone-card.zone-office   { --zone-hi: #d9e7f0; --zone-lo: #66717c; --zone-edge: #303840; }
.zone-card.zone-ocean    { --zone-hi: #30c2d6; --zone-lo: #036c84; --zone-edge: #023747; }
.zone-card.zone-race_track { --zone-hi: #8cc8f0; --zone-lo: #555555; --zone-edge: #181818; }
.zone-card.zone-coffee_shop { --zone-hi: #d8a863; --zone-lo: #7a4a2f; --zone-edge: #2b1b12; }
.zone-card.zone-zoo      { --zone-hi: #9cdd7c; --zone-lo: #5ba44e; --zone-edge: #31562a; }
.zone-card.zone-junkyard { --zone-hi: #8b9295; --zone-lo: #4b4f4d; --zone-edge: #242829; }
.zone-card.zone-mountains { --zone-hi: #9fd0ef; --zone-lo: #59666b; --zone-edge: #263237; }
.zone-card.zone-space    { --zone-hi: #8c70ff; --zone-lo: #4e36c4; --zone-edge: #1a0e4a; }
.zone-card.zone-crystal  { --zone-hi: #72e5ff; --zone-lo: #267ca8; --zone-edge: #0e486a; }

/* Locked: keep full color, dim slightly — the lock pill is the signal */
.zones .cell.zone-card.locked {
  filter: brightness(0.92) saturate(0.95);
}
.zones .cell.zone-card.locked .zone-name { color: var(--paper); }
.zones .cell.zone-card.locked .zone-sub  { color: rgba(255,255,255,0.95); }

/* Selected/active card highlight */
.zones .cell.zone-card.equipped {
  outline: 3px solid var(--sun);
  outline-offset: -2px;
  animation: none;
  filter: brightness(1.05) saturate(1.1);
}

.zones .cell.zone-card.equipped .zone-name {
  color: var(--sun);
  text-shadow:
    0 0 8px rgba(255, 210, 63, 0.55),
    0 3px 0 var(--ink),
    0 5px 8px rgba(0,0,0,0.4);
}

/* Unlock progress bar */
.zone-unlock-bar {
  width: 100%;
  max-width: 340px;
  padding: 10px 14px 12px;
  background: linear-gradient(180deg, #f6c453 0%, #b8770a 100%);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.4),
    inset 0 -3px 0 rgba(0,0,0,0.25),
    0 5px 0 var(--ink),
    0 9px 16px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  transform: rotate(-0.5deg);
}

.zone-unlock-bar.hidden { display: none; }

.zone-unlock-label {
  font-family: var(--cartoon-font);
  font-size: 16px;
  letter-spacing: 1.5px;
  color: var(--paper);
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--ink);
  text-transform: uppercase;
}

.zone-unlock-progress {
  width: 100%;
  height: 18px;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.4));
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.zone-unlock-fill {
  height: 100%;
  width: 0%;
  background:
    linear-gradient(180deg, #6dd6ff 0%, #1b8fb8 100%);
  border-radius: 999px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.45);
  transition: width 0.4s ease;
}

.zone-unlock-amount {
  font-family: var(--cartoon-font);
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--paper);
  -webkit-text-stroke: 1px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--ink);
}

@keyframes zone-active-pulse {
  0%, 100% { box-shadow: inset 0 -2px 0 rgba(0,0,0,0.35), 0 2px 0 var(--ink), 0 0 0 rgba(255,210,63,0); }
  50%      { box-shadow: inset 0 -2px 0 rgba(0,0,0,0.35), 0 2px 0 var(--ink), 0 0 14px rgba(255,210,63,0.7); }
}

/* ============ Hatch modal ============ */
.hatch-modal {
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 210, 63, 0.2), transparent 60%),
    rgba(0,0,0,0.78);
  z-index: 10;
}

.hatch-card {
  background: linear-gradient(160deg, #4a2c10, #2b1b0d);
  border: 4px solid var(--sun);
  border-radius: 22px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow:
    0 0 0 4px var(--ink),
    0 20px 60px rgba(0,0,0,0.7),
    0 0 80px rgba(255, 210, 63, 0.35);
  max-width: 320px;
  position: relative;
}

.hatch-card h2 {
  font-family: var(--cartoon-font);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: 1.5px;
  color: var(--sun);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink), 0 6px 10px rgba(0,0,0,0.5);
  margin: 0;
  text-transform: uppercase;
  transform: none;
  animation: none;
}

.egg-anim {
  font-size: 96px;
  animation: shake 0.4s ease-in-out infinite;
  filter: drop-shadow(0 8px 0 rgba(0,0,0,0.4));
}
.egg-anim.cracked { animation: none; }

@keyframes shake {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
}

.hatch-pet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: pop 0.4s ease-out;
}
.hatch-pet.hidden { display: none; }

@keyframes pop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

.hatch-icon {
  font-size: 80px;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,0.4));
}
.hatch-name {
  font-family: var(--cartoon-font);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 1.5px;
  color: var(--paper);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink);
}
.hatch-rarity {
  font-family: var(--cartoon-font);
  font-size: 15px;
  font-weight: 400;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 2px solid var(--ink);
  letter-spacing: 1px;
}
.hatch-mult {
  font-family: var(--cartoon-font);
  font-size: 18px;
  color: var(--sun);
  font-weight: 400;
  letter-spacing: 1px;
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--ink);
}

/* ============ Keyframes ============ */
@keyframes title-wobble {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50%      { transform: rotate(-1deg) translateY(-6px); }
}

@keyframes title-shake {
  0%, 100% { transform: rotate(-3deg); }
  25%      { transform: rotate(-5deg) translateX(-3px); }
  75%      { transform: rotate(-1deg) translateX(3px); }
}

@keyframes title-float {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50%      { transform: rotate(-2deg) translateY(-10px); }
}

@keyframes cta-bounce {
  0%, 100% { transform: rotate(-1.5deg) translateY(0); }
  50%      { transform: rotate(-1.5deg) translateY(-5px); }
}

@keyframes golden-pulse {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 0 rgba(255, 210, 63, 0)); }
  50%      { filter: brightness(1.1) drop-shadow(0 0 12px rgba(255, 210, 63, 0.7)); }
}

@keyframes equipped-glow {
  0%, 100% { box-shadow: 0 4px 0 var(--ink), 0 0 0 rgba(255, 210, 63, 0); }
  50%      { box-shadow: 0 4px 0 var(--ink), 0 0 18px rgba(255, 210, 63, 0.6); }
}

@keyframes mythic-shimmer {
  0%   { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

@keyframes badge-pop {
  0%   { transform: rotate(-2deg) scale(0.4); opacity: 0; }
  60%  { transform: rotate(-2deg) scale(1.18); opacity: 1; }
  100% { transform: rotate(-2deg) scale(1); }
}

@keyframes multiplier-boost {
  0%   { transform: rotate(-2deg) scale(1); }
  45%  { transform: rotate(-2deg) scale(1.2); box-shadow: 0 4px 0 rgba(0,0,0,0.4), 0 0 22px rgba(246,196,83,0.9); }
  100% { transform: rotate(-2deg) scale(1); }
}

@keyframes multiplier-float {
  0%   { opacity: 0; transform: translateY(8px) scale(0.8); }
  22%  { opacity: 1; transform: translateY(0) scale(1.08); }
  100% { opacity: 0; transform: translateY(-20px) scale(1); }
}

@keyframes deco-float-a {
  0%, 100% { transform: translateY(0) rotate(-8deg) scale(1); }
  50%      { transform: translateY(-14px) rotate(10deg) scale(1.1); }
}
@keyframes deco-float-b {
  0%, 100% { transform: translateY(0) rotate(8deg) scale(1); }
  50%      { transform: translateY(-12px) rotate(-10deg) scale(1.12); }
}

/* ============ Skin shop previews ============ */
.skin-cell {
  padding: 6px 4px 8px;
  min-height: 130px;
}

.skin-cell .preview-slot {
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 0 rgba(0,0,0,0.35));
  transition: transform 0.15s ease;
}

.skin-cell:hover .preview-slot {
  transform: translateY(-2px) scale(1.06);
}

.skin-cell .skin-preview {
  width: 84px;
  height: 84px;
  display: block;
}

.skin-cell.unowned .preview-slot {
  filter: drop-shadow(0 4px 0 rgba(0,0,0,0.35)) saturate(0.55) brightness(0.78);
}

.skin-cell .lock-mark {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 14px;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.6));
  z-index: 2;
}

/* ============ Shop zone section headers ============ */
/* Header that spans the full shop grid above each zone's 10 items.
   Uses grid-column: 1/-1 to stretch across all 4 columns of the .grid layout. */
.shop-zone-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 6px;
  margin-top: 8px;
  border-bottom: 2px solid rgba(255,255,255,0.18);
  font-family: 'Luckiest Guy', cursive;
  font-size: 17px;
  letter-spacing: 0.5px;
  color: var(--cream, #fff3c4);
  text-shadow: 0 2px 0 rgba(0,0,0,0.55);
}

.shop-zone-header:first-child {
  margin-top: 0;
}

.shop-zone-icon {
  font-size: 22px;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.45));
}

.shop-zone-name {
  flex: 1;
}

.shop-zone-hint {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 500;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0;
  text-shadow: none;
}

/* ============ Buy confirmation modal ============ */
.buy-modal {
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 210, 63, 0.22), transparent 60%),
    rgba(0, 0, 0, 0.82);
  z-index: 11;
}

.buy-card {
  background: linear-gradient(160deg, #4a2c10, #2b1b0d);
  border: 4px solid var(--sun);
  border-radius: 22px;
  padding: 22px 26px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow:
    0 0 0 4px var(--ink),
    0 20px 60px rgba(0,0,0,0.7),
    0 0 80px rgba(255, 210, 63, 0.3);
  max-width: 320px;
  position: relative;
  animation: buy-card-pop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes buy-card-pop {
  0%   { transform: scale(0.7) rotate(-3deg); opacity: 0; }
  60%  { transform: scale(1.06) rotate(-1deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}

.buy-card h2 {
  font-family: var(--cartoon-font);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: 1.5px;
  color: var(--sun);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink), 0 6px 10px rgba(0,0,0,0.5);
  margin: 0;
  text-transform: uppercase;
  transform: none;
  animation: none;
}

.buy-preview {
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255,210,63,0.20), transparent 65%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.buy-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255,210,63,0.15), transparent 30%, rgba(255,210,63,0.15) 60%, transparent 90%);
  animation: buy-ring-spin 6s linear infinite;
}

.buy-preview canvas {
  width: 180px;
  height: 180px;
  position: relative;
  filter: drop-shadow(0 8px 0 rgba(0,0,0,0.45));
  animation: buy-preview-bob 2.2s ease-in-out infinite;
}

@keyframes buy-ring-spin {
  to { transform: rotate(360deg); }
}

@keyframes buy-preview-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-6px) rotate(2deg); }
}

.buy-name {
  font-family: var(--cartoon-font);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 1.5px;
  color: var(--paper);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink);
  text-align: center;
  line-height: 1.05;
}

.buy-cost {
  font-family: var(--cartoon-font);
  font-size: 24px;
  color: var(--sun);
  background: rgba(255,255,255,0.08);
  padding: 5px 18px;
  border-radius: 999px;
  border: 2.5px dashed rgba(255,255,255,0.3);
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--ink);
  letter-spacing: 1px;
}

.buy-cost span { color: var(--sun); }

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

.btn.btn-buy,
.btn.btn-cancel {
  margin-top: 0;
  font-size: 20px;
  padding: 12px 22px;
  letter-spacing: 1.5px;
  transform: rotate(-1deg);
}

.btn.btn-buy {
  background: linear-gradient(180deg, var(--lime) 0%, var(--lime-dk) 100%);
  color: var(--ink);
  -webkit-text-stroke: 1.5px var(--ink);
  text-shadow: 0 2px 0 rgba(255,255,255,0.35);
}

.btn.btn-cancel {
  background: linear-gradient(180deg, #ff7676 0%, #b81d1d 100%);
  transform: rotate(1deg);
}

.btn.btn-buy:hover { transform: rotate(-1.5deg) translateY(-2px); }
.btn.btn-cancel:hover { transform: rotate(1.5deg) translateY(-2px); }

/* ============ Just-bought celebration ============ */
.cell.just-bought {
  animation: just-bought-pop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 5;
}

@keyframes just-bought-pop {
  0%   { transform: scale(1); filter: brightness(1) saturate(1); }
  18%  { transform: scale(1.22) rotate(-4deg); filter: brightness(1.5) saturate(1.5) drop-shadow(0 0 20px rgba(255,210,63,0.9)); }
  45%  { transform: scale(1.08) rotate(3deg); filter: brightness(1.25) saturate(1.3) drop-shadow(0 0 12px rgba(255,210,63,0.7)); }
  100% { transform: scale(1) rotate(0); filter: brightness(1) saturate(1); }
}

.cell .sparkle {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 22px;
  pointer-events: none;
  z-index: 6;
  transform: translate(-50%, -50%) scale(0);
  animation: sparkle-fly 1.2s cubic-bezier(0.22, 0.84, 0.34, 1) forwards;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

@keyframes sparkle-fly {
  0%   { transform: translate(-50%, -50%) scale(0) rotate(0); opacity: 0; }
  15%  { opacity: 1; transform: translate(-50%, -50%) scale(1.4) rotate(40deg); }
  100% { transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px))) scale(0.4) rotate(220deg); opacity: 0; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  .title-logo,
  .overlay h1,
  .deco,
  .btn-cta,
  .btn-egg.gold,
  .cell.equipped,
  .rarity-tag.mythic,
  .egg-anim,
  .buy-card,
  .buy-preview::before,
  .buy-preview canvas,
  .cell.just-bought,
  .cell .sparkle {
    animation: none !important;
  }
}

@media (max-height: 640px) {
  .title-logo { width: min(98%, 430px); margin-top: -8px; }
  .overlay h1 { font-size: clamp(40px, 10vw, 60px); }
  .btn-cta { font-size: 26px; padding: 14px 32px; }
  .btn-tryagain, .btn-play { font-size: 24px; padding: 12px 20px; }
  .btn-tryagain .btn-glyph, .btn-play .btn-glyph { width: 34px; height: 34px; font-size: 22px; }
  .deco { font-size: 28px !important; }
  .menu-overlay, .gameover-overlay { gap: 9px; padding-top: 18px; }
  .gameover-overlay h1 { font-size: clamp(38px, 9.5vw, 54px); margin-top: 0; }
  .score-card-value { font-size: 26px; }
  .score-card { padding: 8px 18px; }
  .tile-icon { font-size: 26px; }
  .tile-label { font-size: 12px; }
  .earned-col { font-size: 14px; }
  .earned-col strong { font-size: 18px; }
  .info-card-body { font-size: 12px; }
  /* v26 — tighten results card + smart card on short screens */
  .results-card { padding: 12px 18px 10px; gap: 4px; }
  .results-stat-value { font-size: 26px; }
  .results-stat-label { font-size: 12px; }
  .results-trophy { font-size: 24px; }
  .results-earned-item { font-size: 12px; }
  .results-earned-item strong { font-size: 18px; }
  .results-newbest { font-size: 12px; padding: 3px 11px; top: -12px; }
  .smart-card { padding: 8px 12px; gap: 10px; }
  .smart-card-icon { width: 38px; height: 38px; font-size: 22px; }
  .smart-card-title { font-size: 14px; }
  .smart-card-sub { font-size: 12px; }
  .smart-card-chevron { font-size: 28px; }
}

@media (max-width: 420px) {
  #menu { padding-inline: 14px; }
  #menu .title-logo { width: 100%; margin-top: -8px; }
  #menu .menu-row { gap: 8px; width: 100%; }
  #menu .btn-sm {
    padding: 10px 12px;
    font-size: 15px;
    letter-spacing: 1px;
  }
  .tile-row, .info-row, .earned-card, .score-card,
  .results-card, .smart-card, .btn-tryagain, .btn-play { width: 96%; }
  .info-card { padding: 8px 10px 10px; }
  .info-card-head { font-size: 13px; }
  .info-card-icon { font-size: 18px; }
}

/* ============ Tasks panel ============ */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.task-row {
  background: rgba(0,0,0,0.35);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 0 var(--ink);
  font-family: var(--cartoon-font);
  letter-spacing: 0.5px;
}
.task-row.ready { background: linear-gradient(180deg, rgba(255,184,77,0.35), rgba(0,0,0,0.4)); }
.task-row.claimed { opacity: 0.55; filter: grayscale(0.4); }
.task-head { display: flex; justify-content: space-between; font-size: 15px; }
.task-label { color: var(--paper); }
.task-reward { color: #ffe27a; }
.task-progress {
  height: 10px;
  background: rgba(0,0,0,0.5);
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}
.task-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--lime), var(--cyan));
  transition: width 0.25s ease;
}
.task-row.ready .task-fill { background: linear-gradient(90deg, #ffd166, #ff9633); }
.task-foot { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: rgba(255,255,255,0.85); }
.btn-task-claim {
  padding: 6px 12px;
  font-size: 13px;
  margin: 0;
  background: linear-gradient(180deg, var(--sun) 0%, #d49a2b 100%);
  color: var(--ink);
  -webkit-text-stroke: 1px var(--ink);
  border-radius: 10px;
  letter-spacing: 1px;
}
.btn-task-claim[disabled] {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5);
  -webkit-text-stroke: 0;
  cursor: not-allowed;
  box-shadow: 0 2px 0 var(--ink);
  filter: none;
  opacity: 1;
}

.stamp-card {
  margin: 14px auto 6px;
  width: 100%;
  max-width: 360px;
  background: linear-gradient(180deg, rgba(247,196,83,0.18), rgba(0,0,0,0.35));
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 10px 12px;
  font-family: var(--cartoon-font);
  letter-spacing: 0.5px;
  box-shadow: 0 4px 0 var(--ink);
}
.stamp-head { display: flex; justify-content: space-between; font-size: 14px; color: var(--paper); margin-bottom: 6px; }
.stamp-reward { color: #ffe27a; font-size: 12px; }
.stamp-progress {
  height: 12px;
  background: rgba(0,0,0,0.5);
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}
.stamp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sun), #ff9633, var(--pink));
  transition: width 0.25s ease;
}
.stamp-foot { margin-top: 6px; font-size: 12px; color: rgba(255,255,255,0.8); text-align: center; }

.tasks-section-title {
  margin: 18px 0 8px;
  font-family: var(--cartoon-font);
  font-size: 18px;
  letter-spacing: 1.5px;
  color: var(--paper);
  text-align: center;
  text-shadow: 0 2px 0 rgba(0,0,0,0.5);
}
.achievements-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ach-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.35);
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-family: var(--cartoon-font);
  letter-spacing: 0.5px;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
}
.ach-item.done {
  background: linear-gradient(180deg, rgba(110,210,80,0.35), rgba(0,0,0,0.35));
  color: var(--paper);
}
.ach-icon { font-size: 16px; color: #ffe27a; text-align: center; }
.ach-item.done .ach-icon { color: var(--lime); }
.ach-reward-tag { font-size: 12px; color: #ffe27a; }

/* Ticket count chip inside hatch buttons */
.ticket-count {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  background: rgba(0,0,0,0.4);
  border-radius: 999px;
  font-size: 13px;
}

/* ============ Achievement toast (in-canvas overlay) ============ */
.achievement-toast {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translate(-50%, -20px);
  background: linear-gradient(180deg, #ffd166 0%, #d49a2b 100%);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 10px 18px;
  font-family: var(--cartoon-font);
  letter-spacing: 1px;
  color: var(--ink);
  -webkit-text-stroke: 0.6px var(--ink);
  box-shadow: 0 5px 0 var(--ink), 0 10px 20px rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
  z-index: 30;
  text-align: center;
}
.achievement-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.achievement-toast .ach-title { font-size: 16px; }
.achievement-toast .ach-reward { font-size: 13px; margin-top: 2px; color: #5a2e00; }

/* ============ Shop tabs (Skins / Trails) ============ */
.shop-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 4px 0 8px;
}
.shop-tab {
  background: rgba(0,0,0,0.4);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 8px 16px;
  color: var(--paper);
  font-family: var(--cartoon-font);
  font-size: 15px;
  letter-spacing: 1.2px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.08s ease, background 0.15s ease;
}
.shop-tab.active {
  background: linear-gradient(180deg, var(--sun) 0%, #d49a2b 100%);
  color: var(--ink);
  -webkit-text-stroke: 0.8px var(--ink);
  transform: translateY(-2px);
}
.shop-tab:hover { transform: translateY(-2px); }
.shop-tab.active:hover { transform: translateY(-3px); }

/* Trail cells use the same grid as skin cells but render an emoji preview. */
.trail-preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 60%, rgba(255,255,255,0.18), rgba(0,0,0,0.4));
  border-radius: 12px;
  border: 2px solid var(--ink);
}
.trail-icon {
  font-size: 48px;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,0.45));
}

/* ============ Powerup Upgrades shop tab ============ */
/* Two-column ability cards so each one has room to show level + current /
   next-upgrade effect lines + cost. The shared .grid is 4-col; we stretch
   each ability cell across 2 columns. */
.powerup-cell {
  grid-column: span 2;
  padding: 12px 14px 14px;
  min-height: 130px;
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
  gap: 6px;
  background: linear-gradient(180deg, rgba(177, 91, 255, 0.18), rgba(43, 27, 13, 0.35));
  border-color: var(--violet-dk);
}
.powerup-cell.owned {
  background: linear-gradient(180deg, rgba(109, 214, 255, 0.22), rgba(0, 119, 168, 0.28));
  border-color: var(--cyan-dk);
}
.powerup-cell.maxed {
  background: linear-gradient(180deg, rgba(255, 210, 63, 0.28), rgba(184, 135, 10, 0.22));
  border-color: var(--sun-dk);
  outline: 3px solid var(--sun);
  outline-offset: 1px;
}
.powerup-cell .powerup-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 56px;
}
.powerup-cell .powerup-icon {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,0.45));
}
.powerup-cell .powerup-name {
  font-family: var(--cartoon-font);
  font-size: 13px;
  letter-spacing: 0.4px;
  line-height: 1.05;
  color: var(--paper);
  text-shadow: 0 2px 0 var(--ink);
  min-width: 0;
  overflow-wrap: normal;
  hyphens: none;
}
.powerup-cell .powerup-level {
  position: absolute;
  top: 6px;
  right: 8px;
  font-family: var(--cartoon-font);
  font-size: 11px;
  letter-spacing: 0.8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1.5px solid var(--ink);
  color: var(--paper);
  box-shadow: 0 2px 0 var(--ink);
}
.powerup-cell .powerup-effect {
  font-family: var(--body-font);
  font-weight: 500;
  font-size: 12px;
  line-height: 1.3;
  color: var(--paper);
  opacity: 0.95;
}
.powerup-cell .powerup-next {
  font-family: var(--body-font);
  font-weight: 500;
  font-size: 11px;
  line-height: 1.3;
  color: var(--sun);
  opacity: 0.95;
}
.powerup-cell .powerup-next.maxed {
  color: var(--sun);
  font-family: var(--cartoon-font);
  font-size: 14px;
  letter-spacing: 1.2px;
  text-shadow: 0 2px 0 var(--ink);
}
.powerup-cell .powerup-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}
.powerup-cell .powerup-cost {
  font-family: var(--cartoon-font);
  font-size: 14px;
  color: var(--sun);
  text-shadow: 0 2px 0 var(--ink);
  letter-spacing: 0.5px;
}
.powerup-cell .powerup-cost.maxed {
  color: var(--lime);
}
.powerup-cell .powerup-cta {
  font-family: var(--cartoon-font);
  font-size: 12px;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--sun) 0%, var(--sun-dk) 100%);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  box-shadow: 0 2px 0 var(--ink);
}

/* ============ In-run powerup HUD strip ============ */
.powerup-hud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 2px 0 4px;
  pointer-events: none;
}
.powerup-hud.hidden { display: none; }
.powerup-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 3px 9px 3px 7px;
  box-shadow: 0 2px 0 rgba(0,0,0,0.55);
  font-family: var(--cartoon-font);
  font-size: 11px;
  letter-spacing: 0.6px;
  color: var(--paper);
}
.powerup-chip-icon {
  font-size: 14px;
  line-height: 1;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.45));
}
.powerup-chip-bar {
  width: 38px;
  height: 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.5);
}
.powerup-chip-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sun), var(--lime));
  transition: width 0.12s linear;
}
.powerup-chip[data-id="coin_storm"] .powerup-chip-fill {
  background: linear-gradient(90deg, var(--sun), #ffe27a);
}
.powerup-chip[data-id="diamond_fever"] .powerup-chip-fill {
  background: linear-gradient(90deg, var(--cyan), var(--violet));
}
.powerup-chip[data-id="invincible"] .powerup-chip-fill {
  background: linear-gradient(90deg, #ffffff, var(--cyan));
}
.powerup-chip[data-id="golden_pipe"] .powerup-chip-fill {
  background: linear-gradient(90deg, var(--sun), var(--lime));
}
.powerup-chip-time {
  font-variant-numeric: tabular-nums;
  min-width: 22px;
  text-align: right;
}
.powerup-chip-cap {
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
  margin-left: 1px;
}

/* ============ Settings ============ */
/* Floating gear button — sits to the right of the music-toggle button. */
.settings-toggle {
  position: absolute;
  left: 64px;
  bottom: 40px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2.5px solid var(--paper);
  background: var(--ink);
  color: var(--paper);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  z-index: 50;
  box-shadow: 0 4px 0 rgba(0,0,0,0.5);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.settings-toggle:hover { opacity: 0.85; transform: rotate(40deg); }
.settings-toggle:active {
  transform: translateY(2px) rotate(40deg);
  box-shadow: 0 2px 0 rgba(0,0,0,0.5);
}

#settingsPanel h2 {
  color: var(--cyan);
  text-shadow: 0 4px 0 var(--cyan-dk), 0 7px 0 var(--ink), 0 12px 18px rgba(0,0,0,0.5);
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: min(100%, 380px);
  margin-top: 18px;
  align-items: stretch;
}

.settings-row {
  background: rgba(255,255,255,0.08);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 14px 16px 12px;
  box-shadow: 0 4px 0 var(--ink), 0 8px 14px rgba(0,0,0,0.35);
  transform: rotate(-0.6deg);
}
.settings-row:nth-child(2) { transform: rotate(0.7deg); }

.settings-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.settings-label {
  font-family: var(--cartoon-font);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 1.5px;
  color: var(--paper);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--ink);
  text-transform: uppercase;
}

.settings-mute {
  font-family: var(--cartoon-font);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--paper);
  background: linear-gradient(180deg, var(--lime) 0%, var(--lime-dk) 100%);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 4px 14px;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
  text-transform: uppercase;
  -webkit-text-stroke: 1.2px var(--ink);
  paint-order: stroke fill;
  transition: transform 0.08s ease, filter 0.15s ease;
}
.settings-mute:hover { filter: brightness(1.1); }
.settings-mute:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.settings-mute[aria-pressed="true"] {
  background: linear-gradient(180deg, #d24343 0%, #7a1e1e 100%);
}

/* Chunky cartoon-style range slider */
.settings-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px;
  background: transparent;
  cursor: pointer;
  margin: 4px 0;
}
.settings-slider::-webkit-slider-runnable-track {
  height: 14px;
  background: linear-gradient(180deg, var(--paper) 0%, #d8c7a0 100%);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: inset 0 2px 0 rgba(0,0,0,0.15);
}
.settings-slider::-moz-range-track {
  height: 14px;
  background: linear-gradient(180deg, var(--paper) 0%, #d8c7a0 100%);
  border: 3px solid var(--ink);
  border-radius: 999px;
}
.settings-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe78c 0%, var(--sun) 55%, var(--sun-dk) 100%);
  border: 3px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink), 0 6px 8px rgba(0,0,0,0.4);
  margin-top: -9px;
  cursor: grab;
  transition: transform 0.08s ease;
}
.settings-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe78c 0%, var(--sun) 55%, var(--sun-dk) 100%);
  border: 3px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink), 0 6px 8px rgba(0,0,0,0.4);
  cursor: grab;
}
.settings-slider:active::-webkit-slider-thumb { transform: scale(1.1); cursor: grabbing; }
.settings-slider:active::-moz-range-thumb { transform: scale(1.1); cursor: grabbing; }
.settings-slider:focus { outline: none; }

.settings-row-foot {
  display: flex;
  justify-content: flex-end;
  font-family: var(--cartoon-font);
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--sun);
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--ink);
  margin-top: 2px;
}

#settingsResetBtn {
  align-self: center;
  margin-top: 6px;
}

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.8); color: #fff; padding: 10px 16px; border-radius: 8px;
  font: 600 14px/1 Fredoka, sans-serif; z-index: 9999; pointer-events: none;
  animation: toastIn .2s ease-out, toastOut .4s ease-in 3s forwards;
}
@keyframes toastIn  { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toastOut { to   { opacity: 0; transform: translate(-50%, -8px); } }

/* Anchored to the stage's top-right (#hud has inset:0 over #stage). Sits
   above every overlay (menu, gameover, panels) so players can reach
   sign-in from any screen — except active play (hidden via the
   body[data-game-state="play"] rule below). */
.signin-chip {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 60;
  pointer-events: auto;
  background: rgba(0,0,0,.55); color:#fff; border:0; border-radius:999px;
  padding:6px 14px; font:600 13px Fredoka, sans-serif; cursor:pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.signin-chip:hover { background: rgba(0,0,0,.75); }
.signin-chip:focus-visible { outline: 2px solid #ffd23f; outline-offset: 2px; }
/* Hide the chip only during active gameplay. Menu, pause, and game-over
   screens all show it so players can sign in without starting a run. */
body[data-game-state="play"] .signin-chip { display: none; }
/* Also hide when any panel overlay is open — its close (×) button lives at
   the same top-right corner and would otherwise be covered by the chip. */
#stage:has(.panel:not(.hidden)) .signin-chip { display: none; }

.signin-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.signin-overlay.hidden { display: none; }
/* Sub-views inside the sign-in card swap via JS adding/removing .hidden;
   .hidden has no global rule, so it must be scoped here. */
.signin-card > .hidden { display: none; }

.signin-card {
  width: min(380px, 92%); background:#fff; color:#222; border-radius: 16px;
  padding: 24px 22px; box-shadow: 0 30px 60px rgba(0,0,0,.4); position: relative;
}
.signin-close {
  position:absolute; top:8px; right:12px; background:none; border:0; font-size:24px; line-height:1;
  cursor:pointer; color:#888;
}
.signin-title { font: 700 22px 'Luckiest Guy', sans-serif; margin: 0 0 4px; }
.signin-sub   { color:#666; margin: 0 0 16px; font: 500 14px Fredoka, sans-serif; }
.signin-label { display:block; font: 600 12px Fredoka, sans-serif; color:#555; margin: 12px 0 4px; }
.signin-input {
  width: 100%; box-sizing: border-box; padding: 10px 12px; font: 500 15px Fredoka, sans-serif;
  border: 1.5px solid #d6d6d6; border-radius: 10px; background: #fafafa;
}
.signin-input:focus { outline: 0; border-color:#ff3d8a; background:#fff; }
.signin-btn {
  width:100%; margin-top:12px; padding: 10px 14px; border: 0; border-radius: 10px;
  background:#ff3d8a; color:#fff; font: 700 15px Fredoka, sans-serif; cursor: pointer;
}
.signin-btn:hover { filter: brightness(1.05); }
.signin-btn.ghost { background:#eee; color:#333; }
.signin-msg { min-height: 1.2em; margin: 8px 0 0; font: 500 13px Fredoka, sans-serif; color:#c0392b; }
.signin-or { text-align:center; margin: 14px 0 8px; color:#999; font: 600 12px Fredoka, sans-serif; }
.signin-or span { background:#fff; padding: 0 8px; }
.google-btn-host { display:flex; justify-content:center; }

/* Friends + Leaderboard overlay screens — styled to match the sign-in card */
.friends-modal, .lb-modal {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55);
  z-index: 2000;
}
.friends-modal .panel, .lb-modal .panel {
  position: relative;
  background: #fff; color: #222;
  width: min(380px, 92%); max-height: 82vh; overflow-y: auto;
  border-radius: 16px; padding: 24px 22px;
  box-shadow: 0 30px 60px rgba(0,0,0,.4);
}
.friends-modal h2, .lb-modal h2 { margin: 0 0 12px; font: 700 22px 'Luckiest Guy', sans-serif; }
.friends-modal h3 {
  margin: 16px 0 6px; font: 600 12px Fredoka, sans-serif; color: #555;
  text-transform: uppercase; letter-spacing: .5px;
}
.friends-modal .row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid #eee; gap: 8px;
  font: 500 15px Fredoka, sans-serif;
}
.friends-modal .row:last-child { border-bottom: 0; }
.friends-modal .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 8px; flex: none; }
.friends-modal .dot.online  { background: #38d36b; }
.friends-modal .dot.offline { background: #ccc; }
.friends-modal .actions button { margin-left: 4px; cursor: pointer; }
.friends-modal .my-tag {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: #f4f4f4; border-radius: 10px; margin-bottom: 12px;
  font-family: monospace; font-size: 14px; color: #333;
}
.friends-modal input[type="text"] {
  width: 100%; box-sizing: border-box; padding: 10px 12px; margin-bottom: 8px;
  border: 1.5px solid #d6d6d6; border-radius: 10px; background: #fafafa; color: #222;
  font: 500 15px Fredoka, sans-serif;
}
.friends-modal input[type="text"]:focus { outline: 0; border-color: #ff3d8a; background: #fff; }
.friends-modal button, .lb-modal button {
  background: #eee; color: #333; border: 0; border-radius: 10px;
  padding: 8px 12px; cursor: pointer; font: 700 14px Fredoka, sans-serif;
}
.friends-modal button:hover, .lb-modal button:hover { filter: brightness(0.95); }
#friend-add { background: #ff3d8a; color: #fff; margin-top: 4px; }
#friend-add:hover { filter: brightness(1.05); }
.friends-modal .close, .lb-modal .close {
  position: absolute; top: 8px; right: 12px;
  background: none; border: 0; line-height: 1; font-size: 24px; color: #888; padding: 2px 6px;
}
.lb-modal .tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.lb-modal .tabs button { flex: 1; }
.lb-modal .tabs button.active { background: #ff3d8a; color: #fff; }
.lb-modal .row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid #eee;
}
.lb-modal .row:last-child { border-bottom: 0; }
.lb-modal .row.me { background: #fff0f6; border-radius: 8px; padding: 8px; }
.lb-modal .row .rank { width: 28px; text-align: right; color: #999; font-variant-numeric: tabular-nums; }
.lb-modal .row .name { flex: 1; display: flex; align-items: center; min-width: 0; font: 500 15px Fredoka, sans-serif; }
.lb-modal .row .score { font-variant-numeric: tabular-nums; font: 700 15px Fredoka, sans-serif; }
.lb-modal .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 8px; flex: none; }
.lb-modal .dot.online  { background: #38d36b; }
.lb-modal .dot.offline { background: #ccc; }
