/**
 * CoinRush Slice 'n Dice V2 - Clean Modern Design
 * Matching Coinflip styling exactly
 */

/* ============================================
   CSS VARIABLES - Green Theme (matching Coinflip)
   ============================================ */
:root {
  /* Typography */
  --sd-font-primary: 'Sora', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --sd-font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  
  /* Core colors */
  --sd-bg-dark: #050807;
  --sd-bg-base: #0a0f0d;
  --sd-bg-card: rgba(12, 20, 16, 0.95);
  --sd-bg-elevated: rgba(255, 255, 255, 0.04);
  
  /* Accent colors */
  --sd-accent: #5bffb2;
  --sd-accent-dim: #3dd492;
  --sd-accent-glow: rgba(91, 255, 178, 0.35);
  
  /* Text */
  --sd-text-primary: #ffffff;
  --sd-text-secondary: rgba(255, 255, 255, 0.75);
  --sd-text-muted: rgba(255, 255, 255, 0.45);
  --sd-text-disabled: rgba(255, 255, 255, 0.25);
  
  /* Gold */
  --sd-gold: #fbbf24;
  --sd-gold-dim: #f59e0b;
  --sd-gold-glow: rgba(251, 191, 36, 0.35);
  
  /* Game colors */
  --sd-green: #22c55e;
  --sd-green-light: #4ade80;
  --sd-green-glow: rgba(34, 197, 94, 0.4);
  
  --sd-red: #ef4444;
  --sd-red-light: #f87171;
  --sd-red-glow: rgba(239, 68, 68, 0.4);
  
  /* Borders */
  --sd-border: rgba(255, 255, 255, 0.06);
  --sd-border-hover: rgba(91, 255, 178, 0.2);
  
  /* Radius */
  --sd-radius-sm: 8px;
  --sd-radius-md: 12px;
  --sd-radius-lg: 16px;
  
  /* Transitions */
  --sd-transition-fast: 0.15s ease;
  --sd-transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   GLOBAL RESET
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--sd-bg-dark);
  color: var(--sd-text-primary);
  font-family: var(--sd-font-primary);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Ensure navbar sticks to very top */
body {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Override sticky navbar to fixed for consistent behavior */
.jackpot-topnav {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  margin: 0 !important;
}

/* ============================================
   AVATAR COMPONENT - With Level Borders
   ============================================ */
.sd-avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  flex-shrink: 0;
}

.sd-avatar--xs { width: 24px; height: 24px; font-size: 10px; }
.sd-avatar--sm { width: 40px; height: 40px; font-size: 14px; }
.sd-avatar--md { width: 48px; height: 48px; font-size: 16px; }
.sd-avatar--lg { width: 64px; height: 64px; font-size: 20px; }
.sd-avatar--xl { width: 80px; height: 80px; font-size: 24px; }

.sd-avatar__initials {
  position: relative;
  z-index: 2;
}

.sd-avatar__level {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: linear-gradient(135deg, #5bffb2, #3dd492);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 8px;
  z-index: 15;
  min-width: 18px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.sd-avatar--lg .sd-avatar__level {
  font-size: 12px;
  padding: 3px 6px;
  min-width: 22px;
  bottom: -6px;
  right: -6px;
}

.sd-avatar__frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
}

/* ============================================
   MAIN APP CONTAINER
   ============================================ */
.sd-app {
  min-height: 100vh;
  background: var(--sd-bg-base);
  padding-top: 72px; /* Navbar space */
  position: relative;
}

/* ============================================
   FLOATING ORBS - Background Animation
   ============================================ */
.sd-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sd-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: orbFloat 20s ease-in-out infinite;
}

.sd-orb--1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(91, 255, 178, 0.15) 0%, transparent 70%);
  top: -10%;
  left: -5%;
  animation-delay: 0s;
}

.sd-orb--2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.12) 0%, transparent 70%);
  bottom: -10%;
  right: -5%;
  animation-delay: -7s;
}

.sd-orb--3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.08) 0%, transparent 70%);
  top: 40%;
  left: 30%;
  animation-delay: -14s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ============================================
   PARTICLES - Floating dots
   ============================================ */
.sd-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sd-particle {
  position: absolute;
  width: var(--size, 3px);
  height: var(--size, 3px);
  background: var(--color, rgba(91, 255, 178, 0.8));
  border-radius: 50%;
  left: var(--x);
  bottom: -10px;
  animation: particleFloat var(--duration, 6s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0;
}

@keyframes particleFloat {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.6; }
  100% { transform: translateY(-100vh); opacity: 0; }
}

/* ============================================
   CONNECTION WARNING
   ============================================ */
.sd-connection-warning {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(239, 68, 68, 0.9);
  padding: 12px 24px;
  border-radius: var(--sd-radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

/* ============================================
   HISTORY TICKER
   ============================================ */
.sd-ticker {
  position: relative;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--sd-border);
  overflow: hidden;
  height: 44px;
  z-index: 10;
}

.sd-ticker-track {
  display: flex;
  gap: 40px;
  padding: 0 20px;
  height: 100%;
  align-items: center;
  animation: tickerScroll 30s linear infinite;
  width: max-content;
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.sd-ticker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 13px;
}

.sd-ticker-id {
  color: var(--sd-text-muted);
  font-family: var(--sd-font-mono);
}

.sd-ticker-winner {
  color: var(--sd-text-primary);
  font-weight: 600;
}

.sd-ticker-text {
  color: var(--sd-text-muted);
}

.sd-ticker-amount {
  font-weight: 700;
  font-family: var(--sd-font-mono);
  padding: 2px 8px;
  border-radius: 6px;
}

.sd-ticker-amount--win {
  color: var(--sd-green-light);
  background: rgba(34, 197, 94, 0.15);
}

.sd-ticker-amount--lose {
  color: var(--sd-red-light);
  background: rgba(239, 68, 68, 0.15);
}

.sd-ticker-roll {
  font-family: var(--sd-font-mono);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(91, 255, 178, 0.15);
  color: var(--sd-accent);
}

/* ============================================
   MAIN LAYOUT - 3 Column
   ============================================ */
.sd-layout {
  display: grid;
  grid-template-columns: 300px 1fr 320px;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 16px;
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 80px);
}

@media (max-width: 1200px) {
  .sd-layout {
    grid-template-columns: 280px 1fr;
  }
  .sd-sidebar--right {
    display: none;
  }
}

@media (max-width: 900px) {
  .sd-layout {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .sd-sidebar--left {
    order: 2;
  }
}

/* ============================================
   SIDEBARS
   ============================================ */
.sd-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 80px;
  height: fit-content;
  max-height: calc(100vh - 100px);
}

/* ============================================
   CREATE PANEL - Clean V3 (matching Coinflip)
   ============================================ */
.create-panel {
  background: rgba(10, 15, 12, 0.98);
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius-md);
  overflow: hidden;
}

.create-panel__header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.create-panel__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.create-panel__icon {
  color: var(--sd-accent);
  display: flex;
  width: 16px;
  height: 16px;
}

.create-panel__icon svg {
  width: 100%;
  height: 100%;
}

.create-panel__content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Side Selector (matching Coinflip R/G) - but for dice High/Low */
.create-panel__sides {
  display: flex;
  align-items: center;
  gap: 8px;
}

.side-selector {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid transparent;
  border-radius: var(--sd-radius-md);
  cursor: pointer;
  transition: all var(--sd-transition-base);
}

.side-selector--high {
  border-color: rgba(34, 197, 94, 0.2);
}

.side-selector--low {
  border-color: rgba(239, 68, 68, 0.2);
}

.side-selector--active.side-selector--high {
  border-color: var(--sd-green);
  background: rgba(34, 197, 94, 0.1);
}

.side-selector--active.side-selector--low {
  border-color: var(--sd-red);
  background: rgba(239, 68, 68, 0.1);
}

.side-selector__dice {
  width: 40px;
  height: 40px;
  border-radius: var(--sd-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
}

.side-selector--high .side-selector__dice {
  background: linear-gradient(135deg, var(--sd-green), var(--sd-green-light));
}

.side-selector--low .side-selector__dice {
  background: linear-gradient(135deg, var(--sd-red), var(--sd-red-light));
}

.side-selector__label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-selector__name {
  font-size: 13px;
  font-weight: 700;
  color: var(--sd-text-primary);
}

.side-selector__subtitle {
  font-size: 10px;
  color: var(--sd-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.side-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.side-divider__text {
  font-size: 10px;
  font-weight: 800;
  color: var(--sd-text-muted);
}

/* Amount Input */
.amount-input {
  position: relative;
}

.amount-input input {
  width: 100%;
  padding: 14px 50px 14px 16px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--sd-border);
  border-radius: var(--sd-radius-md);
  color: var(--sd-text-primary);
  font-size: 20px;
  font-weight: 700;
  font-family: var(--sd-font-mono);
  outline: none;
  transition: all var(--sd-transition-fast);
}

.amount-input input:focus {
  border-color: var(--sd-accent);
  box-shadow: 0 0 0 3px rgba(91, 255, 178, 0.1);
}

.amount-input input::placeholder {
  color: var(--sd-text-disabled);
}

.amount-input img {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  opacity: 0.8;
}

/* Amount Presets */
.amount-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.preset-btn {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius-sm);
  color: var(--sd-text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--sd-font-mono);
  cursor: pointer;
  transition: all var(--sd-transition-fast);
}

.preset-btn:hover {
  background: rgba(91, 255, 178, 0.1);
  border-color: var(--sd-accent);
  color: var(--sd-accent);
}

.preset-btn--max {
  background: rgba(91, 255, 178, 0.1);
  border-color: rgba(91, 255, 178, 0.3);
  color: var(--sd-accent);
}

/* Min Roll Input */
.minroll-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.minroll-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--sd-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.minroll-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.minroll-input input {
  width: 100px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius-sm);
  color: var(--sd-text-primary);
  font-size: 14px;
  font-family: var(--sd-font-mono);
  outline: none;
}

.minroll-input input:focus {
  border-color: var(--sd-accent);
}

.minroll-hint {
  font-size: 11px;
  color: var(--sd-text-muted);
}

/* Error */
.create-panel__error {
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--sd-radius-sm);
  color: var(--sd-red-light);
  font-size: 13px;
}

/* CTA Buttons */
.create-panel__cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border: none;
  border-radius: var(--sd-radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--sd-transition-base);
}

.cta-btn--primary {
  background: linear-gradient(135deg, var(--sd-accent), var(--sd-accent-dim));
  color: #0a0f0d;
  box-shadow: 0 4px 20px var(--sd-accent-glow);
}

.cta-btn--primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--sd-accent-glow);
}

.cta-btn--free {
  background: linear-gradient(135deg, var(--sd-gold), var(--sd-gold-dim));
  color: #0a0f0d;
  box-shadow: 0 4px 20px var(--sd-gold-glow);
}

.cta-btn--free:hover:not(:disabled) {
  transform: translateY(-2px);
}

.cta-btn--full {
  width: 100%;
}

.cta-btn--login {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--sd-border);
  color: var(--sd-text-primary);
}

.cta-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.cta-icon {
  width: 16px;
  height: 16px;
  display: flex;
}

.cta-icon svg {
  width: 100%;
  height: 100%;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.sd-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Header */
.sd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.sd-header-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sd-header-title h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--sd-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sd-header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--sd-green-light);
}

.sd-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sd-green);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.sd-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Filter Tabs */
.sd-filter-tabs {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--sd-radius-md);
}

.sd-filter-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-radius: var(--sd-radius-sm);
  color: var(--sd-text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--sd-transition-fast);
}

.sd-filter-tab:hover {
  color: var(--sd-text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.sd-filter-tab--active {
  background: rgba(91, 255, 178, 0.15);
  color: var(--sd-accent);
}

.sd-filter-icon {
  width: 14px;
  height: 14px;
  display: flex;
}

.sd-filter-icon svg {
  width: 100%;
  height: 100%;
}

/* Rules Button */
.sd-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--sd-radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--sd-transition-fast);
}

.sd-btn--ghost {
  background: transparent;
  border: 1px solid var(--sd-border);
  color: var(--sd-text-secondary);
}

.sd-btn--ghost:hover {
  border-color: var(--sd-accent);
  color: var(--sd-accent);
}

.sd-btn-icon {
  width: 14px;
  height: 14px;
  display: flex;
}

.sd-btn-icon svg {
  width: 100%;
  height: 100%;
}

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

/* Empty State */
.sd-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.sd-empty-state--large {
  background: rgba(10, 15, 12, 0.6);
  border: 1px dashed var(--sd-border);
  border-radius: var(--sd-radius-lg);
}

.sd-empty-icon {
  width: 48px;
  height: 48px;
  color: var(--sd-text-muted);
  margin-bottom: 16px;
  opacity: 0.5;
}

.sd-empty-icon svg {
  width: 100%;
  height: 100%;
}

.sd-empty-state h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--sd-text-primary);
}

.sd-empty-state p {
  margin: 0;
  font-size: 14px;
  color: var(--sd-text-muted);
}

/* ============================================
   COMPACT BATTLE CARD
   ============================================ */
.bc {
  background: linear-gradient(165deg, 
    rgba(14, 24, 19, 0.97) 0%, 
    rgba(10, 18, 14, 0.98) 50%,
    rgba(12, 20, 16, 0.97) 100%);
  border: 1px solid rgba(91, 255, 178, 0.1);
  border-radius: var(--sd-radius-md);
  overflow: visible;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
}

.bc::before {
  content: '';
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

.bc:hover {
  border-color: rgba(91, 255, 178, 0.25);
  transform: translateY(-4px);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 60px rgba(91, 255, 178, 0.08);
}

.bc--own {
  border-color: rgba(91, 255, 178, 0.2);
  background: linear-gradient(165deg, 
    rgba(91, 255, 178, 0.06) 0%,
    rgba(14, 24, 19, 0.97) 50%,
    rgba(91, 255, 178, 0.03) 100%);
}

.bc--own::after {
  content: 'YOUR BATTLE';
  position: absolute;
  top: -10px;
  left: 20px;
  padding: 4px 10px;
  background: linear-gradient(135deg, var(--sd-accent), var(--sd-accent-dim));
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #0a0f0d;
  box-shadow: 0 2px 10px var(--sd-accent-glow);
}

.bc--rolling {
  animation: bcPulse 2s ease-in-out infinite;
  border-color: rgba(251, 191, 36, 0.3);
}

@keyframes bcPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); }
  50% { 
    box-shadow: 
      0 4px 20px rgba(0, 0, 0, 0.3),
      0 0 30px rgba(251, 191, 36, 0.2);
  }
}

.bc--resolved {
  opacity: 0.7;
}

.bc--resolved:hover {
  opacity: 0.9;
}

/* Battle Card Row */
.bc__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 12px;
  min-height: 60px;
}

/* Player */
.bc__player {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.bc__player--right {
  justify-content: flex-end;
}

.bc__player--winner {
  position: relative;
}

.bc__avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.bc__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sd-accent), var(--sd-accent-dim));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #0a0f0d;
  box-shadow: 0 0 15px var(--sd-accent-glow);
  border: 2px solid rgba(91, 255, 178, 0.3);
}

.bc__dice-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: rgba(10, 15, 12, 0.95);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.bc__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.bc__info--right {
  align-items: flex-end;
  text-align: right;
}

.bc__name {
  font-size: 13px;
  font-weight: 700;
  color: var(--sd-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.bc__bet {
  font-size: 12px;
  font-weight: 600;
  color: var(--sd-gold);
  font-family: var(--sd-font-mono);
}

.bc__roll {
  font-size: 24px;
  font-weight: 900;
  font-family: var(--sd-font-mono);
  color: var(--sd-accent);
  text-shadow: 0 0 20px var(--sd-accent-glow);
}

.bc__roll--win {
  color: var(--sd-green-light);
}

.bc__roll--lose {
  color: var(--sd-red-light);
}

.bc__crown {
  width: 18px;
  height: 18px;
  color: var(--sd-gold);
  filter: drop-shadow(0 0 8px var(--sd-gold-glow));
  animation: crownBounce 2s ease-in-out infinite;
}

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

.bc__crown svg {
  width: 100%;
  height: 100%;
}

/* VS Dice */
.bc__vs {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(91, 255, 178, 0.2), rgba(91, 255, 178, 0.1));
  border: 2px solid rgba(91, 255, 178, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Waiting Slot */
.bc__waiting {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bc__waiting-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(91, 255, 178, 0.08);
  border: 2px dashed rgba(91, 255, 178, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: rgba(91, 255, 178, 0.5);
  animation: waitPulse 2s ease-in-out infinite;
}

@keyframes waitPulse {
  0%, 100% { border-color: rgba(91, 255, 178, 0.2); }
  50% { border-color: rgba(91, 255, 178, 0.5); }
}

.bc__waiting-text {
  font-size: 12px;
  color: var(--sd-text-muted);
  font-style: italic;
}

/* Battle Footer */
.bc__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(91, 255, 178, 0.06);
  gap: 10px;
}

.bc__pot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--sd-gold);
  font-family: var(--sd-font-mono);
}

.bc__coin {
  width: 16px;
  height: 16px;
  filter: drop-shadow(0 0 4px var(--sd-gold-glow));
}

.bc__minroll {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 6px;
  color: #c4b5fd;
  font-family: var(--sd-font-mono);
}

.bc__status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 5px 10px;
  border-radius: 6px;
  font-family: var(--sd-font-mono);
}

.bc__status--open {
  background: rgba(6, 182, 212, 0.2);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.bc__status--warning {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.bc__status--urgent {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.bc__status--rolling {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.bc__status--resolved {
  background: rgba(34, 197, 94, 0.15);
  color: var(--sd-green-light);
  border: 1px solid rgba(91, 255, 178, 0.2);
}

.bc__timer-icon {
  width: 12px;
  height: 12px;
  display: inline-flex;
  margin-right: 4px;
  vertical-align: middle;
}

.bc__timer-icon svg {
  width: 100%;
  height: 100%;
}

.bc__actions {
  display: flex;
  gap: 6px;
}

.bc__btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--sd-transition-base);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.bc__btn--view {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--sd-text-primary);
}

.bc__btn--view:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.bc__btn--join {
  background: linear-gradient(135deg, var(--sd-accent), var(--sd-accent-dim));
  color: #0a0f0d;
  font-weight: 800;
  box-shadow: 0 4px 15px var(--sd-accent-glow);
}

.bc__btn--join:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--sd-accent-glow);
}

.bc__btn--join:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.bc__btn-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
}

.bc__btn-icon svg {
  width: 100%;
  height: 100%;
}

/* ============================================
   CHAT SIDEBAR WRAPPER
   ============================================ */
.sd-chat-wrapper {
  height: calc(100vh - 180px);
  min-height: 500px;
  max-height: 800px;
  background: rgba(10, 15, 12, 0.95);
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius-lg);
  overflow: hidden;
}

.sd-chat-wrapper .cr-chat-container {
  height: 100%;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
}

/* ============================================
   MODALS
   ============================================ */
.sd-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10000;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.sd-modal {
  background: linear-gradient(165deg, rgba(15, 25, 20, 0.98), rgba(10, 18, 14, 0.99));
  border: 1px solid rgba(91, 255, 178, 0.15);
  border-radius: var(--sd-radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sd-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sd-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--sd-text-primary);
}

.sd-modal-icon {
  width: 20px;
  height: 20px;
  color: var(--sd-accent);
}

.sd-modal-icon svg {
  width: 100%;
  height: 100%;
}

.sd-modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-radius: 8px;
  color: var(--sd-text-muted);
  cursor: pointer;
  transition: all var(--sd-transition-fast);
}

.sd-modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--sd-red-light);
}

.sd-modal-close svg {
  width: 16px;
  height: 16px;
}

.sd-modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: 60vh;
}

.sd-modal-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============================================
   DUEL OVERLAY
   ============================================ */
.duel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.duel-card {
  background: linear-gradient(165deg, rgba(15, 25, 20, 0.98), rgba(10, 18, 14, 0.99));
  border: 1px solid rgba(91, 255, 178, 0.2);
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  padding: 30px;
  position: relative;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7);
}

.duel-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-radius: 10px;
  color: var(--sd-text-muted);
  cursor: pointer;
  transition: all var(--sd-transition-fast);
}

.duel-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--sd-red-light);
}

.duel-close svg {
  width: 18px;
  height: 18px;
}

.duel-header {
  text-align: center;
  margin-bottom: 24px;
}

.duel-status {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 6px 16px;
  border-radius: 20px;
  display: inline-block;
}

.duel-status--waiting {
  background: rgba(6, 182, 212, 0.2);
  color: #22d3ee;
}

.duel-status--rolling {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  animation: statusPulse 1s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.duel-status--complete {
  background: rgba(34, 197, 94, 0.2);
  color: var(--sd-green-light);
}

.duel-players {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
}

.duel-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  position: relative;
}

.duel-player--winner {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.duel-player--loser {
  opacity: 0.5;
}

.duel-player__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sd-accent), var(--sd-accent-dim));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #0a0f0d;
  box-shadow: 0 0 30px var(--sd-accent-glow);
}

.duel-player__name {
  font-size: 16px;
  font-weight: 700;
  color: var(--sd-text-primary);
}

.duel-player__bet {
  font-size: 14px;
  font-weight: 600;
  color: var(--sd-gold);
  font-family: var(--sd-font-mono);
}

.duel-player__roll {
  font-size: 48px;
  font-weight: 900;
  font-family: var(--sd-font-mono);
  color: var(--sd-accent);
  text-shadow: 0 0 30px var(--sd-accent-glow);
  min-height: 60px;
  display: flex;
  align-items: center;
}

.duel-player__roll--win {
  color: var(--sd-green-light);
}

.duel-player__roll--lose {
  color: var(--sd-red-light);
}

.duel-player__crown {
  position: absolute;
  top: -12px;
  right: 50%;
  transform: translateX(50%);
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--sd-gold), var(--sd-gold-dim));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px var(--sd-gold-glow);
  animation: crownBounce 2s ease-in-out infinite;
}

.duel-player__crown svg {
  width: 18px;
  height: 18px;
  color: #0a0f0d;
}

.duel-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.duel-vs__icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(91, 255, 178, 0.2), rgba(91, 255, 178, 0.1));
  border: 2px solid rgba(91, 255, 178, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.duel-vs__text {
  font-size: 11px;
  font-weight: 800;
  color: var(--sd-text-muted);
  letter-spacing: 2px;
}

.duel-pot {
  text-align: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
}

.duel-pot__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--sd-text-muted);
  margin-bottom: 4px;
}

.duel-pot__value {
  font-size: 28px;
  font-weight: 800;
  color: var(--sd-gold);
  font-family: var(--sd-font-mono);
  text-shadow: 0 0 20px var(--sd-gold-glow);
}

/* ============================================
   RULES MODAL CONTENT
   ============================================ */
.rules-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rules-item {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--sd-radius-md);
  border-left: 3px solid var(--sd-accent);
}

.rules-icon {
  width: 24px;
  height: 24px;
  color: var(--sd-accent);
  flex-shrink: 0;
}

.rules-icon svg {
  width: 100%;
  height: 100%;
}

.rules-content h4 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--sd-text-primary);
}

.rules-content p {
  margin: 0;
  font-size: 13px;
  color: var(--sd-text-secondary);
  line-height: 1.5;
}

/* ============================================
   DAILY REWARD MODAL
   ============================================ */
.daily-reward-content {
  text-align: center;
}

.daily-reward-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--sd-gold), var(--sd-gold-dim));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 40px var(--sd-gold-glow);
  animation: rewardPulse 2s ease-in-out infinite;
}

@keyframes rewardPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.daily-reward-icon svg {
  width: 40px;
  height: 40px;
  color: #0a0f0d;
}

.daily-reward-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--sd-text-primary);
  margin-bottom: 8px;
}

.daily-reward-subtitle {
  font-size: 14px;
  color: var(--sd-text-muted);
  margin-bottom: 24px;
}

.daily-reward-amount {
  font-size: 36px;
  font-weight: 900;
  color: var(--sd-gold);
  font-family: var(--sd-font-mono);
  margin-bottom: 24px;
  text-shadow: 0 0 30px var(--sd-gold-glow);
}

.daily-reward-claim {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--sd-gold), var(--sd-gold-dim));
  border: none;
  border-radius: var(--sd-radius-md);
  color: #0a0f0d;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--sd-transition-base);
  box-shadow: 0 4px 20px var(--sd-gold-glow);
}

.daily-reward-claim:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--sd-gold-glow);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .sd-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .sd-filter-tabs {
    width: 100%;
    overflow-x: auto;
  }
  
  .bc__row {
    padding: 10px 12px;
  }
  
  .bc__name {
    max-width: 70px;
  }
  
  .duel-players {
    grid-template-columns: 1fr;
  }
  
  .duel-vs {
    order: -1;
  }
}

/* ============================================
   DICE POPUP - Premium Duel Modal
   ============================================ */
.dice-popup {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.dice-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.dice-popup__confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.dice-popup__confetti-piece {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.dice-popup__card {
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, rgba(15, 25, 20, 0.98) 0%, rgba(10, 18, 14, 0.99) 100%);
  border: 1px solid rgba(91, 255, 178, 0.15);
  border-radius: 20px;
  width: 100%;
  max-width: 580px;
  padding: 24px;
  box-shadow: 
    0 0 80px rgba(91, 255, 178, 0.1),
    0 20px 60px rgba(0, 0, 0, 0.5);
  animation: popupSlideIn 0.3s ease-out;
}

@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.dice-popup__card--resolved {
  border-color: rgba(91, 255, 178, 0.3);
}

.dice-popup__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.dice-popup__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.dice-popup__close svg {
  width: 16px;
  height: 16px;
}

/* Header */
.dice-popup__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.dice-popup__id {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dice-popup__pot {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
  padding: 8px 16px;
  border-radius: 30px;
}

.dice-popup__pot--centered {
  justify-content: center;
}

.dice-popup__pot-icon {
  width: 20px;
  height: 20px;
}

.dice-popup__pot span {
  font-size: 18px;
  font-weight: 700;
  color: var(--sd-gold);
}

/* Status */
.dice-popup__status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
}

.dice-popup__status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.dice-popup__status-icon svg {
  width: 20px;
  height: 20px;
}

/* Countdown number */
.dice-popup__countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--sd-accent), var(--sd-accent-dark));
  color: #0a0f0d;
  font-size: 32px;
  font-weight: 900;
  border-radius: 50%;
  animation: countdownPulse 1s ease-in-out infinite;
  box-shadow: 0 0 30px rgba(91, 255, 178, 0.5), 0 0 60px rgba(91, 255, 178, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

@keyframes countdownPulse {
  0%, 100% { 
    transform: scale(1); 
    box-shadow: 0 0 30px rgba(91, 255, 178, 0.5), 0 0 60px rgba(91, 255, 178, 0.2);
  }
  50% { 
    transform: scale(1.15); 
    box-shadow: 0 0 40px rgba(91, 255, 178, 0.7), 0 0 80px rgba(91, 255, 178, 0.3);
  }
}

/* Status */
.dice-popup__status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
}

.dice-popup__status--waiting {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
}

.dice-popup__status--ready {
  background: rgba(91, 255, 178, 0.1);
  color: var(--sd-accent);
}

.dice-popup__status--rolling {
  background: linear-gradient(135deg, rgba(91, 255, 178, 0.15), rgba(251, 191, 36, 0.15));
  color: #fff;
  animation: statusPulse 0.5s ease-in-out infinite alternate;
}

.dice-popup__status--revealing {
  background: rgba(251, 191, 36, 0.1);
  color: var(--sd-gold);
}

.dice-popup__status--resolved {
  background: linear-gradient(135deg, rgba(91, 255, 178, 0.2), rgba(34, 197, 94, 0.2));
  color: var(--sd-accent);
}

@keyframes statusPulse {
  from { opacity: 0.8; }
  to { opacity: 1; }
}

.dice-popup__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--sd-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.dice-popup__dice-spin {
  animation: diceSpin 0.3s ease-in-out infinite;
}

.dice-popup__dice-spin svg {
  width: 24px;
  height: 24px;
  color: var(--sd-accent);
}

@keyframes diceSpin {
  0%, 100% { transform: rotate(-15deg); }
  50% { transform: rotate(15deg); }
}

.dice-popup__winner-icon {
  color: var(--sd-gold);
}

.dice-popup__winner-icon svg {
  width: 20px;
  height: 20px;
}

/* Players */
.dice-popup__players {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
}

.dice-popup__player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  position: relative;
  transition: all 0.3s ease;
}

.dice-popup__player--winner {
  background: rgba(91, 255, 178, 0.08);
  border-color: rgba(91, 255, 178, 0.3);
  box-shadow: 0 0 30px rgba(91, 255, 178, 0.15);
}

.dice-popup__player--loser {
  opacity: 0.6;
}

.dice-popup__crown {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--sd-gold);
  animation: crownBounce 0.5s ease-out;
}

.dice-popup__crown svg {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 2px 8px rgba(251, 191, 36, 0.5));
}

@keyframes crownBounce {
  0% { transform: translateX(-50%) translateY(-20px) scale(0); }
  60% { transform: translateX(-50%) translateY(5px) scale(1.1); }
  100% { transform: translateX(-50%) translateY(0) scale(1); }
}

.dice-popup__name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dice-popup__you {
  font-size: 10px;
  font-weight: 700;
  background: var(--sd-accent);
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.dice-popup__name--waiting {
  color: rgba(255, 255, 255, 0.4);
}

.dice-popup__bet {
  font-size: 14px;
  font-weight: 600;
  color: var(--sd-gold);
}

.dice-popup__avatar-waiting {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   CSGOROLL-STYLE 3D DICE ANIMATION
   ============================================ */

/* Roll Display Container */
.dice-popup__roll {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  justify-content: center;
  perspective: 500px;
}

/* Individual Digit Cube */
.dice-popup__digit {
  width: 56px;
  height: 72px;
  background: linear-gradient(145deg, rgba(40, 45, 50, 0.95), rgba(25, 30, 35, 0.98));
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sd-font-mono);
  font-size: 42px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  overflow: hidden;
  position: relative;
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform-style: preserve-3d;
}

/* Idle state with placeholder */
.dice-popup__digit--idle {
  background: linear-gradient(145deg, rgba(35, 40, 45, 0.9), rgba(20, 25, 30, 0.95));
  border-color: rgba(255, 255, 255, 0.05);
}

.dice-popup__digit-placeholder {
  font-size: 36px;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 700;
}

/* Static number display */
.dice-popup__digit-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-variant-numeric: tabular-nums;
}

/* Number strip for vertical scrolling - contains 0-9 repeated */
.dice-popup__digit-strip {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: transform;
}

.dice-popup__digit-num {
  height: 72px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  font-size: 42px;
  font-weight: 800;
  color: var(--sd-accent);
  text-shadow: 0 0 20px rgba(91, 255, 178, 0.5);
}

/* ===== SPINNING STATE ===== */
.dice-popup__digit--spinning {
  background: linear-gradient(145deg, rgba(30, 50, 45, 0.95), rgba(20, 35, 30, 0.98));
  border-color: rgba(91, 255, 178, 0.25);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(91, 255, 178, 0.15),
    inset 0 1px 0 rgba(91, 255, 178, 0.1);
}

/* Top fade gradient */
.dice-popup__digit--spinning::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 24px;
  background: linear-gradient(to bottom, rgba(25, 40, 35, 1), transparent);
  z-index: 5;
  pointer-events: none;
}

/* Bottom fade gradient */
.dice-popup__digit--spinning::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 24px;
  background: linear-gradient(to top, rgba(25, 40, 35, 1), transparent);
  z-index: 5;
  pointer-events: none;
}

/* Rolling container state */
.dice-popup__roll--rolling .dice-popup__digit {
  background: linear-gradient(145deg, rgba(30, 50, 45, 0.95), rgba(20, 35, 30, 0.98));
  border-color: rgba(91, 255, 178, 0.2);
}

/* ===== REVEALED/STOPPED STATE ===== */
.dice-popup__digit--revealed {
  background: linear-gradient(145deg, rgba(35, 60, 50, 0.98), rgba(25, 45, 38, 0.98));
  border-color: rgba(91, 255, 178, 0.5);
  color: #fff;
  box-shadow: 
    0 4px 25px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(91, 255, 178, 0.3),
    inset 0 1px 0 rgba(91, 255, 178, 0.2);
  animation: cubeStop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dice-popup__digit--revealed::before,
.dice-popup__digit--revealed::after {
  display: none;
}

.dice-popup__digit--revealed .dice-popup__digit-inner {
  animation: none;
  filter: none;
  transform: translateY(0);
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

@keyframes cubeStop {
  0% {
    transform: scale(1) rotateX(0deg);
  }
  30% {
    transform: scale(1.08) rotateX(-5deg);
  }
  50% {
    transform: scale(1.05) rotateX(3deg);
  }
  70% {
    transform: scale(1.02) rotateX(-1deg);
  }
  100% {
    transform: scale(1) rotateX(0deg);
  }
}

/* Glow pulse on reveal */
.dice-popup__digit--revealed::before {
  display: block;
  content: '';
  position: absolute;
  inset: -2px;
  background: transparent;
  border-radius: 14px;
  box-shadow: 0 0 20px rgba(91, 255, 178, 0.4);
  animation: glowPulse 1s ease-out;
  pointer-events: none;
}

@keyframes glowPulse {
  0% {
    box-shadow: 0 0 30px rgba(91, 255, 178, 0.8);
  }
  100% {
    box-shadow: 0 0 20px rgba(91, 255, 178, 0.3);
  }
}

/* ===== WIN/LOSE STATES ===== */
.dice-popup__roll--win .dice-popup__digit--revealed {
  border-color: rgba(91, 255, 178, 0.7);
  box-shadow: 
    0 4px 25px rgba(0, 0, 0, 0.4),
    0 0 50px rgba(91, 255, 178, 0.4);
}

.dice-popup__roll--lose .dice-popup__digit--revealed {
  border-color: rgba(255, 100, 100, 0.5);
  box-shadow: 
    0 4px 25px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(255, 100, 100, 0.2);
}

.dice-popup__roll--lose .dice-popup__digit--revealed .dice-popup__digit-inner {
  color: rgba(255, 255, 255, 0.7);
}

/* Legacy styles removed - using new 3D cube animation */

.dice-popup__roll--win .dice-popup__digit-inner {
  color: var(--sd-accent);
}

@keyframes winnerGlow {
  from { box-shadow: 0 0 15px rgba(91, 255, 178, 0.2); }
  to { box-shadow: 0 0 25px rgba(91, 255, 178, 0.5); }
}

.dice-popup__roll--lose .dice-popup__digit {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--sd-red);
  opacity: 0.8;
}

.dice-popup__roll--lose .dice-popup__digit-inner {
  color: var(--sd-red);
}

/* Center / VS */
.dice-popup__center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 20px;
}

.dice-popup__dice {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: var(--sd-accent);
  transition: all 0.3s;
}

.dice-popup__dice svg {
  width: 40px;
  height: 40px;
}

.dice-popup__dice--rolling {
  animation: diceShake 0.15s ease-in-out infinite;
}

.dice-popup__dice--rolling svg {
  filter: drop-shadow(0 0 10px rgba(91, 255, 178, 0.5));
}

@keyframes diceShake {
  0%, 100% { transform: rotate(-20deg) scale(1); }
  25% { transform: rotate(20deg) scale(1.1); }
  50% { transform: rotate(-15deg) scale(1); }
  75% { transform: rotate(15deg) scale(1.05); }
}

.dice-popup__vs {
  font-size: 14px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 2px;
}

.dice-popup__range {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 20px;
}

/* Result Info */
.dice-popup__result {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 16px 24px;
  margin-bottom: 16px;
}

.dice-popup__result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.dice-popup__result-row:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dice-popup__result-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.dice-popup__result-value {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.dice-popup__result-value--gold {
  color: var(--sd-gold);
}

/* User Banner */
.dice-popup__banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  border-radius: 12px;
  margin-bottom: 16px;
  animation: bannerSlide 0.4s ease-out;
}

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

.dice-popup__banner--won {
  background: linear-gradient(135deg, rgba(91, 255, 178, 0.15), rgba(34, 197, 94, 0.15));
  border: 1px solid rgba(91, 255, 178, 0.3);
}

.dice-popup__banner--lost {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.dice-popup__banner-icon {
  color: var(--sd-gold);
}

.dice-popup__banner-icon svg {
  width: 24px;
  height: 24px;
}

.dice-popup__banner--lost .dice-popup__banner-icon {
  color: var(--sd-red);
}

.dice-popup__banner-text {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.dice-popup__banner-prize {
  font-size: 18px;
  font-weight: 800;
  color: var(--sd-gold);
}

.dice-popup__banner-loss {
  font-size: 18px;
  font-weight: 800;
  color: var(--sd-red);
}

/* Footer */
.dice-popup__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.dice-popup__fair {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

.dice-popup__btn {
  padding: 12px 32px;
  font-size: 14px;
  font-weight: 700;
  color: #000;
  background: linear-gradient(135deg, var(--sd-accent), var(--sd-accent-dim));
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.dice-popup__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(91, 255, 178, 0.3);
}

/* Responsive */
@media (max-width: 600px) {
  .dice-popup__card {
    padding: 16px;
  }

  .dice-popup__players {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .dice-popup__center {
    order: -1;
    flex-direction: row;
    gap: 16px;
    padding: 0;
  }

  .dice-popup__player {
    padding: 16px;
  }

  .dice-popup__digit {
    width: 28px;
    height: 40px;
    font-size: 18px;
  }
}
