/* SPN Quiz - Core Styles */
/* Split into: style.css (core), overlays.css, leaderboard.css */

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

:root {
  /* Supernova Brand Colors */
  --primary: #1868db;
  --primary-dark: #1254b0;
  --primary-light: #4d8eef;
  --secondary: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  /* Kahoot-style option colors */
  --option-1: #e74c3c;
  --option-2: #3498db;
  --option-3: #f1c40f;
  --option-4: #2ecc71;
}

/* Dark Theme (default) */
body.theme-dark {
  --bg: #0a1628;
  --bg-light: #132038;
  --bg-card: #1e3a5f;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #1e3a5f;
}

/* Light Theme */
body.theme-light {
  --bg: #f1f5f9;
  --bg-light: #ffffff;
  --bg-card: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #cbd5e1;
}

/* Default to dark if no theme class */
body:not(.theme-dark):not(.theme-light) {
  --bg: #0a1628;
  --bg-light: #132038;
  --bg-card: #1e3a5f;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #1e3a5f;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#app {
  width: 100%;
  max-width: 800px;
  padding: 20px;
}

.screen {
  display: none;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.screen.active {
  display: block;
}

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

/* Logo */
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
}

.logo-icon {
  height: 80px;
  width: auto;
}

.logo-title {
  font-size: 3.5rem;
  font-weight: bold;
  color: var(--primary);
  margin: 0 0 30px 0;
  letter-spacing: 4px;
}

.tagline {
  color: var(--text-muted);
  margin-bottom: 30px;
  font-size: 1rem;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--bg-light);
  color: var(--text);
  border: 2px solid var(--primary);
}

.btn-large {
  padding: 16px 48px;
  font-size: 1.2rem;
}

.btn-back {
  background: transparent;
  color: var(--text-muted);
  margin-top: 20px;
}

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

.home-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 300px;
  margin: 0 auto;
}

/* Form Field */
.form-field {
  margin: 15px 0;
  text-align: left;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.form-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
}

/* Input */
.input {
  width: 100%;
  max-width: 300px;
  padding: 14px 20px;
  border: 2px solid var(--bg-light);
  border-radius: 8px;
  background: var(--bg-light);
  color: var(--text);
  font-size: 1rem;
  margin: 0;
}

.input:focus {
  outline: none;
  border-color: var(--primary);
}

.input-code {
  text-transform: uppercase;
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 8px;
  font-weight: bold;
}

/* Game Code */
.game-code {
  font-size: 3rem;
  font-weight: bold;
  letter-spacing: 10px;
  color: var(--primary);
  background: var(--bg-light);
  padding: 20px 40px;
  border-radius: 12px;
  display: inline-block;
  margin: 20px 0;
}

.game-code-display {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.game-code-display span {
  color: var(--primary);
  font-weight: bold;
  letter-spacing: 3px;
}

/* Quiz List */
.quiz-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
  max-height: 300px;
  overflow-y: auto;
}

.quiz-item {
  background: var(--bg-light);
  padding: 16px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  text-align: left;
}

.quiz-item:hover {
  border-color: var(--primary);
}

.quiz-item.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.2);
}

.quiz-item h3 {
  margin-bottom: 4px;
}

.quiz-item span {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Player List */
.player-list {
  background: var(--bg-light);
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  min-height: 100px;
  max-height: 200px;
  overflow-y: auto;
}

.player-list .waiting {
  color: var(--text-muted);
}

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 20px;
  margin: 4px;
  animation: popIn 0.3s ease;
}

.player-avatar {
  font-size: 1.2rem;
}

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

.player-avatar-large {
  font-size: 4rem;
  margin-bottom: 10px;
}

.player-nickname {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary);
}

/* Spinner */
.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--bg-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 30px auto;
  animation: spin 1s linear infinite;
}

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

/* Question */
.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.timer {
  font-size: 2rem;
  font-weight: bold;
  background: var(--warning);
  color: var(--bg);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer.danger {
  background: var(--danger);
  animation: pulse 0.5s infinite;
}

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

.question-text {
  font-size: 1.5rem;
  margin-bottom: 30px;
  line-height: 1.4;
  background: var(--bg-light);
  padding: 30px;
  border-radius: 12px;
}

/* Options */
.options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  transition: opacity 0.3s ease;
}

.option {
  padding: 20px;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
  color: white;
  border: none;
  text-align: left;
}

.option:hover {
  transform: scale(1.02);
}

.option:nth-child(1) { background: var(--option-1); }
.option:nth-child(2) { background: var(--option-2); }
.option:nth-child(3) { background: var(--option-3); color: var(--bg); }
.option:nth-child(4) { background: var(--option-4); }

.option.selected {
  outline: 4px solid white;
}

.option.correct {
  outline: 4px solid var(--secondary);
  animation: correct 0.5s;
}

.option.wrong {
  opacity: 0.5;
}

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

.host-options .option {
  cursor: default;
}

.answer-count {
  margin-top: 20px;
  font-size: 1.2rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 600px) {
  .options {
    grid-template-columns: 1fr;
  }

  .question-text {
    font-size: 1.2rem;
    padding: 20px;
  }

  .game-code {
    font-size: 2rem;
    letter-spacing: 5px;
  }
}

/* Team Rank in reveal */
.reveal-team-rank {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary);
}
