/* Modern CSS Variables - Professional Design */
:root {
  /* Colors - Refined Swamp Theme */
  --bg-primary: #0d1b12; /* Deep swamp green */
  --bg-secondary: #1a2e1f; /* Swamp green */
  --bg-tertiary: #24382a; /* Lighter swamp */
  --bg-card: #1e2f23; /* Card background */
  --bg-hover: #2a3f30; /* Hover state */
  
  --border-primary: rgba(132, 204, 22, 0.15); /* Subtle borders */
  --border-hover: rgba(132, 204, 22, 0.3);
  --border-accent: rgba(132, 204, 22, 0.4);
  
  /* Enhanced Text Colors - Better Contrast */
  --text-primary: #ffffff;
  --text-secondary: #e5e7eb; /* Improved from #d1d5db */
  --text-tertiary: #b8bcc4; /* Improved from #9ca3af */
  --text-muted: #9ca3af;
  
  /* Refined Accent Colors */
  --accent-primary: #84cc16; /* Swamp green */
  --accent-secondary: #65a30d; /* Darker green */
  --accent-light: #a3d636; /* Light accent */
  
  /* Semantic Status Colors with Opacity Variants */
  --status-success: #10b981;
  --status-success-light: rgba(16, 185, 129, 0.1);
  --status-success-border: rgba(16, 185, 129, 0.3);
  --status-warning: #f59e0b;
  --status-warning-light: rgba(245, 158, 11, 0.1);
  --status-warning-border: rgba(245, 158, 11, 0.3);
  --status-error: #ef4444;
  --status-error-light: rgba(239, 68, 68, 0.1);
  --status-error-border: rgba(239, 68, 68, 0.3);
  --status-info: #3b82f6;
  --status-info-light: rgba(59, 130, 246, 0.1);
  --status-info-border: rgba(59, 130, 246, 0.3);
  
  /* Legacy support */
  --accent-success: var(--status-success);
  --accent-error: var(--status-error);
  --accent-warning: var(--status-warning);
  
  /* Professional Gradients */
  --gradient-main: linear-gradient(135deg, #84cc16 0%, #65a30d 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(132, 204, 22, 0.1) 0%, rgba(101, 163, 13, 0.05) 100%);
  --gradient-card: linear-gradient(135deg, #1e2f23 0%, #1a2e1f 100%);
  
  /* Professional Shadows - Enhanced Elevation System */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-accent: 0 4px 14px 0 rgba(132, 204, 22, 0.15);
  --shadow-focus: 0 0 0 3px rgba(132, 204, 22, 0.3);
  
  /* Enhanced Spacing - 8px Grid System */
  --spacing-xxs: 0.25rem; /* 4px */
  --spacing-xs: 0.5rem; /* 8px */
  --spacing-sm: 0.75rem; /* 12px */
  --spacing-md: 1rem; /* 16px */
  --spacing-lg: 1.5rem; /* 24px */
  --spacing-xl: 2rem; /* 32px */
  --spacing-2xl: 3rem; /* 48px */
  --spacing-3xl: 4rem; /* 64px */
  --spacing-4xl: 6rem; /* 96px */
  
  /* Border Radius - Refined */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;
  
  /* Enhanced Typography Scale with Line Heights */
  --font-xs: 0.75rem; /* 12px */
  --font-sm: 0.875rem; /* 14px */
  --font-base: 1rem; /* 16px */
  --font-lg: 1.125rem; /* 18px */
  --font-xl: 1.25rem; /* 20px */
  --font-2xl: 1.5rem; /* 24px */
  --font-3xl: 2rem; /* 32px */
  --font-4xl: 2.5rem; /* 40px */
  
  /* Line Heights */
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;
  
  /* Letter Spacing */
  --tracking-tighter: -0.05em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;
  
  /* Animation Timing - Standardized */
  --timing-fast: 150ms;
  --timing-base: 250ms;
  --timing-slow: 400ms;
  --timing-slower: 600ms;
  
  /* Easing Functions */
  --easing-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --easing-decelerate: cubic-bezier(0, 0, 0.2, 1);
  --easing-accelerate: cubic-bezier(0.4, 0, 1, 1);
  --easing-sharp: cubic-bezier(0.4, 0, 0.6, 1);
  
  /* Breakpoints for Responsive Design */
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
}

/* Reset and Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Global Focus Styles for Accessibility */
*:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}

body {
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  background: 
    linear-gradient(180deg, #0d1b12 0%, #1a2e1f 50%, #0f1f14 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  height: 100vh;
  line-height: var(--leading-normal);
  font-size: var(--font-base);
  letter-spacing: var(--tracking-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

/* Responsive Design - Enhanced Breakpoints */
@media (max-width: 1536px) {
  .main-container-wrapper {
    gap: var(--spacing-md);
  }
}

@media (max-width: 1280px) {
  .left-sidebar,
  .right-sidebar {
    min-width: 240px;
  }
  
  .fab-button {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 1024px) {
  .main-container-wrapper {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
  
  .left-sidebar,
  .right-sidebar {
    width: 100%;
    min-width: auto;
    max-width: 100%;
  }
  
  .content-area {
    width: 100%;
  }
}

@media (max-width: 768px) {
  :root {
    --spacing-lg: 1rem;
    --spacing-xl: 1.5rem;
    --spacing-2xl: 2rem;
  }
  
  .fab-button {
    width: 48px;
    height: 48px;
    top: var(--spacing-md);
    right: var(--spacing-md);
  }
  
  .modal-content {
    width: 95%;
    max-height: 95vh;
    padding: var(--spacing-md);
  }
  
  .control-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-sm);
  }
  
  .winner-item,
  .leaderboard-item {
    padding: var(--spacing-sm) var(--spacing-md);
  }
}

@media (max-width: 640px) {
  .sidebar-header h4 {
    font-size: var(--font-lg);
  }
  
  .chat-header h3 {
    font-size: var(--font-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
  }
  
  .toggle-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-xs);
  }
}

/* Subtle texture overlay - Removed */
body::before {
  display: none;
}

/* Blob Shapes Background - Reduced opacity for better visibility */
.blob {
  position: fixed;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  filter: blur(90px);
  opacity: 0.3; /* Reduced from 0.8 for better content visibility */
  z-index: 0;
  pointer-events: none;
  will-change: transform, border-radius;
  transform-origin: center;
}

.blob-1 {
  width: 900px;
  height: 900px;
  background: radial-gradient(circle, rgba(132, 204, 22, 0.6) 0%, rgba(101, 163, 13, 0.4) 35%, rgba(65, 130, 10, 0.2) 60%, transparent 80%);
  top: -150px;
  left: -250px;
  animation: blobMove1 25s ease-in-out infinite;
}

.blob-2 {
  width: 1000px;
  height: 1000px;
  background: radial-gradient(circle, rgba(101, 163, 13, 0.55) 0%, rgba(65, 130, 10, 0.35) 35%, rgba(132, 204, 22, 0.2) 60%, transparent 80%);
  top: 5%;
  right: -250px;
  animation: blobMove2 30s ease-in-out infinite;
  animation-delay: -5s;
}

.blob-3 {
  width: 850px;
  height: 850px;
  background: radial-gradient(circle, rgba(163, 230, 53, 0.5) 0%, rgba(132, 204, 22, 0.3) 35%, rgba(101, 163, 13, 0.15) 60%, transparent 80%);
  bottom: 0%;
  left: 0%;
  animation: blobMove3 22s ease-in-out infinite;
  animation-delay: -10s;
}

.blob-4 {
  width: 950px;
  height: 950px;
  background: radial-gradient(circle, rgba(65, 130, 10, 0.5) 0%, rgba(101, 163, 13, 0.3) 35%, rgba(132, 204, 22, 0.15) 60%, transparent 80%);
  bottom: -150px;
  right: 5%;
  animation: blobMove4 28s ease-in-out infinite;
  animation-delay: -8s;
}

.blob-5 {
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(132, 204, 22, 0.55) 0%, rgba(163, 230, 53, 0.35) 35%, rgba(101, 163, 13, 0.2) 60%, transparent 80%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: blobMove5 35s ease-in-out infinite;
  animation-delay: -15s;
}

@keyframes blobMove1 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  }
  25% {
    transform: translate(150px, 200px) scale(1.15);
    border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
  }
  50% {
    transform: translate(300px, 100px) scale(0.85);
    border-radius: 50% 50% 50% 50% / 60% 40% 60% 40%;
  }
  75% {
    transform: translate(100px, 300px) scale(1.1);
    border-radius: 40% 60% 60% 40% / 50% 50% 50% 50%;
  }
}

@keyframes blobMove2 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    border-radius: 60% 40% 40% 60% / 60% 60% 40% 40%;
  }
  33% {
    transform: translate(-200px, 150px) scale(1.2);
    border-radius: 40% 60% 60% 40% / 40% 40% 60% 60%;
  }
  66% {
    transform: translate(-100px, -150px) scale(0.9);
    border-radius: 70% 30% 30% 70% / 50% 50% 50% 50%;
  }
}

@keyframes blobMove3 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    border-radius: 50% 50% 50% 50% / 40% 60% 40% 60%;
  }
  25% {
    transform: translate(200px, -120px) scale(1.25);
    border-radius: 30% 70% 70% 30% / 70% 30% 70% 30%;
  }
  50% {
    transform: translate(-150px, 180px) scale(0.8);
    border-radius: 70% 30% 30% 70% / 30% 70% 30% 70%;
  }
  75% {
    transform: translate(120px, -80px) scale(1.15);
    border-radius: 40% 60% 60% 40% / 60% 40% 60% 40%;
  }
}

@keyframes blobMove4 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    border-radius: 40% 60% 60% 40% / 50% 50% 50% 50%;
  }
  33% {
    transform: translate(-180px, -200px) scale(1.15);
    border-radius: 60% 40% 40% 60% / 70% 30% 70% 30%;
  }
  66% {
    transform: translate(150px, 120px) scale(0.85);
    border-radius: 30% 70% 70% 30% / 40% 60% 40% 60%;
  }
}

@keyframes blobMove5 {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
  }
  20% {
    transform: translate(-45%, -55%) scale(1.2);
    border-radius: 60% 40% 40% 60% / 60% 60% 40% 40%;
  }
  40% {
    transform: translate(-55%, -45%) scale(0.85);
    border-radius: 40% 60% 60% 40% / 40% 40% 60% 60%;
  }
  60% {
    transform: translate(-48%, -52%) scale(1.1);
    border-radius: 70% 30% 30% 70% / 50% 50% 50% 50%;
  }
  80% {
    transform: translate(-52%, -48%) scale(0.9);
    border-radius: 30% 70% 70% 30% / 70% 30% 70% 30%;
  }
}

/* Floating Leaves/Seaweed */
.floating-leaf {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  opacity: 0.3;
  will-change: transform;
}

.leaf-1 {
  width: 40px;
  height: 60px;
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.6) 0%, rgba(101, 163, 13, 0.4) 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  left: 10%;
  bottom: -60px;
  animation: floatUp1 25s linear infinite;
  transform: rotate(-15deg);
}

.leaf-2 {
  width: 35px;
  height: 50px;
  background: linear-gradient(135deg, rgba(101, 163, 13, 0.5) 0%, rgba(65, 130, 10, 0.3) 100%);
  border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%;
  left: 25%;
  bottom: -50px;
  animation: floatUp2 30s linear infinite;
  animation-delay: -5s;
  transform: rotate(20deg);
}

.leaf-3 {
  width: 45px;
  height: 70px;
  background: linear-gradient(135deg, rgba(163, 230, 53, 0.5) 0%, rgba(132, 204, 22, 0.3) 100%);
  border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
  left: 40%;
  bottom: -70px;
  animation: floatUp3 28s linear infinite;
  animation-delay: -10s;
  transform: rotate(-25deg);
}

.leaf-4 {
  width: 30px;
  height: 45px;
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.6) 0%, rgba(101, 163, 13, 0.4) 100%);
  border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
  left: 55%;
  bottom: -45px;
  animation: floatUp4 32s linear infinite;
  animation-delay: -8s;
  transform: rotate(15deg);
}

.leaf-5 {
  width: 50px;
  height: 75px;
  background: linear-gradient(135deg, rgba(65, 130, 10, 0.5) 0%, rgba(101, 163, 13, 0.3) 100%);
  border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
  left: 70%;
  bottom: -75px;
  animation: floatUp5 27s linear infinite;
  animation-delay: -12s;
  transform: rotate(-20deg);
}

.leaf-6 {
  width: 38px;
  height: 55px;
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.5) 0%, rgba(163, 230, 53, 0.3) 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  left: 85%;
  bottom: -55px;
  animation: floatUp6 29s linear infinite;
  animation-delay: -15s;
  transform: rotate(25deg);
}

.leaf-7 {
  width: 42px;
  height: 65px;
  background: linear-gradient(135deg, rgba(101, 163, 13, 0.6) 0%, rgba(65, 130, 10, 0.4) 100%);
  border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%;
  left: 15%;
  bottom: -65px;
  animation: floatUp7 31s linear infinite;
  animation-delay: -3s;
  transform: rotate(-18deg);
}

.leaf-8 {
  width: 33px;
  height: 48px;
  background: linear-gradient(135deg, rgba(163, 230, 53, 0.5) 0%, rgba(132, 204, 22, 0.3) 100%);
  border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
  left: 45%;
  bottom: -48px;
  animation: floatUp8 26s linear infinite;
  animation-delay: -18s;
  transform: rotate(22deg);
}

.leaf-9 {
  width: 47px;
  height: 68px;
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.5) 0%, rgba(101, 163, 13, 0.3) 100%);
  border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
  left: 60%;
  bottom: -68px;
  animation: floatUp9 33s linear infinite;
  animation-delay: -7s;
  transform: rotate(-12deg);
}

.leaf-10 {
  width: 36px;
  height: 52px;
  background: linear-gradient(135deg, rgba(65, 130, 10, 0.5) 0%, rgba(101, 163, 13, 0.3) 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  left: 75%;
  bottom: -52px;
  animation: floatUp10 28s linear infinite;
  animation-delay: -20s;
  transform: rotate(18deg);
}

.leaf-11 {
  width: 41px;
  height: 62px;
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.5) 0%, rgba(163, 230, 53, 0.3) 100%);
  border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%;
  left: 30%;
  bottom: -62px;
  animation: floatUp11 30s linear infinite;
  animation-delay: -14s;
  transform: rotate(-22deg);
}

.leaf-12 {
  width: 44px;
  height: 66px;
  background: linear-gradient(135deg, rgba(101, 163, 13, 0.5) 0%, rgba(132, 204, 22, 0.3) 100%);
  border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%;
  left: 80%;
  bottom: -66px;
  animation: floatUp12 34s linear infinite;
  animation-delay: -11s;
  transform: rotate(16deg);
}

@keyframes floatUp1 {
  0% {
    transform: translateY(0) translateX(0) rotate(-15deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-120vh) translateX(30px) rotate(-15deg);
    opacity: 0;
  }
}

@keyframes floatUp2 {
  0% {
    transform: translateY(0) translateX(0) rotate(20deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-120vh) translateX(-25px) rotate(20deg);
    opacity: 0;
  }
}

@keyframes floatUp3 {
  0% {
    transform: translateY(0) translateX(0) rotate(-25deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-120vh) translateX(40px) rotate(-25deg);
    opacity: 0;
  }
}

@keyframes floatUp4 {
  0% {
    transform: translateY(0) translateX(0) rotate(15deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-120vh) translateX(-35px) rotate(15deg);
    opacity: 0;
  }
}

@keyframes floatUp5 {
  0% {
    transform: translateY(0) translateX(0) rotate(-20deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-120vh) translateX(28px) rotate(-20deg);
    opacity: 0;
  }
}

@keyframes floatUp6 {
  0% {
    transform: translateY(0) translateX(0) rotate(25deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-120vh) translateX(-32px) rotate(25deg);
    opacity: 0;
  }
}

@keyframes floatUp7 {
  0% {
    transform: translateY(0) translateX(0) rotate(-18deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-120vh) translateX(22px) rotate(-18deg);
    opacity: 0;
  }
}

@keyframes floatUp8 {
  0% {
    transform: translateY(0) translateX(0) rotate(22deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-120vh) translateX(-38px) rotate(22deg);
    opacity: 0;
  }
}

@keyframes floatUp9 {
  0% {
    transform: translateY(0) translateX(0) rotate(-12deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-120vh) translateX(35px) rotate(-12deg);
    opacity: 0;
  }
}

@keyframes floatUp10 {
  0% {
    transform: translateY(0) translateX(0) rotate(18deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-120vh) translateX(-28px) rotate(18deg);
    opacity: 0;
  }
}

@keyframes floatUp11 {
  0% {
    transform: translateY(0) translateX(0) rotate(-22deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-120vh) translateX(42px) rotate(-22deg);
    opacity: 0;
  }
}

@keyframes floatUp12 {
  0% {
    transform: translateY(0) translateX(0) rotate(16deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-120vh) translateX(-30px) rotate(16deg);
    opacity: 0;
  }
}

/* Additional leaves 13-24 */
.leaf-13 {
  width: 39px;
  height: 58px;
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.6) 0%, rgba(101, 163, 13, 0.4) 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  left: 5%;
  bottom: -58px;
  animation: floatUp1 26s linear infinite;
  animation-delay: -2s;
  transform: rotate(-10deg);
}

.leaf-14 {
  width: 37px;
  height: 54px;
  background: linear-gradient(135deg, rgba(163, 230, 53, 0.5) 0%, rgba(132, 204, 22, 0.3) 100%);
  border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
  left: 20%;
  bottom: -54px;
  animation: floatUp3 29s linear infinite;
  animation-delay: -6s;
  transform: rotate(14deg);
}

.leaf-15 {
  width: 43px;
  height: 63px;
  background: linear-gradient(135deg, rgba(101, 163, 13, 0.5) 0%, rgba(65, 130, 10, 0.3) 100%);
  border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
  left: 35%;
  bottom: -63px;
  animation: floatUp5 31s linear infinite;
  animation-delay: -13s;
  transform: rotate(-17deg);
}

.leaf-16 {
  width: 34px;
  height: 50px;
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.5) 0%, rgba(163, 230, 53, 0.3) 100%);
  border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%;
  left: 50%;
  bottom: -50px;
  animation: floatUp7 27s linear infinite;
  animation-delay: -4s;
  transform: rotate(19deg);
}

.leaf-17 {
  width: 46px;
  height: 69px;
  background: linear-gradient(135deg, rgba(65, 130, 10, 0.5) 0%, rgba(101, 163, 13, 0.3) 100%);
  border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%;
  left: 65%;
  bottom: -69px;
  animation: floatUp9 33s linear infinite;
  animation-delay: -9s;
  transform: rotate(-21deg);
}

.leaf-18 {
  width: 40px;
  height: 59px;
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.6) 0%, rgba(101, 163, 13, 0.4) 100%);
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  left: 90%;
  bottom: -59px;
  animation: floatUp11 28s linear infinite;
  animation-delay: -16s;
  transform: rotate(13deg);
}

/* Leaves from left side */
.leaf-19 {
  width: 38px;
  height: 56px;
  background: linear-gradient(135deg, rgba(101, 163, 13, 0.5) 0%, rgba(132, 204, 22, 0.3) 100%);
  border-radius: 50% 50% 50% 50% / 68% 68% 32% 32%;
  left: -56px;
  top: 20%;
  animation: floatFromLeft1 32s linear infinite;
  animation-delay: -1s;
  transform: rotate(22deg);
}

.leaf-20 {
  width: 41px;
  height: 61px;
  background: linear-gradient(135deg, rgba(163, 230, 53, 0.5) 0%, rgba(132, 204, 22, 0.3) 100%);
  border-radius: 50% 50% 50% 50% / 56% 56% 44% 44%;
  left: -61px;
  top: 45%;
  animation: floatFromLeft2 30s linear infinite;
  animation-delay: -8s;
  transform: rotate(-19deg);
}

.leaf-21 {
  width: 35px;
  height: 51px;
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.6) 0%, rgba(101, 163, 13, 0.4) 100%);
  border-radius: 50% 50% 50% 50% / 64% 64% 36% 36%;
  left: -51px;
  top: 70%;
  animation: floatFromLeft3 34s linear infinite;
  animation-delay: -14s;
  transform: rotate(17deg);
}

/* Leaves from right side */
.leaf-22 {
  width: 44px;
  height: 65px;
  background: linear-gradient(135deg, rgba(65, 130, 10, 0.5) 0%, rgba(101, 163, 13, 0.3) 100%);
  border-radius: 50% 50% 50% 50% / 59% 59% 41% 41%;
  right: -65px;
  top: 15%;
  animation: floatFromRight1 29s linear infinite;
  animation-delay: -3s;
  transform: rotate(-23deg);
}

.leaf-23 {
  width: 36px;
  height: 53px;
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.5) 0%, rgba(163, 230, 53, 0.3) 100%);
  border-radius: 50% 50% 50% 50% / 67% 67% 33% 33%;
  right: -53px;
  top: 50%;
  animation: floatFromRight2 31s linear infinite;
  animation-delay: -10s;
  transform: rotate(20deg);
}

.leaf-24 {
  width: 42px;
  height: 62px;
  background: linear-gradient(135deg, rgba(101, 163, 13, 0.5) 0%, rgba(132, 204, 22, 0.3) 100%);
  border-radius: 50% 50% 50% 50% / 57% 57% 43% 43%;
  right: -62px;
  top: 75%;
  animation: floatFromRight3 27s linear infinite;
  animation-delay: -17s;
  transform: rotate(-15deg);
}

/* Animations for leaves from left side */
@keyframes floatFromLeft1 {
  0% {
    transform: translateX(0) translateY(0) rotate(22deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateX(calc(100vw + 56px)) translateY(-40vh) rotate(22deg);
    opacity: 0;
  }
}

@keyframes floatFromLeft2 {
  0% {
    transform: translateX(0) translateY(0) rotate(-19deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateX(calc(100vw + 61px)) translateY(30vh) rotate(-19deg);
    opacity: 0;
  }
}

@keyframes floatFromLeft3 {
  0% {
    transform: translateX(0) translateY(0) rotate(17deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateX(calc(100vw + 51px)) translateY(-20vh) rotate(17deg);
    opacity: 0;
  }
}

/* Animations for leaves from right side */
@keyframes floatFromRight1 {
  0% {
    transform: translateX(0) translateY(0) rotate(-23deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateX(calc(-100vw - 65px)) translateY(50vh) rotate(-23deg);
    opacity: 0;
  }
}

@keyframes floatFromRight2 {
  0% {
    transform: translateX(0) translateY(0) rotate(20deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateX(calc(-100vw - 53px)) translateY(-35vh) rotate(20deg);
    opacity: 0;
  }
}

@keyframes floatFromRight3 {
  0% {
    transform: translateX(0) translateY(0) rotate(-15deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateX(calc(-100vw - 62px)) translateY(25vh) rotate(-15deg);
    opacity: 0;
  }
}

/* Particles Background - Disabled */
#particles-js {
  display: none;
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.3;
}

canvas {
  display: block;
}

/* Login Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn var(--timing-base) var(--easing-decelerate);
  padding: var(--spacing-lg);
}

.modal.hidden {
  display: none;
}

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

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.login-container {
  background: linear-gradient(
    135deg,
    rgba(13, 27, 18, 0.98) 0%,
    rgba(26, 46, 31, 0.95) 100%
  );
  border: 1px solid rgba(132, 204, 22, 0.2);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  max-width: 420px;
  width: 90%;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(132, 204, 22, 0.15),
    0 0 40px rgba(132, 204, 22, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

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

.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  text-align: center;
}

.login-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 0%, rgba(132, 204, 22, 0.9) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 400;
  opacity: 0.8;
}

.login-input-group {
  margin-bottom: 1.5rem;
}

.login-input-group label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
  text-transform: uppercase;
  font-size: 0.75rem;
  opacity: 0.9;
}

.login-input-wrapper {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  transition: none;
}

.login-input-wrapper:focus-within {
  border: none;
  background: transparent;
  box-shadow: none;
}

.login-input-group input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: rgba(13, 27, 18, 0.5);
  border: 1.5px solid rgba(132, 204, 22, 0.15);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: none;
  font-weight: 400;
  line-height: 1.5;
}

.login-input-group input:focus {
  outline: none;
  color: #ffffff;
  border-color: rgba(132, 204, 22, 0.6);
  background: rgba(13, 27, 18, 0.7);
  box-shadow: 
    0 0 0 2px rgba(132, 204, 22, 0.15),
    0 2px 8px rgba(132, 204, 22, 0.1);
}

.login-input-group input:-webkit-autofill,
.login-input-group input:-webkit-autofill:hover,
.login-input-group input:-webkit-autofill:focus {
  -webkit-text-fill-color: #ffffff;
  -webkit-box-shadow: 0 0 0px 1000px rgba(13, 27, 18, 0.7) inset;
  transition: background-color 5000s ease-in-out 0s;
}

.login-input-group input::placeholder {
  color: var(--text-tertiary);
  opacity: 0.5;
  font-weight: 400;
}

.login-btn {
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #84cc16 0%, #65a30d 100%);
  border: none;
  border-radius: 12px;
  color: #0d1b12;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 2rem;
  margin-bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  letter-spacing: 0.5px;
  box-shadow: 
    0 4px 16px rgba(132, 204, 22, 0.3),
    0 0 0 1px rgba(132, 204, 22, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.login-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s ease;
}

.login-btn:hover::before {
  left: 100%;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 24px rgba(132, 204, 22, 0.4),
    0 0 0 1px rgba(132, 204, 22, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  background: linear-gradient(135deg, #a3e635 0%, #84cc16 100%);
}

.login-btn:active {
  transform: translateY(0);
  box-shadow: 
    0 2px 12px rgba(132, 204, 22, 0.3),
    0 0 0 1px rgba(132, 204, 22, 0.2);
}


.error-message {
  color: var(--accent-error);
  text-align: center;
  font-size: 0.875rem;
  display: none;
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  border-radius: var(--radius-md);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.error-message:not(:empty) {
  display: block;
}

/* Main Application */
#mainApp {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

#mainApp.hidden {
  display: none;
}

/* Header - Hidden */
.header {
  display: none;
}

/* Floating Action Button (FAB) - Beautiful & Compact */
.fab-button {
  position: fixed;
  top: var(--spacing-lg);
  right: var(--spacing-lg);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  color: var(--accent-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all var(--timing-base) var(--easing-standard);
  z-index: 1000;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.fab-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-subtle);
  opacity: 0;
  transition: opacity var(--timing-base) var(--easing-standard);
}

.fab-button:hover::before {
  opacity: 1;
}

.fab-button:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(132, 204, 22, 0.3);
  border-color: var(--accent-primary);
  background: var(--bg-hover);
}

.fab-button:active {
  transform: translateY(0) scale(0.98);
  box-shadow: var(--shadow-sm);
}

.fab-button:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: 
    var(--shadow-focus),
    var(--shadow-lg), 
    0 0 20px rgba(132, 204, 22, 0.3);
}

.fab-button .icon {
  width: 20px;
  height: 20px;
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
  color: var(--accent-primary);
  display: block;
  margin: 0 auto;
}

.fab-button:hover .icon {
  transform: rotate(90deg);
  color: var(--accent-primary);
}

.fab-button.active {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
}

.fab-button.active .icon {
  transform: rotate(180deg);
}

/* FAB Menu Dropdown - Professional */
.fab-menu {
  position: fixed;
  top: calc(40px + var(--spacing-lg) + var(--spacing-sm));
  right: var(--spacing-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--spacing-sm);
  min-width: 240px;
  box-shadow: var(--shadow-xl);
  z-index: 999;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  backdrop-filter: blur(10px);
}

.fab-menu:not(.hidden) {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.fab-menu-item {
  width: 100%;
  padding: var(--spacing-md) var(--spacing-lg);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  font-size: var(--font-sm);
  font-weight: 500;
  transition: all var(--timing-fast) var(--easing-standard);
  text-align: left;
  position: relative;
  overflow: hidden;
  letter-spacing: var(--tracking-wide);
}

.fab-menu-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--accent-primary);
  transform: scaleY(0);
  transition: transform var(--timing-fast) var(--easing-standard);
}

.fab-menu-item:hover {
  background: var(--bg-hover);
}

.fab-menu-item:hover::before {
  transform: scaleY(1);
}

.fab-menu-item:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: -2px;
  background: var(--bg-hover);
  box-shadow: var(--shadow-focus);
}

.fab-menu-item .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--accent-primary);
  transition: transform var(--timing-fast) var(--easing-standard);
}

.fab-menu-item:hover .icon {
  transform: scale(1.1);
}

.fab-menu-item-danger {
  color: var(--accent-error);
}

.fab-menu-item-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.fab-menu-item-danger .icon {
  color: var(--accent-error);
}

.fab-menu-divider {
  height: 1px;
  background: var(--border-primary);
  margin: 0.5rem 0;
}

/* Connection status in FAB menu */
.fab-menu-item.connected {
  background: rgba(16, 185, 129, 0.1);
  border-left: 3px solid var(--accent-success);
}

.fab-menu-item.connected .icon {
  color: var(--accent-success);
}

.fab-menu-item.disconnected {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--accent-error);
}

.fab-menu-item.disconnected .icon {
  color: var(--accent-error);
}

.header .logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--gradient-main);
  margin-right: 1rem;
}


@keyframes logoGlow {
  0%, 100% {
    filter: drop-shadow(0 0 10px rgba(74, 222, 128, 0.4));
    box-shadow: 
      0 0 15px rgba(74, 222, 128, 0.3),
      0 0 30px rgba(74, 222, 128, 0.15);
  }
  50% {
    filter: drop-shadow(0 0 15px rgba(74, 222, 128, 0.6));
    box-shadow: 
      0 0 20px rgba(74, 222, 128, 0.4),
      0 0 40px rgba(74, 222, 128, 0.25);
  }
}

.header-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  position: relative;
  z-index: 101; /* Выше всех декоративных элементов */
  pointer-events: auto;
}

.settings-btn, .logout-btn {
  padding: 0.625rem 1.25rem;
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 
    0 1px 2px 0 rgba(0, 0, 0, 0.05),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  position: relative;
  z-index: 102;
  pointer-events: auto;
  gap: 0.5rem;
}

.settings-btn:hover, .logout-btn:hover {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  border-color: var(--accent-primary);
  color: var(--bg-primary);
  transform: translateY(-1px);
  box-shadow: 
    0 4px 6px -1px rgba(132, 204, 22, 0.2),
    0 2px 4px -1px rgba(132, 204, 22, 0.1),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
}

.connection-btn {
  padding: 0.625rem 1.25rem;
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 
    0 1px 2px 0 rgba(0, 0, 0, 0.05),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  position: relative;
  z-index: 102;
  pointer-events: auto;
}

.connection-btn:hover {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  border-color: var(--accent-primary);
  color: var(--bg-primary);
  transform: translateY(-1px);
  box-shadow: 
    0 4px 6px -1px rgba(132, 204, 22, 0.2),
    0 2px 4px -1px rgba(132, 204, 22, 0.1),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
}

.connection-btn.connected {
  background: linear-gradient(135deg, var(--accent-success) 0%, #059669 100%);
  border-color: var(--accent-success);
  color: white;
  box-shadow: 
    0 2px 4px -1px rgba(16, 185, 129, 0.3),
    0 1px 2px -1px rgba(16, 185, 129, 0.2),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
}

.connection-btn.disconnected {
  background: linear-gradient(135deg, var(--accent-error) 0%, #dc2626 100%);
  border-color: var(--accent-error);
  color: white;
  box-shadow: 
    0 2px 4px -1px rgba(239, 68, 68, 0.3),
    0 1px 2px -1px rgba(239, 68, 68, 0.2),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
}

/* Section Divider - Professional */
.section-divider {
  height: 1px;
  background: var(--border-primary);
  margin: var(--spacing-md) 0 var(--spacing-xs) 0;
  position: relative;
  flex-shrink: 0;
}

.section-divider::after {
  content: '';
  position: absolute;
  left: 0;
  top: -1px;
  width: 50px;
  height: 2px;
  background: var(--gradient-main);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(132, 204, 22, 0.4);
}

/* Sidebar Section Header - Professional */
.sidebar-section-header {
  margin-bottom: var(--spacing-sm);
  flex-shrink: 0;
}

.sidebar-section-header h5 {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--spacing-xs) 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  padding-left: var(--spacing-sm);
}

.sidebar-section-header h5::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: var(--gradient-main);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(132, 204, 22, 0.4);
}

/* Main Container - Chat-Centric Professional Layout */
.main-container-wrapper {
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  gap: 0;
  height: calc(100vh - 4rem * 2);
  background: var(--gradient-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  margin: 4rem 16rem; /* Увеличены горизонтальные отступы до 16rem */
  padding: 0;
  position: relative;
  z-index: 2;
  overflow: hidden;
  box-shadow: 
    /* Многослойные тени для глубины */
    0 0 0 1px rgba(132, 204, 22, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 4px 8px rgba(0, 0, 0, 0.15),
    0 8px 16px rgba(0, 0, 0, 0.1),
    0 16px 32px rgba(0, 0, 0, 0.08),
    0 32px 64px rgba(0, 0, 0, 0.05),
    /* Внутренние тени для объема */
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1),
    /* Свечение акцента */
    0 0 60px rgba(132, 204, 22, 0.12),
    0 0 120px rgba(132, 204, 22, 0.06);
  transition: box-shadow 0.3s ease;
}

/* Left Sidebar - Participants & Controls (Unified Card) */
.left-sidebar.participants-sidebar {
  grid-column: 1;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: var(--spacing-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  transition: all 0.3s ease;
  position: relative;
}

.left-sidebar.participants-sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, 
    transparent 0%, 
    rgba(132, 204, 22, 0.3) 10%,
    var(--accent-primary) 20%, 
    var(--accent-light) 50%,
    var(--accent-primary) 80%,
    rgba(132, 204, 22, 0.3) 90%,
    transparent 100%);
  opacity: 0.8;
  pointer-events: none;
  box-shadow: 
    0 0 12px rgba(132, 204, 22, 0.6),
    0 0 24px rgba(132, 204, 22, 0.4),
    -2px 0 16px rgba(132, 204, 22, 0.3),
    -4px 0 32px rgba(132, 204, 22, 0.2);
  animation: dividerPulse 3s ease-in-out infinite;
  filter: blur(0.5px);
}

@keyframes dividerPulse {
  0%, 100% {
    opacity: 0.8;
    box-shadow: 
      0 0 12px rgba(132, 204, 22, 0.6),
      0 0 24px rgba(132, 204, 22, 0.4),
      -2px 0 16px rgba(132, 204, 22, 0.3),
      -4px 0 32px rgba(132, 204, 22, 0.2);
  }
  50% {
    opacity: 1;
    box-shadow: 
      0 0 16px rgba(132, 204, 22, 0.8),
      0 0 32px rgba(132, 204, 22, 0.6),
      -3px 0 24px rgba(132, 204, 22, 0.5),
      -6px 0 48px rgba(132, 204, 22, 0.3);
  }
}

/* Контент внутри панели должен быть поверх декораций */
.left-sidebar.swamp-tree > *,
.left-sidebar.swamp-tree .giveaway-controls,
.left-sidebar.swamp-tree .participants-info,
.left-sidebar.swamp-tree .participants-info *,
.left-sidebar.swamp-tree .leaderboard-container,
.left-sidebar.swamp-tree .leaderboard-container *,
.left-sidebar.swamp-tree .control-btn,
.left-sidebar.swamp-tree .toggle-btn,
.left-sidebar.swamp-tree .leaderboard-toggle-btn,
.left-sidebar.swamp-tree .leaderboard-item,
.left-sidebar.swamp-tree .leaderboard-list {
  position: relative;
  z-index: 20; /* Очень высокий z-index */
  pointer-events: auto;
}

.left-sidebar.swamp-tree:hover {
  transform: rotate(-0.5deg) scale(1.01);
}

/* Органичные "ветви" на левой панели */
.left-sidebar.swamp-tree::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 20%;
  width: 60%;
  height: 15px;
  background: var(--gradient-moss);
  border-radius: 50px;
  opacity: 0.6;
  box-shadow: 0 0 20px rgba(132, 204, 22, 0.3);
  pointer-events: none; /* Не блокирует клики */
  z-index: 0;
}

.left-sidebar.swamp-tree::after {
  content: '';
  position: absolute;
  top: 30%;
  right: -10px; /* Изменено с -15px на -10px, чтобы не выходила слишком далеко */
  width: 30px;
  height: 40px;
  background: var(--gradient-moss);
  border-radius: 50px 0 0 50px;
  opacity: 0.5;
  box-shadow: -5px 0 15px rgba(132, 204, 22, 0.2);
  pointer-events: none; /* Не блокирует клики */
  z-index: 0;
  clip-path: inset(0 -10px 0 0); /* Обрезаем элемент, чтобы он не выходил за границы */
}

/* Дополнительная ветвь дерева */
.swamp-tree .tree-branch {
  position: absolute;
  top: 15%;
  right: -10px; /* Изменено с -20px на -10px, чтобы не выходила слишком далеко */
  width: 25px;
  height: 60px;
  background: var(--gradient-moss);
  border-radius: 0 50px 50px 0;
  opacity: 0.4;
  box-shadow: -3px 0 10px rgba(132, 204, 22, 0.2);
  transform: rotate(-15deg);
  pointer-events: none; /* Не блокирует клики */
  z-index: 0;
  clip-path: inset(0 -10px 0 0); /* Обрезаем элемент, чтобы он не выходил за границы */
}

/* Right Sidebar - Leaderboard & Winners (Unified Card) */
.right-sidebar.leaderboard-sidebar {
  grid-column: 3;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: var(--spacing-lg) var(--spacing-md) var(--spacing-lg) var(--spacing-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  transition: all 0.3s ease;
  position: relative;
}

.right-sidebar.leaderboard-sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, 
    transparent 0%, 
    rgba(132, 204, 22, 0.3) 10%,
    var(--accent-primary) 20%, 
    var(--accent-light) 50%,
    var(--accent-primary) 80%,
    rgba(132, 204, 22, 0.3) 90%,
    transparent 100%);
  opacity: 0.8;
  pointer-events: none;
  box-shadow: 
    0 0 12px rgba(132, 204, 22, 0.6),
    0 0 24px rgba(132, 204, 22, 0.4),
    2px 0 16px rgba(132, 204, 22, 0.3),
    4px 0 32px rgba(132, 204, 22, 0.2);
  animation: dividerPulse 3s ease-in-out infinite;
  filter: blur(0.5px);
}

.winners-content {
  overflow: hidden;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Контент внутри панели должен быть поверх декораций */
.right-sidebar.swamp-stones > *,
.right-sidebar.swamp-stones .winners-section,
.right-sidebar.swamp-stones .winners-section *,
.right-sidebar.swamp-stones .winners-list,
.right-sidebar.swamp-stones .winners-list *,
.right-sidebar.swamp-stones .winner-item,
.right-sidebar.swamp-stones .winners-empty {
  position: relative;
  z-index: 20; /* Очень высокий z-index */
  pointer-events: auto;
}

.right-sidebar.swamp-stones:hover {
  transform: rotate(1deg) scale(1.01);
}

/* "Трещины" на камнях */
.right-sidebar.swamp-stones::before {
  content: '';
  position: absolute;
  top: 15%;
  left: 10%;
  width: 2px;
  height: 60%;
  background: linear-gradient(180deg, 
    transparent 0%, 
    rgba(45, 80, 22, 0.4) 20%, 
    rgba(45, 80, 22, 0.6) 50%, 
    rgba(45, 80, 22, 0.4) 80%, 
    transparent 100%);
  border-radius: 2px;
  pointer-events: none; /* Не блокирует клики */
  z-index: 0;
}

.right-sidebar.swamp-stones::after {
  content: '';
  position: absolute;
  bottom: 20%;
  right: 15%;
  width: 40%;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(45, 80, 22, 0.4) 20%, 
    rgba(45, 80, 22, 0.6) 50%, 
    rgba(45, 80, 22, 0.4) 80%, 
    transparent 100%);
  border-radius: 2px;
  pointer-events: none; /* Не блокирует клики */
  z-index: 0;
}

/* Дополнительная трещина на камне */
.swamp-stones .stone-crack {
  position: absolute;
  top: 40%;
  left: 5%;
  width: 1.5px;
  height: 30%;
  background: linear-gradient(180deg, 
    transparent 0%, 
    rgba(45, 80, 22, 0.5) 30%, 
    rgba(45, 80, 22, 0.7) 50%, 
    rgba(45, 80, 22, 0.5) 70%, 
    transparent 100%);
  border-radius: 1px;
  transform: rotate(25deg);
  pointer-events: none; /* Не блокирует клики */
  z-index: 0;
}

/* Удаляем старые разделители - они больше не нужны в органичной компоновке */

/* Center - Chat Main Area (Unified Card) */
.content-area.chat-main {
  grid-column: 2;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: 0;
  transition: all 0.3s ease;
  position: relative;
  height: 100%;
  min-height: 0;
}

.content-area.chat-main::before,
.content-area.chat-main::after {
  content: '';
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, 
    transparent 0%, 
    rgba(132, 204, 22, 0.3) 10%,
    var(--accent-primary) 20%, 
    var(--accent-light) 50%,
    var(--accent-primary) 80%,
    rgba(132, 204, 22, 0.3) 90%,
    transparent 100%);
  opacity: 0.8;
  pointer-events: none;
  z-index: 1;
  box-shadow: 
    0 0 12px rgba(132, 204, 22, 0.6),
    0 0 24px rgba(132, 204, 22, 0.4),
    0 0 32px rgba(132, 204, 22, 0.2);
  animation: dividerPulse 3s ease-in-out infinite;
  filter: blur(0.5px);
}

.content-area.chat-main::before {
  left: 0;
  box-shadow: 
    0 0 12px rgba(132, 204, 22, 0.6),
    0 0 24px rgba(132, 204, 22, 0.4),
    2px 0 16px rgba(132, 204, 22, 0.3),
    4px 0 32px rgba(132, 204, 22, 0.2);
}

.content-area.chat-main::after {
  right: 0;
  box-shadow: 
    0 0 12px rgba(132, 204, 22, 0.6),
    0 0 24px rgba(132, 204, 22, 0.4),
    -2px 0 16px rgba(132, 204, 22, 0.3),
    -4px 0 32px rgba(132, 204, 22, 0.2);
}

/* Winners in Sidebar */
.winners-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

/* Sidebar Common Styles - Professional */
.sidebar-header {
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--border-primary);
  position: relative;
  flex-shrink: 0;
}

.sidebar-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 80px;
  height: 3px;
  background: var(--gradient-main);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(132, 204, 22, 0.5);
}

.sidebar-header h4 {
  font-size: var(--font-xl);
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-secondary) 0%, rgba(132, 204, 22, 0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  text-shadow: 0 1px 4px rgba(132, 204, 22, 0.2);
  position: relative;
}

.sidebar-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Participants Sidebar Specific - Professional */
.participants-info {
  text-align: center;
  padding: var(--spacing-md);
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  box-shadow: 
    var(--shadow-sm),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.participants-info::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-subtle);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.participants-info:hover {
  border-color: var(--accent-primary);
  background: linear-gradient(135deg, var(--bg-hover) 0%, var(--bg-secondary) 100%);
  box-shadow: 
    var(--shadow-lg), 
    0 0 40px rgba(132, 204, 22, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-3px) scale(1.01);
}

.participants-info:hover::before {
  opacity: 1;
}

.participants-info:hover .participants-progress-bar {
  stroke: var(--accent-primary);
  filter: drop-shadow(0 0 8px rgba(132, 204, 22, 0.6));
}

/* Icon hover effects - Removed */

/* Progress Indicator Wrapper */
.participants-progress-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
  width: 120px;
  height: 120px;
  margin-left: auto;
  margin-right: auto;
}

/* Circular Progress Indicator */
.participants-progress-circle {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.participants-progress-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.participants-progress-bg {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 6;
  opacity: 0.3;
}

.participants-progress-bar {
  fill: none;
  stroke: var(--accent-primary);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 283; /* 2 * π * 45 */
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.3s ease;
  filter: drop-shadow(0 0 4px rgba(132, 204, 22, 0.4));
}

/* Count Number */
.participants-count-large {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: var(--font-3xl);
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  letter-spacing: -1px;
  z-index: 2;
  filter: drop-shadow(0 2px 8px rgba(132, 204, 22, 0.4));
  transition: all 0.3s ease;
}

.participants-info:hover .participants-count-large {
  transform: translate(-50%, -50%) scale(1.1);
  text-shadow: 0 4px 12px rgba(132, 204, 22, 0.5);
}

/* Icon in Corner */
.participants-icon-wrapper {
  display: none;
}

.participants-icon {
  display: none;
}

.participants-info:hover .participants-icon-wrapper {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px rgba(132, 204, 22, 0.3);
}

.participants-label-text {
  font-size: var(--font-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 500;
  margin-top: var(--spacing-sm);
  transition: color 0.3s ease;
}

.participants-info:hover .participants-label-text {
  color: var(--text-secondary);
}

@keyframes reflection {
  0%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  50% {
    opacity: 0.5;
    transform: translateY(-5px);
  }
}

@keyframes dividerPulse {
  0%, 100% {
    opacity: 0.6;
    box-shadow: 
      0 0 8px rgba(132, 204, 22, 0.4),
      0 0 12px rgba(132, 204, 22, 0.2);
  }
  50% {
    opacity: 0.8;
    box-shadow: 
      0 0 12px rgba(132, 204, 22, 0.6),
      0 0 16px rgba(132, 204, 22, 0.4);
  }
}

/* Scrollbars */
.left-sidebar::-webkit-scrollbar,
.right-sidebar::-webkit-scrollbar,
.content-area::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
  width: 6px;
}

.left-sidebar::-webkit-scrollbar-track,
.right-sidebar::-webkit-scrollbar-track,
.content-area::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.left-sidebar::-webkit-scrollbar-thumb,
.right-sidebar::-webkit-scrollbar-thumb,
.content-area::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, 
    rgba(132, 204, 22, 0.7) 0%, 
    rgba(101, 163, 13, 0.8) 50%,
    rgba(132, 204, 22, 0.7) 100%);
  border-radius: 3px;
  border: 1px solid rgba(132, 204, 22, 0.4);
  box-shadow: 
    0 0 6px rgba(132, 204, 22, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.left-sidebar::-webkit-scrollbar-thumb:hover,
.right-sidebar::-webkit-scrollbar-thumb:hover,
.content-area::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, 
    rgba(132, 204, 22, 0.9) 0%, 
    rgba(101, 163, 13, 1) 50%,
    rgba(132, 204, 22, 0.9) 100%);
  box-shadow: 
    0 0 10px rgba(132, 204, 22, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-color: rgba(132, 204, 22, 0.6);
}

/* Chat Box Custom Scrollbar - Styled */
/* Ensure scrollbar is always visible when content overflows */
#chatBox.chat-box,
.chat-box {
  scrollbar-gutter: stable;
}

#chatBox.chat-box::-webkit-scrollbar,
.chat-box::-webkit-scrollbar {
  width: 10px !important;
  /* Always show scrollbar when content overflows */
  display: block !important;
}

#chatBox.chat-box::-webkit-scrollbar-track,
.chat-box::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.4) !important;
  border-radius: 5px;
  margin: 4px 0;
  border: 1px solid rgba(132, 204, 22, 0.1);
}

#chatBox.chat-box::-webkit-scrollbar-thumb,
.chat-box::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, 
    rgba(132, 204, 22, 0.7) 0%, 
    rgba(101, 163, 13, 0.8) 50%,
    rgba(132, 204, 22, 0.7) 100%) !important;
  border-radius: 5px;
  border: 1px solid rgba(132, 204, 22, 0.4);
  box-shadow: 
    0 0 6px rgba(132, 204, 22, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: all var(--timing-fast) var(--easing-standard);
  min-height: 30px;
}

#chatBox.chat-box::-webkit-scrollbar-thumb:hover,
.chat-box::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, 
    rgba(132, 204, 22, 0.9) 0%, 
    rgba(101, 163, 13, 1) 50%,
    rgba(132, 204, 22, 0.9) 100%) !important;
  box-shadow: 
    0 0 10px rgba(132, 204, 22, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-color: rgba(132, 204, 22, 0.6);
}

#chatBox.chat-box::-webkit-scrollbar-thumb:active,
.chat-box::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, 
    rgba(132, 204, 22, 1) 0%, 
    rgba(101, 163, 13, 1) 50%,
    rgba(132, 204, 22, 1) 100%) !important;
  box-shadow: 
    0 0 14px rgba(132, 204, 22, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Firefox scrollbar for chat - added to existing .chat-box rule */

/* Tab Buttons - Pill Buttons (Modern) */
.tab-buttons {
  display: flex;
  gap: var(--spacing-sm);
  background: transparent;
  padding: 0;
  border: none;
}

.toggle-btn {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-lg);
  background: transparent;
  border: 1px solid var(--border-primary);
  border-radius: 50px; /* Pill shape */
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--timing-base) var(--easing-standard);
  font-size: var(--font-sm);
  font-weight: 500;
  position: relative;
  letter-spacing: var(--tracking-wide);
  overflow: hidden;
}

.toggle-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-subtle);
  opacity: 0;
  transition: opacity var(--timing-base) var(--easing-standard);
}

.toggle-btn:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.toggle-btn:hover::before {
  opacity: 1;
}

.toggle-btn.active {
  background: var(--gradient-main);
  border-color: var(--accent-primary);
  color: var(--bg-primary);
  font-weight: 600;
  box-shadow: 
    var(--shadow-md),
    0 0 20px rgba(132, 204, 22, 0.4),
    0 0 40px rgba(132, 204, 22, 0.2);
  transform: translateY(-1px);
  position: relative;
}

.toggle-btn.active::before {
  opacity: 0;
}

.toggle-btn.active:hover {
  box-shadow: 
    var(--shadow-lg),
    0 0 30px rgba(132, 204, 22, 0.5),
    0 0 50px rgba(132, 204, 22, 0.3);
  transform: translateY(-2px) scale(1.02);
}

.toggle-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}

/* Control Buttons - Professional Refined */
.control-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.control-btn {
  padding: var(--spacing-md) var(--spacing-lg);
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--timing-base) var(--easing-standard);
  font-size: var(--font-sm);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  box-shadow: 
    var(--shadow-sm),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  letter-spacing: var(--tracking-wide);
}

.control-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-subtle);
  opacity: 0;
  transition: opacity var(--timing-base) var(--easing-standard);
}

.control-btn:hover {
  background: linear-gradient(135deg, var(--bg-hover) 0%, var(--bg-secondary) 100%);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
  box-shadow: 
    var(--shadow-md),
    0 0 16px rgba(132, 204, 22, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  filter: brightness(1.03);
}

.control-btn:hover::before {
  opacity: 1;
}

.control-btn .icon {
  width: 20px;
  height: 20px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.control-btn:active {
  transform: translateY(-1px);
  box-shadow: 
    0 4px 15px rgba(74, 222, 128, 0.25),
    0 0 10px rgba(74, 222, 128, 0.15);
}

.control-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: 
    var(--shadow-focus),
    var(--shadow-md),
    0 0 20px rgba(132, 204, 22, 0.4);
}

.control-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.control-btn:disabled:hover {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-color: var(--border-primary);
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
}

/* Dropdown Menu */
.control-btn-dropdown {
  position: relative;
  width: 100%;
}

.control-btn-dropdown .control-btn {
  /* Ensure the button inside dropdown has the same styles as other control buttons */
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.dropdown-menu:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-item {
  width: 100%;
  padding: 0.875rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.4s ease;
}

.dropdown-item:hover::before {
  left: 100%;
}

.dropdown-item:hover {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
  transform: translateX(4px);
}

.dropdown-item:active {
  transform: translateX(2px);
}

.dropdown-item .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}

/* Participants Info */
.participants-info {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: var(--spacing-lg);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(74, 222, 128, 0.2),
    0 0 20px rgba(74, 222, 128, 0.1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 20; /* Очень высокий z-index */
  pointer-events: auto;
  cursor: pointer;
}

.participants-info:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 25px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(74, 222, 128, 0.4),
    0 0 30px rgba(74, 222, 128, 0.2);
}


.participants-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary); /* Яркий белый текст */
  position: relative;
  z-index: 11; /* Выше декораций */
  text-transform: uppercase;
  letter-spacing: 1px;
}

.participants-count {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--gradient-swamp); /* Болотный градиент */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 11; /* Выше декораций */
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
  filter: drop-shadow(0 0 10px rgba(132, 204, 22, 0.5)); /* Свечение для видимости */
}

/* Timer Section - Professional */
.timer-section {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  box-shadow: 
    var(--shadow-sm),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  transition: all var(--timing-base) var(--easing-standard);
  position: relative;
  overflow: hidden;
}

.timer-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-main);
  opacity: 0;
  transition: opacity var(--timing-base) var(--easing-standard);
}

.timer-section:hover {
  border-color: var(--accent-primary);
  box-shadow: 
    var(--shadow-md),
    0 0 20px rgba(132, 204, 22, 0.2);
  transform: translateY(-2px);
}

.timer-section:hover::before {
  opacity: 1;
}

.timer-display {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.timer-time {
  font-size: var(--font-3xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  font-family: 'Inter', monospace;
  text-shadow: 0 0 30px rgba(132, 204, 22, 0.3);
  filter: drop-shadow(0 2px 4px rgba(132, 204, 22, 0.2));
}

.timer-time.timer-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: pulse 1s ease-in-out infinite;
}

.timer-time.timer-expired {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.timer-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.timer-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--timing-base) var(--easing-standard);
  padding: 0;
  position: relative;
  box-shadow: var(--shadow-xs);
}

.timer-btn:hover {
  background: linear-gradient(135deg, var(--bg-hover) 0%, var(--bg-secondary) 100%);
  border-color: var(--accent-primary);
  transform: translateY(-1px) scale(1.05);
  box-shadow: 
    var(--shadow-md),
    0 0 12px rgba(132, 204, 22, 0.25);
  color: var(--accent-primary);
}

.timer-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}

.timer-btn:active {
  transform: translateY(0) scale(1);
}

.timer-btn .icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  stroke: currentColor;
  display: block;
  margin: 0 auto;
  flex-shrink: 0;
}

.timer-btn .icon use {
  display: block;
}

.timer-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.timer-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Leaderboard */
.leaderboard-container {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-radius: var(--radius-xl);
  padding: 1rem;
  box-shadow: 0 4px 16px rgba(132, 204, 22, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  z-index: 20; /* Очень высокий z-index */
  pointer-events: auto;
}

.leaderboard-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.leaderboard-header h4 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary); /* Яркий белый текст */
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  margin: 0;
  position: relative;
  z-index: 11; /* Выше декораций */
}

.leaderboard-toggle {
  display: flex;
  gap: 0.375rem;
  background: var(--bg-secondary);
  padding: 0.2rem;
  border-radius: var(--radius-md);
}

.leaderboard-toggle {
  display: flex;
  gap: var(--spacing-xs);
  background: var(--bg-tertiary);
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-primary);
}

.leaderboard-toggle-btn {
  flex: 1;
  padding: var(--spacing-xs) var(--spacing-sm);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--timing-fast) var(--easing-standard);
  font-size: var(--font-xs);
  font-weight: 500;
  text-align: center;
  position: relative;
  z-index: 11;
  pointer-events: auto;
  letter-spacing: var(--tracking-wide);
}

.leaderboard-toggle-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.leaderboard-toggle-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
  background: var(--bg-hover);
}

.leaderboard-toggle-btn.active {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 
    var(--shadow-sm),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border-color: var(--accent-primary);
}

.leaderboard-toggle-btn:hover:not(.active) {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: hidden;
  margin-bottom: 0;
  flex: 1;
  min-height: 0;
  position: relative;
}

/* Разделители между позициями */
.leaderboard-item:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: -0.25rem;
  left: 0.625rem;
  right: 0.625rem;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(132, 204, 22, 0.15) 20%,
    rgba(132, 204, 22, 0.15) 80%,
    transparent 100%);
  opacity: 0.5;
}

.leaderboard-item.top-1:not(:last-child)::after,
.leaderboard-item.top-2:not(:last-child)::after,
.leaderboard-item.top-3:not(:last-child)::after {
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(132, 204, 22, 0.25) 20%,
    rgba(132, 204, 22, 0.25) 80%,
    transparent 100%);
  opacity: 0.7;
}

.leaderboard-item {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.625rem;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  transition: all var(--timing-base) var(--easing-standard);
  min-height: 38px;
  position: relative;
  z-index: 11;
  pointer-events: auto;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

/* Акцентная левая полоса для топ-3 */
.leaderboard-item.top-1::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #84cc16 0%, #65a30d 100%);
  box-shadow: 0 0 8px rgba(132, 204, 22, 0.6);
}

.leaderboard-item.top-2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, rgba(156, 163, 175, 0.8) 0%, rgba(107, 114, 128, 0.6) 100%);
  box-shadow: 0 0 6px rgba(156, 163, 175, 0.4);
}

.leaderboard-item.top-3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.8) 0%, rgba(180, 83, 9, 0.6) 100%);
  box-shadow: 0 0 5px rgba(217, 119, 6, 0.3);
}

/* Градиентные фоны и свечение для топ-3 */
.leaderboard-item.top-1 {
  background: linear-gradient(135deg, 
    rgba(132, 204, 22, 0.15) 0%, 
    rgba(101, 163, 13, 0.1) 50%,
    rgba(132, 204, 22, 0.15) 100%);
  border-color: rgba(132, 204, 22, 0.3);
  box-shadow: 
    var(--shadow-xs),
    0 0 20px rgba(132, 204, 22, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  padding: 0.75rem 0.625rem 0.75rem 0.875rem; /* Больше padding для топ-3 */
  min-height: 44px;
}

.leaderboard-item.top-2 {
  background: linear-gradient(135deg, 
    rgba(156, 163, 175, 0.12) 0%, 
    rgba(107, 114, 128, 0.08) 50%,
    rgba(156, 163, 175, 0.12) 100%);
  border-color: rgba(156, 163, 175, 0.25);
  box-shadow: 
    var(--shadow-xs),
    0 0 15px rgba(156, 163, 175, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 0.6875rem 0.625rem 0.6875rem 0.8125rem;
  min-height: 42px;
}

.leaderboard-item.top-3 {
  background: linear-gradient(135deg, 
    rgba(217, 119, 6, 0.12) 0%, 
    rgba(180, 83, 9, 0.08) 50%,
    rgba(217, 119, 6, 0.12) 100%);
  border-color: rgba(217, 119, 6, 0.25);
  box-shadow: 
    var(--shadow-xs),
    0 0 12px rgba(217, 119, 6, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 0.625rem 0.625rem 0.625rem 0.75rem;
  min-height: 40px;
}

.leaderboard-item:hover {
  background: linear-gradient(135deg, var(--bg-hover) 0%, var(--bg-secondary) 100%);
  border-color: var(--accent-primary);
  transform: translateX(4px) scale(1.02);
  box-shadow: 
    var(--shadow-md),
    0 0 20px rgba(132, 204, 22, 0.3),
    0 0 40px rgba(132, 204, 22, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  filter: brightness(1.05);
  transition: all var(--timing-base) var(--easing-standard);
}

/* Улучшенные hover-эффекты для топ-3 */
.leaderboard-item.top-1:hover {
  background: linear-gradient(135deg, 
    rgba(132, 204, 22, 0.2) 0%, 
    rgba(101, 163, 13, 0.15) 50%,
    rgba(132, 204, 22, 0.2) 100%);
  border-color: rgba(132, 204, 22, 0.5);
  box-shadow: 
    var(--shadow-lg),
    0 0 30px rgba(132, 204, 22, 0.5),
    0 0 60px rgba(132, 204, 22, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  filter: brightness(1.08);
}

.leaderboard-item.top-2:hover {
  background: linear-gradient(135deg, 
    rgba(156, 163, 175, 0.18) 0%, 
    rgba(107, 114, 128, 0.12) 50%,
    rgba(156, 163, 175, 0.18) 100%);
  border-color: rgba(156, 163, 175, 0.4);
  box-shadow: 
    var(--shadow-md),
    0 0 25px rgba(156, 163, 175, 0.3),
    0 0 50px rgba(156, 163, 175, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  filter: brightness(1.06);
}

.leaderboard-item.top-3:hover {
  background: linear-gradient(135deg, 
    rgba(217, 119, 6, 0.18) 0%, 
    rgba(180, 83, 9, 0.12) 50%,
    rgba(217, 119, 6, 0.18) 100%);
  border-color: rgba(217, 119, 6, 0.4);
  box-shadow: 
    var(--shadow-md),
    0 0 25px rgba(217, 119, 6, 0.3),
    0 0 50px rgba(217, 119, 6, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  filter: brightness(1.06);
}

.leaderboard-item:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}

.leaderboard-rank {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-tertiary);
  min-width: 1.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Круглые бейджи для топ-3 */
.leaderboard-rank.top-1,
.leaderboard-rank.top-2,
.leaderboard-rank.top-3 {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.leaderboard-rank.top-1 {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #1a2e1f;
  box-shadow: 
    0 2px 8px rgba(251, 191, 36, 0.4),
    0 0 12px rgba(251, 191, 36, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.leaderboard-rank.top-2 {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
  color: #ffffff;
  box-shadow: 
    0 2px 6px rgba(156, 163, 175, 0.3),
    0 0 10px rgba(156, 163, 175, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.leaderboard-rank.top-3 {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #ffffff;
  box-shadow: 
    0 2px 6px rgba(217, 119, 6, 0.3),
    0 0 10px rgba(217, 119, 6, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}


.leaderboard-info {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
  min-width: 0;
}

.leaderboard-username {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.05px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Улучшенная типографика для топ-3 */
.leaderboard-item.top-1 .leaderboard-username,
.leaderboard-item.top-2 .leaderboard-username,
.leaderboard-item.top-3 .leaderboard-username {
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.1px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.leaderboard-value {
  font-size: 0.875rem;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  letter-spacing: 0.05px;
  white-space: nowrap;
  filter: drop-shadow(0 1px 2px rgba(132, 204, 22, 0.3));
  font-variant-numeric: tabular-nums;
}

/* Улучшенные значения для топ-3 */
.leaderboard-item.top-1 .leaderboard-value {
  font-size: 0.9375rem;
  filter: drop-shadow(0 1px 3px rgba(132, 204, 22, 0.5));
}

.leaderboard-item.top-2 .leaderboard-value,
.leaderboard-item.top-3 .leaderboard-value {
  font-size: 0.875rem;
  filter: drop-shadow(0 1px 2px rgba(132, 204, 22, 0.4));
}

.leaderboard-item.empty {
  opacity: 0.5;
  pointer-events: none;
}

/* Индикатор прогресса для топ-3 (показывает % от лидера) */
.leaderboard-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(132, 204, 22, 0.1);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  overflow: hidden;
}

.leaderboard-progress-bar {
  height: 100%;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.leaderboard-item.top-1 .leaderboard-progress-bar {
  background: linear-gradient(90deg, #84cc16 0%, #65a30d 100%);
  width: 100%;
  box-shadow: 0 0 8px rgba(132, 204, 22, 0.6);
}

.leaderboard-item.top-2 .leaderboard-progress-bar {
  background: linear-gradient(90deg, rgba(156, 163, 175, 0.8) 0%, rgba(107, 114, 128, 0.6) 100%);
  box-shadow: 0 0 6px rgba(156, 163, 175, 0.4);
}

.leaderboard-item.top-3 .leaderboard-progress-bar {
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.8) 0%, rgba(180, 83, 9, 0.6) 100%);
  box-shadow: 0 0 6px rgba(217, 119, 6, 0.4);
}

.leaderboard-list::-webkit-scrollbar {
  width: 4px;
}

.leaderboard-list::-webkit-scrollbar-track {
  background: transparent;
}

.leaderboard-list::-webkit-scrollbar-thumb {
  background: rgba(74, 222, 128, 0.3);
  border-radius: 2px;
}

.leaderboard-list::-webkit-scrollbar-thumb:hover {
  background: rgba(74, 222, 128, 0.6);
}


/* Chat */
.chat-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  /* Ensure flex children can shrink */
  flex-shrink: 0;
}

.chat-header {
  padding: var(--spacing-lg) var(--spacing-xl);
  border-bottom: 1px solid var(--border-primary);
  background: transparent;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-header h3 {
  font-size: 1rem;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%) !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.2px;
  margin: 0;
  padding: var(--spacing-sm) var(--spacing-md);
  position: relative;
  z-index: 3;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 10px rgba(132, 204, 22, 0.3);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  border: 1px solid rgba(132, 204, 22, 0.3);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  width: auto;
  max-width: calc(100% - var(--spacing-xl));
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.25),
    0 0 20px rgba(132, 204, 22, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(4px);
  animation: announcementPulse 3s ease-in-out infinite;
}

.chat-header h3:hover {
  border-color: rgba(132, 204, 22, 0.5);
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-hover) 100%);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.3),
    0 0 24px rgba(132, 204, 22, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

/* Иконка в заголовке чата */
.chat-header h3 .icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  fill: var(--accent-primary);
  color: var(--accent-primary);
  opacity: 0.85;
  filter: drop-shadow(0 0 4px rgba(132, 204, 22, 0.4));
  transition: opacity 0.3s ease;
}

.chat-header h3:hover .icon {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(132, 204, 22, 0.6));
}

.chat-header h3 .icon-small {
  width: 16px;
  height: 16px;
}

.chat-header h3 span {
  display: inline-block;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 8px rgba(132, 204, 22, 0.2);
}

/* Выделение символа + */
.chat-header h3 .plus-symbol {
  display: inline-block;
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 1.15em;
  text-shadow: 
    0 0 10px rgba(132, 204, 22, 0.6),
    0 0 20px rgba(132, 204, 22, 0.4),
    0 1px 2px rgba(0, 0, 0, 0.5);
  margin: 0 3px;
  padding: 0 2px;
  transition: all 0.3s ease;
  position: relative;
  animation: plusSymbolPulse 2s ease-in-out infinite;
}

.chat-header h3:hover .plus-symbol {
  text-shadow: 
    0 0 15px rgba(132, 204, 22, 0.8),
    0 0 25px rgba(132, 204, 22, 0.5),
    0 1px 2px rgba(0, 0, 0, 0.5);
  transform: scale(1.1);
}

/* Анимация пульсации для блока объявления */
@keyframes announcementPulse {
  0%, 100% {
    border-color: rgba(132, 204, 22, 0.3);
    box-shadow: 
      0 2px 8px rgba(0, 0, 0, 0.25),
      0 0 20px rgba(132, 204, 22, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
  50% {
    border-color: rgba(132, 204, 22, 0.5);
    box-shadow: 
      0 2px 8px rgba(0, 0, 0, 0.25),
      0 0 28px rgba(132, 204, 22, 0.15),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
}

/* Анимация пульсации для символа + */
@keyframes plusSymbolPulse {
  0%, 100% {
    text-shadow: 
      0 0 10px rgba(132, 204, 22, 0.6),
      0 0 20px rgba(132, 204, 22, 0.4),
      0 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 1;
  }
  50% {
    text-shadow: 
      0 0 15px rgba(132, 204, 22, 0.8),
      0 0 30px rgba(132, 204, 22, 0.6),
      0 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 1;
  }
}

/* Акцентная линия снизу - убрана для упрощения */

@keyframes accentLinePulse {
  0%, 100% {
    opacity: 0.8;
    width: 80px;
    box-shadow: 0 0 12px rgba(132, 204, 22, 0.6);
  }
  50% {
    opacity: 1;
    width: 100px;
    box-shadow: 0 0 16px rgba(132, 204, 22, 0.8);
  }
}

.chat-box {
  flex: 1 1 auto;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: var(--spacing-xl);
  position: relative;
  z-index: 2;
  background: transparent;
  min-height: 0;
  /* Ensure scrollbar is always visible when content overflows */
  -webkit-overflow-scrolling: touch;
  /* Firefox scrollbar */
  scrollbar-width: thin !important;
  scrollbar-color: rgba(132, 204, 22, 0.8) rgba(0, 0, 0, 0.4) !important;
  /* Ensure scrolling works with mouse wheel */
  overscroll-behavior: contain;
  /* Force scrollbar to be visible */
  scrollbar-gutter: stable;
  /* Ensure scrolling is not blocked */
  touch-action: pan-y;
  /* Make sure element can receive scroll events */
  pointer-events: auto !important;
}

.chat-messages {
  display: flex !important;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
  min-height: 0;
  overflow: visible;
  /* Ensure messages don't block scrolling */
  flex-shrink: 0;
}

.chat-message {
  display: flex !important;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.25rem 0;
  padding-right: 4rem; /* Space for action buttons */
  background: transparent;
  border: none;
  border-radius: 0;
  transition: none;
  position: relative;
  word-wrap: break-word;
  overflow-wrap: break-word;
  width: 100%;
  min-width: 0;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Role-based message styling - убраны границы, оставлены только бейджи */

.chat-role-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  margin-right: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chat-role-label-mod {
  background: rgba(0, 200, 0, 0.5);
  color: rgba(0, 255, 0, 0.9);
}

.chat-role-label-vip {
  background: rgba(145, 70, 255, 0.5);
  color: rgba(200, 150, 255, 0.9);
}

.chat-role-label-sub {
  background: rgba(0, 153, 255, 0.5);
  color: rgba(150, 200, 255, 0.9);
}

/* Кастомная приписка для выделенных пользователей */
.chat-role-label-custom {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  margin-right: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ffffff;
  opacity: 0.9;
}

/* Кастомная обводка для выделенных пользователей - убрана, оставлены только бейджи */

.chat-message-content {
  display: flex !important;
  align-items: flex-start;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: calc(100% - 4rem); /* Reserve space for action buttons */
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 1.5rem;
}

/* Ensure username and text are always visible */
.chat-message-content > .chat-username {
  display: inline !important;
  visibility: visible !important;
  opacity: 1 !important;
  white-space: nowrap;
  flex-shrink: 0;
}

.chat-message-content > .chat-text {
  display: inline !important;
  visibility: visible !important;
  opacity: 1 !important;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.chat-action-buttons {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  opacity: 0;
  transition: opacity var(--timing-fast) var(--easing-standard);
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  padding: 0.125rem;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  border-radius: 0.25rem;
  pointer-events: auto; /* Ensure buttons are clickable even when opacity is 0 */
}

/* Показывать кнопки при наведении на сообщение */
.chat-message:hover .chat-action-buttons {
  opacity: 0.4;
}

.chat-delete-btn,
.chat-timeout-btn {
  padding: 0.375rem 0.5rem;
  border: none;
  background: rgba(0, 0, 0, 0.15);
  cursor: pointer;
  font-size: 0.875rem;
  border-radius: 0.25rem;
  transition: all var(--timing-fast) var(--easing-standard);
  opacity: 0.3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(156, 163, 175, 0.5);
  backdrop-filter: blur(2px);
  min-width: 28px;
  min-height: 28px;
  pointer-events: auto; /* Ensure buttons are always clickable */
  user-select: none; /* Prevent text selection */
}

.chat-delete-btn:hover {
  color: rgba(239, 68, 68, 0.8);
  opacity: 0.7;
  background: rgba(239, 68, 68, 0.15);
  transform: scale(1.05);
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.2);
}

.chat-timeout-btn:hover {
  color: rgba(245, 158, 11, 0.8);
  opacity: 0.7;
  background: rgba(245, 158, 11, 0.15);
  transform: scale(1.05);
  box-shadow: 0 0 4px rgba(245, 158, 11, 0.2);
}

.chat-username {
  font-weight: 600;
  color: var(--accent-primary); /* Removed !important to allow inline style colors from Twitch */
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
  flex-shrink: 0;
  white-space: nowrap;
  visibility: visible !important;
  opacity: 1 !important;
  display: inline !important;
}

.chat-username:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

.chat-text {
  color: var(--text-primary) !important;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  line-height: 1.5;
  white-space: normal;
  visibility: visible !important;
  opacity: 1 !important;
  text-align: left;
}

.chat-participant .chat-text {
  color: #84cc16 !important;
  font-weight: 600;
}

/* Battle participant indicator */
.chat-battle-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  position: relative;
  cursor: help;
  margin-right: 0.25rem;
}

.battle-loader {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  position: relative;
  background: transparent;
  animation: battle-pulse 2s ease-in-out infinite;
}

.battle-loader::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border: 2.5px solid transparent;
  border-top-color: #3b82f6;
  border-right-color: #3b82f6;
  border-radius: 50%;
  animation: battle-spin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  box-shadow: 
    0 0 10px rgba(59, 130, 246, 0.5),
    0 0 15px rgba(59, 130, 246, 0.3);
}

.battle-loader::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: radial-gradient(circle, #3b82f6 0%, #2563eb 100%);
  border-radius: 50%;
  box-shadow: 
    0 0 6px rgba(59, 130, 246, 0.8),
    0 0 10px rgba(59, 130, 246, 0.4);
  animation: battle-glow 1.5s ease-in-out infinite;
}

@keyframes battle-spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes battle-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}

@keyframes battle-glow {
  0%, 100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(0.9);
  }
}

.chat-message-deleted {
  opacity: 0.5;
  pointer-events: none;
}

.chat-message-deleted .chat-text {
  font-style: italic;
  color: var(--text-tertiary);
}

.chat-badges {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
  min-width: 0;
}

.chat-badges:empty {
  display: none;
}

.chat-badge {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  background: var(--accent-warning);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: bold;
  color: white;
}

.chat-badge-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
}

.chat-emote {
  height: 1.75em;
  width: auto;
  vertical-align: middle;
  display: inline-block;
  margin: 0 0.125rem;
}

.show-new-messages-btn {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 1rem;
  z-index: 10;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--timing-fast) var(--easing-standard);
  box-shadow: var(--shadow-lg);
  display: none; /* Hidden by default, shown only when needed */
}

.show-new-messages-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-hover);
}

.show-new-messages-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}

/* Winners Section */
.winners-section {
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 20; /* Очень высокий z-index */
  pointer-events: auto;
}

.winners-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  margin-top: -1.5rem;
  margin-left: 0;
  margin-right: 0;
  padding-top: 0;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  overflow: visible;
  white-space: nowrap;
  min-width: max-content;
  width: fit-content;
  max-width: calc(100% - 1rem);
  box-sizing: border-box;
  text-align: center;
}

.winners-section h3::before {
  content: '🏆';
  font-size: 2rem;
  line-height: 1;
  display: block;
}

/* Winners list styles are now in sidebar */

.winner-item {
  padding: 0.5rem 0.625rem;
  background: linear-gradient(135deg, rgba(26, 46, 31, 0.95) 0%, rgba(36, 56, 42, 0.95) 100%);
  border: 1px solid rgba(132, 204, 22, 0.25);
  border-radius: var(--radius-sm);
  transition: all var(--timing-base) var(--easing-standard);
  cursor: pointer;
  position: relative;
  z-index: 11;
  pointer-events: auto;
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex !important;
  flex-direction: column;
  gap: 0.375rem;
  min-height: auto;
  overflow: visible;
  width: 100%;
  visibility: visible;
  opacity: 1;
  flex-shrink: 0;
}

.winner-item:hover {
  background: linear-gradient(135deg, rgba(42, 63, 48, 0.98) 0%, rgba(26, 46, 31, 0.98) 100%);
  border-color: rgba(132, 204, 22, 0.5);
  transform: translateX(2px) scale(1.01);
  box-shadow: 
    0 4px 8px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(132, 204, 22, 0.3),
    0 0 40px rgba(132, 204, 22, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  filter: brightness(1.05);
  transition: all var(--timing-base) var(--easing-standard);
}

.winner-item:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}

/* Removed icon - no longer needed */

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

/* Winner rows for two-line layout */
.winner-row {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
  flex-shrink: 0;
  visibility: visible;
  opacity: 1;
}

.winner-row-top {
  justify-content: space-between;
  width: 100%;
}

.winner-row-bottom {
  justify-content: flex-start;
  gap: 0.5rem;
  width: 100%;
}

.winner-name {
  display: inline-block !important;
  font-weight: 600;
  color: #ffffff !important;
  font-size: 0.9375rem;
  letter-spacing: 0.1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  visibility: visible;
  opacity: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.winner-date {
  display: inline-block !important;
  font-size: 0.8125rem;
  color: #b8bcc4 !important;
  font-weight: 500;
  letter-spacing: 0.1px;
  flex-shrink: 0;
  white-space: nowrap;
  visibility: visible;
  opacity: 1;
}

.winner-info-row {
  display: none;
}

/* Service badge - compact display */
.winner-service {
  display: inline-block !important;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 1;
  transition: all 0.2s ease;
  line-height: 1.3;
  visibility: visible;
  letter-spacing: 0.3px;
}

.winner-item:hover .winner-service {
  opacity: 1;
}

/* Amounts container - compact display */
.winner-amounts {
  display: flex !important;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  visibility: visible;
  opacity: 1;
}

.winner-deposit {
  display: inline-block !important;
  color: #d1d5db !important;
  font-weight: 500;
  white-space: nowrap;
  visibility: visible;
}

.winner-arrow {
  display: inline-block !important;
  color: #9ca3af !important;
  font-weight: 400;
  margin: 0 0.125rem;
  visibility: visible;
  font-size: 0.875rem;
}

.winner-winning {
  display: inline-block !important;
  color: #10b981 !important;
  font-weight: 700;
  white-space: nowrap;
  visibility: visible;
  text-shadow: 0 1px 2px rgba(16, 185, 129, 0.3);
}

.winners-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--spacing-2xl) var(--spacing-lg);
  position: relative;
  z-index: 11;
  pointer-events: auto;
  min-height: 200px;
  animation: fadeInUp 0.5s ease-out;
}

.winners-empty::before {
  content: '';
  display: block;
  width: 80px;
  height: 80px;
  margin-bottom: var(--spacing-lg);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 64 64' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='20' y='50' width='24' height='6' rx='2' fill='%2384cc16' opacity='0.3'/%3E%3Crect x='24' y='48' width='16' height='4' rx='2' fill='%2384cc16' opacity='0.4'/%3E%3Cpath d='M18 20 L18 42 C18 44.209 19.791 46 22 46 L42 46 C44.209 46 46 44.209 46 42 L46 20 L18 20 Z' fill='%2384cc16' opacity='0.2'/%3E%3Cpath d='M20 22 L20 40 C20 41.105 20.895 42 22 42 L42 42 C43.105 42 44 41.105 44 40 L44 22 L20 22 Z' fill='%2384cc16' opacity='0.3'/%3E%3Cpath d='M18 24 C14 24 12 22 12 18 C12 14 14 12 18 12' stroke='%2384cc16' stroke-width='2' fill='none' stroke-linecap='round' opacity='0.4'/%3E%3Cpath d='M46 24 C50 24 52 22 52 18 C52 14 50 12 46 12' stroke='%2384cc16' stroke-width='2' fill='none' stroke-linecap='round' opacity='0.4'/%3E%3Cellipse cx='32' cy='20' rx='14' ry='4' fill='%2384cc16' opacity='0.2'/%3E%3Cellipse cx='32' cy='18' rx='12' ry='3' fill='%2384cc16' opacity='0.3'/%3E%3Cpath d='M32 28 L33.5 32 L38 32.5 L35 35.5 L35.5 40 L32 37.5 L28.5 40 L29 35.5 L26 32.5 L30.5 32 Z' fill='%2384cc16' opacity='0.5'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.6;
  animation: floatTrophy 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(132, 204, 22, 0.2));
}

.winners-empty-text {
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-weight: 500;
  letter-spacing: 0.3px;
  margin: 0;
}

.winners-empty-subtext {
  color: var(--text-tertiary);
  font-size: var(--font-xs);
  font-weight: 400;
  letter-spacing: 0.2px;
  margin-top: var(--spacing-xs);
  margin: 0;
}

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

@keyframes floatTrophy {
  0%, 100% {
    transform: translateY(0) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-8px) scale(1.05);
    opacity: 0.8;
  }
}


/* Modal Content */
.modal-content {
  background: linear-gradient(135deg, 
    rgba(26, 46, 31, 0.95) 0%, 
    rgba(36, 56, 42, 0.9) 50%,
    rgba(26, 46, 31, 0.95) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(132, 204, 22, 0.3);
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 
    0 0 0 1px rgba(132, 204, 22, 0.2),
    0 8px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: modalSlideIn var(--timing-base) var(--easing-decelerate);
  position: relative;
}

.modal-content::before {
  display: none;
}

.modal-content.winner-modal::before {
  display: none;
}

.modal-content.winner-modal {
  overflow-y: auto;
  overflow-x: visible;
  scrollbar-width: none;
  scrollbar-color: var(--accent-primary) var(--bg-tertiary);
  position: relative;
}

.modal-content.winner-modal::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-lg);
  border-bottom: 1px solid rgba(132, 204, 22, 0.2);
  flex-shrink: 0;
  background: linear-gradient(135deg, 
    rgba(26, 46, 31, 0.8) 0%, 
    rgba(36, 56, 42, 0.6) 100%);
  box-shadow: 
    0 2px 0 0 rgba(132, 204, 22, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent-primary);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 10px rgba(132, 204, 22, 0.5);
  -webkit-text-fill-color: var(--accent-primary) !important;
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
}

.modal-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border: 1px solid rgba(132, 204, 22, 0.2);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.modal-btn:hover {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-hover) 100%);
  border-color: rgba(132, 204, 22, 0.4);
  color: var(--text-primary);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.modal-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}

.modal-btn.close:hover {
  background: var(--accent-error);
  color: white;
}

.modal-btn.close:focus-visible {
  outline-color: var(--accent-error);
}

/* Winner Modal */
.winner-modal {
  max-width: 700px;
  max-height: 90vh;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.winner-modal::before {
  display: none !important;
}

.winner-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  padding: var(--spacing-xl);
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-primary);
}

.winner-left-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.winner-info {
  display: flex;
  gap: var(--spacing-lg);
  flex-shrink: 0;
  overflow: visible;
  position: relative;
}

.winner-avatar {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-xl);
  background: var(--gradient-main);
  overflow: hidden;
  flex-shrink: 0;
}

.winner-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.winner-details h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--spacing-md);
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 10px rgba(132, 204, 22, 0.3);
  -webkit-text-fill-color: #ffffff !important;
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
}

.winner-stats {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem var(--spacing-sm);
  padding-left: calc(var(--spacing-sm) + 3px);
  position: relative;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  cursor: default;
  min-height: 1.875rem;
  gap: var(--spacing-md);
}

.stat::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 55%;
  background: rgba(132, 204, 22, 0.3);
  border-radius: 0 2px 2px 0;
  transition: all 0.2s ease;
}

.stat:hover {
  background: rgba(132, 204, 22, 0.05);
}

.stat:hover::before {
  background: rgba(132, 204, 22, 0.6);
  width: 3px;
  height: 65%;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary) !important;
  font-weight: 500;
  flex-shrink: 0;
  flex: 0 1 auto;
  min-width: fit-content;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
  padding-right: var(--spacing-sm);
}

.stat-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary) !important;
  text-align: right;
  flex-shrink: 0;
  flex: 0 1 auto;
  min-width: fit-content;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 45%;
}

.winner-actions {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  padding: var(--spacing-lg);
  border-top: 1px solid var(--border-primary);
  flex-shrink: 0;
  justify-content: center;
  flex-wrap: wrap;
}

.action-btn {
  flex: 1;
  padding: 0.875rem 1rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

/* Уменьшенные кнопки для модального окна победителя */
.winner-actions .action-btn {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  min-width: 0;
  flex: 0 0 auto;
  justify-content: center;
}

.action-btn.reroll {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  color: var(--text-primary);
  border: 1px solid rgba(132, 204, 22, 0.3);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.action-btn.reroll:hover {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-hover) 100%);
  border-color: rgba(132, 204, 22, 0.5);
  box-shadow: 
    0 4px 10px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.action-btn.messages {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  color: var(--text-primary);
  border: 1px solid rgba(132, 204, 22, 0.3);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.action-btn.messages:hover {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-hover) 100%);
  border-color: rgba(132, 204, 22, 0.5);
  box-shadow: 
    0 4px 10px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.action-btn.coin {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  color: var(--text-primary);
  border: 1px solid rgba(132, 204, 22, 0.3);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.action-btn.coin:hover {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-hover) 100%);
  border-color: rgba(132, 204, 22, 0.5);
  box-shadow: 
    0 4px 10px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.action-btn.approve {
  background: linear-gradient(135deg, #84cc16 0%, #65a30d 100%);
  color: white;
  border: 1px solid rgba(132, 204, 22, 0.4);
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.action-btn.approve:hover {
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  background: linear-gradient(135deg, #a3d636 0%, #84cc16 100%);
}

.winner-timer {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  padding: var(--spacing-lg) var(--spacing-xl);
  flex-shrink: 0;
  position: relative;
}

.winner-timer::before,
.winner-timer::after {
  display: none !important;
}

.timer-bar-container {
  position: relative;
  width: 100%;
  height: 10px;
  background: rgba(132, 204, 22, 0.2);
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.timer-bar-bg {
  display: none;
}

.timer-bar-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-light) 100%);
  border-radius: var(--radius-full);
  transform-origin: left center;
  transform: scaleX(1);
  transition: transform 0.1s linear, background 0.3s ease;
  box-shadow: 0 0 16px rgba(132, 204, 22, 0.7), inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.timer-bar-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.timer {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-primary) !important;
  text-shadow: 0 0 12px rgba(132, 204, 22, 0.6), 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: color 0.3s ease;
  white-space: nowrap;
  text-align: center;
  letter-spacing: 0.05em;
}

.timer-status {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: center;
  min-height: 1.5rem;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.timer-status.answered {
  color: #84cc16;
}

.timer-status.reroll {
  color: #f59e0b;
}

.winner-actions::before,
.winner-actions::after {
  display: none !important;
}

.winner-chat {
  padding: var(--spacing-lg);
  border-top: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: auto;
  overflow: visible;
}

.winner-chat h4 {
  font-size: 0.875rem;
  color: #e5e7eb !important;
  margin-bottom: var(--spacing-md);
  font-weight: 600;
  flex-shrink: 0;
}

.chat-log {
  background: transparent;
  border-radius: var(--radius-md);
  padding: var(--spacing-xs);
  height: 250px;
  overflow-y: auto;
  overflow-x: hidden;
  font-size: 0.875rem;
  color: #e5e7eb !important;
  word-wrap: break-word;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  flex-shrink: 0;
}

/* Messenger-style message bubbles - compact */
.chat-message-bubble {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  max-width: 90%;
  animation: messageSlideIn 0.2s ease-out;
}

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

.chat-message-bubble-content {
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.15) 0%, rgba(101, 163, 13, 0.1) 100%);
  border: 1px solid rgba(132, 204, 22, 0.3);
  border-radius: 0.75rem 0.75rem 0.75rem 0.2rem;
  padding: 0.375rem 0.625rem;
  color: var(--text-primary);
  font-size: 0.8125rem;
  line-height: 1.3;
  word-wrap: break-word;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
}

.chat-message-bubble-time {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  padding-left: 0.5rem;
  opacity: 0.65;
  line-height: 1;
}

/* Custom scrollbar for chat log */
.chat-log::-webkit-scrollbar {
  width: 6px;
}

.chat-log::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.chat-log::-webkit-scrollbar-thumb {
  background: rgba(132, 204, 22, 0.4);
  border-radius: 3px;
}

.chat-log::-webkit-scrollbar-thumb:hover {
  background: rgba(132, 204, 22, 0.6);
}

.message-time {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Edit Modal */
.edit-form {
  padding: var(--spacing-lg);
}

.form-group {
  margin-bottom: var(--spacing-md);
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input:not([type="range"]),
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(132, 204, 22, 0.1);
}

/* Fix for autofill background color */
.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus,
.form-group input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px var(--bg-secondary) inset !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  background-color: var(--bg-secondary) !important;
  border: 1px solid var(--border-primary) !important;
  box-shadow: 0 0 0 30px var(--bg-secondary) inset !important;
}

.form-group input::selection {
  background: var(--accent-primary);
  color: white;
}

.form-group input[readonly] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Range input (slider) styles */
.form-group input[type="range"] {
  width: 100%;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  margin: 1rem 0;
}

.form-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent-primary);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(132, 204, 22, 0.4);
}

.form-group input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(132, 204, 22, 0.6);
}

.form-group input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent-primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(132, 204, 22, 0.4);
}

.form-group input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(132, 204, 22, 0.6);
}

.form-group input[type="range"]::-moz-range-track {
  width: 100%;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
}

.form-group input[type="range"]:focus {
  outline: none;
}

.form-group input[type="range"]:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(132, 204, 22, 0.2);
}

.form-group input[type="range"]:focus::-moz-range-thumb {
  box-shadow: 0 0 0 3px rgba(132, 204, 22, 0.2);
}

#wheelSoundVolumeGroup {
  transition: opacity 0.3s ease;
}

#wheelSoundVolumeGroup:has(input[type="range"]:disabled),
#wheelSoundVolumeGroup.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.edit-actions {
  display: flex;
  gap: 0.75rem;
  padding: var(--spacing-lg);
  border-top: 1px solid var(--border-primary);
}

.action-btn.save {
  background: linear-gradient(135deg, #84cc16 0%, #65a30d 100%);
  color: white;
  border: 1px solid rgba(132, 204, 22, 0.4);
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.action-btn.save:hover {
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  background: linear-gradient(135deg, #a3d636 0%, #84cc16 100%);
}

.action-btn.cancel {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  color: var(--text-primary);
  border: 1px solid rgba(132, 204, 22, 0.2);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.action-btn.cancel:hover {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-hover) 100%);
  border-color: rgba(132, 204, 22, 0.4);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

/* Settings Modal */
/* Password Modal Styles */
.password-modal {
  max-width: 450px;
  width: 90%;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-xl);
}

.password-form {
  padding: var(--spacing-lg);
}

.password-form .form-group {
  margin-bottom: var(--spacing-md);
}

.password-form label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9375rem;
}

.password-form input[type="password"] {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.password-form input[type="password"]:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(132, 204, 22, 0.1);
}

.password-actions {
  display: flex;
  gap: 0.75rem;
  padding: 0 var(--spacing-lg) var(--spacing-lg);
}

.password-actions .action-btn {
  flex: 1;
}

.password-actions .action-btn.save {
  background: linear-gradient(135deg, #84cc16 0%, #65a30d 100%);
  color: white;
  border: 1px solid rgba(132, 204, 22, 0.4);
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.password-actions .action-btn.save:hover {
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  background: linear-gradient(135deg, #a3d636 0%, #84cc16 100%);
}

.password-actions .action-btn.cancel {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  color: var(--text-primary);
  border: 1px solid rgba(132, 204, 22, 0.2);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.password-actions .action-btn.cancel:hover {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-hover) 100%);
  border-color: rgba(132, 204, 22, 0.4);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

.error-message {
  padding: 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.settings-modal {
  max-width: 800px;
}

.settings-tabs {
  display: flex;
  gap: 0.75rem;
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-primary);
  background: linear-gradient(180deg, rgba(26, 46, 31, 0.95) 0%, rgba(26, 46, 31, 0.85) 100%);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
  position: relative;
}

.settings-tabs::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--accent-primary) 50%, 
    transparent 100%);
  opacity: 0.3;
}

.settings-tab {
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.875rem;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.settings-tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.1), 
    transparent);
  transition: left 0.5s ease;
}

.settings-tab:hover::before {
  left: 100%;
}

.settings-tab:hover:not(.active) {
  background: rgba(132, 204, 22, 0.15);
  border-color: rgba(132, 204, 22, 0.4);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(132, 204, 22, 0.2);
}

.settings-tab.active {
  background: var(--gradient-accent);
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 20px rgba(132, 204, 22, 0.4),
              0 0 0 1px rgba(255, 255, 255, 0.1) inset,
              0 0 30px rgba(132, 204, 22, 0.3);
  transform: translateY(-2px);
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.settings-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 3px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 2px 2px 0 0;
  box-shadow: 0 -2px 8px rgba(255, 255, 255, 0.5);
}

.settings-content {
  padding: var(--spacing-lg);
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  /* Custom scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: var(--accent-primary) var(--bg-primary);
}

/* Custom scrollbar for settings content */
.settings-content::-webkit-scrollbar {
  width: 8px;
}

.settings-content::-webkit-scrollbar-track {
  background: var(--bg-primary);
  border-radius: 4px;
}

.settings-content::-webkit-scrollbar-thumb {
  background: var(--gradient-main);
  border-radius: 4px;
  transition: all 0.3s ease;
}

.settings-content::-webkit-scrollbar-thumb:hover {
  background: var(--gradient-accent);
  box-shadow: 0 0 10px rgba(132, 204, 22, 0.5);
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: block;
}

.settings-panel h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--spacing-lg);
  color: var(--text-primary);
}

.phrases-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: var(--spacing-lg);
}

.phrase-item {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
}

.phrase-item input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.phrase-item button {
  padding: 0.5rem 0.75rem;
  background: var(--accent-error);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.phrase-item button:hover {
  background: #dc2626;
  transform: scale(1.05);
}

.add-btn {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--accent-success);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.add-btn:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Services styles */
.services-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: var(--spacing-lg);
}

.service-item {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
}

.service-item input,
.service-item select {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.service-item input:focus,
.service-item select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.service-item button {
  padding: 0.5rem 0.75rem;
  background: var(--accent-error);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.service-item button:hover {
  background: #dc2626;
  transform: scale(1.05);
}

.settings-actions {
  display: flex;
  gap: 0.75rem;
  padding: var(--spacing-lg);
  border-top: 1px solid var(--border-primary);
  flex-shrink: 0;
}

/* Notification System - Minimalist Design */
.notification-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  pointer-events: none;
  max-width: 300px;
}

.notification {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 10px;
  padding: 0.75rem 0.875rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  animation: slideInNotificationMinimal 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 260px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification:hover {
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

/* Progress bar */
.notification-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.6;
  transform-origin: left;
  animation: progressBarMinimal linear forwards;
  z-index: 1;
}

.notification-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.notification:hover .notification-icon {
  transform: scale(1.05);
}

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

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: rgba(248, 250, 252, 0.95);
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.notification-message {
  font-size: 0.75rem;
  color: rgba(203, 213, 225, 0.8);
  line-height: 1.4;
  word-wrap: break-word;
}

.notification-close {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  background: transparent;
  border: none;
  color: rgba(148, 163, 184, 0.6);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 5px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-close svg {
  width: 12px;
  height: 12px;
}

.notification:hover .notification-close {
  opacity: 1;
}

.notification-close:hover {
  color: rgba(239, 68, 68, 0.9);
  background: rgba(239, 68, 68, 0.08);
}

.notification-close:active {
  transform: scale(0.95);
}

/* Type-specific styles with thin borders */
.notification-success {
  border-left: 2px solid rgba(16, 185, 129, 0.4);
}

.notification-success .notification-icon {
  color: #10b981;
}

.notification-success .notification-progress {
  color: #10b981;
}

.notification-error {
  border-left: 2px solid rgba(239, 68, 68, 0.4);
}

.notification-error .notification-icon {
  color: #ef4444;
}

.notification-error .notification-progress {
  color: #ef4444;
}

.notification-warning {
  border-left: 2px solid rgba(245, 158, 11, 0.4);
}

.notification-warning .notification-icon {
  color: #f59e0b;
}

.notification-warning .notification-progress {
  color: #f59e0b;
}

.notification-info {
  border-left: 2px solid rgba(59, 130, 246, 0.4);
}

.notification-info .notification-icon {
  color: #3b82f6;
}

.notification-info .notification-progress {
  color: #3b82f6;
}

.notification-twitch {
  border-left: 2px solid rgba(145, 71, 255, 0.4);
}

.notification-twitch .notification-icon {
  color: #9147ff;
}

.notification-twitch .notification-progress {
  color: #9147ff;
}

/* Smooth animations */
@keyframes slideInNotificationMinimal {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutNotificationMinimal {
  from {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
  to {
    transform: translateX(100%) scale(0.95);
    opacity: 0;
  }
}

@keyframes progressBarMinimal {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.notification-removing {
  animation: slideOutNotificationMinimal 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* Responsive */
/* Адаптивность для органичной компоновки */
@media (max-width: 1400px) {
  .main-container-wrapper {
    grid-template-columns: 280px 1fr 260px;
    gap: 1rem;
  }
  
  .left-sidebar,
  .right-sidebar {
    transform: rotate(0deg); /* Убираем наклоны на средних экранах */
  }
}

@media (max-width: 1280px) {
  .main-container-wrapper {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 1rem;
  }
  
  .left-sidebar {
    grid-column: 1;
    grid-row: 1;
    transform: rotate(0deg);
  }
  
  .content-area {
    grid-column: 1;
    grid-row: 2;
    transform: rotate(0deg);
  }
  
  .right-sidebar {
    grid-column: 1;
    grid-row: 3;
    transform: rotate(0deg);
    align-self: stretch;
  }
}

/* Старые стили удалены - используется новая grid компоновка выше */

@media (max-width: 768px) {
  .main-container-wrapper {
    padding: 0 1rem;
  }

  .header {
    padding: 1rem;
  }
  
  .winner-info {
    flex-direction: column;
    align-items: center;
  }
  
  .winner-stats {
    grid-template-columns: 1fr;
  }
}

/* Utilities */
.text-center {
  text-align: center;
}

.mb-10 {
  margin-bottom: 0.625rem;
}

.mb-20 {
  margin-bottom: 1.25rem;
}

.mt-20 {
  margin-top: 1.25rem;
}

/* Enhanced Design Improvements */

/* Icons */
.settings-btn::before,
.logout-btn::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
}

.settings-btn {
    position: relative;
    min-width: 44px;
}

/* Pulsing effect for active states */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.control-btn:not(:disabled):hover {
  animation: pulse 2s ease-in-out infinite;
}

/* Gradient borders */
.left-sidebar,
.right-sidebar,
.content-area {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
}

.left-sidebar::before,
.right-sidebar::before,
.content-area::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(101, 163, 13, 0.3), rgba(132, 204, 22, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.left-sidebar:hover::before,
.right-sidebar:hover::before,
.content-area:hover::before {
  opacity: 1;
}

/* Smooth transitions */
* {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading states */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Improved logo */
/* Override old logo styles for login */
.login-header .login-logo {
  background: none;
  box-shadow: none;
  animation: none;
}

.header .logo {
  background: var(--gradient-main);
  box-shadow: 
    0 0 30px rgba(132, 204, 22, 0.4),
    0 0 60px rgba(118, 75, 162, 0.2);
  animation: logoFloat 3s ease-in-out infinite;
}

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

/* Enhanced particles background - Disabled */
#particles-js {
  display: none;
  background: radial-gradient(ellipse at top, rgba(132, 204, 22, 0.1) 0%, transparent 50%);
}

/* Better focus rings */
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Skeleton loading */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 0px,
    var(--bg-tertiary) 40px,
    var(--bg-secondary) 80px
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* Card hover effects */
.winner-item,
.chat-message,
.phrase-item {
  position: relative;
  overflow: hidden;
}

.winner-item::after,
.chat-message::after,
.phrase-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
    width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.05),
    transparent
  );
  transition: left 0.5s ease;
}

.winner-item:hover::after,
.chat-message:hover::after,
.phrase-item:hover::after {
  left: 100%;
}

/* Counter animation */
.participants-count {
  position: relative;
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* Pulse animation removed - no visual effect on update */

/* Status indicator */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.5rem;
  animation: pulse 2s ease-in-out infinite;
}

.status-dot.online {
  background: var(--accent-success);
  box-shadow: 0 0 8px var(--accent-success);
}

.status-dot.offline {
  background: var(--accent-error);
  box-shadow: 0 0 8px var(--accent-error);
}

/* Better scrollbar design */
.left-sidebar::-webkit-scrollbar-thumb,
.right-sidebar::-webkit-scrollbar-thumb,
.content-area::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
}

/* Enhanced notifications */
.notification {
  box-shadow: 
    var(--shadow-xl),
    0 0 40px rgba(132, 204, 22, 0.2);
}

.notification:hover {
  transform: translateX(-4px);
  box-shadow: 
    var(--shadow-xl),
    0 0 50px rgba(132, 204, 22, 0.3);
}

/* Glass effect enhancement */
.login-container,
.left-sidebar,
.right-sidebar,
.content-area,
.modal-content {
  background: linear-gradient(
    135deg,
    rgba(26, 46, 31, 0.95) 0%,
    rgba(36, 56, 42, 0.9) 100%
  );
}

/* Improved button interactions */
.control-btn {
  position: relative;
  overflow: hidden;
}

.control-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.control-btn:active::before {
  width: 300px;
  height: 300px;
}

/* Tab indicator animation */
.toggle-btn.active {
  position: relative;
}

.toggle-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: white;
  border-radius: 2px;
  animation: expand 0.3s ease;
}

@keyframes expand {
  from {
    width: 0;
  }
  to {
    width: 40px;
  }
}

/* Header improvements */
.header {
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 0 20px rgba(132, 204, 22, 0.05);
}

/* Better logo in header */
.header h1 {
  position: relative;
}

.header h1::after {
  content: '🎮';
  position: absolute;
  right: -2rem;
  font-size: 1.25rem;
  opacity: 0.5;
  animation: bounce 2s ease-in-out infinite;
}

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

/* Improved winner avatar */
.winner-avatar {
  position: relative;
  border: 3px solid var(--accent-primary);
}

/* Crown removed */



/* Smooth number transitions */
#participantsCount,
.mTimer {
  transition: all 0.3s ease;
  color: #ffffff !important;
  font-size: 1.5rem;
  font-weight: 700;
}

/* Text color utilities for winner modal */
.text-slate-400 {
  color: #e5e7eb !important;
}

.winner-modal .text-slate-400 {
  color: #e5e7eb !important;
}

/* Enhanced modal backdrop */
.modal {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
}

/* Better form inputs */
.form-group input:hover,
.form-group select:hover {
  border-color: var(--accent-primary);
}

/* Active giveaway button */
.startGiveawayBtn[style*="background: rgb(239, 68, 68)"] {
  animation: pulse 2s ease-in-out infinite;
}

/* Improved tab buttons */
.tab-buttons {
  background: transparent;
}

/* ============================================
   PREMIUM DESIGN ENHANCEMENTS
   ============================================ */

/* Animated gradient backgrounds for cards */
.left-sidebar,
.right-sidebar,
.content-area {
  position: relative;
  overflow: hidden;
}

.left-sidebar::before,
.right-sidebar::before,
.content-area::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(132, 204, 22, 0.1) 0%,
    transparent 70%
  );
  animation: rotate 20s linear infinite;
  pointer-events: none;
  z-index: 0;
}

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

.left-sidebar > *,
.right-sidebar > *,
.content-area > * {
  position: relative;
  z-index: 1;
}

/* Premium button styles with shine effect */
.control-btn {
  position: relative;
  overflow: hidden;
}

.control-btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 70%
  );
  transform: translateX(-100%) translateY(-100%) rotate(45deg);
  transition: transform 0.6s ease;
}

.control-btn:hover::before {
  transform: translateX(100%) translateY(100%) rotate(45deg);
}

/* Glowing borders on focus */
.control-btn:focus-visible,
.action-btn:focus-visible,
.toggle-btn:focus-visible {
  box-shadow:
    0 0 0 3px rgba(132, 204, 22, 0.3),
    0 0 20px rgba(132, 204, 22, 0.5),
    inset 0 0 20px rgba(132, 204, 22, 0.1);
}

/* Premium winner items with hover gradient */
.winner-item {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  transition: all var(--timing-base) var(--easing-standard);
}

.winner-item:hover {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
  transform: translateY(-4px);
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(132, 204, 22, 0.2);
}

/* Enhanced chat messages with backdrop blur */
.chat-message {
  backdrop-filter: blur(10px);
  transition: all var(--timing-fast) var(--easing-standard);
}

.chat-message:hover {
  background: rgba(132, 204, 22, 0.05);
  transform: translateX(4px);
}

/* Premium stat cards with glow effect */
.stat {
  position: relative;
  padding: 0.75rem;
  background: rgba(132, 204, 22, 0.05);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(132, 204, 22, 0.1);
  transition: all 0.3s ease;
}

.stat:hover {
  background: rgba(132, 204, 22, 0.1);
  border-color: rgba(132, 204, 22, 0.3);
  box-shadow: 0 0 15px rgba(132, 204, 22, 0.2);
}

.stat-value {
  font-weight: 700;
  color: #ffffff !important;
  text-shadow: 0 0 10px rgba(132, 204, 22, 0.3);
}

/* Premium modal with animated border */
.modal-content {
  position: relative;
  overflow: hidden;
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: var(--gradient-main);
  animation: slideBorder 2s ease-in-out infinite;
}

@keyframes slideBorder {
  0%, 100% { left: -100%; }
  50% { left: 100%; }
}

/* Beautiful loading animation for buttons */
.btn-loading::after {
  width: 20px;
  height: 20px;
  border-width: 3px;
}

/* Premium checkbox and radio styles */
input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-primary);
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
}

input[type="checkbox"]:checked::before,
input[type="radio"]:checked::before {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
  font-size: 14px;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background: var(--gradient-accent);
  border-color: var(--accent-primary);
}

/* Enhanced scrollbar with gradient */
.left-sidebar::-webkit-scrollbar,
.right-sidebar::-webkit-scrollbar,
.content-area::-webkit-scrollbar {
  width: 8px;
}

.left-sidebar::-webkit-scrollbar-track,
.right-sidebar::-webkit-scrollbar-track,
.content-area::-webkit-scrollbar-track {
  background: var(--bg-primary);
  border-radius: 4px;
}

.left-sidebar::-webkit-scrollbar-thumb,
.right-sidebar::-webkit-scrollbar-thumb,
.content-area::-webkit-scrollbar-thumb {
  background: var(--gradient-main);
  border-radius: 4px;
  transition: all 0.3s ease;
}

.left-sidebar::-webkit-scrollbar-thumb:hover,
.right-sidebar::-webkit-scrollbar-thumb:hover,
.content-area::-webkit-scrollbar-thumb:hover {
  background: var(--gradient-accent);
  box-shadow: 0 0 10px rgba(132, 204, 22, 0.5);
}

/* Premium notification animations */
.notification {
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.notification::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-accent);
  transform: scaleX(0);
  animation: progressBar linear forwards;
}

@keyframes progressBar {
  to { transform: scaleX(1); }
}

.notification-success {
  --progress-color: var(--accent-success);
}

.notification-error {
  --progress-color: var(--accent-error);
}

.notification-twitch {
  --progress-color: #84cc16;
}

/* Premium chat badges with glow */
.chat-badge {
  background: var(--gradient-accent) !important;
  box-shadow: 0 0 10px rgba(132, 204, 22, 0.4);
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 10px rgba(132, 204, 22, 0.4); }
  50% { box-shadow: 0 0 20px rgba(132, 204, 22, 0.8); }
}

/* Beautiful input focus states */
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-primary);
  box-shadow:
    0 0 0 3px rgba(132, 204, 22, 0.1),
    0 0 20px rgba(132, 204, 22, 0.2);
}

/* Premium modal close button with rotation */
.modal-btn.close:hover {
  transform: rotate(90deg);
  background: var(--accent-error);
}

.modal-btn.minimize:hover,
.modal-btn.maximize:hover {
  background: var(--accent-warning);
}

/* Beautiful winner stats grid */
.winner-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
}

/* Premium responsive improvements */
@media (max-width: 1200px) {
  .winner-stats {
    grid-template-columns: 1fr;
  }
}

/* Smooth page transitions */
body {
  transition: opacity 0.3s ease;
}

body.loading {
  opacity: 0.5;
}

/* Premium color-coded winner cards */
.winner-item:nth-child(1) {
  border-left: 4px solid #ffd700;
}

.winner-item:nth-child(2) {
  border-left: 4px solid #c0c0c0;
}

.winner-item:nth-child(3) {
  border-left: 4px solid #cd7f32;
}

/* Beautiful gradient text for headers */
h1, h2, h3 {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Premium empty states - Enhanced */
.winners-empty,
.chat-empty,
.leaderboard-empty,
.participants-empty {
  padding: var(--spacing-2xl) var(--spacing-xl);
  text-align: center;
  color: var(--text-tertiary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  min-height: 200px;
}

.winners-empty::before,
.chat-empty::before,
.leaderboard-empty::before,
.participants-empty::before {
  content: '📭';
  display: block;
  font-size: 3rem;
  margin-bottom: var(--spacing-sm);
  opacity: 0.6;
  animation: float 3s ease-in-out infinite;
}

.winners-empty-text,
.chat-empty-text,
.leaderboard-empty-text,
.participants-empty-text {
  font-size: var(--font-base);
  color: var(--text-secondary);
  font-weight: 500;
  font-style: normal;
}

.winners-empty-subtext,
.chat-empty-subtext,
.leaderboard-empty-subtext,
.participants-empty-subtext {
  font-size: var(--font-sm);
  color: var(--text-tertiary);
  margin-top: var(--spacing-xs);
  font-style: italic;
}

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

/* Enhanced participants counter */
.participants-count {
  font-size: 1.125rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  background: rgba(132, 204, 22, 0.1);
  border-radius: var(--radius-md);
  border: 1px solid rgba(132, 204, 22, 0.2);
}

#participantsCount {
  font-weight: 700;
  color: var(--accent-primary);
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Panel Content */
.panel-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.panel-content.hidden {
  display: none;
}

/* Wheel Container */
.wheel-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
}

.wheel-wrapper {
  position: relative;
  width: 270px;
  height: 270px;
  margin: 0 auto;
}

#wheelCanvas {
  border-radius: 50%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), inset 0 0 20px rgba(0, 0, 0, 0.1);
}

.wheel-pointer {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.75rem;
  color: var(--accent-error);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  z-index: 10;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
}

.wheel-spin-btn {
  width: 100%;
  padding: var(--spacing-md) var(--spacing-lg);
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  border: none;
  border-radius: var(--radius-lg);
  color: white;
  cursor: pointer;
  transition: all var(--timing-base) var(--easing-standard);
  font-size: var(--font-base);
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(132, 204, 22, 0.3);
}

.wheel-spin-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(132, 204, 22, 0.4);
}

.wheel-spin-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus), 0 6px 20px rgba(132, 204, 22, 0.4);
}

.wheel-spin-btn:active:not(:disabled) {
  transform: translateY(-1px);
}

.wheel-spin-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.wheel-result {
  min-height: 2rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-primary);
  animation: fadeIn 0.3s ease;
}

.wheel-result.has-result {
  background: var(--bg-secondary);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent-primary);
  box-shadow: 0 0 20px rgba(132, 204, 22, 0.3);
}

/* Winners History Modal Styles */
.winners-history-modal {
  max-width: 900px;
  width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.winners-history-filters {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--border-primary);
  background: rgba(26, 46, 31, 0.5);
  flex-shrink: 0;
}

.search-group {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.history-search-input {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.history-search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(132, 204, 22, 0.1);
}

.history-search-input::placeholder {
  color: var(--text-tertiary);
}

.filter-group {
  display: flex;
  gap: var(--spacing-sm);
}

.history-filter-select {
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  background: rgba(26, 46, 31, 0.8);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 180px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2384cc16' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
}

.history-filter-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  background-color: rgba(26, 46, 31, 0.9);
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2384cc16' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  box-shadow: 0 0 0 3px rgba(132, 204, 22, 0.1);
}

.history-filter-select:hover {
  border-color: var(--accent-primary);
  background-color: rgba(26, 46, 31, 0.9);
}

.history-filter-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border: none;
}

.history-filter-select option:hover {
  background: rgba(132, 204, 22, 0.2);
}

.history-filter-select option:checked {
  background: var(--accent-primary);
  color: white;
}

/* Super Admin Styles */
.super-admin-only.hidden {
  display: none !important;
}

/* Sessions Styles */
.sessions-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.session-header, .session-row {
  display: grid;
  grid-template-columns: 1.5fr 2fr 1.5fr 1.8fr 1.8fr 1fr 1fr;
  gap: 1rem;
  padding: 0.75rem 1rem;
  align-items: center;
}

.session-header {
  background: rgba(132, 204, 22, 0.1);
  border-bottom: 2px solid var(--accent-primary);
  font-weight: 600;
  color: var(--text-primary);
}

.session-row {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}

.session-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-primary);
}

.session-row.current {
  background: rgba(132, 204, 22, 0.1);
  border-color: var(--accent-primary);
}

.current-badge {
  color: var(--accent-primary);
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* Highlighted Users Styles */
.highlighted-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.highlighted-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.highlighted-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-primary);
  transform: translateX(4px);
}

.highlighted-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.highlighted-username {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}

.highlighted-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  color: #ffffff;
  opacity: 0.9;
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.highlighted-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.highlighted-actions {
  display: flex;
  gap: 0.5rem;
}

.action-btn.small {
  padding: 0.4rem 0.6rem;
  font-size: 0.875rem;
  min-width: auto;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-style: italic;
}

.status-badge.status-active {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-badge.status-inactive {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Audit Log Styles */
.audit-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.audit-filters .action-btn {
  padding: 0.75rem 1.5rem;
  background: rgba(132, 204, 22, 0.2);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.audit-filters .action-btn:hover {
  background: var(--accent-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(132, 204, 22, 0.3);
}

.audit-filter {
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  background: rgba(26, 46, 31, 0.8);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  flex: 1;
  min-width: 200px;
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2384cc16' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
}

.audit-filter:hover {
  border-color: var(--accent-primary);
  background-color: rgba(26, 46, 31, 0.95);
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2384cc16' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.audit-filter:focus {
  outline: none;
  border-color: var(--accent-primary);
  background-color: rgba(26, 46, 31, 0.95);
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2384cc16' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  box-shadow: 0 0 0 3px rgba(132, 204, 22, 0.15);
  transform: translateY(-1px);
}

input.audit-filter {
  background-image: none !important;
  padding: 0.75rem 1rem;
}

input.audit-filter::placeholder {
  color: var(--text-tertiary);
}

input.audit-filter:focus {
  background-image: none !important;
}

select.audit-filter {
  /* Keep background image for select only */
}

.audit-filter option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border: none;
  font-weight: 500;
}

.audit-filter option:hover {
  background: rgba(132, 204, 22, 0.2);
}

.audit-filter option:checked {
  background: var(--accent-primary);
  color: white;
}

.audit-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 500px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Ensure audit-list container is visible */
.audit-list {
  min-height: 200px;
  position: relative;
}

.audit-header, .audit-row {
  display: grid;
  grid-template-columns: 1.5fr 1.5fr 1fr 3fr 1.5fr;
  gap: 1rem;
  padding: 0.75rem 1rem;
  align-items: center;
}

.audit-header {
  background: rgba(132, 204, 22, 0.1);
  border-bottom: 2px solid var(--accent-primary);
  font-weight: 600;
  color: var(--text-primary);
  position: sticky;
  top: 0;
  z-index: 10;
}

.audit-loading-more {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
}

.audit-row {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}

.audit-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-primary);
}

.audit-action-type {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: rgba(132, 204, 22, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--accent-primary);
}

.audit-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem;
}

.pagination button {
  padding: 0.5rem 1rem;
  background: rgba(132, 204, 22, 0.2);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.pagination button:hover {
  background: var(--accent-primary);
  transform: translateY(-2px);
}

.pagination span {
  color: var(--text-secondary);
  font-weight: 500;
}

.pagination-info {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: 0.5rem;
}

/* Admins Styles */
.admins-controls {
  margin-bottom: 1rem;
}

.admins-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-header, .admin-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1.5fr 1.5fr;
  gap: 1rem;
  padding: 0.75rem 1rem;
  align-items: center;
}

.admin-header {
  background: rgba(132, 204, 22, 0.1);
  border-bottom: 2px solid var(--accent-primary);
  font-weight: 600;
  color: var(--text-primary);
}

.admin-row {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}

.admin-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-primary);
}

.admin-row:hover .role-select {
  border-color: var(--accent-primary);
}

.role-select {
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  background: rgba(26, 46, 31, 0.8);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-width: 180px;
  position: relative;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2384cc16' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
}

.role-select:hover {
  border-color: var(--accent-primary);
  background-color: rgba(26, 46, 31, 0.95);
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2384cc16' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.role-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  background-color: rgba(26, 46, 31, 0.95);
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2384cc16' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  box-shadow: 0 0 0 3px rgba(132, 204, 22, 0.15);
  transform: translateY(-1px);
}

.role-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border: none;
  font-weight: 500;
}

.role-select option:hover {
  background: rgba(132, 204, 22, 0.2);
}

.role-select option:checked {
  background: var(--accent-primary);
  color: white;
}

.btn-danger {
  padding: 0.5rem 1rem;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid var(--accent-error);
  border-radius: var(--radius-md);
  color: var(--accent-error);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.875rem;
}

.btn-danger:hover {
  background: var(--accent-error);
  color: white;
  transform: translateY(-2px);
}

.loading, .empty, .error {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.error {
  color: var(--accent-error);
}

.winners-history-count {
  padding: var(--spacing-sm) var(--spacing-md);
  background: rgba(26, 46, 31, 0.3);
  border-bottom: 1px solid var(--border-primary);
  color: var(--text-secondary);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.winners-history-count span {
  color: var(--accent-primary);
  font-weight: 600;
}

.winners-history-list-container {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.winners-history-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.winners-loading-more {
  text-align: center;
  padding: 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border-primary);
  margin-top: 0.5rem;
  border-radius: var(--radius-md);
}

/* Custom scrollbar for winners history list */
.winners-history-list::-webkit-scrollbar {
  width: 8px;
}

.winners-history-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
}

.winners-history-list::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: var(--radius-sm);
  transition: background 0.3s ease;
}

.winners-history-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

/* Winner item in history modal */
.winners-history-list .winner-item {
  background: rgba(26, 46, 31, 0.6);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  cursor: default;
  transition: all 0.3s ease;
  position: relative;
  overflow: visible;
}

.winners-history-list .winner-item:hover {
  background: rgba(132, 204, 22, 0.05);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(132, 204, 22, 0.1);
  border-color: var(--border-primary) !important; /* Переопределяем глобальный border-color */
}

/* Отключаем псевдоэлемент ::after для истории победителей */
.winners-history-list .winner-item::after {
  display: none !important;
}

.winners-history-list .winner-telegram {
  margin-left: var(--spacing-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Стили для элементов внутри winner-item в истории победителей */
.winners-history-list .winner-item .winner-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.winners-history-list .winner-item .winner-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
  flex: 1;
}

.winners-history-list .winner-item .winner-date {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.winners-history-list .winner-item .winner-info-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.winners-history-list .winner-item .winner-service {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.winners-history-list .winner-item .winner-telegram {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0;
}

.winners-history-list .winner-item .winner-amounts {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 0.5rem;
}

.winners-history-list .winner-item .winner-deposit,
.winners-history-list .winner-item .winner-winning {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.winners-history-list .winner-item .winner-winning {
  color: var(--accent-success);
  font-weight: 500;
}

/* Participants Modal Styles */
.participants-modal {
  max-width: 700px;
  width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.participants-modal-controls {
  display: flex;
  flex-direction: row;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--border-primary);
  background: rgba(26, 46, 31, 0.5);
  flex-shrink: 0;
  align-items: flex-end;
}

.participants-search-group {
  flex: 1;
  min-width: 200px;
}

.participants-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.participants-search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(132, 204, 22, 0.1);
}

.participants-search-input::placeholder {
  color: var(--text-tertiary);
}

.participants-sort-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.participants-sort-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  white-space: nowrap;
}

.participants-sort-select {
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  background: rgba(26, 46, 31, 0.8);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 200px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2384cc16' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
}

.participants-sort-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  background-color: rgba(26, 46, 31, 0.9);
  box-shadow: 0 0 0 3px rgba(132, 204, 22, 0.1);
}

.participants-sort-select:hover {
  border-color: var(--accent-primary);
  background-color: rgba(26, 46, 31, 0.9);
}

.participants-sort-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
}

.participants-count-info {
  padding: var(--spacing-sm) var(--spacing-md);
  background: rgba(26, 46, 31, 0.3);
  border-bottom: 1px solid var(--border-primary);
  color: var(--text-secondary);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.participants-count-info span {
  color: var(--accent-primary);
  font-weight: 600;
}

.participants-list-container {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.participants-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.participants-empty {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.participant-item {
  background: rgba(26, 46, 31, 0.6);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.participant-item:hover {
  background: rgba(132, 204, 22, 0.05);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(132, 204, 22, 0.1);
  border-color: var(--border-primary);
}

.participant-username {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9375rem;
  flex: 1;
}

.participants-actions {
  padding: var(--spacing-md);
  border-top: 1px solid var(--border-primary);
  background: rgba(26, 46, 31, 0.3);
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}

/* Custom scrollbar for participants list */
.participants-list::-webkit-scrollbar {
  width: 8px;
}

.participants-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
}

.participants-list::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: var(--radius-sm);
  transition: background 0.3s ease;
}

.participants-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

/* Cleanup Settings Styles */
.cleanup-section {
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-lg);
  background: rgba(26, 46, 31, 0.3);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
}

.cleanup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.cleanup-header h5 {
  margin: 0;
  font-size: 1.125rem;
  color: var(--text-primary);
}

.action-btn.small {
  padding: 0.375rem;
  font-size: 0.875rem;
  min-width: auto;
  width: 2rem;
  height: 2rem;
  background: rgba(132, 204, 22, 0.1);
  border: 1px solid rgba(132, 204, 22, 0.3);
  color: var(--text-secondary);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.action-btn.small:hover {
  background: rgba(132, 204, 22, 0.2);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(132, 204, 22, 0.2);
}

.cleanup-stats {
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-md);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
}

.cleanup-stat-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cleanup-stat-item:last-child {
  border-bottom: none;
}

.cleanup-stat-item span {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.cleanup-stat-item strong {
  color: var(--text-primary);
  font-weight: 600;
}

.cleanup-controls {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.cleanup-controls .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cleanup-controls label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.cleanup-controls input[type="number"] {
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.cleanup-controls input[type="number"]:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(132, 204, 22, 0.1);
}

.cleanup-controls select {
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  background: rgba(26, 46, 31, 0.95);
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2384cc16' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

.cleanup-controls select:hover {
  border-color: var(--accent-primary);
  background-color: rgba(26, 46, 31, 0.95);
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2384cc16' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.cleanup-controls select:focus {
  outline: none;
  border-color: var(--accent-primary);
  background-color: rgba(26, 46, 31, 0.95);
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2384cc16' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  box-shadow: 0 0 0 3px rgba(132, 204, 22, 0.15);
  transform: translateY(-1px);
}

.cleanup-controls select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border: none;
  font-weight: 500;
}

.cleanup-controls select option:hover {
  background: rgba(132, 204, 22, 0.2);
}

.cleanup-controls select option:checked {
  background: var(--accent-primary);
  color: white;
}

.action-btn.danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
}

.action-btn.danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
  transform: translateY(-2px);
}

/* Responsive adjustments for history modal */
@media (max-width: 768px) {
  .winners-history-modal {
    width: 95vw;
    max-height: 95vh;
  }
  
  .search-group {
    flex-direction: column;
  }
  
  .history-search-input {
    min-width: 100%;
  }
  
  .filter-group {
    flex-direction: column;
  }
  
  .history-filter-select {
    width: 100%;
  }
}

/* Premium mobile responsiveness */
@media (max-width: 768px) {
  .left-sidebar,
  .right-sidebar,
  .content-area {
    margin: 0;
    border-radius: 0;
  }
  
  .control-btn {
    font-size: 0.875rem;
    padding: 0.75rem;
  }
}

/* Bonus Modal Styles */
/* Coin Flip Modal Styles - Minimalist Design */
.coin-flip-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  padding: 3rem;
}

#coinFlipModal .coin-wrapper {
  perspective: 1200px;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#coinFlipModal .coin {
  width: 180px;
  height: 180px;
  position: relative;
  transform-style: preserve-3d;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#coinFlipModal .coin-face {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(148, 163, 184, 0.2);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.2),
    0 1px 3px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#coinFlipModal .coin:hover .coin-face {
  border-color: rgba(148, 163, 184, 0.3);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.25),
    0 2px 4px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.coin-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.coin-letter {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(248, 250, 252, 0.95);
  letter-spacing: -0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.coin-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(203, 213, 225, 0.7);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#coinFlipModal .coin-front {
  transform: rotateY(0deg);
}

#coinFlipModal .coin-front .coin-letter {
  color: rgba(16, 185, 129, 0.9);
}

#coinFlipModal .coin-back {
  transform: rotateY(180deg);
}

#coinFlipModal .coin-back .coin-letter {
  color: rgba(148, 163, 184, 0.8);
}

/* Animation for flipping - eagle result */
#coinFlipModal .coin.flipping.eagle-result {
  animation: coin-flip-eagle-minimal 2s cubic-bezier(0.4, 0, 0.2, 1);
  animation-fill-mode: forwards;
}

/* Animation for flipping - tails result */
#coinFlipModal .coin.flipping.tails-result {
  animation: coin-flip-tails-minimal 2s cubic-bezier(0.4, 0, 0.2, 1);
  animation-fill-mode: forwards;
}

/* Result animation */
.coin-result {
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) 1.8s;
  color: rgba(248, 250, 252, 0.9);
  letter-spacing: 0.02em;
}

.coin-result.show {
  opacity: 1;
  transform: translateY(0);
}

.coin-result.eagle {
  color: rgba(16, 185, 129, 0.9);
}

.coin-result.tails {
  color: rgba(148, 163, 184, 0.8);
}

/* Smooth flip animations */
@keyframes coin-flip-eagle-minimal {
  0% {
    transform: rotateY(0deg);
  }
  50% {
    transform: rotateY(1080deg);
  }
  100% {
    transform: rotateY(1080deg);
  }
}

@keyframes coin-flip-tails-minimal {
  0% {
    transform: rotateY(0deg);
  }
  50% {
    transform: rotateY(1080deg);
  }
  100% {
    transform: rotateY(1260deg);
  }
}

/* ============================================
   SVG ICONS STYLES
   ============================================ */

.icon {
  width: 1.25em;
  height: 1.25em;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.5rem;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

/* Icon sizes */
.icon-sm {
  width: 1em;
  height: 1em;
}

.icon-lg {
  width: 1.5em;
  height: 1.5em;
}

.icon-xl {
  width: 2em;
  height: 2em;
}

/* Icon animations on hover */
.control-btn:hover .icon,
.action-btn:hover .icon,
.wheel-spin-btn:hover .icon {
  transform: scale(1.1);
  animation: iconPulse 0.6s ease-in-out;
}

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

/* Spinning icon (for reroll and loading) */
.icon-spin-animation {
  animation: iconRotate 1s linear infinite;
}

@keyframes iconRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Icon colored variants */
.icon-colored {
  fill: var(--accent-primary);
}

.icon-success {
  fill: var(--accent-success);
}

.icon-error {
  fill: var(--accent-error);
}

.icon-warning {
  fill: var(--accent-warning);
}

/* Button layout with icons */
.control-btn,
.action-btn,
.wheel-spin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.control-btn > span,
.action-btn > span,
.wheel-spin-btn > span {
  display: inline-block;
}

/* Icon spacing adjustments */
.control-btn .icon,
.action-btn .icon,
.wheel-spin-btn .icon,
.settings-btn .icon,
.logout-btn .icon,
.modal-btn .icon,
.add-btn .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* Убираем margin-right, так как теперь используется gap в flex */
.control-btn .icon {
  margin-right: 0;
}

/* Remove margin if icon has no sibling span */
.control-btn .icon:only-child,
.action-btn .icon:only-child,
.wheel-spin-btn .icon:only-child,
.settings-btn .icon:only-child,
.modal-btn .icon:only-child,
.add-btn .icon:only-child {
  margin-right: 0;
}

/* Selection Modal Styles */
.selection-modal {
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--spacing-lg);
}

/* Card Pick Modal Styles */
.card-pick-modal {
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.card-pick-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  padding-left: var(--spacing-md); /* Отступ слева для заголовка */
}

/* Selection modal header - только кнопка закрытия справа */
.selection-modal .card-pick-header {
  justify-content: flex-end;
  padding-left: 0;
}

.card-pick-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
}

/* Selection Stage */
.selection-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  gap: var(--spacing-lg);
}

.selection-info {
  text-align: center;
}

.selection-text {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.selection-count {
  font-size: 1rem;
  color: var(--text-secondary);
}

.selection-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
}

/* SVG иконка для заголовка */
.selection-icon {
  width: 24px;
  height: 24px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
  color: var(--accent-primary);
}

.shuffle-animation {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin: var(--spacing-lg) 0;
}

.shuffle-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  box-shadow: 0 0 10px rgba(132, 204, 22, 0.5);
  animation: shuffleWave 1.4s ease-in-out infinite;
}

.shuffle-dot:nth-child(1) {
  animation-delay: 0s;
}

.shuffle-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.shuffle-dot:nth-child(3) {
  animation-delay: 0.4s;
}

.shuffle-dot:nth-child(4) {
  animation-delay: 0.6s;
}

.shuffle-dot:nth-child(5) {
  animation-delay: 0.8s;
}

@keyframes shuffleWave {
  0%, 60%, 100% {
    transform: translateY(0) scale(1);
    opacity: 0.7;
    box-shadow: 0 0 10px rgba(132, 204, 22, 0.5);
  }
  30% {
    transform: translateY(-20px) scale(1.3);
    opacity: 1;
    box-shadow: 0 0 20px rgba(132, 204, 22, 0.8);
  }
}

.selection-result {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.selection-result.show {
  opacity: 1;
  transform: translateY(0);
}

.result-text {
  font-size: 1.5rem;
  color: var(--accent-success);
  font-weight: 600;
  text-align: center;
}

/* Pick Stage */
.pick-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.cards-info {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: var(--spacing-sm);
}

.cards-container {
  display: grid;
  grid-template-columns: repeat(3, 140px);
  justify-content: center;
  align-content: center;
  gap: var(--spacing-md);
  min-height: 300px;
  padding: var(--spacing-lg) var(--spacing-lg) calc(var(--spacing-lg) + 60px);
  position: relative;
  max-width: 100%;
  width: 100%;
}

/* Card Styles */
.card {
  width: 140px;
  height: 200px;
  position: relative;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.7s ease, scale 0.3s ease, opacity 0.3s ease;
  perspective: 1000px;
  flex-shrink: 0;
  margin: 0;
  transform-origin: center center;
}

.card.flipped {
  transform: rotateY(180deg);
}

.card.dimmed {
  opacity: 0.3;
  pointer-events: none;
}

.card.winner {
  transform: scale(1.15); /* Убрали rotateY(180deg) - карта не должна поворачиваться, только масштабироваться */
  z-index: 10;
  box-shadow: 0 0 30px rgba(132, 204, 22, 0.8);
  position: relative;
  transform-origin: center center;
}

/* Карта победителя должна показывать лицевую сторону */
.card.winner .card-front {
  transform: rotateY(0deg) !important; /* Лицевая сторона видна */
  z-index: 2 !important;
}

.card.winner .card-back {
  transform: rotateY(180deg) !important; /* Рубашка скрыта */
  z-index: 1 !important;
}

/* Текст на карте победителя не нужно поворачивать, так как сама карта не поворачивается */
.card.winner .card-front * {
  transform: none; /* Текст должен быть нормально ориентирован */
}

.card.winner::before {
  display: none; /* Текст "ПОБЕДИТЕЛЬ!" убран */
}

.card-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm);
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--border-primary);
  transition: transform 0.7s ease;
  box-sizing: border-box;
}

.card-front {
  background: linear-gradient(135deg, #84cc16 0%, #a3d636 100%);
  transform: rotateY(180deg); /* Скрыт изначально, повернут назад */
  overflow: hidden; /* Предотвращаем выход контента за границы карты */
}

/* Правило для карты победителя (должно быть самым приоритетным) */
.card.winner .card-front,
.card.winner.flipped .card-front {
  transform: rotateY(0deg) !important; /* Карта победителя показывает лицевую сторону */
}

/* Правило для обычных перевернутых карт (не победителей) */
.card.flipped:not(.winner) .card-front {
  transform: rotateY(0deg); /* При перевороте карты, лицевая сторона становится видимой */
}

/* Исключаем карту победителя из общего правила */
.card.flipped:not(.winner) .card-front * {
  transform: rotateY(180deg); /* Обратный поворот содержимого, чтобы текст не был перевернут */
}

.card-back {
  background: linear-gradient(135deg, #1a2e1f 0%, #24382a 100%);
  transform: rotateY(0deg); /* Виден изначально (рубашка) */
  border: 2px solid var(--accent-primary);
  position: relative;
  overflow: hidden;
}

.card.flipped .card-back {
  transform: rotateY(180deg); /* При перевороте карты, рубашка скрывается */
}

.card-back::before {
  content: '🎴';
  position: absolute;
  font-size: 4rem;
  opacity: 0.3;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.card-back::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
}

.card-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.3);
  margin-bottom: var(--spacing-sm);
  object-fit: cover;
  background: var(--bg-secondary);
}

.card-username {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  word-break: break-word;
  max-width: 100%;
  padding: 0 var(--spacing-xs);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Ограничиваем до 2 строк */
  -webkit-box-orient: vertical;
  line-clamp: 2; /* Стандартное свойство для современных браузеров */
  line-height: 1.3;
  max-height: 2.6em; /* Fallback: примерно 2 строки с учетом line-height */
}

.card:hover:not(.flipped):not(.dimmed) {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(132, 204, 22, 0.4);
}

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

.card-pick-controls {
  display: flex;
  justify-content: center;
  margin-top: var(--spacing-lg);
  padding: 0 var(--spacing-md);
}

.card-pick-controls .action-btn {
  min-width: auto;
  width: auto;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 15px rgba(132, 204, 22, 0.3);
  transition: all 0.3s ease;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
}

.card-pick-controls .action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(132, 204, 22, 0.4);
}

.card-pick-controls .action-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(132, 204, 22, 0.3);
}

/* Скрытая кнопка не должна быть кликабельной */
.card-pick-controls .action-btn.hidden {
  display: none !important;
  pointer-events: none;
}

/* Disabled button state for card pick */
.control-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
  .card {
    width: 120px;
    height: 170px;
  }
  
  .cards-container {
    gap: var(--spacing-sm);
  }
  
  .card-pick-modal {
    width: 95%;
  }
}

/* BUNKER Modal Styles */
.bunker-modal {
  max-width: 900px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
}

.bunker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bunker-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #84cc16 0%, #65a30d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bunker-content {
  padding: 1.25rem;
}

.bunker-phase {
  min-height: 350px;
}

.bunker-phase.hidden {
  display: none;
}

/* Selection Phase */
.bunker-selection-info {
  text-align: center;
  margin-bottom: 2rem;
}

.bunker-selection-text {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.bunker-selection-count {
  font-size: 1rem;
  color: var(--text-secondary);
}

.bunker-selection-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  margin-bottom: 2rem;
}

.bunker-shuffle-animation {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
}

.bunker-shuffle-dot {
  width: 12px;
  height: 12px;
  background: #84cc16;
  border-radius: 50%;
  animation: bunker-shuffle-bounce 1.4s ease-in-out infinite;
}

.bunker-shuffle-dot:nth-child(1) {
  animation-delay: 0s;
}

.bunker-shuffle-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.bunker-shuffle-dot:nth-child(3) {
  animation-delay: 0.4s;
}

.bunker-shuffle-dot:nth-child(4) {
  animation-delay: 0.6s;
}

.bunker-shuffle-dot:nth-child(5) {
  animation-delay: 0.8s;
}

@keyframes bunker-shuffle-bounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

.bunker-selection-result {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
  margin-top: 1.5rem;
}

.bunker-selection-result.show {
  opacity: 1;
  transform: translateY(0);
}

.bunker-result-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: #84cc16;
  text-align: center;
}

.bunker-selected-participants {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.bunker-participant-item {
  padding: 0.625rem 0.75rem;
  background: rgba(132, 204, 22, 0.1);
  border: 1px solid rgba(132, 204, 22, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.bunker-participant-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.bunker-participant-item.active {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.bunker-participant-item.active svg {
  color: #10b981;
}

.bunker-participant-item.excluded {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  opacity: 0.6;
  text-decoration: line-through;
}

.bunker-participant-item.excluded svg {
  color: #ef4444;
}

/* Resource Indicators */
.bunker-resources {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  margin-bottom: 1.5rem;
  background: rgba(26, 46, 31, 0.5);
  border-radius: 8px;
  border: 1px solid rgba(132, 204, 22, 0.2);
}

.bunker-resources.hidden {
  display: none;
}

.bunker-resource-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.bunker-resource-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.bunker-resource-bar {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  min-width: 60px;
}

.bunker-resource-fill {
  height: 100%;
  transition: width 0.3s ease, background-color 0.3s ease;
  border-radius: 4px;
}

.bunker-resource-fill.bunker-resource-good {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.bunker-resource-fill.bunker-resource-warning {
  background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.bunker-resource-fill.bunker-resource-critical {
  background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
  animation: pulse-critical 2s infinite;
}

@keyframes pulse-critical {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.bunker-resource-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 45px;
  text-align: right;
}

/* Resource Changes in Results */
.bunker-result-resource-changes {
  text-align: center;
  padding: 0.75rem;
  margin: 0.75rem 0;
  background: rgba(132, 204, 22, 0.1);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border: 1px solid rgba(132, 204, 22, 0.2);
  min-height: 0;
}

.bunker-result-resource-changes.hidden {
  display: none;
  padding: 0;
  margin: 0;
  border: none;
}

.bunker-result-resource-event {
  text-align: center;
  padding: 0.75rem;
  margin: 0.75rem 0;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid;
  min-height: 0;
}

.bunker-result-resource-event.hidden {
  display: none;
  padding: 0;
  margin: 0;
  border: none;
}

.bunker-result-resource-event.bunker-resource-event-positive {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}

.bunker-result-resource-event.bunker-resource-event-negative {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.bunker-result-resource-warning {
  text-align: center;
  padding: 0.75rem;
  margin: 0.75rem 0;
  background: rgba(239, 68, 68, 0.15);
  border-radius: 8px;
  font-size: 0.875rem;
  color: #ef4444;
  font-weight: 600;
  border: 1px solid rgba(239, 68, 68, 0.3);
  animation: pulse-warning 2s infinite;
  min-height: 0;
}

.bunker-result-resource-warning.hidden {
  display: none;
  padding: 0;
  margin: 0;
  border: none;
  animation: none;
}

@keyframes pulse-warning {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* Reading Phase */
.bunker-branch-info {
  text-align: center;
  margin-bottom: 1.5rem;
}

.bunker-branch-number {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.bunker-reading-text {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: rgba(132, 204, 22, 0.05);
  border-radius: 12px;
  border-left: 4px solid #84cc16;
}

.bunker-reading-details {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(132, 204, 22, 0.05);
  border-radius: 8px;
}

.bunker-context-detail {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* Voting Phase */
.bunker-voting-text {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(132, 204, 22, 0.05);
  border-radius: 8px;
  border-left: 4px solid #84cc16;
}

.bunker-voting-timer {
  text-align: center;
  font-size: 1.125rem;
  font-weight: 600;
  color: #84cc16;
  margin-bottom: 1rem;
}

.bunker-voting-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bunker-voting-option {
  padding: 0.875rem 1rem;
  background: rgba(132, 204, 22, 0.1);
  border: 2px solid rgba(132, 204, 22, 0.3);
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.bunker-voting-option:hover {
  background: rgba(132, 204, 22, 0.2);
  border-color: #84cc16;
  transform: translateX(5px);
}

.bunker-option-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #84cc16;
  margin-bottom: 0.375rem;
}

.bunker-option-text {
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.bunker-option-progress {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.375rem;
}

.bunker-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #84cc16 0%, #65a30d 100%);
  transition: width 0.3s ease;
  width: 0%;
}

.bunker-option-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: right;
}

/* Result Phase */
.bunker-result-choice {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  color: #84cc16;
  margin-bottom: 1.5rem;
}

.bunker-result-selected {
  margin-bottom: 1.5rem;
}

.bunker-result-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.bunker-result-participant {
  padding: 0.5rem;
  font-size: 1rem;
  color: var(--text-primary);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.bunker-result-text {
  text-align: center;
  font-size: 1.125rem;
  font-weight: 600;
  padding: 1rem;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  color: #ef4444;
}

.bunker-result-text.bunker-success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.bunker-result-text.bunker-twist {
  background: rgba(132, 204, 22, 0.1);
  color: #65a30d;
}

.bunker-result-remaining {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.bunker-participants-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.bunker-participants-list > div {
  width: 100%;
}

.bunker-active-participants,
.bunker-excluded-participants {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

/* Final Phase */
.bunker-final-text {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: rgba(132, 204, 22, 0.05);
  border-radius: 12px;
  border-left: 4px solid #84cc16;
}

.bunker-finalists-list {
  margin-top: 1.5rem;
}

.bunker-finalists-count {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 1rem;
  background: rgba(132, 204, 22, 0.1);
  border-radius: 8px;
  text-align: center;
}

.bunker-final-voting-title {
  font-size: 1.125rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.bunker-final-voting-timer {
  text-align: center;
  font-size: 1.125rem;
  font-weight: 600;
  color: #84cc16;
  margin-bottom: 1rem;
}

.bunker-final-cards {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  overflow: visible;
}

.bunker-final-card {
  width: 90px;
  height: 120px;
  position: relative;
  perspective: 1000px;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8) translateY(20px);
  animation: cardAppear 0.5s ease-out forwards;
  overflow: visible;
}

.bunker-final-card:nth-child(1) { animation-delay: 0.05s; }
.bunker-final-card:nth-child(2) { animation-delay: 0.1s; }
.bunker-final-card:nth-child(3) { animation-delay: 0.15s; }
.bunker-final-card:nth-child(4) { animation-delay: 0.2s; }
.bunker-final-card:nth-child(5) { animation-delay: 0.25s; }
.bunker-final-card:nth-child(6) { animation-delay: 0.3s; }
.bunker-final-card:nth-child(7) { animation-delay: 0.35s; }
.bunker-final-card:nth-child(8) { animation-delay: 0.4s; }
.bunker-final-card:nth-child(9) { animation-delay: 0.45s; }
.bunker-final-card:nth-child(10) { animation-delay: 0.5s; }

@keyframes cardAppear {
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.bunker-card-back,
.bunker-card-front {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: visible;
  transform-style: preserve-3d;
}

.bunker-card-back {
  background: linear-gradient(135deg, #84cc16 0%, #65a30d 50%, #a3d636 100%);
  box-shadow: 0 4px 16px rgba(132, 204, 22, 0.4), 0 0 0 0 rgba(132, 204, 22, 0);
  transform: rotateY(0deg);
  z-index: 2;
}

.bunker-card-front {
  background: linear-gradient(135deg, #84cc16 0%, #65a30d 50%, #a3d636 100%);
  box-shadow: 0 4px 16px rgba(132, 204, 22, 0.4), 0 0 0 0 rgba(132, 204, 22, 0);
  transform: rotateY(180deg);
  z-index: 1;
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
  text-align: center;
  padding: 0.5rem;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-height: 1.3;
  max-height: calc(100% - 1rem);
}

/* Hover effects only when card is not flipped */
.bunker-final-card:not(.flipped):hover .bunker-card-back,
.bunker-final-card:not(.flipped):hover .bunker-card-front {
  box-shadow: 0 6px 24px rgba(132, 204, 22, 0.5), 0 0 20px rgba(132, 204, 22, 0.3);
  transform: translateY(-4px);
}

.bunker-final-card:not(.flipped):hover .bunker-card-back {
  transform: translateY(-4px) rotateY(0deg);
}

.bunker-final-card:not(.flipped):hover .bunker-card-front {
  transform: translateY(-4px) rotateY(180deg);
}

.bunker-card-icon {
  width: 48px;
  height: 48px;
  color: rgba(255, 255, 255, 0.95);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s ease;
}

.bunker-final-card:hover .bunker-card-icon {
  transform: scale(1.1);
}

.bunker-card-number {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 10px rgba(255, 255, 255, 0.3);
  transition: transform 0.3s ease;
}

.bunker-final-card:hover .bunker-card-number {
  transform: translateX(-50%) scale(1.1);
}

.bunker-final-card.flipped {
  transition: opacity 0.4s ease;
}

.bunker-final-card.flipped .bunker-card-back {
  transform: rotateY(180deg) !important;
  z-index: 1;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.bunker-final-card.flipped .bunker-card-front {
  transform: rotateY(0deg) !important;
  z-index: 2;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  animation: cardFlipReveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s both;
}

/* Override cardFlipReveal for winner - use winnerCardPulse instead */
.bunker-final-card.winner.flipped .bunker-card-front {
  animation: winnerCardPulse 2s ease-in-out infinite 1s, winnerGlow 2s ease-in-out infinite 1s !important;
}

@keyframes cardFlipReveal {
  0% {
    transform: rotateY(0deg) scale(0.95);
  }
  50% {
    transform: rotateY(0deg) scale(1.05);
  }
  100% {
    transform: rotateY(0deg) scale(1);
  }
}

.bunker-final-card.winner {
  z-index: 10;
  animation: winnerPulse 2s ease-in-out infinite;
}

.bunker-final-card.winner .bunker-card-front,
.bunker-final-card.winner .bunker-card-back {
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 50%, #ea580c 100%) !important;
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.8), 0 0 80px rgba(245, 158, 11, 0.6), 0 0 120px rgba(245, 158, 11, 0.4), 0 8px 32px rgba(0, 0, 0, 0.3) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  border-width: 2px !important;
}

/* Winner flipped card front - transform already set above, animation set in override */

.bunker-final-card.winner.flipped .bunker-card-back {
  transform: rotateY(180deg) !important;
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.8), 0 0 80px rgba(245, 158, 11, 0.6), 0 0 120px rgba(245, 158, 11, 0.4), 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

@keyframes winnerGlow {
  0%, 100% {
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.8), 0 0 80px rgba(245, 158, 11, 0.6), 0 0 120px rgba(245, 158, 11, 0.4), 0 8px 32px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 60px rgba(245, 158, 11, 1), 0 0 120px rgba(245, 158, 11, 0.8), 0 0 180px rgba(245, 158, 11, 0.6), 0 8px 32px rgba(0, 0, 0, 0.3);
  }
}

@keyframes winnerPulse {
  0%, 100% {
    transform: scale(1) translateY(0);
  }
  50% {
    transform: scale(1.08) translateY(-8px);
  }
}

/* Prevent hover effects during animations */
.bunker-final-card.flipped:hover .bunker-card-back,
.bunker-final-card.flipped:hover .bunker-card-front {
  transform: none !important;
  box-shadow: inherit !important;
}

@keyframes winnerCardPulse {
  0%, 100% {
    transform: rotateY(0deg) scale(1.05);
  }
  50% {
    transform: rotateY(0deg) scale(1.1);
  }
}

.bunker-final-card.flipped:not(.winner) {
  opacity: 0.5;
  filter: grayscale(0.3);
  transition: opacity 0.4s ease 0.3s, filter 0.4s ease 0.3s;
}

.bunker-final-winner {
  text-align: center;
  padding: 2rem;
}

.bunker-winner-label {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.bunker-winner-name {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #84cc16 0%, #65a30d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bunker-final-voting-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.bunker-final-voting-option {
  padding: 0.625rem 0.75rem;
}

.bunker-final-voting-option .bunker-option-value {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.bunker-final-voting-option .bunker-option-text {
  font-size: 0.75rem;
  line-height: 1.3;
  margin-bottom: 0.375rem;
}

.bunker-final-voting-option .bunker-option-progress {
  height: 5px;
  margin-bottom: 0.25rem;
}

.bunker-final-voting-option .bunker-option-count {
  font-size: 0.6875rem;
}

/* Controls */
.bunker-controls {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.bunker-continue-btn {
  padding: 12px 32px;
  background: linear-gradient(135deg, #84cc16 0%, #65a30d 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(132, 204, 22, 0.3);
}

.bunker-continue-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(132, 204, 22, 0.4);
}

.bunker-continue-btn:active {
  transform: translateY(0);
}

.bunker-continue-btn.hidden {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .bunker-modal {
    width: 98%;
    max-height: 95vh;
  }
  
  .bunker-participants-list {
    grid-template-columns: 1fr;
  }
  
  .bunker-final-cards {
    gap: 0.5rem;
  }
  
  .bunker-final-card {
    width: 70px;
    height: 100px;
  }
  
  .bunker-card-icon {
    width: 40px;
    height: 40px;
  }
  
  .bunker-card-number {
    font-size: 0.9rem;
  }
  
  .bunker-final-voting-options {
    grid-template-columns: 1fr;
  }
}

/* ========== SEA BATTLE STYLES ========== */
.sea-battle-modal {
  max-width: 950px;
  width: 95%;
  max-height: 95vh;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 0;
}

.sea-battle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-primary);
}

.sea-battle-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sea-battle-header-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.sea-battle-content {
  padding: 1.5rem;
}

.sea-battle-phase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.sea-battle-phase.hidden {
  display: none;
}

/* Selection Phase */
.sea-battle-selection-info {
  text-align: center;
}

.sea-battle-selection-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.sea-battle-selection-count {
  font-size: 1rem;
  color: var(--text-secondary);
}

.sea-battle-shuffle-animation {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 2rem 0;
}

.sea-battle-shuffle-dot {
  width: 12px;
  height: 12px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: sea-battle-shuffle 1.4s infinite ease-in-out;
}

.sea-battle-shuffle-dot:nth-child(1) { animation-delay: -0.32s; }
.sea-battle-shuffle-dot:nth-child(2) { animation-delay: -0.16s; }
.sea-battle-shuffle-dot:nth-child(3) { animation-delay: 0s; }
.sea-battle-shuffle-dot:nth-child(4) { animation-delay: 0.16s; }
.sea-battle-shuffle-dot:nth-child(5) { animation-delay: 0.32s; }

@keyframes sea-battle-shuffle {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

.sea-battle-selection-result {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.sea-battle-selection-result.show {
  opacity: 1;
  transform: translateY(0);
}

.sea-battle-result-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
  text-align: center;
}

.sea-battle-selected-participants {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
  width: 100%;
  max-width: 800px;
  margin-top: 1rem;
}

/* Selection Phase - аналогично card-pick */
.sea-battle-selection-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  gap: var(--spacing-lg);
}

.sea-battle-selection-info {
  text-align: center;
}

.sea-battle-selection-text {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.sea-battle-selection-count {
  font-size: 1rem;
  color: var(--text-secondary);
}

.sea-battle-selection-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
}

.sea-battle-shuffle-animation {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin: var(--spacing-lg) 0;
}

.sea-battle-shuffle-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  box-shadow: 0 0 10px rgba(132, 204, 22, 0.5);
  animation: shuffleWave 1.4s ease-in-out infinite;
}

.sea-battle-shuffle-dot:nth-child(1) {
  animation-delay: 0s;
}

.sea-battle-shuffle-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.sea-battle-shuffle-dot:nth-child(3) {
  animation-delay: 0.4s;
}

.sea-battle-shuffle-dot:nth-child(4) {
  animation-delay: 0.6s;
}

.sea-battle-shuffle-dot:nth-child(5) {
  animation-delay: 0.8s;
}

.sea-battle-selection-result {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.sea-battle-selection-result.show {
  opacity: 1;
  transform: translateY(0);
}

.sea-battle-result-text {
  font-size: 1.5rem;
  color: var(--accent-success);
  font-weight: 600;
  text-align: center;
}

/* Placement Phase */
.sea-battle-placement-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

/* Playing Phase */

.sea-battle-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-height: 90px;
}

.sea-battle-stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.sea-battle-stat-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  border-color: rgba(132, 204, 22, 0.5);
}

.sea-battle-stat-item:hover::before {
  opacity: 1;
}

.sea-battle-stat-icon {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
  z-index: 1;
  position: relative;
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
}

.sea-battle-stat-item:hover .sea-battle-stat-icon {
  transform: scale(1.1);
  color: var(--accent-primary);
}

.sea-battle-stat-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex: 1;
  z-index: 1;
  position: relative;
  width: 100%;
  text-align: center;
}

.sea-battle-stat-label {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  line-height: 1.2;
  width: 100%;
}

.sea-battle-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  transition: all 0.3s ease;
  text-align: center;
  font-variant-numeric: tabular-nums;
  width: 100%;
  color: var(--text-primary);
}

/* Animation for value changes */
@keyframes sea-battle-stat-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

.sea-battle-stat-value.updated {
  animation: sea-battle-stat-pulse 0.4s ease;
}

.sea-battle-active-participants {
  width: 100%;
  max-width: 500px;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
}

.sea-battle-active-participants-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  text-align: center;
}

.sea-battle-active-participants-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  justify-content: center;
  align-items: center;
}

.sea-battle-participant-tag {
  display: inline-block;
  padding: 0.375rem 0.625rem;
  background: rgba(132, 204, 22, 0.12);
  border: 1px solid rgba(132, 204, 22, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  line-height: 1.2;
  max-width: 150px;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: default;
}

.sea-battle-participant-tag::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transition: left 0.4s ease;
}

.sea-battle-participant-tag:hover {
  background: rgba(132, 204, 22, 0.2);
  border-color: rgba(132, 204, 22, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(132, 204, 22, 0.15);
}

.sea-battle-participant-tag:hover::before {
  left: 100%;
}

.sea-battle-participant-tag.removing {
  animation: sea-battle-participant-remove 0.4s ease forwards;
}

@keyframes sea-battle-participant-remove {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.9);
  }
  100% {
    opacity: 0;
    transform: scale(0.8);
    max-height: 0;
    padding: 0;
    margin: 0;
  }
}

.sea-battle-result-message {
  min-height: 56px;
  padding: 0.875rem 1.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  max-width: 100%;
}

.sea-battle-result-message.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.sea-battle-result-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.sea-battle-result-message.show .sea-battle-result-icon {
  animation: sea-battle-icon-pulse 0.5s ease;
}

@keyframes sea-battle-icon-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

.sea-battle-result-text-content {
  font-weight: 600;
  letter-spacing: 0.5px;
}

.sea-battle-result-message.hit {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.sea-battle-result-message.hit .sea-battle-result-icon {
  color: #ef4444;
}

.sea-battle-result-message.miss {
  background: rgba(132, 204, 22, 0.12);
  border-color: rgba(132, 204, 22, 0.4);
  color: #a5b4fc;
  box-shadow: 0 2px 8px rgba(132, 204, 22, 0.15);
}

.sea-battle-result-message.miss .sea-battle-result-icon {
  color: #84cc16;
}

.sea-battle-field-container {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
}

.sea-battle-grid {
  display: inline-block;
  background: var(--bg-tertiary);
  border: 2px solid rgba(132, 204, 22, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}


.sea-battle-row {
  display: flex;
}

.sea-battle-header-row {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: flex-start;
}

.sea-battle-header-row > div:first-child {
  width: 30px;
  height: 30px;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.sea-battle-header-cell {
  width: 55px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
  flex-shrink: 0;
}

.sea-battle-row-label {
  width: 30px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-right: 0.5rem;
  text-align: center;
  flex-shrink: 0;
}

.sea-battle-cell {
  width: 55px;
  height: 55px;
  border: 2px solid var(--border-primary);
  background: rgba(132, 204, 22, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78125rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.sea-battle-cell-number {
  font-variant-numeric: tabular-nums;
  text-align: center;
  line-height: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sea-battle-cell:hover:not(.sea-battle-cell-shot) {
  background: rgba(132, 204, 22, 0.2);
  border-color: var(--accent-primary);
  transform: scale(1.05);
}

.sea-battle-cell-shot {
  cursor: not-allowed;
}

.sea-battle-cell-shot .sea-battle-cell-number {
  opacity: 0.3;
}

.sea-battle-cell-hit {
  background: rgba(239, 68, 68, 0.3) !important;
  border-color: var(--accent-error) !important;
  color: var(--accent-error) !important;
}

.sea-battle-cell-miss {
  background: rgba(156, 163, 175, 0.2) !important;
  border-color: var(--text-tertiary) !important;
  color: var(--text-tertiary) !important;
}

.sea-battle-cell-ship {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: var(--accent-success) !important;
  position: relative;
}

.sea-battle-cell-ship::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M3 18L5 12L9 14L15 8L19 10L21 6' stroke='%2310b981' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M3 18L21 18' stroke='%2310b981' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='6' cy='15' r='1.5' fill='%2310b981'/%3E%3Ccircle cx='12' cy='12' r='1.5' fill='%2310b981'/%3E%3Ccircle cx='18' cy='9' r='1.5' fill='%2310b981'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.6;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Explosion Animation */
.sea-battle-explosion {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
}

.sea-battle-explosion::before,
.sea-battle-explosion::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.8) 0%, rgba(239, 68, 68, 0) 70%);
  transform: translate(-50%, -50%);
  animation: sea-battle-explode 0.6s ease-out forwards;
}

.sea-battle-explosion::after {
  animation-delay: 0.1s;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.8) 0%, rgba(251, 191, 36, 0) 70%);
}

@keyframes sea-battle-explode {
  0% {
    width: 0;
    height: 0;
    opacity: 1;
  }
  50% {
    width: 80px;
    height: 80px;
    opacity: 0.8;
  }
  100% {
    width: 120px;
    height: 120px;
    opacity: 0;
  }
}

/* Splash Animation */
.sea-battle-splash {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
}

.sea-battle-splash::before,
.sea-battle-splash::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(132, 204, 22, 0.6) 0%, rgba(132, 204, 22, 0) 70%);
  transform: translate(-50%, -50%);
  animation: sea-battle-splash 0.5s ease-out forwards;
}

.sea-battle-splash::after {
  animation-delay: 0.1s;
  background: radial-gradient(circle, rgba(147, 197, 253, 0.6) 0%, rgba(147, 197, 253, 0) 70%);
}

@keyframes sea-battle-splash {
  0% {
    width: 0;
    height: 0;
    opacity: 1;
  }
  50% {
    width: 60px;
    height: 60px;
    opacity: 0.7;
  }
  100% {
    width: 100px;
    height: 100px;
    opacity: 0;
  }
}

.sea-battle-hit-name {
  color: var(--accent-error);
  font-weight: 700;
  animation: sea-battle-pulse 0.5s ease-in-out;
}

@keyframes sea-battle-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Winner Phase */
.sea-battle-winner {
  text-align: center;
  padding: 2rem;
}

.sea-battle-winner-label {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.sea-battle-winner-name {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #84cc16 0%, #65a30d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Sea Battle Controls */
.sea-battle-controls {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sea-battle-continue-btn {
  padding: 12px 32px;
  background: linear-gradient(135deg, #84cc16 0%, #65a30d 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(132, 204, 22, 0.3);
}

.sea-battle-continue-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(132, 204, 22, 0.4);
}

.sea-battle-continue-btn:active {
  transform: translateY(0);
}

.sea-battle-continue-btn.hidden {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .sea-battle-modal {
    width: 98%;
    max-height: 95vh;
  }
  
  .sea-battle-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .sea-battle-cell {
    width: 40px;
    height: 40px;
    font-size: 0.65rem;
  }
  
  .sea-battle-header-cell {
    width: 40px;
    height: 28px;
  }
  
  .sea-battle-row-label {
    width: 25px;
    height: 40px;
  }
  
  .sea-battle-header-row > div:first-child {
    width: 25px;
    height: 28px;
  }
}

/* ========== MULTI-LEVEL DRAW MODAL STYLES ========== */
.multi-level-modal {
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

.multi-level-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--border-primary);
}

.multi-level-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.multi-level-content {
  padding: var(--spacing-md);
}

.multi-level-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.multi-level-group-info {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.multi-level-participants-count {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.multi-level-progress-container {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: var(--spacing-md);
}

.multi-level-progress-bar {
  height: 100%;
  background: var(--gradient-accent);
  border-radius: var(--radius-sm);
  width: 0%;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(132, 204, 22, 0.5);
}

.multi-level-pagination {
  display: flex;
  justify-content: center;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
}

.multi-level-pagination-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border-primary);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.multi-level-pagination-btn:hover:not(:disabled) {
  border-color: var(--accent-primary);
  background: var(--bg-card);
  transform: scale(1.1);
}

.multi-level-pagination-btn.active {
  background: var(--gradient-accent);
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px rgba(132, 204, 22, 0.6);
  transform: scale(1.15);
}

.multi-level-pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.multi-level-scroll-container {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  margin-bottom: var(--spacing-md);
}

.multi-level-scroll-container.hidden {
  display: none;
}

/* Scroll indicator arrow - fixed in center top, pointing down */
.multi-level-scroll-indicator {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 4px;
}

.multi-level-indicator-arrow {
  width: 32px;
  height: 32px;
  color: var(--accent-primary);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  animation: multi-level-indicator-pulse 2s ease-in-out infinite;
  display: block;
}

@keyframes multi-level-indicator-pulse {
  0%, 100% {
    opacity: 1;
    transform: translateY(0);
  }
  50% {
    opacity: 0.8;
    transform: translateY(2px);
  }
}

.multi-level-items-wrapper {
  display: flex;
  align-items: center;
  height: 100%;
  will-change: transform;
  gap: var(--spacing-sm);
  padding: 0 var(--spacing-md);
}

.multi-level-item {
  flex-shrink: 0;
  width: 140px;
  height: 160px;
  background: var(--bg-card);
  border: 2px solid var(--border-primary);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm);
  transition: all 0.3s ease;
  cursor: pointer;
}

.multi-level-item:hover {
  border-color: var(--border-hover);
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.multi-level-item.winner {
  border-color: var(--accent-primary);
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.2) 0%, rgba(132, 204, 22, 0.2) 100%);
  box-shadow: 0 0 20px rgba(132, 204, 22, 0.6), var(--shadow-xl);
  transform: scale(1.1);
  z-index: 10;
}

.multi-level-item.dimmed {
  opacity: 0.3;
  filter: grayscale(100%);
}

/* Scroll highlight effect - wave effect during animation */
.multi-level-item.scroll-highlight {
  border-color: var(--accent-primary);
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.15) 0%, rgba(132, 204, 22, 0.15) 100%);
  box-shadow: 0 0 15px rgba(132, 204, 22, 0.4), var(--shadow-md);
  z-index: 5;
  /* Remove transition - GSAP handles animations */
}

.multi-level-item.scroll-highlight-weak {
  border-color: var(--accent-secondary);
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.08) 0%, rgba(132, 204, 22, 0.08) 100%);
  box-shadow: 0 0 8px rgba(132, 204, 22, 0.3);
  z-index: 3;
  /* Remove transition - GSAP handles animations */
}

.multi-level-item-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-xs);
  overflow: hidden;
  border: 2px solid var(--border-primary);
}

.multi-level-item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.multi-level-item-avatar:not(:has(img)) {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Fallback for browsers without :has() support */
@supports not selector(:has(*)) {
  .multi-level-item-avatar {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
  }
}

.multi-level-item-username {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  word-break: break-word;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
  padding: 0 2px;
  /* Dynamic font size for very long usernames */
  min-height: 1.3em;
}

/* For very long usernames, allow 2 lines with smaller font */
.multi-level-item-username[data-long="true"] {
  font-size: 0.75rem;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  max-height: 2.4em;
}

.multi-level-item.winner .multi-level-item-username {
  color: var(--accent-primary);
  font-weight: 700;
}

.multi-level-winners-list {
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
}

.multi-level-winners-list.hidden {
  display: none;
}

.multi-level-winners-list h3 {
  margin: 0 0 var(--spacing-md) 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.multi-level-winners-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--spacing-sm);
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: var(--spacing-xs);
  /* Custom scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: var(--accent-primary) var(--bg-tertiary);
}

/* Webkit scrollbar styling (Chrome, Safari, Edge) */
.multi-level-winners-container::-webkit-scrollbar {
  width: 8px;
}

.multi-level-winners-container::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

.multi-level-winners-container::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 4px;
  transition: background 0.2s ease;
}

.multi-level-winners-container::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

.multi-level-winner-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--spacing-sm);
  background: var(--bg-card);
  border: 2px solid var(--border-primary);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.multi-level-winner-item:hover {
  border-color: var(--accent-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.multi-level-winner-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-xs);
  overflow: hidden;
  border: 2px solid var(--border-primary);
}

.multi-level-winner-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.multi-level-winner-avatar:not(:has(img)) {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
}

/* Fallback for browsers without :has() support */
@supports not selector(:has(*)) {
  .multi-level-winner-avatar {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-primary);
  }
}

.multi-level-winner-info {
  text-align: center;
  width: 100%;
}

.multi-level-winner-group {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.multi-level-winner-username {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* For very long usernames in winners list */
.multi-level-winner-username[data-long="true"] {
  font-size: 0.75rem;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  max-height: 2.6em;
}

.multi-level-actions {
  display: flex;
  justify-content: center;
  gap: var(--spacing-sm);
  padding-top: var(--spacing-md);
}

.multi-level-actions .action-btn {
  min-width: 200px;
}

.multi-level-actions .action-btn.hidden {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .multi-level-modal {
    width: 95%;
    max-height: 95vh;
  }
  
  .multi-level-item {
    width: 120px;
    height: 140px;
  }
  
  .multi-level-item-avatar {
    width: 60px;
    height: 60px;
  }
  
  .multi-level-info {
    flex-direction: column;
    gap: var(--spacing-xs);
    align-items: flex-start;
  }
}

/* ==================== NEW YEAR DECORATIONS ==================== */

