/**
 * CoinRush Coinflip – Deep-Space Glassmorphism Redesign
 * Matches jackpot / guild-casino design language
 * All class names aligned to coinflip-react.jsx components
 */

/* ======== FONTS ======== */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600;700&display=swap');

/* ======== CSS VARIABLES ======== */
:root {
  --cf-font: 'Sora', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --cf-font-body: 'Inter', -apple-system, sans-serif;
  --cf-mono: 'JetBrains Mono', 'SF Mono', monospace;

  /* Auth-inspired neutral dark palette */
  --cf-bg: #0c0f14;
  --cf-bg-card: rgba(20, 24, 32, 0.55);
  --cf-glass: rgba(20, 24, 32, 0.55);
  --cf-border: rgba(255, 255, 255, 0.06);
  --cf-radius: 16px;
  --cf-radius-sm: 10px;
  --cf-radius-xs: 6px;

  --cf-accent: #4fffb0;
  --cf-accent-light: #7dffcc;
  --cf-purple: #a855f7;
  --cf-purple-dim: rgba(168, 85, 247, 0.15);

  --cf-red: #f43f5e;
  --cf-red-light: #fb7185;
  --cf-red-glow: rgba(244, 63, 94, 0.45);
  --cf-red-bg: rgba(244, 63, 94, 0.08);
  --cf-green: #00ffa3;
  --cf-green-light: #4fffb0;
  --cf-green-glow: rgba(0, 255, 163, 0.45);
  --cf-green-bg: rgba(0, 255, 163, 0.05);

  --cf-gold: #fbbf24;
  --cf-cyan: #22d3ee;
  --cf-text: #e2e8f0;
  --cf-text-dim: rgba(255, 255, 255, 0.55);
  --cf-text-muted: rgba(255, 255, 255, 0.3);
  --cf-surface: rgba(255, 255, 255, 0.03);
  --cf-surface-hover: rgba(255, 255, 255, 0.06);

  --cf-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --cf-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ======== GLOBAL RESET ======== */
html, body { background: #0c0f14 !important; margin: 0; padding: 0; }

/* ================================================================
   APP SHELL
   ================================================================ */
.cf-app {
  position: relative;
  min-height: 100vh;
  background: var(--cf-bg);
  color: var(--cf-text);
  font-family: var(--cf-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-top: 72px;
}
.cf-app *, .cf-app *::before, .cf-app *::after { box-sizing: border-box; }

/* Subtle grid overlay */
.cf-app::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ================================================================
   BACKGROUND ORBS
   ================================================================ */
.cf-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.cf-orb {
  position: absolute; border-radius: 50%;
  filter: blur(100px); opacity: 0.5;
  animation: cf-orb-drift 20s ease-in-out infinite alternate;
  will-change: transform;
}
.cf-orb--1 { width: 420px; height: 420px; top: -10%; left: -5%; background: rgba(79, 255, 176, 0.06); animation-duration: 22s; }
.cf-orb--2 { width: 350px; height: 350px; top: 30%; right: -8%; background: rgba(168, 85, 247, 0.08); animation-duration: 26s; animation-delay: -4s; }
.cf-orb--3 { width: 300px; height: 300px; bottom: -5%; left: 25%; background: rgba(244, 63, 94, 0.06); animation-duration: 28s; animation-delay: -8s; }
.cf-orb--4 { width: 250px; height: 250px; top: 50%; left: 10%; background: rgba(251, 191, 36, 0.05); animation-duration: 30s; animation-delay: -12s; }
.cf-orb--5 { width: 200px; height: 200px; top: 15%; right: 20%; background: rgba(168, 85, 247, 0.06); animation-duration: 24s; animation-delay: -6s; }
.cf-orb--6 { width: 180px; height: 180px; bottom: 20%; right: 10%; background: rgba(79, 255, 176, 0.05); animation-duration: 32s; animation-delay: -16s; }
@keyframes cf-orb-drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -20px) scale(1.1); }
}

/* ================================================================
   PARTICLES
   ================================================================ */
.cf-particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.cf-particle {
  position: absolute;
  width: var(--size, 3px); height: var(--size, 3px);
  background: var(--color, rgba(79, 255, 176, 0.3));
  border-radius: 50%; opacity: 0;
  left: var(--x, 50%); bottom: -10px;
  animation: cf-particle-rise var(--duration, 8s) var(--delay, 0s) infinite;
}
@keyframes cf-particle-rise {
  0%   { opacity: 0; transform: translateY(0) scale(0.5); }
  10%  { opacity: 0.5; }
  90%  { opacity: 0.1; }
  100% { opacity: 0; transform: translateY(-100vh) scale(1); }
}

/* ================================================================
   MAIN LAYOUT (3-col grid)
   ================================================================ */
.cf-layout {
  position: relative; z-index: 1;
  max-width: 1580px;
  margin: 0 auto;
  padding: 16px 16px 60px;
  display: grid;
  grid-template-columns: 320px 1fr 360px;
  gap: 20px;
  align-items: start;
}
.cf-sidebar { display: flex; flex-direction: column; gap: 16px; }
.cf-sidebar--right {
  position: sticky;
  top: 88px;
  align-self: start;
  height: calc(100vh - 104px);
  display: flex;
  flex-direction: column;
}
.cf-sidebar--right .cr-chat-container {
  flex: 1;
  max-height: none;
  min-height: 0;
  height: 100%;
  border-radius: var(--cf-radius);
  border: 1px solid var(--cf-border);
  background: var(--cf-glass);
  backdrop-filter: blur(20px);
}
/* Override default chat max-height when in sidebar */
.cf-sidebar--right .cr-chat-container {
  max-height: calc(100vh - 104px) !important;
}
.cf-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

@media (max-width: 1400px) {
  .cf-layout { grid-template-columns: 300px 1fr 340px; gap: 16px; }
}
@media (max-width: 1200px) {
  .cf-layout { grid-template-columns: 280px 1fr; }
  .cf-sidebar--right { display: none; }
}

/* ================================================================
   CONNECTION WARNING
   ================================================================ */
.cf-connection-warning {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%);
  z-index: 500;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: var(--cf-radius-sm);
  backdrop-filter: blur(12px);
  color: var(--cf-red-light); font-size: 13px; font-weight: 600;
  animation: cf-fade-in 0.3s ease;
}
.cf-connection-icon { font-size: 16px; }

/* ================================================================
   HEADER
   ================================================================ */
.cf-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: var(--cf-glass);
  border: 1px solid var(--cf-border);
  border-radius: var(--cf-radius);
  backdrop-filter: blur(20px);
}
.cf-header-title { display: flex; align-items: center; gap: 12px; }
.cf-header-title h1 {
  font-size: 18px; font-weight: 800; color: #fff;
  text-transform: uppercase; letter-spacing: 0.5px; margin: 0;
  background: linear-gradient(135deg, #fff 30%, var(--cf-accent-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.cf-header-status {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: rgba(0, 255, 163, 0.05);
  border: 1px solid rgba(0, 255, 163, 0.15);
  border-radius: 20px;
  font-size: 11px; font-weight: 700; color: var(--cf-green);
}
.cf-status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cf-green);
  box-shadow: 0 0 8px var(--cf-green-glow);
  animation: cf-pulse-dot 2s ease-in-out infinite;
}
@keyframes cf-pulse-dot {
  0%, 100% { opacity: 0.6; transform: scale(0.8); }
  50%      { opacity: 1;   transform: scale(1); }
}
.cf-header-actions { display: flex; align-items: center; gap: 10px; }

/* Sound Toggle */
.cf-sound-toggle {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.4);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.25s ease;
  padding: 0; flex-shrink: 0;
}
.cf-sound-toggle svg { width: 18px; height: 18px; }
.cf-sound-toggle.on {
  color: var(--cf-accent);
  border-color: rgba(79, 255, 176, 0.12);
  background: rgba(255, 255, 255, 0.05);
}
.cf-sound-toggle.on:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(79, 255, 176, 0.2);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.1);
}
.cf-sound-toggle:not(.on):hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
}

/* ================================================================
   FILTER TABS
   ================================================================ */
.cf-filter-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--cf-border);
  border-radius: var(--cf-radius-sm);
  padding: 3px; gap: 2px;
}
.cf-filter-tab {
  padding: 6px 14px;
  background: none; border: none;
  border-radius: var(--cf-radius-xs);
  color: var(--cf-text-dim);
  font-size: 12px; font-weight: 600; font-family: var(--cf-font);
  cursor: pointer;
  transition: all var(--cf-transition);
  display: flex; align-items: center; gap: 4px;
}
.cf-filter-tab:hover { color: var(--cf-text); background: rgba(255, 255, 255, 0.04); }
.cf-filter-tab--active {
  color: #fff;
  background: rgba(79, 255, 176, 0.1);
  border: 1px solid rgba(79, 255, 176, 0.15);
}
.cf-filter-icon { display: flex; align-items: center; }
.cf-filter-icon svg { width: 12px; height: 12px; }

/* ================================================================
   SHARED PANEL
   ================================================================ */
.cf-panel {
  background: var(--cf-glass);
  border: 1px solid var(--cf-border);
  border-radius: var(--cf-radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  transition: border-color var(--cf-transition);
}
.cf-panel:hover { border-color: rgba(79, 255, 176, 0.1); }
.cf-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--cf-border);
  background: rgba(255, 255, 255, 0.03);
}
.cf-panel-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; color: var(--cf-text);
  text-transform: uppercase; letter-spacing: 0.5px; margin: 0;
}
.cf-panel-title svg, .cf-panel-icon { width: 16px; height: 16px; color: var(--cf-accent-light); flex-shrink: 0; }
.cf-panel-icon svg { width: 16px; height: 16px; }
.cf-panel-body { padding: 14px; }

/* ================================================================
   BUTTONS (cf-btn used by dialogs / modals / header)
   ================================================================ */
.cf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border: none;
  border-radius: var(--cf-radius-sm);
  font-family: var(--cf-font);
  font-size: 13px; font-weight: 700;
  cursor: pointer; position: relative; overflow: hidden;
  transition: all var(--cf-transition);
  white-space: nowrap;
}
.cf-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.cf-btn--sm { padding: 6px 12px; font-size: 12px; border-radius: var(--cf-radius-xs); }
.cf-btn--lg { padding: 14px 24px; font-size: 15px; }
.cf-btn--full { width: 100%; }
.cf-btn-icon { display: flex; align-items: center; }
.cf-btn-icon svg { width: 14px; height: 14px; }
.cf-btn--primary {
  background: linear-gradient(135deg, var(--cf-accent), #7c3aed);
  color: #fff;
  box-shadow: 0 4px 20px rgba(79, 255, 176, 0.15);
}
.cf-btn--primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(79, 255, 176, 0.25); }
.cf-btn--primary:active:not(:disabled) { transform: translateY(0); }
.cf-btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--cf-border);
  color: var(--cf-text-dim);
}
.cf-btn--ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); border-color: rgba(79, 255, 176, 0.15); color: var(--cf-text); }
.cf-btn--accent {
  background: linear-gradient(135deg, var(--cf-green), #00cc82);
  color: #000; font-weight: 800;
  box-shadow: 0 4px 20px rgba(0, 255, 163, 0.25);
}
.cf-btn--accent:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(0, 255, 163, 0.4); }
.cf-btn--danger {
  background: linear-gradient(135deg, var(--cf-red), #dc2626);
  color: #fff;
  box-shadow: 0 4px 20px rgba(244, 63, 94, 0.25);
}
.cf-btn--danger:hover:not(:disabled) { transform: translateY(-1px); }
.cf-btn--loading { pointer-events: none; }

/* ================================================================
   FORM ELEMENTS
   ================================================================ */
.cf-label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11px; font-weight: 700; color: var(--cf-text-dim);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.cf-input {
  width: 100%; padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--cf-border);
  border-radius: var(--cf-radius-sm);
  color: #fff; font-size: 16px; font-weight: 700;
  font-family: var(--cf-mono); outline: none;
  transition: border-color var(--cf-transition);
}
.cf-input:focus { border-color: var(--cf-accent); }
.cf-input::placeholder { color: var(--cf-text-muted); font-weight: 400; }
.cf-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px; outline: none;
}
.cf-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--cf-accent);
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(79, 255, 176, 0.2);
}

/* ================================================================
   SIDE BADGE (SideBadge component)
   ================================================================ */
.cf-side-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 20px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.cf-side-badge--red {
  background: var(--cf-red-bg); color: var(--cf-red-light);
  border: 1px solid rgba(244, 63, 94, 0.2);
}
.cf-side-badge--green {
  background: var(--cf-green-bg); color: var(--cf-green-light);
  border: 1px solid rgba(0, 255, 163, 0.2);
}
.cf-side-badge svg { width: 10px; height: 10px; }

/* ================================================================
   TEXT UTILITIES
   ================================================================ */
.cf-text-red { color: var(--cf-red) !important; }
.cf-text-green { color: var(--cf-green) !important; }
.cf-coin-icon { width: 18px; height: 18px; }
.cf-coin-icon-sm { width: 14px; height: 14px; }

/* ================================================================
   HISTORY TICKER (HistoryTicker component)
   ================================================================ */
.cf-ticker {
  position: relative; padding: 8px 0; overflow: hidden; z-index: 1;
}
.cf-ticker::before, .cf-ticker::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 60px;
  z-index: 5; pointer-events: none;
}
.cf-ticker::before { left: 0; background: linear-gradient(90deg, var(--cf-bg), transparent); }
.cf-ticker::after { right: 0; background: linear-gradient(-90deg, var(--cf-bg), transparent); }
.cf-ticker-track {
  display: flex; gap: 8px; width: max-content;
  animation: cf-ticker-scroll 80s linear infinite;
}
.cf-ticker-track:hover { animation-play-state: paused; }
@keyframes cf-ticker-scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.cf-ticker-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: var(--cf-glass); border: 1px solid var(--cf-border);
  border-radius: 20px; white-space: nowrap;
  backdrop-filter: blur(10px);
  transition: border-color var(--cf-transition);
}
.cf-ticker-item:hover { border-color: rgba(79, 255, 176, 0.15); }
.cf-ticker-id { font-size: 10px; font-weight: 700; color: var(--cf-text-muted); font-family: var(--cf-mono); }
.cf-ticker-winner { font-size: 11px; font-weight: 700; color: var(--cf-text); }
.cf-ticker-text { font-size: 10px; color: var(--cf-text-dim); }
.cf-ticker-amount { font-size: 11px; font-weight: 700; font-family: var(--cf-mono); }
.cf-ticker-amount--red { color: var(--cf-red); }
.cf-ticker-amount--green { color: var(--cf-green); }

/* ================================================================
   AVATAR (Avatar component)
   ================================================================ */
.cf-avatar {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cf-avatar .cr-user-avatar__inner {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; text-transform: uppercase; z-index: 1;
  background: var(--cr-avatar-bg, #6B21A8);
  overflow: hidden;
}
.cf-avatar__initials {
  color: inherit;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  z-index: 1;
  position: relative;
  line-height: 1;
}
.cf-avatar__lvl {
  position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--cf-accent), #7c3aed);
  color: #fff; font-size: 8px; font-weight: 800;
  padding: 1px 5px; border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 15; white-space: nowrap; line-height: 1.2;
}
/* Level badge */
.cf-avatar__level {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #1a1a2e, #0f0f1a);
  color: #ffd700;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  z-index: 15;
  font-family: var(--cf-mono);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  line-height: 1.2;
}
.cf-avatar--xs .cf-avatar__level { font-size: 7px; padding: 1px 4px; bottom: -4px; }
.cf-avatar--sm .cf-avatar__level { font-size: 8px; padding: 2px 5px; bottom: -5px; }
.cf-avatar--lg .cf-avatar__level,
.cf-avatar--xl .cf-avatar__level { font-size: 10px; padding: 2px 7px; bottom: -8px; }

/* PNG Border Frame — on top, transparent center */
.cf-avatar__frame,
.cf-avatar .cr-user-avatar__frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
  object-fit: contain;
}
/* Frame glow by tier */
.cf-avatar.avatar-bronze .cf-avatar__frame,
.cf-avatar.avatar-bronze .cr-user-avatar__frame { filter: drop-shadow(0 0 8px rgba(205, 127, 50, 0.6)); }
.cf-avatar.avatar-silver .cf-avatar__frame,
.cf-avatar.avatar-silver .cr-user-avatar__frame { filter: drop-shadow(0 0 10px rgba(192, 192, 192, 0.7)); }
.cf-avatar.avatar-gold .cf-avatar__frame,
.cf-avatar.avatar-gold .cr-user-avatar__frame { filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.8)); }
.cf-avatar.avatar-gold-elite .cf-avatar__frame,
.cf-avatar.avatar-gold-elite .cr-user-avatar__frame,
.cf-avatar.avatar-platinum .cf-avatar__frame,
.cf-avatar.avatar-platinum .cr-user-avatar__frame { filter: drop-shadow(0 0 15px rgba(220, 20, 60, 0.9)); }

/* ================================================================
   BATTLE LIST
   ================================================================ */
.cf-battle-list {
  display: flex; flex-direction: column; gap: 8px;
}

/* ================================================================
   BATTLE CARD (BattleCard component – uses bc__ BEM classes)
   TOP-TIER PREMIUM DESIGN
   ================================================================ */
.bc {
  position: relative;
  display: flex; flex-direction: column;
  background: linear-gradient(165deg, rgba(20, 24, 32, 0.7), rgba(12, 15, 20, 0.65));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--cf-radius);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
/* Subtle top accent line */
.bc::before {
  content: '';
  position: absolute; top: 0; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79, 255, 176, 0.15), transparent);
  z-index: 1;
}
.bc:hover {
  border-color: rgba(79, 255, 176, 0.15);
  box-shadow: 0 8px 32px rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}
.bc--resolved { 
  opacity: 0.5;
  filter: saturate(0.7);
}
.bc--resolved:hover { transform: none; }
.bc--own {
  border-color: rgba(79, 255, 176, 0.12);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(12, 15, 20, 0.65));
  box-shadow: 0 2px 16px rgba(255, 255, 255, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.bc--own::before {
  background: linear-gradient(90deg, transparent, rgba(79, 255, 176, 0.25), transparent);
}
.bc--countdown {
  border-color: rgba(79, 255, 176, 0.15);
  animation: bc-glow-pulse 2s ease-in-out infinite;
}
.bc--countdown::before {
  background: linear-gradient(90deg, transparent, rgba(79, 255, 176, 0.3), transparent);
  animation: bc-line-pulse 2s ease-in-out infinite;
}
@keyframes bc-glow-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(79, 255, 176, 0), inset 0 1px 0 rgba(255, 255, 255, 0.04); }
  50% { box-shadow: 0 4px 28px rgba(255, 255, 255, 0.1), 0 0 40px rgba(255, 255, 255, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.06); }
}
@keyframes bc-line-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* Battle card row – main content area */
.bc__row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; gap: 14px;
}

/* Player slot */
.bc__player {
  display: flex; align-items: center; gap: 12px;
  flex: 1; min-width: 0;
}
.bc__player--right {
  flex-direction: row-reverse;
  text-align: right;
}
.bc__player--right .bc__info { align-items: flex-end; }
.bc__player--winner .bc__name {
  color: var(--cf-green);
}
.bc__avatar-wrap {
  position: relative; flex-shrink: 0;
  cursor: pointer;
}
/* Glowing ring on avatar hover */
.bc__avatar-wrap::after {
  content: '';
  position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color 0.3s ease;
  pointer-events: none; z-index: 5;
}
.bc__avatar-wrap:hover::after {
  border-color: rgba(79, 255, 176, 0.2);
}
.bc__avatar-popover {
  display: none;
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  z-index: 100;
  background: linear-gradient(165deg, rgba(20, 24, 32, 0.95), rgba(12, 15, 20, 0.95));
  border: 1px solid rgba(79, 255, 176, 0.1);
  border-radius: var(--cf-radius-sm);
  padding: 12px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  white-space: nowrap;
  animation: cf-fade-in 0.15s ease;
}
/* Popover arrow */
.bc__avatar-popover::after {
  content: '';
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(20, 24, 32, 0.95);
}
.bc__avatar-wrap:hover .bc__avatar-popover,
.bc__avatar-wrap--clickable:focus-within .bc__avatar-popover { 
  display: flex; flex-direction: column; align-items: center; gap: 6px; 
}
.bc__avatar-popover-name { font-size: 12px; font-weight: 700; color: #fff; }
.bc__avatar-popover-btn {
  font-size: 10px; font-weight: 600; color: var(--cf-accent-light);
  background: none; border: none; cursor: pointer; padding: 2px 6px;
  font-family: var(--cf-font);
}
.bc__avatar-popover-btn:hover { text-decoration: underline; }

.bc__info {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.bc__name {
  font-size: 13px; font-weight: 700; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bc__level-badge {
  display: inline-flex; align-items: center;
  padding: 1px 6px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(79, 255, 176, 0.1);
  font-size: 9px; font-weight: 800; color: var(--cf-accent-light);
  font-family: var(--cf-mono);
}
.bc__bet {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; color: var(--cf-text-dim);
  font-family: var(--cf-mono);
}
.bc__side {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px; border-radius: 12px;
  font-size: 9px; font-weight: 700; text-transform: uppercase;
}
.bc__side--red {
  background: var(--cf-red-bg); color: var(--cf-red-light);
  border: 1px solid rgba(244, 63, 94, 0.15);
}
.bc__side--green {
  background: var(--cf-green-bg); color: var(--cf-green-light);
  border: 1px solid rgba(0, 255, 163, 0.15);
}
.bc__side-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
}

/* VS indicator */
.bc__vs {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  font-size: 10px; font-weight: 900; color: var(--cf-accent-light);
  letter-spacing: 1px; text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.04);
}
.bc__vs svg { width: 16px; height: 16px; color: var(--cf-accent); opacity: 0.5; }

/* Waiting slot */
.bc__waiting {
  display: flex; align-items: center; gap: 10px;
  color: var(--cf-text-muted); font-size: 12px; font-weight: 500;
}
.bc__waiting-icon {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px dashed rgba(79, 255, 176, 0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: rgba(79, 255, 176, 0.18);
  animation: bc-waiting-pulse 2.5s ease-in-out infinite;
  background: rgba(255, 255, 255, 0.025);
}
@keyframes bc-waiting-pulse {
  0%, 100% { border-color: rgba(255, 255, 255, 0.1); }
  50%      { border-color: rgba(79, 255, 176, 0.18); }
}
.bc__waiting-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px dashed rgba(79, 255, 176, 0.1);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.025);
}
.bc__waiting-avatar svg { width: 16px; height: 16px; opacity: 0.3; }
.bc__waiting-text { font-size: 12px; color: var(--cf-text-muted); font-style: italic; }

/* Winner crown */
.bc__crown {
  display: flex; align-items: center;
  color: var(--cf-gold);
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5));
}
.bc__crown svg { width: 16px; height: 16px; }

/* Footer */
.bc__footer {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(0, 0, 0, 0.12);
}
.bc__pot {
  display: flex; align-items: center; gap: 6px;
  font-size: 15px; font-weight: 800; font-family: var(--cf-mono);
  background: linear-gradient(135deg, #fff 20%, var(--cf-gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.bc__coin { width: 18px; height: 18px; filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.3)); }
.bc__deviation {
  padding: 2px 8px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 10px; font-weight: 700; color: var(--cf-accent-light);
  font-family: var(--cf-mono);
}

/* Status badge */
.bc__status {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-left: auto;
}
.bc__status--open {
  background: rgba(0, 255, 163, 0.05); color: var(--cf-green);
  border: 1px solid rgba(0, 255, 163, 0.15);
}
.bc__status--countdown {
  background: rgba(255, 255, 255, 0.06); color: var(--cf-accent-light);
  border: 1px solid rgba(79, 255, 176, 0.1);
  animation: bc-status-pulse 1s ease-in-out infinite;
}
@keyframes bc-status-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
.bc__status--resolved {
  background: rgba(255, 255, 255, 0.04); color: var(--cf-text-dim);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.bc__status--urgent {
  background: rgba(244, 63, 94, 0.1); color: var(--cf-red);
  border: 1px solid rgba(244, 63, 94, 0.2);
  animation: cf-urgent-flash 0.5s ease-in-out infinite alternate;
}
.bc__status--warning {
  background: rgba(251, 191, 36, 0.08); color: var(--cf-gold);
  border: 1px solid rgba(251, 191, 36, 0.15);
}
.bc__timer-icon { display: inline-flex; align-items: center; }
.bc__timer-icon svg { width: 10px; height: 10px; }

@keyframes cf-urgent-flash { 0% { opacity: 0.7; } 100% { opacity: 1; } }

/* Action buttons */
.bc__actions {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto;
}
.bc__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 16px; border: none;
  border-radius: 8px;
  font-family: var(--cf-font);
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative; overflow: hidden;
}
.bc__btn:disabled { opacity: 0.4; cursor: not-allowed; }
.bc__btn-icon { display: flex; align-items: center; }
.bc__btn-icon svg { width: 14px; height: 14px; }
.bc__btn--view {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--cf-text-dim);
  padding: 7px 10px;
}
.bc__btn--view:hover { 
  background: rgba(255, 255, 255, 0.08); 
  border-color: rgba(79, 255, 176, 0.15); 
  color: #fff; 
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.06);
}
.bc__btn--join {
  background: linear-gradient(135deg, var(--cf-green), #00cc82);
  color: #000; font-weight: 800;
  box-shadow: 0 2px 12px rgba(0, 255, 163, 0.2);
  padding: 7px 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase; font-size: 11px;
}
.bc__btn--join::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 50%);
  opacity: 0; transition: opacity 0.25s;
}
.bc__btn--join:hover:not(:disabled)::before { opacity: 1; }
.bc__btn--join:hover:not(:disabled) { 
  transform: translateY(-1px); 
  box-shadow: 0 6px 24px rgba(0, 255, 163, 0.3); 
}

/* ================================================================
   CREATE BATTLE PANEL (CreateBattlePanel component)
   ================================================================ */
.create-panel {
  position: relative;
  background: var(--cf-glass);
  border: 1px solid var(--cf-border);
  border-radius: var(--cf-radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  transition: border-color var(--cf-transition);
}
.create-panel:hover { border-color: rgba(79, 255, 176, 0.1); }

.create-panel__glow {
  position: absolute; top: -60px; left: 50%; transform: translateX(-50%);
  width: 250px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent 70%);
  pointer-events: none; z-index: 0;
}

.create-panel__header {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--cf-border);
  background: rgba(255, 255, 255, 0.03);
}

.create-panel__title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; color: var(--cf-text);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.create-panel__icon { display: flex; align-items: center; }
.create-panel__icon svg { width: 16px; height: 16px; color: var(--cf-accent-light); }

.create-panel__balance {
  display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
}
.create-panel__balance-label {
  font-size: 9px; font-weight: 700; color: var(--cf-text-dim);
  text-transform: uppercase; letter-spacing: 1px;
}
.create-panel__balance-value {
  display: flex; align-items: center; gap: 4px;
  font-size: 14px; font-weight: 800; font-family: var(--cf-mono);
  color: var(--cf-green);
}
.create-panel__balance-value img { width: 14px; height: 14px; }

.create-panel__content {
  position: relative; z-index: 1;
  padding: 16px;
  display: flex; flex-direction: column; gap: 16px;
}

.create-panel__section {
  display: flex; flex-direction: column; gap: 8px;
}
.create-panel__section-label {
  font-size: 11px; font-weight: 700; color: var(--cf-text-dim);
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* Side Selector */
.create-panel__sides {
  display: flex; align-items: center; gap: 8px;
}
.side-selector {
  flex: 1; padding: 12px 10px;
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--cf-border);
  border-radius: var(--cf-radius-sm);
  cursor: pointer; position: relative; overflow: hidden;
  transition: all var(--cf-transition);
  font-family: var(--cf-font);
}
.side-selector::before {
  content: ''; position: absolute; inset: 0;
  opacity: 0; transition: opacity var(--cf-transition);
}
.side-selector--red::before { background: radial-gradient(circle at center, rgba(244, 63, 94, 0.12), transparent 70%); }
.side-selector--green::before { background: radial-gradient(circle at center, rgba(0, 255, 163, 0.05), transparent 70%); }
.side-selector--active::before { opacity: 1; }
.side-selector--red:hover, .side-selector--red.side-selector--active {
  border-color: rgba(244, 63, 94, 0.4); color: var(--cf-red-light);
}
.side-selector--green:hover, .side-selector--green.side-selector--active {
  border-color: rgba(0, 255, 163, 0.4); color: var(--cf-green-light);
}
.side-selector__coin {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 14px; font-weight: 900; color: #fff;
  position: relative; z-index: 1;
}
.side-selector--red .side-selector__coin {
  background: linear-gradient(135deg, var(--cf-red), #dc2626);
  box-shadow: 0 0 12px var(--cf-red-glow);
}
.side-selector--green .side-selector__coin {
  background: linear-gradient(135deg, var(--cf-green), #00cc82);
  box-shadow: 0 0 12px var(--cf-green-glow);
}
.side-selector__label {
  display: flex; flex-direction: column; gap: 1px;
  position: relative; z-index: 1;
}
.side-selector__name {
  font-size: 12px; font-weight: 800; color: #fff;
  letter-spacing: 0.5px;
}
.side-selector__subtitle {
  font-size: 9px; font-weight: 600; color: var(--cf-text-dim);
}

/* VS divider between side selectors */
.side-divider {
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.side-divider__text {
  font-size: 10px; font-weight: 900; color: var(--cf-text-muted);
  letter-spacing: 2px;
}

/* Amount input */
.create-panel__amount-row {
  display: flex; flex-direction: column; gap: 8px;
}
.amount-input {
  position: relative;
}
.amount-input input {
  width: 100%; padding: 12px 40px 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--cf-border);
  border-radius: var(--cf-radius-sm);
  color: #fff; font-size: 16px; font-weight: 700;
  font-family: var(--cf-mono); outline: none;
  transition: border-color var(--cf-transition);
}
.amount-input input:focus { border-color: var(--cf-accent); }
.amount-input input::placeholder { color: var(--cf-text-muted); font-weight: 400; }
.amount-input__icon {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; pointer-events: none;
}

/* Amount presets */
.amount-presets {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.preset-btn {
  flex: 1; min-width: 40px; padding: 7px 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--cf-border);
  border-radius: var(--cf-radius-xs);
  color: var(--cf-text); font-size: 12px; font-weight: 700;
  font-family: var(--cf-mono);
  cursor: pointer; transition: all var(--cf-transition);
}
.preset-btn:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--cf-accent); }
.preset-btn--max {
  background: linear-gradient(135deg, rgba(0, 255, 163, 0.1), rgba(0, 204, 130, 0.05));
  border-color: rgba(0, 255, 163, 0.2); color: var(--cf-green);
}
.preset-btn--max:hover { background: rgba(0, 255, 163, 0.15); border-color: var(--cf-green); }

/* Tolerance chips */
.tolerance-chips {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.tol-chip {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--cf-border);
  border-radius: 20px;
  color: var(--cf-text-dim); font-size: 12px; font-weight: 600;
  font-family: var(--cf-mono);
  cursor: pointer; transition: all var(--cf-transition);
}
.tol-chip:hover { border-color: var(--cf-accent); color: var(--cf-text); }
.tol-chip--active {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--cf-accent); color: var(--cf-accent-light);
}
.tol-custom {
  position: relative; display: flex; align-items: center;
}
.tol-custom__input {
  width: 48px; padding: 6px 20px 6px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--cf-border);
  border-radius: 20px;
  color: var(--cf-text); font-size: 12px; font-weight: 600;
  font-family: var(--cf-mono); outline: none;
  transition: border-color var(--cf-transition);
  -moz-appearance: textfield;
}
.tol-custom__input::-webkit-inner-spin-button,
.tol-custom__input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.tol-custom__input:focus { border-color: var(--cf-accent); }
.tol-custom__input--active { border-color: var(--cf-accent); background: rgba(255, 255, 255, 0.06); }
.tol-custom__suffix {
  position: absolute; right: 8px;
  font-size: 11px; font-weight: 600; color: var(--cf-text-dim);
  pointer-events: none;
}

/* Error */
.create-panel__error {
  padding: 8px 12px;
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.2);
  border-radius: var(--cf-radius-xs);
  font-size: 12px; color: var(--cf-red); font-weight: 500;
}

/* CTA buttons */
.create-panel__cta {
  display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.cta-row {
  display: flex; gap: 8px; width: 100%; justify-content: center;
}
.cta-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border: none;
  border-radius: var(--cf-radius-sm);
  font-family: var(--cf-font);
  font-size: 14px; font-weight: 800;
  cursor: pointer; position: relative; overflow: hidden;
  transition: all var(--cf-transition);
  white-space: nowrap;
}
.cta-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.cta-btn--primary {
  flex: 1;
  background: linear-gradient(135deg, var(--cf-accent), #7c3aed);
  color: #fff;
  box-shadow: 0 4px 20px rgba(79, 255, 176, 0.15);
}
.cta-btn--primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(79, 255, 176, 0.25); }
.cta-btn--full { width: 100%; }
.cta-btn--free {
  background: linear-gradient(135deg, rgba(0, 255, 163, 0.05), rgba(0, 204, 130, 0.08));
  border: 1px solid rgba(0, 255, 163, 0.2);
  color: var(--cf-green); font-weight: 700;
  transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
}
.cta-btn--free:hover:not(:disabled) { background: rgba(0, 255, 163, 0.18); border-color: var(--cf-green); }
.cta-btn--login {
  width: 100%;
  background: linear-gradient(135deg, var(--cf-accent), #7c3aed);
  color: #fff;
  box-shadow: 0 4px 20px rgba(79, 255, 176, 0.12);
}
.cta-btn--login:hover { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(79, 255, 176, 0.2); }
.cta-icon { display: flex; align-items: center; }
.cta-icon svg { width: 16px; height: 16px; }

/* ============================================
   CTA ANIMATED — Green checkmark morph
   ============================================ */
.cta-btn--animated {
  position: relative; overflow: hidden;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1), height 0.5s cubic-bezier(0.4,0,0.2,1), min-width 0.5s cubic-bezier(0.4,0,0.2,1), flex 0.5s cubic-bezier(0.4,0,0.2,1), border-radius 0.5s cubic-bezier(0.4,0,0.2,1), border-color 0.4s ease, box-shadow 0.4s ease, background 0.4s ease, transform 0.25s ease;
}

/* Face states */
.cta-face {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  opacity: 0; transform: translateY(8px) scale(0.92);
  transition: opacity 0.35s cubic-bezier(0.4,0,0.2,1), transform 0.35s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none; position: absolute; inset: 0;
}
.cta-face--active { opacity: 1; transform: translateY(0) scale(1); position: relative; }

/* Loading spinner */
.cta-face--loader { color: rgba(255,255,255,0.6); }
.cta-spin-svg { width: 18px; height: 18px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Success morph — centered in parent via margin auto */
.cta-btn--animated.cta-success {
  width: 52px !important; min-width: 52px !important; height: 52px !important; border-radius: 50% !important;
  border-color: rgba(0,255,163,0.6) !important;
  background: linear-gradient(135deg, rgba(0,255,163,0.22), rgba(0,200,130,0.15)) !important;
  box-shadow: 0 0 40px rgba(0,255,163,0.4), 0 0 80px rgba(0,255,163,0.18), 0 0 120px rgba(0,255,163,0.06) !important;
  padding: 0 !important; flex: 0 0 52px !important;
  margin-left: auto !important; margin-right: auto !important;
}
/* Hide sibling buttons when success circle is showing */
.cta-btn--animated.cta-success ~ .cta-btn {
  opacity: 0; width: 0; min-width: 0; padding: 0; border: none; overflow: hidden; flex: 0;
  transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
}

/* SVG check animations */
.cta-check-svg { width: 28px; height: 28px; }
.cta-check-ring {
  fill: none; stroke: #00ffa3; stroke-width: 2;
  stroke-dasharray: 151; stroke-dashoffset: 151; opacity: 0;
  filter: drop-shadow(0 0 6px rgba(0,255,163,0.6));
}
.cta-check-mark {
  fill: none; stroke: #00ffa3; stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 40; stroke-dashoffset: 40;
  filter: drop-shadow(0 0 8px rgba(0,255,163,0.8));
}
.cta-success .cta-check-ring { animation: cta-ring-draw 0.5s 0.12s cubic-bezier(0.22,0.61,0.36,1) forwards; }
.cta-success .cta-check-mark { animation: cta-check-draw 0.35s 0.45s cubic-bezier(0.22,0.61,0.36,1) forwards; }
.cta-success .cta-face--check.cta-face--active { animation: cta-check-pop 0.4s 0.7s cubic-bezier(0.34,1.56,0.64,1) both; }
@keyframes cta-ring-draw { to { stroke-dashoffset: 0; opacity: 0.5; } }
@keyframes cta-check-draw { to { stroke-dashoffset: 0; } }
@keyframes cta-check-pop { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(0) scale(1.18); } 100% { transform: translateY(0) scale(1); } }

/* ================================================================
   LEADERBOARD (LeaderboardPanel component)
   ================================================================ */
.cf-leaderboard-panel { /* extends .cf-panel */ }
.cf-leaderboard-list { display: flex; flex-direction: column; gap: 4px; }
.cf-leaderboard-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--cf-radius-xs);
  transition: background var(--cf-transition);
}
.cf-leaderboard-item:hover { background: rgba(255, 255, 255, 0.03); }
.cf-leaderboard-item--gold { background: rgba(251, 191, 36, 0.05); }
.cf-leaderboard-item--silver { background: rgba(192, 192, 192, 0.04); }
.cf-leaderboard-item--bronze { background: rgba(205, 127, 50, 0.04); }
.cf-leaderboard-rank { min-width: 28px; display: flex; align-items: center; justify-content: center; }
.cf-leaderboard-medal { display: flex; }
.cf-leaderboard-number { font-size: 11px; font-weight: 700; color: var(--cf-text-dim); font-family: var(--cf-mono); }
.cf-leaderboard-info { flex: 1; min-width: 0; }
.cf-leaderboard-name {
  display: block; font-size: 13px; font-weight: 700; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cf-leaderboard-stats { display: block; font-size: 10px; color: var(--cf-text-dim); font-family: var(--cf-mono); }
.cf-leaderboard-profit { font-size: 13px; font-weight: 800; font-family: var(--cf-mono); white-space: nowrap; }
.cf-leaderboard-profit--positive { color: var(--cf-green); }
.cf-leaderboard-profit--negative { color: var(--cf-red); }

/* ================================================================
   EMPTY STATE
   ================================================================ */
.cf-empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 32px 16px; color: var(--cf-text-dim);
  font-size: 13px; font-weight: 500; text-align: center;
}
.cf-empty-state--large { padding: 48px 24px; }
.cf-empty-icon { display: flex; }
.cf-empty-icon svg { width: 32px; height: 32px; opacity: 0.3; }
.cf-empty-state h3 { font-size: 16px; font-weight: 700; color: var(--cf-text); margin: 0; }
.cf-empty-state p { font-size: 12px; color: var(--cf-text-dim); margin: 0; }

/* ================================================================
   DUEL OVERLAY / BATTLE POPUP (DuelOverlay component)
   TOP-TIER PREMIUM DESIGN
   ================================================================ */
@keyframes cf-fade-in { from { opacity: 0; } to { opacity: 1; } }

.battle-popup {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  animation: cf-fade-in 0.3s ease;
}
.battle-popup__backdrop {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(12, 15, 20, 0.85), rgba(0, 0, 0, 0.92));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Confetti */
.battle-popup__confetti {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 50;
}
.battle-popup__confetti-piece {
  position: absolute; top: -10px;
  border-radius: 2px;
  animation: bp-confetti-fall 3s ease-out forwards;
}
@keyframes bp-confetti-fall {
  0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  50%  { opacity: 0.9; }
  100% { transform: translateY(100vh) rotate(720deg) scale(0.5); opacity: 0; }
}

/* Main card */
.battle-popup__card {
  position: relative; z-index: 10;
  width: 650px; max-width: 95vw;
  max-height: 90vh; overflow-y: auto;
  background: linear-gradient(170deg, #141820 0%, #0c0f14 40%, #0a0d12 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 28px;
  box-shadow: 
    0 32px 100px rgba(0, 0, 0, 0.6),
    0 0 80px rgba(255, 255, 255, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 0 40px rgba(255, 255, 255, 0.015);
  animation: bp-card-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow-x: hidden;
}
/* Countdown state — pulsing border */
.battle-popup__card--countdown {
  border-color: rgba(79, 255, 176, 0.18);
  animation: bp-card-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), bp-card-countdown-pulse 1.5s ease-in-out infinite;
}
@keyframes bp-card-countdown-pulse {
  0%, 100% { border-color: rgba(79, 255, 176, 0.1); box-shadow: 0 32px 100px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 255, 255, 0.04); }
  50% { border-color: rgba(79, 255, 176, 0.25); box-shadow: 0 32px 100px rgba(0, 0, 0, 0.6), 0 0 60px rgba(255, 255, 255, 0.08); }
}
/* Flipping state — subtle ambient glow */
.battle-popup__card--flipping {
  border-color: rgba(251, 191, 36, 0.15);
}
.battle-popup__card::-webkit-scrollbar { width: 4px; }
.battle-popup__card::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 4px; }
@keyframes bp-card-in {
  from { transform: scale(0.8) translateY(40px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

/* Animated glow */
.battle-popup__glow {
  position: absolute; top: -80px; left: 50%; transform: translateX(-50%);
  width: 500px; height: 250px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(79, 255, 176, 0.1), transparent 70%);
  pointer-events: none; z-index: 0;
  animation: bp-glow-breathe 4s ease-in-out infinite;
}
@keyframes bp-glow-breathe {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

/* Close button */
.battle-popup__close {
  position: absolute; top: 16px; right: 16px; z-index: 20;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--cf-text-dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}
.battle-popup__close:hover { 
  background: rgba(244, 63, 94, 0.15); 
  border-color: rgba(244, 63, 94, 0.4); 
  color: var(--cf-red);
  transform: rotate(90deg);
}
.battle-popup__close svg { width: 16px; height: 16px; }

/* Header */
.battle-popup__header {
  position: relative; z-index: 2;
  padding: 24px 28px 14px;
}
.battle-popup__header-top {
  display: flex; align-items: center; justify-content: center;
  gap: 20px;
}
.battle-popup__id {
  font-size: 11px; font-weight: 800; color: var(--cf-accent-light);
  text-transform: uppercase; letter-spacing: 3px;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 10px; border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: absolute; left: 28px; top: 24px;
}
.battle-popup__pot {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  flex-direction: column;
}
.battle-popup__pot-icon { display: flex; align-items: center; }
.battle-popup__pot-icon img { width: 32px; height: 32px; filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5)); }
.battle-popup__pot-amount {
  font-size: 32px; font-weight: 900; font-family: var(--cf-mono);
  background: linear-gradient(135deg, #fff 20%, var(--cf-gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  text-align: center;
}
.battle-popup__pot-label {
  font-size: 10px; font-weight: 700; color: var(--cf-text-dim);
  text-transform: uppercase; letter-spacing: 2px;
  margin-top: -2px;
}

/* Players row */
.battle-popup__players {
  position: relative; z-index: 2;
  display: flex; align-items: stretch; gap: 0;
  padding: 16px 24px;
}

/* Player card */
.battle-popup__player {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 20px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--cf-radius);
  position: relative; overflow: hidden;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Colored top accent on player cards */
.battle-popup__player--red {
  border-top: 2px solid rgba(244, 63, 94, 0.5);
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.06) 0%, rgba(255,255,255,0.03) 40%);
}
.battle-popup__player--green {
  border-top: 2px solid rgba(34, 197, 94, 0.5);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.06) 0%, rgba(255,255,255,0.03) 40%);
}
/* Side color dot — inline next to name */
.battle-popup__side-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.battle-popup__side-dot--red {
  background: #f43f5e;
  box-shadow: 0 0 6px rgba(244, 63, 94, 0.5);
}
.battle-popup__side-dot--green {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}
.battle-popup__player-glow {
  position: absolute; inset: 0; opacity: 0;
  transition: opacity 0.5s ease; pointer-events: none;
}
.battle-popup__player-glow--red { 
  background: radial-gradient(ellipse at 50% 70%, rgba(244, 63, 94, 0.2), transparent 70%); 
}
.battle-popup__player-glow--green { 
  background: radial-gradient(ellipse at 50% 70%, rgba(34, 197, 94, 0.2), transparent 70%); 
}
.battle-popup__player--red .battle-popup__player-glow--red,
.battle-popup__player--green .battle-popup__player-glow--green { opacity: 1; }

.battle-popup__player--winner {
  border-color: rgba(0, 255, 163, 0.35);
  box-shadow: 0 0 40px rgba(0, 255, 163, 0.1), inset 0 0 30px rgba(0, 255, 163, 0.03);
  background: rgba(0, 255, 163, 0.04);
  animation: bp-winner-pulse 2s ease-in-out infinite;
}
@keyframes bp-winner-pulse {
  0%, 100% { box-shadow: 0 0 30px rgba(0, 255, 163, 0.05); }
  50% { box-shadow: 0 0 50px rgba(0, 255, 163, 0.15); }
}
.battle-popup__player--loser { 
  opacity: 0.35; 
  filter: grayscale(0.6) brightness(0.8); 
  transform: scale(0.97);
}

.battle-popup__avatar-wrapper {
  position: relative; display: flex; flex-direction: column; align-items: center;
  margin-bottom: 4px;
}
.battle-popup__avatar {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
}
/* Force avatar sizing in duel popup */
.battle-popup__avatar .cf-avatar,
.battle-popup__avatar .cr-user-avatar {
  width: 80px; height: 80px;
  display: flex; align-items: center; justify-content: center;
}
.battle-popup__avatar .cr-user-avatar__inner {
  width: 58px !important; height: 58px !important;
  font-size: 20px !important;
  border-radius: 50%;
  background: var(--cr-avatar-bg, #6B21A8);
}
.battle-popup__avatar .cr-user-avatar__frame,
.battle-popup__avatar .cf-avatar__frame {
  width: 88px !important; height: 88px !important;
}
.battle-popup__avatar .cf-avatar__level {
  font-size: 10px; padding: 2px 7px; bottom: -8px;
}
.battle-popup__crown {
  position: absolute; top: -24px; left: 50%; transform: translateX(-50%);
  color: var(--cf-gold);
  filter: drop-shadow(0 0 16px rgba(251, 191, 36, 0.6));
  animation: bp-crown-bounce 1.5s ease-in-out infinite;
  z-index: 10;
}
@keyframes bp-crown-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(-3deg); }
  50%      { transform: translateX(-50%) translateY(-6px) rotate(3deg); }
}

.battle-popup__info {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  position: relative; z-index: 1;
}
.battle-popup__name-row {
  display: flex; align-items: center; gap: 8px;
}
.battle-popup__name {
  font-size: 15px; font-weight: 700; color: #fff;
  max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.battle-popup__you {
  padding: 2px 8px; border-radius: 4px;
  background: linear-gradient(135deg, rgba(79, 255, 176, 0.1), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(79, 255, 176, 0.18);
  font-size: 9px; font-weight: 900; color: var(--cf-accent-light);
  letter-spacing: 1px; text-transform: uppercase;
}
.battle-popup__bet-row {
  display: flex; align-items: center; gap: 10px;
}
.battle-popup__bet {
  font-size: 14px; font-weight: 700; font-family: var(--cf-mono);
  color: var(--cf-text);
}
.battle-popup__odds {
  font-size: 11px; font-weight: 700; font-family: var(--cf-mono);
  color: var(--cf-text-dim);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 6px; border-radius: 4px;
}
.battle-popup__waiting-indicator {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--cf-text-dim); font-size: 12px; font-weight: 500;
  position: relative; z-index: 1;
  padding: 12px 0;
}

/* Spinner */
.battle-popup__spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(79, 255, 176, 0.1);
  border-top-color: var(--cf-accent);
  animation: cf-spin 0.8s linear infinite;
}
@keyframes cf-spin { to { transform: rotate(360deg); } }

/* Center section */
.battle-popup__center {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  flex-shrink: 0;
  padding: 14px 0;
  min-width: 120px;
  position: relative; z-index: 2;
}
.battle-popup__status {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 800; color: var(--cf-text-dim);
  text-transform: uppercase; letter-spacing: 2px;
}
.battle-popup__status--waiting { color: var(--cf-text-muted); }
.battle-popup__status--ready { 
  color: var(--cf-green); 
  text-shadow: 0 0 12px rgba(0, 255, 163, 0.4);
}
.battle-popup__status--flipping { 
  color: var(--cf-accent-light); 
  text-shadow: 0 0 12px rgba(79, 255, 176, 0.2);
  animation: bp-flipping-text-pulse 1.2s ease-in-out infinite;
}
@keyframes bp-flipping-text-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.battle-popup__status svg { width: 20px; height: 20px; }

/* Bouncing dots */
.battle-popup__dots {
  display: flex; gap: 6px;
}
.battle-popup__dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cf-accent-light), #7dffcc);
  box-shadow: 0 0 10px rgba(79, 255, 176, 0.25);
  animation: bp-dot-bounce 1s ease-in-out infinite;
}
.battle-popup__dots span:nth-child(2) { animation-delay: 0.15s; }
.battle-popup__dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bp-dot-bounce {
  0%, 80%, 100% { transform: scale(0.4) translateY(0); opacity: 0.3; }
  40% { transform: scale(1.3) translateY(-6px); opacity: 1; }
}

/* Countdown — Clean circular timer */
.battle-popup__countdown {
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  position: relative;
  width: 80px; height: 80px;
}
.battle-popup__countdown-circle {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.battle-popup__countdown-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 3;
}
.battle-popup__countdown-progress {
  fill: none;
  stroke: var(--cf-accent, #4fffb0);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 188.496;
  transition: stroke-dashoffset 0.15s linear;
}
.battle-popup__countdown-num {
  font-size: 32px; font-weight: 800; font-family: var(--cf-mono);
  color: #fff;
  position: relative; z-index: 1;
  line-height: 1;
  animation: bp-cd-enter 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.battle-popup__countdown-label {
  font-size: 9px; font-weight: 700; color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase; letter-spacing: 1.5px;
  position: relative; z-index: 1;
  margin-top: 2px;
}
@keyframes bp-cd-enter {
  0%   { transform: scale(1.5); opacity: 0; }
  60%  { transform: scale(0.95); }
  100% { transform: scale(1); opacity: 1; }
}

/* Result */
.battle-popup__result {
  font-size: 14px; font-weight: 900; letter-spacing: 4px;
  text-transform: uppercase;
  padding: 8px 24px; border-radius: 24px;
  animation: bp-result-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}
.battle-popup__result::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: bp-result-shine 2s ease-in-out infinite;
}
@keyframes bp-result-shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes bp-result-in {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.battle-popup__result--red {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.15), rgba(244, 63, 94, 0.08));
  color: var(--cf-red);
  border: 1px solid rgba(244, 63, 94, 0.3);
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.12);
}
.battle-popup__result--green {
  background: linear-gradient(135deg, rgba(0, 255, 163, 0.15), rgba(0, 255, 163, 0.05));
  color: var(--cf-green);
  border: 1px solid rgba(0, 255, 163, 0.3);
  box-shadow: 0 0 20px rgba(0, 255, 163, 0.05);
}

/* Coin wrapper */
.battle-popup__coin-wrapper {
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.battle-popup__coin {
  width: 220px; height: 220px;
  position: relative; z-index: 1;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5));
}
.battle-popup__coin canvas { max-width: 100%; max-height: 100%; }

/* VS divider */
.battle-popup__vs-divider {
  display: flex; align-items: center; justify-content: center;
}
.battle-popup__vs {
  font-size: 11px; font-weight: 900; color: var(--cf-text-muted);
  letter-spacing: 4px; text-transform: uppercase;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 12px; border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Ticket (provably fair) */
.battle-popup__ticket {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 4px 24px; padding: 10px 18px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--cf-radius-sm);
  font-family: var(--cf-font);
  cursor: default; transition: all 0.2s ease;
}
.battle-popup__ticket--clickable {
  cursor: pointer;
}
.battle-popup__ticket--clickable:hover {
  border-color: rgba(0, 255, 163, 0.35);
  background: rgba(0, 255, 163, 0.03);
  box-shadow: 0 0 20px rgba(0, 255, 163, 0.06);
}
.battle-popup__ticket svg { flex-shrink: 0; color: var(--cf-green); }
.battle-popup__ticket-label {
  font-size: 11px; font-weight: 600; color: var(--cf-text-dim);
}
.battle-popup__ticket-value {
  font-size: 13px; font-weight: 800; font-family: var(--cf-mono);
}
.battle-popup__ticket-value--red { color: var(--cf-red); }
.battle-popup__ticket-value--green { color: var(--cf-green); }

/* User result banner */
.battle-popup__banner {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 8px 24px; padding: 14px 20px;
  border-radius: 14px;
  font-size: 15px; font-weight: 800;
  animation: bp-banner-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative; overflow: hidden;
}
@keyframes bp-banner-in {
  from { transform: translateY(20px) scale(0.9); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.battle-popup__banner--won {
  background: linear-gradient(135deg, rgba(0, 255, 163, 0.05), rgba(0, 255, 163, 0.05));
  border: 1px solid rgba(0, 255, 163, 0.3);
  color: var(--cf-green);
  box-shadow: 0 4px 30px rgba(0, 255, 163, 0.05), inset 0 0 30px rgba(0, 255, 163, 0.03);
}
.battle-popup__banner--lost {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.12), rgba(244, 63, 94, 0.05));
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--cf-red);
  box-shadow: 0 4px 30px rgba(244, 63, 94, 0.08);
}
.battle-popup__banner-icon { display: flex; flex-shrink: 0; }
.battle-popup__banner-text { font-size: 15px; font-weight: 900; letter-spacing: 2px; text-transform: uppercase; }
.battle-popup__banner-prize {
  font-family: var(--cf-mono); font-weight: 800;
  font-size: 16px;
}

/* Footer */
.battle-popup__footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.1);
}
.battle-popup__fair {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--cf-text-dim);
}
.battle-popup__fair svg { color: var(--cf-green); }
.battle-popup__footer-actions { display: flex; gap: 10px; }
.battle-popup__btn {
  padding: 10px 22px; border: none;
  border-radius: var(--cf-radius-sm);
  font-family: var(--cf-font);
  font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all 0.2s ease;
  letter-spacing: 0.3px;
}
.battle-popup__btn--cancel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--cf-text-dim);
}
.battle-popup__btn--cancel:hover { 
  background: rgba(244, 63, 94, 0.1); 
  border-color: rgba(244, 63, 94, 0.3); 
  color: var(--cf-red); 
  transform: translateY(-1px);
}
.battle-popup__btn--close {
  background: linear-gradient(135deg, var(--cf-accent), #7c3aed);
  color: #fff;
  box-shadow: 0 4px 20px rgba(79, 255, 176, 0.15);
  position: relative; overflow: hidden;
}
.battle-popup__btn--close::before {
  content: '';
  position: absolute; top: 0; left: -100%; 
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  transition: left 0.4s ease;
}
.battle-popup__btn--close:hover::before { left: 100%; }
.battle-popup__btn--close:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 8px 32px rgba(79, 255, 176, 0.25); 
}

/* ================================================================
   PROVABLY FAIR VERIFICATION MODAL (ProvablyFairVerificationModal)
   ================================================================ */
.pf-modal-overlay {
  position: fixed; inset: 0; z-index: 10001;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  animation: cf-fade-in 0.3s ease;
}
.pf-modal {
  position: relative;
  width: 560px; max-width: 95vw; max-height: 85vh;
  background: linear-gradient(165deg, #141820, #0c0f14);
  border: 1px solid var(--cf-border);
  border-radius: 20px;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  animation: bp-card-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pf-modal::-webkit-scrollbar { width: 4px; }
.pf-modal::-webkit-scrollbar-thumb { background: rgba(79, 255, 176, 0.15); border-radius: 4px; }
.pf-modal__close {
  position: absolute; top: 14px; right: 14px; z-index: 10;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--cf-text-dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--cf-transition);
}
.pf-modal__close:hover { background: rgba(244, 63, 94, 0.15); color: var(--cf-red); }
.pf-modal__close svg { width: 16px; height: 16px; }

.pf-modal__header {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 24px 24px 16px; text-align: center;
  border-bottom: 1px solid var(--cf-border);
}
.pf-modal__icon { display: flex; color: var(--cf-green); margin-bottom: 4px; }
.pf-modal__icon svg { width: 28px; height: 28px; }
.pf-modal__title { font-size: 20px; font-weight: 800; color: #fff; margin: 0; }
.pf-modal__subtitle { font-size: 12px; color: var(--cf-text-dim); margin: 0; font-family: var(--cf-mono); }

.pf-modal__body { padding: 20px 24px; }
.pf-modal__footer {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--cf-border);
  display: flex; justify-content: center;
}

/* PF Button */
.pf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 24px; border: none;
  border-radius: var(--cf-radius-sm);
  font-family: var(--cf-font);
  font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all var(--cf-transition);
}
.pf-btn--primary {
  background: linear-gradient(135deg, var(--cf-accent), #7c3aed);
  color: #fff;
  box-shadow: 0 4px 16px rgba(79, 255, 176, 0.15);
}
.pf-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(79, 255, 176, 0.25); }

/* Verifying state */
.pf-verifying {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 40px 20px; color: var(--cf-text-dim); font-size: 13px;
}
.pf-spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid rgba(79, 255, 176, 0.1);
  border-top-color: var(--cf-accent);
  animation: cf-spin 0.8s linear infinite;
}

/* Error */
.pf-error {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 24px 16px; text-align: center;
}
.pf-error__icon { color: var(--cf-red); }
.pf-error h3 { font-size: 16px; font-weight: 700; color: #fff; margin: 0; }
.pf-error p { font-size: 13px; color: var(--cf-text-dim); margin: 0; }

/* Status banner */
.pf-status {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px; border-radius: var(--cf-radius); text-align: center;
  margin-bottom: 16px;
}
.pf-status--valid {
  background: rgba(0, 255, 163, 0.06);
  border: 1px solid rgba(0, 255, 163, 0.15);
}
.pf-status--invalid {
  background: rgba(244, 63, 94, 0.06);
  border: 1px solid rgba(244, 63, 94, 0.15);
}
.pf-status__icon { display: flex; }
.pf-status--valid .pf-status__icon { color: var(--cf-green); }
.pf-status--invalid .pf-status__icon { color: var(--cf-red); }
.pf-status h3 { font-size: 16px; font-weight: 800; color: #fff; margin: 0; }
.pf-status p { font-size: 12px; color: var(--cf-text-dim); margin: 0; max-width: 360px; }

/* Summary */
.pf-summary {
  display: flex; gap: 12px; margin-bottom: 16px;
}
.pf-summary__item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--cf-radius-sm);
}
.pf-summary__label { font-size: 10px; font-weight: 700; color: var(--cf-text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.pf-summary__value { font-size: 14px; font-weight: 800; color: #fff; font-family: var(--cf-mono); }
.pf-summary__badge {
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
}
.pf-summary__badge--red { background: var(--cf-red-bg); color: var(--cf-red); border: 1px solid rgba(244, 63, 94, 0.2); }
.pf-summary__badge--green { background: var(--cf-green-bg); color: var(--cf-green); border: 1px solid rgba(0, 255, 163, 0.2); }
.pf-summary__match { font-size: 13px; font-weight: 800; }
.pf-summary__match--yes { color: var(--cf-green); }
.pf-summary__match--no { color: var(--cf-red); }

/* Section */
.pf-section { margin-bottom: 16px; }
.pf-section:last-child { margin-bottom: 0; }
.pf-section__title {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--cf-accent-light);
  margin: 0 0 10px;
}
.pf-section__title svg { flex-shrink: 0; }

/* Detail cards */
.pf-details {
  display: flex; flex-direction: column; gap: 8px;
}
.pf-detail-card {
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--cf-radius-sm);
}
.pf-detail-card--compact { padding: 8px 12px; }
.pf-detail-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.pf-detail-label { font-size: 11px; font-weight: 600; color: var(--cf-text-dim); }
.pf-detail-value {
  display: block; font-family: var(--cf-mono); font-size: 11px; color: var(--cf-text);
  word-break: break-all; line-height: 1.5;
}
.pf-detail-value--hash, .pf-detail-value--seed { font-size: 10px; color: var(--cf-text-dim); }
.pf-detail-hint { font-size: 10px; color: var(--cf-text-muted); margin-top: 4px; }
.pf-detail-row-inline {
  display: flex; align-items: center; gap: 8px;
}
.pf-detail-row-inline .pf-detail-value { word-break: normal; }

/* Copy button */
.pf-copy-btn {
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--cf-text-dim); transition: color 0.2s;
  display: flex; align-items: center;
}
.pf-copy-btn:hover { color: var(--cf-accent-light); }

/* Ticket comparison */
.pf-ticket-comparison {
  display: flex; align-items: center; gap: 12px;
  justify-content: center; padding: 8px 0;
}
.pf-ticket-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.pf-ticket-label { font-size: 10px; font-weight: 600; color: var(--cf-text-dim); }
.pf-ticket-value { font-size: 14px; font-weight: 800; font-family: var(--cf-mono); color: #fff; }
.pf-ticket-value--match { color: var(--cf-green); }
.pf-ticket-value--mismatch { color: var(--cf-red); }
.pf-ticket-separator {
  font-size: 18px; font-weight: 900; color: var(--cf-text-dim);
}

/* Color text helpers for PF modal */
.pf-text-red { color: var(--cf-red); }
.pf-text-green { color: var(--cf-green); }

/* Steps */
.pf-steps {
  display: flex; flex-direction: column; gap: 10px;
}
.pf-step {
  display: flex; gap: 12px; align-items: flex-start;
}
.pf-step__number {
  width: 24px; height: 24px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--cf-accent), #7c3aed);
  border-radius: 50%;
  font-size: 11px; font-weight: 800; color: #fff;
}
.pf-step__content { flex: 1; }
.pf-step__content h5 { font-size: 12px; font-weight: 700; color: #fff; margin: 0 0 2px; }
.pf-step__content p { font-size: 11px; color: var(--cf-text-dim); margin: 0; line-height: 1.5; }

/* ================================================================
   JOIN DIALOG
   ================================================================ */
.cf-dialog-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  animation: cf-fade-in 0.3s ease;
}
.cf-dialog {
  position: relative;
  width: 440px; max-width: 92vw;
  background: linear-gradient(165deg, #141820, #0c0f14);
  border: 1px solid var(--cf-border);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  animation: bp-card-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}
.cf-dialog-close {
  position: absolute; top: 12px; right: 12px; z-index: 10;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--cf-text-dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--cf-transition);
}
.cf-dialog-close:hover { background: rgba(244, 63, 94, 0.15); color: var(--cf-red); }
.cf-dialog-close svg { width: 14px; height: 14px; }
.cf-dialog-header {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--cf-border);
}
.cf-dialog-badge { font-size: 10px; font-weight: 700; color: var(--cf-accent-light); text-transform: uppercase; letter-spacing: 2px; }
.cf-dialog-title { font-size: 18px; font-weight: 800; color: #fff; margin: 0; }
.cf-dialog-body { padding: 16px 20px; }
.cf-dialog-info {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px; background: rgba(255, 255, 255, 0.03);
  border-radius: var(--cf-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.cf-dialog-info-row { display: flex; align-items: center; justify-content: space-between; }
.cf-dialog-label { font-size: 12px; color: var(--cf-text-dim); font-weight: 500; }
.cf-dialog-value { font-size: 13px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 4px; }
.cf-dialog-value--coins { font-family: var(--cf-mono); }
.cf-dialog-amount { margin-top: 12px; }
.cf-dialog-amount-row { display: flex; flex-direction: column; gap: 8px; }
.cf-dialog-range { font-size: 11px; color: var(--cf-text-dim); text-align: center; font-family: var(--cf-mono); }
.cf-dialog-odds {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--cf-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.cf-dialog-odds-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cf-dialog-odds-label { font-size: 10px; color: var(--cf-text-dim); font-weight: 600; }
.cf-dialog-odds-value { font-size: 18px; font-weight: 900; font-family: var(--cf-mono); }
.cf-dialog-odds-pot { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cf-dialog-odds-pot-value {
  display: flex; align-items: center; gap: 4px;
  font-size: 16px; font-weight: 800; font-family: var(--cf-mono); color: var(--cf-gold);
}
.cf-dialog-footer {
  display: flex; gap: 10px;
  padding: 14px 20px 20px;
  border-top: 1px solid var(--cf-border);
}
.cf-dialog-footer .cf-btn { flex: 1; }

/* ================================================================
   MODALS – Rules, Daily Rewards
   ================================================================ */
.cf-modal-overlay,
.cf-modal-backdrop {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  animation: cf-fade-in 0.3s ease;
}
.cf-modal {
  position: relative;
  background: linear-gradient(165deg, #141820, #0c0f14);
  border: 1px solid var(--cf-border);
  border-radius: 20px;
  width: 90%; max-width: 560px; max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  animation: bp-card-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cf-modal::-webkit-scrollbar { width: 4px; }
.cf-modal::-webkit-scrollbar-thumb { background: rgba(79, 255, 176, 0.15); border-radius: 4px; }
.cf-modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 10;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--cf-text-dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--cf-transition);
}
.cf-modal-close:hover { background: rgba(244, 63, 94, 0.15); color: var(--cf-red); }
.cf-modal-close svg { width: 16px; height: 16px; }
.cf-modal-header {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 24px 24px 16px; text-align: center;
  border-bottom: 1px solid var(--cf-border);
}
.cf-modal-badge { font-size: 10px; font-weight: 700; color: var(--cf-accent-light); text-transform: uppercase; letter-spacing: 2px; }
.cf-modal-title { font-size: 22px; font-weight: 800; color: #fff; margin: 0; }
.cf-modal-subtitle { font-size: 13px; color: var(--cf-text-dim); margin: 0; }
.cf-modal-body { padding: 20px 24px; }
.cf-modal-footer {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--cf-border);
}

/* ================================================================
   HOW TO PLAY MODAL
   ================================================================ */
.cf-htp-modal { max-width: 680px; }
.cf-htp-body { display: flex; flex-direction: column; gap: 24px; }

.cf-htp-section {
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--cf-radius);
}
.cf-htp-section--highlight {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}
.cf-htp-section-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.cf-htp-section-header h3 {
  font-size: 16px; font-weight: 800; color: #fff; margin: 0;
}
.cf-htp-section-icon {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: rgba(255, 255, 255, 0.05); flex-shrink: 0;
}
.cf-htp-section-icon svg { color: var(--cf-text-muted); }
.cf-htp-section-icon--accent { background: rgba(255, 255, 255, 0.08); }
.cf-htp-section-icon--accent svg { color: var(--cf-accent-light); }

.cf-htp-intro {
  font-size: 13px; color: var(--cf-text-dim); line-height: 1.6; margin: 0 0 14px;
}
.cf-htp-intro strong { color: #fff; }

/* Steps */
.cf-htp-steps { display: flex; flex-direction: column; gap: 12px; }
.cf-htp-step {
  display: flex; align-items: flex-start; gap: 12px;
}
.cf-htp-step-num {
  width: 28px; height: 28px; min-width: 28px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--cf-accent), #7c3aed);
  border-radius: 50%; font-size: 13px; font-weight: 800; color: #fff;
}
.cf-htp-step h4 { font-size: 13px; font-weight: 700; color: #fff; margin: 0 0 3px; }
.cf-htp-step p { font-size: 12px; color: var(--cf-text-dim); margin: 0; line-height: 1.5; }

/* Example boxes */
.cf-htp-example-box {
  margin-top: 12px; padding: 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--cf-radius-sm);
}
.cf-htp-example-box h4 {
  font-size: 12px; font-weight: 700; color: var(--cf-accent-light);
  text-transform: uppercase; letter-spacing: 1px; margin: 0 0 10px;
}
.cf-htp-example-box ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.cf-htp-example-box li {
  position: relative; padding-left: 14px;
  font-size: 12px; color: var(--cf-text-dim); line-height: 1.5;
}
.cf-htp-example-box li::before {
  content: ''; position: absolute; left: 0; top: 7px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--cf-accent);
}
.cf-htp-example-box li strong { color: #fff; }
.cf-htp-example-scenario {
  margin-bottom: 10px;
}
.cf-htp-example-scenario p {
  font-size: 12px; color: var(--cf-text-dim); margin: 0 0 4px; line-height: 1.5;
}
.cf-htp-example-scenario p strong { color: #fff; }

/* Example table */
.cf-htp-example-table {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px; overflow: hidden;
}
.cf-htp-example-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;
  font-size: 11px; color: var(--cf-text-dim);
}
.cf-htp-example-row span {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.cf-htp-example-row:last-child span { border-bottom: none; }
.cf-htp-example-row--header {
  font-weight: 700; color: var(--cf-text-muted);
  background: rgba(255, 255, 255, 0.03);
}
.cf-htp-example-row--header span {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
}
.cf-htp-example-note {
  font-size: 11px; color: var(--cf-text-dim); margin: 10px 0 0; line-height: 1.5;
}
.cf-htp-example-note strong { color: #fff; }

/* Fair grid */
.cf-htp-fair-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.cf-htp-fair-item {
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--cf-radius-sm);
}
.cf-htp-fair-item h4 { font-size: 12px; font-weight: 700; color: #fff; margin: 0 0 4px; }
.cf-htp-fair-item p { font-size: 11px; color: var(--cf-text-dim); margin: 0; line-height: 1.5; }

/* Info list */
.cf-htp-info-list {
  display: flex; flex-direction: column; gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--cf-radius-sm); overflow: hidden;
}
.cf-htp-info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.cf-htp-info-row:last-child { border-bottom: none; }
.cf-htp-info-row:nth-child(even) { background: rgba(255, 255, 255, 0.015); }
.cf-htp-info-label { font-size: 12px; font-weight: 600; color: var(--cf-text-muted); }
.cf-htp-info-value { font-size: 12px; color: #fff; text-align: right; }

/* Floating Action Button — bottom left */
.cf-htp-fab {
  position: fixed; bottom: 24px; left: 24px; z-index: 900;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(79, 255, 176, 0.12);
  border-radius: 50px;
  color: var(--cf-accent-light);
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}
.cf-htp-fab:hover {
  background: rgba(79, 255, 176, 0.1);
  border-color: rgba(79, 255, 176, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(79, 255, 176, 0.1);
}
.cf-htp-fab svg { flex-shrink: 0; }

/* ================================================================
   RULES MODAL — Community Rules
   ================================================================ */
.cf-rules-modal { max-width: 640px; }
.cf-rules-body { display: flex; flex-direction: column; gap: 20px; }

.cf-rules-section {
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--cf-radius-sm);
}
.cf-rules-section--enforcement {
  background: rgba(244, 63, 94, 0.04);
  border-color: rgba(244, 63, 94, 0.12);
}
.cf-rules-section-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.cf-rules-section-header h3 {
  font-size: 14px; font-weight: 800; color: #fff; margin: 0;
}
.cf-rules-section-num {
  width: 26px; height: 26px; min-width: 26px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--cf-accent), #7c3aed);
  border-radius: 50%; font-size: 12px; font-weight: 800; color: #fff;
}
.cf-rules-section-num--warn {
  background: linear-gradient(135deg, var(--cf-red), #e11d48);
}
.cf-rules-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.cf-rules-list li {
  position: relative; padding-left: 14px;
  font-size: 12px; color: var(--cf-text-dim); line-height: 1.6;
}
.cf-rules-list li::before {
  content: ''; position: absolute; left: 0; top: 7px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--cf-accent);
}
.cf-rules-section--enforcement .cf-rules-list li::before {
  background: var(--cf-red);
}
.cf-rules-list li strong { color: #fff; }

/* ================================================================
   CONFETTI (shared)
   ================================================================ */
.cf-confetti,
.dr-confetti {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 50;
}
.cf-confetti-piece,
.dr-confetti-piece {
  position: absolute; top: -10px;
  width: 8px; height: 8px; border-radius: 2px;
  animation: bp-confetti-fall 3s ease-out forwards;
}

/* ================================================================
   DAILY REWARDS v3 — Premium dark glass
   ================================================================ */
.dr3 {
  max-width: 420px; width: 100%;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  position: relative;
}

/* Empty / loading states */
.dr3-empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 56px 24px; text-align: center;
}
.dr3-empty-icon { display: flex; color: var(--cf-accent-light); opacity: 0.5; }
.dr3-empty-icon svg { width: 36px; height: 36px; }

/* ── Banner ── */
.dr3-banner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 48px 14px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.dr3-banner-streak {
  display: flex; align-items: baseline; gap: 6px;
}
.dr3-banner-num {
  font-size: 28px; font-weight: 900; color: #fff;
  font-family: var(--cf-mono); line-height: 1;
}
.dr3-banner-unit {
  font-size: 12px; font-weight: 600; color: var(--cf-text-dim);
}
.dr3-banner-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
}
.dr3-banner-status {
  font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 4px;
}
.dr3-banner-status svg { width: 14px; height: 14px; }
.dr3-banner-status--done { color: var(--cf-green); }
.dr3-banner-status--ready { color: var(--cf-accent-light); }
.dr3-banner-timer {
  font-size: 10px; font-weight: 600; color: var(--cf-text-dim);
}

/* ── Reward card ── */
.dr3-reward-card {
  display: flex; align-items: center; gap: 14px;
  margin: 14px 16px 0;
  padding: 14px 16px;
  background: var(--rc-bg, rgba(255,255,255,0.02));
  border: 1px solid var(--rc-border, rgba(255,255,255,0.06));
  border-radius: 12px;
  position: relative;
}
.dr3-reward-icon {
  width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--rc-border, rgba(255,255,255,0.06));
  color: var(--rc, #fff);
}
.dr3-reward-icon svg { width: 20px; height: 20px; }
.dr3-reward-body { flex: 1; min-width: 0; }
.dr3-reward-name {
  font-size: 14px; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dr3-reward-desc {
  font-size: 11px; color: var(--cf-text-dim); margin-top: 1px;
}
.dr3-reward-badge {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.dr3-reward-badge--done { color: var(--cf-green); }
.dr3-reward-badge--done svg { width: 20px; height: 20px; }
.dr3-reward-badge--new {
  font-size: 9px; font-weight: 800; letter-spacing: 1px;
  color: var(--rc, var(--cf-accent-light));
  padding: 3px 8px; border-radius: 6px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--rc-border, rgba(255,255,255,0.08));
}

/* ── Claim action ── */
.dr3-action {
  padding: 14px 16px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.dr3-claim {
  width: 100%;
  padding: 13px 24px;
  background: linear-gradient(135deg, var(--cf-accent) 0%, #6d28d9 100%);
  color: #fff; font-size: 14px; font-weight: 700;
  border: none; border-radius: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--cf-body);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.dr3-claim:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139,92,246,0.3);
}
.dr3-claim:active:not(:disabled) { transform: translateY(0); }
.dr3-claim:disabled { opacity: 0.6; cursor: not-allowed; }
.dr3-claim--busy { opacity: 0.7; }

.dr3-claimed {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: 10px;
  background: rgba(79,255,176,0.05);
  border: 1px solid rgba(79,255,176,0.1);
  color: var(--cf-green); font-size: 13px; font-weight: 600;
}
.dr3-claimed svg { width: 15px; height: 15px; }

.dr3-err {
  padding: 8px 14px; background: rgba(244,63,94,0.06);
  border: 1px solid rgba(244,63,94,0.12); border-radius: 8px;
  font-size: 12px; color: var(--cf-red); font-weight: 500;
  text-align: center;
}

/* ── Week grid ── */
.dr3-week {
  margin: 10px 16px 0;
  padding: 12px 14px;
  background: rgba(255,255,255,0.015);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 12px;
}
.dr3-week-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.dr3-week-label {
  font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.7);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.dr3-week-range {
  font-size: 10px; font-weight: 600; color: var(--cf-text-dim);
}

.dr3-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.dr3-cell {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 5px 2px; border-radius: 8px;
  transition: all 0.15s ease;
}
.dr3-cell-day {
  font-size: 9px; font-weight: 700; color: var(--cf-text-dim);
  font-family: var(--cf-mono);
}
.dr3-cell-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.025);
  color: var(--cf-text-dim);
  transition: all 0.15s ease;
}
.dr3-cell-icon svg { width: 13px; height: 13px; }

/* Current day */
.dr3-cell--now {
  background: rgba(139,92,246,0.08);
  border: 1px solid rgba(139,92,246,0.2);
}
.dr3-cell--now .dr3-cell-icon {
  background: linear-gradient(135deg, var(--cf-accent), #6d28d9);
  color: #fff;
  box-shadow: 0 2px 8px rgba(139,92,246,0.25);
}
.dr3-cell--now .dr3-cell-day { color: var(--cf-accent-light); }

/* Past days */
.dr3-cell--done { opacity: 0.45; }
.dr3-cell--done .dr3-cell-icon { color: var(--cf-green); }

/* Future / locked */
.dr3-cell--lock { opacity: 0.25; }

/* Combo day */
.dr3-cell--combo .dr3-cell-icon {
  background: rgba(79,255,176,0.06);
  border: 1px dashed rgba(79,255,176,0.15);
}

/* Progress bar */
.dr3-progress { margin-top: 8px; }
.dr3-progress-track {
  height: 3px; border-radius: 2px;
  background: rgba(255,255,255,0.04);
  overflow: hidden;
}
.dr3-progress-fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--cf-accent), var(--cf-green));
  transition: width 0.6s ease-out;
}
.dr3-progress-txt {
  display: block; text-align: center;
  font-size: 10px; font-weight: 600; color: var(--cf-text-dim);
  margin-top: 5px;
}

/* ── Power-up pills ── */
.dr3-pus {
  margin: 10px 16px 16px;
}
.dr3-pus-label {
  font-size: 10px; font-weight: 700; color: var(--cf-text-dim);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px;
  display: block;
}
.dr3-pus-row { display: flex; gap: 5px; flex-wrap: wrap; }
.dr3-pu {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
}
.dr3-pu svg { width: 12px; height: 12px; }
.dr3-pu--xp { color: #fbbf24; border-color: rgba(251,191,36,0.15); }
.dr3-pu--cf { color: #3b82f6; border-color: rgba(59,130,246,0.15); }
.dr3-pu--bd { color: #ef4444; border-color: rgba(239,68,68,0.15); }
.dr3-pu--jp { color: #a855f7; border-color: rgba(168,85,247,0.15); }
.dr3-pu--em { color: #06b6d4; border-color: rgba(6,182,212,0.15); }
.dr3-pu--gd { color: #f97316; border-color: rgba(249,115,22,0.15); }

/* Shared spinner (keep for other uses) */
.cf-loading {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 40px 20px; color: var(--cf-text-dim); font-size: 13px;
}
.cf-spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid rgba(79, 255, 176, 0.1);
  border-top-color: var(--cf-accent);
  animation: cf-spin 0.8s linear infinite;
}
.cf-spinner--sm { width: 16px; height: 16px; border-width: 2px; }
.cf-login-prompt {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 40px 20px; text-align: center;
}
.cf-login-prompt svg { width: 28px; height: 28px; color: var(--cf-accent-light); opacity: 0.5; }
.cf-login-prompt h3 { font-size: 16px; font-weight: 700; color: #fff; margin: 0; }
.cf-login-prompt p { font-size: 13px; color: var(--cf-text-dim); margin: 0; }
.cf-login-icon { display: flex; }

/* ================================================================
   RESPONSIVE
   ================================================================ */

/* Tablets portrait */
@media (max-width: 1024px) {
  .cf-layout {
    grid-template-columns: 260px 1fr;
    gap: 14px; padding: 12px 12px 50px;
  }
}

/* Large phones / Small tablets */
@media (max-width: 900px) {
  .cf-layout {
    grid-template-columns: 1fr;
    gap: 14px; padding: 12px 10px 40px;
  }
  .cf-sidebar--left { order: 2; }
  .cf-sidebar--right { display: none; }
  .cf-main { order: 1; }

  .cf-header { flex-direction: column; gap: 10px; align-items: stretch; }
  .cf-header-title { justify-content: center; }
  .cf-header-actions { justify-content: center; flex-wrap: wrap; }

  /* Duel overlay */
  .battle-popup__card { width: 95vw; border-radius: 18px; }
  .battle-popup__players { flex-direction: column; gap: 12px; }
  .battle-popup__center { flex-direction: row; gap: 12px; }
  .battle-popup__countdown-num { font-size: 26px; }
  .battle-popup__countdown { width: 64px; height: 64px; }
  .battle-popup__coin { width: 170px; height: 170px; }
  .battle-popup__pot-amount { font-size: 24px; }

  .cf-dialog { width: 92vw; }

  /* Modals */
  .cf-htp-modal { max-width: 95vw; }
  .cf-rules-modal { max-width: 95vw; }
  .cf-htp-fair-grid { grid-template-columns: 1fr; }
  .cf-htp-section { padding: 16px; }
  .cf-htp-section-header h3 { font-size: 15px; }
  .cf-rules-section { padding: 14px; }
}

/* Phones */
@media (max-width: 600px) {
  .cf-app { padding-top: 64px; }
  .cf-layout { padding: 8px 8px 80px; gap: 12px; }

  .cf-header { padding: 10px 12px; }
  .cf-header-title h1 { font-size: 15px; }
  .cf-filter-tab { padding: 6px 12px; font-size: 11px; min-height: 36px; }

  .cf-panel-header { padding: 10px 14px; }
  .cf-panel-title { font-size: 12px; }
  .cf-panel-body { padding: 10px; }

  /* Battle card — touch-friendly */
  .bc__row { padding: 10px 12px; }
  .bc__footer { padding: 8px 12px 10px; }
  .bc__footer .cf-btn { min-height: 40px; padding: 10px 16px; }

  /* Create panel — mobile optimized */
  .create-panel__header { padding: 10px 14px; }
  .create-panel__content { padding: 12px; gap: 12px; }
  .create-panel__sides { gap: 8px; }
  .side-selector { padding: 10px 8px; min-height: 60px; }
  .side-selector__name { font-size: 11px; }
  .side-selector__coin { width: 32px; height: 32px; font-size: 13px; }
  .side-divider { padding: 0 4px; }

  /* Buttons — min touch target 44px */
  .cf-btn { padding: 10px 16px; font-size: 12px; min-height: 40px; }
  .cf-btn--lg { padding: 12px 20px; font-size: 14px; min-height: 44px; }
  .cta-btn { padding: 12px 16px; font-size: 13px; min-height: 44px; }

  /* Inputs — prevent iOS zoom (16px min) */
  .cf-input { font-size: 16px; padding: 10px 12px; min-height: 44px; }
  .amount-input input { font-size: 16px; padding: 10px 36px 10px 12px; min-height: 44px; }
  .preset-btn { font-size: 11px; padding: 8px 4px; min-width: 40px; min-height: 36px; }
  .tol-chip { padding: 8px 12px; min-height: 36px; }
  .tol-custom__input { min-height: 36px; font-size: 14px; }

  /* Leaderboard */
  .cf-leaderboard-item { padding: 8px 8px; gap: 6px; }
  .cf-leaderboard-name { font-size: 12px; }
  .cf-leaderboard-profit { font-size: 12px; }

  /* Duel overlay — mobile first */
  .battle-popup__card { border-radius: 16px; max-height: 92vh; }
  .battle-popup__header { padding: 16px 16px 10px; }
  .battle-popup__id { font-size: 9px; letter-spacing: 2px; padding: 4px 10px; position: absolute; left: 16px; top: 14px; }
  .battle-popup__pot-amount { font-size: 22px; }
  .battle-popup__pot-icon img { width: 26px; height: 26px; }
  .battle-popup__players { padding: 10px 12px; gap: 10px; }
  .battle-popup__player { padding: 14px 10px 12px; border-radius: 12px; }
  .battle-popup__avatar .cf-avatar,
  .battle-popup__avatar .cr-user-avatar { width: 65px; height: 65px; }
  .battle-popup__avatar .cr-user-avatar__inner { width: 48px !important; height: 48px !important; font-size: 16px !important; }
  .battle-popup__avatar .cr-user-avatar__frame,
  .battle-popup__avatar .cf-avatar__frame { width: 72px !important; height: 72px !important; }
  .battle-popup__avatar .cf-avatar__level { font-size: 8px; padding: 1px 5px; }
  .battle-popup__name { font-size: 13px; }
  .battle-popup__bet { font-size: 12px; }
  .battle-popup__odds { font-size: 9px; }
  .battle-popup__countdown-num { font-size: 24px; }
  .battle-popup__countdown { width: 56px; height: 56px; }
  .battle-popup__result { font-size: 11px; padding: 5px 14px; }
  .battle-popup__coin { width: 150px; height: 150px; }
  .battle-popup__ticket { margin: 4px 12px; padding: 8px 12px; }
  .battle-popup__banner { margin: 6px 12px; padding: 10px 12px; border-radius: 10px; }
  .battle-popup__banner-text { font-size: 12px; letter-spacing: 1.5px; }
  .battle-popup__banner-prize { font-size: 14px; }
  .battle-popup__footer { padding: 12px 12px 16px; }
  .battle-popup__btn { padding: 10px 18px; font-size: 12px; border-radius: 8px; min-height: 40px; }
  .battle-popup__glow { width: 300px; height: 180px; top: -50px; }
  .battle-popup__close { width: 36px; height: 36px; top: 10px; right: 10px; }

  /* Modals — mobile friendly */
  .cf-modal { width: 95vw; max-height: 85vh; border-radius: 16px; }
  .cf-modal-header { padding: 18px 16px 12px; }
  .cf-modal-title { font-size: 18px; }
  .cf-modal-subtitle { font-size: 12px; }
  .cf-modal-body { padding: 14px 14px; }
  .cf-modal-footer { padding: 12px 14px 18px; }
  .cf-modal-close { top: 12px; right: 12px; }

  /* How to Play modal — mobile */
  .cf-htp-modal { max-width: 100vw; }
  .cf-htp-body { gap: 16px; }
  .cf-htp-section { padding: 14px 12px; }
  .cf-htp-section-header { margin-bottom: 10px; }
  .cf-htp-section-header h3 { font-size: 14px; }
  .cf-htp-section-icon { width: 32px; height: 32px; border-radius: 8px; }
  .cf-htp-section-icon svg { width: 16px; height: 16px; }
  .cf-htp-step { gap: 10px; }
  .cf-htp-step-num { width: 24px; height: 24px; min-width: 24px; font-size: 11px; }
  .cf-htp-step h4 { font-size: 12px; }
  .cf-htp-step p { font-size: 11px; }
  .cf-htp-intro { font-size: 12px; }
  .cf-htp-example-box { padding: 12px; }
  .cf-htp-example-box h4 { font-size: 11px; }
  .cf-htp-example-box li { font-size: 11px; }
  .cf-htp-example-row { font-size: 10px; }
  .cf-htp-example-row span { padding: 6px 8px; }
  .cf-htp-fair-grid { grid-template-columns: 1fr; gap: 8px; }
  .cf-htp-fair-item { padding: 10px; }
  .cf-htp-fair-item h4 { font-size: 11px; }
  .cf-htp-fair-item p { font-size: 10px; }
  .cf-htp-info-row { padding: 8px 12px; }
  .cf-htp-info-label { font-size: 11px; }
  .cf-htp-info-value { font-size: 11px; }

  /* Rules modal — mobile */
  .cf-rules-modal { max-width: 100vw; }
  .cf-rules-body { gap: 14px; }
  .cf-rules-section { padding: 12px 10px; }
  .cf-rules-section-header { margin-bottom: 8px; }
  .cf-rules-section-header h3 { font-size: 13px; }
  .cf-rules-section-num { width: 22px; height: 22px; min-width: 22px; font-size: 10px; }
  .cf-rules-list li { font-size: 11px; padding-left: 12px; }

  /* Dialog — mobile */
  .cf-dialog { width: 95vw; border-radius: 16px; }
  .cf-dialog-header { padding: 16px 14px 10px; }
  .cf-dialog-body { padding: 12px 14px; }
  .cf-dialog-footer { padding: 12px 14px 16px; }
  .cf-dialog-footer .cf-btn { min-height: 44px; }

  .pf-modal { width: 95vw; border-radius: 16px; }

  /* Ticker */
  .cf-ticker-item { padding: 4px 8px; font-size: 10px; }

  /* Background – reduce complexity */
  .cf-orb--4, .cf-orb--5, .cf-orb--6 { display: none; }
  .cf-app::before { display: none; }

  /* FAB — above bottom safe area */
  .cf-htp-fab { bottom: 16px; left: 12px; padding: 8px 14px 8px 10px; font-size: 12px; gap: 6px; }
  .cf-htp-fab svg { width: 16px; height: 16px; }
}

/* Very small phones */
@media (max-width: 380px) {
  .cf-layout { padding: 6px 6px 80px; }
  .cf-header-title h1 { font-size: 13px; }
  .cf-filter-tab { padding: 5px 8px; font-size: 10px; }
  .battle-popup__pot-amount { font-size: 18px; }
  .battle-popup__countdown-num { font-size: 20px; }
  .battle-popup__countdown { width: 46px; height: 46px; }
  .battle-popup__coin { width: 120px; height: 120px; }
  .battle-popup__player { padding: 10px 6px; }
  .battle-popup__avatar .cf-avatar,
  .battle-popup__avatar .cr-user-avatar { width: 55px; height: 55px; }
  .battle-popup__avatar .cr-user-avatar__inner { width: 40px !important; height: 40px !important; font-size: 14px !important; }
  .battle-popup__avatar .cr-user-avatar__frame,
  .battle-popup__avatar .cf-avatar__frame { width: 60px !important; height: 60px !important; }
  .battle-popup__avatar .cf-avatar__level { font-size: 7px; padding: 1px 4px; }
  .battle-popup__name { font-size: 11px; max-width: 90px; }
  .battle-popup__you { font-size: 8px; padding: 2px 6px; }
  .preset-btn { min-width: 36px; font-size: 10px; }
  .side-selector { padding: 8px 6px; min-height: 54px; }
  .side-selector__coin { width: 28px; height: 28px; font-size: 11px; }

  /* Modals — max space */
  .cf-modal { width: 98vw; max-height: 90vh; }
  .cf-modal-header { padding: 14px 12px 10px; }
  .cf-modal-title { font-size: 16px; }
  .cf-modal-body { padding: 10px; }
  .cf-htp-section { padding: 10px 8px; }
  .cf-rules-section { padding: 10px 8px; }

  /* FAB — compact on tiny screens */
  .cf-htp-fab { bottom: 12px; left: 8px; padding: 7px 12px 7px 9px; font-size: 11px; }
  .cf-htp-fab svg { width: 14px; height: 14px; }
}

/* ======== FOOTER INTEGRATION ======== */
footer {
  margin-top: 0 !important;
  background: linear-gradient(180deg, var(--cf-bg) 0%, rgba(10, 15, 20, 1) 100%) !important;
  border-top-color: rgba(255, 255, 255, 0.08) !important;
}
