:root {
  /* ── Backgrounds (Royal Navy — deep blue-royal) ── */
  --bg:       #06091c;
  --bg2:      #0a1028;
  --bg3:      #0e1632;
  --card:     #09102a;
  --card-h:   rgba(255,255,255,0.06);

  /* ── Gold Ramp (extracted from app-icon.svg) ── */
  --gold:        #c6a256;
  --gold2:       #d9be76;
  --gold-deep:   #9c7c39;
  --gold-dim:    rgba(198,162,86,0.1);
  --gold-border: rgba(198,162,86,0.26);
  --gold-glow:   rgba(198,162,86,0.15);
  --gold-grad:   linear-gradient(135deg, #d9be76 0%, #c6a256 50%, #9c7c39 100%);

  /* ── Accent Colors ── */
  --blue:     #4a9eff;
  --green:    #00c9a7;
  --red:      #ff6b6b;
  --orange:   #e67e22;
  --purple:   #9b59b6;

  /* ── Level Colors (used only on level badges/borders — 10% of UI) ── */
  --l1-col:   #c6a256;
  --l2-col:   #4a9eff;
  --l3-col:   #9b59b6;
  --l4-col:   #e67e22;

  /* ── Text ── */
  --text:     #eaeef8;
  --text1:    #f4f7ff;
  --text2:    rgba(210,222,248,0.78);
  --text3:    rgba(210,222,248,0.52);
  --muted:    #4a5568;
  --muted2:   #8a9aaa;

  /* ── Borders ── */
  --border:   rgba(255,255,255,0.06);
  --border2:  rgba(255,255,255,0.1);

  /* ── Typography ── */
  --font-head: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Manrope', 'Noto Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'DM Mono', 'JetBrains Mono', 'Noto Sans', monospace;

  /* ── Font Sizes (Desktop-first, larger & readable) ── */
  --fs-hero:   3rem;
  --fs-h1:     2rem;
  --fs-h2:     1.4rem;
  --fs-h3:     1.15rem;
  --fs-body:   1rem;
  --fs-sm:     0.9rem;
  --fs-xs:     0.78rem;
  --fs-xxs:    0.68rem;

  /* ── Spacing ── */
  --sp-xs:     4px;
  --sp-sm:     8px;
  --sp-md:     12px;
  --sp-lg:     16px;
  --sp-xl:     24px;
  --sp-2xl:    32px;
  --sp-3xl:    48px;
  --sp-4xl:    64px;

  /* ── Radii ── */
  --r-sm:      6px;
  --r-md:      10px;
  --r-lg:      14px;
  --r-xl:      20px;
  --r-full:    999px;

  /* ── Shadows ── */
  --sh-card:   0 2px 12px rgba(0,0,0,0.3);
  --sh-gold:   0 0 20px rgba(201,168,76,0.15);
  --sh-lift:   0 4px 20px rgba(0,0,0,0.4);

  /* ── Motion ── */
  --ease-out:  cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in:   cubic-bezier(0.55, 0, 1, 0.45);
  --ease-std:  cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast:    0.15s;
  --t-med:     0.25s;
  --t-slow:    0.4s;
  --t-reveal:  0.7s;

  /* ── Layout ── */
  --max-w:     1100px;
  --topbar-h:  52px;
  --tabbar-h:  44px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}

/* ── Responsive font scaling ── */
/* ── iPad / small desktop (≤1024px) ── */
@media (max-width: 1024px) {
  html { font-size: 16px; }
  :root {
    --fs-hero: 2.5rem;   /* 40px */
    --fs-h1:   1.75rem;  /* 28px */
    --fs-h2:   1.3rem;   /* 20.8px */
    --fs-h3:   1.1rem;   /* 17.6px */
    --fs-sm:   0.9rem;
    --fs-xs:   0.78rem;
    --fs-xxs:  0.7rem;
  }
}

/* ── Mobile landscape / tablet portrait (≤768px) ── */
@media (max-width: 768px) {
  html { font-size: 15px; }
  :root {
    --fs-hero: 2rem;     /* 30px */
    --fs-h1:   1.5rem;   /* 22.5px */
    --fs-h2:   1.2rem;   /* 18px */
    --fs-h3:   1.07rem;  /* 16px */
    --fs-body: 1rem;     /* 15px */
    --fs-sm:   0.92rem;  /* 13.8px */
    --fs-xs:   0.8rem;   /* 12px */
    --fs-xxs:  0.72rem;  /* 10.8px */
  }
}

/* ── Mobile portrait (≤480px) ── */
@media (max-width: 480px) {
  html { font-size: 14px; }
  :root {
    --fs-hero: 1.8rem;   /* 25.2px */
    --fs-h1:   1.35rem;  /* 18.9px */
    --fs-h2:   1.15rem;  /* 16.1px */
    --fs-h3:   1.05rem;  /* 14.7px */
    --fs-body: 1rem;     /* 14px */
    --fs-sm:   0.93rem;  /* 13px */
    --fs-xs:   0.82rem;  /* 11.5px */
    --fs-xxs:  0.75rem;  /* 10.5px */
  }
}

::selection { background: rgba(201,168,76,0.3); color: #fff; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(201,168,76,0.35); }

input, select, textarea, button { font-family: inherit; }

/* ══════════════════════════════════════
   Shared Visual FX — Confetti, Particles,
   Gold Shimmer, Glass Card Utility
   ══════════════════════════════════════ */

/* ── Glass card utility ── */
.glass-card {
  background: rgba(12,17,34,0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(201,168,76,0.18);
  border-radius: 12px;
  transition: background 0.25s ease, border-color 0.25s ease,
              box-shadow 0.25s ease, transform 0.25s ease;
}

.glass-card:hover {
  background: rgba(15,22,42,0.85);
  border-color: rgba(201,168,76,0.35);
  box-shadow: 0 0 24px rgba(201,168,76,0.12), 0 8px 32px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}

/* ── Gold shimmer on key elements ── */
@keyframes goldShimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.gold-shimmer {
  background: linear-gradient(
    90deg,
    #c9a84c 0%,
    #f0d080 30%,
    #c9a84c 50%,
    #9a7528 70%,
    #c9a84c 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: goldShimmer 3.5s linear infinite;
}

/* ── Confetti burst animation ── */
@keyframes wowConfettiBurst {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(0deg);
    opacity: 1;
  }
  45% {
    opacity: 1;
    transform: translate(
      calc(-50% + var(--tx, 0px)),
      calc(-50% + var(--ty, 0px))
    ) scale(1) rotate(var(--rot, 90deg));
  }
  100% {
    transform: translate(
      calc(-50% + var(--tx, 0px)),
      calc(-50% + calc(var(--ty, 0px) + 18px))
    ) scale(0.2) rotate(calc(var(--rot, 90deg) * 2));
    opacity: 0;
  }
}

/* ── Hover floating particles animation ── */
@keyframes wowParticleFloat {
  0%   { transform: translateY(0) scale(0); opacity: 0; }
  12%  { opacity: 0.85; transform: translateY(-6px) scale(1); }
  100% { transform: translateY(var(--py, -32px)) scale(0.15); opacity: 0; }
}
