/* Host Game View - TV Screen */
.host-game {
  min-height: 100vh;
  background: #f5f5f0;
  color: #1a1a1a;
  display: flex;
  flex-direction: column;
}

/* ============ GAME PHASES ============ */
.game-phase {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2rem;
}

.game-phase.hidden {
  display: none;
}

/* ============ QUESTION PHASE ============ */
.question-phase {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.question-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.round-badge {
  background: #1a1a1a;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.round-badge.turbo {
  background: linear-gradient(135deg, #f0e500 0%, #ff9800 100%);
  color: #1a1a1a;
  animation: turboPulse 1s ease-in-out infinite;
}

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

.category-badge {
  color: #888;
  font-size: 1rem;
}

/* Buzz Winner Badge */
.buzz-winner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(145deg, #f0e500, #d4c800);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1a1a1a;
  animation: buzzPulse 0.5s ease-out;
}

.buzz-winner.hidden {
  display: none;
}

.buzz-winner-icon {
  font-size: 1.1rem;
}

.buzz-winner-name {
  font-weight: 800;
}

@keyframes buzzPulse {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.timer-circle {
  width: 70px;
  height: 70px;
  background: #f0e500;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-circle.warning { background: #ff9800; }
.timer-circle.danger { background: #ff4444; color: #fff; }

.timer-number {
  font-size: 2rem;
  font-weight: 900;
}

.question-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

.question-image-container {
  max-width: 400px;
  max-height: 280px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.question-image-container.hidden { display: none; }

.question-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.question-text {
  font-size: 3.2rem;
  font-weight: 700;
  max-width: 1000px;
  line-height: 1.3;
}

.question-type-hint {
  font-size: 1rem;
  color: #888;
  font-style: italic;
}

/* Answers Display */
.answers-display {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 950px;
  margin: 0 auto;
  width: 100%;
}

.answer-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1.75rem;
  border-radius: 16px;
  color: #fff;
  transition: transform 0.2s, opacity 0.2s;
}

.answer-option.answer-a { background: linear-gradient(145deg, #ff6b6b, #ee5a5a); }
.answer-option.answer-b { background: linear-gradient(145deg, #4dabf7, #339af0); }
.answer-option.answer-c { background: linear-gradient(145deg, #ffd43b, #fab005); color: #1a1a1a; }
.answer-option.answer-d { background: linear-gradient(145deg, #69db7c, #51cf66); }

.answer-option .answer-letter {
  font-size: 2rem;
  font-weight: 900;
  width: 50px;
  text-align: center;
}

.answer-option .answer-content {
  font-size: 1.4rem;
  font-weight: 600;
  flex: 1;
}

.answer-option.correct {
  outline: 4px solid #00c853;
  outline-offset: 2px;
  transform: scale(1.02);
}

.answer-option.hidden-answer {
  opacity: 0;
  transform: translateY(20px);
}

.answer-option.reveal {
  animation: revealAnswer 0.3s ease forwards;
}

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

/* ============ RESULT PHASE ============ */
.result-phase {
  padding: 2rem;
  position: relative;
}

.result-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 2.5rem;
  height: 100%;
}

.result-main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Result Header */
.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.result-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.result-title {
  font-size: 2.8rem;
  font-weight: 700;
  margin: 0;
}

.next-timer {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.next-timer-circle {
  width: 56px;
  height: 56px;
  background: #f0e500;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 900;
}

.next-timer-text {
  display: flex;
  flex-direction: column;
}

.next-label {
  font-size: 0.7rem;
  color: #888;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.next-value {
  font-size: 1rem;
  font-weight: 700;
}

.next-arrow {
  width: 36px;
  height: 36px;
  background: #f0e500;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
}

/* Result Answer Section */
.result-answer-section {
  display: flex;
  gap: 2rem;
  background: #fff;
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  flex: 1;
}

.result-image-container {
  width: 360px;
  height: 240px;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
}

.result-image-container.hidden { display: none; }

.result-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-answer-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.result-question {
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.5;
}

.correct-answer-box {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: #fdfde8;
  padding: 1.5rem 2rem;
  border-radius: 16px;
}

.correct-check {
  width: 48px;
  height: 48px;
  background: #f0e500;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
}

.correct-answer-content {
  display: flex;
  flex-direction: column;
}

.correct-label {
  font-size: 0.85rem;
  color: #888;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.correct-text {
  font-size: 1.6rem;
  font-weight: 700;
}

/* Result Stats */
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.stat-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.stat-label {
  font-size: 0.9rem;
  color: #888;
}

.stat-icon {
  font-size: 1.5rem;
  opacity: 0.3;
}

.stat-value {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 900;
}

.stat-percent {
  font-size: 1rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
}

.stat-correct .stat-percent { background: #e8f5e9; color: #00c853; }
.stat-wrong .stat-percent { background: #ffebee; color: #ff4444; }

.stat-unit {
  font-size: 1rem;
  color: #888;
}

.stat-bar {
  height: 6px;
  background: #f0f0f0;
  border-radius: 3px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.stat-bar-fill.correct { background: #00c853; }
.stat-bar-fill.wrong { background: #ff4444; }
.stat-bar-fill.time { background: #4dabf7; }

/* Result Leaderboard */
.result-leaderboard {
  background: #fff;
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
}

.leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.leaderboard-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.leaderboard-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: #888;
  background: #f5f5f0;
  padding: 0.5rem 1rem;
  border-radius: 10px;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  overflow-y: auto;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: #fafafa;
}

.leaderboard-item.top-1 {
  background: #f0e500;
}

.leaderboard-rank {
  font-weight: 900;
  font-size: 1.3rem;
  width: 32px;
  text-align: center;
}

.leaderboard-avatar-wrapper {
  position: relative;
}

.leaderboard-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.leaderboard-points-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: #00c853;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  min-width: 32px;
  text-align: center;
}

.leaderboard-points-badge.negative {
  background: #ff4444;
}

.leaderboard-points-badge.zero {
  background: #888;
}

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

.leaderboard-name {
  font-weight: 600;
  font-size: 1.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-label {
  font-size: 0.8rem;
  color: #666;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.top-1 .leaderboard-label {
  color: #1a1a1a;
}

.leaderboard-score {
  font-weight: 900;
  font-size: 1.3rem;
}

/* ============ FINAL PHASE ============ */
.final-phase {
  display: flex;
  align-items: center;
  justify-content: center;
}

.final-content {
  text-align: center;
  max-width: 800px;
}

.final-title {
  font-size: 4rem;
  font-weight: 900;
  margin-bottom: 3rem;
}

/* Podium */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.podium-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #eee;
  overflow: hidden;
}

.podium-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.podium-name {
  font-weight: 700;
  font-size: 1.1rem;
}

.podium-score {
  font-weight: 600;
  color: #666;
}

.podium-stand {
  width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  border-radius: 12px 12px 0 0;
}

.first .podium-stand {
  height: 150px;
  background: linear-gradient(180deg, #ffd700, #b8860b);
}

.second .podium-stand {
  height: 110px;
  background: linear-gradient(180deg, #c0c0c0, #808080);
}

.third .podium-stand {
  height: 80px;
  background: linear-gradient(180deg, #cd7f32, #8b4513);
}

.first .podium-avatar {
  border: 4px solid #ffd700;
  width: 100px;
  height: 100px;
}

/* Final Leaderboard */
.final-leaderboard {
  max-width: 500px;
  margin: 0 auto 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.play-again-btn {
  padding: 1.25rem 3rem;
  font-size: 1.2rem;
  font-weight: 700;
  background: #f0e500;
  color: #1a1a1a;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.1s;
}

.play-again-btn:hover {
  transform: scale(1.02);
}

/* ============ PAUSE ============ */
.pause-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f5f5f0;
  border: 2px solid #ddd;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 1rem;
}

.pause-btn:hover {
  background: #eee;
  border-color: #ccc;
}

.pause-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.pause-overlay.hidden {
  display: none;
}

.pause-content {
  text-align: center;
  color: #fff;
}

.pause-icon {
  font-size: 5rem;
  display: block;
  margin-bottom: 1.5rem;
}

.pause-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 2rem;
}

.resume-btn {
  padding: 1rem 3rem;
  background: #f0e500;
  color: #1a1a1a;
  border: none;
  border-radius: 14px;
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s;
}

.resume-btn:hover {
  transform: scale(1.05);
}

/* ============ AI JOKE ============ */
.ai-joke-container {
  margin-top: 1.5rem;
  animation: fadeInUp 0.5s ease-out;
}

.ai-joke-container.hidden {
  display: none;
}

.ai-joke-bubble {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.ai-joke-icon {
  font-size: 3.5rem;
  flex-shrink: 0;
}

.ai-joke-text {
  color: white;
  font-size: 1.8rem;
  line-height: 1.5;
  margin: 0;
  font-style: italic;
}

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

/* ============ ANIMATIONS ============ */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1200px) {
  .result-layout {
    grid-template-columns: 1fr;
  }
  
  .result-leaderboard {
    max-height: 300px;
  }
}

@media (max-width: 768px) {
  .game-phase {
    padding: 1rem;
  }
  
  .question-text {
    font-size: 1.5rem;
  }
  
  .answers-display {
    grid-template-columns: 1fr;
  }
  
  .result-stats {
    grid-template-columns: 1fr;
  }
  
  .final-title {
    font-size: 2.5rem;
  }
  
  .podium-stand {
    width: 80px;
  }
}
