/* Paw Patrol "Scan2" — landing page styles.
 * Type + palette mirror the official pawpatrol.com design language: Lilita One
 * display + Manrope body (both SIL OFL, self-hosted under assets/fonts/), and
 * the site's blue/navy/red/yellow tokens. NO character art is used. Confirm the
 * final palette against the official brand kit before launch. */

/* Self-hosted OFL fonts — see assets/fonts/OFL.txt. */
@font-face {
  font-family: "Lilita One";
  src: url("../assets/fonts/LilitaOne-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../assets/fonts/Manrope-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../assets/fonts/Manrope-SemiBold.ttf") format("truetype");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../assets/fonts/Manrope-ExtraBold.ttf") format("truetype");
  font-weight: 800; font-style: normal; font-display: swap;
}

:root {
  /* Palette mirrored from pawpatrol.com shared stylesheet. */
  --pp-blue: #0050b8;     /* primary brand blue */
  --pp-blue-dk: #0d2445;  /* deep navy */
  --pp-sky: #0089d0;      /* lighter sky blue */
  --pp-red: #e2211c;
  --pp-yellow: #ffe100;
  --paper: #ffffff;
  --ink: #0d2445;         /* navy ink (brand) */
  --muted: #5d6c7b;

  --radius: 14px;
  --shadow-hard: 5px 5px 0 var(--pp-blue-dk);
  --shadow-soft: 0 8px 24px rgba(13, 36, 69, 0.16);
  --ease-pop: cubic-bezier(0.2, 0.9, 0.3, 1.3);

  /* Brand type: Lilita One display, Manrope body (self-hosted OFL). */
  --font-head: "Lilita One", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

/* Paint the root the navy the page-gradient ends on, so iOS Safari's
   over-scroll bounce and the area behind the collapsing bottom toolbar
   show brand color instead of white. */
html { background: var(--pp-blue-dk); }

body {
  background: var(--pp-blue);
  background: linear-gradient(180deg, var(--pp-blue) 0%, var(--pp-blue-dk) 100%);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; flex-direction: column;
}

body.modal-open { overflow: hidden; }
/* While a modal is open, drop the floating back/collection chips beneath the
   modal overlay so they can't be tapped over it — the X (or backdrop) is the
   only way out. The win-overlay uses .hidden (not .modal-open), so the
   collection chip stays tappable on the win screen. */
body.modal-open .back-fab,
body.modal-open .collection-fab { z-index: 40; pointer-events: none; }

img { max-width: 100%; display: block; }

/* --- mockup banner ---------------------------------------------------- */
.mockup-banner {
  text-align: center; font-family: var(--font-body); font-weight: 800;
  font-size: .72rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--pp-blue-dk); background: var(--pp-yellow);
  padding: .4rem 1rem; border-bottom: 2px solid var(--ink);
}

/* --- hero ------------------------------------------------------------- */
.hero-banner { position: relative; width: 100%; overflow: hidden; background: var(--pp-blue-dk); }
.hero-banner-img { display: block; width: 100%; height: auto; object-fit: cover; }
.hero-logo {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  /* scale down to fit the hero on both axes, with margin so it never kisses an edge */
  width: auto; height: auto; max-width: 72%; max-height: 76%;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(13, 36, 69, .55));
  pointer-events: none;
}

/* --- page ------------------------------------------------------------- */
.page {
  width: 100%; max-width: 480px; margin: 0 auto; padding: 1.25rem 1.25rem 2rem;
  display: flex; flex-direction: column; flex: 1 0 auto;
}

/* --- floating back button (non-landing screens) ---------------------- */
/* Hero shows only on the landing screen; no persistent navbar elsewhere. */
body.nav-mode .hero-banner { display: none; }
.back-fab {
  position: fixed; z-index: 65;
  top: calc(env(safe-area-inset-top, 0px) + 2.6rem); left: .9rem;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  border: 3px solid var(--ink); background: var(--paper); color: var(--ink);
  font-family: var(--font-head); font-size: 1.4rem; line-height: 1;
  display: grid; place-items: center; cursor: pointer;
  box-shadow: var(--shadow-hard);
  transition: transform .12s var(--ease-pop);
}
.back-fab:active { transform: scale(.92); }
.back-fab:focus-visible { outline: 3px solid var(--pp-yellow); outline-offset: 2px; }
.back-fab[hidden] { display: none; }

.intro { text-align: center; margin: .25rem 0 1rem; animation: rise-in .4s var(--ease-pop) both; }
.headline {
  font-family: var(--font-head); font-weight: 400;
  font-size: clamp(1.9rem, 7.5vw, 2.5rem); line-height: 1.05;
  margin: 0 0 .5rem; color: var(--paper); letter-spacing: .005em;
  text-shadow: 0 2px 0 var(--pp-blue-dk);
}
.subhead {
  margin: 0 auto; max-width: 22rem; color: var(--paper);
  font-size: 1.05rem; opacity: .95;
}

.actions { display: flex; flex-direction: column; gap: .7rem; }
.actions .cta { animation: rise-in .4s var(--ease-pop) both; }
.actions .cta:nth-child(1) { animation-delay: .08s; }
.actions .cta:nth-child(2) { animation-delay: .16s; }
.actions .cta:nth-child(3) { animation-delay: .24s; }
.actions .cta:nth-child(4) { animation-delay: .32s; }

/* --- CTAs ------------------------------------------------------------- */
.cta {
  display: flex; align-items: center; gap: 1rem;
  width: 100%; text-align: left; text-decoration: none;
  padding: .8rem 1.1rem; border: 3px solid var(--ink);
  border-radius: var(--radius); background: var(--paper); color: var(--ink);
  box-shadow: var(--shadow-hard); cursor: pointer;
  font-family: var(--font-head);
  transition: transform .12s var(--ease-pop), box-shadow .12s ease;
}
.cta:active { transform: translate(3px, 3px) scale(.985); box-shadow: 3px 3px 0 var(--ink); }
.cta:focus-visible { outline: 4px solid var(--pp-yellow); outline-offset: 3px; }

.cta-icon {
  flex: 0 0 auto; width: 2.7rem; height: 2.7rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--pp-yellow); border: 3px solid var(--ink);
}
.cta-icon svg { width: 1.5rem; height: 1.5rem; display: block; }
.cta-text { display: flex; flex-direction: column; line-height: 1.15; }
.cta-title { font-size: 1.3rem; font-weight: 400; letter-spacing: .01em; }
.cta-sub { font-family: var(--font-body); font-size: .85rem; color: var(--muted); font-weight: 500; }

/* Kids = primary (filled brand yellow — pops against the blue page). */
.cta-play { background: var(--pp-yellow); color: var(--pp-blue-dk); }
.cta-play .cta-sub { color: var(--pp-blue-dk); opacity: .8; }
.cta-play .cta-icon { background: var(--pp-blue); color: var(--pp-yellow); }

/* Parents = secondary (white card, sky-blue icon). */
.cta-shop { background: var(--paper); }
.cta-shop .cta-icon { background: var(--pp-sky); color: var(--paper); }

/* --- footer ----------------------------------------------------------- */
.site-footer { margin-top: auto; padding-top: 1.5rem; text-align: center; }
.legal { color: var(--paper); opacity: .8; font-size: .72rem; line-height: 1.4; margin: 0; }

/* --- toast ------------------------------------------------------------ */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  padding: .75rem 1.25rem; border-radius: 999px; font-weight: 600;
  box-shadow: var(--shadow-soft); z-index: 60; max-width: 90vw;
}
.toast[hidden] { display: none; }

/* --- modal (parent gate) ---------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1.25rem; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(16, 19, 26, .55); }
.modal-card {
  position: relative; z-index: 1; width: 100%; max-width: 360px;
  background: var(--paper); border: 3px solid var(--ink);
  border-radius: var(--radius); box-shadow: var(--shadow-hard);
  padding: 1.5rem 1.25rem; text-align: center;
}
.modal-close {
  position: absolute; top: .5rem; right: .65rem; border: none; background: none;
  font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted);
}
.modal-close:focus-visible { outline: 3px solid var(--pp-yellow); outline-offset: 2px; }
.modal-title { font-family: var(--font-head); font-size: 1.6rem; font-weight: 400; margin: 0 0 .5rem; color: var(--pp-blue-dk); }
.modal-sub { color: var(--muted); margin: 0 0 1.25rem; }
.cta-confirm { justify-content: center; background: var(--pp-blue); color: var(--paper); }
.cta-confirm .cta-title { color: var(--paper); }
.cta-nevermind { justify-content: center; background: var(--paper); color: var(--pp-blue-dk); margin-top: .6rem; }
.cta-nevermind .cta-title { color: var(--pp-blue-dk); }

/* --- collection chip + popup ------------------------------------------ */
/* Floating chip mirrors .back-fab but sits top-right; z above win-overlay
   (70) so it stays tappable while the win card is showing. */
.collection-fab {
  position: fixed; z-index: 75;
  top: calc(env(safe-area-inset-top, 0px) + 2.6rem); right: .9rem;
  height: 2.5rem; padding: 0 .7rem 0 .5rem; border-radius: 999px;
  border: 3px solid var(--ink); background: var(--pp-yellow); color: var(--pp-blue-dk);
  display: inline-flex; align-items: center; gap: .3rem; cursor: pointer;
  font-family: var(--font-head); font-size: 1.15rem; line-height: 1;
  box-shadow: var(--shadow-hard);
  transition: transform .12s var(--ease-pop);
}
.collection-fab:active { transform: scale(.92); }
.collection-fab:focus-visible { outline: 3px solid var(--pp-blue-dk); outline-offset: 2px; }
.collection-fab[hidden] { display: none; }
.collection-paw { width: 1.5rem; height: 1.5rem; display: grid; place-items: center; }
.collection-paw svg { width: 100%; height: 100%; display: block; }
.collection-fab-count { letter-spacing: .02em; }

/* Popup sits above the win-overlay (70); the shared .modal default is 50. */
.collection-modal { z-index: 80; }
#reset-modal { z-index: 85; } /* sits above the collection modal it opens over */
.collection-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem;
  margin: 0 0 1rem;
}
.collection-slot {
  position: relative; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  border: 3px solid var(--ink); background: #e8edf3;
  display: grid; place-items: center;
}
.collection-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.collection-slot.locked .lock-icon { width: 48%; height: 48%; color: var(--muted); opacity: .45; }
.collection-slot.locked .lock-icon svg { width: 100%; height: 100%; display: block; }
.collection-hint { font-family: var(--font-body); font-size: .82rem; color: var(--muted); margin: 0; }
.collection-reset {
  margin: .4rem auto 0; display: inline-block;
  background: none; border: none; padding: .25rem;
  font-family: var(--font-body); font-size: .78rem; font-weight: 600;
  color: var(--muted); text-decoration: underline; cursor: pointer; opacity: .75;
}
.collection-reset:hover { opacity: 1; }

/* --- retailer picker popup -------------------------------------------- */
.retailer-brand {
  display: block; width: auto; max-width: 70%; height: auto; max-height: 4.5rem;
  margin: .25rem auto .75rem; object-fit: contain;
}
.retailer-list { display: flex; flex-direction: column; gap: .55rem; margin-top: .25rem; }
.retailer-row {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  width: 100%; padding: .85rem 1rem; cursor: pointer;
  border: 3px solid var(--ink); border-radius: var(--radius);
  background: var(--paper); color: var(--pp-blue-dk);
  font-family: var(--font-head); font-size: 1.1rem; line-height: 1;
  box-shadow: var(--shadow-hard);
  transition: transform .12s var(--ease-pop);
}
.retailer-row:active { transform: scale(.97); }
.retailer-row:focus-visible { outline: 3px solid var(--pp-yellow); outline-offset: 2px; }
.retailer-arrow { font-family: var(--font-body); font-weight: 800; font-size: 1.2rem; }

/* --- product offer popup ---------------------------------------------- */
/* Square packshot, centered inside the card with the card's own padding
   (1.5rem top / 1.25rem sides ≥ 20px) acting as the margin. Contained (not
   cropped) on a light tile with rounded corners. */
.offer-img {
  display: block; object-fit: contain;
  width: 100%; max-width: 12.75rem; aspect-ratio: 1 / 1;
  margin: 0 auto 1rem; padding: .5rem; box-sizing: border-box;
  background: #f2f5f9; border: 3px solid var(--ink);
  border-radius: var(--radius);
}
.offer-title { margin-bottom: .35rem; }
.offer-desc {
  color: var(--muted); font-size: .92rem; line-height: 1.4;
  margin: 0 0 1.1rem;
}
.offer-desc[hidden] { display: none; }
.offer-actions { display: flex; flex-direction: column; align-items: stretch; gap: 1rem; }
.offer-btn { justify-content: center; }
/* "Buy Now at Target" — white button (base .cta is already white/ink). */
.offer-buy { background: var(--paper); color: var(--pp-blue-dk); }
.offer-buy .cta-title { color: var(--pp-blue-dk); }
/* Wallet badge button — official image asset, no chrome of its own. */
.wallet-btn {
  display: block; width: 100%; padding: 0; border: none; background: none;
  cursor: pointer; line-height: 0;
}
.wallet-btn:focus-visible { outline: 4px solid var(--pp-yellow); outline-offset: 3px; border-radius: var(--radius); }
.wallet-btn:active { transform: scale(.985); }
.wallet-btn:disabled { opacity: .6; cursor: default; }
.wallet-badge { display: block; height: 3rem; width: auto; margin: 0 auto; }
.wallet-note { margin: -.5rem 0 0; text-align: center; color: var(--muted); font-size: .72rem; }
/* Card receives focus on open (tabindex=-1) — suppress its outline. */
.offer-modal .modal-card:focus { outline: none; }
/* Close sits in the card's white padding — give it a soft gray chip so the
   white X-circle reads as a button against the white card. */
.offer-modal .modal-close {
  z-index: 2; width: 2rem; height: 2rem; border-radius: 50%;
  background: #e2e8f0; color: var(--ink);
  display: grid; place-items: center;
}

/* --- screens (view switching) ----------------------------------------- */
.screen[hidden] { display: none; }
.screen { animation: screen-in .28s var(--ease-pop) both; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Shared element entrance — every element fades + rises in. Staggered via
   --i (set per element in JS) or nth-child for static landing content. */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.screen-title {
  font-family: var(--font-head); font-weight: 400; color: var(--paper);
  font-size: clamp(1.5rem, 6vw, 2rem); text-align: center;
  margin: .25rem 0 1.25rem; text-shadow: 0 2px 0 var(--pp-blue-dk);
}
.back-btn {
  border: none; background: none; cursor: pointer;
  color: var(--paper); font-family: var(--font-body); font-weight: 800;
  font-size: .95rem; padding: .35rem .25rem; opacity: .9;
}
.back-btn:focus-visible { outline: 3px solid var(--pp-yellow); outline-offset: 2px; border-radius: 6px; }

/* --- pup grid --------------------------------------------------------- */
.pup-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}
.pup-tile {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  border: none; background: none; cursor: pointer; padding: .25rem;
  font-family: var(--font-head); color: var(--paper);
  transition: transform .12s var(--ease-pop);
  animation: rise-in .42s var(--ease-pop) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}
.pup-tile:focus-visible { outline: none; }
.pup-tile:focus-visible .pup-face { outline: 4px solid var(--pp-yellow); outline-offset: 3px; }
.pup-face {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 50%;
  border: 4px solid var(--paper); box-shadow: var(--shadow-soft);
  background: var(--paper);
}
.pup-name { font-size: 1rem; letter-spacing: .01em; text-shadow: 0 1px 0 var(--pp-blue-dk); }
.pup-tile:active, .pup-tile.is-pressed { transform: scale(.9); }

/* --- spotlight -------------------------------------------------------- */
.spotlight { text-align: center; margin-top: .5rem; }
.spotlight > *, .product-card {
  animation: rise-in .42s var(--ease-pop) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.spotlight-face {
  width: 8.5rem; height: 8.5rem; margin: 0 auto .75rem; border-width: 5px;
}
.spotlight-name {
  font-family: var(--font-head); font-weight: 400; color: var(--paper);
  font-size: clamp(1.6rem, 6.5vw, 2.1rem); margin: 0 0 .25rem;
  text-shadow: 0 2px 0 var(--pp-blue-dk);
}
.spotlight-sub { color: var(--paper); opacity: .9; margin: 0 0 1.25rem; font-size: .95rem; }

.product-list { display: flex; flex-direction: column; gap: 1rem; }
.product-card {
  display: flex; align-items: center; gap: 1rem; text-align: left;
  background: var(--paper); border: 3px solid var(--ink);
  border-radius: var(--radius); box-shadow: var(--shadow-hard); padding: .85rem;
  cursor: pointer; transition: transform .12s var(--ease-pop);
}
.product-card:active, .product-card.is-pressed { transform: scale(.97); }
.product-card:focus-visible { outline: 3px solid var(--pp-yellow); outline-offset: 2px; }
.product-img {
  flex: 0 0 auto; width: 5rem; height: 5rem; object-fit: contain;
  border-radius: 10px; background: #f3f6fb;
}
.product-name {
  flex: 1; font-family: var(--font-body); font-weight: 800;
  font-size: .95rem; line-height: 1.25; color: var(--ink);
}

/* sticky shop-all CTA */
.shop-all-bar {
  position: sticky; bottom: 0; z-index: 1;
  margin: 1.5rem -1.25rem -2rem;
  padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
}
.shop-all { width: 100%; margin: 0; justify-content: center; }

/* --- Pup Match game --------------------------------------------------- */
.game-sub { text-align: center; color: var(--paper); opacity: .9; margin: 0 0 1.25rem; font-size: .95rem; }

.game-board {
  position: relative; /* anchors the pulse ring (painted under the tiles) */
  display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr);
  gap: .75rem; perspective: 1000px;
}
.game-tile {
  position: relative; z-index: 1; /* sit above the pulse ring */
  border: none; background: none; padding: 0; cursor: pointer;
  display: grid; /* stretches .tile-inner to fill — buttons don't propagate % height */
  aspect-ratio: 1 / 1; perspective: 900px;
  animation: tile-in .5s var(--ease-pop) backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
  transition: transform .18s var(--ease-pop); /* bump (ring sweep); reverts via backwards fill */
}
.game-tile:focus-visible { outline: none; }
.game-tile:focus-visible .tile-face { outline: 4px solid var(--pp-yellow); outline-offset: 3px; }

.tile-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform .4s var(--ease-pop);
}
/* flip with a coin-teeter settle (overshoot then rock to rest) */
.game-tile.is-flipped .tile-inner { animation: tile-flip .6s var(--ease-pop) forwards; }
/* mismatched cards flip back (180 -> 0) instead of snapping to the logo */
.game-tile.is-unflipping .tile-inner { animation: tile-flip-back .5s var(--ease-pop) forwards; }

.tile-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius); border: 4px solid var(--paper);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; box-shadow: var(--shadow-soft);
}
.tile-back {
  background: linear-gradient(160deg, var(--pp-blue), var(--pp-blue-dk));
  color: var(--paper);
}
.tile-back-img { width: 100%; height: 100%; object-fit: cover; }
.tile-front { background: var(--paper); transform: rotateY(180deg); }
.tile-front img { width: 100%; height: 100%; object-fit: cover; }

.game-tile.is-matched { animation: match-pop .5s var(--ease-pop); }
.game-tile.is-matched .tile-front { box-shadow: 0 0 0 4px var(--pp-yellow) inset; }

/* Pulse ring: expands from a just-flipped tile, painted under the grid. */
.pulse-ring {
  position: absolute; z-index: 0; pointer-events: none;
  width: var(--ring-d, 300px); height: var(--ring-d, 300px);
  margin-left: calc(var(--ring-d, 300px) / -2);
  margin-top: calc(var(--ring-d, 300px) / -2);
  border-radius: 50%; border: 4px solid var(--pp-yellow);
  background: radial-gradient(circle, rgba(255, 225, 0, .28) 0%, rgba(255, 225, 0, 0) 68%);
  transform: scale(0);
  animation: pulse-ring-expand 600ms ease-out forwards;
}
@keyframes pulse-ring-expand {
  0%   { transform: scale(0);  opacity: .95; }
  100% { transform: scale(1);  opacity: 0; }
}
/* Bump as the ring sweeps past — transition (not animation) so it can't replay tile-in. */
.game-tile.is-bumped { transform: scale(1.12); }

@keyframes tile-in {
  from { opacity: 0; transform: translateX(85vw) scale(.7) rotate(7deg); }
  60%  { opacity: 1; }
  to   { opacity: 1; transform: none; }
}
@keyframes tile-flip {
  0%   { transform: rotateY(0); }
  55%  { transform: rotateY(202deg); }
  74%  { transform: rotateY(168deg); }
  88%  { transform: rotateY(186deg); }
  100% { transform: rotateY(180deg); }
}
@keyframes tile-flip-back {
  0%   { transform: rotateY(180deg); }
  55%  { transform: rotateY(-22deg); }
  74%  { transform: rotateY(12deg); }
  88%  { transform: rotateY(-6deg); }
  100% { transform: rotateY(0); }
}
@keyframes match-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* --- pre-game countdown ------------------------------------------------ */
/* Fixed in the top-middle band (where the logo used to sit) so showing /
   hiding it never reflows the board below. */
.game-countdown {
  position: fixed; z-index: 60; pointer-events: none;
  top: calc(env(safe-area-inset-top, 0px) + 2.4rem); left: 0; right: 0;
  display: grid; place-items: center;
  font-family: var(--font-head);
  font-size: clamp(2.75rem, 14vw, 4.25rem); line-height: 1;
  color: var(--pp-yellow);
  -webkit-text-stroke: 3px var(--ink); text-stroke: 3px var(--ink);
  text-shadow: 0 4px 0 var(--ink), 0 6px 12px rgba(13, 36, 69, .35);
  letter-spacing: .02em; user-select: none;
}
.game-countdown[hidden] { display: none; }
.game-countdown.go { color: var(--pp-blue); font-size: clamp(2.25rem, 11vw, 3.5rem); }
.game-countdown.pop { animation: count-pop .55s var(--ease-pop); }
@keyframes count-pop {
  0%   { transform: scale(.4); opacity: 0; }
  40%  { transform: scale(1.18); opacity: 1; }
  70%  { transform: scale(.96); }
  100% { transform: scale(1); opacity: 1; }
}

/* --- win celebration -------------------------------------------------- */
.win-overlay {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center;
  padding: 1.25rem; background: rgba(13, 36, 69, .65);
}
.win-overlay[hidden] { display: none; }
.win-card {
  position: relative; z-index: 1; width: 100%; max-width: 340px;
  background: var(--paper); border: 3px solid var(--ink);
  border-radius: var(--radius); box-shadow: var(--shadow-hard);
  padding: 1.75rem 1.5rem; text-align: center;
  animation: win-in .55s var(--ease-pop) both;
}
.win-title { font-family: var(--font-head); font-weight: 400; font-size: 2rem; color: var(--pp-blue-dk); margin: 0 0 .25rem; }
.win-sub { color: var(--muted); margin: 0 0 1.25rem; }
.scratcher-mount { margin: 0 0 1rem; }
.collection-count { font-family: var(--font-body); font-size: .8rem; color: var(--muted); margin: 0 0 1.25rem; }
.win-actions { display: flex; flex-direction: column; gap: .75rem; }
.win-btn { justify-content: center; }
@keyframes win-in {
  from { opacity: 0; transform: scale(.7) translateY(20px); }
  to   { opacity: 1; transform: none; }
}

.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti-bit {
  position: absolute; top: -12%; width: 10px; height: 14px; border-radius: 2px;
  animation: confetti-fall 2.4s linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(118vh) rotate(560deg); opacity: .85; }
}

/* Spine bursts: explode outward from a point and fade over 3s. */
.confetti-burst {
  position: absolute; width: 9px; height: 12px; border-radius: 2px;
  will-change: transform, opacity;
  animation: confetti-burst 3s cubic-bezier(.16, .8, .3, 1) forwards;
}
@keyframes confetti-burst {
  0%   { transform: translate(-50%, -50%) rotate(0deg); opacity: 1; }
  12%  { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--bx)), calc(-50% + var(--by))) rotate(var(--br)); opacity: 0; }
}

/* --- larger screens --------------------------------------------------- */
@media (min-width: 481px) {
  .hero-banner { border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; max-width: 480px; margin: 0 auto; }
}

/* --- reduced motion --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  /* keep the game playable: flip instantly instead of animating */
  .game-tile.is-flipped .tile-inner { transform: rotateY(180deg); }
}
