/* ===== PAGE ANIMATEUR ===== */

.page-animateur {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Écran de création */
#ecran-creation {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.creation-card {
  width: 100%;
  max-width: 480px;
  text-align: center;
}

.creation-card .emoji-hero {
  font-size: 4rem;
  margin-bottom: 16px;
  display: block;
}

.creation-card h2 {
  margin-bottom: 8px;
  font-size: 1.8rem;
}

.creation-card p {
  color: var(--text-muted);
  margin-bottom: 32px;
}

.creation-card .form-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.creation-card label {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Écran principal de jeu */
#ecran-jeu {
  display: none;
  flex: 1;
  padding: 24px 16px;
  gap: 24px;
}

#ecran-jeu.actif {
  display: flex;
  flex-direction: column;
}

/* En-tête de salle */
.salle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
}

.salle-info h2 {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.salle-info .code-salle {
  font-family: 'Courier New', monospace;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  background: linear-gradient(90deg, var(--purple-light), var(--yellow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Layout grille */
.jeu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 24px;
}

.jeu-col-left  { display: flex; flex-direction: column; gap: 24px; }
.jeu-col-right { display: flex; flex-direction: column; gap: 24px; }

/* Zone buzzer */
.buzzer-zone {
  position: relative;
}

.buzzer-zone .card-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-weight: 700;
}

.buzzer-display {
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}

.buzzer-display.en-attente {
  background: var(--bg3);
  border: 2px dashed var(--border);
}

.buzzer-display.buzze {
  background: linear-gradient(135deg, rgba(255, 214, 10, 0.12), rgba(255, 107, 53, 0.12));
  border: 2px solid var(--yellow);
  animation: flash-bg 0.5s ease 2;
}

.buzzer-display.en-attente .placeholder {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
}

.buzzer-display.en-attente .placeholder .icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 8px;
}

.equipe-buzzee {
  text-align: center;
  animation: bounce-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.equipe-buzzee .equipe-nom {
  font-size: 2rem;
  font-weight: 900;
  color: var(--yellow);
  text-shadow: 0 0 20px var(--yellow-glow);
  line-height: 1.2;
  word-break: break-word;
}

.equipe-buzzee .buzz-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Contrôle du mode buzzer */
.mode-control {
  margin-bottom: 16px;
}

.mode-control .mode-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 700;
}

.mode-btns {
  display: flex;
  gap: 8px;
}

.mode-btns .btn-mode {
  flex: 1;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg3);
  color: var(--text-muted);
  -webkit-tap-highlight-color: transparent;
}

.mode-btns .btn-mode:hover {
  color: var(--text);
  border-color: var(--border);
}

.mode-btns .btn-mode.actif-mode {
  background: var(--bg3);
  color: var(--text);
}

.mode-btns .btn-mode[data-mode="inactif"].actif-mode {
  background: rgba(239, 35, 60, 0.12);
  border-color: var(--red);
  color: var(--red);
}

.mode-btns .btn-mode[data-mode="actif"].actif-mode {
  background: rgba(6, 214, 160, 0.12);
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 16px rgba(6, 214, 160, 0.2);
}

.mode-btns .btn-mode[data-mode="test"].actif-mode {
  background: rgba(168, 85, 247, 0.12);
  border-color: var(--purple-light);
  color: var(--purple-light);
}

/* Indicateur de mode dans le header */
.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.3s;
}

.mode-badge.mode-inactif {
  background: rgba(239, 35, 60, 0.12);
  border: 1px solid var(--red);
  color: var(--red);
}

.mode-badge.mode-actif {
  background: rgba(6, 214, 160, 0.15);
  border: 1px solid var(--green);
  color: var(--green);
  box-shadow: 0 0 12px rgba(6, 214, 160, 0.2);
  animation: pulse-mode 2s ease infinite;
}

.mode-badge.mode-test {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid var(--purple-light);
  color: var(--purple-light);
}

@keyframes pulse-mode {
  0%, 100% { box-shadow: 0 0 8px rgba(6, 214, 160, 0.2); }
  50%       { box-shadow: 0 0 20px rgba(6, 214, 160, 0.4); }
}

/* Log mode test */
.test-log {
  margin-top: 12px;
  max-height: 100px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.test-log-ligne {
  font-size: 0.85rem;
  color: var(--purple-light);
  padding: 4px 8px;
  background: rgba(168, 85, 247, 0.08);
  border-radius: 4px;
  animation: bounce-in 0.2s ease;
}

.test-log-ligne .check { color: var(--green); margin-right: 4px; }

.buzzer-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.buzzer-actions .btn {
  flex: 1;
}

/* QR Code */
.qr-zone {
  text-align: center;
}

.qr-zone .card-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-weight: 700;
}

#qr-img {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-sm);
  background: white;
  padding: 6px;
  display: block;
  margin: 0 auto 12px;
}

.qr-url {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  word-break: break-all;
  line-height: 1.4;
}

/* Joueurs connectés */
.joueurs-zone .card-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 700;
}

#liste-joueurs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
}

.joueur-tag {
  padding: 6px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  animation: bounce-in 0.3s ease;
}

.joueurs-vide {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
}

/* Tableau des scores */
.scores-zone .card-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#tableau-scores {
  width: 100%;
  border-collapse: collapse;
}

#tableau-scores th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

#tableau-scores td {
  padding: 12px;
  border-bottom: 1px solid rgba(58, 54, 96, 0.4);
  vertical-align: middle;
}

#tableau-scores tr:last-child td {
  border-bottom: none;
}

#tableau-scores .equipe-nom-score {
  font-weight: 700;
  font-size: 1rem;
}

#tableau-scores .score-val {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--yellow);
  display: inline-block;
  min-width: 40px;
  text-align: center;
  transition: transform 0.3s;
}

#tableau-scores .score-val.bump {
  animation: score-bump 0.4s ease;
}

#tableau-scores .score-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

#tableau-scores .btn-score {
  min-height: 36px;
  width: 36px;
  padding: 0;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scores-vide {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-style: italic;
}

/* Responsive */
@media (max-width: 900px) {
  .jeu-grid {
    grid-template-columns: 1fr;
  }
  .jeu-col-left, .jeu-col-right {
    gap: 16px;
  }
}

@media (max-width: 600px) {
  .salle-header { flex-direction: column; text-align: center; }
  #ecran-jeu { padding: 16px 12px; }
  .card { padding: 16px; }
}

/* ===== MESSAGE ZONE ===== */
.message-zone .card-title { margin-bottom: 12px; }

.message-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.btn-preset {
  padding: 8px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
}
.btn-preset:hover {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--purple);
  color: var(--purple-light);
}
.btn-preset:active { transform: scale(0.95); }

.message-custom {
  display: flex;
  gap: 8px;
  align-items: center;
}
.message-custom .input { flex: 1; }

/* ===== MINUTEUR CARD ===== */
.minuteur-zone .card-title { margin-bottom: 14px; }

.minuteur-display { margin-bottom: 16px; }

.minuteur-temps {
  font-size: 3rem;
  font-weight: 900;
  font-family: 'Courier New', monospace;
  text-align: center;
  color: var(--green);
  transition: color 0.4s;
  line-height: 1;
  margin-bottom: 10px;
}
.minuteur-temps.attention { color: var(--orange); }
.minuteur-temps.urgent    { color: var(--red);    animation: shake 0.4s ease; }

.minuteur-barre-container {
  height: 10px;
  background: var(--bg3);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.minuteur-barre {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #0ff8a0);
  border-radius: 5px;
  width: 100%;
  transition: width 1s linear, background 0.5s;
}
.minuteur-barre.attention { background: linear-gradient(90deg, var(--orange), #ffaa44); }
.minuteur-barre.urgent    { background: linear-gradient(90deg, var(--red), #ff6680); }

.minuteur-actions {
  display: flex;
  gap: 10px;
}
.minuteur-actions .btn { flex: 1; }

/* ===== HISTORIQUE CARD ===== */
.historique-zone .card-title { margin-bottom: 12px; }

#liste-historique {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.historique-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  animation: bounce-in 0.25s ease;
}
.historique-num {
  font-weight: 900;
  color: var(--text-muted);
  min-width: 24px;
}
.historique-equipe { font-weight: 700; flex: 1; }
.historique-heure  { color: var(--text-muted); font-size: 0.8rem; font-family: 'Courier New', monospace; }
.historique-vide   { color: var(--text-muted); font-style: italic; font-size: 0.9rem; }
