/* =========================================================================
   SmashPad — modern stylesheet
   Design tokens → base → animated background → start card → controls →
   overlays → responsive → motion/safe-area.
   ========================================================================= */

:root {
  /* palette */
  --accent: #FFCC00;
  --accent-2: #FFB300;
  --ink: #ffffff;
  --bg-0: #14102b;
  --bg-1: #1a1140;

  /* type scale (fluid) */
  --fs-title: clamp(38px, 8vw, 62px);
  --fs-tag:   clamp(14px, 3.4vw, 18px);

  /* spacing + radius + shadow tokens */
  --r-lg: 30px;
  --r-md: 20px;
  --r-sm: 14px;
  --ring: rgba(255,255,255,.14);
  --stroke: rgba(255,255,255,.12);
  --glass: rgba(255,255,255,.06);
  --shadow-xl: 0 40px 90px -20px rgba(0,0,0,.6);
  --shadow-glow: 0 12px 40px -6px rgba(255,179,0,.5);

  /* safe-area (notches / rounded corners) */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%; width: 100%;
  overflow: hidden; background: var(--bg-0);
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont,
               "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  touch-action: none; overscroll-behavior: none;
  user-select: none; -webkit-user-select: none;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}

/* ---------- Backdrop layers ----------
   #bg    = themeable gradient (fixed, animated hue/scale drift)
   #ambient = animated ambient particles per theme (stars, bubbles, sparkles)
   #stage = the sprite canvas, now TRANSPARENT so the layers show through. */
#bg, #ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
#stage {
  position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 1;
  background: transparent;
}

/* Base (Rainbow) gradient — slow living drift. */
#bg {
  background:
    radial-gradient(120% 120% at 20% 10%, #3a1a5e 0%, transparent 55%),
    radial-gradient(120% 120% at 90% 90%, #10324f 0%, transparent 55%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-0) 100%);
  background-size: 200% 200%, 200% 200%, 100% 100%;
  animation: bgDrift 26s ease-in-out infinite alternate;
  transition: background .6s ease;
}
@keyframes bgDrift {
  0%   { background-position: 0% 0%,   100% 100%, 0 0; }
  100% { background-position: 40% 30%, 60% 70%,   0 0; }
}

/* ---------- Theme gradients (all dark, to keep white text readable) ---------- */
body[data-theme="space"] #bg {
  background:
    radial-gradient(90% 70% at 78% 18%, rgba(120,80,220,.5) 0%, transparent 55%),
    radial-gradient(80% 80% at 15% 85%, rgba(40,60,160,.55) 0%, transparent 55%),
    linear-gradient(160deg, #0b1030 0%, #05030f 100%);
  background-size: 200% 200%, 200% 200%, 100% 100%;
}
body[data-theme="ocean"] #bg {
  background:
    radial-gradient(100% 70% at 30% 8%, rgba(20,170,190,.5) 0%, transparent 55%),
    radial-gradient(90% 80% at 85% 90%, rgba(10,60,120,.6) 0%, transparent 55%),
    linear-gradient(160deg, #06304a 0%, #021523 100%);
  background-size: 200% 200%, 200% 200%, 100% 100%;
}
body[data-theme="kawaii"] #bg {
  background:
    radial-gradient(90% 70% at 22% 12%, rgba(255,120,190,.45) 0%, transparent 55%),
    radial-gradient(85% 80% at 82% 88%, rgba(150,90,220,.48) 0%, transparent 55%),
    linear-gradient(160deg, #3a1136 0%, #1a0722 100%);
  background-size: 200% 200%, 200% 200%, 100% 100%;
}

/* ---------- Ambient animated particles (pure CSS) ----------
   Two layered pseudo-elements per theme give depth (near + far), each a field
   of radial-gradient dots scrolled by a keyframe. Hidden by default. */
#ambient::before, #ambient::after {
  content: ""; position: absolute; inset: -10% -10% -10% -10%;
  opacity: 0; transition: opacity .6s ease;
}

/* SPACE — twinkling starfield (two parallax layers), bigger & brighter. */
body[data-theme="space"] #ambient::before {
  opacity: 1;
  background-image:
    radial-gradient(2.5px 2.5px at 12% 22%, #fff, transparent),
    radial-gradient(2px 2px   at 82% 14%, #fff, transparent),
    radial-gradient(3.5px 3.5px at 47% 61%, #cfe0ff, transparent),
    radial-gradient(2px 2px   at 68% 82%, #fff, transparent),
    radial-gradient(2.5px 2.5px at 28% 74%, #fff, transparent),
    radial-gradient(3px 3px   at 91% 47%, #dce9ff, transparent),
    radial-gradient(2px 2px   at 58% 33%, #fff, transparent),
    radial-gradient(2.5px 2.5px at 38% 8%, #eaf1ff, transparent);
  background-repeat: repeat; background-size: 290px 290px;
  animation: starDrift 55s linear infinite, twinkle 3.2s ease-in-out infinite alternate;
}
body[data-theme="space"] #ambient::after {
  opacity: 1;
  background-image:
    radial-gradient(1.5px 1.5px at 33% 38%, rgba(255,255,255,.95), transparent),
    radial-gradient(1.5px 1.5px at 74% 66%, rgba(210,225,255,.95), transparent),
    radial-gradient(2px 2px at 9% 90%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 58% 8%, #fff, transparent),
    radial-gradient(2px 2px at 88% 28%, #cfe0ff, transparent);
  background-repeat: repeat; background-size: 190px 190px;
  animation: starDrift 34s linear infinite reverse, twinkle 2.4s ease-in-out infinite alternate;
}
@keyframes starDrift { to { transform: translateY(-290px); } }
@keyframes twinkle { 0% { opacity: .5; } 100% { opacity: 1; } }

/* OCEAN — rising bubbles (two sizes, different speeds), bigger & faster. */
body[data-theme="ocean"] #ambient::before {
  opacity: 1;
  background-image:
    radial-gradient(9px 9px at 15% 100%, rgba(190,245,255,.6), transparent 70%),
    radial-gradient(13px 13px at 42% 100%, rgba(160,230,255,.45), transparent 70%),
    radial-gradient(7px 7px at 68% 100%, rgba(205,248,255,.55), transparent 70%),
    radial-gradient(16px 16px at 87% 100%, rgba(140,220,255,.4), transparent 70%);
  background-repeat: repeat-x; background-size: 55% 420px;
  animation: bubbleUp 10s linear infinite;
}
body[data-theme="ocean"] #ambient::after {
  opacity: 1;
  background-image:
    radial-gradient(6px 6px at 27% 100%, rgba(205,248,255,.55), transparent 70%),
    radial-gradient(4px 4px at 55% 100%, rgba(225,251,255,.6), transparent 70%),
    radial-gradient(10px 10px at 78% 100%, rgba(170,235,255,.45), transparent 70%);
  background-repeat: repeat-x; background-size: 45% 300px;
  animation: bubbleUp 6.5s linear infinite;
}
@keyframes bubbleUp { to { transform: translateY(-440px); } }

/* KAWAII — drifting sparkles + soft floating hearts glow, bigger & faster. */
body[data-theme="kawaii"] #ambient::before {
  opacity: 1;
  background-image:
    radial-gradient(3.5px 3.5px at 18% 30%, #fff0f7, transparent),
    radial-gradient(4px 4px at 62% 20%, #ffd0ec, transparent),
    radial-gradient(3px 3px at 40% 70%, #fff, transparent),
    radial-gradient(4px 4px at 82% 58%, #ffdff2, transparent),
    radial-gradient(3.5px 3.5px at 8% 82%, #fff0f7, transparent),
    radial-gradient(3px 3px at 52% 44%, #ffe4f4, transparent);
  background-repeat: repeat; background-size: 250px 250px;
  animation: sparkleDrift 28s linear infinite, twinkle 2.2s ease-in-out infinite alternate;
}
body[data-theme="kawaii"] #ambient::after {
  opacity: 1;
  background-image:
    radial-gradient(90px 90px at 20% 30%, rgba(255,150,200,.16), transparent 70%),
    radial-gradient(120px 120px at 78% 70%, rgba(200,140,255,.16), transparent 70%);
  background-repeat: no-repeat; background-size: cover;
  animation: kawaiiPulse 6s ease-in-out infinite alternate;
}
@keyframes sparkleDrift { to { transform: translate(-140px, -140px); } }
@keyframes kawaiiPulse { 0% { opacity: .65; transform: scale(1); } 100% { opacity: 1; transform: scale(1.1); } }

/* ---------- Big drifting theme emojis on the START SCREEN ----------
   app.js fills #startFloaters (from the active theme's emoji pool) so the
   landing page is unmistakably themed — rockets/fish/hearts slowly rising
   behind the card. Sits above the backdrop but below the overlay/card. */
#startFloaters {
  position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden;
}
body.playing #startFloaters { display: none; }   /* only on the start screen */
.start-floater {
  position: absolute; bottom: -12vh;
  font-size: clamp(30px, 6vw, 62px); line-height: 1;
  opacity: 0; will-change: transform, opacity;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.35));
  animation: floatRise var(--dur, 20s) linear infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes floatRise {
  0%   { transform: translateY(0) rotate(0deg);        opacity: 0; }
  10%  { opacity: .85; }
  90%  { opacity: .85; }
  100% { transform: translateY(-118vh) rotate(var(--spin, 20deg)); opacity: 0; }
}

/* ---------- Animated aurora behind the start card ----------
   Kept subtle so the per-theme animated backdrop (#bg/#ambient) reads through
   it instead of being washed out. */
.overlay::before {
  content: ""; position: absolute; inset: -20% -10%; z-index: -1;
  background:
    radial-gradient(40% 40% at 25% 30%, rgba(255,107,157,.18), transparent 70%),
    radial-gradient(45% 45% at 75% 35%, rgba(94,92,230,.18), transparent 70%),
    radial-gradient(40% 40% at 55% 80%, rgba(52,199,89,.14), transparent 70%);
  filter: blur(28px); opacity: .8;
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translate3d(-3%, -2%, 0) scale(1.05) rotate(0deg); }
  100% { transform: translate3d(3%, 2%, 0) scale(1.15) rotate(8deg); }
}

.overlay {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: flex-start; justify-content: center;
  padding: calc(24px + var(--safe-t)) 24px calc(24px + var(--safe-b));
  text-align: center;
  /* overflow-x:hidden clips the decorative aurora so it never causes a
     horizontal scroll (which was shoving the layout sideways on phones).
     overflow-y:auto keeps the card scrollable when it's taller than the screen. */
  overflow-x: hidden; overflow-y: auto;
}

/* ---------- Start card (glassmorphism) ---------- */
.card {
  position: relative;
  /* margin:auto centers the card in the flex overlay when it fits, but lets it
     pin to the top (reachable by scroll) when it's taller than the viewport. */
  margin: auto;
  /* min-width:0 stops this flex item from refusing to shrink below its content's
     intrinsic width (the cause of horizontal overflow on narrow phones). */
  min-width: 0;
  max-width: min(620px, 100%); width: 100%;
  /* More transparent + a lighter blur so the animated theme backdrop shows
     THROUGH the card (the whole point of the punch-up), while text stays crisp
     thanks to the blur + strong text/glyph shadows. */
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02));
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  padding: clamp(26px, 5vw, 42px) clamp(20px, 4vw, 34px);
  backdrop-filter: blur(11px) saturate(1.35);
  -webkit-backdrop-filter: blur(11px) saturate(1.35);
  box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255,255,255,.16);
  animation: floatIn .7s cubic-bezier(.2,.9,.3,1.2) both;
}
/* subtle top sheen */
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.12), transparent 30%);
  mix-blend-mode: overlay;
}
@keyframes floatIn { from {opacity:0; transform:translateY(22px) scale(.96);} to {opacity:1; transform:none;} }

.logo {
  font-size: clamp(52px, 12vw, 66px); line-height: 1; margin-bottom: 2px;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.4));
  animation: bob 3.4s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-3deg);} 50% { transform: translateY(-7px) rotate(3deg);} }

h1 {
  margin: 4px 0; font-size: var(--fs-title); font-weight: 900; letter-spacing: -1.5px;
  background: linear-gradient(90deg,#FF6B9D,#FFCC00,#34C759,#30B0C7,#AF52DE,#FF6B9D);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 6s linear infinite;
}
@keyframes sheen { to { background-position: 200% center; } }

.tagline { margin: 4px 0 22px; font-size: var(--fs-tag); color: rgba(255,255,255,.82); line-height: 1.45; }

/* ---------- Mode picker ---------- */
.section-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: 2px;
  color: rgba(255,255,255,.45); margin: 0 0 12px; font-weight: 800;
}
#modeGrid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 10px; margin-bottom: 24px;
}
.mode-card {
  appearance: none; cursor: pointer; color: #fff; position: relative;
  background: var(--glass); border: 1.5px solid var(--ring);
  border-radius: var(--r-md); padding: 15px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  transition: transform .16s cubic-bezier(.2,.9,.3,1.4), border-color .16s, background .16s, box-shadow .16s;
}
.mode-card:hover { transform: translateY(-3px); background: rgba(255,255,255,.1); }
.mode-card:active { transform: translateY(0) scale(.97); }
.mode-card.selected {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(255,204,0,.22), rgba(255,204,0,.08));
  box-shadow: 0 8px 24px -6px rgba(255,204,0,.5), inset 0 1px 0 rgba(255,255,255,.25);
}
.mode-card.selected::before {
  content: "✓"; position: absolute; top: 6px; right: 8px;
  font-size: 11px; font-weight: 900; color: #241100;
  background: var(--accent); width: 17px; height: 17px; border-radius: 50%;
  display: grid; place-items: center;
}
.mode-emoji { font-size: 30px; line-height: 1; filter: drop-shadow(0 3px 6px rgba(0,0,0,.35)); }
.mode-name { font-size: 12.5px; font-weight: 700; letter-spacing: .2px; }

/* ---------- Theme picker (smaller chips than the mode cards) ---------- */
#themeGrid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin-bottom: 24px;
}
.theme-card {
  appearance: none; cursor: pointer; color: #fff; position: relative;
  background: var(--glass); border: 1.5px solid var(--ring);
  border-radius: var(--r-sm); padding: 10px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  transition: transform .16s cubic-bezier(.2,.9,.3,1.4), border-color .16s, background .16s, box-shadow .16s;
}
.theme-card:hover { transform: translateY(-2px); background: rgba(255,255,255,.1); }
.theme-card:active { transform: translateY(0) scale(.97); }
.theme-card.selected {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(255,204,0,.22), rgba(255,204,0,.08));
  box-shadow: 0 8px 24px -6px rgba(255,204,0,.5), inset 0 1px 0 rgba(255,255,255,.25);
}
.theme-emoji { font-size: 22px; line-height: 1; filter: drop-shadow(0 3px 6px rgba(0,0,0,.35)); }
.theme-name { font-size: 11px; font-weight: 700; }

/* ---------- Sound toggle ---------- */
.toggle-row {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 4px 0 22px; font-size: 16px; font-weight: 700; color: rgba(255,255,255,.88);
}
.switch { position: relative; display: inline-block; width: 60px; height: 34px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.slider {
  position: absolute; inset: 0; border-radius: 999px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.2);
  transition: background .22s ease;
}
.slider::before {
  content: ""; position: absolute; height: 28px; width: 28px; left: 3px; top: 2px;
  border-radius: 50%; background: #fff; transition: transform .24s cubic-bezier(.2,.9,.3,1.5);
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
}
.switch input:checked + .slider { background: linear-gradient(180deg,#FFE066,#FFB300); }
.switch input:checked + .slider::before { transform: translateX(26px); }
.switch input:focus-visible + .slider { outline: 2px solid #fff; outline-offset: 3px; }
#soundLabel { min-width: 122px; text-align: left; }

/* ---------- Primary button ---------- */
.btn-primary {
  position: relative; overflow: hidden; appearance: none; border: 0; cursor: pointer;
  font: inherit; font-size: clamp(19px, 5vw, 25px); font-weight: 800; color: #241100;
  padding: 17px 44px; border-radius: 999px;
  background: linear-gradient(180deg,#FFE066,#FFB300);
  box-shadow: var(--shadow-glow), inset 0 2px 0 rgba(255,255,255,.65);
  transition: transform .14s cubic-bezier(.2,.9,.3,1.4), box-shadow .14s;
}
.btn-primary:hover { transform: translateY(-2px) scale(1.025); box-shadow: 0 18px 48px -6px rgba(255,179,0,.6), inset 0 2px 0 rgba(255,255,255,.65); }
.btn-primary:active { transform: translateY(1px) scale(.99); }
.btn-primary:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
/* moving shine */
.btn-shine {
  position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-18deg); animation: shine 3.6s ease-in-out infinite;
}
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 140%; } }

.esc-hint { margin: 20px 0 0; font-size: 15px; color: rgba(255,255,255,.72); }
.esc-hint b {
  background: rgba(255,255,255,.14); padding: 2px 10px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.2); font-weight: 700; white-space: nowrap;
}

/* ---------- Donate ---------- */
#donateWrap { margin-top: 18px; }
.donate-caption {
  margin: 0 0 10px; font-size: 13.5px; font-weight: 700;
  color: rgba(255,255,255,.62);
}
.donate-link {
  display: inline-block; text-decoration: none; font-weight: 800; font-size: 15px;
  color: #ffd60a; padding: 12px 26px; border-radius: 999px;
  border: 1px solid rgba(255,214,10,.5); background: rgba(255,214,10,.12);
  box-shadow: 0 6px 20px -8px rgba(255,179,0,.6);
  transition: background .16s ease, transform .16s ease, box-shadow .16s ease;
}
.donate-link:hover {
  background: rgba(255,214,10,.24); transform: translateY(-1px);
  box-shadow: 0 10px 26px -8px rgba(255,179,0,.7);
}

/* ---- Disguised Razorpay button ----
   The visible coffee face sits in normal flow; Razorpay's real button is
   overlaid on top, stretched to cover it, and made invisible-but-clickable.
   The tap therefore lands on Razorpay's own <a> (a genuine gesture that opens
   secure checkout) while the user only ever sees "Buy me a coffee". */
.donate-stack { position: relative; display: inline-block; }
.donate-face  { position: relative; z-index: 1; cursor: pointer; }
/* Razorpay's injected wrapper — cover the face and go transparent. */
.donate-rzp {
  position: absolute; inset: 0; z-index: 2;
  margin: 0; opacity: 0;
}
.donate-rzp, .donate-rzp * { cursor: pointer !important; }
/* Stretch Razorpay's own elements to fill the whole coffee button so the entire
   surface is the hit target (they render as inline HTML, so we can size them). */
.donate-rzp .razorpay-payment-button,
.donate-rzp form { display: block; width: 100%; height: 100%; }
.donate-rzp .PaymentButton { width: 100% !important; height: 100% !important; }

/* ---------- Grown-ups note ---------- */
details {
  margin-top: 18px; text-align: left; font-size: 13.5px;
  color: rgba(255,255,255,.62); line-height: 1.55;
  background: rgba(0,0,0,.16); border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r-sm); padding: 12px 16px;
}
details[open] { background: rgba(0,0,0,.24); }
details summary { cursor: pointer; color: rgba(255,255,255,.82); font-weight: 700; list-style: none; text-align: center; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "ⓘ "; }
details p { margin: 10px 2px 0; }
details code { background: rgba(255,255,255,.1); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }

.btn-install {
  margin-top: 14px; display: inline-block; cursor: pointer;
  font-weight: 800; font-size: 14px; color: #fff;
  padding: 11px 22px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.08);
  transition: background .16s ease, transform .16s ease;
}
.btn-install:hover { background: rgba(255,255,255,.16); transform: translateY(-1px); }
.btn-install:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.btn-install[hidden] { display: none; }

/* ---------- Share ---------- */
#shareWrap { margin-top: 12px; }
.btn-share {
  display: inline-block; cursor: pointer; font: inherit;
  font-weight: 800; font-size: 14px; color: #fff;
  padding: 11px 22px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.08);
  transition: background .16s ease, transform .16s ease;
}
.btn-share:hover { background: rgba(255,255,255,.16); transform: translateY(-1px); }
.btn-share:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.share-panel {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-top: 12px;
}
.share-panel[hidden] { display: none; }
.share-opt {
  cursor: pointer; font: inherit; text-decoration: none;
  font-weight: 700; font-size: 13.5px; color: #fff;
  padding: 9px 18px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.24); background: rgba(255,255,255,.06);
  transition: background .16s ease, transform .16s ease;
}
.share-opt:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }
.share-opt:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.compat { margin-top: 16px; font-size: 12px; color: rgba(255,255,255,.4); }
.legal-links { margin-top: 8px; font-size: 12px; }
.legal-links a { color: rgba(255,255,255,.5); text-decoration: none; }
.legal-links a:hover { color: var(--accent); }

/* ---------- Grown-up smash report ---------- */
.report-overlay { z-index: 30; display: none; background: rgba(10,6,26,.55); backdrop-filter: blur(6px); }
.report-overlay.show { display: flex; }
.report-card { max-width: 420px; }
.report-emoji { font-size: clamp(46px, 11vw, 60px); line-height: 1; animation: bob 3.4s ease-in-out infinite; }
.report-card h2 {
  margin: 8px 0 18px; font-size: clamp(24px, 6vw, 32px); font-weight: 900; letter-spacing: -.5px;
}
.report-stats { display: flex; gap: 14px; justify-content: center; margin-bottom: 18px; }
.report-stat {
  flex: 1; max-width: 150px;
  background: var(--glass); border: 1px solid var(--ring); border-radius: var(--r-md);
  padding: 16px 10px; display: flex; flex-direction: column; gap: 4px;
}
.report-num {
  font-size: clamp(28px, 8vw, 40px); font-weight: 900; color: var(--accent);
  line-height: 1;
}
.report-cap { font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,.55); font-weight: 700; }
.report-note { margin: 0 0 22px; font-size: 16px; color: rgba(255,255,255,.82); font-weight: 700; }

/* ---------- Hold-to-exit ring ---------- */
#escring {
  position: fixed; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; pointer-events: none; opacity: 0; transition: opacity .18s ease;
  background: rgba(10,6,26,.42); backdrop-filter: blur(3px);
}
#escring.show { opacity: 1; }
#escring .label { font-size: 22px; font-weight: 800; letter-spacing: .2px; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
#escring svg { transform: rotate(-90deg); filter: drop-shadow(0 6px 22px rgba(0,0,0,.55)); }
#ringTrack { fill: none; stroke: rgba(255,255,255,.18); stroke-width: 12; }
#ringFill  { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round;
             transition: stroke-dashoffset .06s linear; }

/* ---------- Persistent tiny hint ---------- */
#playhint {
  position: fixed; z-index: 15;
  left: 50%; bottom: calc(16px + var(--safe-b)); transform: translateX(-50%);
  font-size: 13px; color: rgba(255,255,255,.4); pointer-events: none; white-space: nowrap;
  background: rgba(0,0,0,.28); padding: 7px 16px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  opacity: 0; transition: opacity .45s ease;
}
#playhint.show { opacity: 1; }
#playhint.fade { opacity: 0; }

/* ---------- Made in India ---------- */
#madein {
  position: fixed; z-index: 16;
  left: 50%; transform: translateX(-50%);
  bottom: calc(12px + var(--safe-b));
  font-size: 12px; font-weight: 700; letter-spacing: .3px;
  color: rgba(255,255,255,.55); pointer-events: none;
  display: flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.22); padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(6px);
}
#madein .flag { font-size: 14px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.4)); }
/* While playing, hide the credit so it doesn't overlap the centered exit hint. */
body.playing #madein { display: none; }

.hidden { display: none !important; }

/* ---------- Responsive tweaks ---------- */
@media (max-width: 380px) {
  #modeGrid { grid-template-columns: repeat(3, 1fr); }
  .mode-emoji { font-size: 26px; }
  .mode-name { font-size: 11px; }
  #playhint { font-size: 11px; }
}
/* Short landscape (phones held sideways): tighten vertical rhythm */
@media (max-height: 480px) and (orientation: landscape) {
  .logo { font-size: 40px; }
  .tagline { margin-bottom: 12px; }
  #modeGrid { margin-bottom: 14px; }
  .toggle-row { margin-bottom: 12px; }
  details { display: none; } /* keep the fold clean on tiny landscape */
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .card, .logo, h1, .btn-shine, .overlay::before,
  #bg, #ambient::before, #ambient::after, .start-floater { animation: none !important; }
  #startFloaters { display: none !important; }   /* no drifting emojis when motion is reduced */
  h1 { background-position: 0 center; }
  /* Ambient dots stay (static), just no drifting/twinkling — still pretty, calm. */
}
