/* ─── Display Styles ─────────────────────────────────────────────────────── */

body {
  background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
}

/* ─── LOBBY ─────────────────────────────────────────────────────────────── */

.lobby-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 40px;
  gap: 30px;
}

.lobby-header {
  text-align: center;
}

.game-title {
  font-size: 4rem;
  font-weight: 900;
  background: linear-gradient(135deg, #FF6B35, #FFE66D, #4ECDC4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 4px;
  text-shadow: none;
}

.game-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 6px;
  text-transform: uppercase;
}

.lobby-content {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 30px;
  min-height: 0;
}

.qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.qr-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.qr-code-container {
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-code-container img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
}

.game-code-display {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.code-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.code-value {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--color-accent);
}

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

.players-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.players-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-count-badge {
  background: var(--color-accent);
  color: white;
  font-size: 0.9rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.teams-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.team-column {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-header {
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-glass);
}

.team-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.team-players-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.team-player-item {
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.team-player-item:hover {
  background: rgba(255, 255, 255, 0.12);
}

.team-player-item .player-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.unassigned-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.unassigned-player {
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 0.95rem;
  animation: fadeIn 0.3s ease;
}

.timer-setting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 0;
}

.timer-setting-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.timer-setting-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timer-setting-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-accent);
  min-width: 50px;
  text-align: center;
}

.timer-adj {
  padding: 6px 14px !important;
  font-size: 0.9rem !important;
}

.lobby-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding-top: 8px;
}

/* ─── BOARD ─────────────────────────────────────────────────────────────── */

.board-layout {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 30px 40px;
  gap: 20px;
}

.board-header {
  display: flex;
  justify-content: center;
}

.score-cards {
  display: flex;
  gap: 30px;
}

.score-card {
  background: var(--bg-glass);
  border: 2px solid var(--team-color);
  border-radius: var(--radius-lg);
  padding: 12px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.3s;
}

.score-card.active {
  box-shadow: 0 0 25px rgba(var(--team-color), 0.4);
  transform: scale(1.05);
}

.score-team-name {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.score-value {
  font-size: 2rem;
  font-weight: 900;
}

.board-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.game-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 900px;
}

.board-field {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  position: relative;
  transition: all 0.3s;
  border: 2px solid transparent;
}

.board-field.start {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.board-field.finish {
  background: linear-gradient(135deg, rgba(255,107,53,0.3), rgba(255,230,109,0.3));
  border-color: var(--color-accent);
}

.board-field.explain {
  background: var(--color-explain-bg);
  border-color: rgba(78, 205, 196, 0.3);
}

.board-field.draw {
  background: var(--color-draw-bg);
  border-color: rgba(255, 230, 109, 0.3);
}

.board-field.pantomime {
  background: var(--color-pantomime-bg);
  border-color: rgba(255, 107, 138, 0.3);
}

.board-field .field-icon {
  font-size: 1.4rem;
}

.board-field .field-number {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.board-field .team-tokens {
  position: absolute;
  bottom: 4px;
  display: flex;
  gap: 4px;
}

.team-token {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid white;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.board-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.turn-info {
  font-size: 1.3rem;
  font-weight: 600;
  padding: 16px 32px;
  text-align: center;
}

.turn-team {
  font-weight: 800;
}

.turn-player {
  font-weight: 500;
  color: var(--text-secondary);
  display: block;
  font-size: 1rem;
  margin-top: 4px;
}

/* ─── ROUND ─────────────────────────────────────────────────────────────── */

.round-layout {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 40px;
}

.round-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
}

.round-scores {
  display: flex;
  gap: 16px;
}

.mini-score {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.1rem;
  font-weight: 700;
}

.mini-team-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.round-category {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-glass);
  border-radius: var(--radius-xl);
  padding: 10px 24px;
}

.category-icon {
  font-size: 1.6rem;
}

.category-label {
  font-size: 1.3rem;
  font-weight: 700;
}

.round-timer {
  display: flex;
  align-items: center;
}

.round-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.draw-area {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.display-canvas {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 0 40px rgba(0,0,0,0.3);
  max-width: 100%;
  max-height: 100%;
}

.category-display {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.category-big-icon {
  font-size: 8rem;
  animation: bounce 2s ease infinite;
}

.category-big-label {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.round-stats {
  display: flex;
  gap: 40px;
  margin-top: 20px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-value {
  font-size: 3rem;
  font-weight: 900;
}

.stat-label {
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.round-footer {
  padding-top: 16px;
  text-align: center;
}

.active-player-info {
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.active-player-name {
  font-weight: 800;
  color: var(--text-primary);
}

.active-team-name {
  font-weight: 800;
}

.active-player-label {
  margin: 0 6px;
}

/* ─── SUMMARY ───────────────────────────────────────────────────────────── */

.summary-container {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-card {
  text-align: center;
  padding: 50px 60px;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.summary-icon {
  font-size: 4rem;
}

.summary-card h2 {
  font-size: 2rem;
  font-weight: 800;
}

.summary-team {
  font-size: 1.4rem;
  font-weight: 700;
  padding: 8px 24px;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
}

.summary-stats {
  display: flex;
  gap: 30px;
  margin: 16px 0;
}

.summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.summary-stat.highlight .summary-stat-value {
  font-size: 3rem;
  color: var(--color-accent);
}

.summary-stat-value {
  font-size: 2rem;
  font-weight: 900;
}

.summary-stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ─── GAME OVER ─────────────────────────────────────────────────────────── */

.gameover-container {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(255,107,53,0.1), transparent 70%);
}

.gameover-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  position: relative;
}

.trophy {
  font-size: 8rem;
  animation: bounce 1.5s ease infinite;
}

.winner-title {
  font-size: 3.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, #FFE66D, #FF6B35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.final-scores {
  display: flex;
  gap: 30px;
  margin: 16px 0;
}

.final-score-card {
  background: var(--bg-glass);
  border-radius: var(--radius-lg);
  padding: 20px 40px;
  text-align: center;
  border: 2px solid var(--border-glass);
}

.final-score-card.winner {
  border-color: var(--color-accent);
  box-shadow: 0 0 30px rgba(255, 107, 53, 0.3);
}

.final-score-team {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.final-score-value {
  font-size: 2.5rem;
  font-weight: 900;
}

/* Word correct flash */
.word-correct-flash {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 5rem;
  z-index: 100;
  animation: correctFlash 0.8s ease forwards;
  pointer-events: none;
}

@keyframes correctFlash {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

.word-skip-flash {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 4rem;
  z-index: 100;
  animation: correctFlash 0.6s ease forwards;
  pointer-events: none;
}
