* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f0f1a;
  color: #e0e0e0;
  min-height: 100vh;
}

#app {
  max-width: 800px;
  margin: 0 auto;
}

.screen { display: none; }
.screen.active { display: block; }
.hidden { display: none !important; }

/* Login */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90vh;
  padding: 20px;
  gap: 16px;
}

.login-container h1, .main-header h1 {
  font-size: 1.4rem;
  text-align: center;
  color: #f0c040;
  text-shadow: 0 0 20px rgba(240,192,64,0.3);
}

.subtitle {
  color: #888;
  text-align: center;
  font-size: 0.9rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 320px;
}

.input-group label {
  font-size: 0.85rem;
  color: #aaa;
}

.input-group input, .input-group select {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #333;
  background: #1a1a2e;
  color: #e0e0e0;
  font-size: 1rem;
  width: 100%;
}

.input-group input:focus, .input-group select:focus {
  outline: none;
  border-color: #f0c040;
}

.btn {
  padding: 14px 28px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
  touch-action: manipulation;
}

.btn:active { transform: scale(0.96); }

.btn-primary { background: #f0c040; color: #1a1a2e; font-weight: 700; }
.btn-primary:hover { opacity: 0.9; }
.btn-success { background: #2ecc71; color: #fff; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-warning { background: #e67e22; color: #fff; }
.btn-sm { padding: 10px 18px; font-size: 0.85rem; }

.small { font-size: 0.8rem; color: #888; }

/* Initial Game */
.container {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 90vh;
}

.container h2 { font-size: 1.2rem; color: #f0c040; }

.init-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.init-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #1a1a2e;
  border: 1px solid #333;
  border-radius: 12px;
  color: #e0e0e0;
  cursor: pointer;
  text-align: left;
  font-size: 0.85rem;
  transition: border-color 0.2s;
  touch-action: manipulation;
}

.init-btn:active { border-color: #f0c040; background: #222240; }

.init-icon { font-size: 1.5rem; }
.init-text { flex: 1; line-height: 1.3; }
.init-pts { color: #2ecc71; font-weight: 700; white-space: nowrap; }

.result-msg { color: #f0c040; font-size: 1rem; text-align: center; padding: 12px; }

.team-choice {
  display: flex;
  gap: 12px;
}

.btn-team {
  flex: 1;
  padding: 20px;
  border-radius: 14px;
  border: 2px solid transparent;
  font-size: 1rem;
  cursor: pointer;
  text-align: center;
  transition: transform 0.1s, border-color 0.2s;
  touch-action: manipulation;
}

.btn-team:active { transform: scale(0.96); }
.btn-team.emma { background: #1a1a3e; color: #7eb8ff; border-color: #335599; }
.btn-team.emma:active { border-color: #7eb8ff; }
.btn-team.lucas { background: #3e1a1a; color: #ff7e7e; border-color: #993333; }
.btn-team.lucas:active { border-color: #ff7e7e; }

.captain-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
  font-size: 0.9rem;
  color: #ccc;
}

.captain-toggle input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #f0c040;
}

.team-name { font-weight: 700; }

/* Header */
.main-header {
  padding: 12px 16px 8px;
  border-bottom: 1px solid #222;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-gear {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  color: #666;
}

.player-info {
  font-size: 0.8rem;
  color: #888;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.captain-badge {
  background: #f0c040;
  color: #1a1a2e;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
}

.logout-btn {
  background: none;
  border: 1px solid #444;
  color: #aaa;
  padding: 2px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  cursor: pointer;
  margin-left: auto;
}

/* Scores */
.scores {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
}

.score-card {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 12px;
}

.score-card.emma { background: rgba(126,184,255,0.1); }
.score-card.lucas { background: rgba(255,126,126,0.1); }

.score-team { font-size: 0.8rem; color: #888; }
.score-value { font-size: 2rem; font-weight: 800; }
.score-card.emma .score-value { color: #7eb8ff; }
.score-card.lucas .score-value { color: #ff7e7e; }

.score-vs { font-weight: 700; color: #666; font-size: 0.9rem; }

/* Main Grid */
.main-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
}

.main-actions h2, .main-players h2 {
  font-size: 0.9rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.actions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 12px;
  border-radius: 14px;
  border: 1px solid #333;
  background: #1a1a2e;
  color: #e0e0e0;
  cursor: pointer;
  min-width: 90px;
  flex: 1;
  transition: transform 0.1s, opacity 0.2s;
  touch-action: manipulation;
}

.action-btn:active:not(:disabled) { transform: scale(0.95); }
.action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.action-icon { font-size: 1.5rem; }
.action-label { font-size: 0.75rem; }
.action-pts { font-size: 0.85rem; font-weight: 700; }
.action-btn.bonne-reponse .action-pts { color: #2ecc71; }
.action-btn.indice-trouve .action-pts { color: #f39c12; }
.action-btn.grand-jeu .action-pts { color: #e74c3c; }

.action-cooldown {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #555;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: #aaa;
}

.action-cooldown.active {
  border-color: #f0c040;
  color: #f0c040;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Time Controls */
.time-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.time-block {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  background: #1a1a2e;
  border: 1px solid #333;
}

.time-block h4 { font-size: 0.85rem; margin-bottom: 4px; }
.time-desc { font-size: 0.7rem; color: #888; margin-bottom: 8px; }

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.stepper-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid #444;
  background: #222;
  color: #e0e0e0;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stepper-value { font-size: 1.4rem; font-weight: 700; min-width: 40px; text-align: center; }
.stepper-unit { font-size: 0.8rem; color: #888; }

/* Section divider */
.section-divider {
  border: none;
  border-top: 1px solid #333;
  margin: 16px 0;
}

/* Mini-jeux */
.minigame-card {
  background: #1a1a2e;
  border: 1px solid #333;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}

.minigame-card h3 {
  font-size: 1rem;
  color: #f0c040;
  margin-bottom: 10px;
}

.mg-hint {
  font-size: 0.75rem;
  color: #888;
  margin: 6px 0;
}

.mg-target-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mg-target-form select {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #333;
  background: #222;
  color: #e0e0e0;
  font-size: 0.9rem;
}

.mg-phase-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f0c040;
  margin-bottom: 4px;
}

.mg-questions-left {
  font-size: 0.8rem;
  color: #888;
}

.mg-question-box {
  background: #222240;
  border-radius: 12px;
  padding: 14px;
  margin: 10px 0;
}

.mg-q-statement {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.mg-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mg-option {
  flex: 1;
  min-width: 80px;
  padding: 14px 10px;
  border-radius: 12px;
  border: 2px solid #444;
  background: #1a1a2e;
  color: #e0e0e0;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s;
  touch-action: manipulation;
}

.mg-option:active { border-color: #f0c040; }
.mg-option.selected { border-color: #2ecc71; background: #1a3a2e; }
.mg-option.correct { border-color: #2ecc71; background: #1a3a2e; }
.mg-option.wrong { border-color: #e74c3c; background: #3a1a1e; }

.mg-vote-count {
  font-size: 0.8rem;
  color: #888;
  margin-top: 8px;
}

.mg-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* Player list */
#players-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #1a1a2e;
  border-radius: 10px;
  border: 1px solid #222;
}

.player-row.emma { border-left: 3px solid #7eb8ff; }
.player-row.lucas { border-left: 3px solid #ff7e7e; }
.player-row.no-team { border-left: 3px solid #555; }

.player-name { font-weight: 600; font-size: 0.9rem; }
.player-pts { color: #888; font-size: 0.8rem; }
.player-captain-badge {
  background: #f0c040;
  color: #1a1a2e;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  margin-left: 6px;
}

/* Notifications */
.notif-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 300px;
  overflow-y: auto;
}

.notif-item {
  padding: 6px 10px;
  font-size: 0.8rem;
  background: #1a1a2e;
  border-radius: 8px;
  border-left: 3px solid #555;
}

.notif-item.emma { border-left-color: #7eb8ff; }
.notif-item.lucas { border-left-color: #ff7e7e; }

.notif-pseudo { font-weight: 600; }
.notif-reason { color: #aaa; }
.notif-amount { font-weight: 700; }
.notif-amount.pos { color: #2ecc71; }
.notif-amount.neg { color: #e74c3c; }

/* Admin */
.assign-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.assign-form input, .assign-form select {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #1a1a2e;
  color: #e0e0e0;
  font-size: 0.9rem;
}

.assign-form .btn { align-self: flex-start; }

/* Responsive */
@media (min-width: 640px) {
  .main-grid {
    flex-direction: row;
  }
  .main-actions {
    flex: 1;
  }
  .main-players {
    flex: 1;
  }
}

/* Player mini-game vote area */
#mg-player-vote-area .mg-option {
  max-width: 200px;
}

/* Boss Quiz - Text responses */
.mg-responses-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
}

.mg-response-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #1a1a2e;
  border-radius: 10px;
  border: 1px solid #333;
}

.mg-response-item.validated {
  border-color: #2ecc71;
  background: #1a3a2e;
}

.mg-response-item.rejected {
  border-color: #555;
  opacity: 0.7;
}

.response-pseudo {
  font-weight: 600;
  font-size: 0.85rem;
  min-width: 80px;
}

.response-text {
  flex: 1;
  font-size: 0.85rem;
  color: #ccc;
}

.response-status {
  font-size: 1rem;
}

.validate-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: #888;
  cursor: pointer;
}

.validate-toggle input {
  width: 18px;
  height: 18px;
  accent-color: #2ecc71;
}

/* Text answer input for players */
.mg-text-answer {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.mg-text-answer input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #333;
  background: #1a1a2e;
  color: #e0e0e0;
  font-size: 0.9rem;
}

.mg-text-answer input:focus {
  outline: none;
  border-color: #f0c040;
}
