@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');

: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:         #5a5f7a;
  --text:          #ece8ff;
  --emerald:       #10b981;
  --yellow:        #fbbf24;
  --red:           #ef4444;
  --blue:          #3b82f6;
  --cyan:          #06b6d4;
  --orange:        #f97316;
  --fuchsia:       #d946ef;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ── 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 { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }
.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;
}
.card-2 { padding: 1.75rem; }

/* ── Navbar ───────────────────────────────────── */
nav.main-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,13,24,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  height: 56px;
  gap: 1.5rem;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo .logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--purple), var(--accent));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  box-shadow: 0 0 10px rgba(224,64,251,.3);
}
.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;
  gap: .25rem;
  flex: 1;
}
.nav-links a {
  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;
}
.nav-links a:hover { color: var(--text); background: rgba(167,139,250,.1); }
.nav-links a.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-right {
  display: flex; align-items: center; gap: .75rem; margin-left: auto;
}
#nav-user-info {
  display: flex; align-items: center; gap: .5rem;
  font-family: 'Space Mono', monospace; font-size: .75rem;
}
.coin-badge {
  background: rgba(251,191,36,.1);
  border: 1px solid rgba(251,191,36,.25);
  border-radius: .5rem;
  padding: .2rem .6rem;
  color: var(--yellow);
  font-family: 'Space Mono', monospace;
  font-size: .75rem;
  font-weight: 700;
}

/* ── 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;
}
.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-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: var(--card);
  border: 1px solid var(--border);
  border-radius: .5rem;
  color: var(--text);
  padding: .5rem .85rem;
  font-family: 'Space Mono', monospace;
  font-size: .8rem;
  outline: none;
  transition: border-color .15s;
  width: 100%;
}
input:focus, select:focus { border-color: rgba(145,70,255,.5); }
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; }
}

.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; }
.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: 900px) {
  .g3 { grid-template-columns: repeat(2, 1fr); }
  .g4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .nav-links a span { display: none; }
}

/* ── 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;
}

/* ── 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-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); }
.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);
}
.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;
}

/* ── 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;
  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: hidden;
}
.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: 1.5rem; right: 1.5rem;
  z-index: 300;
  display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .75rem;
  padding: .75rem 1.1rem;
  font-size: .85rem;
  animation: slideUp .2s ease both;
  max-width: 320px;
  box-shadow: 0 4px 24px rgba(0,0,0,.4);
}
.toast.success { border-color: rgba(16,185,129,.3); }
.toast.error   { border-color: rgba(239,68,68,.3); }
.toast.info    { border-color: rgba(145,70,255,.3); }

/* ── 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: 700px; height: 420px;
  background:
    radial-gradient(ellipse at 40% 50%, rgba(124,58,237,.18) 0%, transparent 60%),
    radial-gradient(ellipse at 65% 50%, rgba(224,64,251,.1) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 60%, rgba(0,212,255,.06) 0%, transparent 45%);
  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-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 {
  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: block;
  position: relative;
  isolation: isolate;
}

/* 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, #9146ff, #bf94ff, #6441a5, #9146ff);
  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%, rgba(145,70,255,.28) 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 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);
}
.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: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: rgba(145,70,255,.5);
  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;
  display: block;
  position: relative;
  z-index: 2;
}
.game-card:hover .banner-emoji {
  animation: float-emoji 2.2s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(145,70,255,.7)) drop-shadow(0 4px 20px rgba(145,70,255,.4));
}

.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, transparent, var(--card) 30%);
}
.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: #8b91b0; line-height: 1.4; }
.game-card:hover .game-card-desc { color: #b0b6d4; }

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

.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;
}

/* ── 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: contain;
  image-rendering: pixelated;
  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;
}
.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: .7rem 1.1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  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; }

/* ── 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-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: pointer;
}
.pride-card .story-header:hover {
  opacity: .96;
}
.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; }
