:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-card: rgba(30, 30, 50, 0.7);
  --bg-card-hover: rgba(40, 40, 70, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.4);
  --accent-green: #22c55e;
  --accent-green-glow: rgba(34, 197, 94, 0.3);
  --accent-red: #ef4444;
  --accent-red-glow: rgba(239, 68, 68, 0.3);
  --accent-blue: #3b82f6;
  --accent-blue-glow: rgba(59, 130, 246, 0.3);
  --accent-orange: #f97316;
  --accent-orange-glow: rgba(249, 115, 22, 0.3);
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.3);
  --gradient-main: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f1a 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gradient-main);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated background */
.bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-main);
  z-index: -2;
}

.bg-pattern {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(34, 197, 94, 0.05) 0%, transparent 40%);
  z-index: -1;
}

/* Header */
.header {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-text span {
  color: var(--accent-blue);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-green);
  transition: all 0.3s ease;
}

.status-badge.disconnected {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--accent-red);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

/* Main container */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Timer Display Card */
.timer-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 40px;
  margin-bottom: 24px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.timer-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple), var(--accent-blue));
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.timer-label {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.timer-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(72px, 15vw, 120px);
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  text-shadow: 0 0 60px rgba(255, 255, 255, 0.1);
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.timer-display.warning {
  color: var(--accent-orange);
  text-shadow: 0 0 60px var(--accent-orange-glow);
}

.timer-display.danger {
  color: var(--accent-red);
  text-shadow: 0 0 60px var(--accent-red-glow);
  animation: urgentPulse 0.5s infinite;
}

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

.timer-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
}

.timer-status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all 0.3s ease;
}

.timer-status-indicator.running {
  background: var(--accent-green);
  box-shadow: 0 0 12px var(--accent-green-glow);
  animation: pulse 1s infinite;
}

.timer-status-indicator.ads {
  background: var(--accent-orange);
  box-shadow: 0 0 12px var(--accent-orange-glow);
  animation: pulse 1s infinite;
}

/* Controls Section */
.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.control-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.control-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.control-card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-card-title .icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.control-card-title .icon.timer {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.control-card-title .icon.reset {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
}

.control-card-title .icon.ads {
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent-orange);
}

.control-card-title .icon.custom {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-green);
}

.control-card-title .icon.team {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.control-card-title .icon.sound {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.control-card-title .icon.music {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
}

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn::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;
}

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

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

.btn-start {
  background: linear-gradient(135deg, var(--accent-green), #16a34a);
  color: white;
  box-shadow: 0 4px 20px var(--accent-green-glow);
}

.btn-start:hover {
  box-shadow: 0 6px 30px var(--accent-green-glow);
}

.btn-stop {
  background: linear-gradient(135deg, var(--accent-red), #dc2626);
  color: white;
  box-shadow: 0 4px 20px var(--accent-red-glow);
}

.btn-stop:hover {
  box-shadow: 0 6px 30px var(--accent-red-glow);
}

.btn-reset {
  background: linear-gradient(135deg, var(--accent-blue), #2563eb);
  color: white;
  box-shadow: 0 4px 15px var(--accent-blue-glow);
}

.btn-reset:hover {
  box-shadow: 0 6px 25px var(--accent-blue-glow);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-ads {
  background: linear-gradient(135deg, var(--accent-orange), #ea580c);
  color: white;
  box-shadow: 0 4px 15px var(--accent-orange-glow);
}

.btn-ads:hover {
  box-shadow: 0 6px 25px var(--accent-orange-glow);
}

.btn-ads.active {
  animation: glowPulse 2s infinite;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 4px 20px var(--accent-orange-glow); }
  50% { box-shadow: 0 4px 35px rgba(249, 115, 22, 0.5); }
}

.ads-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-logo {
  background: linear-gradient(135deg, var(--accent-purple), #7c3aed);
  color: white;
  box-shadow: 0 4px 15px var(--accent-purple-glow);
}

.btn-logo:hover {
  box-shadow: 0 6px 25px var(--accent-purple-glow);
}

.btn-team-intro {
  background: linear-gradient(135deg, #eab308, #ca8a04);
  color: white;
  box-shadow: 0 4px 15px rgba(234, 179, 8, 0.3);
}

.btn-team-intro:hover {
  box-shadow: 0 6px 25px rgba(234, 179, 8, 0.4);
}

.btn-horn {
  background: linear-gradient(135deg, var(--accent-red), #dc2626);
  color: white;
  box-shadow: 0 4px 15px var(--accent-red-glow);
}

.btn-horn:hover {
  box-shadow: 0 6px 25px var(--accent-red-glow);
}

.btn-music {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: white;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-music:hover {
  box-shadow: 0 6px 25px rgba(6, 182, 212, 0.4);
}

.btn-music.playing {
  animation: glowPulse 2s infinite;
}

.btn-music.playing::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  background: rgba(6, 182, 212, 0.2);
  animation: ripple 1.5s infinite;
}

@keyframes ripple {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.3); opacity: 0; }
}

.sound-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Custom Time Input */
.custom-time-input {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.input-wrapper {
  flex: 1 1 auto;
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  width: 100%;
  height: 52px;
  padding: 0 50px 0 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.input-wrapper input::placeholder {
  color: var(--text-muted);
}

.input-suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  pointer-events: none;
}

.btn-set {
  background: linear-gradient(135deg, var(--accent-purple), #7c3aed);
  color: white;
  box-shadow: 0 4px 15px var(--accent-purple-glow);
  padding: 14px 16px;
  width: auto;
  min-width: auto;
  flex: 0 0 auto;
}

.btn-set:hover {
  box-shadow: 0 6px 25px var(--accent-purple-glow);
}

/* Footer */
.footer {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
}

.footer a {
  color: var(--accent-blue);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 640px) {
  .header {
    padding: 12px 16px;
  }

  .logo-text {
    font-size: 18px;
  }

  .container {
    padding: 20px 16px;
  }

  .timer-card {
    padding: 28px 20px;
  }

  .timer-display {
    font-size: 64px;
  }

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

  .control-card {
    padding: 20px;
  }

  /* Mobile card ordering */
  .card-timer-control { order: 1; }
  .card-time-settings { order: 2; }
  .card-advertisement { order: 3; }
  .card-team-intro { order: 4; }
  .card-sound-effects { order: 5; }
  .card-music { order: 6; }

  .custom-time-input {
    flex-direction: column;
  }

  .btn-set {
    width: 100%;
  }
}

/* Animations for page load */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timer-card {
  animation: fadeInUp 0.5s ease;
}

.control-card {
  animation: fadeInUp 0.5s ease;
  animation-fill-mode: both;
}

.control-card:nth-child(1) { animation-delay: 0.1s; }
.control-card:nth-child(2) { animation-delay: 0.2s; }
.control-card:nth-child(3) { animation-delay: 0.3s; }
.control-card:nth-child(4) { animation-delay: 0.4s; }
.control-card:nth-child(5) { animation-delay: 0.5s; }
.control-card:nth-child(6) { animation-delay: 0.6s; }

/* Header right section */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Header Buttons */
.header-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.header-btn svg {
  transition: transform 0.3s ease;
}

/* Settings Button */
.settings-btn:hover svg {
  transform: rotate(45deg);
}

/* Switch Sport Button */
.switch-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.4);
  color: var(--accent-purple);
}

.switch-btn:hover svg {
  transform: rotate(180deg);
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

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

.modal-title {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title .icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

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

.modal-body {
  padding: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-select {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.form-select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* School Display (read-only) */
.school-display {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  background: rgba(59, 130, 246, 0.1);
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  color: var(--accent-blue);
}

/* File Upload */
.file-upload {
  position: relative;
}

.file-upload-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 24px;
  background: rgba(0, 0, 0, 0.2);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-upload-label:hover {
  background: rgba(0, 0, 0, 0.3);
  border-color: var(--accent-purple);
}

.file-upload-label.dragover {
  background: rgba(139, 92, 246, 0.1);
  border-color: var(--accent-purple);
}

.file-upload-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-upload-text {
  text-align: center;
}

.file-upload-text strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.file-upload-text span {
  font-size: 13px;
  color: var(--text-muted);
}

.file-preview {
  margin-top: 16px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  display: none;
}

.file-preview.active {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-preview-img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: rgba(255, 255, 255, 0.05);
}

.file-preview-info {
  flex: 1;
  min-width: 0;
}

.file-preview-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-preview-size {
  font-size: 12px;
  color: var(--text-muted);
}

.file-preview-remove {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.15);
  border: none;
  color: var(--accent-red);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.file-preview-remove:hover {
  background: rgba(239, 68, 68, 0.25);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-modal {
  padding: 12px 24px;
  width: auto;
}

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

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-save {
  background: linear-gradient(135deg, var(--accent-purple), #7c3aed);
  color: white;
  box-shadow: 0 4px 15px var(--accent-purple-glow);
}

.btn-save:hover {
  box-shadow: 0 6px 25px var(--accent-purple-glow);
}

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

/* Upload status message */
.upload-status {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  display: none;
}

.upload-status.active {
  display: block;
}

.upload-status.success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.upload-status.error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.upload-status.loading {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Range Slider Styles */
.slider-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.15);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  min-width: 48px;
  text-align: center;
}

.slider-value.brightness {
  color: #eab308;
  background: rgba(234, 179, 8, 0.15);
}

.form-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--accent-blue);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--accent-blue-glow);
  transition: all 0.2s ease;
}

.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px var(--accent-blue-glow);
}

.form-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--accent-blue);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px var(--accent-blue-glow);
  transition: all 0.2s ease;
}

.form-range::-moz-range-thumb:hover {
  transform: scale(1.1);
}

.form-range.brightness::-webkit-slider-thumb {
  background: #eab308;
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.3);
}

.form-range.brightness::-webkit-slider-thumb:hover {
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.4);
}

.form-range.brightness::-moz-range-thumb {
  background: #eab308;
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.3);
}

.slider-icon {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.slider-icon svg {
  opacity: 0.7;
}

/* Login Screen */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-main);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.login-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 30% 70%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 70% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 50%);
  z-index: -1;
}

.login-content {
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
}

.login-logo img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.login-logo-text {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
}

.login-logo-text span {
  color: var(--accent-blue);
}

.login-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-input-group {
  text-align: left;
}

.login-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.login-input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.login-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.login-input::placeholder {
  color: var(--text-muted);
}

.login-btn {
  width: 100%;
  height: 52px;
  margin-top: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent-blue), #2563eb);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px var(--accent-blue-glow);
}

.login-btn:hover {
  box-shadow: 0 6px 25px var(--accent-blue-glow);
  transform: translateY(-1px);
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.login-error {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  color: var(--accent-red);
  font-size: 14px;
  display: none;
}

.login-error.active {
  display: block;
}

@media (max-width: 640px) {
  .login-logo img {
    width: 48px;
    height: 48px;
  }

  .login-logo-text {
    font-size: 28px;
  }

  .login-subtitle {
    font-size: 14px;
    margin-bottom: 32px;
  }
}

/* Sport Selection Screen */
.sport-select-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-main);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.sport-select-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sport-select-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(34, 197, 94, 0.08) 0%, transparent 40%);
  z-index: -1;
}

.sport-select-content {
  text-align: center;
  max-width: 600px;
  width: 100%;
}

.sport-select-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.sport-select-logo img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.sport-select-logo-text {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
}

.sport-select-logo-text span {
  color: var(--accent-blue);
}

.sport-select-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 48px;
}

.sport-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sport-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 32px;
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 600;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  color: var(--text-primary);
}

.sport-btn::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.5s ease;
}

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

.sport-btn:active {
  transform: scale(0.98);
}

.sport-btn .sport-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.3s ease;
}

/* Basketball */
.sport-btn.basketball {
  border-color: rgba(249, 115, 22, 0.3);
}

.sport-btn.basketball:hover {
  background: rgba(249, 115, 22, 0.1);
  border-color: var(--accent-orange);
  box-shadow: 0 0 30px rgba(249, 115, 22, 0.2);
}

.sport-btn.basketball .sport-icon {
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent-orange);
}

/* Volleyball */
.sport-btn.volleyball {
  border-color: rgba(59, 130, 246, 0.3);
}

.sport-btn.volleyball:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--accent-blue);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
}

.sport-btn.volleyball .sport-icon {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

/* Wrestling */
.sport-btn.wrestling {
  border-color: rgba(239, 68, 68, 0.3);
}

.sport-btn.wrestling:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--accent-red);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.2);
}

.sport-btn.wrestling .sport-icon {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

/* Main app hidden state */
.app-container.hidden {
  display: none;
}

@media (max-width: 640px) {
  .sport-select-logo img {
    width: 48px;
    height: 48px;
  }

  .sport-select-logo-text {
    font-size: 28px;
  }

  .sport-select-title {
    font-size: 18px;
    margin-bottom: 32px;
  }

  .sport-btn {
    padding: 20px 24px;
    font-size: 18px;
  }

  .sport-btn .sport-icon {
    width: 40px;
    height: 40px;
  }
}
