/* Custom CSS Design System - YouTube Comment & Live Chat Picker v2 */

:root {
  /* Color Palette */
  --bg-base: #060811;
  --bg-card: rgba(12, 15, 34, 0.65);
  --bg-card-hover: rgba(18, 22, 50, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-glow: rgba(99, 102, 241, 0.35);
  
  --primary: #6366f1; /* Indigo */
  --primary-glow: rgba(99, 102, 241, 0.4);
  --secondary: #8b5cf6; /* Violet */
  --accent: #ec4899; /* Pink/Magenta */
  --accent-glow: rgba(236, 72, 153, 0.45);
  --success: #10b981; /* Emerald */
  --warning: #f59e0b; /* Amber */
  --danger: #f43f5e; /* Rose Red */
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --font-title: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-bounce: all 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.25);
}

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

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Ambient glow spots in background */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.35;
  pointer-events: none;
}

.bg-glow-1 {
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  top: -10%;
  right: -5%;
}

.bg-glow-2 {
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
  bottom: -10%;
  left: -10%;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(6, 8, 17, 0.8);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Layout */
.app-container {
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  gap: 24px;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-radius: 20px;
  background: rgba(12, 15, 34, 0.55);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon-wrapper {
  background: linear-gradient(135deg, #ff0055 0%, #ff5500 100%);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 15px rgba(255, 0, 85, 0.35);
}

.logo-icon {
  width: 24px;
  height: 24px;
  color: white;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #f8fafc, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

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

.demo-badge-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.demo-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
  transition: var(--transition-smooth);
}

.demo-status-dot.loading {
  background-color: var(--warning);
  box-shadow: 0 0 8px var(--warning);
  animation: pulse-dot 1s infinite alternate;
}

.demo-status-dot.live {
  background-color: var(--danger);
  box-shadow: 0 0 8px var(--danger);
  animation: pulse-dot 0.8s infinite alternate;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1.2); opacity: 1; }
}

#app-status-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

/* App Main Content */
.app-content {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
  flex: 1;
}

/* Cards (Glassmorphism design) */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.35);
  transition: var(--transition-smooth);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.card-icon i {
  width: 20px;
  height: 20px;
}

.card-header h3 {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Control Panel Inputs */
.control-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.input-icon-small {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.input-with-icon input {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px 12px 42px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: var(--transition-smooth);
}

.input-with-icon input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: rgba(0, 0, 0, 0.4);
}

.input-help {
  font-size: 11px;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition-bounce);
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
}

.btn-accent {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
  color: white;
  box-shadow: 0 4px 20px var(--accent-glow);
}

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

.btn-accent:disabled {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-accent-outline {
  background: rgba(236, 72, 153, 0.08);
  border: 1px solid var(--accent);
  color: var(--text-primary);
}

.btn-accent-outline:hover {
  background: rgba(236, 72, 153, 0.2);
  transform: translateY(-2px);
}

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

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.btn-ghost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 16px;
  border-radius: 16px;
  font-family: var(--font-title);
  font-weight: 700;
}

.btn-block {
  width: 100%;
}

.btn-glow-neon {
  position: relative;
}

.btn-glow-neon:after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  box-shadow: 0 0 20px var(--accent);
  opacity: 0;
  transition: var(--transition-smooth);
  z-index: -1;
}

.btn-glow-neon:hover:not(:disabled):after {
  opacity: 1;
}

.hidden {
  display: none !important;
}

/* Switch styling */
.switch-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.switch-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.switch-label h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.switch-label p {
  font-size: 11px;
  color: var(--text-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s;
  border-radius: 34px;
  border: 1px solid var(--border-color);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(0.25, 0.8, 0.25, 1.25);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.form-row {
  display: flex;
  gap: 16px;
}

.col {
  flex: 1;
}

.custom-select {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.custom-select:focus {
  border-color: var(--primary);
}

.margin-top-sm {
  margin-top: 8px;
}

.margin-top-lg {
  margin-top: 24px;
}

.margin-bottom-md {
  margin-bottom: 16px;
}

/* Right Column (Picker Panel) */
.picker-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Video Card (details showing loaded video) */
.video-card {
  padding: 16px;
  border-left: 4px solid var(--primary);
}

.video-info-layout {
  display: flex;
  gap: 20px;
}

.video-thumbnail-wrapper {
  position: relative;
  width: 160px;
  aspect-ratio: 16/9;
  border-radius: 10px;
  overflow: hidden;
  background-color: black;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.video-thumbnail-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.duration-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,0.8);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: white;
}

.video-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

.channel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.video-title {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.live-stream-tag {
  background: var(--danger);
  color: white;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.5);
  animation: pulse-live 1.2s infinite alternate ease-in-out;
  flex-shrink: 0;
}

@keyframes pulse-live {
  0% { opacity: 0.8; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1.05); }
}

.video-channel {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.video-stats {
  display: flex;
  gap: 12px;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.stat-icon {
  width: 14px;
  height: 14px;
}

/* Live Chat Card */
.live-chat-card {
  display: flex;
  flex-direction: column;
}

.bg-live-chat {
  border-bottom: 1px solid var(--border-color);
  background: rgba(244, 63, 94, 0.03);
}

.pulsing-red-dot {
  color: var(--danger);
  animation: pulse-dot 1s infinite alternate;
}

.live-count-badge {
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 8px;
  margin-left: auto;
  color: var(--text-secondary);
}

.live-chat-body {
  height: 220px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  background: rgba(0, 0, 0, 0.2);
}

.live-chat-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: chatSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1) forwards;
}

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

.chat-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: var(--bg-base);
  margin-top: 2px;
}

.chat-bubble {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.chat-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 2px;
}

.chat-author {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.chat-author.highlight {
  color: var(--warning);
}

.chat-time {
  font-size: 10px;
  color: var(--text-muted);
}

.chat-text {
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}

.live-chat-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 13px;
}

/* Stats dashboard */
.comments-status {
  padding: 16px 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat-box {
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  text-align: center;
}

.stat-box.accent {
  background: rgba(99, 102, 241, 0.05);
  border-color: rgba(99, 102, 241, 0.15);
}

.stat-val {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 2px;
}

#stats-eligible {
  color: var(--primary);
  text-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.stat-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Fetching comments loader */
.loading-bar-container {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.loading-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
}

#loading-status-text {
  color: var(--text-primary);
}

#loading-percentage {
  color: var(--primary);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 10px;
  width: 0%;
  transition: width 0.15s ease-out;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.loading-subtext {
  font-size: 11px;
  color: var(--text-muted);
}

/* Picker Visualizer & Roulette Scroll */
.picker-visualizer-card {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.picker-visualizer-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.picker-visualizer-header h3 {
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 700;
}

.status-indicator-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 100px;
  color: var(--text-muted);
}

.status-indicator-badge.ready {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.status-indicator-badge.picking {
  background: rgba(236, 72, 153, 0.1);
  color: var(--accent);
  animation: pulse-border 1.5s infinite ease-in-out;
}

/* Viewport for horizontal scrolling animation */
.roulette-viewport {
  position: relative;
  width: 100%;
  height: 200px;
  background: radial-gradient(circle at center, rgba(17, 24, 61, 0.45) 0%, rgba(5, 7, 20, 0.95) 100%);
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
}

/* Center marker needle */
.roulette-center-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--primary) 50%, var(--accent) 100%);
  transform: translateX(-50%);
  z-index: 10;
  box-shadow: 0 0 15px var(--accent);
}

.roulette-center-line:before, .roulette-center-line:after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
}

.roulette-center-line:before {
  top: 0;
  border-top: 8px solid var(--accent);
}

.roulette-center-line:after {
  bottom: 0;
  border-bottom: 8px solid var(--accent);
}

/* Horizontal comments track */
.roulette-track {
  display: flex;
  align-items: center;
  height: 100%;
  padding-left: 50%; /* Start scrolling centered */
  will-change: transform;
}

.roulette-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
  gap: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
}

.pulsing-icon {
  width: 32px;
  height: 32px;
  color: var(--primary);
  animation: pulse-glow 2s infinite alternate ease-in-out;
}

@keyframes pulse-glow {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px var(--primary-glow)); }
  100% { transform: scale(1.15); filter: drop-shadow(0 0 12px var(--primary)); }
}

.roulette-placeholder p {
  font-size: 13px;
  max-width: 360px;
  line-height: 1.5;
}

.roulette-placeholder strong {
  color: var(--text-primary);
}

/* Single comment item card inside the roulette */
.roulette-item {
  flex-shrink: 0;
  width: 300px;
  height: 110px;
  margin: 0 10px;
  background: rgba(10, 12, 31, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease-out, transform 0.15s ease-out, box-shadow 0.15s ease-out;
  transform: scale(0.96);
  opacity: 0.65;
}

.roulette-item.center-active {
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
  transform: scale(1.04);
  opacity: 1;
}

.roulette-item.active-landed {
  border-color: var(--accent);
  box-shadow: 0 0 25px var(--accent-glow);
  background: rgba(22, 16, 42, 0.98);
  transform: scale(1.08);
  opacity: 1;
}

.roulette-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.roulette-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: var(--bg-base);
}

.roulette-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.roulette-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.roulette-handle {
  font-size: 10px;
  color: var(--text-muted);
}

.roulette-comment-text {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.picker-actions {
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

/* Winner Overlay Screen */
.winner-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.winner-glow-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 5, 12, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: -1;
  animation: fadeIn 0.4s ease-out;
}

.winner-card {
  width: 100%;
  max-width: 580px;
  background: radial-gradient(circle at top, rgba(28, 18, 48, 0.96) 0%, rgba(12, 15, 34, 0.99) 100%);
  border: 2px solid var(--accent);
  box-shadow: 0 0 50px rgba(236, 72, 153, 0.4);
  border-radius: 28px;
  padding: 40px 32px 32px 32px;
  position: relative;
  text-align: center;
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.25);
}

.winner-card.max-w-lg {
  max-width: 720px;
}

.winner-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.winner-close-btn:hover {
  background: rgba(255,255,255,0.15);
  color: white;
  transform: rotate(90deg);
}

.winner-close-btn i {
  width: 16px;
  height: 16px;
}

.winner-ribbon {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--warning) 0%, #f43f5e 100%);
  color: white;
  padding: 6px 24px;
  border-radius: 100px;
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.winner-ribbon i {
  width: 14px;
  height: 14px;
}

.winner-details-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.winner-avatar-wrapper {
  position: relative;
  margin-bottom: 20px;
}

.winner-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 4px solid var(--accent);
  box-shadow: 0 0 25px rgba(236, 72, 153, 0.5);
  background-color: var(--bg-base);
}

.winner-crown-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: var(--warning);
  color: #060811;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(12, 15, 34, 0.99);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.winner-crown-badge i {
  width: 16px;
  height: 16px;
}

.winner-name {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 800;
  color: white;
  margin-bottom: 4px;
}

.winner-handle {
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 24px;
  transition: var(--transition-smooth);
}

.winner-handle:hover {
  text-shadow: 0 0 8px var(--accent);
}

.winner-comment-bubble {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
}

.winner-comment-bubble:before {
  content: '"';
  position: absolute;
  top: 10px;
  left: 20px;
  font-family: var(--font-title);
  font-size: 60px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.05);
  line-height: 1;
}

#winner-comment-text {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.6;
  position: relative;
  z-index: 1;
  font-style: italic;
  word-break: break-word;
}

.winner-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
}

.winner-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.winner-stat i {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.winner-actions-group {
  display: flex;
  gap: 16px;
  width: 100%;
}

.winner-actions-group .btn {
  flex: 1;
}

/* Multi-Winner Screen Container */
.winner-multi-container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
}

.winner-multi-container .winner-name {
  text-align: center;
  font-size: 26px;
}

.winners-scroll-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 380px;
  overflow-y: auto;
  padding: 8px 4px;
}

.winner-row-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 14px 18px;
  transition: var(--transition-smooth);
}

.winner-row-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(236, 72, 153, 0.3);
  transform: translateX(4px);
}

.winner-row-num {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 800;
  color: var(--warning);
  width: 24px;
}

.winner-row-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background-color: var(--bg-base);
}

.winner-row-info {
  display: flex;
  flex-direction: column;
  width: 150px;
  overflow: hidden;
  flex-shrink: 0;
}

.winner-row-name {
  font-size: 13px;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.winner-row-handle {
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.winner-row-comment {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  flex-grow: 1;
  padding-right: 12px;
  word-break: break-word;
}

.winner-row-link {
  color: var(--text-muted);
  transition: var(--transition-smooth);
  flex-shrink: 0;
  padding: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.winner-row-link:hover {
  color: white;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.winner-row-link i {
  width: 14px;
  height: 14px;
}

/* Footer styling */
.app-footer {
  text-align: center;
  padding: 24px 0 8px 0;
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.footer-link:hover {
  color: var(--primary);
  text-shadow: 0 0 8px var(--primary-glow);
}

.powered-by {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--text-muted);
}

.font-glow {
  color: var(--accent);
}

.font-glow:hover {
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
}

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

@keyframes popIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

.delay-1 {
  animation-delay: 0.1s;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .app-content {
    grid-template-columns: 1fr;
  }
  
  .control-panel {
    gap: 16px;
  }
}

@media (max-width: 600px) {
  .app-container {
    padding: 12px;
  }
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .winner-actions-group {
    flex-direction: column;
  }
  .winner-card {
    padding: 32px 16px 24px 16px;
  }
  .winner-row-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
  }
  .winner-row-info {
    width: 100%;
  }
  .winner-row-link {
    align-self: flex-end;
  }
}
