/* Spotcalypse - Zombie Shooter Gaming Design */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@500;700&display=swap');

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

/* Reset button styles */
button {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  outline: none;
}

button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Reset anchor styles */
a {
  color: inherit;
  text-decoration: none;
}

a:visited {
  color: inherit;
}

a:hover {
  text-decoration: none;
}

:root {
  --primary: #dc2626;
  --primary-dark: #b91c1c;
  --secondary: #22c55e;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --dark: #0f172a;
  --darker: #020617;
  --glass: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
}

html, body {
  height: auto;
  min-height: 100vh;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1a0a0a 50%, #0f172a 100%);
  color: white;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Animated background */
.bg-animated {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(220, 38, 38, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(34, 197, 94, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(245, 158, 11, 0.1) 0%, transparent 30%);
  z-index: -1;
  animation: bgPulse 10s ease-in-out infinite;
  pointer-events: none;
}

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

/* Glass card effect */
.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glass-strong {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Modern buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border-radius: 1rem;
  font-weight: 700;
  font-size: 1.125rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

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

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(220, 38, 38, 0.5);
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.5);
}

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

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

/* Health bar */
.health-bar {
  width: 100%;
  height: 1.5rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 0.75rem;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.health-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444 0%, #22c55e 100%);
  transition: width 0.3s ease;
}

.health-bar-fill.critical {
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 100%);
  animation: healthPulse 0.5s ease-in-out infinite;
}

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

/* Timer circle */
.timer-circle {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  font-family: 'Space Grotesk', sans-serif;
  position: relative;
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
  animation: timerPulse 1s ease-in-out infinite;
}

.timer-circle.warning {
  animation: timerWarning 0.5s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { box-shadow: 0 0 30px rgba(239, 68, 68, 0.5); }
  50% { box-shadow: 0 0 50px rgba(239, 68, 68, 0.8); }
}

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

/* Score display */
.score-badge {
  background: linear-gradient(135deg, var(--accent) 0%, #d97706 100%);
  padding: 0.5rem 1.5rem;
  border-radius: 2rem;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

/* Kill counter */
.kill-counter {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  padding: 0.5rem 1.5rem;
  border-radius: 2rem;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* QR Code container */
.qr-container {
  background: white;
  padding: 1.5rem;
  border-radius: 1.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Player list */
.player-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.75rem;
  transition: all 0.2s;
}

.player-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.player-item.dead {
  opacity: 0.5;
}

/* Connection indicator */
.connection-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.connection-dot.connected { background: var(--success); }
.connection-dot.reconnecting {
  background: var(--accent);
  animation: blink 0.5s infinite;
}
.connection-dot.disconnected { background: var(--danger); }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Input styling */
.input-modern {
  width: 100%;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  color: white;
  font-size: 1.25rem;
  font-weight: 500;
  text-align: center;
  transition: all 0.3s;
}

.input-modern:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.2);
}

.input-modern::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Headings */
.title-xl {
  font-size: 3rem;
  font-weight: 800;
  font-family: 'Space Grotesk', sans-serif;
  background: linear-gradient(135deg, #dc2626 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.title-lg {
  font-size: 2rem;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
}

/* Wave announcement */
.wave-announce {
  font-size: 4rem;
  font-weight: 900;
  font-family: 'Space Grotesk', sans-serif;
  text-transform: uppercase;
  animation: waveIn 0.5s ease-out;
}

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

/* Game over screen */
.game-over-text {
  font-size: 5rem;
  font-weight: 900;
  font-family: 'Space Grotesk', sans-serif;
  color: #dc2626;
  text-shadow: 0 0 30px rgba(220, 38, 38, 0.8);
  animation: gameOverPulse 1s ease-in-out infinite;
}

@keyframes gameOverPulse {
  0%, 100% { text-shadow: 0 0 30px rgba(220, 38, 38, 0.8); }
  50% { text-shadow: 0 0 60px rgba(220, 38, 38, 1); }
}

/* Leaderboard */
.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  margin-bottom: 0.5rem;
}

.leaderboard-rank {
  font-size: 2rem;
  font-weight: 900;
  font-family: 'Space Grotesk', sans-serif;
  width: 3rem;
  text-align: center;
}

.leaderboard-rank.gold { color: #fbbf24; }
.leaderboard-rank.silver { color: #9ca3af; }
.leaderboard-rank.bronze { color: #d97706; }

/* Game container */
#game-container {
  width: 100%;
  height: 100vh;
  position: relative;
}

#game-container canvas {
  display: block;
}

/* Mobile HUD overlay */
.mobile-hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, transparent 100%);
  z-index: 100;
  pointer-events: none;
}

.mobile-controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem;
  background: linear-gradient(0deg, rgba(0,0,0,0.5) 0%, transparent 100%);
  z-index: 100;
}

/* Utility classes */
.min-h-screen { min-height: 100vh; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-mono { font-family: 'Space Grotesk', monospace; }
.opacity-60 { opacity: 0.6; }
.opacity-80 { opacity: 0.8; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }

.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-6xl { max-width: 72rem; }
.w-full { width: 100%; }

.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }
.text-6xl { font-size: 3.75rem; }
.text-white { color: white; }

.fixed { position: fixed; }
.absolute { position: absolute; }
.relative { position: relative; }
.top-4 { top: 1rem; }
.right-4 { right: 1rem; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-50 { z-index: 50; }

.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Mobile responsiveness */
@media (max-width: 768px) {
  .title-xl { font-size: 2rem; }
  .title-lg { font-size: 1.5rem; }
  .timer-circle { width: 4rem; height: 4rem; font-size: 1.5rem; }
}

/* Colors & backgrounds */
.bg-white { background-color: white; }
.bg-white\/5 { background-color: rgba(255, 255, 255, 0.05); }
.bg-white\/10 { background-color: rgba(255, 255, 255, 0.1); }
.bg-black\/50 { background-color: rgba(0, 0, 0, 0.5); }
.bg-red-500\/20 { background-color: rgba(239, 68, 68, 0.2); }
.text-red-300 { color: #fca5a5; }
.text-green-400 { color: #4ade80; }
.text-yellow-400 { color: #facc15; }

.transition-all { transition: all 0.2s ease; }
.cursor-pointer { cursor: pointer; }
.block { display: block; }
.flex-1 { flex: 1 1 0%; }

/* Additional utilities for spectator */
.top-20 { top: 5rem; }
.left-4 { left: 1rem; }
.bottom-4 { bottom: 1rem; }
.z-40 { z-index: 40; }

/* Kill feed animation */
.animate-slide-in {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Spectator camera indicator */
.camera-indicator {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.8) 0%, rgba(153, 27, 27, 0.8) 100%);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}
