@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Inter:wght@400;500;600&family=Space+Mono:wght@400;700&display=swap');

/*
 * styles.css — GuildStream · Architecture CSS
 * ─────────────────────────────────────────────────────────
 * Sections (ordre) :
 *  L.   3 – ~80   : Variables CSS / Thème (dark + light)
 *  L.  80 – 1135  : Base — typo, layout, cards, navbar, boutons, animations
 *  L.1136 – 1879  : Composants partagés — pokémon, modals, toasts, hero, stats
 *  L.1880 – 2378  : Quiz / category-card (quiz.html, index.html, culture-foot.html)
 *  L.2379 – 2501  : Auth callback + Capture arena
 *  L.2502 – 3128  : Profil / wallet / missions (profile.html, u.html)
 *  L.3129 – 3250  : Daily, transactions, pokedex filter
 *  L.3251 – 3441  : Responsive mobile-first
 *  L.3442 – 3570  : Performance & accessibilité
 *  L.3571 – 4159  : Helpers layout / utilitaires
 *  L.4160 – 4510  : Micro-tuning UI & nav
 *
 * À extraire progressivement vers des fichiers séparés :
 *   css/quiz.css     → L.1880-2378  (pages : quiz.html, culture-foot.html, index.html)
 *   css/profile.css  → L.2502-3128  (pages : profile.html, u.html)
 *   css/utils.css    → L.3571-4159  (toutes les pages)
 * ─────────────────────────────────────────────────────────
 */

/* ════════════════════════════════════════════════════════════
   THEME VARIABLES — DARK MODE (DEFAULT)
════════════════════════════════════════════════════════════ */
:root {
  --bg:            #0b0b17;
  --card:          #111122;
  --card2:         #161628;
  --border:        #21213a;
  --purple:        #7c3aed;
  --purple-light:  #a78bfa;
  --purple-dark:   #5b21b6;
  --accent:        #e040fb;
  --accent-dark:   #ab00d6;
  --accent-glow:   rgba(224,64,251,.35);
  --electric:      #00d4ff;
  --electric-glow: rgba(0,212,255,.3);
  --muted:         #7a7f9a;
  --text:          #ece8ff;
  --emerald:       #10b981;
  --yellow:        #fbbf24;
  --red:           #ef4444;
  --blue:          #3b82f6;
  --cyan:          #06b6d4;
  --orange:        #f97316;
  --fuchsia:       #d946ef;
  --transition:    color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
  --ticker-bg:     #0d0d1a;
}

/* ════════════════════════════════════════════════════════════
   THEME VARIABLES — LIGHT MODE
════════════════════════════════════════════════════════════ */
:root[data-theme="light"] {
  --ticker-bg:     #1a0a2e;
  --bg:            #f8f9fa;
  --card:          #ffffff;
  --card2:         #f0f1f5;
  --border:        #e0e4ec;
  --purple:        #7c3aed;
  --purple-light:  #a78bfa;
  --purple-dark:   #5b21b6;
  --accent:        #d946ef;
  --accent-dark:   #ab00d6;
  --accent-glow:   rgba(217,70,239,.15);
  --electric:      #0891b2;
  --electric-glow: rgba(6,182,212,.2);
  --muted:         #6b7280;
  --text:          #1f2937;
  --emerald:       #059669;
  --yellow:        #f59e0b;
  --red:           #dc2626;
  --blue:          #2563eb;
  --cyan:          #0891b2;
  --orange:        #ea580c;
  --fuchsia:       #c2185b;
  --transition:    color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

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

/* ── Custom scrollbar ─────────────────────────── */
::-webkit-scrollbar              { width: 5px; height: 5px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: rgba(124,58,237,.35); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover  { background: rgba(167,139,250,.6); }
::-webkit-scrollbar-corner       { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: rgba(124,58,237,.35) transparent; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background:
    radial-gradient(ellipse 80% 45% at 15% 0%,   rgba(124,58,237,.09)  0%, transparent 60%),
    radial-gradient(ellipse 55% 35% at 85% 100%,  rgba(6,182,212,.06)   0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 50% 50%,   rgba(224,64,251,.03)  0%, transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: var(--transition);
}

/* ════════════════════════════════════════════════════════════
   THEME TOGGLE BUTTON
════════════════════════════════════════════════════════════ */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 0.75rem;
  cursor: pointer;
  font-size: 1.25rem;
  transition: var(--transition);
  position: relative;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--card2);
  border-color: var(--purple);
  transform: scale(1.05);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

img,
svg,
iframe {
  max-width: 100%;
  transition: var(--transition);
}

/* ── Typography ───────────────────────────────── */
.font-raj  { font-family: 'Rajdhani', sans-serif; }
.font-mono { font-family: 'Space Mono', monospace; font-size: .85em; }

h1, h2, h3, .section-title {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: .04em;
}

.text-gradient {
  background: linear-gradient(120deg, var(--purple-light) 0%, var(--accent) 55%, var(--electric) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Layout ───────────────────────────────────── */
.container { width: min(1280px, 100%); margin: 0 auto; padding: 0 clamp(.85rem, 2vw, 1.5rem); }
main, section, footer { min-width: 0; }
.py-8  { padding-top: 2rem;   padding-bottom: 2rem; }
.py-12 { padding-top: 3rem;   padding-bottom: 3rem; }
.py-16 { padding-top: 4rem;   padding-bottom: 4rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

/* ── Card ─────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem;
  position: relative;
  transition: var(--transition), transform .22s, box-shadow .22s, border-color .22s;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 1.5rem; right: 1.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167,139,250,.18), transparent);
  pointer-events: none;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(167,139,250,.22);
  box-shadow: 0 10px 32px rgba(0,0,0,.3), 0 0 0 1px rgba(167,139,250,.06);
}
.card-2 { padding: 1.75rem; }

/* ── Navbar ───────────────────────────────────── */
nav.main-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,13,24,.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

:root[data-theme="light"] nav.main-nav {
  background: rgba(248,249,250,.95);
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.mobile-quick-nav {
  display: none;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  gap: .5rem 1rem;
  padding: 0.5rem 0 0;
  flex-wrap: wrap;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
  order: 1;
  transition: transform 0.2s ease;
}

.nav-logo:hover {
  transform: scale(1.02);
}

.nav-logo .logo-icon {
  width: 36px; 
  height: 36px;
  background: linear-gradient(135deg, var(--purple), var(--accent));
  border-radius: 8px;
  display: flex; 
  align-items: center; 
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 0 12px rgba(224,64,251,.35);
  flex-shrink: 0;
}

.nav-logo span.accent {
  background: linear-gradient(120deg, var(--purple-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: .15rem;
  /* Prend toute la largeur → passe à la 2e ligne */
  flex: 0 0 100%;
  order: 10;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  padding: .25rem 0 .5rem;
  border-top: 1px solid rgba(255,255,255,.05);
  margin-top: .25rem;
}
.nav-links::-webkit-scrollbar {
  display: none;
}
.nav-links a,
.nav-group-toggle {
  color: var(--muted);
  text-decoration: none;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .35rem .75rem;
  border-radius: .5rem;
  transition: color .2s, background .2s, box-shadow .2s;
  border: 1px solid transparent;
  background: transparent;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-group-toggle:hover { color: var(--text); background: rgba(167,139,250,.1); }
.nav-links a.active,
.nav-group-toggle.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(124,58,237,.25), rgba(224,64,251,.15));
  border: 1px solid rgba(167,139,250,.2);
  box-shadow: 0 0 10px rgba(224,64,251,.1);
}
.nav-group {
  position: relative;
}
.nav-group-toggle {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  line-height: 1;
  white-space: nowrap;
}
.nav-caret {
  font-size: .7rem;
  opacity: .8;
  transition: transform .2s ease;
}
.nav-submenu {
  position: absolute;
  top: calc(100% + .45rem);
  left: 0;
  min-width: 220px;
  padding: .4rem;
  border-radius: .85rem;
  border: 1px solid var(--border);
  background: rgba(13,13,24,.98);
  box-shadow: 0 16px 36px rgba(0,0,0,.35);
  display: none;
  flex-direction: column;
  gap: .2rem;
  z-index: 120;
}
.nav-submenu a {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.nav-group:hover .nav-submenu,
.nav-group.open .nav-submenu {
  display: flex;
}
.nav-group:hover .nav-caret,
.nav-group.open .nav-caret {
  transform: rotate(180deg);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  justify-self: end;
  margin-left: auto;
  flex: 0 0 auto;
  min-width: 0;
  flex-wrap: nowrap;
  order: 5;
}

.nav-right > * {
  flex-shrink: 0;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0 0.5rem;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0 0.3rem;
  transition: color 0.2s ease;
}

.lang-btn:hover, .lang-btn.active {
  color: var(--text);
}

.lang-sep {
  color: var(--muted);
  opacity: 0.5;
}

#nav-user-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex-wrap: nowrap;
  justify-content: flex-end;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
}

#nav-user-info span:last-child {
  display: inline-block;
  white-space: nowrap;
}

.coin-badge {
  background: rgba(251,191,36,.12);
  border: 1px solid rgba(251,191,36,.3);
  border-radius: 0.6rem;
  padding: 0.25rem 0.7rem;
  color: var(--yellow);
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  transition: var(--transition);
}

.coin-badge:hover {
  background: rgba(251,191,36,.2);
  border-color: rgba(251,191,36,.4);
}

/* ── Buttons ──────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: .5rem 1.25rem;
  border-radius: .6rem;
  border: none;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
@keyframes btnShimmer {
  0%   { transform: translateX(-120%) skewX(-18deg); }
  100% { transform: translateX(220%)  skewX(-18deg); }
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: -4px; bottom: -4px;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  animation: btnShimmer 2.8s ease-in-out infinite;
  pointer-events: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--purple) 0%, #9d50ff 50%, var(--accent) 100%);
  background-size: 200% 100%;
  background-position: 0% 50%;
  color: #fff;
  box-shadow: 0 2px 12px rgba(124,58,237,.45), 0 1px 3px rgba(0,0,0,.4);
  transition: background-position .3s, box-shadow .3s, transform .15s;
}
.btn-primary:hover:not(:disabled) {
  background-position: 100% 50%;
  box-shadow: 0 4px 20px rgba(224,64,251,.5), 0 2px 8px rgba(0,0,0,.4);
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }

.btn-ghost {
  background: rgba(255,255,255,.03);
  color: var(--purple-light);
  border: 1px solid rgba(124,58,237,.35);
}
.btn-ghost:hover:not(:disabled) {
  color: #fff;
  border-color: var(--accent);
  background: rgba(224,64,251,.07);
  box-shadow: 0 0 12px rgba(224,64,251,.15);
}
.btn-ghost:disabled { opacity: .4; cursor: not-allowed; }

.btn-discord {
  background: linear-gradient(135deg, #5865f2 0%, #7289da 55%, #8b5cf6 100%);
  color: #fff;
  border: 1px solid rgba(129,140,248,.5);
  box-shadow: 0 2px 14px rgba(88,101,242,.35), 0 1px 3px rgba(0,0,0,.35);
}
.btn-discord:hover:not(:disabled) {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(88,101,242,.5), 0 2px 8px rgba(0,0,0,.35);
  filter: saturate(1.08);
}

.btn-games {
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 60%, #06b6d4 100%);
  color: #fff;
  border: 1px solid rgba(56,189,248,.45);
  box-shadow: 0 2px 14px rgba(14,165,233,.28), 0 1px 3px rgba(0,0,0,.35);
}
.btn-games:hover:not(:disabled) {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(14,165,233,.4), 0 2px 8px rgba(0,0,0,.35);
  filter: saturate(1.06);
}

.btn-quiz {
  background: linear-gradient(135deg, #a21caf 0%, #d946ef 100%);
  color: #fff;
  border: 1px solid rgba(217,70,239,.4);
  box-shadow: 0 2px 12px rgba(217,70,239,.4), 0 1px 3px rgba(0,0,0,.4);
  transition: box-shadow .3s, transform .15s;
}
.btn-quiz:hover {
  box-shadow: 0 4px 22px rgba(217,70,239,.6), 0 2px 8px rgba(0,0,0,.4);
  transform: translateY(-1px);
  color: #fff;
}

.btn-twitch {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: #9146ff;
  color: #fff;
  border: 1px solid rgba(145,70,255,.5);
  font-weight: 700;
}
.btn-twitch:hover {
  background: #7c3aed;
  box-shadow: 0 0 18px rgba(145,70,255,.45);
  color: #fff;
  transform: translateY(-1px);
}

.btn-success {
  background: rgba(16,185,129,.2);
  border: 1px solid rgba(16,185,129,.35);
  color: var(--emerald);
}
.btn-success:hover:not(:disabled) { background: rgba(16,185,129,.3); }

.btn-danger {
  background: rgba(239,68,68,.2);
  border: 1px solid rgba(239,68,68,.35);
  color: var(--red);
}
.btn-danger:hover { background: rgba(239,68,68,.3); }

.btn-sm { padding: .3rem .75rem; font-size: .78rem; }
.btn-lg { padding: .75rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; }

/* ── Tab nav ──────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: .3rem;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: .3rem;
  width: fit-content;
  margin-bottom: 2rem;
}
.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: .55rem 1.1rem;
  border-radius: .7rem;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  transition: color .2s, background .2s, border-color .2s, transform .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
  min-width: 80px;
}
.tab-btn .tab-icon {
  font-size: 1.3rem;
  line-height: 1;
  transition: transform .25s cubic-bezier(.22,1,.36,1), filter .25s;
}
.tab-btn .tab-label { line-height: 1; }

.tab-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124,58,237,.12), rgba(224,64,251,.06));
  opacity: 0;
  transition: opacity .2s;
  border-radius: inherit;
}
.tab-btn:hover { color: var(--text); transform: translateY(-1px); }
.tab-btn:hover::before { opacity: 1; }
.tab-btn:hover .tab-icon { transform: scale(1.2) translateY(-1px); }
.tab-btn:hover { border-color: rgba(124,58,237,.2); }

.tab-btn.active {
  background: linear-gradient(135deg, var(--purple) 0%, #9d50ff 60%, var(--accent) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 18px rgba(124,58,237,.4), 0 0 0 1px rgba(167,139,250,.2);
  transform: translateY(-1px);
}
.tab-btn.active::before { opacity: 0; }
.tab-btn.active .tab-icon {
  transform: scale(1.25) translateY(-1px);
  filter: drop-shadow(0 2px 6px rgba(255,255,255,.3));
}
.tab-btn.active .tab-label { text-shadow: 0 1px 4px rgba(0,0,0,.3); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Inputs ───────────────────────────────────── */
input[type="text"], input[type="search"], input[type="password"], select, textarea {
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: .65rem;
  color: var(--text);
  padding: .5rem .85rem;
  font-family: 'Space Mono', monospace;
  font-size: .8rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
  width: 100%;
}
input[type="text"]:hover, input[type="search"]:hover,
input[type="password"]:hover, select:hover, textarea:hover {
  border-color: rgba(167,139,250,.22);
  background: rgba(0,0,0,.32);
}
input:focus, input[type="text"]:focus, input[type="search"]:focus,
input[type="password"]:focus, select:focus, textarea:focus {
  border-color: rgba(167,139,250,.55);
  box-shadow: 0 0 0 3px rgba(124,58,237,.14), inset 0 1px 0 rgba(255,255,255,.04);
  background: rgba(0,0,0,.35);
}
select option { background: var(--card); }

/* ── Animations ───────────────────────────────── */
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes pulse    { 0%,100% { opacity:1; } 50% { opacity:.5; } }
@keyframes live-pulse { 0%,100% { box-shadow:0 0 0 0 rgba(239,68,68,.5); } 50% { box-shadow:0 0 0 6px rgba(239,68,68,0); } }
@keyframes slideUp  {
  from { opacity:0; transform:translateY(16px); }
  to   { opacity:1; transform:translateY(0); }
}
@keyframes shimmer  {
  from { background-position: -200% 0; }
  to   { background-position:  200% 0; }
}
@keyframes confetti-fall {
  0%   { transform: translateX(0) rotate(0deg); opacity: 1; }
  100% { transform: translateX(var(--drift, 60px)) translateY(100vh) rotate(720deg); opacity: 0; }
}
@keyframes rankup-in {
  from { opacity: 0; transform: scale(.85); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes rankup-bounce {
  from { opacity: 0; transform: scale(.4) rotate(-20deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

.animate-spin   { animation: spin 1s linear infinite; }
.animate-pulse  { animation: pulse 2s ease-in-out infinite; }
.animate-slideup{ animation: slideUp .25s ease both; }

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, rgba(145,70,255,.08) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: .5rem;
}

/* ── Grid helpers ─────────────────────────────── */
.grid    { display: grid; gap: 1rem; auto-rows: max-content; }
.g2      { grid-template-columns: repeat(2, 1fr); }
.g3      { grid-template-columns: repeat(3, 1fr); }
.g4      { grid-template-columns: repeat(4, 1fr); }
.g-auto  { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

@media (max-width: 1900px) {
  .nav-inner {
    gap: .4rem;
  }
  .nav-logo {
    font-size: .92rem;
    letter-spacing: .06em;
  }
  .nav-links {
    gap: .02rem;
  }
  .nav-links a,
  .nav-group-toggle {
    font-size: .68rem;
    padding: .22rem .32rem;
    letter-spacing: .03em;
  }
  .nav-right {
    gap: .28rem;
    margin-left: auto;
  }
  .nav-right .btn {
    padding: .32rem .58rem;
    font-size: .72rem;
  }
  #nav-user-info {
    gap: .28rem;
    font-size: .64rem;
  }
  #nav-user-info span:last-child {
    display: none;
  }
  .coin-badge {
    padding: .15rem .42rem;
    font-size: .66rem;
  }
}
@media (max-width: 1200px) {
  .container { padding: 0 1rem; }
  .g3 { grid-template-columns: repeat(2, 1fr); }
  .g4 { grid-template-columns: repeat(2, 1fr); }
  #leaderboard-grids { grid-template-columns: 1fr !important; }
}
@media (max-width: 1024px) {
  body.nav-open {
    overflow: hidden;
  }
  nav.main-nav {
    box-shadow: 0 10px 24px rgba(0,0,0,.24);
  }
  .nav-inner {
    display: flex;
    height: auto;
    min-height: 60px;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.65rem 0;
    align-items: center;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 1.1rem;
    line-height: 1;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  .nav-toggle:hover {
    background: var(--card2);
    border-color: var(--purple);
    transform: scale(1.05);
  }
  .nav-toggle:active {
    transform: scale(0.95);
  }
  .nav-links,
  .nav-right {
    display: none;
    width: 100%;
    flex: 0 0 100%;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: .95rem;
    background: rgba(8,10,26,.96);
    padding: .45rem;
  }
  body.nav-open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .35rem;
    padding-top: .45rem;
    max-height: min(48vh, 420px);
    overflow-y: auto;
  }
  .nav-group {
    width: 100%;
  }
  .nav-group-toggle {
    width: 100%;
    justify-content: flex-start;
  }
  .nav-submenu {
    position: static;
    min-width: 0;
    margin-top: .35rem;
    box-shadow: none;
    background: rgba(255,255,255,.03);
  }
  body.nav-open .nav-right {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .55rem;
    padding-top: .45rem;
  }
  .nav-links a {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: 100%;
    min-height: 48px;
    padding: .8rem .9rem;
    background: rgba(255,255,255,.02);
  }
  .nav-links a span { display: inline; }
  .nav-right .btn,
  .nav-right .lang-toggle,
  #nav-user-info {
    width: 100%;
    justify-content: center;
  }
  #nav-user-info {
    flex-wrap: wrap;
    padding: .2rem 0;
  }
}
@media (max-width: 1024px) {
  body {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }
  .nav-links,
  .nav-right {
    display: none !important;
  }
  .mobile-quick-nav {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .2rem;
    position: fixed;
    left: .45rem;
    right: .45rem;
    bottom: calc(.45rem + env(safe-area-inset-bottom, 0px));
    z-index: 130;
    padding: .25rem;
    border-radius: 1rem;
    border: 1px solid rgba(124,58,237,.28);
    background: rgba(11,11,23,.96);
    backdrop-filter: blur(14px);
    box-shadow: 0 12px 32px rgba(0,0,0,.32);
    transition: opacity .2s ease, transform .2s ease;
  }
  body.nav-open .mobile-quick-nav {
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
  }
  .mobile-quick-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .12rem;
    min-height: 50px;
    padding: .25rem .1rem;
    border-radius: .75rem;
    color: var(--muted);
    text-decoration: none;
    font-family: 'Rajdhani', sans-serif;
    font-size: .56rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.05;
  }
  .mobile-quick-nav a span:first-child {
    font-size: .9rem;
    line-height: 1;
  }
  .mobile-quick-nav a.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(124,58,237,.28), rgba(6,182,212,.18));
    box-shadow: inset 0 0 0 1px rgba(167,139,250,.25);
  }
  .hero {
    padding: 2.5rem 0 2rem;
  }
  .hero-universe-pills {
    flex-wrap: wrap;
  }
  .hero-ctas {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-ctas .btn,
  .btn-lg {
    width: 100%;
  }
  .tab-nav {
    width: 100%;
  }
  .tab-btn {
    flex: 1;
    min-width: 0;
  }
  #quiz-score-tabs { flex-wrap: wrap; }
  #toast-container {
    bottom: 6rem;
  }
}
@media (max-width: 600px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  body {
    font-size: 14px;
    padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  }
  .container { padding: 0 .85rem; }
  .card, .card-2, .modal-box { padding: 1rem; }
  .hero .tagline { font-size: .95rem; }
  .hero h1 { line-height: 1.05; }
  .hero-pill-sep { display: none; }
  .btn {
    width: auto;
    max-width: 100%;
    white-space: normal;
    min-height: 44px;
  }
  .btn-full,
  .hero-ctas .btn,
  .nav-right .btn {
    width: 100%;
  }
  .stats-bar { padding: .6rem 0; }
  .stats-bar .stat-item {
    flex-direction: column;
    align-items: flex-start;
    gap: .15rem;
  }
  .leaderboard-row {
    flex-wrap: wrap;
    align-items: center;
  }
  .lb-name {
    min-width: 0;
    width: calc(100% - 80px);
  }
  .lb-score {
    width: 100%;
    padding-left: 3.1rem;
  }
  .tx-row, .cp-row { align-items: flex-start; }
  #toast-container {
    left: .75rem;
    right: .75rem;
    bottom: 9rem;
  }
  .toast { max-width: none; }
  .mobile-quick-nav {
    left: .2rem;
    right: .2rem;
    bottom: calc(.3rem + env(safe-area-inset-bottom, 0px));
    padding: .2rem;
    gap: .15rem;
  }
  .mobile-quick-nav a {
    font-size: .5rem;
    min-height: 46px;
  }
  footer {
    margin-top: 2.5rem;
    padding: 1rem 0 1.5rem;
  }
}

/* ── Flex helpers ─────────────────────────────── */
.flex     { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2    { gap: .5rem; }
.gap-3    { gap: .75rem; }
.gap-4    { gap: 1rem; }
.flex-1   { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

/* ── Alert / badge ────────────────────────────── */
.alert {
  border-radius: .75rem;
  padding: .75rem 1rem;
  font-size: .85rem;
  margin-bottom: 1rem;
}
.alert-error  { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #f87171; }
.alert-success{ background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); color: var(--emerald); }
.alert-info   { background: rgba(145,70,255,.1); border: 1px solid rgba(145,70,255,.3); color: var(--purple-light); }

.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-family: 'Space Mono', monospace;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .2rem .6rem;
  border-radius: 999px;
  position: relative;
  white-space: nowrap;
}
.badge-animated {
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
  animation: badge-float 2.8s ease-in-out infinite;
}
.badge-animated::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,.28) 45%, transparent 72%);
  transform: translateX(-140%);
  animation: badge-shimmer 2.8s ease-in-out infinite;
}
.badge-live {
  background: rgba(16,185,129,.14) !important;
  color: #86efac !important;
  border: 1px solid rgba(16,185,129,.3) !important;
}
.badge-new {
  box-shadow: 0 8px 18px rgba(217,70,239,.16);
}
@keyframes badge-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@keyframes badge-shimmer {
  from { transform: translateX(-140%); }
  to { transform: translateX(140%); }
}

/* ── Stat card ────────────────────────────────── */
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.stat-card:hover,
.story-metric:hover {
  transform: translateY(-3px);
  border-color: rgba(145,70,255,.28);
  box-shadow: 0 14px 28px rgba(145,70,255,.10);
}
.stat-card:hover .stat-icon,
.story-metric:hover .stat-icon {
  transform: scale(1.08);
}
.stat-icon {
  width: 40px; height: 40px;
  border-radius: .6rem;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  transition: transform .18s ease;
}
.stat-val  { font-family: 'Space Mono', monospace; font-size: 1.1rem; font-weight: 700; }
.stat-label{ font-size: .75rem; color: var(--muted); margin-top: .1rem; }
.stat-hover-detail {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(3px);
  transition: max-height .18s ease, opacity .18s ease, transform .18s ease;
  font-size: .63rem;
  color: #c4b5fd;
  font-family: 'Space Mono', monospace;
  margin-top: 0;
}
.stat-card:hover .stat-hover-detail,
.story-metric:hover .stat-hover-detail {
  max-height: 2rem;
  opacity: 1;
  margin-top: .3rem;
  transform: translateY(0);
}

/* ── XP bar ───────────────────────────────────── */
.xp-bar-track {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin: .35rem 0;
}
.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--purple-light));
  border-radius: 999px;
  transition: width 1.1s cubic-bezier(.22,1,.36,1);
  position: relative;
  overflow: hidden;
}

/* ── Rank badge ───────────────────────────────── */
.rank-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-family: 'Space Mono', monospace;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .2rem .65rem;
  border-radius: 999px;
  color: #fff;
}
.rank-Bronze      { background: linear-gradient(135deg, #92400e, #b45309); }
.rank-Silver      { background: linear-gradient(135deg, #6b7280, #d1d5db); }
.rank-Gold        { background: linear-gradient(135deg, #b45309, #fbbf24); }
.rank-Platinum    { background: linear-gradient(135deg, #0e7490, #67e8f9); }
.rank-Emerald     { background: linear-gradient(135deg, #047857, #34d399); }
.rank-Ruby        { background: linear-gradient(135deg, #be123c, #fb7185); }
.rank-Diamond     { background: linear-gradient(135deg, #1d4ed8, #93c5fd); }
.rank-Master      { background: linear-gradient(135deg, var(--purple-dark), var(--accent)); box-shadow: 0 0 8px var(--accent-glow); }
.rank-Grandmaster { background: linear-gradient(135deg, #581c87, #c084fc); box-shadow: 0 0 10px rgba(192,132,252,.3); }
.rank-Mythic      { background: linear-gradient(135deg, #9f1239, #f472b6); box-shadow: 0 0 12px rgba(244,114,182,.35); }
.profile-hero-avatar {
  width: 88px;
  height: 88px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(145,70,255,.28), rgba(96,165,250,.18));
  border: 2px solid rgba(145,70,255,.65);
  box-shadow: 0 0 0 4px rgba(145,70,255,.08), 0 14px 32px rgba(145,70,255,.22);
  overflow: hidden;
}
.profile-avatar-edit {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  border: 2px solid var(--card);
  box-shadow: 0 8px 18px rgba(145,70,255,.28);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  font-size: .85rem;
}
.profile-avatar-edit:hover {
  transform: scale(1.15);
  box-shadow: 0 10px 24px rgba(145,70,255,.45);
}
.profile-xp-hero-fill {
  box-shadow: 0 0 18px rgba(145,70,255,.28);
  animation: xp-breathe 1.8s ease-in-out infinite, xp-float 2.8s ease-in-out infinite;
}
@keyframes xp-breathe {
  0%,100% { opacity: .9; filter: saturate(1); }
  50%     { opacity: 1;  filter: saturate(1.2); }
}
@keyframes xp-float {
  0%,100% { box-shadow: 0 0 18px rgba(145,70,255,.22); }
  50% { box-shadow: 0 0 24px rgba(96,165,250,.28); }
}

/* ── Pokemon card ─────────────────────────────── */
.poke-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: .75rem;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  position: relative;
}
.poke-card:hover { border-color: rgba(145,70,255,.4); transform: translateY(-2px); }
.poke-card img   { width: 80px; height: 80px; object-fit: contain; image-rendering: pixelated; }
.poke-card.shiny { border-color: rgba(251,191,36,.4); }
.poke-card .poke-name {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: .85rem;
  margin-top: .3rem;
  text-transform: capitalize;
}
.poke-card .poke-num {
  font-family: 'Space Mono', monospace;
  font-size: .65rem;
  color: var(--muted);
}
.shiny-star {
  position: absolute; top: .35rem; right: .45rem;
  font-size: .8rem;
}

/* ── Pokédex modal ────────────────────────────── */
#dex-modal {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
#dex-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
#dex-modal-card {
  position: relative; z-index: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  width: 100%; max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  animation: dex-modal-in .22s cubic-bezier(.22,1,.36,1);
}
@keyframes dex-modal-in {
  from { opacity:0; transform:scale(.93) translateY(12px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}
#dex-modal-close {
  position: absolute; top: .9rem; right: .9rem;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: .5rem;
  color: var(--muted);
  width: 2rem; height: 2rem;
  font-size: 1rem; line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
  display: flex; align-items: center; justify-content: center;
}
#dex-modal-close:hover { background: rgba(255,255,255,.14); color: #fff; }
.dex-modal-header {
  display: flex; align-items: flex-start; gap: 1.5rem;
  padding: 1.5rem 1.5rem 1rem;
}
.dex-modal-sprite-wrap {
  flex-shrink: 0;
  width: 160px; height: 160px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 1rem;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.dex-modal-sprite-wrap img {
  width: 140px; height: 140px; object-fit: contain;
  transition: opacity .2s;
}
.dex-shiny-toggle {
  position: absolute; bottom: .4rem; right: .4rem;
  background: rgba(0,0,0,.5);
  border: 1px solid rgba(251,191,36,.4);
  border-radius: .4rem;
  color: #fbbf24; font-size: .65rem; font-weight: 700;
  padding: .15rem .4rem; cursor: pointer;
  transition: background .15s;
}
.dex-shiny-toggle:hover { background: rgba(251,191,36,.15); }
.dex-cry-btn {
  flex-shrink: 0;
  background: rgba(145,70,255,.1);
  border: 1px solid rgba(145,70,255,.3);
  border-radius: .5rem;
  color: #a78bfa; font-size: .9rem;
  width: 2.1rem; height: 2.1rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s, transform .1s;
}
.dex-cry-btn:hover   { background: rgba(145,70,255,.2); }
.dex-cry-btn.playing { transform: scale(1.15); background: rgba(145,70,255,.25); border-color: rgba(145,70,255,.6); }
.dex-modal-info { flex: 1; min-width: 0; }
.dex-modal-num  { font-family:'Space Mono',monospace; font-size:.75rem; color:var(--muted); margin-bottom:.2rem; }
.dex-modal-name { font-family:'Rajdhani',sans-serif; font-size:2rem; font-weight:700; text-transform:capitalize; line-height:1.1; margin-bottom:.5rem; }
.dex-modal-types { display:flex; gap:.35rem; flex-wrap:wrap; margin-bottom:.75rem; }
.dex-rarity-badge {
  display: inline-flex; align-items: center; gap:.3rem;
  font-size:.7rem; font-weight:700;
  padding:.2rem .6rem; border-radius:.4rem;
  margin-bottom:.75rem;
}
.dex-info-row { display:flex; gap:1rem; flex-wrap:wrap; font-size:.8rem; color:var(--muted); margin-bottom:.5rem; }
.dex-info-row span strong { color:#e2e8f0; }
.dex-ball-info { font-size:.78rem; color:var(--muted); }
.dex-modal-body { padding: 0 1.5rem 1.5rem; }
.dex-section-title {
  font-size:.7rem; font-weight:700; text-transform:uppercase;
  letter-spacing:.1em; color:var(--muted);
  margin: 1rem 0 .6rem;
}
.dex-stat-row { display:flex; align-items:center; gap:.75rem; margin-bottom:.45rem; }
.dex-stat-name { font-size:.72rem; color:var(--muted); width:72px; flex-shrink:0; text-align:right; }
.dex-stat-val  { font-family:'Space Mono',monospace; font-size:.72rem; font-weight:700; width:28px; flex-shrink:0; text-align:right; color:#e2e8f0; }
.dex-stat-bar-bg { flex:1; height:6px; background:rgba(255,255,255,.07); border-radius:999px; overflow:hidden; }
.dex-stat-bar-fill { height:100%; border-radius:999px; transition:width .5s .1s; }
.dex-description {
  font-size:.82rem; line-height:1.6; color:#cbd5e1;
  background:rgba(255,255,255,.03);
  border:1px solid var(--border);
  border-radius:.6rem;
  padding:.75rem 1rem;
  margin-top:.5rem;
  font-style: italic;
}
.dex-abilities { display:flex; gap:.5rem; flex-wrap:wrap; }
.dex-ability-tag {
  background:rgba(145,70,255,.12);
  border:1px solid rgba(145,70,255,.25);
  border-radius:.4rem;
  padding:.15rem .55rem;
  font-size:.72rem; font-weight:600; color:#a78bfa;
  text-transform:capitalize;
}

/* ── Type badges ──────────────────────────────── */
.type-badge {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .1rem .5rem;
  border-radius: .3rem;
  color: #fff;
}
.type-fire     { background: #e25d2a; }
.type-water    { background: #3a91d3; }
.type-grass    { background: #3fa129; }
.type-electric { background: #c7a011; }
.type-psychic  { background: #d0336e; }
.type-ice      { background: #5fa6b8; }
.type-dragon   { background: #4c31d9; }
.type-dark     { background: #3b3148; }
.type-fairy    { background: #c778c3; }
.type-normal   { background: #787060; }
.type-fighting { background: #912c2c; }
.type-flying   { background: #7291cc; }
.type-poison   { background: #7a2e8c; }
.type-ground   { background: #b87d2e; }
.type-rock     { background: #7b6f3a; }
.type-bug      { background: #6b8e23; }
.type-ghost    { background: #4e3f89; }
.type-steel    { background: #7d8c99; }

/* ── Modal ────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-overlay.open .modal-box { transform: translateY(0); opacity: 1; }
.modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 2rem 2.25rem;
  max-width: 420px;
  max-height: min(88vh, 760px);
  width: 100%;
  transform: translateY(24px);
  opacity: 0;
  transition: transform .3s cubic-bezier(.175,.885,.32,1.275), opacity .25s ease;
  box-shadow:
    0 0 60px rgba(145,70,255,.12),
    0 24px 48px rgba(0,0,0,.5);
  position: relative;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--purple), var(--purple-light), var(--fuchsia));
  border-radius: 1.25rem 1.25rem 0 0;
}

/* ── Login modal specific ─────────────────────── */
#login-modal .modal-box h2 {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text);
  margin-bottom: .3rem;
}
#login-modal .modal-box label {
  font-size: .78rem;
  color: var(--muted);
  display: block;
  margin-bottom: .35rem;
  font-weight: 500;
  letter-spacing: .02em;
}
#login-modal .modal-box input[type="text"],
#login-modal .modal-box input[type="password"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: .6rem;
  color: var(--text);
  padding: .65rem 1rem;
  font-family: 'Inter', sans-serif;
  font-size: .88rem;
  outline: none;
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
#login-modal .modal-box input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(145,70,255,.15);
}
#login-modal .modal-box input::placeholder {
  color: var(--muted);
  opacity: .6;
}
#login-error {
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.2);
  border-radius: .5rem;
  padding: .5rem .75rem;
  color: var(--red) !important;
  font-size: .8rem;
  text-align: center;
  animation: shakeX .35s ease;
}
@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
#login-modal .btn-primary.btn-full {
  padding: .7rem 1rem;
  font-size: .9rem;
  letter-spacing: .08em;
  border-radius: .6rem;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  box-shadow: 0 4px 16px rgba(145,70,255,.3);
  transition: transform .15s, box-shadow .15s, background .15s;
}
#login-modal .btn-primary.btn-full:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(145,70,255,.4);
  background: linear-gradient(135deg, var(--purple-light), var(--purple));
}
#login-modal .btn-primary.btn-full:active:not(:disabled) {
  transform: translateY(0);
}
#login-modal .btn-ghost.btn-full {
  padding: .55rem 1rem;
  font-size: .82rem;
  border-radius: .6rem;
}
#login-modal p a {
  color: var(--purple-light);
  text-decoration: none;
  font-weight: 600;
  transition: color .15s;
}
#login-modal p a:hover {
  color: var(--purple);
  text-decoration: underline;
}

/* ── Toast ────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 6rem; right: 1.5rem;
  z-index: 300;
  display: flex; flex-direction: column; gap: .55rem;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px) scale(.96); }
  to   { opacity: 1; transform: translateX(0)    scale(1); }
}
.toast {
  background: rgba(17,17,34,.92);
  border: 1px solid rgba(255,255,255,.08);
  border-left: 3px solid var(--muted);
  border-radius: .8rem;
  padding: .7rem 1rem .7rem 1rem;
  font-size: .84rem;
  animation: toastIn .22s cubic-bezier(.22,1,.36,1) both;
  max-width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  line-height: 1.45;
}
.toast.success {
  border-color: rgba(52,211,153,.18);
  border-left-color: #34d399;
  background: rgba(16,50,35,.88);
}
.toast.error {
  border-color: rgba(239,68,68,.2);
  border-left-color: #ef4444;
  background: rgba(50,16,16,.88);
}
.toast.info {
  border-color: rgba(145,70,255,.2);
  border-left-color: var(--purple);
  background: rgba(20,12,40,.88);
}

/* ── Page loading state ───────────────────────── */
.page-loading {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 60vh;
  gap: 1rem;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(145,70,255,.2);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ── Hero section ─────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 4rem 0 3rem;
  text-align: center;
}
.hero::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 900px; height: 520px;
  background:
    radial-gradient(ellipse at 40% 50%, rgba(124,58,237,.26) 0%, transparent 55%),
    radial-gradient(ellipse at 65% 50%, rgba(224,64,251,.15) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 65%, rgba(0,212,255,.1)  0%, transparent 45%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, rgba(124,58,237,.55) 35%, rgba(224,64,251,.7) 50%, rgba(124,58,237,.55) 65%, transparent 95%);
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: .75rem;
}
.hero .tagline {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto 1.75rem;
}
.hero-universe-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-bottom: 1.1rem;
}
.hero-pill {
  font-size: .78rem;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--purple);
  background: rgba(145,70,255,.1);
  border: 1px solid rgba(145,70,255,.25);
  padding: .2rem .65rem;
  border-radius: 99px;
}
.hero-pill-sep {
  color: var(--border);
  font-size: .9rem;
  user-select: none;
}
.hero-claim {
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  color: var(--text);
  margin: 0 auto .6rem;
  letter-spacing: .01em;
}
.hero-ctas { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

.hero-compact { padding: 1.5rem 0 1.25rem; }
.hero-compact h1 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); margin-bottom: .3rem; }
.hero-compact .tagline { font-size: .88rem; margin-bottom: 0; }

/* ── Stats bar ────────────────────────────────── */
.stats-bar {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: .75rem 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.stats-bar::-webkit-scrollbar { display: none; }
.stats-bar .stat-item {
  display: flex; align-items: center; gap: .5rem;
  flex-shrink: 0;
}
.stats-bar .stat-item .val {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: .9rem;
  color: var(--text);
}
.stats-bar .stat-item .lbl {
  font-size: .75rem;
  color: var(--muted);
}
.stats-bar .divider {
  width: 1px; height: 24px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── Games grid card ──────────────────────────── */
/* ── Game cards ─────────────────────────────────── */
@keyframes card-shine {
  0%   { transform: translateX(-120%) skewX(-15deg); }
  100% { transform: translateX(220%)  skewX(-15deg); }
}
@keyframes float-emoji {
  0%,100% { transform: scale(1.22) translateY(-4px); }
  50%      { transform: scale(1.22) translateY(-10px); }
}
@keyframes glow-pulse {
  0%,100% { opacity: .55; }
  50%      { opacity: 1; }
}
@keyframes border-spin {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.game-card {
  --card-accent: #9146ff;
  --card-accent-2: #bf94ff;
  --card-ring: rgba(145,70,255,.6);
  --card-glow: rgba(145,70,255,.35);
  --card-sheen: rgba(145,70,255,.28);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  overflow: hidden;
  transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s, border-color .35s;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  isolation: isolate;
}

.game-card.card-anime {
  --card-accent: #8b5cf6;
  --card-accent-2: #ec4899;
  --card-ring: rgba(139,92,246,.62);
  --card-glow: rgba(139,92,246,.34);
  --card-sheen: rgba(236,72,153,.18);
}
.game-card.card-pokemon {
  --card-accent: #3b82f6;
  --card-accent-2: #facc15;
  --card-ring: rgba(59,130,246,.62);
  --card-glow: rgba(59,130,246,.32);
  --card-sheen: rgba(250,204,21,.18);
}
.game-card.card-pirate {
  --card-accent: #f97316;
  --card-accent-2: #fb923c;
  --card-ring: rgba(249,115,22,.62);
  --card-glow: rgba(249,115,22,.34);
  --card-sheen: rgba(251,146,60,.18);
}
.game-card.card-quiz {
  --card-accent: #a855f7;
  --card-accent-2: #22d3ee;
  --card-ring: rgba(168,85,247,.62);
  --card-glow: rgba(168,85,247,.32);
  --card-sheen: rgba(34,211,238,.16);
}
.game-card.card-football {
  --card-accent: #16a34a;
  --card-accent-2: #22c55e;
  --card-ring: rgba(22,163,74,.62);
  --card-glow: rgba(22,163,74,.34);
  --card-sheen: rgba(34,197,94,.16);
}
.game-card.card-rewards {
  --card-accent: #f59e0b;
  --card-accent-2: #f97316;
  --card-ring: rgba(245,158,11,.62);
  --card-glow: rgba(245,158,11,.34);
  --card-sheen: rgba(249,115,22,.16);
}

/* animated gradient border on hover via outline trick */
.game-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 1.3rem;
  background: conic-gradient(from 0deg, var(--card-accent), var(--card-accent-2), #ffffff, var(--card-accent));
  background-size: 200% 200%;
  opacity: 0;
  z-index: -1;
  transition: opacity .35s;
  animation: border-spin 3s linear infinite;
}
.game-card:hover::after { opacity: 1; }

/* inner glow overlay — top half only so body text stays readable */
.game-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 55%;
  background: radial-gradient(ellipse at 50% 0%, var(--card-sheen) 0%, transparent 80%);
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
  z-index: 1;
}
.game-card:hover {
  border-color: transparent;
  transform: translateY(-8px) scale(1.025);
  box-shadow:
    0 0 0 1px var(--card-ring),
    0 8px 24px var(--card-glow),
    0 24px 56px var(--card-glow),
    0 2px 8px rgba(0,0,0,.5);
}
.game-card:hover::before { opacity: 1; }

/* shine sweep */
.game-card .card-shine {
  position: absolute;
  top: 0; left: 0;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent);
  transform: translateX(-120%) skewX(-15deg);
  pointer-events: none;
  z-index: 5;
}
.game-card:hover .card-shine {
  animation: card-shine .65s ease forwards;
}

.game-card-banner {
  height: 120px;
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem;
  position: relative;
  overflow: hidden;
  transition: height .35s cubic-bezier(.22,1,.36,1);
}
.game-card-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5,8,18,.18), rgba(5,8,18,.34));
  pointer-events: none;
}
.game-card:hover .game-card-banner { height: 130px; }

/* ambient glow under emoji */
.game-card-banner::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%; transform: translateX(-50%);
  width: 80px; height: 40px;
  border-radius: 50%;
  background: var(--card-glow);
  filter: blur(18px);
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
}
.game-card:hover .game-card-banner::after {
  opacity: 1;
  animation: glow-pulse 1.8s ease-in-out infinite;
}

.game-card-banner .banner-emoji {
  transition: transform .35s cubic-bezier(.22,1,.36,1), filter .35s, letter-spacing .35s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .18em;
  position: relative;
  z-index: 2;
  font-size: 2.9rem;
  letter-spacing: .02em;
  text-shadow: 0 4px 16px rgba(0,0,0,.28), 0 0 18px rgba(255,255,255,.08);
  padding: .2rem .45rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 26px rgba(0,0,0,.16);
  backdrop-filter: blur(4px);
}
.game-card:hover .banner-emoji {
  animation: float-emoji 2.2s ease-in-out infinite;
  filter: drop-shadow(0 0 12px var(--card-glow)) drop-shadow(0 4px 20px var(--card-glow));
  letter-spacing: .05em;
  transform: scale(1.06) translateY(-2px);
}

.game-card-preview {
  background: rgba(145,70,255,.08);
  border-bottom: 1px solid rgba(145,70,255,.15);
  padding: .32rem .9rem;
  font-size: .67rem;
  color: rgba(255,255,255,.55);
  font-family: 'Space Mono', monospace;
  display: flex;
  gap: .5rem;
  align-items: center;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .32s cubic-bezier(.22,1,.36,1), opacity .28s, padding .32s;
  padding-top: 0; padding-bottom: 0;
}
.game-card:hover .game-card-preview {
  max-height: 2rem;
  opacity: 1;
  padding-top: .32rem;
  padding-bottom: .32rem;
}

.game-card-preview-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--emerald); flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}

.game-card-body {
  padding: 1rem 1.1rem .75rem;
  position: relative; z-index: 2;
  background: linear-gradient(to bottom, rgba(7,10,20,.82) 0%, rgba(10,13,24,.96) 26%, var(--card) 100%);
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: .2rem;
}
.game-card-title {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: .25rem;
  transition: color .25s;
}
.game-card:hover .game-card-title { color: #fff; }
.game-card-desc {
  font-size: .8rem;
  color: #c6cdea;
  line-height: 1.5;
  text-shadow: 0 1px 1px rgba(0,0,0,.2);
}
.game-card:hover .game-card-desc { color: #eef2ff; }

.game-card-footer {
  padding: .7rem 1.1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .4rem .5rem;
  position: relative; z-index: 2;
  transition: border-color .35s;
  background: rgba(7,10,20,.72);
  margin-top: auto;
}
.game-card:hover .game-card-footer { border-color: rgba(145,70,255,.25); }

.home-featured-section {
  margin-bottom: 2.6rem;
}
.home-featured-grid,
.home-games-grid {
  align-items: stretch;
  gap: 1.25rem !important;
}
.home-category-trigger {
  width: 100%;
  padding: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}
.home-category-trigger:focus-visible {
  outline: 2px solid rgba(167,139,250,.85);
  outline-offset: 3px;
}
.anime-games-modal-box {
  max-width: min(1100px, 96vw);
  width: 100%;
}
.anime-games-modal-grid {
  align-items: stretch;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
}
.home-games-grid {
  margin-bottom: 2.6rem;
}
#home-grid {
  gap: 2rem !important;
  margin-top: .5rem;
}

.game-card-play {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--purple);
  color: #fff;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .35rem .9rem;
  border-radius: 2rem;
  white-space: nowrap;
  transition: background .25s, transform .25s, box-shadow .25s;
  position: relative;
  overflow: hidden;
}
.game-card-play::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.18) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform .4s;
}
.game-card:hover .game-card-play {
  background: #9146ff;
  transform: scale(1.08);
  box-shadow: 0 0 16px rgba(145,70,255,.7), 0 4px 20px rgba(145,70,255,.45);
}
.game-card:hover .game-card-play::before { transform: translateX(100%); }
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  animation: pulse 2s ease-in-out infinite;
  display: inline-block;
}
.twitch-carousel::-webkit-scrollbar { display: none; }
.sc-arrow {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,#9147ff,#7c3aed);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(145,70,255,.45);
  transition: transform .15s, box-shadow .15s;
}
.sc-arrow:hover { transform: scale(1.08); box-shadow: 0 2px 14px rgba(145,70,255,.7); }
.sc-arrow:active { transform: scale(.96); }
/* ── Language toggle ── */
.lang-toggle { display:flex;align-items:center;gap:.3rem;margin-right:.5rem; }
.lang-btn { background:none;border:none;cursor:pointer;color:var(--muted);font-weight:700;font-size:.75rem;font-family:'Rajdhani',sans-serif;letter-spacing:.04em;padding:.2rem .3rem;border-radius:.3rem;transition:color .15s; }
.lang-btn.active { color:#fff; }
.lang-btn:hover { color:var(--text); }
.lang-sep { color:var(--border);font-size:.7rem;user-select:none; }

/* ── Leaderboard ──────────────────────────────── */
.leaderboard-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 0;
  border-bottom: 1px solid rgba(35,35,56,.7);
}
.leaderboard-row:last-child { border-bottom: none; }
.lb-rank {
  font-family: 'Space Mono', monospace;
  font-size: .8rem;
  font-weight: 700;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.lb-rank.gold   { color: var(--yellow); filter: drop-shadow(0 0 5px rgba(251,191,36,.6)); }
.lb-rank.silver { color: #d1d5db; }
.lb-rank.bronze { color: #b87333; }
.lb-avatar {
  width: 32px; height: 32px;
  border-radius: .5rem;
  background: var(--purple);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: .9rem;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}
.lb-name { font-family: 'Rajdhani', sans-serif; font-weight: 700; flex: 1; }
.lb-score {
  font-family: 'Space Mono', monospace;
  font-size: .78rem;
  color: var(--purple-light);
  font-weight: 700;
}

/* ── Pokemon types color variables ───────────────*/
.bg-grid {
  background-image:
    linear-gradient(rgba(145,70,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(145,70,255,.04) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ── Channel points widget ────────────────────── */
.cp-row {
  display: flex; align-items: center;
  padding: .6rem 0;
  gap: .75rem;
  border-bottom: 1px solid var(--border);
}
.cp-row:last-child { border-bottom: none; }
.cp-icon { font-size: 1.1rem; flex-shrink: 0; }
.cp-label { font-size: .85rem; flex: 1; }
.cp-cost {
  font-family: 'Space Mono', monospace;
  font-size: .75rem;
  color: var(--yellow);
  font-weight: 700;
}

/* ── Quiz ─────────────────────────────────────── */
.quiz-hero {
  position: relative;
  overflow: hidden;
}
.quiz-hero .container {
  position: relative;
}
.quiz-hero h1 {
  animation: quiz-title-glow 3s ease-in-out infinite;
}
.quiz-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.q-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(145,70,255,.7);
  box-shadow: 0 0 14px rgba(145,70,255,.45);
  animation: quiz-float 7s ease-in-out infinite;
  opacity: .35;
}
.qp1 { left: 10%; top: 62%; animation-delay: 0s; }
.qp2 { left: 22%; top: 28%; width: 5px; height: 5px; background: rgba(59,130,246,.8); animation-delay: .8s; }
.qp3 { left: 48%; top: 72%; width: 6px; height: 6px; background: rgba(251,191,36,.8); animation-delay: 1.4s; }
.qp4 { left: 66%; top: 24%; animation-delay: 2s; }
.qp5 { left: 82%; top: 56%; width: 5px; height: 5px; background: rgba(16,185,129,.85); animation-delay: 1.1s; }
.qp6 { left: 90%; top: 18%; width: 4px; height: 4px; animation-delay: 2.5s; }
@keyframes quiz-float {
  0%,100% { transform: translateY(0) scale(.9); opacity: .2; }
  50%     { transform: translateY(-16px) scale(1.15); opacity: .75; }
}
@keyframes quiz-title-glow {
  0%,100% { text-shadow: 0 0 0 rgba(145,70,255,0); }
  50%     { text-shadow: 0 0 22px rgba(145,70,255,.28); }
}
.quiz-image-wrap {
  position: relative;
  width: 240px; height: 240px;
  margin: 0 auto;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 0 0 1px rgba(145,70,255,.15), 0 0 32px rgba(145,70,255,.12);
}
.quiz-image-wrap::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -35%;
  height: 38%;
  background: linear-gradient(180deg, transparent, rgba(96,165,250,.2), transparent);
  animation: quiz-scan 2.4s linear infinite;
  pointer-events: none;
  z-index: 2;
}
.quiz-image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 100%, rgba(145,70,255,.12), transparent 65%);
  animation: glow-pulse 2.2s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}
@keyframes quiz-scan {
  0%   { transform: translateY(0); opacity: 0; }
  15%  { opacity: .85; }
  100% { transform: translateY(310px); opacity: 0; }
}
.quiz-image-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  image-rendering: auto;
  transition: filter 1s ease, transform .5s ease;
  animation: quiz-art-bob 2.8s ease-in-out infinite;
  position: relative;
  z-index: 0;
}
@keyframes quiz-art-bob {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-4px); }
}
.quiz-timer-bar {
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  margin: 1rem 0;
}
.quiz-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--purple-light));
  border-radius: 999px;
  transition: width .1s linear, background .5s;
}
.quiz-timer-fill.danger { background: linear-gradient(90deg, var(--red), #f87171); }

.category-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  display: block;
  width: 100%;
  padding: 0;
  text-decoration: none;
  position: relative;
  isolation: isolate;
  transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s, border-color .35s;
  z-index: 0;
}
.category-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 1.3rem;
  background: conic-gradient(from 0deg, #9146ff, #bf94ff, #6441a5, #9146ff);
  opacity: 0;
  z-index: -1;
  transition: opacity .35s;
  animation: border-spin 3s linear infinite;
}
.category-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 55%;
  background: radial-gradient(ellipse at 50% 0%, rgba(145,70,255,.3) 0%, transparent 80%);
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
  z-index: 1;
}
.category-card:hover { text-decoration: none; }
.category-card:hover,
.category-card:not([data-disabled="true"]):hover {
  border-color: transparent;
  transform: translateY(-8px) scale(1.025);
  box-shadow:
    0 0 0 1px rgba(145,70,255,.6),
    0 8px 24px rgba(145,70,255,.35),
    0 24px 56px rgba(145,70,255,.2),
    0 2px 8px rgba(0,0,0,.5);
}
.category-card[data-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.category-card:hover::after  { opacity: 1; }
.category-card:hover::before { opacity: 1; }

.category-card .card-shine {
  position: absolute;
  top: 0; left: 0;
  width: 45%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent);
  transform: translateX(-120%) skewX(-15deg);
  pointer-events: none;
  z-index: 5;
}
.category-card:hover .card-shine { animation: card-shine .65s ease forwards; }

.category-card .cat-banner {
  height: 136px;
  min-height: 136px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: height .35s cubic-bezier(.22,1,.36,1), min-height .35s;
}
.category-card:hover .cat-banner { height: 150px; min-height: 150px; }

.category-card .cat-banner::after {
  content: '';
  position: absolute;
  bottom: -8px; left: 50%; transform: translateX(-50%);
  width: 80px; height: 40px;
  border-radius: 50%;
  background: var(--cat-glow, rgba(145,70,255,.5));
  filter: blur(18px);
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
}
.category-card:hover .cat-banner::after {
  opacity: 1;
  animation: glow-pulse 1.8s ease-in-out infinite;
}

.category-card .cat-art {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
}
.category-card .cat-art-icon {
  font-size: 4.8rem;
  line-height: 1;
  opacity: .88;
  transition: transform .35s cubic-bezier(.22,1,.36,1), filter .35s ease, opacity .35s ease;
  animation: float-emoji 2.8s ease-in-out infinite;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.category-card .art-pokemon .cat-art-icon {
  width: 96px;
  height: 96px;
  font-size: 0;
  background: url('https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/25.png') center/contain no-repeat;
  filter: brightness(0) blur(7px) drop-shadow(0 0 10px rgba(255,203,5,.18));
}
.category-card .art-anime .cat-art-icon {
  filter: blur(6px) saturate(.2) drop-shadow(0 0 12px rgba(224,64,251,.18));
}
.category-card .art-gaming .cat-art-icon {
  filter: blur(5px) saturate(.55) drop-shadow(0 0 12px rgba(16,185,129,.18));
}
.category-card:hover .cat-art-icon,
.category-card.selected .cat-art-icon {
  transform: scale(1.12);
  opacity: 1;
}
.category-card:hover .art-pokemon .cat-art-icon,
.category-card.selected .art-pokemon .cat-art-icon {
  filter: brightness(0) blur(2px) drop-shadow(0 0 18px rgba(255,203,5,.35));
}
.category-card:hover .art-anime .cat-art-icon,
.category-card.selected .art-anime .cat-art-icon {
  filter: blur(2px) saturate(.5) drop-shadow(0 0 18px rgba(224,64,251,.35));
}
.category-card:hover .art-gaming .cat-art-icon,
.category-card.selected .art-gaming .cat-art-icon {
  filter: blur(2px) saturate(.85) drop-shadow(0 0 18px rgba(16,185,129,.35));
}

.category-card .banner-emoji {
  font-size: 1rem;
  position: absolute;
  top: .65rem;
  right: .65rem;
  z-index: 3;
  transition: transform .35s cubic-bezier(.22,1,.36,1), filter .35s;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(5,8,24,.45);
  border: 1px solid rgba(255,255,255,.08);
}
.category-card:hover .banner-emoji {
  transform: scale(1.08);
  filter: drop-shadow(0 0 10px var(--cat-glow, rgba(145,70,255,.7)));
}
.category-card .cat-hover-cta {
  position: absolute;
  left: 50%;
  bottom: .7rem;
  transform: translateX(-50%) translateY(8px);
  z-index: 3;
  opacity: 0;
  font-family: 'Rajdhani', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(8,12,28,.72);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: .28rem .65rem;
  transition: opacity .25s ease, transform .25s ease;
}
.category-card:hover .cat-hover-cta,
.category-card.selected .cat-hover-cta {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.category-card .cat-preview {
  background: rgba(255,255,255,.05);
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 0 1rem;
  font-size: .68rem;
  color: rgba(255,255,255,.5);
  font-family: 'Space Mono', monospace;
  display: flex;
  gap: .5rem;
  align-items: center;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .32s cubic-bezier(.22,1,.36,1), opacity .28s, padding .3s;
}
.category-card:hover .cat-preview {
  max-height: 2rem;
  opacity: 1;
  padding-top: .32rem;
  padding-bottom: .32rem;
}

.category-card .cat-body {
  padding: .9rem 1.1rem .75rem;
  position: relative; z-index: 2;
  background: linear-gradient(to bottom, transparent, var(--card) 25%);
}
.category-card .cat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}
.category-card .cat-title {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text);
  margin-bottom: .25rem;
  transition: color .25s;
}
.category-card .cat-difficulty {
  font-family: 'Space Mono', monospace;
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-radius: 999px;
  padding: .2rem .45rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.category-card:hover .cat-title { color: #fff; }
.category-card .cat-sub {
  font-size: .78rem;
  color: #8b91b0;
  line-height: 1.4;
}
.category-card:hover .cat-sub { color: #b0b6d4; }

.category-card .cat-footer {
  padding: .6rem .9rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  position: relative; z-index: 2;
  transition: border-color .35s;
}
.category-card:hover .cat-footer { border-color: rgba(145,70,255,.25); }
.category-card.selected {
  border-color: transparent;
  transform: translateY(-10px) scale(1.035);
  box-shadow:
    0 0 0 1px rgba(145,70,255,.75),
    0 0 0 4px rgba(145,70,255,.14),
    0 10px 28px rgba(145,70,255,.4),
    0 28px 64px rgba(145,70,255,.26),
    0 2px 8px rgba(0,0,0,.5);
}
.category-card.selected::after,
.category-card.selected::before { opacity: 1; }
.category-card.selected::after { animation-duration: 1.6s; }
.category-card.selected .cat-banner { height: 150px; min-height: 150px; }
.category-card.selected .cat-banner::after {
  opacity: 1;
  animation: glow-pulse 1.2s ease-in-out infinite;
}
.category-card .cat-selected-ribbon {
  position: absolute;
  left: .7rem;
  top: .7rem;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .28rem .55rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(16,185,129,.9), rgba(74,222,128,.9));
  color: #041208;
  font-family: 'Rajdhani', sans-serif;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(16,185,129,.28);
  animation: selected-badge-pop .45s ease;
}
@keyframes selected-badge-pop {
  0%   { transform: scale(.85) translateY(-4px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.category-card .game-card-play {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
  font-family: 'Rajdhani', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #fff;
}
.category-card:hover .game-card-play,
.category-card.selected .game-card-play {
  opacity: 1;
  transform: translateY(0);
}
.quiz-launch-wrap {
  margin-top: 1.35rem;
  text-align: center;
}
.quiz-launch-btn {
  min-width: min(100%, 360px);
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: .06em;
  box-shadow:
    0 0 0 1px rgba(145,70,255,.25),
    0 12px 30px rgba(145,70,255,.28);
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  animation: quiz-cta-pulse 1.8s ease-in-out infinite;
}
.quiz-launch-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.12) 45%, transparent 100%);
  transform: translateX(-120%);
  animation: quiz-cta-charge 2.2s linear infinite;
  pointer-events: none;
  z-index: 0;
}
.quiz-launch-btn::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(145,70,255,.28), transparent 65%);
  z-index: 0;
  opacity: .7;
  animation: glow-pulse 1.8s ease-in-out infinite;
  pointer-events: none;
}
.quiz-launch-energy,
.quiz-launch-text {
  position: relative;
  z-index: 1;
}
.quiz-launch-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
}
@keyframes quiz-cta-pulse {
  0%,100% { transform: scale(1); box-shadow: 0 0 0 1px rgba(145,70,255,.25), 0 12px 30px rgba(145,70,255,.28); }
  50%     { transform: scale(1.015); box-shadow: 0 0 0 1px rgba(145,70,255,.42), 0 16px 42px rgba(145,70,255,.4); }
}
@keyframes quiz-cta-charge {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}
.quiz-launch-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 0 0 1px rgba(145,70,255,.45),
    0 18px 46px rgba(145,70,255,.42);
}
.quiz-launch-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  animation: none;
}
.quiz-launch-btn:disabled::before,
.quiz-launch-btn:disabled::after {
  animation: none;
}

/* ── Auth callback ────────────────────────────── */
.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 2.5rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 80px rgba(145,70,255,.1);
  animation: slideUp .3s ease both;
}
.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 1rem;
}
.progress-fill {
  height: 100%;
  background: var(--purple);
  border-radius: 999px;
  animation: pulse 1.4s ease-in-out infinite;
  width: 65%;
}

/* ── Capture arena ────────────────────────────── */
.encounter-sprite {
  width: 160px; height: 160px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 20px rgba(145,70,255,.3));
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
.ball-btn {
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .75rem;
  padding: .6rem .9rem;
  cursor: pointer;
  transition: all .15s;
  font-size: .72rem;
  font-family: 'Space Mono', monospace;
  color: var(--muted);
}
.ball-btn:hover:not(:disabled) { border-color: var(--purple); color: var(--text); }
.ball-btn:disabled { opacity: .4; cursor: not-allowed; }
.ball-btn .ball-emoji { font-size: 1.4rem; }
.ball-btn .ball-cost  { color: var(--yellow); font-weight: 700; }
.ball-btn .ball-price { color: var(--muted); font-size: .65rem; }

/* ── Capture animation ────────────────────────── */
.capture-anim {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 2rem; gap: 1rem;
  min-height: 200px;
}
.shake {
  animation: shake .5s ease;
}
@keyframes shake {
  0%,100% { transform: rotate(0); }
  20%  { transform: rotate(-10deg); }
  40%  { transform: rotate(10deg); }
  60%  { transform: rotate(-8deg); }
  80%  { transform: rotate(8deg); }
}

/* ── Scrollbar ────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple); }

/* ── Footer ───────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: 4rem;
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
}

/* ── Misc utilities ───────────────────────────── */
.text-purple  { color: var(--purple); }
.text-muted   { color: var(--muted); }
.text-emerald { color: var(--emerald); }
.text-yellow  { color: var(--yellow); }
.text-red     { color: var(--red); }
.text-blue    { color: var(--blue); }
.text-orange  { color: var(--orange); }
.text-fuchsia { color: var(--fuchsia); }
.text-cyan    { color: var(--cyan); }
.text-white   { color: var(--text); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-sm      { font-size: .85rem; }
.text-xs      { font-size: .75rem; }
.capitalize   { text-transform: capitalize; }
.uppercase    { text-transform: uppercase; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.hidden { display: none !important; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Profile hero ─────────────────────────────── */
.profile-hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.profile-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 70% at 0% 50%, rgba(145,70,255,.1), transparent);
  pointer-events: none;
}
.avatar-lg {
  width: 72px; height: 72px;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--purple-dark), var(--purple-light));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(145,70,255,.3);
}

/* ── Wallet mood ─────────────────────────────── */
.wallet-balance-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(251,191,36,.10), rgba(145,70,255,.08));
  border: 1px solid rgba(251,191,36,.18);
  box-shadow: 0 14px 32px rgba(251,191,36,.08);
  transition: transform .18s ease, box-shadow .18s ease;
}
.wallet-balance-panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(251,191,36,.12);
}
.wallet-coin-orb {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: linear-gradient(135deg, rgba(251,191,36,.25), rgba(245,158,11,.08));
  border: 1px solid rgba(251,191,36,.25);
  box-shadow: 0 10px 22px rgba(251,191,36,.14);
  animation: walletFloat 2.6s ease-in-out infinite;
}
.wallet-trend-pills {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
}
.wallet-trend-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .7rem;
  border-radius: 999px;
  font-family: 'Space Mono', monospace;
  font-size: .72rem;
  border: 1px solid transparent;
}
.wallet-trend-pill.gain {
  color: var(--emerald);
  background: rgba(16,185,129,.10);
  border-color: rgba(16,185,129,.24);
}
.wallet-trend-pill.loss {
  color: #fca5a5;
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.24);
}
@keyframes walletFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px) scale(1.03); }
}

.profile-shell {
  display: grid;
  gap: 1.5rem;
}

.profile-top-grid {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 1.5rem;
  align-items: flex-start;
}

.profile-main-card {
  flex: 1 1 0 !important;
  min-width: 0 !important;
}

.profile-wallet-card {
  flex: 0 0 340px !important;
  width: 340px !important;
  min-width: 0 !important;
  position: sticky;
  top: 5.75rem;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.profile-stats-grid .stat-card:last-child {
  grid-column: 1 / -1;
}

.profile-stats-grid .stat-card {
  padding: .8rem;
  gap: .6rem;
}

.profile-stats-grid .stat-icon {
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
}

.profile-stats-grid .stat-val {
  font-size: 1rem;
}

.profile-stats-grid .stat-label {
  font-size: .72rem;
  white-space: normal;
  word-break: break-word;
}

.profile-history-list {
  max-height: 460px;
  overflow-y: auto;
  padding-right: .25rem;
  display: grid;
  gap: .55rem;
}

.profile-history-list::-webkit-scrollbar {
  width: 8px;
}

.profile-history-list::-webkit-scrollbar-thumb {
  background: rgba(145,70,255,.24);
  border-radius: 999px;
}

.profile-history-list .tx-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .85rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border-radius: .95rem;
  border: 1px solid rgba(255,255,255,.06);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(145,70,255,.03));
}

.profile-history-main {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
}

.profile-history-icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: .85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(145,70,255,.16);
  border: 1px solid rgba(145,70,255,.24);
  font-size: 1.1rem;
}

.profile-history-copy {
  min-width: 0;
}

.profile-history-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
}

.profile-history-meta {
  margin-top: .2rem;
  font-size: .78rem;
  color: var(--muted);
}

.profile-history-amount {
  text-align: right;
  white-space: nowrap;
  font-weight: 700;
  font-size: 1rem;
}

@media (max-width: 640px) {
  .profile-top-grid {
    flex-wrap: wrap !important;
    gap: .75rem !important;
  }

  .profile-main-card {
    flex: 1 1 280px !important;
  }

  .profile-wallet-card {
    flex: 1 1 280px !important;
    width: auto !important;
    position: static;
  }
}

@media (max-width: 480px) {
  .profile-top-grid {
    flex-direction: column !important;
    gap: 1rem !important;
  }

  .profile-main-card,
  .profile-wallet-card {
    flex: none !important;
    width: 100% !important;
  }
}

@media (max-width: 720px) {
  .profile-stats-grid {
    grid-template-columns: 1fr;
  }

  .profile-history-list .tx-row {
    grid-template-columns: 1fr;
  }

  .profile-history-amount {
    text-align: left;
  }
}

.profile-story-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.story-card {
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(145,70,255,.03));
  border: 1px solid rgba(145,70,255,.14);
  border-radius: 1rem;
  padding: 1rem;
}
.story-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .9rem;
  flex-wrap: wrap;
}
.story-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.story-metric {
  padding: .8rem;
  border-radius: .9rem;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.story-metric::before,
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at top right, rgba(96,165,250,.12), transparent 48%);
  transition: opacity .18s ease;
}
.story-metric:hover::before,
.stat-card:hover::before {
  opacity: 1;
}
.countup-value {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}
.story-progress-track {
  height: .6rem;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.06);
}
.story-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple-light), #60a5fa);
}
.daily-goals-card {
  background: linear-gradient(180deg, rgba(145,70,255,.06), rgba(59,130,246,.04));
  border: 1px solid rgba(145,70,255,.18);
  border-radius: 1rem;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}
.daily-goals-card.primary-focus {
  padding: 1.2rem;
  border-color: rgba(145,70,255,.28);
  box-shadow: 0 18px 40px rgba(145,70,255,.12);
}
.daily-goals-card.primary-focus::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top right, rgba(96,165,250,.12), transparent 45%);
}
.goal-list {
  display: grid;
  gap: .75rem;
}
.goal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .85rem .9rem;
  border-radius: .9rem;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
}
.goal-row.done {
  background: rgba(16,185,129,.08);
  border-color: rgba(16,185,129,.24);
  box-shadow: 0 14px 30px rgba(16,185,129,.12);
  animation: goalGlow 1.6s ease-in-out infinite;
}
.goal-pop-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(16,185,129,.95), rgba(52,211,153,.95));
  color: #fff;
  font-size: .75rem;
  box-shadow: 0 8px 20px rgba(16,185,129,.22);
  animation: goalPop .32s ease-out;
}
.goal-reward-pop {
  margin-top: .45rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .55rem;
  border-radius: 999px;
  background: rgba(16,185,129,.10);
  border: 1px solid rgba(16,185,129,.22);
  color: #86efac;
  font-size: .68rem;
  font-family: 'Space Mono', monospace;
  animation: goalPop .34s ease-out;
}
@keyframes goalPop {
  0% { transform: scale(.88); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes goalGlow {
  0%, 100% { box-shadow: 0 14px 30px rgba(16,185,129,.10); }
  50% { box-shadow: 0 18px 34px rgba(16,185,129,.18); }
}
.goal-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .65rem;
  border-radius: 999px;
  font-family: 'Space Mono', monospace;
  font-size: .7rem;
  background: rgba(251,191,36,.10);
  color: #fcd34d;
  border: 1px solid rgba(251,191,36,.22);
}
.goal-status {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .55rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.goal-status.done {
  color: var(--emerald);
  background: rgba(16,185,129,.10);
}
.goal-status.todo {
  color: #c4b5fd;
  background: rgba(145,70,255,.12);
}
.goal-bar {
  width: 100%;
  height: .45rem;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
  margin-top: .45rem;
}
.goal-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #60a5fa);
  position: relative;
  overflow: hidden;
  transition: width .9s cubic-bezier(.22,1,.36,1);
}
.secondary-grid {
  opacity: .94;
}
.story-card.secondary {
  padding: .9rem;
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(145,70,255,.025));
  border-color: rgba(255,255,255,.07);
}
.story-metric.compact {
  padding: .65rem .75rem;
}
.stat-card.compact {
  padding: .85rem;
}
.stat-card.compact .stat-val {
  font-size: 1rem;
}
.stat-card.compact .stat-label {
  font-size: .7rem;
}
.pride-card {
  background: linear-gradient(180deg, rgba(251,191,36,.06), rgba(145,70,255,.05));
  border: 1px solid rgba(251,191,36,.16);
  border-radius: 1rem;
  padding: 1rem;
}
.pride-title-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(251,191,36,.18), rgba(145,70,255,.18));
  border: 1px solid rgba(251,191,36,.22);
  color: #fff7cc;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 800;
  letter-spacing: .03em;
}
.pride-progress-note {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: rgba(96,165,250,.10);
  border: 1px solid rgba(96,165,250,.22);
  color: #bfdbfe;
  font-size: .72rem;
  font-family: 'Space Mono', monospace;
}
.pride-card .story-header {
  cursor: default;
}
.pride-card .story-header:hover {
  opacity: .96;
}
.pride-panel {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 1rem;
  background: rgba(255,255,255,.03);
  overflow: hidden;
}
.pride-panel-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .8rem 1rem;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 800;
  color: #fff;
}
.pride-panel-summary::-webkit-details-marker {
  display: none;
}
.pride-panel-meta {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .55rem;
  border-radius: 999px;
  background: rgba(96,165,250,.10);
  border: 1px solid rgba(96,165,250,.22);
  color: #bfdbfe;
  font-size: .72rem;
  font-family: 'Space Mono', monospace;
}
.pride-panel[open] .pride-panel-summary {
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.pride-badges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .75rem;
}
.pride-badge {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
  padding: .8rem;
  border-radius: 1rem;
  font-size: .72rem;
  font-family: 'Space Mono', monospace;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: #fff;
  min-height: 92px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.pride-badge:hover {
  transform: translateY(-3px);
}
.pride-badge-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: .8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: linear-gradient(135deg, rgba(251,191,36,.20), rgba(145,70,255,.20));
}
.pride-badge-label {
  font-weight: 800;
  font-family: 'Rajdhani', sans-serif;
  font-size: .92rem;
  letter-spacing: .02em;
}
.pride-badge-desc {
  font-size: .64rem;
  color: #cbd5e1;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity .18s ease, transform .18s ease;
}
.pride-badge:hover .pride-badge-desc {
  opacity: 1;
  transform: translateY(0);
}
.pride-badge.unlocked {
  background: linear-gradient(135deg, rgba(251,191,36,.14), rgba(145,70,255,.14));
  border-color: rgba(251,191,36,.24);
  box-shadow: 0 10px 22px rgba(251,191,36,.08);
}
.pride-badge.locked {
  opacity: .58;
  filter: saturate(.7);
}
.competition-card {
  background: linear-gradient(180deg, rgba(59,130,246,.06), rgba(16,185,129,.04));
  border-color: rgba(59,130,246,.16);
}
.competition-note {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: rgba(59,130,246,.10);
  border: 1px solid rgba(59,130,246,.22);
  color: #bfdbfe;
  font-size: .72rem;
  font-family: 'Space Mono', monospace;
}
@media (max-width: 900px) {
  .profile-story-grid,
  .story-mini-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Daily reward ─────────────────────────────── */
.daily-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.1rem 1.25rem;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.daily-card.can-claim {
  border-color: rgba(16,185,129,.35);
  box-shadow: 0 16px 34px rgba(16,185,129,.10);
}
.daily-streak-track {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .4rem;
}
.daily-streak-step {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 800;
  color: var(--muted);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}
.daily-streak-step.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(251,146,60,.95), rgba(239,68,68,.95));
  border-color: rgba(251,191,36,.45);
  box-shadow: 0 8px 20px rgba(249,115,22,.28);
  transform: translateY(-1px);
}
.daily-next-reward {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: rgba(251,191,36,.10);
  border: 1px solid rgba(251,191,36,.22);
  color: #fcd34d;
}
.claim-btn-live {
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(16,185,129,.22);
  animation: claimPulse 1.9s ease-in-out infinite;
}
.claim-btn-live::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 70%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-18deg);
  animation: claimShine 2.4s linear infinite;
}
@keyframes claimPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-1px) scale(1.02); }
}
@keyframes claimShine {
  0% { left: -120%; }
  100% { left: 140%; }
}

/* ── Transaction row ──────────────────────────── */
.tx-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 0;
  border-bottom: 1px solid rgba(35,35,56,.6);
}
.tx-row:last-child { border-bottom: none; }
.tx-icon { font-size: 1.1rem; flex-shrink: 0; }
.tx-label { font-size: .85rem; flex: 1; }
.tx-sub   { font-family: 'Space Mono', monospace; font-size: .65rem; color: var(--muted); }
.tx-amount {
  font-family: 'Space Mono', monospace;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.tx-amount.credit { color: var(--emerald); }
.tx-amount.debit  { color: var(--red); }

/* ── Pill ─────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  border-radius: .75rem;
  padding: .45rem 1rem;
  font-family: 'Space Mono', monospace;
  font-size: .78rem;
  border: 1px solid var(--border);
  background: var(--card);
}
.pill.limit-ok   { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.3); color: var(--emerald); }
.pill.limit-done { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.3); color: #f87171; }

/* ── Quiz result ──────────────────────────────── */
.result-row {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .65rem .85rem;
  border-radius: .75rem;
  border: 1px solid transparent;
  margin-bottom: .4rem;
}
.result-row.correct { border-color: rgba(16,185,129,.3); background: rgba(16,185,129,.05); }
.result-row.wrong   { border-color: rgba(239,68,68,.25); background: rgba(239,68,68,.05); }

/* ── Pokedex filter row ───────────────────────── */
.filter-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.filter-row input, .filter-row select { width: auto; flex: 1; min-width: 140px; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE OPTIMIZATION — MOBILE-FIRST
════════════════════════════════════════════════════════════ */

/* BASE: Mobile defaults already good */
html, body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Touch-friendly buttons */
button, a, [role="button"] {
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
}

/* Optimize font sizes for mobile */
@media (max-width: 640px) {
  :root {
    font-size: 14px;
  }
  
  body {
    font-size: 14px;
    line-height: 1.5;
  }
  
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1rem; }
  
  /* Navbar mobile */
  nav.main-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    z-index: 200;
    border-bottom: none;
    border-top: 1px solid var(--border);
    min-height: auto;
  }
  
  .nav-inner {
    min-height: 50px;
    gap: .25rem;
    flex-wrap: wrap;
  }
  
  body {
    padding-bottom: 60px;
  }
  
  .container {
    padding: 0 1rem;
  }
  
  /* Grid adjustments */
  .grid, .cards-grid, .stats-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Better spacing on mobile */
  .section {
    margin-bottom: 2rem;
  }
  
  .py-8 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
  .py-12 { padding-top: 2rem; padding-bottom: 2rem; }
  .py-16 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
  
  /* Modal optimizations */
  .modal, .modal-panel {
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh;
    border-radius: 1.5rem 1.5rem 0 0 !important;
    overflow-y: auto;
    margin: auto 0 0 0;
  }
  
  /* Better card spacing */
  .card, .card-2 {
    padding: 1rem;
  }
  
  /* Tabs mobile */
  .tabs {
    flex-direction: column;
    gap: .5rem;
  }
  
  .tab-btn {
    padding: 0.75rem 1rem !important;
    border-radius: 0.5rem;
  }
  
  /* Buttons full width on mobile */
  .btn-full { width: 100%; }
  
  /* Better inputs */
  input, select, textarea {
    font-size: 16px !important;
    padding: 0.75rem 1rem !important;
  }
}

/* Tablet: 641px - 1024px */
@media (min-width: 641px) and (max-width: 1024px) {
  :root {
    font-size: 15px;
  }
  
  .container {
    padding: 0 1.25rem;
  }
  
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.1rem; }
  
  /* Grid on tablet */
  .grid { grid-template-columns: repeat(2, 1fr); }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  
  /* Navbar tablet */
  nav.main-nav {
    position: sticky;
    top: 0;
    min-height: 56px;
  }
  
  body {
    padding-bottom: 0;
  }
}

/* Small Desktop: 1025px - 1440px */
@media (min-width: 1025px) and (max-width: 1440px) {
  :root {
    font-size: 15px;
  }
  
  .container {
    max-width: 1200px;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.2rem; }
  
  .grid { grid-template-columns: repeat(3, 1fr); }
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Large Desktop: 1441px+ */
@media (min-width: 1441px) {
  :root {
    font-size: 16px;
  }
  
  .container {
    max-width: 1400px;
  }
  
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.3rem; }
  
  .grid { grid-template-columns: repeat(4, 1fr); }
  .cards-grid { grid-template-columns: repeat(4, 1fr); }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Extra Large: 1920px+ */
@media (min-width: 1920px) {
  :root {
    font-size: 17px;
  }
  
  .container {
    max-width: 1600px;
  }
  
  .grid { grid-template-columns: repeat(5, 1fr); }
}

/* ════════════════════════════════════════════════════════════
   PERFORMANCE & ACCESSIBILITY
════════════════════════════════════════════════════════════ */

/* Smooth scrolling only for users who prefer it */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
  
  * {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f8f9fa;
    --card: #ffffff;
    --card2: #f5f6f7;
    --border: #e0e0e0;
    --text: #1a1a2e;
    --muted: #7a7a8f;
  }
}

/* Landscape mode optimization */
@media (max-height: 600px) and (orientation: landscape) {
  body {
    padding-bottom: 0;
  }
  
  nav.main-nav {
    position: sticky;
    bottom: auto;
    top: 0;
  }
  
  .py-8, .py-12, .py-16 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
}

/* High DPI screens optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* ════════════════════════════════════════════════════════════
   COMPONENT OPTIMIZATIONS
════════════════════════════════════════════════════════════ */

/* Better form inputs */
input, select, textarea {
  border-radius: 0.75rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(224,64,251,.1);
}

input::placeholder, textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

/* Better buttons */
button, [role="button"] {
  border-radius: 0.75rem;
  padding: 0.65rem 1.5rem;
  border: none;
  background: var(--accent);
  color: white;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(224,64,251,.3);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Secondary button */
button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

button.secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

/* ════════════════════════════════════════════════════════════
   LAYOUT HELPERS
════════════════════════════════════════════════════════════ */

/* Flexbox helpers */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

/* Grid helpers */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }

/* Spacing helpers */
.mt-auto { margin-top: auto; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin: 0 auto; }

/* Width helpers */
.w-full { width: 100%; }
.h-full { height: 100%; }
.max-w-full { max-width: 100%; }

/* Visibility helpers */
.hidden { display: none !important; }
.invisible { visibility: hidden; }

@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .hide-tablet { display: none !important; }
}

@media (min-width: 1025px) {
  .hide-desktop { display: none !important; }
}

/* Show helpers */
.show-mobile { display: none !important; }

@media (max-width: 640px) {
  .show-mobile { display: block !important; }
}

/* ════════════════════════════════════════════════════════════
   ANIMATIONS
════════════════════════════════════════════════════════════ */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

.animate-fade { animation: fadeIn 0.3s ease-out; }
.animate-slide-left { animation: slideInLeft 0.3s ease-out; }
.animate-slide-right { animation: slideInRight 0.3s ease-out; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-bounce { animation: bounce 1s ease-in-out infinite; }

/* ════════════════════════════════════════════════════════════
   TABLE RESPONSIVE
════════════════════════════════════════════════════════════ */

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--card2);
  font-weight: 600;
  color: var(--text);
}

tr:hover {
  background: rgba(255,255,255,.02);
}

@media (max-width: 640px) {
  table, thead, tbody, th, td, tr {
    display: block;
  }
  
  thead {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  
  tr {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
    display: block;
  }
  
  td {
    padding-left: 50%;
    position: relative;
    padding-bottom: 0.5rem;
    border: none;
  }
  
  td:before {
    content: attr(data-label);
    position: absolute;
    left: 1rem;
    font-weight: 600;
    color: var(--muted);
  }
}

/* ════════════════════════════════════════════════════════════
   SCROLLBAR OPTIMIZATION
════════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Firefox scrollbar */
* {
  scrollbar-color: var(--border) transparent;
  scrollbar-width: thin;
}

/* ════════════════════════════════════════════════════════════
   PRINT STYLES
════════════════════════════════════════════════════════════ */

@media print {
  body {
    background: white;
    color: black;
  }
  
  nav, footer, .no-print, .hide-on-print {
    display: none !important;
  }
  
  a {
    text-decoration: underline;
  }
  
  img {
    max-width: 100%;
  }
}

/* ════════════════════════════════════════════════════════════
   UI BALANCE REFRESH — 2026-04-24
   Global coherence pass for spacing, hierarchy and responsiveness
════════════════════════════════════════════════════════════ */

:root {
  --content-max: 1320px;
  --content-max-wide: 1460px;
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.25rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --radius-sm: 0.7rem;
  --radius-md: 1rem;
  --radius-lg: 1.2rem;
}

/* Layout rhythm */
.container {
  width: min(var(--content-max), 100%);
  padding-left: clamp(0.9rem, 1.8vw, 1.5rem);
  padding-right: clamp(0.9rem, 1.8vw, 1.5rem);
}

main.container {
  padding-top: clamp(1.25rem, 2vw, 2rem);
  padding-bottom: clamp(1.5rem, 2.2vw, 2.4rem);
}

main.container > * + * {
  margin-top: clamp(1rem, 1.8vw, 1.6rem);
}

section + section {
  margin-top: clamp(0.8rem, 1.6vw, 1.4rem);
}

/* Typography hierarchy */
h1, .hero h1 {
  letter-spacing: 0.03em;
}

h2 {
  letter-spacing: 0.035em;
}

h3 {
  letter-spacing: 0.03em;
}

.tagline {
  max-width: 72ch;
  margin-left: auto;
  margin-right: auto;
}

/* Components sizing consistency */
.card {
  border-radius: var(--radius-md);
  padding: clamp(0.95rem, 1.4vw, 1.2rem);
}

.card-2 {
  border-radius: var(--radius-lg);
  padding: clamp(1.1rem, 1.8vw, 1.55rem);
}

.badge,
.pill,
.rank-badge {
  min-height: 1.75rem;
  align-items: center;
}

.btn {
  min-height: 44px;
  border-radius: 0.72rem;
  padding: 0.62rem 1.1rem;
  font-size: 0.86rem;
  letter-spacing: 0.055em;
}

.btn-sm {
  min-height: 36px;
  padding: 0.4rem 0.78rem;
}

.btn-lg {
  min-height: 48px;
  padding: 0.82rem 1.35rem;
}

/* Prevent generic button rules from shrinking visual coherence */
button:not(.btn):not(.tab-btn):not(.nav-toggle):not(.lang-btn):not(.filter-btn):not(.rank-tab) {
  border-radius: var(--radius-sm);
}

/* Navigation balance */
.nav-inner {
  min-height: 64px;
  padding-bottom: 0.15rem;
}

.nav-links {
  gap: 0.3rem;
  padding-top: 0.35rem;
  padding-bottom: 0.5rem;
}

.nav-links a,
.nav-group-toggle {
  font-size: 0.8rem;
  padding: 0.42rem 0.74rem;
  border-radius: 0.6rem;
}

.nav-submenu {
  border-radius: 0.9rem;
}

/* Tabs and sub-tabs */
.tab-nav {
  max-width: 100%;
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: var(--radius-md);
}

.tab-btn {
  min-height: 44px;
  padding: 0.62rem 1rem;
  border-radius: 0.72rem;
}

#quiz-score-tabs,
.rank-tabs,
.admin-filters,
.filters {
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Grids balance */
.grid {
  gap: clamp(0.8rem, 1.4vw, 1.2rem);
}

.home-games-grid,
.home-featured-grid,
.anime-games-modal-grid,
.football-games-grid,
.profile-top-grid,
.profile-story-grid {
  gap: clamp(0.9rem, 1.5vw, 1.4rem) !important;
}

.game-card,
.football-game-card,
.story-card,
.daily-goals-card,
.pride-card {
  border-radius: var(--radius-lg);
}

.game-card-body,
.football-game-content {
  padding: 1rem 1.1rem 0.9rem;
}

.game-card-footer,
.football-game-footer {
  padding: 0.7rem 1.1rem;
}

/* Stats/readability alignment */
.stats-bar .container {
  gap: clamp(1rem, 2vw, 1.8rem) !important;
}

.stat-card,
.story-metric,
.goal-row,
.profile-history-list .tx-row {
  border-radius: 0.95rem;
}

.profile-history-list .tx-row {
  padding: 0.85rem 1rem;
}

/* Desktop and large desktop */
@media (min-width: 1201px) {
  .container {
    width: min(var(--content-max-wide), 100%);
  }

  .nav-links a,
  .nav-group-toggle {
    font-size: 0.78rem;
    padding: 0.4rem 0.68rem;
  }

  .hero {
    padding-top: clamp(3rem, 5vw, 4.5rem);
    padding-bottom: clamp(2.1rem, 3.2vw, 3rem);
  }
}

/* Tablet */
@media (min-width: 641px) and (max-width: 1024px) {
  .container {
    width: min(980px, 100%);
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .g4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .g3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

/* Mobile: keep top navigation stable, improve touch comfort */
@media (max-width: 640px) {
  nav.main-nav {
    position: sticky;
    top: 0;
    bottom: auto;
    border-top: none;
    border-bottom: 1px solid var(--border);
  }

  body {
    padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  }

  .container {
    padding-left: 0.82rem;
    padding-right: 0.82rem;
  }

  .hero {
    padding-top: 2.2rem;
    padding-bottom: 1.7rem;
  }

  .hero .tagline {
    font-size: 0.95rem;
    margin-bottom: 1.1rem;
  }

  .tab-nav {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tab-nav::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex: 0 0 auto;
    min-width: 120px;
  }

  .mobile-quick-nav {
    left: 0.3rem;
    right: 0.3rem;
    gap: 0.18rem;
  }

  .mobile-quick-nav a {
    min-height: 50px;
    font-size: 0.56rem;
  }

  .mobile-quick-nav a span:first-child {
    font-size: 0.96rem;
  }

  .btn,
  .btn-lg,
  .btn-full {
    min-height: 46px;
  }

  .profile-history-main {
    gap: 0.55rem;
  }

  .profile-history-title {
    font-size: 0.93rem;
  }

  .profile-history-meta {
    font-size: 0.74rem;
  }

  .pride-badges {
    grid-template-columns: 1fr;
  }

  /* Profile mobile layout */
  .profile-top-grid {
    flex-direction: column !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
  }

  .profile-main-card,
  .profile-wallet-card {
    flex: none !important;
    width: 100% !important;
    min-width: 0 !important;
    position: static !important;
  }

  .profile-wallet-card {
    flex: none !important;
  }

  .profile-story-grid {
    grid-template-columns: 1fr !important;
  }

  .story-mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Rank ladder wrapping */
  .xp-bar-track + div + div {
    flex-wrap: wrap !important;
  }

  /* Goal rows full width */
  .goal-row {
    flex-wrap: wrap;
    gap: .5rem;
  }

  .goal-badge {
    align-self: flex-start;
  }

  /* Daily card inner */
  .daily-streak-track {
    gap: .3rem;
  }

  .daily-streak-step {
    width: 1.75rem;
    height: 1.75rem;
    font-size: .72rem;
  }

  /* Wallet balance panel */
  .wallet-balance-panel {
    gap: .65rem;
  }

  /* Profile stats grid single column */
  .profile-stats-grid {
    grid-template-columns: 1fr !important;
  }

  .profile-stats-grid .stat-card:last-child {
    grid-column: auto;
  }

  /* Story header wrapping */
  .story-header {
    flex-wrap: wrap;
    gap: .5rem;
  }

  /* Pride card */
  .pride-badge-desc {
    opacity: 1;
    transform: none;
  }
}

/* ════════════════════════════════════════════════════════════
   UI MICRO-TUNING — Profile/Home/Quiz/Football/Admin
════════════════════════════════════════════════════════════ */

/* Home/Twitch block balance */
#twitch-section .container {
  max-width: min(1200px, 100%);
}

#twitch-player-wrap {
  border-radius: 0.95rem !important;
}

#online-users-preview {
  padding: 0.2rem 0.1rem 0.35rem;
}

/* Profile refinements */
.profile-shell {
  gap: clamp(1rem, 1.8vw, 1.6rem);
}

.profile-main-card,
.profile-wallet-card,
.daily-goals-card,
.pride-card,
.story-card {
  box-shadow: 0 12px 28px rgba(0,0,0,0.16);
}

.profile-history-list {
  max-height: 520px;
}

.profile-history-list .tx-row {
  align-items: center;
}

/* Quiz readability and controls */
#quiz-tabs {
  margin-bottom: 1.25rem;
}

#quiz-state .card,
#quiz-state .card-2 {
  border-radius: 1rem;
}

.quiz-image-wrap {
  width: min(240px, 62vw);
  height: min(240px, 62vw);
}

/* Football pages */
.football-games-grid {
  gap: clamp(0.9rem, 1.6vw, 1.35rem);
}

.football-game-title {
  line-height: 1.15;
}

.football-game-footer {
  align-items: center;
  gap: 0.45rem;
}

.match-card {
  border-radius: 0.95rem;
}

.match-body {
  padding: 0.9rem 0.95rem 0.8rem;
}

.bet-options {
  gap: 0.45rem;
}

/* Admin cohesion */
.adm-wrap,
.admin-container,
.details-container {
  width: min(1360px, 100%);
}

.adm-section,
.activity-chart,
.game-breakdown,
.history-section {
  scroll-margin-top: 88px;
}

.admin-filters,
.rank-tabs,
.adm-header-actions,
.adm-tabs {
  row-gap: 0.55rem;
}

.users-table th,
.users-table td {
  vertical-align: middle;
}

/* Tablet tuning */
@media (min-width: 641px) and (max-width: 1024px) {
  .adm-wrap,
  .admin-container,
  .details-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .adm-page-header,
  .football-hero,
  .hero {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .player-header {
    grid-template-columns: auto 1fr;
    gap: 1.1rem;
  }

  .player-wallet {
    grid-column: 1 / -1;
    text-align: left;
  }

  .history-item {
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
  }

  .history-item .result {
    grid-column: 1 / -1;
    text-align: left;
  }

  .match-teams {
    gap: 0.8rem;
  }
}

/* Mobile tuning */
@media (max-width: 640px) {
  #twitch-player-wrap {
    max-height: 230px !important;
  }

  .home-games-grid {
    gap: 0.85rem !important;
  }

  .game-card-title,
  .football-game-title {
    font-size: 1rem;
  }

  .game-card-desc,
  .football-game-desc {
    font-size: 0.78rem;
  }

  .football-game-footer {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .football-game-cta {
    margin-left: auto;
  }

  .quiz-image-wrap {
    width: min(220px, 70vw);
    height: min(220px, 70vw);
  }

  .category-card .cat-banner {
    height: 120px;
    min-height: 120px;
  }

  .category-card:hover .cat-banner,
  .category-card.selected .cat-banner {
    height: 126px;
    min-height: 126px;
  }

  .match-header,
  .match-body,
  .bet-amount-row,
  .my-bet-info,
  .admin-match-row,
  .admin-grid-2 {
    grid-template-columns: 1fr !important;
  }

  .bet-options {
    grid-template-columns: 1fr;
  }

  .match-teams {
    flex-direction: column;
    gap: 0.35rem;
  }

  .team-name.home,
  .team-name.away {
    text-align: center;
  }

  .player-header {
    grid-template-columns: 1fr;
    gap: 1rem;
    text-align: left;
  }

  .player-avatar-large {
    width: 84px;
    height: 84px;
    font-size: 2.3rem;
  }

  .player-info h1 {
    font-size: 1.45rem;
  }

  .game-row {
    grid-template-columns: 1fr;
    gap: 0.45rem;
    padding: 0.75rem;
  }

  .history-item {
    grid-template-columns: 1fr;
    gap: 0.45rem;
    padding: 0.8rem;
  }

  .history-item .result {
    text-align: left;
  }

  .adm-tabs {
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 0.2rem;
  }

  .adm-tabs::-webkit-scrollbar {
    display: none;
  }

  .adm-tab {
    white-space: nowrap;
  }

  .kpi-grid,
  .charts-grid,
  .game-stats,
  .admin-stats,
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ════════════════════════════════════════════════════════════
   NAV ACCESSIBILITY & CONSISTENCY — Pass 3
════════════════════════════════════════════════════════════ */

.nav-links a,
.nav-group-toggle,
.lang-btn,
.nav-toggle,
.mobile-quick-nav a {
  position: relative;
}

.js-a11y-clickable:focus-visible {
  outline: 2px solid rgba(125,211,252,.9);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(125,211,252,.18);
}

.nav-links a:focus-visible,
.nav-group-toggle:focus-visible,
.lang-btn:focus-visible,
.nav-toggle:focus-visible,
.mobile-quick-nav a:focus-visible {
  outline: 2px solid rgba(125,211,252,.9);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(125,211,252,.18);
}

.nav-links a.active::after,
.nav-group-toggle.active::after {
  content: '';
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  bottom: 0.2rem;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(167,139,250,.95), rgba(34,211,238,.9));
}

.nav-right .btn,
.lang-btn,
.nav-links a,
.nav-group-toggle {
  min-height: 38px;
}

.mobile-quick-nav a {
  min-height: 52px;
}

@media (max-width: 1024px) {
  .nav-links a,
  .nav-group-toggle,
  .nav-right .btn {
    min-height: 46px;
  }

  .nav-links a.active::after,
  .nav-group-toggle.active::after {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.45rem;
  }

  .nav-toggle {
    min-width: 46px;
    min-height: 46px;
  }
}

@media (max-width: 640px) {
  .mobile-quick-nav a {
    min-height: 54px;
    border-radius: 0.72rem;
  }

  .mobile-quick-nav a.active {
    box-shadow: inset 0 0 0 1px rgba(167,139,250,.34), 0 6px 16px rgba(124,58,237,.18);
  }
}

/* ════════════════════════════════════════════════════════════
   WAVE C — SYSTÈME DE BADGES UNIFIÉ
════════════════════════════════════════════════════════════ */
.gs-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .16rem .6rem; border-radius: 999px;
  font-size: .65rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .07em;
  border: 1px solid transparent; line-height: 1.4;
  white-space: nowrap;
}
.gs-badge-purple  { background: rgba(145,70,255,.14);  color: #c4b5fd; border-color: rgba(145,70,255,.28); }
.gs-badge-gold    { background: rgba(251,191,36,.12);  color: #fbbf24; border-color: rgba(251,191,36,.28); }
.gs-badge-green   { background: rgba(52,211,153,.12);  color: #34d399; border-color: rgba(52,211,153,.28); }
.gs-badge-red     { background: rgba(248,113,113,.12); color: #f87171; border-color: rgba(248,113,113,.28); }
.gs-badge-blue    { background: rgba(59,130,246,.12);  color: #60a5fa; border-color: rgba(59,130,246,.28); }
.gs-badge-muted   { background: rgba(255,255,255,.05); color: var(--muted); border-color: rgba(255,255,255,.1); }
.gs-badge-cyan    { background: rgba(6,182,212,.12);   color: #22d3ee; border-color: rgba(6,182,212,.28); }
.gs-badge-orange  { background: rgba(249,115,22,.12);  color: #fb923c; border-color: rgba(249,115,22,.28); }

/* ════════════════════════════════════════════════════════════
   WAVE C — BOUTONS : ÉTAT DISABLED COHÉRENT
════════════════════════════════════════════════════════════ */
.btn:disabled,
.btn[aria-disabled="true"],
button:disabled {
  opacity: .42;
  cursor: not-allowed;
  pointer-events: none;
  filter: saturate(.4);
}
.btn:focus-visible {
  outline: 2px solid rgba(167,139,250,.8);
  outline-offset: 3px;
}

/* ════════════════════════════════════════════════════════════
   WAVE C — MODALS : SÉCURITÉ MOBILE
════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem;
  width: min(480px, calc(100vw - 2rem));
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  position: relative;
}
.modal-box h2, .modal-box h3 {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 800; margin-bottom: .85rem;
}
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1.3rem; line-height: 1;
  padding: .25rem; border-radius: 6px;
  transition: color .15s, background .15s;
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,.06); }

/* ════════════════════════════════════════════════════════════
   WAVE C — CARTES : OMBRES & BORDURES STANDARDISÉES
════════════════════════════════════════════════════════════ */
/* Canonical card shadow — use instead of ad-hoc box-shadow */
.gs-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem;
  transition: transform .18s, box-shadow .18s;
}
.gs-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.22), 0 0 0 1px rgba(145,70,255,.12);
}
.gs-card-glow {
  box-shadow: 0 0 0 1px rgba(145,70,255,.2), 0 8px 32px rgba(145,70,255,.1);
}

/* ════════════════════════════════════════════════════════════
   WAVE C — FORMULAIRES : INPUTS COHÉRENTS
════════════════════════════════════════════════════════════ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
select,
textarea {
  background: rgba(255,255,255,.04);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: .9rem;
  padding: .6rem .9rem;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(145,70,255,.5);
  box-shadow: 0 0 0 3px rgba(145,70,255,.12);
}
input::placeholder,
textarea::placeholder { color: var(--muted); }

:root[data-theme="light"] input[type="text"],
:root[data-theme="light"] input[type="email"],
:root[data-theme="light"] input[type="search"],
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
  background: rgba(0,0,0,.03);
}

/* ════════════════════════════════════════════════════════════
   WAVE C — SHARE BUTTON (global)
════════════════════════════════════════════════════════════ */
.gs-share-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .38rem .85rem; border-radius: 999px; cursor: pointer;
  font-size: .78rem; font-weight: 700;
  border: 1.5px solid rgba(145,70,255,.3);
  background: rgba(145,70,255,.1); color: #c4b5fd;
  transition: background .15s, transform .12s;
  white-space: nowrap; text-decoration: none;
}
.gs-share-btn:hover  { background: rgba(145,70,255,.22); transform: translateY(-1px); }
.gs-share-btn:active { transform: scale(.96); }

/* ════════════════════════════════════════════════════════════
   WAVE C — LOADING OVERLAY GLOBAL
════════════════════════════════════════════════════════════ */
.gs-loading-overlay {
  position: absolute; inset: 0; z-index: 10;
  background: rgba(13,13,24,.7);
  backdrop-filter: blur(3px);
  border-radius: inherit;
  display: flex; align-items: center; justify-content: center;
}
.gs-spinner {
  width: 28px; height: 28px;
  border: 3px solid rgba(145,70,255,.2);
  border-top-color: #9147ff;
  border-radius: 50%;
  animation: gsSpinAnim .7s linear infinite;
}
@keyframes gsSpinAnim { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════════════════════
   WAVE C — TOOLTIPS LÉGERS
════════════════════════════════════════════════════════════ */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: rgba(20,20,40,.95);
  border: 1px solid var(--border);
  color: var(--text); font-size: .72rem; font-weight: 600;
  padding: .28rem .6rem; border-radius: 7px;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .15s;
  z-index: 9999;
}
[data-tip]:hover::after { opacity: 1; }

/* ════════════════════════════════════════════════════════════
   WAVE C — RESPONSIVE : FIXES SUPPLÉMENTAIRES
════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* Modals safe width on phones */
  [class*="modal"] [class*="inner"],
  [class*="modal"] > div:not([class]) {
    width: min(100%, calc(100vw - 2rem)) !important;
    max-width: none !important;
  }
  /* Tabs scrollables sur mobile */
  [class*="tab-bar"],
  [class*="tabs"],
  [class*="tab-list"] {
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap !important;
  }
  /* Prevent hero button overflow */
  .hero .btn, .hero-actions .btn {
    min-width: 0; width: 100%;
  }
}

/* ════════════════════════════════════════════════════════════
   WAVE C — COUNTDOWN COOLDOWN DISPLAY
════════════════════════════════════════════════════════════ */
.gs-cooldown {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .85rem; border-radius: 999px;
  background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.25);
  color: #f87171; font-size: .8rem; font-weight: 700;
  font-family: 'Space Mono', monospace;
}
.gs-cooldown-label { font-family: 'Inter', sans-serif; font-weight: 600; }

/* ════════════════════════════════════════════════════════════
   DESIGN — VISUAL POLISH (2026-06-29)
════════════════════════════════════════════════════════════ */

/* ── Étape 9 — Séparateurs en gradient ───────── */
.hr-fade, hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167,139,250,.2), transparent);
  margin: 1rem 0;
}

/* ── Étape 10 — Rarity pills : shimmer legendary/mythic ── */
@keyframes rarityShimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
.rarity-legendary {
  background: rgba(249,115,22,.15);
  color: #fdba74;
  position: relative;
  overflow: hidden;
}
.rarity-legendary::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(253,186,116,.25) 50%, transparent 65%);
  background-size: 200% 100%;
  animation: rarityShimmer 3s ease-in-out infinite;
  border-radius: inherit;
  pointer-events: none;
}
.rarity-mythic {
  background: linear-gradient(135deg, rgba(217,70,239,.18), rgba(124,58,237,.18));
  color: #e879f9;
  position: relative;
  overflow: hidden;
  animation: mythicGlow 2s ease-in-out infinite;
}
@keyframes mythicGlow {
  0%,100% { box-shadow: 0 0 6px rgba(217,70,239,.3); }
  50%     { box-shadow: 0 0 12px rgba(217,70,239,.55); }
}
.rarity-mythic::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(232,121,249,.3) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: rarityShimmer 2.2s ease-in-out infinite;
  border-radius: inherit;
  pointer-events: none;
}

/* ── Navbar active link highlight ─────────────── */
nav.main-nav .nav-links a.active {
  color: var(--purple-light);
  background: rgba(124,58,237,.14);
  border-color: rgba(124,58,237,.3);
}

/* ── Stats bar amélioration ───────────────────── */
.stats-bar {
  background: rgba(17,17,34,.7);
  backdrop-filter: blur(8px);
  border-top:    1px solid rgba(167,139,250,.1);
  border-bottom: 1px solid rgba(167,139,250,.1);
}

/* ── Coin badge glow ──────────────────────────── */
.coin-badge {
  box-shadow: 0 0 8px rgba(251,191,36,.12);
  transition: box-shadow .2s, background .2s;
}
.coin-badge:hover {
  box-shadow: 0 0 14px rgba(251,191,36,.28);
}

/* ── Card light mode : désactiver translateY ──── */
:root[data-theme="light"] .card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
  border-color: rgba(124,58,237,.18);
}

/* ═══════════════════════════════════════════════════════════════
   VISUAL ENHANCEMENTS 2026-06-30
   ═══════════════════════════════════════════════════════════════ */

/* ── Animated gradient on hero GuildStream title ─────────────── */
@keyframes gradient-drift {
  0%,100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.hero h1 .text-gradient {
  background-size: 250% 250%;
  animation: gradient-drift 5s ease-in-out infinite;
}

/* ── Hero ambient floating orbs ───────────────────────────────── */
@keyframes orb-drift-a {
  0%,100% { transform: translate(0,0)       scale(1);    opacity: .22; }
  33%      { transform: translate(28px,-38px) scale(1.1);  opacity: .42; }
  66%      { transform: translate(-18px,24px) scale(.92);  opacity: .24; }
}
@keyframes orb-drift-b {
  0%,100% { transform: translate(0,0)       scale(1);   opacity: .15; }
  40%      { transform: translate(-30px,20px) scale(1.12); opacity: .33; }
  70%      { transform: translate(20px,-26px) scale(.9);  opacity: .18; }
}
.hero-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(52px);
  pointer-events: none;
}
.hero-orb.orb-1 {
  width: 420px; height: 420px;
  top: -110px; left: -80px;
  background: radial-gradient(circle, rgba(124,58,237,.62) 0%, rgba(109,40,217,.3) 50%, transparent 72%);
  animation: orb-drift-a 12s ease-in-out infinite;
}
.hero-orb.orb-2 {
  width: 360px; height: 360px;
  top: -60px; right: -50px;
  background: radial-gradient(circle, rgba(224,64,251,.52) 0%, rgba(168,85,247,.28) 50%, transparent 72%);
  animation: orb-drift-b 10s ease-in-out infinite;
  animation-delay: -3.5s;
}
.hero-orb.orb-3 {
  width: 280px; height: 280px;
  bottom: -70px; left: 28%;
  background: radial-gradient(circle, rgba(0,212,255,.34) 0%, rgba(59,130,246,.2) 50%, transparent 72%);
  animation: orb-drift-a 14s ease-in-out infinite;
  animation-delay: -7s;
}
.hero-orb.orb-4 {
  width: 230px; height: 230px;
  top: 40%; right: 10%;
  background: radial-gradient(circle, rgba(244,114,182,.34) 0%, rgba(236,72,153,.18) 50%, transparent 72%);
  animation: orb-drift-b 11s ease-in-out infinite;
  animation-delay: -1.8s;
}

/* ── Hero floating particles ──────────────────────────────────── */
@keyframes h-pt-float {
  0%,100% { transform: translateY(0)     scale(.85); opacity: .22; }
  50%      { transform: translateY(-22px) scale(1.12); opacity: .72; }
}
.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.h-pt {
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(145,70,255,.8);
  box-shadow: 0 0 12px rgba(145,70,255,.45);
  animation: h-pt-float 6.5s ease-in-out infinite;
  opacity: .25;
}
.hp1 { left: 8%;  top: 68%; }
.hp2 { left: 19%; top: 28%; animation-delay: .9s;  width: 5px; height: 5px; background: rgba(0,212,255,.88);    box-shadow: 0 0 10px rgba(0,212,255,.4); }
.hp3 { left: 44%; top: 74%; animation-delay: 1.7s; width: 6px; height: 6px; background: rgba(244,114,182,.88); box-shadow: 0 0 10px rgba(244,114,182,.4); }
.hp4 { left: 68%; top: 22%; animation-delay: 2.4s;             background: rgba(224,64,251,.88);  box-shadow: 0 0 12px rgba(224,64,251,.4); }
.hp5 { left: 84%; top: 58%; animation-delay: .5s;  width: 5px; height: 5px; background: rgba(251,191,36,.88); box-shadow: 0 0 10px rgba(251,191,36,.35); }
.hp6 { left: 58%; top: 78%; animation-delay: 3.2s; width: 4px; height: 4px; background: rgba(52,211,153,.88);  box-shadow: 0 0 8px rgba(52,211,153,.35); }
@media (prefers-reduced-motion: reduce) {
  .hero-orb, .h-pt { animation: none !important; opacity: .1; }
}

/* ── Game card stagger entrance ───────────────────────────────── */
@keyframes card-enter {
  from { opacity: 0; transform: translateY(26px) scale(.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.gs-stagger-grid > * {
  animation: card-enter .65s cubic-bezier(.22,1,.36,1) both;
  animation-delay: calc(var(--gs-i, 0) * 85ms);
}

/* ── Scroll-reveal sections ───────────────────────────────────── */
.gs-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .55s cubic-bezier(.22,1,.36,1), transform .55s cubic-bezier(.22,1,.36,1);
}
.gs-reveal.gs-visible {
  opacity: 1;
  transform: translateY(0);
}
.gs-reveal.d1 { transition-delay: .08s; }
.gs-reveal.d2 { transition-delay: .16s; }
.gs-reveal.d3 { transition-delay: .24s; }

/* ── GC stat count-up flash ───────────────────────────────────── */
@keyframes gs-count-flash {
  0%   { color: var(--electric); text-shadow: 0 0 10px rgba(0,212,255,.4); }
  100% { color: inherit; text-shadow: none; }
}
.gs-counted {
  animation: gs-count-flash .7s ease-out;
}

/* ── Podium top-3 glow cards ──────────────────────────────────── */
#gc-podium .rank-1 {
  filter: drop-shadow(0 0 14px rgba(251,191,36,.35));
}
#gc-podium .rank-2 {
  filter: drop-shadow(0 0 8px rgba(209,213,219,.22));
}
#gc-podium .rank-3 {
  filter: drop-shadow(0 0 6px rgba(184,115,51,.22));
}


/* ── Thème Halloween (temporaire) ─────────────────
 * Actif via la classe html.gs-halloween, posée par js/common.js
 * jusqu'au 2/11 inclus. Ce bloc peut être supprimé ensuite. */
.gs-halloween .text-gradient,
.gs-halloween .nav-logo span.accent {
  background-image: linear-gradient(120deg, var(--purple-light) 0%, #F97316 60%, #FDBA74 100%);
}
.gs-halloween h1,
.gs-halloween h2,
.gs-halloween .section-title {
  text-shadow: 0 0 18px rgba(249,115,22,.28);
}
.gs-halloween .btn-primary {
  background-image: linear-gradient(135deg, var(--purple) 0%, #9d50ff 50%, #F97316 100%);
  box-shadow: 0 0 0 1px rgba(249,115,22,.55), 0 2px 14px rgba(249,115,22,.35), 0 1px 3px rgba(0,0,0,.4);
}
.gs-halloween .btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 0 1px #F97316, 0 4px 22px rgba(249,115,22,.5), 0 2px 8px rgba(0,0,0,.4);
}
.gs-halloween .btn-ghost {
  border-color: rgba(249,115,22,.45);
}
.gs-halloween .btn-ghost:hover:not(:disabled) {
  border-color: #F97316;
}
.gs-pumpkin {
  margin-left: .1rem;
  font-size: 1.05rem;
  -webkit-text-fill-color: initial;
  filter: drop-shadow(0 0 6px rgba(249,115,22,.55));
}
@media (prefers-reduced-motion: no-preference) {
  .gs-pumpkin { display: inline-block; animation: gsPumpkinBob 3s ease-in-out infinite; }
  @keyframes gsPumpkinBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
}

/* ══ Navigation GuildStream (rubriques + menus déroulants) ═══════════
 * Rendu par initNav() dans js/common.js. Classes préfixées gsn-
 * pour ne pas hériter des anciennes règles .nav-links / .mobile-quick-nav.
 * Mêmes couleurs, polices et effets que l'ancien menu. */
.gsn-bar {
  display: flex;
  align-items: center;
  gap: .5rem 1rem;
  min-height: 64px;
  padding: .5rem 0;
}
.gsn-bar .nav-logo { order: 0; }
.gsn-menu { flex: 1 1 auto; min-width: 0; }
.gsn-list, .gsn-sub, .gsn-panel ul, .gsn-sheet-list { list-style: none; margin: 0; padding: 0; }
.gsn-list { display: flex; align-items: center; gap: .15rem; }
.gsn-group { position: relative; }

.gsn-toggle,
.gsn-sub a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--muted);
  text-decoration: none;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .35rem .75rem;
  border-radius: .5rem;
  border: 1px solid transparent;
  background: transparent;
  white-space: nowrap;
  cursor: pointer;
  line-height: 1.2;
  transition: color .2s, background .2s, box-shadow .2s;
}
.gsn-toggle:hover, .gsn-group.open > .gsn-toggle,
.gsn-sub a:hover, .gsn-sub a:focus-visible { color: var(--text); background: rgba(167,139,250,.1); }
.gsn-toggle.active,
.gsn-sub a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(124,58,237,.25), rgba(224,64,251,.15));
  border-color: rgba(167,139,250,.2);
  box-shadow: 0 0 10px rgba(224,64,251,.1);
}
:root[data-theme="light"] .gsn-toggle.active,
:root[data-theme="light"] .gsn-sub a.active { color: var(--purple-dark, #5b21b6); }
.gsn-caret { font-size: .7rem; opacity: .8; transition: transform .2s ease; }
.gsn-group.open .gsn-caret, .gsn-dd.open .gsn-caret { transform: rotate(180deg); }
.gsn-event { color: #fbbf24; border-color: rgba(251,191,36,.3); }

/* Panneaux déroulants (rubriques, langue, compte) */
.gsn-sub,
.gsn-panel,
.gsn-notif-panel {
  position: absolute;
  top: calc(100% + .45rem);
  z-index: 120;
  padding: .4rem;
  border-radius: .85rem;
  border: 1px solid var(--border);
  background: rgba(13,13,24,.98);
  box-shadow: 0 16px 36px rgba(0,0,0,.35);
}
:root[data-theme="light"] .gsn-sub,
:root[data-theme="light"] .gsn-panel,
:root[data-theme="light"] .gsn-notif-panel,
:root[data-theme="light"] .gsn-sheet { background: rgba(255,255,255,.98); box-shadow: 0 16px 36px rgba(15,15,40,.14); }
.gsn-sub { left: 0; min-width: 220px; display: none; }
.gsn-sub::before { content: ''; position: absolute; left: 0; right: 0; top: -.55rem; height: .55rem; }
.gsn-sub li + li { margin-top: .2rem; }
.gsn-sub a { display: flex; width: 100%; box-sizing: border-box; }
.gsn-group.open > .gsn-sub { display: block; }
@media (min-width: 1024px) and (hover: hover) {
  .gsn-group:hover > .gsn-sub { display: block; }
  .gsn-group:hover .gsn-caret { transform: rotate(180deg); }
}

/* Actions à droite */
.gsn-actions { display: flex; align-items: center; gap: .6rem; margin-left: auto; flex: 0 0 auto; }
.gsn-dd { position: relative; }
.gsn-panel { right: 0; min-width: 190px; display: none; }
.gsn-dd.open > .gsn-panel { display: block; }
.gsn-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  height: 36px; padding: 0 .65rem;
  border-radius: .6rem; border: 1px solid var(--border);
  background: transparent; color: var(--muted); cursor: pointer;
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: .8rem; letter-spacing: .06em;
  transition: color .2s, border-color .2s, background .2s;
}
.gsn-pill:hover, .gsn-dd.open > .gsn-pill { color: var(--text); border-color: rgba(167,139,250,.35); background: rgba(167,139,250,.08); }
.gsn-item {
  display: flex; align-items: center; gap: .55rem; width: 100%; box-sizing: border-box;
  padding: .5rem .7rem; border-radius: .5rem; border: none; background: transparent;
  color: var(--text); text-decoration: none; text-align: left; cursor: pointer;
  font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: .92rem; letter-spacing: .03em;
}
.gsn-item:hover, .gsn-item:focus-visible { background: rgba(167,139,250,.1); }
.gsn-item.active { color: var(--purple-light); background: rgba(124,58,237,.14); }
.gsn-check { width: 1rem; color: var(--purple-light); font-weight: 800; }
.gsn-admin { color: #fbbf24; }
.gsn-logout { color: var(--muted); }
.gsn-sep { height: 1px; margin: .35rem .3rem; background: var(--border); }
.gsn-count {
  margin-left: auto; min-width: 1.2rem; padding: 0 .35rem; border-radius: 999px;
  background: rgba(145,70,255,.25); color: #c4b5fd; font-size: .72rem; font-weight: 800; text-align: center;
}

.gsn-icon-btn {
  position: relative; background: none; border: none; cursor: pointer;
  padding: .3rem .45rem; border-radius: .5rem; color: var(--muted); font-size: 1.05rem; line-height: 1;
  transition: color .15s;
}
.gsn-icon-btn:hover { color: var(--text); }
.gsn-notif-panel { right: 0; width: 300px; max-width: calc(100vw - 1.5rem); padding: 0; overflow: hidden; z-index: 9999; border-color: rgba(145,70,255,.25); border-radius: 14px; }
.gsn-daily {
  padding: .2rem .55rem; border-radius: 999px; background: rgba(251,191,36,.2); border: 1px solid rgba(251,191,36,.5);
  color: #fbbf24; font-weight: 800; font-size: .78rem; text-decoration: none; animation: navDailyPulse 1.8s ease-in-out infinite;
}
.gsn-coins {
  padding: .2rem .55rem; border-radius: 999px; background: rgba(251,191,36,.15); border: 1px solid rgba(251,191,36,.35);
  color: #fbbf24; font-family: 'Space Mono', monospace; font-weight: 800; font-size: .78rem; white-space: nowrap; text-decoration: none;
}
.gsn-coins:hover { background: rgba(251,191,36,.22); }
.gsn-avatar-btn { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem; border: none; background: none; color: var(--muted); cursor: pointer; border-radius: 999px; }
.gsn-avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 2px solid rgba(167,139,250,.35); box-shadow: 0 0 10px rgba(224,64,251,.15);
}
.gsn-avatar-letter {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--purple), var(--accent)); color: #fff;
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 1rem;
}
.gsn-dd.open .gsn-avatar, .gsn-avatar-btn:hover .gsn-avatar { border-color: var(--purple-light); }
.gsn-account-panel { min-width: 250px; }
.gsn-account-head { padding: .45rem .7rem .6rem; border-bottom: 1px solid var(--border); margin-bottom: .35rem; }
.gsn-account-name { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 1rem; color: var(--text); margin-bottom: .35rem; overflow-wrap: anywhere; }
.gsn-account-stats { display: flex; align-items: center; gap: .45rem; }
.gsn-xp-track { flex: 1; min-width: 50px; height: 4px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
:root[data-theme="light"] .gsn-xp-track { background: rgba(0,0,0,.08); }

.gsn-burger, .gsn-login-drawer, .gsn-tabbar, .gsn-sheet, .gsn-sheet-backdrop { display: none; }
.gsn-burger {
  align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  font-size: 1.1rem; line-height: 1; border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: .75rem; cursor: pointer; transition: all .2s ease;
}
.gsn-burger:hover { background: var(--card2); border-color: var(--purple); }

/* Ordinateur un peu étroit : libellés de rubriques plus serrés */
@media (min-width: 1024px) and (max-width: 1240px) {
  .gsn-bar { gap: .5rem .6rem; }
  .gsn-toggle { padding: .35rem .5rem; font-size: .84rem; gap: .35rem; }
}

/* ── Tablette et mobile : rubriques dans le tiroir ☰ ── */
@media (max-width: 1023.98px) {
  .gsn-bar { flex-wrap: wrap; }
  .gsn-burger { display: inline-flex; }
  .gsn-menu { display: none; order: 10; flex: 0 0 100%; }
  body.nav-open .gsn-menu {
    display: block; max-height: min(65vh, 520px); overflow-y: auto;
    border: 1px solid rgba(255,255,255,.06); border-radius: .95rem; background: rgba(8,10,26,.96); padding: .45rem;
  }
  :root[data-theme="light"] body.nav-open .gsn-menu { background: rgba(255,255,255,.98); border-color: var(--border); }
  .gsn-list { flex-direction: column; align-items: stretch; gap: .5rem; }
  .gsn-toggle { pointer-events: none; padding: .35rem .5rem .1rem; font-size: .72rem; border: none; background: none !important; box-shadow: none; color: var(--muted) !important; }
  .gsn-toggle .gsn-caret { display: none; }
  .gsn-event-slot .gsn-toggle { pointer-events: auto; font-size: .9rem; padding: .8rem .9rem; color: #fbbf24 !important; }
  .gsn-sub, .gsn-group.open > .gsn-sub { display: block; position: static; min-width: 0; padding: 0; border: none; box-shadow: none; background: none; }
  .gsn-sub::before { display: none; }
  .gsn-sub a { min-height: 48px; padding: .8rem .9rem; background: rgba(255,255,255,.02); }
  .gsn-sub li + li { margin-top: .3rem; }
}

/* ── Mobile (< 768 px) : barre du bas + panneau qui glisse ── */
@media (max-width: 767.98px) {
  body.gsn-nav { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .gsn-actions { gap: .4rem; }
  .gsn-actions .gsn-login { display: none; }
  .gsn-login-drawer { display: flex; width: 100%; margin-top: .6rem; justify-content: center; }
  .gsn-actions .theme-toggle { width: 38px; height: 38px; font-size: 1.05rem; }
  .gsn-burger { width: 40px; height: 40px; }
  .gsn-pill { height: 34px; padding: 0 .5rem; }

  .gsn-tabbar {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .2rem;
    position: fixed; left: .45rem; right: .45rem; bottom: calc(.45rem + env(safe-area-inset-bottom, 0px)); z-index: 130;
    padding: .25rem; border-radius: 1rem; border: 1px solid rgba(124,58,237,.28);
    background: rgba(11,11,23,.96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 12px 32px rgba(0,0,0,.32);
  }
  :root[data-theme="light"] .gsn-tabbar { background: rgba(255,255,255,.97); box-shadow: 0 8px 24px rgba(15,15,40,.12); }
  .gsn-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
    min-height: 54px; padding: .25rem .1rem; border: none; border-radius: .75rem; background: none;
    color: var(--muted); text-decoration: none; cursor: pointer;
    font-family: 'Rajdhani', sans-serif; font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.05;
  }
  .gsn-tab span:first-child { font-size: 1.15rem; line-height: 1; }
  .gsn-tab.active, .gsn-tab[aria-expanded="true"] {
    color: #fff; background: linear-gradient(135deg, rgba(124,58,237,.28), rgba(6,182,212,.18)); box-shadow: inset 0 0 0 1px rgba(167,139,250,.25);
  }
  :root[data-theme="light"] .gsn-tab.active, :root[data-theme="light"] .gsn-tab[aria-expanded="true"] { color: var(--purple-dark, #5b21b6); }

  .gsn-sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 8650; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .2s ease; }
  .gsn-sheet-backdrop.is-open { opacity: 1; }
  .gsn-sheet {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 8700;
    max-height: 70vh; overflow-y: auto; padding: .4rem .9rem calc(1rem + env(safe-area-inset-bottom, 0px));
    border-radius: 1.1rem 1.1rem 0 0; border: 1px solid rgba(124,58,237,.28); border-bottom: none;
    background: rgba(13,13,24,.98); box-shadow: 0 -16px 40px rgba(0,0,0,.45);
    transform: translateY(100%); transition: transform .22s ease;
  }
  .gsn-sheet.is-open { transform: translateY(0); }
  .gsn-sheet[hidden], .gsn-sheet-backdrop[hidden] { display: none; }
  .gsn-sheet-handle { width: 40px; height: 4px; border-radius: 99px; background: var(--border); margin: .2rem auto .5rem; }
  .gsn-sheet-head {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem;
    font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 1.05rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text);
  }
  .gsn-sheet-close { width: 36px; height: 36px; border-radius: .6rem; border: 1px solid var(--border); background: none; color: var(--muted); cursor: pointer; font-size: .95rem; }
  .gsn-sheet-list li + li { margin-top: .35rem; }
  .gsn-sheet-list a {
    display: flex; align-items: center; gap: .65rem; min-height: 50px; padding: .8rem .9rem; border-radius: .6rem;
    border: 1px solid rgba(255,255,255,.05); background: rgba(255,255,255,.02); color: var(--text); text-decoration: none;
    font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: .95rem; letter-spacing: .06em; text-transform: uppercase;
  }
  .gsn-sheet-list a.active { color: #fff; background: linear-gradient(135deg, rgba(124,58,237,.25), rgba(224,64,251,.15)); border-color: rgba(167,139,250,.2); }
  :root[data-theme="light"] .gsn-sheet-list a.active { color: var(--purple-dark, #5b21b6); }

  /* Éléments déjà fixés en bas : au-dessus de la barre */
  body.gsn-nav #gs-live-banner { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  body.gsn-nav #gs-pwa-banner { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
  .gsn-sheet, .gsn-sheet-backdrop { transition: none; }
}
/* L'ancienne barre mobile (84 px réservés en bas) n'existe plus entre 768 et 1023 px */
@media (min-width: 768px) and (max-width: 1024px) {
  body.gsn-nav { padding-bottom: 0; }
}
/* Petits écrans : header compact */
@media (max-width: 479.98px) {
  .gsn-bar.is-logged .gsn-logo-text, .gsn-bar.is-logged .gs-pumpkin { display: none; }
  .gsn-lang-code { display: none; }
  .gsn-actions .gsn-daily { display: none !important; }
  .gsn-coins { font-size: .72rem; padding: .18rem .45rem; }
  .gsn-actions .gsn-icon-btn { padding: .3rem .25rem; }
}
/* Langue dans le tiroir : seulement sur très petit écran (le 🌐 du header y est masqué) */
.gsn-drawer-lang { display: none; }
.gsn-coins { display: inline-flex; align-items: center; min-height: 32px; min-width: 0; }
@media (max-width: 479.98px) {
  .gsn-actions .gsn-lang { display: none; }
  .gsn-drawer-lang {
    display: flex; align-items: center; gap: .35rem; margin-top: .6rem; padding: .45rem .5rem 0;
    border-top: 1px solid rgba(255,255,255,.06); color: var(--muted);
  }
  .gsn-lang-opt {
    flex: 1; min-height: 44px; border-radius: .6rem; border: 1px solid var(--border); background: transparent; color: var(--muted);
    font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: .85rem; letter-spacing: .06em; cursor: pointer;
  }
  .gsn-lang-opt.active { color: #fff; background: linear-gradient(135deg, rgba(124,58,237,.25), rgba(224,64,251,.15)); border-color: rgba(167,139,250,.3); }
  :root[data-theme="light"] .gsn-lang-opt.active { color: var(--purple-dark, #5b21b6); }
  .gsn-avatar-btn .gsn-caret { display: none; }
  .gsn-bar { gap: .5rem; }
  .gsn-actions { gap: .3rem; }
}
/* Très petits écrans (< 360 px) : header resserré */
@media (max-width: 359.98px) {
  .gsn-coins-unit { display: none; }
  .gsn-bar a, .gsn-bar button { min-width: 38px; min-height: 40px; }
  .gsn-actions .theme-toggle, .gsn-burger { width: 38px; height: 40px; padding: 0; }
  .gsn-actions .gsn-icon-btn { padding: 0; }
  .gsn-avatar { width: 32px; height: 32px; }
  .gsn-actions { gap: .25rem; }
}
