/* SpotQuiz - Modern 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;
}

:root {
  --primary: #8b5cf6;
  --primary-dark: #7c3aed;
  --secondary: #06b6d4;
  --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%, #1e1b4b 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(139, 92, 246, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.3) 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;
}

.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(139, 92, 246, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 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;
}

/* Answer buttons - Kahoot style */
.answer-btn {
  padding: 1.5rem;
  border-radius: 1rem;
  font-weight: 700;
  font-size: 1.25rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.answer-btn:hover:not(:disabled) {
  transform: scale(1.02);
  filter: brightness(1.1);
}

.answer-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.answer-btn.selected {
  animation: selectedPulse 0.5s ease;
  box-shadow: 0 0 0 4px white, 0 0 30px rgba(255,255,255,0.5);
}

@keyframes selectedPulse {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.answer-red { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.answer-blue { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }
.answer-yellow { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.answer-green { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }

.answer-correct {
  animation: correctBounce 0.5s ease;
  box-shadow: 0 0 0 4px #86efac, 0 0 40px rgba(134, 239, 172, 0.5);
}

.answer-wrong {
  opacity: 0.4;
  filter: grayscale(0.5);
}

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

/* 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);
}

/* Rank display */
.rank-display {
  font-size: 5rem;
  font-weight: 900;
  font-family: 'Space Grotesk', sans-serif;
  background: linear-gradient(135deg, var(--accent) 0%, #fbbf24 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 4px 20px rgba(245, 158, 11, 0.5));
}

/* 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);
}

/* Quiz card */
.quiz-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.5rem;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.quiz-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(139, 92, 246, 0.3);
}

/* Status badges */
.status-ready {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.status-active {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.status-finished {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
}

/* 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; }
}

/* Winner display */
.winner-crown {
  font-size: 4rem;
  animation: crownBounce 1s ease-in-out infinite;
}

@keyframes crownBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-10px) rotate(-5deg); }
  75% { transform: translateY(-10px) rotate(5deg); }
}

/* Result feedback */
.result-correct {
  animation: correctPop 0.5s ease;
}

.result-wrong {
  animation: wrongShake 0.5s ease;
}

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

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

/* Toggle switch */
.toggle-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
}

.toggle-switch {
  width: 3.5rem;
  height: 2rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  position: relative;
  cursor: pointer;
  transition: all 0.3s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.toggle-switch:hover {
  background: rgba(255, 255, 255, 0.3);
}

.toggle-switch:active {
  transform: scale(0.95);
}

.toggle-switch.active {
  background: var(--success);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  width: 1.5rem;
  height: 1.5rem;
  background: white;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active::after {
  left: calc(100% - 1.75rem);
}

/* Countdown circle */
.countdown-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.countdown-number {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: 'Space Grotesk', sans-serif;
  animation: countdownPulse 1s ease-in-out infinite;
}

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

/* 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(139, 92, 246, 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, white 0%, rgba(255,255,255,0.7) 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;
}

/* 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); }
.col-span-3 { grid-column: span 3; }

@media (max-width: 768px) {
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.p-3 { padding: 0.75rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.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-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.ml-2 { margin-left: 0.5rem; }
.pb-20 { padding-bottom: 5rem; }
.pb-24 { padding-bottom: 6rem; }

.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-xs { font-size: 0.75rem; }
.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-8xl { font-size: 6rem; }
.text-white { color: white; }
.text-left { text-align: left; }
.text-gray-600 { color: #4b5563; }
.cursor-pointer { cursor: pointer; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex-1 { flex: 1 1 0%; }
.break-all { word-break: break-all; }

.fixed { position: fixed; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }

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

/* Animations */
.animate-bounce {
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
  50% { transform: translateY(0); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
}

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

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

/* Desktop responsiveness */
@media (min-width: 768px) {
  .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .md\:col-span-3 { grid-column: span 3; }
  .md\:p-8 { padding: 2rem; }
  .md\:p-12 { padding: 3rem; }
}

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