/* ============================================
   BOARD.CSS - Projector/Board Display
   ============================================ */

/* ========== Board Container ========== */
.board {
  width: 100vw;
  height: 100vh;
  background: #000000;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-family);
}

/* ========== Board Header ========== */
.board-header {
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.board-room-code {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--bg-card);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  letter-spacing: 0.2em;
  font-family: monospace;
}

.board-player-count {
  font-size: 1.25rem;
  color: var(--text-secondary);
}

.board-status {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ========== Board Question Display ========== */
.board-question {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 4rem;
  overflow-y: auto;
}

.board-question-number {
  font-size: 1.5rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 1rem;
  font-weight: 600;
}

.board-question-text {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 2rem;
  line-height: 1.3;
  color: #ffffff;
}

/* ========== Board Options ========== */
.board-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 0 2rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.board-options.two-options {
  grid-template-columns: 1fr 1fr;
  max-width: 1000px;
}

.board-option {
  padding: 1.5rem 2rem;
  border-radius: var(--radius-lg);
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition-normal);
  color: #ffffff;
  min-height: 100px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.board-option:nth-child(1) {
  background: var(--choice-a);
}

.board-option:nth-child(2) {
  background: var(--choice-b);
}

.board-option:nth-child(3) {
  background: var(--choice-c);
}

.board-option:nth-child(4) {
  background: var(--choice-d);
}

.board-option.correct {
  box-shadow: 0 0 30px currentColor, 0 0 60px currentColor;
  transform: scale(1.05);
  animation: pulse 1s ease infinite;
}

.board-option.incorrect {
  opacity: 0.3;
  filter: grayscale(0.8);
}

.board-option-label {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.board-option-text {
  flex: 1;
  line-height: 1.4;
}

/* ========== Board Bar Chart (Answer Distribution) ========== */
.board-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  height: 200px;
  padding: 0 4rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.board-bar {
  flex: 1;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  transition: height 0.5s ease;
  min-height: 4px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

.board-bar:nth-child(1) {
  background: var(--choice-a);
}

.board-bar:nth-child(2) {
  background: var(--choice-b);
}

.board-bar:nth-child(3) {
  background: var(--choice-c);
}

.board-bar:nth-child(4) {
  background: var(--choice-d);
}

.board-bar-count {
  position: absolute;
  top: -2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
}

.board-bar-label {
  position: absolute;
  bottom: -2rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* ========== Board Lobby ========== */
.board-lobby {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

.board-qr {
  max-width: 300px;
  margin: 2rem auto;
  background: #ffffff;
  padding: 1rem;
  border-radius: var(--radius-lg);
}

.board-qr img {
  width: 100%;
  height: auto;
  display: block;
}

.board-join-url {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 1rem 0;
  color: var(--accent);
}

.board-waiting-text {
  font-size: 2rem;
  color: var(--text-secondary);
  margin-top: 2rem;
  animation: pulse 2s ease infinite;
}

.board-players-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  max-width: 1200px;
  width: 100%;
}

.board-player-name {
  background: var(--bg-card);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
}

/* ========== Board Timer ========== */
.board-timer {
  font-size: 3rem;
  font-weight: 700;
  text-align: center;
  color: #ffffff;
  margin: 1rem 0;
}

.board-timer.timer-urgent {
  color: var(--error);
  animation: pulse 0.5s ease infinite;
}

.board-timer-label {
  font-size: 1rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ========== Board Podium (Final Results) ========== */
.board-podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 2rem;
  height: 60vh;
  padding: 2rem;
}

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

.podium-bar {
  width: 150px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 1.5rem;
  align-items: center;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.podium-place:nth-child(1) .podium-bar {
  height: 60%;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  order: 2;
}

.podium-place:nth-child(2) .podium-bar {
  height: 45%;
  background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
  order: 1;
}

.podium-place:nth-child(3) .podium-bar {
  height: 30%;
  background: linear-gradient(135deg, #cd7f32, #e89a5e);
  order: 3;
}

.podium-rank {
  font-size: 3rem;
  font-weight: 800;
  color: rgba(0, 0, 0, 0.8);
  margin-bottom: 0.5rem;
}

.podium-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #ffffff;
  position: absolute;
  bottom: 100%;
  margin-bottom: 0.75rem;
  white-space: nowrap;
}

.podium-score {
  font-size: 1.25rem;
  color: rgba(0, 0, 0, 0.6);
  font-weight: 600;
}

/* ========== Board Leaderboard ========== */
.board-leaderboard {
  padding: 2rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.board-leaderboard-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 2rem;
}

.board-leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.board-leaderboard-item {
  background: var(--bg-card);
  padding: 1rem 2rem;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 1.5rem;
}

.board-leaderboard-rank {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  min-width: 3rem;
  text-align: center;
}

.board-leaderboard-name {
  flex: 1;
  font-weight: 600;
}

.board-leaderboard-score {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--success);
}

/* ========== Animations ========== */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px currentColor;
  }
  50% {
    box-shadow: 0 0 40px currentColor;
  }
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .board-question-text {
    font-size: clamp(1.5rem, 4vw, 3rem);
  }

  .board-options {
    padding: 0 1rem 1rem;
  }

  .board-option {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    padding: 1rem 1.5rem;
  }

  .board-bar-chart {
    padding: 0 2rem 1rem;
  }
}

@media (max-width: 768px) {
  .board-header {
    padding: 0.75rem 1rem;
  }

  .board-question {
    padding: 1rem 1.5rem;
  }

  .board-options {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .board-podium {
    gap: 1rem;
  }

  .podium-bar {
    width: 100px;
  }

  .podium-name {
    font-size: 1.2rem;
  }
}
