/* ===== SETUP SCREEN ===== */
#screen-setup {
  background: linear-gradient(180deg, #0a0a2e 0%, #141450 50%, #0d0d3a 100%);
}

.setup-container {
  max-width: 700px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 28px;
  border: 1px solid rgba(255, 215, 0, 0.15);
}

.setup-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setup-section h3 {
  font-size: 0.9rem;
  color: var(--wwm-gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
}

.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-chip {
  padding: 10px 18px;
  border-radius: 30px;
  border: 2px solid var(--wwm-border);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dim);
  transition: all 0.2s;
  font-family: var(--font);
}

.category-chip:hover {
  border-color: rgba(255, 215, 0, 0.3);
}

.category-chip.active {
  border-color: var(--wwm-gold);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 171, 0, 0.1) 100%);
  color: var(--wwm-gold);
}

.source-selector {
  display: flex;
  gap: 10px;
}

.source-btn {
  flex: 1;
  padding: 14px 12px;
  border: 2px solid var(--wwm-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dim);
  transition: all 0.2s;
}

.source-btn:hover {
  border-color: rgba(255, 215, 0, 0.3);
}

.source-btn.active {
  border-color: var(--wwm-gold);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 171, 0, 0.1) 100%);
  color: var(--wwm-gold);
}

.difficulty-selector {
  display: flex;
  gap: 10px;
}

.diff-btn {
  flex: 1;
  padding: 12px 8px;
  border: 2px solid var(--wwm-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dim);
  transition: all 0.2s;
}

.diff-btn:hover {
  border-color: rgba(255, 215, 0, 0.3);
}

.diff-btn.active {
  border-color: var(--wwm-gold);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 171, 0, 0.1) 100%);
  color: var(--wwm-gold);
}

.kid-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dim);
}

.kid-toggle input[type="checkbox"] {
  accent-color: var(--wwm-gold);
  width: 20px;
  height: 20px;
}

.kid-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

.error-text {
  color: var(--danger);
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
}

.round-selector {
  display: flex;
  gap: 10px;
}

.round-btn {
  flex: 1;
  padding: 14px;
  border: 2px solid var(--wwm-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-dim);
  transition: all 0.2s;
}

.round-btn:hover {
  border-color: rgba(255, 215, 0, 0.3);
}

.round-btn.active {
  border-color: var(--wwm-gold);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 171, 0, 0.1) 100%);
  color: var(--wwm-gold);
}

.test-mode-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.test-mode-toggle:hover {
  opacity: 1;
}

.test-mode-toggle input[type="checkbox"] {
  accent-color: var(--wwm-gold);
}

/* ===== LOBBY SCREEN ===== */
#screen-lobby {
  background: linear-gradient(180deg, #0a0a2e 0%, #141450 50%, #0d0d3a 100%);
}

.lobby-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 600px;
}

.qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  border: 1px solid rgba(255, 215, 0, 0.12);
}

#qr-canvas {
  border-radius: var(--radius-sm);
}

.room-code-display {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--wwm-gold);
  letter-spacing: 8px;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.join-url {
  font-size: 0.85rem;
  color: var(--text-muted);
  word-break: break-all;
  text-align: center;
}

.players-section {
  width: 100%;
  border: 1px solid rgba(255, 215, 0, 0.12);
}

.players-section h3 {
  margin-bottom: 12px;
  color: var(--text-dim);
  font-size: 1rem;
}

.player-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.player-tag {
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--wwm-blue) 0%, var(--wwm-blue-light) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  font-weight: 700;
  font-size: 1rem;
  color: white;
  animation: bounceIn 0.3s ease-out;
}

/* ===== WWM GAME SCREEN ===== */
.wwm-screen {
  background: linear-gradient(180deg, #0a0a2e 0%, #0f1045 30%, #141465 60%, #0d0d3a 100%);
  background-size: 100% 100%;
  color: white;
  padding: 0;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
}

/* Spotlight effect */
.wwm-screen::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(26, 35, 126, 0.4) 0%, transparent 70%);
  pointer-events: none;
}

.wwm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 14px 24px;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(255, 215, 0, 0.1);
  position: relative;
  z-index: 1;
}

.wwm-progress {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--wwm-gold);
}

.wwm-category {
  font-size: 0.9rem;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  color: var(--text-dim);
}

.wwm-scores-toggle {
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-dim);
  transition: all 0.2s;
}

.wwm-scores-toggle:hover {
  background: rgba(255, 215, 0, 0.1);
  border-color: rgba(255, 215, 0, 0.2);
  color: var(--wwm-gold);
}

.wwm-scoreboard {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.3);
  width: 100%;
  position: relative;
  z-index: 1;
}

.wwm-score-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.wwm-score-item .points {
  font-weight: 800;
  color: var(--wwm-gold);
}

.wwm-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 950px;
  margin: 0 auto;
  padding: 24px;
  gap: 28px;
  position: relative;
  z-index: 1;
}

/* ===== Question Box - WWM Diamond Style ===== */
.wwm-question-box {
  background: linear-gradient(135deg, #0d1157 0%, #1a237e 30%, #283593 50%, #1a237e 70%, #0d1157 100%);
  border: 2px solid rgba(255, 215, 0, 0.2);
  border-radius: 20px;
  padding: 36px 44px;
  text-align: center;
  width: 100%;
  box-shadow:
    0 0 40px rgba(26, 35, 126, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.4);
  position: relative;
}

.wwm-question-box::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), transparent 40%, transparent 60%, rgba(255, 215, 0, 0.1));
  pointer-events: none;
  z-index: 0;
}

.wwm-question-box p {
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.4;
  color: white;
  position: relative;
  z-index: 1;
}

/* ===== Answer Boxes - WWM Style ===== */
.wwm-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
}

.wwm-answer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 28px;
  background: linear-gradient(135deg, #0d1157 0%, #1a237e 50%, #0d1157 100%);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  cursor: default;
  transition: all 0.4s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.wwm-answer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.answer-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 215, 0, 0.1);
  border: 2px solid rgba(255, 215, 0, 0.25);
  border-radius: 10px;
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--wwm-gold);
  flex-shrink: 0;
}

.answer-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: white;
}

.wwm-answer.correct {
  background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 50%, #1b5e20 100%) !important;
  border-color: #66bb6a !important;
  box-shadow: 0 0 30px rgba(76, 175, 80, 0.5), 0 0 60px rgba(76, 175, 80, 0.2);
  animation: correctPulse 0.6s ease-out;
}

.wwm-answer.correct .answer-letter {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
}

.wwm-answer.wrong {
  background: linear-gradient(135deg, #7f0000 0%, #b71c1c 50%, #7f0000 100%) !important;
  border-color: #ef5350 !important;
  box-shadow: 0 0 30px rgba(244, 67, 54, 0.5), 0 0 60px rgba(244, 67, 54, 0.2);
  animation: shake 0.5s ease-in-out;
}

.wwm-answer.wrong .answer-letter {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
}

@keyframes correctPulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.04); }
  60% { transform: scale(0.98); }
  100% { transform: scale(1); }
}

/* ===== Status Bar ===== */
.wwm-status {
  width: 100%;
  padding: 20px 24px;
  text-align: center;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  z-index: 1;
}

.wwm-status.buzzed {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.2) 0%, rgba(255, 215, 0, 0.15) 100%);
  color: var(--wwm-gold);
  font-size: 2.4rem;
  padding: 28px;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
  border-top-color: rgba(255, 215, 0, 0.15);
}

.wwm-status.result-correct {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.2) 0%, rgba(76, 175, 80, 0.1) 100%);
  color: #69f0ae;
  font-size: 2.4rem;
  padding: 28px;
  text-shadow: 0 0 30px rgba(105, 240, 174, 0.5);
  border-top-color: rgba(76, 175, 80, 0.15);
}

.wwm-status.result-wrong {
  background: linear-gradient(135deg, rgba(244, 67, 54, 0.2) 0%, rgba(244, 67, 54, 0.1) 100%);
  color: #ff5252;
  font-size: 2.4rem;
  padding: 28px;
  text-shadow: 0 0 30px rgba(255, 82, 82, 0.5);
  border-top-color: rgba(244, 67, 54, 0.15);
}

.wwm-timer {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.05);
  position: relative;
  z-index: 1;
}

.wwm-timer-bar {
  height: 100%;
  background: linear-gradient(90deg, #ff6b35, #ff9800, #ffd700);
  width: 100%;
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(255, 152, 0, 0.4);
}

/* ===== FINISHED SCREEN ===== */
#screen-finished {
  background: linear-gradient(180deg, #0a0a2e 0%, #141450 50%, #0d0d3a 100%);
}

.finished-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: 100%;
  max-width: 600px;
}

.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  margin: 20px 0;
}

.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: bounceIn 0.5s ease-out;
}

.podium-place .medal {
  font-size: 3rem;
}

.podium-place .podium-name {
  font-weight: 800;
  font-size: 1.2rem;
  color: white;
}

.podium-place .podium-score {
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--wwm-gold);
}

.podium-bar {
  width: 110px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.podium-place:nth-child(1) .podium-bar {
  height: 140px;
  background: linear-gradient(180deg, #FFD700, #FFA000);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.podium-place:nth-child(2) .podium-bar {
  height: 100px;
  background: linear-gradient(180deg, #C0C0C0, #808080);
  box-shadow: 0 0 20px rgba(192, 192, 192, 0.2);
}

.podium-place:nth-child(3) .podium-bar {
  height: 70px;
  background: linear-gradient(180deg, #CD7F32, #8B4513);
  box-shadow: 0 0 20px rgba(205, 127, 50, 0.2);
}

.final-scores {
  width: 100%;
  border: 1px solid rgba(255, 215, 0, 0.12);
}

.final-scores h3 {
  margin-bottom: 12px;
  color: var(--wwm-gold);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.scoreboard-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

.scoreboard-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.04);
}

.scoreboard-row .rank {
  font-weight: 800;
  color: var(--text-dim);
  width: 30px;
}

.scoreboard-row .name {
  flex: 1;
  font-weight: 700;
  color: white;
}

.scoreboard-row .points {
  font-weight: 900;
  color: var(--wwm-gold);
  font-size: 1.2rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .wwm-question-box {
    padding: 24px 20px;
  }

  .wwm-question-box p {
    font-size: 1.2rem;
  }

  .wwm-answers {
    grid-template-columns: 1fr;
  }

  .wwm-answer {
    padding: 16px 20px;
  }

  .answer-text {
    font-size: 1.05rem;
  }

  .wwm-main {
    padding: 14px;
    gap: 18px;
  }

  .wwm-status.buzzed,
  .wwm-status.result-correct,
  .wwm-status.result-wrong {
    font-size: 1.6rem;
    padding: 20px;
  }
}
