/* ============================================================
   POP & MULTIPLY — styles.css
   Neon arcade aesthetic · fluid mobile-first · juice animations
   ============================================================ */

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

:root {
  --bg-0: #05060f;
  --bg-1: #0b1026;
  --bg-2: #11172f;
  --ink: #e8ecff;
  --ink-dim: #8ea0c0;
  --cyan: #22d3ee;
  --cyan-soft: #67e8f9;
  --pink: #f472b6;
  --violet: #a78bfa;
  --gold: #fbbf24;
  --gem: #e879f9;
  --good: #34d399;
  --bad: #f87171;
  --line: rgba(148, 163, 184, 0.18);
  --glass: rgba(17, 23, 47, 0.72);
  --radius: 16px;
  --font: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1000px 600px at 80% -10%, rgba(167, 139, 250, 0.16), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(34, 211, 238, 0.12), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.noscript {
  padding: 40px 20px; text-align: center; font-size: 18px; color: var(--ink-dim);
}

/* ---------- App frame (phone-like column) ---------- */
#app {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

@media (min-width: 700px) {
  #app {
    max-width: 480px;
    height: min(900px, 96vh);
    margin: auto;
    border: 1px solid rgba(103, 232, 249, 0.22);
    border-radius: 24px;
    box-shadow: 0 0 60px rgba(34, 211, 238, 0.12), 0 30px 80px rgba(0, 0, 0, 0.55);
    background: linear-gradient(180deg, rgba(11, 16, 38, 0.85), rgba(5, 6, 15, 0.92));
    overflow: hidden;
  }
}

/* ---------- Screens ---------- */
.screen {
  flex: 1;
  display: none;
  flex-direction: column;
  min-height: 0;
}
.screen.active { display: flex; }

/* ---------- Shared bits ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  font-size: clamp(11px, 3vw, 13px);
  font-weight: 700;
  color: var(--ink);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chip b { font-weight: 800; }
.chip.gem b { color: var(--gem); }
.chip.coin b { color: var(--gold); }
.chip.gold b { color: var(--gold); }
.chip.stage { color: var(--cyan-soft); letter-spacing: 0.06em; }

.spacer { flex: 1; }

.btn {
  appearance: none;
  border: 1px solid rgba(103, 232, 249, 0.35);
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.12), rgba(167, 139, 250, 0.10));
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(14px, 3.8vw, 16px);
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 13px 20px;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.15s ease, opacity 0.15s;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  border: none;
  background: linear-gradient(135deg, var(--cyan), var(--violet) 60%, var(--pink));
  color: #05060f;
  box-shadow: 0 6px 24px rgba(34, 211, 238, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:not(:disabled) { color: #071018; }

.btn-ad {
  border: none;
  background: linear-gradient(135deg, #34d399, #22d3ee);
  color: #04120c;
  box-shadow: 0 6px 22px rgba(52, 211, 153, 0.3);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-dim);
  font-weight: 700;
}

.btn-xl { font-size: clamp(20px, 6vw, 26px); padding: 18px 30px; border-radius: 20px; }
.btn-sm { font-size: 12px; padding: 9px 13px; border-radius: 10px; }
.btn-block { width: 100%; }

.btn-daily {
  border: 1px solid rgba(251, 191, 36, 0.5);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.14), rgba(232, 121, 249, 0.10));
}
.btn-daily.played {
  border-color: rgba(52, 211, 153, 0.55);
  color: var(--good);
}

.btn-pulse { animation: ctaPulse 1.6s ease-in-out infinite; }
@keyframes ctaPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 6px 24px rgba(34, 211, 238, 0.35); }
  50% { transform: scale(1.035); box-shadow: 0 10px 34px rgba(167, 139, 250, 0.55); }
}

.icon-btn {
  appearance: none;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s, filter 0.15s;
  flex: none;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn.danger { color: var(--bad); border-color: rgba(248, 113, 113, 0.35); }
.icon-btn.armed { background: rgba(248, 113, 113, 0.2); color: #fff; }

/* ============================================================
   MENU SCREEN
   ============================================================ */
#screenMenu { align-items: center; justify-content: space-between; padding: 18px 20px 10px; position: relative; }

.menu-orbs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.menu-orbs i {
  position: absolute; border-radius: 50%; filter: blur(50px); opacity: 0.5;
  animation: orbFloat 9s ease-in-out infinite;
}
.menu-orbs i:nth-child(1) { width: 180px; height: 180px; left: -40px; top: 12%; background: rgba(34, 211, 238, 0.35); }
.menu-orbs i:nth-child(2) { width: 200px; height: 200px; right: -50px; top: 40%; background: rgba(244, 114, 182, 0.28); animation-delay: -3s; }
.menu-orbs i:nth-child(3) { width: 160px; height: 160px; left: 30%; bottom: -30px; background: rgba(167, 139, 250, 0.3); animation-delay: -6s; }
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(24px, -30px) scale(1.12); }
}

.menu-top { width: 100%; display: flex; justify-content: flex-end; }

.menu-hero { text-align: center; margin-top: 4vh; }
.logo {
  font-size: clamp(38px, 11vw, 56px);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--cyan-soft) 10%, var(--violet) 50%, var(--pink) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(103, 232, 249, 0.35));
  animation: logoGlow 3s ease-in-out infinite;
}
.logo .amp { font-size: 0.7em; }
@keyframes logoGlow {
  0%, 100% { filter: drop-shadow(0 0 14px rgba(103, 232, 249, 0.3)); }
  50% { filter: drop-shadow(0 0 30px rgba(244, 114, 182, 0.5)); }
}
.tagline {
  margin-top: 10px;
  color: var(--ink-dim);
  letter-spacing: 0.35em;
  font-size: clamp(11px, 3vw, 14px);
  font-weight: 700;
}
.stat-chips { display: flex; gap: 8px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

.menu-actions { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 12px; }
.menu-row { display: flex; gap: 12px; }
.menu-row .btn { flex: 1; }

.version { font-size: 10px; color: rgba(142, 160, 192, 0.55); letter-spacing: 0.08em; margin-top: 6px; }

/* ============================================================
   GAME SCREEN
   ============================================================ */
#screenGame { gap: 8px; padding: 8px 10px max(8px, env(safe-area-inset-bottom)); }

#hud { display: flex; flex-direction: column; gap: 6px; }
.hud-row { display: flex; align-items: center; gap: 6px; }

.moves { display: flex; gap: 4px; align-items: center; padding: 0 2px; }
.pip {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.8);
  transition: all 0.25s;
}
.pip.spent { background: #2c3654; box-shadow: none; transform: scale(0.75); }

.progress {
  position: relative;
  height: 22px;
  background: rgba(10, 14, 30, 0.9);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
#scoreFill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.6);
}
.progress.done #scoreFill {
  background: linear-gradient(90deg, var(--gold), #fde68a);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.75);
}
#scoreLabel {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; letter-spacing: 0.04em;
  color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  font-variant-numeric: tabular-nums;
}
#targetBadge {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%) scale(0);
  font-size: 9px; font-weight: 900; color: #1a1204;
  background: var(--gold); border-radius: 999px; padding: 2px 7px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.progress.done #targetBadge { transform: translateY(-50%) scale(1); }

#canvasWrap {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(103, 232, 249, 0.18);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5);
  touch-action: none;
  cursor: crosshair;
}
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

#comboBadge {
  position: absolute; top: 10px; left: 50%;
  transform: translateX(-50%) scale(0);
  padding: 5px 14px;
  font-size: clamp(14px, 4vw, 18px);
  font-weight: 900; letter-spacing: 0.06em;
  color: #fff;
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.9), rgba(167, 139, 250, 0.9));
  border-radius: 999px;
  box-shadow: 0 0 24px rgba(244, 114, 182, 0.6);
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-variant-numeric: tabular-nums;
}
#comboBadge.show { transform: translateX(-50%) scale(1); }
#comboBadge.pop { animation: comboPop 0.3s ease; }
@keyframes comboPop { 50% { transform: translateX(-50%) scale(1.25); } }

#bigMsg {
  position: absolute; top: 34%; left: 0; right: 0;
  text-align: center;
  font-size: clamp(26px, 8vw, 44px);
  font-weight: 900; letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 0 0 20px var(--cyan), 0 0 50px rgba(34, 211, 238, 0.6);
  opacity: 0;
  pointer-events: none;
}
#bigMsg.show { animation: bigMsgIn 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
@keyframes bigMsgIn {
  0% { opacity: 0; transform: scale(0.4); }
  14% { opacity: 1; transform: scale(1.15); }
  24% { transform: scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.05) translateY(-18px); }
}

#powerBar {
  display: flex; align-items: center; gap: 8px;
  padding: 2px 0 6px;
}
.power {
  appearance: none;
  font-family: var(--font);
  font-size: clamp(10px, 2.8vw, 12px);
  font-weight: 800; letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--glass);
  border: 1px solid rgba(167, 139, 250, 0.4);
  border-radius: 12px;
  padding: 9px 12px;
  cursor: pointer;
  transition: transform 0.12s, filter 0.15s;
  white-space: nowrap;
}
.power:active { transform: scale(0.94); }
.power .count {
  display: inline-block; min-width: 18px;
  margin-left: 4px; padding: 1px 5px;
  background: rgba(167, 139, 250, 0.25);
  border-radius: 999px; text-align: center;
}
.power.none { opacity: 0.55; }
#dropHint {
  flex: 1; text-align: center;
  font-size: 10px; letter-spacing: 0.25em;
  color: rgba(142, 160, 192, 0.7);
  font-weight: 700;
}

/* ---------- Mock ad banner ---------- */
.ad-banner {
  flex: none;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px;
  border-top: 1px dashed rgba(148, 163, 184, 0.22);
  background: rgba(148, 163, 184, 0.05);
  font-size: 11px;
  color: rgba(142, 160, 192, 0.8);
  letter-spacing: 0.03em;
  overflow: hidden;
}
.ad-tag {
  font-size: 8px; font-weight: 900; letter-spacing: 0.1em;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 4px;
  flex: none;
}
.ad-text { white-space: nowrap; }

/* ============================================================
   MODALS
   ============================================================ */
.modal {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  background: rgba(4, 6, 14, 0.74);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 40;
}
.modal.open { opacity: 1; pointer-events: auto; }

.modal-continue, #modalClear, #modalOver { z-index: 50; }
.modal-shop { z-index: 60; }
.modal-ad, .modal-iap { z-index: 70; }

.modal-card {
  width: min(420px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #141b38, #0b1026);
  border: 1px solid rgba(103, 232, 249, 0.28);
  border-radius: 22px;
  padding: 22px;
  display: flex; flex-direction: column; gap: 13px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), 0 0 40px rgba(34, 211, 238, 0.08);
  transform: scale(0.88) translateY(16px);
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal.open .modal-card { transform: none; }
.modal-card.small { width: min(280px, 90%); align-items: center; text-align: center; }
.modal-card.wide { width: min(460px, 100%); }

.modal-title { font-size: 22px; font-weight: 900; letter-spacing: 0.08em; text-align: center; }

/* --- How to play --- */
.how-list { list-style: none; display: flex; flex-direction: column; gap: 11px; font-size: 14px; line-height: 1.45; }
.how-list li {
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
}
.c-cyan { color: var(--cyan-soft); }
.c-pink { color: var(--pink); }
.c-gold { color: var(--gold); }
.c-gem { color: var(--gem); }

/* --- Shop --- */
.shop-head { display: flex; align-items: center; gap: 10px; }
.shop-head .modal-title { flex: 1; text-align: left; }

.tabs { display: flex; gap: 6px; }
.tab {
  flex: 1;
  appearance: none; font-family: var(--font);
  font-size: 12px; font-weight: 800; letter-spacing: 0.03em;
  padding: 9px 6px;
  color: var(--ink-dim);
  background: rgba(10, 14, 30, 0.7);
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
  transition: all 0.18s;
}
.tab.active {
  color: #071018;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  border-color: transparent;
}

.shop-body { min-height: 240px; }
.shop-sec { display: none; flex-direction: column; gap: 10px; }
.shop-sec.active { display: flex; }

.card {
  display: flex; align-items: center; gap: 12px;
  background: rgba(17, 23, 47, 0.65);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 12px;
  transition: border-color 0.2s;
}
.card.equipped { border-color: rgba(52, 211, 153, 0.55); box-shadow: 0 0 18px rgba(52, 211, 153, 0.12); }
.card.cant { border-color: rgba(248, 113, 113, 0.4); }
.card.shake { animation: cardShake 0.4s; }
@keyframes cardShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.card-info { flex: 1; min-width: 0; }
.card-info h3 { font-size: 15px; font-weight: 900; letter-spacing: 0.03em; }
.card-info p { font-size: 11.5px; color: var(--ink-dim); line-height: 1.35; margin-top: 2px; }
.card-info .owned { color: var(--violet); font-weight: 800; display: block; margin-top: 2px; }

.skin-ball {
  flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, var(--c1), var(--c2) 75%);
  box-shadow: 0 0 18px var(--c1), inset 0 0 8px rgba(255, 255, 255, 0.25);
  animation: ballBob 2.4s ease-in-out infinite;
}
@keyframes ballBob { 50% { transform: translateY(-4px); } }

.power-icon { flex: none; font-size: 26px; width: 44px; text-align: center; }

.pack {
  display: flex; align-items: center; gap: 10px;
  appearance: none; font-family: var(--font);
  width: 100%;
  background: rgba(17, 23, 47, 0.65);
  border: 1px solid rgba(232, 121, 249, 0.35);
  border-radius: 15px;
  padding: 14px 16px;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s, filter 0.15s;
}
.pack:active { transform: scale(0.97); }
.pack:disabled { opacity: 0.5; }
.pack.hot { border-color: var(--gem); box-shadow: 0 0 18px rgba(232, 121, 249, 0.18); }
.pack-gems { font-size: 17px; font-weight: 900; flex: 1; text-align: left; }
.pack-tag {
  font-size: 8.5px; font-weight: 900; letter-spacing: 0.08em;
  color: var(--gem);
  border: 1px solid rgba(232, 121, 249, 0.5);
  padding: 2px 6px; border-radius: 999px;
}
.pack-price {
  font-size: 15px; font-weight: 900;
  color: var(--good);
}
.shop-note { font-size: 10.5px; color: rgba(142, 160, 192, 0.65); text-align: center; line-height: 1.4; }

/* --- Continue wall --- */
.ribbon {
  text-align: center;
  font-size: clamp(20px, 6vw, 26px);
  font-weight: 900; letter-spacing: 0.1em;
  padding: 10px;
  border-radius: 14px;
}
.ribbon.alert {
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #f97316);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.45);
  animation: ribbonPulse 1.4s ease-in-out infinite;
}
.ribbon.gold {
  color: #1a1204;
  background: linear-gradient(135deg, var(--gold), #fde68a);
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.4);
}
@keyframes ribbonPulse { 50% { transform: scale(1.03); } }

.cont-sub { text-align: center; color: var(--ink-dim); font-size: 13.5px; }
.cont-stats { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.cont-progress {
  width: 100%; height: 14px;
  background: rgba(10, 14, 30, 0.9);
  border: 1px solid var(--line);
  border-radius: 999px; overflow: hidden;
}
#contFill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold), #fde68a);
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
#contScoreLabel { font-size: 12px; font-weight: 800; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.cont-combo { text-align: center; font-size: 13px; color: var(--ink); }
.cont-combo b { color: var(--pink); font-size: 15px; }
#btnContGems.insufficient { filter: saturate(0.35) brightness(0.85); }

/* --- Stage clear --- */
.clear-stats { display: flex; gap: 8px; }
.clear-stats > div {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: rgba(17, 23, 47, 0.6);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 6px;
}
.clear-stats span { font-size: 10px; letter-spacing: 0.1em; color: var(--ink-dim); font-weight: 800; }
.clear-stats b { font-size: 17px; font-variant-numeric: tabular-nums; }

/* --- Game over --- */
.best-badge {
  display: none;
  text-align: center;
  font-weight: 900; letter-spacing: 0.1em;
  color: #1a1204;
  background: linear-gradient(135deg, var(--gold), #fde68a);
  border-radius: 999px;
  padding: 8px;
  font-size: 14px;
  box-shadow: 0 0 26px rgba(251, 191, 36, 0.5);
}
.best-badge.show { display: block; animation: bestPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes bestPop { 0% { transform: scale(0) rotate(-8deg); } 100% { transform: scale(1); } }

.over-title { margin-top: -4px; }
.over-stats { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.over-score { text-align: center; }
.over-score span { display: block; font-size: 10px; letter-spacing: 0.2em; color: var(--ink-dim); font-weight: 800; }
.over-score b {
  font-size: clamp(34px, 10vw, 46px);
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan-soft), var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.over-mini { display: flex; gap: 8px; }
.over-mini span { font-size: 11px; color: var(--ink-dim); font-weight: 700; }
.over-mini b { color: var(--cyan-soft); font-size: 13px; }

/* --- Mock rewarded ad --- */
.ad-modal-card {
  width: min(360px, 100%);
  display: flex; flex-direction: column; gap: 12px;
  background: #0b1026;
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal.open .ad-modal-card { transform: none; }

.ad-creative {
  position: relative;
  height: 190px;
  border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(120deg, #0ea5e9, #8b5cf6, #ec4899, #0ea5e9);
  background-size: 300% 300%;
  animation: adGradient 5s linear infinite;
  overflow: hidden;
}
@keyframes adGradient { 0% { background-position: 0% 50%; } 100% { background-position: 300% 50%; } }
.ad-brand { font-size: 34px; font-weight: 900; color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4); }
.ad-slogan { font-size: 14px; font-weight: 700; color: rgba(255, 255, 255, 0.9); }
.ad-sponsored {
  position: absolute; top: 8px; left: 8px;
  font-size: 8px; font-weight: 900; letter-spacing: 0.1em;
  color: #fff; background: rgba(0, 0, 0, 0.4);
  padding: 3px 7px; border-radius: 5px;
}

.ad-status { display: flex; align-items: center; gap: 10px; }
.ad-bar { flex: 1; height: 10px; background: rgba(10, 14, 30, 0.9); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
#adBarFill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #34d399, #22d3ee);
  border-radius: 999px;
  transition: width 0.12s linear;
}
#adCountdown { font-size: 12px; font-weight: 900; color: var(--cyan-soft); min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }
.ad-reward { text-align: center; font-size: 13px; color: var(--ink-dim); }
.ad-reward b { color: var(--good); }

/* --- Mock IAP --- */
.spinner {
  width: 38px; height: 38px;
  border: 4px solid rgba(103, 232, 249, 0.2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#iapText { font-size: 14px; font-weight: 700; }

/* --- Toasts --- */
#toastWrap {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 90;
  pointer-events: none;
  width: max-content;
  max-width: 92vw;
}
.toast {
  display: flex; align-items: center; gap: 8px;
  background: rgba(17, 23, 47, 0.95);
  border: 1px solid rgba(103, 232, 249, 0.4);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px; font-weight: 800;
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  max-width: 92vw;
  overflow: hidden; text-overflow: ellipsis;
}
.toast.out { animation: toastOut 0.35s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(0.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px) scale(0.92); } }

/* ---------- Small screens ---------- */
@media (max-width: 420px) {
  .hud-row { gap: 4px; }
  .icon-btn { width: 32px; height: 32px; font-size: 14px; }
  .chip { padding: 4px 8px; gap: 4px; font-size: 11px; }
  .moves { gap: 3px; }
  .pip { width: 7px; height: 7px; }
  .power { padding: 8px 9px; }
}

@media (max-height: 620px) {
  .menu-hero { margin-top: 0; }
  .ad-banner { height: 36px; }
}
