/* games/kahoot.css — Tout le design de l'écran de jeu Kahoot.
   Classes 100% indépendantes des autres jeux (préfixe kh-), rien n'est
   partagé, pour pouvoir faire évoluer ce jeu sans jamais toucher les autres.
   Identité visuelle façon Kahoot : fond violet, question sur bandeau blanc,
   4 tuiles de réponse rouge/bleu/jaune/vert. */

body.theme-kahoot {
  background: radial-gradient(circle at top, #46178f 0%, #200a45 80%);
  align-items: flex-start;
}

body.theme-kahoot #app {
  max-width: 1000px;
  padding: 40px 48px;
}

/* --- Écran de jeu --- */

.kh-screen {
  width: 100%;
}

.kh-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 4px;
}

.kh-title {
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.kh-pill {
  background: rgba(255, 166, 2, 0.14);
  border: 1px solid #ffa602;
  color: #ffa602;
  font-size: 0.75rem;
  padding: 5px 14px;
  border-radius: 100px;
  font-weight: bold;
  white-space: nowrap;
}

.kh-body {
  background: transparent;
}

/* --- Chrono de la question --- */

.kh-timer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.kh-timer-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #864cbf;
  border: 3px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  font-weight: bold;
  flex-shrink: 0;
}

.kh-timer-track {
  flex: 1;
  height: 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.kh-timer-bar {
  height: 100%;
  background: #ffa602;
  border-radius: inherit;
  transition: width 0.1s linear;
}

/* --- Question sur bandeau blanc, comme dans le vrai Kahoot --- */

.kh-question {
  background: #fff;
  color: #201a2e;
  font-size: 1.35rem;
  font-weight: bold;
  text-align: center;
  border-radius: 12px;
  padding: 22px 28px;
  margin-bottom: 18px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

/* --- Grille des réponses (rouge / bleu / jaune / vert) --- */

.kh-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.kh-answer {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  width: 100%;
  margin: 0;
  padding: 16px 20px;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: bold;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.kh-answer-0 { background: #e21b3c; }
.kh-answer-1 { background: #1368ce; }
.kh-answer-2 { background: #d89e00; }
.kh-answer-3 { background: #26890c; }

button.kh-answer {
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
}

button.kh-answer:hover {
  transform: translateY(-2px);
  opacity: 1;
}

.kh-answer.selected {
  outline: 3px solid #fff;
}

.kh-answer.dimmed {
  opacity: 0.35;
}

/* Bonne réponse mise en avant sur l'écran de résultats */
.kh-answer.correct {
  outline: 3px solid #fff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.35);
}

.kh-answer-shape {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.kh-answer-text {
  flex: 1;
}

/* Nombre de joueurs ayant choisi cette réponse (écran de résultats) */
.kh-answer-count {
  background: rgba(0, 0, 0, 0.28);
  padding: 3px 12px;
  border-radius: 100px;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* --- Mon résultat personnel après chaque question --- */

.kh-my-result {
  text-align: center;
  font-weight: bold;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.kh-my-result.good {
  background: rgba(38, 137, 12, 0.25);
  border: 1px solid #4caf2c;
  color: #8ee06f;
}

.kh-my-result.bad {
  background: rgba(226, 27, 60, 0.2);
  border: 1px solid #e21b3c;
  color: #ff8ba0;
}

/* --- Classement (top 5 entre les questions, complet sous le podium) --- */

.kh-board {
  list-style: none;
  padding: 0;
  margin: 0 auto 16px;
  max-width: 520px;
}

.kh-board li {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 8px 14px;
  margin-bottom: 8px;
}

.kh-board li.me {
  outline: 2px solid #ffa602;
}

.kh-board-rank {
  width: 36px;
  text-align: center;
  font-weight: bold;
  flex-shrink: 0;
}

.kh-board .avatar {
  width: 34px;
  height: 34px;
}

.kh-board-name {
  flex: 1;
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kh-board-gain {
  color: #8ee06f;
  font-weight: bold;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.kh-board-score {
  color: #ffa602;
  font-weight: bold;
  flex-shrink: 0;
}

/* --- Podium final --- */

.kh-winner {
  text-align: center;
  font-size: 1.4rem;
  font-weight: bold;
  margin: 0 0 24px;
}

.kh-podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 28px;
}

.kh-podium-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 120px;
}

.kh-podium-step .avatar {
  width: 56px;
  height: 56px;
}

.kh-podium-name {
  font-weight: bold;
  font-size: 0.9rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kh-podium-block {
  width: 100%;
  border-radius: 10px 10px 0 0;
  text-align: center;
  font-weight: bold;
  padding: 10px 0;
  color: #201a2e;
}

.kh-podium-step.first .kh-podium-block {
  height: 110px;
  background: #ffa602;
}

.kh-podium-step.second .kh-podium-block {
  height: 80px;
  background: #b9b9c9;
}

.kh-podium-step.third .kh-podium-block {
  height: 60px;
  background: #c77b30;
}

/* --- Boutons d'action de l'hôte --- */

#kahootNextBtn {
  display: block;
  max-width: 320px;
  margin: 0 auto 12px;
  background: #ffa602;
  color: #201a2e;
}

#kahootEndBtn {
  display: block;
  max-width: 260px;
  margin: 16px auto 0;
}

/* --- Modal de config (choix du quiz), propre à Kahoot --- */

.kh-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.kh-modal {
  width: 100%;
  max-width: 360px;
  background: #2b1155;
  border: 1px solid #46178f;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.kh-modal h2 {
  margin: 0 0 16px;
  text-align: center;
  font-size: 1.2rem;
}

.kh-modal-field {
  display: block;
  font-size: 0.8rem;
  color: #b9a6d9;
  margin-bottom: 12px;
}

.kh-modal-field select {
  width: 100%;
  margin-top: 4px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #46178f;
  background: #1a0a33;
  color: #eaeaea;
  font-size: 1rem;
}

.kh-modal button:not(.secondary) {
  background: #ffa602;
  color: #201a2e;
}
