/* =====================================================
   CRYPTOOOKIE — Global Stylesheet
   Aesthetic: Dark Crypto Terminal / Retro-Futuristic
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&family=Syne:wght@400;600;800&family=Dancing+Script:wght@700&family=Playfair+Display:wght@700&family=Press+Start+2P&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
  --cookie: #ffcc00;
  --cookie-deep: #cc8800;
  --cookie-hover: #ffe033;
  --cookie-dim: #cc9900;
  --cookie-glow: rgba(255, 204, 0, 0.25);
  --bg: #0a0a0f;
  --bg-card: #111118;
  --bg-card2: #18181f;
  --bg-hover: #1e1e28;
  --border: rgba(255, 255, 255, 0.07);
  --border-accent: rgba(255, 204, 0, 0.3);
  --text: #e8e8f0;
  --text-dim: #7a7a9a;
  --text-muted: #4a4a6a;
  --success: #00e5a0;
  --danger: #ff4566;
  --info: #00b4ff;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px var(--cookie-glow);
  --radius: 14px;
  --radius-sm: 8px;
  --nav-h: 60px;
  --bottom-nav-h: 64px;
  --font-display: 'Syne', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

body[data-theme="light"] {
  --bg: #f5f4ef;
  --bg-card: #ffffff;
  --bg-card2: #f0efe8;
  --bg-hover: #e8e7de;
  --border: rgba(0, 0, 0, 0.08);
  --border-accent: rgba(180, 130, 0, 0.3);
  --text: #1a1a1a;
  --text-dim: #5a5a6a;
  --text-muted: #9a9aaa;
  --cookie: #cc8800;
  --cookie-deep: #996600;
  --cookie-hover: #e09900;
  --cookie-dim: #996600;
  --cookie-glow: rgba(204, 136, 0, 0.15);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px var(--cookie-glow);
}

/* Improved number legibility across the app */
.stat-value, .price-ticker, .balance-cell, .value-amount, .history-amount {
  font-feature-settings: "tnum" 1, "lnum" 1;
  letter-spacing: -0.01em;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font-mono);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,204,0,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,204,0,0.012) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}
body[data-theme="light"]::before {
  background-image:
    linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.1; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.2rem, 3vw, 1.8rem); }
h3 { font-size: clamp(1rem, 2.5vw, 1.3rem); }

/* ===== TOP NAV ===== */
.top-nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(10, 10, 15, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
}
body[data-theme="light"] .top-nav { background: rgba(245, 244, 239, 0.96); }

.top-nav-brand {
  font-family: var(--font-display); font-weight: 800; font-size: 1.2rem;
  color: var(--cookie); letter-spacing: -0.02em; text-decoration: none;
  display: flex; align-items: center; gap: 8px;
}
.top-nav-links { display: flex; gap: 2px; align-items: center; }
.top-nav-links a {
  padding: 7px 12px; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 0.75rem;
  text-decoration: none; color: var(--text-dim);
  transition: all 0.2s ease; white-space: nowrap;
}
.top-nav-links a:hover, .top-nav-links a.active {
  background: var(--bg-hover); color: var(--cookie);
}
.top-nav-right { display: flex; align-items: center; gap: 10px; }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: rgba(10, 10, 15, 0.98);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  z-index: 1000; padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom);
  align-items: center; justify-content: space-around;
}
body[data-theme="light"] .bottom-nav { background: rgba(245, 244, 239, 0.98); }

.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-muted);
  font-size: 0.58rem; text-decoration: none;
  transition: all 0.2s ease; min-width: 48px; text-align: center;
  font-family: var(--font-mono);
}
.bottom-nav-item.active, .bottom-nav-item:hover { color: var(--cookie); }
.bottom-nav-item .nav-icon { font-size: 1.25rem; line-height: 1; }

/* ===== PAGE ===== */
.page { position: relative; z-index: 1; min-height: 100dvh; padding-top: var(--nav-h); padding-bottom: 20px; }
.container { max-width: 1100px; margin: 0 auto; padding: 20px 16px; }
.dashboard { display: grid; gap: 16px; }

/* ===== STAT ROW ===== */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  transition: border-color 0.2s ease;
}
.stat-card:hover { border-color: var(--border-accent); }
.stat-label { font-size: 0.62rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 6px; }
.stat-value { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.1rem, 3vw, 1.6rem); color: var(--text); line-height: 1; }
.stat-value.highlight { color: var(--cookie); }
.stat-value.success { color: var(--success); }
.stat-value.danger { color: var(--danger); }

/* ===== CARD ===== */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card-header { padding: 16px 20px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-family: var(--font-display); font-weight: 600; font-size: 0.85rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.card-body { padding: 20px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 20px; font-family: var(--font-mono); font-size: 0.85rem; font-weight: 700;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.2s ease; text-decoration: none; white-space: nowrap; position: relative; overflow: hidden;
}
.btn-primary { background: var(--cookie); color: #000; }
.btn-primary:hover:not(:disabled) { background: #ffe033; transform: translateY(-1px); box-shadow: 0 4px 16px var(--cookie-glow); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #ff6080; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(255,69,102,0.4); }
.btn-success { background: var(--success); color: #000; }
.btn-success:hover:not(:disabled) { background: #33ffb8; transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-dim); }
.btn-outline:hover:not(:disabled) { border-color: var(--cookie); color: var(--cookie); background: var(--cookie-glow); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-lg { padding: 16px 32px; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 7px 12px; font-size: 0.72rem; }

/* ===== INPUTS ===== */
.input-field, .inputBox {
  width: 100%; padding: 12px 16px;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font-mono); font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease; outline: none;
}
.input-field:focus, .inputBox:focus { border-color: var(--cookie); box-shadow: 0 0 0 3px var(--cookie-glow); }
.input-field::placeholder, .inputBox::placeholder { color: var(--text-muted); }

.select-wrap { position: relative; }
.select-wrap select, select.input-field {
  width: 100%; padding: 10px 36px 10px 14px;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font-mono); font-size: 0.85rem;
  appearance: none; -webkit-appearance: none; cursor: pointer; outline: none;
  transition: border-color 0.2s ease;
}
.select-wrap select:focus, select.input-field:focus { border-color: var(--cookie); }
.select-wrap::after { content: '▾'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }

/* ===== GRAPH ===== */
.graph-wrapper { position: relative; width: 100%; }
#graph { width: 100%; height: auto; display: block; border-radius: var(--radius-sm); }

.price-labels {
  position: absolute; left: -72px; top: 0; height: 100%;
  display: flex; flex-direction: column; justify-content: space-between;
  font-size: 0.62rem; color: var(--text-muted); font-family: var(--font-mono);
  text-align: right; width: 68px; pointer-events: none; padding: 2px 0;
}
.time-labels { display: flex; justify-content: space-between; font-size: 0.6rem; color: var(--text-muted); margin-top: 6px; }
.graph-tooltip {
  position: absolute; background: rgba(10,10,15,0.95); border: 1px solid var(--border-accent);
  color: var(--text); padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 0.75rem; pointer-events: none; opacity: 0; transition: opacity 0.15s ease;
  z-index: 100; white-space: nowrap; font-family: var(--font-mono);
}
body[data-theme="light"] .graph-tooltip { background: rgba(245,244,239,0.98); }
.graph-tooltip.visible { opacity: 1; }
.tooltip-price { font-weight: 700; color: var(--cookie); }
.tooltip-time { font-size: 0.65rem; color: var(--text-dim); margin-top: 2px; }

/* ===== THEME TOGGLE ===== */
#themeToggle {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-card2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1rem; transition: all 0.2s ease;
  flex-shrink: 0; position: static !important;
}
#themeToggle:hover { border-color: var(--cookie); background: var(--cookie-glow); }

/* ===== BADGE ===== */
.badge { display: inline-block; padding: 3px 8px; border-radius: 100px; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.badge-success { background: rgba(0,229,160,0.15); color: var(--success); }
.badge-danger { background: rgba(255,69,102,0.15); color: var(--danger); }
.badge-info { background: rgba(0,180,255,0.15); color: var(--info); }
.badge-warning { background: rgba(255,204,0,0.15); color: var(--cookie); }

/* ===== MISC ===== */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.price-ticker { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 6vw, 3.5rem); color: var(--cookie); line-height: 1; }

/* Prevent number overflow in inventory/investment cards */
.value-box { overflow: hidden; min-width: 0; }
.value-amount { font-size: clamp(0.85rem, 2.5vw, 1.1rem) !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-price { font-size: clamp(1rem, 3vw, 1.4rem) !important; }

.history-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; background: var(--bg-card2); border-radius: var(--radius-sm);
  margin-bottom: 8px; border: 1px solid var(--border); transition: border-color 0.2s ease;
}
.history-item:hover { border-color: var(--border-accent); }
.history-victim { font-weight: 700; font-size: 0.9rem; }
.history-amount { color: var(--success); font-weight: 700; font-family: var(--font-display); }
.history-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* ===== LOGIN ===== */
.login-wrapper { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.login-box { width: 100%; max-width: 380px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px 32px; display: flex; flex-direction: column; gap: 14px; }
.login-brand { text-align: center; margin-bottom: 8px; }
.login-brand h1 { color: var(--cookie); font-size: 2rem; margin-bottom: 4px; }
.login-brand p { color: var(--text-muted); font-size: 0.78rem; }

/* ===== REQUIREMENT ===== */
.requirement { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--bg-card2); border-radius: var(--radius-sm); margin-bottom: 8px; font-size: 0.85rem; border: 1px solid var(--border); }
.requirement-status.met { color: var(--success); }
.requirement-status.unmet { color: var(--danger); }

/* ===== MINE BTN ===== */
.mine-btn {
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #ff6070, var(--danger));
  border: 3px solid rgba(255,69,102,0.4); color: white;
  font-family: var(--font-display); font-weight: 800; font-size: 1rem;
  cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  transition: all 0.3s ease; box-shadow: 0 0 40px rgba(255,69,102,0.2);
}
.mine-btn:hover:not(:disabled) { transform: scale(1.06); box-shadow: 0 0 60px rgba(255,69,102,0.5); border-color: rgba(255,69,102,0.8); }
.mine-btn:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }
.mine-btn .mine-icon { font-size: 2rem; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 100px; }

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .top-nav-links { display: none; }
  .bottom-nav { display: flex; }
  .page { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 8px); }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .stat-row .stat-card:nth-child(3) { grid-column: 1 / -1; }
  .price-labels { display: none; }
  .graph-wrapper { margin-left: 0 !important; }
  .mine-btn { width: 130px; height: 130px; font-size: 0.85rem; }
  .login-box { padding: 28px 18px; }
}
@media (max-width: 400px) {
  .stat-row { grid-template-columns: 1fr; }
  .stat-row .stat-card:nth-child(3) { grid-column: auto; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.anim-in { animation: fadeSlideUp 0.4s ease forwards; }
@keyframes flashUp { 0% { color: var(--success); } 100% { color: var(--cookie); } }
@keyframes flashDown { 0% { color: var(--danger); } 100% { color: var(--cookie); } }
.price-flash-up { animation: flashUp 1.5s ease; }
.price-flash-down { animation: flashDown 1.5s ease; }

/* ===== LEGACY COMPAT ===== */
.exchange-topbar, .topbar { display: none !important; }
#menuButton, #sideMenu, #menuOverlay { display: none !important; }

/* ===== COSMETICS ===== */
.cosmetic-username { display:inline-block; }
.rarity-badge {
  display: inline-block; padding: 2px 7px; border-radius: 100px;
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; border: 1px solid; font-family: var(--font-mono);
}

/* Aura: Fire */
@keyframes fireFlicker {
  0%,100% { text-shadow: 0 0 8px #ff6600, 0 0 18px #ff3300, 0 -4px 22px #ffaa00; }
  50%      { text-shadow: 0 0 14px #ff9900, 0 0 28px #ff6600, 0 -7px 32px #ffdd00; }
}
.aura-fire { animation: fireFlicker 1.1s ease-in-out infinite; }

/* Aura: Lightning */
@keyframes lightningZap {
  0%,88%,100% { text-shadow: 0 0 4px #88ccff40; }
  90%          { text-shadow: 0 0 8px #ffffff, 0 0 20px #88ccff, 0 0 40px #4499ff; }
  93%          { text-shadow: 0 0 4px #88ccff40; }
  95%          { text-shadow: 0 0 12px #ffffff, 0 0 30px #88ccff; }
}
.aura-lightning { animation: lightningZap 2.4s steps(1) infinite; }

/* Aura: Underglow */
.aura-underglow { text-shadow: 0 6px 12px currentColor, 0 4px 6px currentColor; filter: drop-shadow(0 4px 8px currentColor); }

/* Aura: Pulse (exotic/limited) */
@keyframes cosmoPulse {
  0%,100% { filter: brightness(1) saturate(1); }
  50%     { filter: brightness(1.6) saturate(1.8); }
}
.aura-pulse { animation: cosmoPulse 1.4s ease-in-out infinite; }

/* Tab system */
.tab-bar { display:flex; gap:2px; margin-bottom:20px; background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:4px; }
.tab-btn {
  flex:1; padding:9px 12px; border:none; border-radius:var(--radius-sm);
  background:transparent; color:var(--text-muted); font-family:var(--font-mono);
  font-size:0.78rem; font-weight:600; cursor:pointer; transition:all 0.18s ease; white-space:nowrap;
}
.tab-btn:hover { color:var(--text); background:var(--bg-hover); }
.tab-btn.active { background:var(--cookie); color:#000; }
.tab-panel { display:none; }
.tab-panel.active { display:block; }

/* Cosmetic grid */
.cosmetic-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:12px; }
.cosmetic-card {
  background:var(--bg-card2); border:1px solid var(--border); border-radius:var(--radius);
  padding:14px; text-align:center; transition:all 0.2s ease;
}
.cosmetic-card:hover { border-color:var(--border-accent); transform:translateY(-2px); }
.cosmetic-card.equipped { border-color:var(--cookie); background:rgba(255,204,0,0.06); }
.cosmetic-card.locked { opacity:0.55; }
.cosmetic-preview { font-size:1.1rem; font-weight:700; margin-bottom:8px; min-height:1.8em; line-height:1.8em; }
.cosmetic-name { font-size:0.75rem; color:var(--text); margin-bottom:4px; font-weight:600; }
.cosmetic-price { font-size:0.68rem; color:var(--text-muted); margin-bottom:8px; }

/* Podium */
.podium { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; align-items:end; margin-bottom:28px; }
.podium-slot { display:flex; flex-direction:column; align-items:center; gap:6px; }
.podium-avatar {
  border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display); font-weight:800; color:#000; flex-shrink:0;
  border: 3px solid transparent;
}
.podium-slot.rank-1 .podium-avatar { width:80px; height:80px; font-size:1.6rem; border-color:#FFD700; box-shadow:0 0 24px #FFD70066; }
.podium-slot.rank-2 .podium-avatar { width:64px; height:64px; font-size:1.2rem; border-color:#C0C0C0; }
.podium-slot.rank-3 .podium-avatar { width:56px; height:56px; font-size:1rem; border-color:#CD7F32; }
.podium-stand {
  width:100%; background:var(--bg-card); border:1px solid var(--border);
  border-radius:var(--radius) var(--radius) 0 0; display:flex; flex-direction:column;
  align-items:center; padding:12px 8px 16px; gap:4px;
}
.podium-slot.rank-1 .podium-stand { padding-top:18px; background:rgba(255,215,0,0.06); border-color:rgba(255,215,0,0.25); }
.podium-slot.rank-2 .podium-stand { padding-top:10px; }
.podium-slot.rank-3 .podium-stand { padding-top:8px; }
.podium-rank { font-family:var(--font-display); font-weight:800; font-size:1.3rem; }
.podium-balance { font-size:0.7rem; color:var(--text-muted); }
.podium-uname { font-size:0.85rem; font-weight:700; text-align:center; cursor:pointer; }
.podium-uname:hover { opacity:0.8; }

/* Leaderboard list rows */
.lb-row {
  display:flex; align-items:center; gap:12px; padding:12px 16px;
  background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-sm);
  margin-bottom:8px; cursor:pointer; transition:all 0.15s ease;
}
.lb-row:hover { border-color:var(--border-accent); background:var(--bg-hover); }
.lb-rank { font-family:var(--font-display); font-weight:800; font-size:1rem; color:var(--text-muted); min-width:32px; }
.lb-avatar { width:36px; height:36px; border-radius:50%; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:0.9rem; color:#000; }
.lb-info { flex:1; min-width:0; }
.lb-balance { font-family:var(--font-display); font-weight:700; font-size:0.9rem; color:var(--cookie); white-space:nowrap; }

/* Player modal */
.modal-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,0.7); backdrop-filter:blur(4px);
  z-index:2000; display:flex; align-items:center; justify-content:center; padding:20px;
  opacity:0; pointer-events:none; transition:opacity 0.2s ease;
}
.modal-overlay.open { opacity:1; pointer-events:all; }
.modal-box {
  background:var(--bg-card); border:1px solid var(--border-accent); border-radius:var(--radius);
  padding:28px; max-width:420px; width:100%; max-height:85vh; overflow-y:auto;
  transform:translateY(16px); transition:transform 0.2s ease;
}
.modal-overlay.open .modal-box { transform:translateY(0); }
.modal-close { float:right; background:none; border:none; color:var(--text-muted); cursor:pointer; font-size:1.2rem; }
.modal-close:hover { color:var(--danger); }
.modal-cosmetic-list { margin-top:16px; display:flex; flex-direction:column; gap:8px; }
.modal-cosmetic-row { display:flex; align-items:center; justify-content:space-between; padding:8px 12px; background:var(--bg-card2); border-radius:var(--radius-sm); font-size:0.8rem; }

/* Settings form */
.settings-field { margin-bottom:16px; }
.settings-field label { display:block; font-size:0.72rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.08em; margin-bottom:6px; }
.toggle-row { display:flex; align-items:center; justify-content:space-between; padding:12px 16px; background:var(--bg-card2); border:1px solid var(--border); border-radius:var(--radius-sm); }
.toggle-label { font-size:0.85rem; color:var(--text); }
.toggle-switch { position:relative; width:44px; height:24px; }
.toggle-switch input { opacity:0; width:0; height:0; }
.toggle-slider {
  position:absolute; inset:0; background:var(--bg-hover); border-radius:12px;
  cursor:pointer; transition:0.2s; border:1px solid var(--border);
}
.toggle-slider:before { content:''; position:absolute; width:18px; height:18px; left:2px; top:2px; background:var(--text-muted); border-radius:50%; transition:0.2s; }
.toggle-switch input:checked + .toggle-slider { background:var(--cookie); border-color:var(--cookie); }
.toggle-switch input:checked + .toggle-slider:before { transform:translateX(20px); background:#000; }

/* Aura: Frost */
@keyframes frostShimmer {
  0%,100% { text-shadow: 0 0 8px #88ddff, 0 0 20px #aaeeff60; }
  50%      { text-shadow: 0 0 14px #ccf4ff, 0 0 32px #88ddff80; }
}
.aura-frost { animation: frostShimmer 1.8s ease-in-out infinite; }

/* Aura: Void */
@keyframes voidFlicker {
  0%,100% { text-shadow: 0 0 10px #6600ff, 0 0 24px #330088; filter:brightness(0.9); }
  50%      { text-shadow: 0 0 20px #aa44ff, 0 0 40px #6600ff; filter:brightness(1.3); }
}
.aura-void { animation: voidFlicker 1.6s ease-in-out infinite; }

/* Crate cards */
.crate-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; text-align: center;
  transition: all 0.2s ease; position: relative; overflow: hidden;
}
.crate-card:hover { border-color: var(--border-accent); transform: translateY(-3px); box-shadow: var(--shadow); }
.crate-card.elite { border-color: rgba(255,34,102,0.4); background: rgba(255,34,102,0.04); }
.crate-card.pro   { border-color: rgba(255,153,0,0.4);  background: rgba(255,153,0,0.04); }
.crate-icon  { font-size: 3rem; margin-bottom: 10px; }
.crate-name  { font-family: var(--font-display); font-weight: 800; font-size: 1rem; margin-bottom: 4px; }
.crate-desc  { font-size: 0.68rem; color: var(--text-muted); margin-bottom: 12px; min-height: 2.4em; }
.crate-drops { display: flex; flex-direction: column; gap: 3px; margin-bottom: 14px; }
.crate-drop-row { display: flex; justify-content: space-between; font-size: 0.65rem; padding: 2px 0; }
.crate-price { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; color: var(--cookie); margin-bottom: 12px; }

/* Crate opening animation */
.crate-result-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.88); backdrop-filter: blur(8px);
  z-index: 3000; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.crate-result-overlay.open { opacity: 1; pointer-events: all; }
.crate-result-box {
  background: var(--bg-card); border: 2px solid var(--border-accent);
  border-radius: var(--radius); padding: 40px 32px; text-align: center;
  max-width: 360px; width: 90%;
  transform: scale(0.8); transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.crate-result-overlay.open .crate-result-box { transform: scale(1); }
.crate-result-cosmetic { font-size: 1.8rem; font-weight: 800; margin: 16px 0 8px; }

/* Avatar picker */
.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 10px; }
.avatar-opt {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 1.3rem; cursor: pointer;
  border: 2px solid transparent; transition: all 0.15s ease;
}
.avatar-opt:hover  { border-color: var(--cookie); transform: scale(1.1); }
.avatar-opt.active { border-color: var(--cookie); box-shadow: 0 0 12px var(--cookie-glow); }

/* Store section headers */
.store-section-header {
  display: flex; align-items: center; gap: 10px; margin: 24px 0 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.store-section-title { font-family: var(--font-display); font-weight: 800; font-size: 1rem; }
.store-section-badge { font-size: 0.65rem; padding: 3px 8px; background: var(--bg-card2); border-radius: 100px; color: var(--text-muted); border: 1px solid var(--border); }

/* Placeholder cards */
.placeholder-card {
  background: var(--bg-card); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 28px; text-align: center;
  opacity: 0.6;
}
.placeholder-icon { font-size: 2.5rem; margin-bottom: 8px; }
.placeholder-label { font-size: 0.78rem; color: var(--text-muted); }

/* ===== SETTINGS / PROFILE ===== */
.settings-field { display:flex;flex-direction:column;gap:6px; }
.settings-field label { font-size:.68rem;color:var(--text-muted);text-transform:uppercase;letter-spacing:.08em; }
.toggle-row { display:flex;align-items:center;justify-content:space-between;padding:10px 0;border-bottom:1px solid var(--border); }
.toggle-label { font-size:.85rem;font-weight:600; }
.toggle-switch { position:relative;display:inline-block;width:44px;height:24px;flex-shrink:0; }
.toggle-switch input { opacity:0;width:0;height:0; }
.toggle-slider { position:absolute;inset:0;background:var(--border);border-radius:100px;cursor:pointer;transition:background .2s; }
.toggle-slider::before { content:'';position:absolute;width:18px;height:18px;left:3px;bottom:3px;background:#fff;border-radius:50%;transition:transform .2s; }
.toggle-switch input:checked + .toggle-slider { background:var(--cookie); }
.toggle-switch input:checked + .toggle-slider::before { transform:translateX(20px); }

/* ===== COSMETIC CARDS ===== */
.cosmetic-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:10px; }
.cosmetic-card { background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:12px;display:flex;flex-direction:column;gap:6px;transition:all .2s ease;position:relative; }
.cosmetic-card:hover { border-color:var(--border-accent); }
.cosmetic-card.equipped { border-color:var(--cookie);background:rgba(255,204,0,.05); }
.cosmetic-card.locked { opacity:.55; }
.cosmetic-preview { background:var(--bg-card2);border-radius:var(--radius-sm);padding:12px 6px;text-align:center;min-height:40px;display:flex;align-items:center;justify-content:center;overflow:hidden; }
.cosmetic-username { font-weight:800;font-size:.82rem;font-family:var(--font-display); }
.cosmetic-name { font-size:.78rem;font-weight:700;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.cosmetic-price { font-size:.7rem;color:var(--text-muted); }
.rarity-badge { font-size:.6rem;font-weight:700;padding:2px 7px;border-radius:100px;border:1px solid;display:inline-block;text-transform:uppercase;letter-spacing:.04em; }

/* ===== LEADERBOARD ROWS ===== */
.lb-row { display:flex;align-items:center;gap:12px;padding:11px 14px;background:var(--bg-card2);border-radius:var(--radius-sm);border:1px solid var(--border);transition:all .15s ease; }
.lb-row:hover { border-color:var(--border-accent); }

/* ===== TABS (shared) ===== */
.tab-bar { display:flex;gap:4px;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:4px;margin-bottom:18px; }
.tab-btn { flex:1;padding:9px 14px;background:transparent;border:none;border-radius:calc(var(--radius) - 3px);font-family:var(--font-mono);font-size:.75rem;font-weight:600;color:var(--text-muted);cursor:pointer;transition:all .15s ease;white-space:nowrap; }
.tab-btn:hover { color:var(--text);background:var(--bg-hover); }
.tab-btn.active { background:var(--cookie);color:#000; }
.tab-panel { display:none; }
.tab-panel.active { display:block; }
