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

:root {
  /* STAKE — navy-slate with green accent (default) */
  --bg-base: #0f212e;
  --bg-sidebar: #1a2c38;
  --bg-topbar: #1a2c38;
  --bg-card: #1a2c38;
  --bg-card-hover: #2f4553;
  --bg-input: #0f212e;
  --bg-game: #0f212e;
  --bg-controls: #1a2c38;
  --accent: #00e701;
  --accent-dim: #00c900;
  --accent-glow: rgba(0, 231, 1, 0.25);
  --accent-bg: rgba(0, 231, 1, 0.08);
  --purple: #a855f7;
  --red: #ed4163;
  --red-glow: rgba(237, 65, 99, 0.25);
  --gold: #f0b90b;
  --blue: #4d9fec;
  --cyan: #06b6d4;
  --pink: #ec4899;
  --text: #b1bad3;
  --text-bright: #ffffff;
  --text-secondary: #8596a8;
  --text-muted: #556677;
  --border: #2f4553;
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 4px;
  --sidebar-w: 230px;
  --topbar-h: 60px;
  --transition: 0.15s ease;
}

/* === THEME PRESETS === */
html[data-theme="rainbet"] {
  --bg-base: #17181e;
  --bg-sidebar: #1d1f25;
  --bg-topbar: #1d1f25;
  --bg-card: #25272f;
  --bg-card-hover: #2e3038;
  --bg-input: #17181e;
  --bg-game: #17181e;
  --bg-controls: #1d1f25;
  --accent: #ff4e64;
  --accent-dim: #e03a50;
  --accent-glow: rgba(255, 78, 100, 0.28);
  --accent-bg: rgba(255, 78, 100, 0.08);
  --border: #34363f;
  --text: #c5c7d1;
  --text-bright: #ffffff;
  --text-secondary: #90929b;
  --text-muted: #5a5c66;
}
html[data-theme="roobet"] {
  --bg-base: #17141f;
  --bg-sidebar: #1e1a2a;
  --bg-topbar: #1e1a2a;
  --bg-card: #26213a;
  --bg-card-hover: #332c4c;
  --bg-input: #17141f;
  --bg-game: #17141f;
  --bg-controls: #1e1a2a;
  --accent: #fb923c;
  --accent-dim: #ea7c26;
  --accent-glow: rgba(251, 146, 60, 0.28);
  --accent-bg: rgba(251, 146, 60, 0.08);
  --border: #33294a;
  --text: #beb6d1;
  --text-bright: #ffffff;
}
html[data-theme="noir"] {
  --bg-base: #000000;
  --bg-sidebar: #0a0a0a;
  --bg-topbar: #0a0a0a;
  --bg-card: #121212;
  --bg-card-hover: #1e1e1e;
  --bg-input: #000000;
  --bg-game: #050505;
  --bg-controls: #0a0a0a;
  --accent: #e8e8e8;
  --accent-dim: #c0c0c0;
  --accent-glow: rgba(232, 232, 232, 0.22);
  --accent-bg: rgba(232, 232, 232, 0.06);
  --border: #1a1a1a;
  --text: #a0a0a0;
  --text-bright: #ffffff;
  --text-secondary: #707070;
  --text-muted: #4a4a4a;
}
html[data-theme="midnight"] {
  --bg-base: #0a0e1a;
  --bg-sidebar: #111627;
  --bg-topbar: #111627;
  --bg-card: #181e32;
  --bg-card-hover: #222a42;
  --bg-input: #0a0e1a;
  --bg-game: #0a0e1a;
  --bg-controls: #111627;
  --accent: #6366f1;
  --accent-dim: #4f52d4;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --accent-bg: rgba(99, 102, 241, 0.08);
  --border: #242b45;
  --text: #a8afc4;
}
html[data-theme="crimson"] {
  --bg-base: #12080a;
  --bg-sidebar: #1c0d10;
  --bg-topbar: #1c0d10;
  --bg-card: #2a1519;
  --bg-card-hover: #381d22;
  --bg-input: #12080a;
  --bg-game: #12080a;
  --bg-controls: #1c0d10;
  --accent: #ef4444;
  --accent-dim: #c53030;
  --accent-glow: rgba(239, 68, 68, 0.3);
  --accent-bg: rgba(239, 68, 68, 0.08);
  --border: #3a1d24;
  --text: #c4a8af;
}
html[data-theme="emerald"] {
  --bg-base: #062e22;
  --bg-sidebar: #083929;
  --bg-topbar: #083929;
  --bg-card: #0c4535;
  --bg-card-hover: #125442;
  --bg-input: #062e22;
  --bg-game: #062e22;
  --bg-controls: #083929;
  --accent: #34d399;
  --accent-dim: #10b981;
  --accent-glow: rgba(52, 211, 153, 0.3);
  --accent-bg: rgba(52, 211, 153, 0.08);
  --border: #145c48;
  --text: #a7d8c6;
}
html[data-theme="sunset"] {
  --bg-base: #1a0a18;
  --bg-sidebar: #2a1124;
  --bg-topbar: #2a1124;
  --bg-card: #3a1930;
  --bg-card-hover: #4a213e;
  --bg-input: #1a0a18;
  --bg-game: #1a0a18;
  --bg-controls: #2a1124;
  --accent: #f97316;
  --accent-dim: #ea580c;
  --accent-glow: rgba(249, 115, 22, 0.3);
  --accent-bg: rgba(249, 115, 22, 0.08);
  --border: #4f2640;
  --text: #e6bdb2;
}
html[data-theme="arctic"] {
  --bg-base: #0a1420;
  --bg-sidebar: #0f1d2f;
  --bg-topbar: #0f1d2f;
  --bg-card: #172841;
  --bg-card-hover: #213457;
  --bg-input: #0a1420;
  --bg-game: #0a1420;
  --bg-controls: #0f1d2f;
  --accent: #38bdf8;
  --accent-dim: #0ea5e9;
  --accent-glow: rgba(56, 189, 248, 0.3);
  --accent-bg: rgba(56, 189, 248, 0.08);
  --border: #223e63;
  --text: #a8c5e0;
}
html[data-theme="royal"] {
  --bg-base: #12082a;
  --bg-sidebar: #1a0f3a;
  --bg-topbar: #1a0f3a;
  --bg-card: #241552;
  --bg-card-hover: #301e68;
  --bg-input: #12082a;
  --bg-game: #12082a;
  --bg-controls: #1a0f3a;
  --accent: #a855f7;
  --accent-dim: #9333ea;
  --accent-glow: rgba(168, 85, 247, 0.3);
  --accent-bg: rgba(168, 85, 247, 0.08);
  --border: #382670;
  --text: #c4a8e0;
}
html[data-theme="mono"] {
  --bg-base: #18181b;
  --bg-sidebar: #202024;
  --bg-topbar: #202024;
  --bg-card: #27272a;
  --bg-card-hover: #323237;
  --bg-input: #18181b;
  --bg-game: #18181b;
  --bg-controls: #202024;
  --accent: #fafafa;
  --accent-dim: #d4d4d4;
  --accent-glow: rgba(250, 250, 250, 0.25);
  --accent-bg: rgba(250, 250, 250, 0.08);
  --border: #3f3f46;
  --text: #a1a1aa;
}
html[data-theme="blood"] {
  --bg-base: #100305;
  --bg-sidebar: #1c0609;
  --bg-topbar: #1c0609;
  --bg-card: #2a0b10;
  --bg-card-hover: #3a0f15;
  --bg-input: #100305;
  --bg-game: #100305;
  --bg-controls: #1c0609;
  --accent: #dc2626;
  --accent-dim: #991b1b;
  --accent-glow: rgba(220, 38, 38, 0.4);
  --accent-bg: rgba(220, 38, 38, 0.1);
  --border: #3d1218;
  --text: #d4a5a9;
}

html, body { height: 100%; }
body {
  font-family: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  -ms-touch-action: manipulation;
}

#app { display: flex; flex-direction: column; height: 100vh; }

/* ==================== TOPBAR ==================== */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  flex-shrink: 0;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.topbar.scrolled {
  background: rgba(10, 10, 18, 0.82);
  backdrop-filter: blur(24px) saturate(1.4);
  border-bottom-color: rgba(255,255,255,0.08);
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.logo-link { text-decoration: none; }
.logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-bright);
  user-select: none;
  transition: text-shadow 0.2s;
}
.logo:hover { text-shadow: 0 0 20px var(--accent-glow); }
.logo span { color: var(--accent); }
.topbar-right { display: flex; align-items: center; gap: 10px; overflow: hidden; flex-shrink: 1; min-width: 0; }

.wallet-pill {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border-radius: 100px;
  overflow: hidden;
  height: 38px;
}
.wallet-bal {
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 6px;
}
.wallet-bal .currency { color: var(--gold); font-size: 11px; font-weight: 600; }
.wallet-deposit {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 0 16px;
  height: 100%;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
}
.wallet-deposit:hover { background: var(--accent-dim); }

.user-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 100px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
}
.user-pill:hover { background: var(--bg-card-hover); }

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-dim)); color: #000; position: relative; overflow: hidden; }
.btn-primary:hover { box-shadow: 0 0 24px var(--accent-glow), 0 4px 16px rgba(0,0,0,0.3); }
.btn-primary:active::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255,255,255,0.3) 0%, transparent 60%); }
.btn-primary:disabled { background: #111a14; color: #2a3a2e; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { box-shadow: 0 0 24px var(--red-glow); }
.btn-secondary { background: var(--bg-card-hover); color: var(--text); }
.btn-secondary:hover { background: var(--border); color: var(--text-bright); }
.btn-discord { background: #5865f2; color: #fff; border-radius: 100px; padding: 10px 24px; }
.btn-discord:hover { background: #4752c4; }
.btn-discord svg { flex-shrink: 0; }
.btn-sm { padding: 5px 10px; font-size: 11px; border-radius: var(--radius-xs); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-bright); }

/* ==================== LAYOUT ==================== */
.main-layout { display: flex; flex: 1; overflow: hidden; }

/* ==================== CHAT ==================== */
.chat-panel {
  width: 320px;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 56px;
  right: 0;
  bottom: 0;
  z-index: 201;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 24px rgba(0,0,0,0.4);
}
.chat-panel.open { transform: translateX(0); }
.chat-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.chat-close:hover { color: var(--text-bright); }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
}
.chat-msg {
  background: var(--bg-card);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.35;
  word-wrap: break-word;
  animation: bounceIn 0.2s ease-out;
}
.chat-msg-user { color: var(--accent); font-weight: 700; font-size: 11px; margin-bottom: 2px; }
.chat-msg-text { color: var(--text); }
.chat-input-row {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}
.chat-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.chat-input:focus { outline: none; border-color: var(--accent); }
.chat-send {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  width: 36px;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}
.chat-send:hover { filter: brightness(1.1); }
.discord-fab {
  position: fixed;
  bottom: 140px;
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.18s ease, filter 0.18s ease;
}
.discord-fab:hover { transform: scale(1.08); filter: brightness(1.12); }
@media (max-width: 900px) {
  .discord-fab { bottom: 128px; }
}
.chat-fab {
  position: fixed;
  bottom: 78px;
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  border: none;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 900px) {
  .chat-panel { bottom: 52px; width: 100%; max-width: 340px; }
  .chat-fab { bottom: 66px; }
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 12px 8px;
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar-install, .sidebar-discord {
  position: sticky;
  margin: 8px 0 0;
  padding: 10px 12px;
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: filter 0.15s ease, transform 0.15s ease;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}
.sidebar-install {
  bottom: 54px;
  background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 -6px 12px rgba(0,0,0,0.35);
}
.sidebar-install:hover { filter: brightness(1.2); transform: translateY(-1px); }
.sidebar-install svg { flex-shrink: 0; }
.sidebar-discord {
  bottom: 0;
  background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
  border: 1px solid rgba(88, 101, 242, 0.5);
  box-shadow: 0 -6px 12px rgba(0,0,0,0.35);
}
.sidebar-discord:hover { filter: brightness(1.12); transform: translateY(-1px); }
.sidebar-discord svg { flex-shrink: 0; }

/* Install FAB on mobile, sits above Discord FAB */
.install-fab {
  position: fixed;
  bottom: 202px;
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
  border: 1px solid rgba(255,255,255,0.18);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, filter 0.18s ease;
}
.install-fab:hover { transform: scale(1.08); filter: brightness(1.2); }
@media (max-width: 900px) {
  .install-fab { bottom: 190px; }
}
@media (display-mode: standalone) {
  /* Already installed — hide both install entry points */
  .install-fab, .sidebar-install { display: none !important; }
}
.sidebar-section { margin-bottom: 16px; }
.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 8px 12px 4px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
}
.sidebar-link:hover { background: var(--glass); color: var(--text-bright); }
.sidebar-link { position: relative; }
.sidebar-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}
.sidebar-link.active { background: var(--accent-bg); color: var(--accent); }
.sidebar-link.active::before { transform: translateY(-50%) scaleY(1); }
.sidebar-link.active .sidebar-icon { filter: none; }
.sidebar-icon { width: 22px; text-align: center; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.sidebar-icon svg { width: 18px; height: 18px; color: inherit; }
/* border-left replaced by ::before accent bar above */

/* ==================== CONTENT ==================== */
.content { flex: 1; overflow-y: auto; padding: 20px; scroll-behavior: smooth; }
/* Page-level content wrapper keeps everything centered up to 1400px */
.content > .home-hero-discord,
.content > .game-grid,
.content > .section-header,
.content > .section-title,
.content > .info-card,
.content > h2,
.content > .stats-grid,
.content > .profile-hero,
.content > .choice-group { max-width: 1400px; margin-left: auto; margin-right: auto; }

/* ==================== HOME PAGE — Discord-style hero ==================== */
.home-hero-discord {
  position: relative;
  overflow: hidden;
  padding: 44px 40px;
  margin-bottom: 22px;
  border-radius: 20px;
  background: linear-gradient(135deg, #5865f2 0%, #4752c4 40%, #3c45a5 100%);
  border: 1px solid rgba(88, 101, 242, 0.45);
  box-shadow: 0 10px 40px rgba(88, 101, 242, 0.22);
}
.home-hero-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 20%, rgba(255,255,255,0.18), transparent 55%),
    radial-gradient(ellipse at 85% 80%, rgba(0,231,1,0.18), transparent 55%);
  pointer-events: none;
}
.home-hero-inner {
  position: relative;
  display: flex;
  gap: 28px;
  align-items: center;
  flex-wrap: wrap;
}
.home-hero-icon {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  background: rgba(255,255,255,0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22);
}
.home-hero-copy { flex: 1; min-width: 260px; }
.home-hero-eyebrow {
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-weight: 800;
  margin-bottom: 4px;
}
.home-hero-trust {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 231, 1, 0.14);
  border: 1px solid rgba(0, 231, 1, 0.35);
  color: #d4fdd0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 6px 12px;
  border-radius: 100px;
  margin-bottom: 12px;
}
.home-hero-trust b { color: #fff; font-weight: 900; }
.home-hero-trust-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00e701;
  box-shadow: 0 0 0 0 rgba(0, 231, 1, 0.7);
  animation: trustPulse 1.8s ease-out infinite;
}
@keyframes trustPulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 231, 1, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(0, 231, 1, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 231, 1, 0); }
}
.home-hero-title {
  font-size: 38px;
  font-weight: 900;
  color: #fff;
  line-height: 1.08;
  margin: 0 0 10px;
  letter-spacing: -0.5px;
}
.home-hero-sub {
  color: rgba(255,255,255,0.86);
  font-size: 15px;
  line-height: 1.5;
  max-width: 640px;
  margin: 0;
}
.home-hero-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.home-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 100px;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  transition: transform 0.15s ease, background 0.15s ease, filter 0.15s ease;
}
.home-hero-btn:hover { background: rgba(255,255,255,0.16); transform: translateY(-1px); }
.home-hero-btn-primary {
  background: #fff;
  color: #4752c4;
  font-weight: 900;
  border-color: transparent;
}
.home-hero-btn-primary:hover { background: #fff; filter: brightness(1.04); }

@media (max-width: 700px) {
  .home-hero-discord { padding: 28px 22px; border-radius: 16px; }
  .home-hero-inner { gap: 18px; }
  .home-hero-icon { width: 62px; height: 62px; border-radius: 16px; }
  .home-hero-icon svg { width: 36px; height: 28px; }
  .home-hero-title { font-size: 26px; }
  .home-hero-sub { font-size: 13.5px; }
  .home-hero-btn { padding: 10px 16px; font-size: 13px; }
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-title { font-size: 16px; font-weight: 700; color: var(--text-bright); }
.section-link { font-size: 12px; color: var(--text-muted); text-decoration: none; }
.section-link:hover { color: var(--accent); }

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.game-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  text-decoration: none;
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: center;
  will-change: transform;
  display: block;
  position: relative;
  border: 1px solid var(--border);
}
.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  transition: left 0.5s ease;
  z-index: 2;
  pointer-events: none;
}
.game-card:hover::before { left: 150%; }
.game-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-lg), 0 0 30px var(--accent-bg);
  border-color: var(--accent-glow);
}
.game-card-img {
  width: 100%;
  aspect-ratio: 10 / 13;
  position: relative;
  overflow: hidden;
  background: #0a0a12;
}
.game-card-img svg { width: 100%; height: 100%; display: block; }
.game-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  z-index: 2;
}

/* ==================== LIVE BETS BAR ==================== */
.live-bets-bar {
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  overflow: hidden;
  flex-shrink: 0;
}
.live-bets-label {
  color: var(--accent);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: livePulse 2s infinite; }
.live-bets-scroll {
  display: flex;
  overflow: hidden;
  flex: 1;
  min-width: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
}
.live-bets-track {
  display: flex;
  gap: 24px;
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: 24px;
  animation: marquee 60s linear infinite;
  will-change: transform;
}
.live-bet-item {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.live-bet-item .game { color: var(--text); font-weight: 600; }
.live-bet-item .win { color: var(--accent); font-weight: 600; }
.live-bet-item .loss { color: var(--red); font-weight: 600; }

/* ==================== GAME HEADER (back button) ==================== */
.game-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 14px;
}
.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}
.back-btn:hover { background: var(--bg-card-hover); color: var(--text-bright); }
.back-btn svg { width: 16px; height: 16px; }
.game-header-icon { display: flex; color: var(--accent); }
.game-header-icon svg { width: 20px; height: 20px; }
.game-header-title { font-size: 16px; font-weight: 700; color: var(--text-bright); }

/* ==================== PAGE TRANSITIONS ==================== */
.page-exit { animation: pageOut 0.12s ease forwards; }
.page-enter { animation: pageIn 0.2s ease forwards; }
@keyframes pageOut { to { opacity: 0; transform: translateY(6px); } }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ==================== GAME PAGE LAYOUT ==================== */
.game-page {
  display: flex;
  gap: 0;
  max-width: 1200px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  min-height: 520px;
}
.game-controls {
  width: 280px;
  flex-shrink: 0;
  background: var(--bg-controls);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.game-area {
  flex: 1;
  background: var(--bg-game);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  position: relative;
  overflow: hidden;
}

/* ==================== FORM CONTROLS (Stake-style) ==================== */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-bright);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition: border-color var(--transition);
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.form-input::placeholder { color: var(--text-muted); font-weight: 400; }
select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b8a9e' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.input-row {
  display: flex;
  gap: 4px;
  align-items: stretch;
}
.input-row .form-input { flex: 1; min-width: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-row .btn-mult {
  padding: 0 10px;
  background: var(--border);
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  border-right: 1px solid var(--bg-input);
}
.input-row .btn-mult:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-right: none; }
.input-row .btn-mult:hover { background: var(--bg-card-hover); color: var(--text-bright); }

.btn-play {
  width: 100%;
  padding: 14px;
  font-size: 14px;
  font-weight: 800;
  border-radius: var(--radius-sm);
  margin-top: auto;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.choice-group { display: flex; gap: 4px; }
.choice-btn {
  flex: 1;
  padding: 9px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
}
.choice-btn:hover { border-color: var(--text-muted); color: var(--text-bright); }
.choice-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }

/* ==================== RESULT BANNER (below game, not overlay) ==================== */
.result-banner {
  position: absolute;
  bottom: -40px;
  left: 0;
  right: 0;
  height: 90px;
  display: flex;
  align-items: flex-start;
  transform-origin: center top;
  justify-content: center;
  gap: 20px;
  padding: 12px 24px 0;
  z-index: 10;
  animation: slideBannerUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
.result-banner.win { background: radial-gradient(ellipse 75% 110% at 50% 95%, var(--accent-glow) 0%, var(--accent-bg) 50%, transparent 85%); }
.result-banner.lose { background: radial-gradient(ellipse 75% 110% at 50% 95%, var(--red-glow) 0%, rgba(237,65,99,0.08) 50%, transparent 85%); }
.rb-mult { font-size: 36px; font-weight: 700; letter-spacing: -1px; animation: bounceIn 0.4s; }
.result-banner.win .rb-mult { color: var(--accent); text-shadow: 0 0 40px var(--accent-glow), 0 0 80px var(--accent-bg); }
.result-banner.lose .rb-mult { color: var(--red); text-shadow: 0 0 40px var(--red-glow); }
.rb-amt { font-size: 22px; font-weight: 700; animation: bounceIn 0.4s 0.1s both; }
.result-banner.win .rb-amt { color: var(--accent); }
.result-banner.lose .rb-amt { color: var(--red); }
@keyframes slideBannerUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Live-updating "● LIVE" pill used on Leaderboard + Tournament */
.live-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--accent-bg);
  color: var(--accent);
  vertical-align: middle;
  animation: liveDotPulse 2s ease-in-out infinite;
}
.live-pill.pulse { animation: liveFlash 0.6s ease-out 1, liveDotPulse 2s ease-in-out infinite 0.6s; }
@keyframes liveDotPulse { 0%, 100% { opacity: 0.7 } 50% { opacity: 1 } }
@keyframes liveFlash { 0% { background: var(--accent); color: #fff; transform: scale(1.08) } 100% { background: var(--accent-bg); color: var(--accent); transform: scale(1) } }

/* ==================== MINES ==================== */
.mines-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  width: 320px;
}
.mine-tile {
  aspect-ratio: 1;
  background: var(--bg-card-hover);
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0.2, 0.2, 1), background 0.2s, border-color 0.2s;
  position: relative;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.mine-tile:hover:not(.revealed):not(.disabled) {
  background: var(--bg-card);
  border-color: var(--text-muted);
  transform: scale(1.05);
}
.mine-tile.safe {
  background: var(--accent-bg);
  border-color: var(--accent);
  animation: tileFlip 0.55s cubic-bezier(0.4, 0.2, 0.2, 1) both;
  box-shadow: 0 0 24px var(--accent-glow), inset 0 0 16px var(--accent-bg);
}
.mine-tile.bomb {
  background: rgba(237,66,69,0.18);
  border-color: var(--red);
  animation: tileFlipShake 0.6s cubic-bezier(0.4, 0.2, 0.2, 1) both;
  box-shadow: 0 0 28px rgba(237,66,69,0.5), inset 0 0 18px rgba(237,66,69,0.25);
}
@keyframes tileFlip { 0% { transform: rotateY(0); } 50% { transform: rotateY(90deg) scale(0.85); } 100% { transform: rotateY(0) scale(1); } }
@keyframes tileFlipShake { 0% { transform: rotateY(0); } 40% { transform: rotateY(90deg) scale(0.85); } 60% { transform: rotateY(0) translateX(-4px); } 70% { transform: translateX(4px); } 80% { transform: translateX(-3px); } 90% { transform: translateX(2px); } 100% { transform: translateX(0); } }
.mine-tile.disabled { cursor: default; opacity: 0.4; }

/* ==================== BLACKJACK ==================== */
.bj-table {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 20px;
}
.card-hand { display: flex; gap: 10px; justify-content: center; }
.playing-card {
  width: 72px;
  height: 100px;
  background: #fff;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 16px;
  font-weight: 700;
  color: #111;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  animation: dealCard 0.3s ease;
}
.playing-card.red { color: #d32f2f; }
@keyframes bjCardDeal {
  0%   { opacity: 0; transform: translate(-240px, -140px) rotate(-18deg) scale(0.85); }
  55%  { opacity: 1; }
  100% { opacity: 1; transform: translate(0,0) rotate(0) scale(1); }
}
.playing-card[data-deal="1"] {
  animation: bjCardDeal 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--deal-i, 0) * 0.12s);
}
.playing-card.hidden {
  background: linear-gradient(135deg, #2f4553, #1a2c38);
  color: #2f4553;
  background-image: repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(255,255,255,0.03) 4px, rgba(255,255,255,0.03) 8px);
}
.hand-label { font-size: 11px; color: var(--text-secondary); text-align: center; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.hand-value { font-size: 20px; font-weight: 800; text-align: center; color: var(--text-bright); }

/* ==================== PLINKO ==================== */
.plinko-canvas { width: 100%; height: 100%; }

/* ==================== CRASH ==================== */
.crash-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.crash-mult {
  font-size: 80px;
  font-weight: 800;
  color: var(--text-bright);
  transition: color 0.2s;
  font-variant-numeric: tabular-nums;
}
.crash-mult.win { color: var(--accent); text-shadow: 0 0 80px var(--accent-glow); }
.crash-mult.lose { color: var(--red); text-shadow: 0 0 80px var(--red-glow); }
.crash-label { font-size: 14px; color: var(--text-secondary); margin-top: 8px; font-weight: 600; }

/* ==================== SLOTS ==================== */
.slots-display { display: flex; gap: 10px; align-items: center; }
.slot-reel {
  width: 96px;
  height: 110px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  transition: all 0.2s;
}
.slot-reel.spinning { animation: slotSpin 0.1s infinite; border-color: var(--accent); }

/* ==================== DICE ==================== */
.dice-wrap { width: 85%; padding: 20px; }
.dice-result-big {
  font-size: 64px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 24px;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s;
}
.dice-bar {
  width: 100%;
  height: 8px;
  background: var(--red);
  border-radius: 100px;
  position: relative;
  margin: 16px 0;
}
.dice-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  transition: width 0.2s;
}
.dice-marker {
  position: absolute;
  top: -6px;
  width: 3px;
  height: 20px;
  background: var(--text-bright);
  border-radius: 2px;
  transition: left 0.2s;
}
.dice-result-marker {
  position: absolute;
  top: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--text-bright);
  border: 3px solid var(--bg-base);
  transform: translateX(-50%);
  transition: left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.dice-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==================== COINFLIP ==================== */
.coin {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 800;
  background: linear-gradient(145deg, #ffd700, #b8860b);
  color: #1a1a2e;
  box-shadow: 0 8px 32px rgba(255,215,0,0.15);
  perspective: 600px;
}
.coin.flip { animation: coinFlip 0.5s ease-in-out; }

/* ==================== ROULETTE ==================== */
.roulette-number {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  font-weight: 800;
  border: 3px solid;
  animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.roulette-number.red { background: rgba(237,66,69,0.15); border-color: var(--red); color: var(--red); }
.roulette-number.black { background: rgba(150,150,150,0.1); border-color: #666; color: #ccc; }
.roulette-number.green { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }

/* ==================== INFO / WALLET / FAIRNESS ==================== */
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-sizing: border-box;
}
/* On wide screens, wallet and profile pages flow two cards side by side */
@media (min-width: 900px) {
  .info-card.col-half { max-width: calc(50% - 8px); display: inline-block; vertical-align: top; }
}
.info-card h3 { font-size: 15px; font-weight: 700; color: var(--text-bright); margin-bottom: 12px; }
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--text-secondary); }
.stat-value { font-weight: 600; color: var(--text-bright); }
.mono { font-family: 'Courier New', monospace; font-size: 11px; word-break: break-all; color: var(--text-secondary); }

/* ==================== HISTORY ==================== */
.bet-list { display: flex; flex-direction: column; gap: 4px; max-width: 700px; }
.bet-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.bet-row .game { font-weight: 600; width: 72px; color: var(--text-bright); }
.bet-row .amount { color: var(--text-secondary); }
.bet-row .mult { font-weight: 600; color: var(--text-bright); }
.bet-row .profit-positive { color: var(--accent); font-weight: 700; }
.bet-row .profit-negative { color: var(--red); font-weight: 700; }

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes dealCard { 0% { transform: translateY(-30px) rotate(-5deg); opacity: 0; } 100% { transform: translateY(0) rotate(0); opacity: 1; } }
@keyframes tileReveal { 0% { transform: scale(0.8); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }
@keyframes coinFlip { 0% { transform: rotateY(0); } 100% { transform: rotateY(720deg); } }
@keyframes slotSpin { 0% { transform: translateY(-3px); } 50% { transform: translateY(3px); } 100% { transform: translateY(-3px); } }
@keyframes livePulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes slideLeft { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes bounceIn { 0% { transform: scale(0.3); opacity: 0; } 50% { transform: scale(1.08); } 70% { transform: scale(0.95); } 100% { transform: scale(1); opacity: 1; } }
@keyframes ripple { 0% { transform: scale(0); opacity: 0.5; } 100% { transform: scale(4); opacity: 0; } }
@keyframes hotStreak { 0%,100% { border-color: #f0b90b; box-shadow: 0 0 15px rgba(240,185,11,0.2); } 50% { border-color: #ef4444; box-shadow: 0 0 25px rgba(239,68,68,0.2); } }
@keyframes floatUp { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-50px); } }
@keyframes cardIn { 0% { opacity: 0; transform: translateY(18px) scale(0.94); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes resultSlam { 0% { transform: scaleY(0.4) translateY(40px); opacity: 0; } 60% { transform: scaleY(1.08) translateY(-4px); opacity: 1; } 80% { transform: scaleY(0.97) translateY(2px); } 100% { transform: scaleY(1) translateY(0); } }
@keyframes emojiFloat { 0% { transform: translate(0,0) rotate(0deg) scale(0.6); opacity: 0; } 15% { opacity: 1; transform: translate(var(--dx-mid),var(--dy-mid)) rotate(calc(var(--rot) * 0.4)) scale(1.15); } 100% { transform: translate(var(--dx),var(--dy)) rotate(var(--rot)) scale(0.4); opacity: 0; } }
@keyframes hotStreakFlicker { 0%,100% { opacity: 0.55; } 50% { opacity: 0.85; } }
@keyframes coinRain { 0% { transform: translateY(-60px) rotate(0deg); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(110vh) rotate(720deg); opacity: 0.4; } }
@keyframes nearMissFlash { 0%,100% { box-shadow: inset 0 0 0 0 transparent; } 25% { box-shadow: inset 0 0 40px 0 rgba(240,185,11,0.55); } 75% { box-shadow: inset 0 0 40px 0 rgba(240,185,11,0.35); } }
@keyframes toastIn { 0% { transform: translateX(40px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes skeletonShimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* Theme accent overrides (activated by data-accent on <html>) */
html[data-accent="green"]    { --accent: #00e701; --accent-dim: #00c900; --accent-bg: rgba(0,231,1,0.1);   --accent-glow: rgba(0,231,1,0.4); }
html[data-accent="lime"]     { --accent: #a3e635; --accent-dim: #84cc16; --accent-bg: rgba(163,230,53,0.1); --accent-glow: rgba(163,230,53,0.4); }
html[data-accent="emerald"]  { --accent: #10b981; --accent-dim: #059669; --accent-bg: rgba(16,185,129,0.1); --accent-glow: rgba(16,185,129,0.4); }
html[data-accent="teal"]     { --accent: #14b8a6; --accent-dim: #0d9488; --accent-bg: rgba(20,184,166,0.1); --accent-glow: rgba(20,184,166,0.4); }
html[data-accent="cyan"]     { --accent: #06b6d4; --accent-dim: #0891b2; --accent-bg: rgba(6,182,212,0.1);  --accent-glow: rgba(6,182,212,0.4); }
html[data-accent="sky"]      { --accent: #0ea5e9; --accent-dim: #0284c7; --accent-bg: rgba(14,165,233,0.1); --accent-glow: rgba(14,165,233,0.4); }
html[data-accent="blue"]     { --accent: #3b82f6; --accent-dim: #2563eb; --accent-bg: rgba(59,130,246,0.1); --accent-glow: rgba(59,130,246,0.4); }
html[data-accent="indigo"]   { --accent: #6366f1; --accent-dim: #4f46e5; --accent-bg: rgba(99,102,241,0.1); --accent-glow: rgba(99,102,241,0.4); }
html[data-accent="violet"]   { --accent: #8b5cf6; --accent-dim: #7c3aed; --accent-bg: rgba(139,92,246,0.1); --accent-glow: rgba(139,92,246,0.4); }
html[data-accent="purple"]   { --accent: #a855f7; --accent-dim: #9333ea; --accent-bg: rgba(168,85,247,0.1); --accent-glow: rgba(168,85,247,0.4); }
html[data-accent="fuchsia"]  { --accent: #d946ef; --accent-dim: #c026d3; --accent-bg: rgba(217,70,239,0.1); --accent-glow: rgba(217,70,239,0.4); }
html[data-accent="pink"]     { --accent: #ec4899; --accent-dim: #db2777; --accent-bg: rgba(236,72,153,0.1); --accent-glow: rgba(236,72,153,0.4); }
html[data-accent="rose"]     { --accent: #f43f5e; --accent-dim: #e11d48; --accent-bg: rgba(244,63,94,0.1);  --accent-glow: rgba(244,63,94,0.4); }
html[data-accent="red"]      { --accent: #ef4444; --accent-dim: #dc2626; --accent-bg: rgba(239,68,68,0.1);  --accent-glow: rgba(239,68,68,0.4); }
html[data-accent="orange"]   { --accent: #fb923c; --accent-dim: #ea7c26; --accent-bg: rgba(251,146,60,0.1); --accent-glow: rgba(251,146,60,0.4); }
html[data-accent="amber"]    { --accent: #f59e0b; --accent-dim: #d97706; --accent-bg: rgba(245,158,11,0.1); --accent-glow: rgba(245,158,11,0.4); }
html[data-accent="gold"]     { --accent: #f0b90b; --accent-dim: #ca8a04; --accent-bg: rgba(240,185,11,0.1); --accent-glow: rgba(240,185,11,0.4); }
html[data-accent="white"]    { --accent: #e8e8e8; --accent-dim: #c0c0c0; --accent-bg: rgba(232,232,232,0.1); --accent-glow: rgba(232,232,232,0.4); }

/* Fluid accent transitions — smooth color/background switch when theme/accent changes */
.sidebar-link, .choice-btn, .btn, .wallet-deposit, .game-card, .form-input,
.mobile-nav a, .logo, .logo span, .tab-btn, .info-card, .result-banner .rb-mult,
.result-banner .rb-amt, .sidebar-link.active, .topbar {
  transition: color 0.25s ease, background-color 0.25s ease, background 0.25s ease,
              border-color 0.25s ease, box-shadow 0.25s ease, text-shadow 0.25s ease;
}

/* Reduced motion */
html[data-reduced-motion="1"] *,
html[data-reduced-motion="1"] *::before,
html[data-reduced-motion="1"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

/* Mobile nav active-pill animation */
.mobile-nav a { position: relative; }
.mobile-nav a::before {
  content: '';
  position: absolute;
  inset: 4px;
  background: var(--accent-bg);
  border-radius: 10px;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: -1;
}
.mobile-nav a.active::before { opacity: 1; transform: scale(1); }

.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s infinite linear;
  border-radius: 6px;
  color: transparent;
  user-select: none;
}
.skeleton-card { height: 140px; border-radius: 12px; }
.skeleton-row  { height: 18px; margin-bottom: 8px; }
.skeleton-pill { height: 36px; border-radius: 100px; }

@media (max-width: 900px) {
  .game-controls {
    position: sticky !important;
    bottom: 0;
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border) !important;
    padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
    z-index: 10;
  }
}

#toast-stack { position: fixed; top: 72px; right: 16px; z-index: 9500; display: flex; flex-direction: column; gap: 8px; pointer-events: none; max-width: calc(100vw - 32px); }
@media (max-width: 900px) { #toast-stack { top: auto; bottom: 66px; left: 50%; right: auto; transform: translateX(-50%); align-items: center; } }
.toast-stack-item { background: #3b82f6e6; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; box-shadow: 0 4px 18px rgba(0,0,0,0.4); animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1); pointer-events: auto; cursor: pointer; min-width: 200px; max-width: 380px; backdrop-filter: blur(8px); }

.game-card:nth-child(1) { animation-delay: 0.00s; }
.game-card:nth-child(2) { animation-delay: 0.04s; }
.game-card:nth-child(3) { animation-delay: 0.08s; }
.game-card:nth-child(4) { animation-delay: 0.12s; }
.game-card:nth-child(5) { animation-delay: 0.16s; }
.game-card:nth-child(6) { animation-delay: 0.20s; }
.game-card:nth-child(7) { animation-delay: 0.24s; }
.game-card:nth-child(8) { animation-delay: 0.28s; }
.game-card:nth-child(9) { animation-delay: 0.32s; }
.game-card:nth-child(10) { animation-delay: 0.36s; }
.game-card:nth-child(11) { animation-delay: 0.40s; }
.game-card:nth-child(12) { animation-delay: 0.44s; }
.game-card:nth-child(13) { animation-delay: 0.48s; }
.game-card:nth-child(14) { animation-delay: 0.52s; }
.game-card:nth-child(15) { animation-delay: 0.56s; }
.game-card:nth-child(16) { animation-delay: 0.60s; }
.game-card:nth-child(17) { animation-delay: 0.64s; }
.game-card:nth-child(18) { animation-delay: 0.68s; }
.game-card:nth-child(19) { animation-delay: 0.72s; }
.game-card:nth-child(20) { animation-delay: 0.76s; }
.game-card:nth-child(21) { animation-delay: 0.80s; }

.hot-streak-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 998;
  background:
    radial-gradient(ellipse at top, rgba(251,191,36,0.22) 0%, transparent 45%),
    radial-gradient(ellipse at bottom, rgba(239,68,68,0.18) 0%, transparent 45%),
    radial-gradient(ellipse at left, rgba(251,146,60,0.12) 0%, transparent 40%),
    radial-gradient(ellipse at right, rgba(251,146,60,0.12) 0%, transparent 40%);
  animation: hotStreakFlicker 1.1s ease-in-out infinite;
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.5s;
}
.hot-streak-ambient.on { opacity: 1; }

.emoji-burst-particle {
  position: fixed;
  font-size: 28px;
  pointer-events: none;
  z-index: 9998;
  user-select: none;
  will-change: transform, opacity;
  animation: emojiFloat 1.4s cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
}

.coin-rain-piece {
  position: fixed;
  top: -60px;
  font-size: 28px;
  pointer-events: none;
  z-index: 10001;
  will-change: transform, opacity;
  animation: coinRain 2.2s cubic-bezier(0.4, 0, 0.8, 1) forwards;
}

.near-miss-flash { animation: nearMissFlash 0.9s ease-in-out 1; }
@keyframes scratchReveal { 0% { transform: scale(0.3) rotate(-10deg); opacity: 0; } 60% { transform: scale(1.15) rotate(5deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes crateShake { 0%,100% { transform: translateX(0); } 10%,30%,50%,70%,90% { transform: translateX(-6px); } 20%,40%,60%,80% { transform: translateX(6px); } }
@keyframes crateRevealPulse { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.3); } }
.keno-cell:hover { transform: scale(1.05); filter: brightness(1.2); }
.tower-cell:not(:disabled):hover { transform: scale(1.05); filter: brightness(1.2); }
/* ==================== CRATE GAME ==================== */
.crate-track { width: 100%; overflow: hidden; position: relative; }
.crate-pointer {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 100%;
  background: var(--accent);
  z-index: 5;
  box-shadow: 0 0 12px var(--accent-glow);
}
.crate-pointer::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--accent);
}

/* ==================== VERSION BAR ==================== */
.version-bar {
  display: none;
  padding: 4px 16px;
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border);
  justify-content: space-between;
  align-items: center;
}
@media (min-width: 901px) { .version-bar { display: flex; } }
.health-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.health-dot.ok { background: var(--accent); }
.health-dot.warn { background: var(--gold); }
.health-dot.down { background: var(--red); }

.waiting { animation: pulse 1.5s infinite; }
.hot-streak { animation: hotStreak 1s infinite; }
.shimmer { background: linear-gradient(90deg, transparent 30%, var(--glass) 50%, transparent 70%); background-size: 200% 100%; animation: shimmer 2s infinite; }

/* ==================== MOBILE BOTTOM NAV ==================== */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(14,14,20,0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  z-index: 200;
  padding: 4px 0;
  padding-bottom: env(safe-area-inset-bottom, 4px);
}
.mobile-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.mobile-nav a {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-nav a .nav-icon { display: flex; align-items: center; justify-content: center; }
.mobile-nav a .nav-icon svg { width: 22px; height: 22px; }
.mobile-nav a.active { color: var(--accent); }
.mobile-nav a:active { transform: scale(0.9); }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .live-bets-bar { padding: 4px 10px; font-size: 10px; position: fixed; bottom: 52px; left: 0; right: 0; z-index: 199; background: rgba(14,14,20,0.9); backdrop-filter: blur(8px); }
  .live-bets-label { font-size: 9px; }
  .content { padding-bottom: 100px; }
  .mobile-nav { display: block; }
  .content { padding: 12px; padding-bottom: 70px; }
  /* Push entire app below iPhone status bar/notch */
  body, #app {
    padding-top: env(safe-area-inset-top, 0);
    background: var(--bg-base);
  }
  .topbar {
    padding: 0 8px;
    height: 44px;
    position: sticky;
    top: env(safe-area-inset-top, 0);
  }
  .topbar-left { flex-shrink: 0; }
  .topbar-right { gap: 6px; }
  .logo { font-size: 16px; letter-spacing: 1px; }
  body { font-size: 13px; }
  .content { padding: 10px; padding-bottom: 70px; }
  #toast-stack { bottom: calc(66px + env(safe-area-inset-bottom, 0)); }

  .game-page {
    flex-direction: column-reverse;
    min-height: auto;
    border-radius: var(--radius-sm);
  }
  .game-controls {
    width: 100%;
    border-right: none;
    border-top: 1px solid var(--border);
    padding: 12px;
    gap: 10px;
  }
  .game-area { min-height: 200px; max-height: 50vh; }

  .home-hero { padding: 20px 16px; margin-bottom: 16px; }
  .home-hero h1 { font-size: 22px; }
  .game-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .game-card-img { aspect-ratio: 10 / 13; }

  .btn { padding: 10px 16px; font-size: 13px; min-height: 44px; }
  .btn-play { padding: 14px; min-height: 48px; font-size: 15px; }
  .choice-btn { padding: 10px; min-height: 44px; font-size: 13px; }
  .form-input { padding: 10px 12px; min-height: 44px; font-size: 15px; }
  .btn-mult { min-height: 44px; min-width: 40px; }

  .playing-card { width: 56px; height: 78px; }
  .playing-card div:first-child { font-size: 16px !important; }
  .hand-value { font-size: 18px; }
  .bj-table { padding: 12px; gap: 10px; }

  .mines-grid { width: 100%; max-width: 340px; gap: 5px; }
  .mine-tile { min-height: 50px; font-size: 18px; }

  .slots-display { gap: 8px; }
  .slot-reel { width: 80px; height: 90px; font-size: 36px; }

  .wallet-pill { height: 30px; max-width: none; overflow: hidden; }
  .wallet-bal { padding: 0 6px; font-size: 10px; white-space: nowrap; }
  .wallet-deposit { padding: 0 8px; font-size: 10px; white-space: nowrap; }
  .wallet-toggle { font-size: 9px !important; padding: 0 4px !important; white-space: nowrap; }
  .user-pill { display: none; }
  .topbar .btn-ghost { display: none; }
  .topbar .btn-sm { padding: 6px 10px; font-size: 11px; min-height: 30px; }

  .info-card { padding: 14px; }
  .section-title { font-size: 16px; }

  .result-banner { padding: 10px 16px; }
  .rb-mult { font-size: 22px; }
  .rb-amt { font-size: 15px; }
}

@media (max-width: 380px) {
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .playing-card { width: 48px; height: 68px; }
  .mine-tile { min-height: 44px; font-size: 16px; }
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ==================== PROFILE PAGE ==================== */
.profile-hero {
  animation: fadeInScale 0.35s cubic-bezier(0.16, 1.2, 0.3, 1);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.profile-hero:hover { box-shadow: 0 10px 36px rgba(0,0,0,0.4); }
.profile-banner {
  background-size: 200% 200% !important;
  animation: gradientShift 10s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}
.profile-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.25) 100%);
  pointer-events: none;
}
.profile-avatar {
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease;
  box-shadow: 0 6px 20px rgba(0,0,0,0.45);
  user-select: none;
}
.profile-avatar[onclick]:hover { transform: scale(1.06); box-shadow: 0 10px 28px rgba(0,0,0,0.55), 0 0 0 4px var(--accent-bg); }
.profile-avatar img { display: block; }
.profile-name {
  transition: color 0.2s ease, text-shadow 0.2s ease;
}
.profile-name[onclick]:hover { color: var(--accent) !important; text-shadow: 0 0 18px var(--accent-glow); }

.profile-stats-grid .profile-stat {
  opacity: 0;
  animation: fadeInUp 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.22s ease, box-shadow 0.22s ease;
  cursor: default;
  position: relative;
  overflow: hidden;
}
.profile-stats-grid .profile-stat::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 120%, var(--accent-bg), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.profile-stats-grid .profile-stat:hover {
  transform: translateY(-3px);
  border-color: var(--accent-glow);
  box-shadow: 0 10px 28px rgba(0,0,0,0.35);
}
.profile-stats-grid .profile-stat:hover::before { opacity: 1; }
.profile-stats-grid .profile-stat .stat-value {
  transition: transform 0.2s ease;
  position: relative;
  z-index: 1;
  display: inline-block;
}
.profile-stats-grid .profile-stat:hover .stat-value { transform: scale(1.06); }
.profile-stats-grid .profile-stat:nth-child(1) { animation-delay: 0.00s; }
.profile-stats-grid .profile-stat:nth-child(2) { animation-delay: 0.05s; }
.profile-stats-grid .profile-stat:nth-child(3) { animation-delay: 0.10s; }
.profile-stats-grid .profile-stat:nth-child(4) { animation-delay: 0.15s; }
.profile-stats-grid .profile-stat:nth-child(5) { animation-delay: 0.20s; }
.profile-stats-grid .profile-stat:nth-child(6) { animation-delay: 0.25s; }

/* ==================== POLISH PACK — ANIMATIONS ==================== */

/* New keyframes */
@keyframes slideInLeft     { from { opacity: 0; transform: translateX(-12px) } to { opacity: 1; transform: none } }
@keyframes fadeInUp        { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
@keyframes gradientShift   { 0%,100% { background-position: 0% 50% } 50% { background-position: 100% 50% } }
@keyframes softBreathe     { 0%,100% { transform: scale(1) } 50% { transform: scale(1.04) } }
@keyframes btnPulse        { 0%,100% { box-shadow: 0 0 0 0 var(--accent-glow) } 50% { box-shadow: 0 0 0 8px transparent } }
@keyframes iconWiggle      { 0%,100% { transform: rotate(0) } 20% { transform: rotate(-6deg) } 60% { transform: rotate(4deg) } }
@keyframes sheenSweep      { 0% { transform: translateX(-100%) skewX(-20deg) } 100% { transform: translateX(250%) skewX(-20deg) } }
@keyframes borderTrail     { 0% { background-position: 0% 50% } 100% { background-position: 200% 50% } }
@keyframes accentGlowPulse { 0%,100% { box-shadow: 0 0 0 0 var(--accent-glow) } 50% { box-shadow: 0 0 16px 2px var(--accent-glow) } }
@keyframes countUpBounce   { 0% { transform: scale(1.3); color: var(--accent) } 100% { transform: scale(1); color: inherit } }
@keyframes fadeInScale     { from { opacity: 0; transform: scale(0.96) } to { opacity: 1; transform: scale(1) } }

/* Sidebar link — slide accent bar in on hover */
.sidebar-link {
  position: relative;
  transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}
.sidebar-link::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sidebar-link:hover { color: var(--text-bright); padding-left: 12px; }
.sidebar-link:hover::before { transform: scaleY(1); }
.sidebar-link.active::before { transform: scaleY(1); }

/* Game-card sheen sweep on hover */
.game-card {
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.22s ease, border-color 0.22s ease;
}
.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.18) 50%, transparent 70%);
  transform: translateX(-100%) skewX(-20deg);
  pointer-events: none;
  z-index: 2;
  transition: transform 0s;
}
.game-card:hover::before { animation: sheenSweep 0.9s cubic-bezier(0.3, 0, 0.3, 1); }
.game-card-img > * { transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
.game-card:hover .game-card-img > svg:last-child { transform: scale(1.04); }

/* Button ripple + soft glow pulse on primary CTAs */
.btn-primary, .btn-play {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.btn-primary::after, .btn-play::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--rx, 50%) var(--ry, 50%), rgba(255,255,255,0.35) 0%, transparent 45%);
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
  z-index: 0;
}
.btn-primary:hover::after, .btn-play:hover::after { opacity: 1; }
.btn-play:not(:disabled) { animation: btnPulse 2.6s ease-in-out infinite; }

/* Choice-btn active — gentle breathe */
.choice-btn.active { animation: softBreathe 2.2s ease-in-out infinite; }

/* Form input focus — accent ring expand */
.form-input, input[type="text"], input[type="number"], input[type="email"], input[type="password"], textarea, select {
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.form-input:focus, input:focus, textarea:focus, select:focus {
  outline: none;
}

/* Balance / number counter bounce on change (apply .count-up via JS) */
.count-up { animation: countUpBounce 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* Stat-card / info-card entrance stagger on page load */
.content > .info-card,
.content > .game-grid {
  animation: fadeInUp 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.content > .info-card:nth-child(2) { animation-delay: 0.04s }
.content > .info-card:nth-child(3) { animation-delay: 0.08s }
.content > .info-card:nth-child(4) { animation-delay: 0.12s }
.content > .info-card:nth-child(5) { animation-delay: 0.16s }
.content > .info-card:nth-child(6) { animation-delay: 0.20s }

/* Topbar entrance */
.topbar { animation: slideInLeft 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* Mobile-nav active icon wiggle */
.mobile-nav a.active .nav-icon svg,
.mobile-nav a.active .nav-icon { animation: iconWiggle 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* Chat FAB — gentle accent glow */
.chat-fab { transition: transform 0.18s ease, box-shadow 0.18s ease; }
.chat-fab:hover { transform: scale(1.08); }

/* Sidebar Discord button — subtle glow breathe */
.sidebar-discord { animation: accentGlowPulse 3.4s ease-in-out infinite; }

/* Game card badge — micro bounce on render */
.game-card-badge { animation: fadeInScale 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

/* Multi-direction gradient shift for VIP / tournament card */
.info-card[style*="gold"],
.info-card[style*="var(--gold)"] {
  background-size: 200% 200%;
  animation: gradientShift 6s ease-in-out infinite;
}

/* ==================== MOBILE PERFORMANCE ==================== */
@media (hover: none) and (pointer: coarse) {
  /* Touch devices: disable hover-only sheen (saves paint) */
  .game-card:hover::before { animation: none; }
  .game-card::before { display: none; }
  /* No btnPulse infinite animation on mobile — saves battery */
  .btn-play:not(:disabled) { animation: none; }
  /* Softer game-card lift — translateY is cheaper than scale+shadow */
  .game-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
}

/* Remove gray tap flash on iOS Safari */
a, button, [role="button"], .sidebar-link, .game-card, .mobile-nav a, .choice-btn {
  -webkit-tap-highlight-color: transparent;
}

/* Allow pinch-zoom but stop double-tap-zoom (massively reduces tap latency on iOS) */
html, body { touch-action: manipulation; }

/* Scrolling perf: give long lists isolation so repaints don't cascade */
.game-grid,
.live-bets-scroll,
.chat-messages {
  contain: layout style;
}

/* Content-visibility for the massive game grid = don't paint offscreen cards */
@media (min-width: 901px) {
  .game-card {
    content-visibility: auto;
    contain-intrinsic-size: 260px 320px;
  }
}

/* Reduce backdrop-filter blur weight on mobile — backdrop-filter is GPU-heavy */
@media (max-width: 900px) {
  .topbar { backdrop-filter: none; background: var(--bg-topbar); }
  .topbar.scrolled { backdrop-filter: blur(10px); }
  .chat-panel { backdrop-filter: none; }
}

/* Respect user preference for reduced motion — wins over everything above */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
