/* ------------------------------------------------------------------
   Blindtest — feuille de style commune (joueur + admin)
   ------------------------------------------------------------------ */

:root {
  --fond: #0d0b1a;
  --fond-2: #17142c;
  --carte: #1e1a38;
  --carte-2: #272247;
  --bord: #362f5e;
  --texte: #f0edff;
  --texte-doux: #a29cc4;
  --accent: #7c5cff;
  --accent-clair: #a78bff;
  --rose: #ff4fa3;
  --vert: #2ee6a8;
  --orange: #ffb020;
  --rouge: #ff5470;
  --radius: 16px;
  --ombre: 0 10px 40px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--texte);
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(124, 92, 255, 0.28), transparent 60%),
    radial-gradient(800px 500px at 88% 110%, rgba(255, 79, 163, 0.22), transparent 60%),
    var(--fond);
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* --- Elements de base --------------------------------------------- */

button {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--texte);
  background: var(--carte-2);
  border: 1px solid var(--bord);
  border-radius: 12px;
  padding: 11px 16px;
  cursor: pointer;
  transition: transform 0.08s, filter 0.15s, background 0.15s;
}

button:hover:not(:disabled) {
  filter: brightness(1.18);
}

button:active:not(:disabled) {
  transform: scale(0.97);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

button.primaire {
  background: linear-gradient(135deg, var(--accent), var(--rose));
  border-color: transparent;
  color: #fff;
}

button.vert {
  background: var(--vert);
  border-color: transparent;
  color: #06251b;
}

button.rouge {
  background: var(--rouge);
  border-color: transparent;
  color: #2b0009;
}

button.fantome {
  background: transparent;
}

button.petit {
  padding: 7px 11px;
  font-size: 0.85rem;
  border-radius: 9px;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: 1rem;
  color: var(--texte);
  background: var(--fond-2);
  border: 1px solid var(--bord);
  border-radius: 12px;
  padding: 12px 14px;
  width: 100%;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.carte {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: var(--radius);
  padding: 18px;
}

.doux {
  color: var(--texte-doux);
}

.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--carte-2);
  border: 1px solid var(--bord);
}

.badge.actif {
  background: var(--vert);
  color: #06251b;
  border-color: transparent;
}

.badge.attente {
  background: var(--orange);
  color: #2b1a00;
  border-color: transparent;
}

.badge.correction {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.cache {
  display: none !important;
}

/* ==================================================================
   PAGE JOUEUR
   ================================================================== */

.joueur-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  max-width: 560px;
  margin: 0 auto;
}

.logo {
  text-align: center;
  margin-bottom: 26px;
}

.logo h1 {
  font-size: 2.3rem;
  background: linear-gradient(120deg, var(--accent-clair), var(--rose));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo p {
  margin: 6px 0 0;
  color: var(--texte-doux);
}

.ecran {
  animation: apparait 0.3s ease;
}

@keyframes apparait {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.barre-joueur {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: var(--radius);
}

.barre-joueur .nom {
  font-weight: 700;
  font-size: 1.05rem;
}

.barre-joueur .score {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--vert);
}

.gros-titre {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 6px;
}

.numero-question {
  text-align: center;
  color: var(--texte-doux);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 18px;
}

#zoneReponse textarea {
  min-height: 92px;
  font-size: 1.15rem;
  resize: none;
}

.bouton-envoi {
  width: 100%;
  margin-top: 12px;
  padding: 17px;
  font-size: 1.15rem;
  border-radius: 14px;
}

.pastille {
  width: 84px;
  height: 84px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
}

.pastille.ok {
  background: rgba(46, 230, 168, 0.16);
}

.pastille.attente {
  background: rgba(255, 176, 32, 0.16);
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    transform: scale(1.06);
    opacity: 0.85;
  }
}

.rappel-reponse {
  margin-top: 14px;
  padding: 14px;
  background: var(--fond-2);
  border-radius: 12px;
  border-left: 3px solid var(--accent);
  word-break: break-word;
}

.classement-liste {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.classement-liste li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--fond-2);
  margin-bottom: 8px;
}

.classement-liste li.moi {
  background: rgba(124, 92, 255, 0.22);
  outline: 1px solid var(--accent);
}

.classement-liste .rang {
  width: 26px;
  font-weight: 800;
  color: var(--texte-doux);
}

.classement-liste .pseudo {
  flex: 1;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.classement-liste .pts {
  font-weight: 800;
  color: var(--vert);
}

/* ==================================================================
   PANEL ADMIN
   ================================================================== */

.admin-page {
  padding: 16px;
  max-width: 1700px;
  margin: 0 auto;
}

.admin-barre {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.admin-barre h1 {
  font-size: 1.25rem;
}

.admin-barre .espace {
  flex: 1;
}

.grille {
  display: grid;
  grid-template-columns: 330px 1fr 430px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 1350px) {
  .grille {
    grid-template-columns: 1fr 1fr;
  }
  .grille .colonne-reponses {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .grille {
    grid-template-columns: 1fr;
  }
}

.colonne {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.entete-carte {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.entete-carte h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--texte-doux);
}

.entete-carte .espace {
  flex: 1;
}

/* --- Playlist ------------------------------------------------------ */

.playlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 4px;
}

.piste {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--fond-2);
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
}

.piste:hover {
  border-color: var(--bord);
}

.piste.courante {
  border-color: var(--accent);
  background: rgba(124, 92, 255, 0.16);
}

.piste.jouee {
  opacity: 0.5;
}

.piste .num {
  width: 24px;
  font-weight: 800;
  color: var(--texte-doux);
  flex-shrink: 0;
}

.piste .infos {
  flex: 1;
  min-width: 0;
}

.piste .infos .t {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.piste .infos .r {
  font-size: 0.8rem;
  color: var(--texte-doux);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Console de jeu ------------------------------------------------ */

.console-question {
  text-align: center;
  padding: 26px 18px;
}

.console-question .reponse-attendue {
  font-size: 2rem;
  font-weight: 800;
  margin: 8px 0 4px;
  background: linear-gradient(120deg, var(--accent-clair), var(--rose));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  word-break: break-word;
}

.chrono {
  font-size: 3.2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin: 10px 0;
}

.chrono.urgent {
  color: var(--rouge);
}

.controles {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 14px;
}

.controles button {
  flex: 1;
  min-width: 130px;
  padding: 15px;
}

.progression {
  height: 6px;
  border-radius: 999px;
  background: var(--fond-2);
  overflow: hidden;
  margin-top: 14px;
}

.progression div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--rose));
  width: 0;
  transition: width 0.2s linear;
}

/* --- Reponses en direct -------------------------------------------- */

.reponses {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 62vh;
  overflow-y: auto;
  padding-right: 4px;
}

.reponse {
  padding: 12px 14px;
  background: var(--fond-2);
  border-radius: 12px;
  border-left: 3px solid var(--bord);
}

.reponse.notee {
  border-left-color: var(--vert);
}

.reponse .haut {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.reponse .qui {
  font-weight: 700;
}

.reponse .quand {
  font-size: 0.75rem;
  color: var(--texte-doux);
}

.reponse .quoi {
  font-size: 1.25rem;
  font-weight: 600;
  word-break: break-word;
  margin-bottom: 10px;
}

.reponse .quoi.juste {
  color: var(--vert);
}

.notes {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.notes button {
  padding: 8px 13px;
  font-size: 0.9rem;
  border-radius: 9px;
  min-width: 46px;
}

.notes button.choisi {
  background: var(--vert);
  color: #06251b;
  border-color: transparent;
}

.notes button.choisi.zero {
  background: var(--rouge);
  color: #2b0009;
}

/* --- Joueurs -------------------------------------------------------- */

.joueurs {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 40vh;
  overflow-y: auto;
}

.joueur-ligne {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--fond-2);
  border-radius: 11px;
}

.joueur-ligne .point {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rouge);
  flex-shrink: 0;
}

.joueur-ligne .point.on {
  background: var(--vert);
}

.joueur-ligne .n {
  flex: 1;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.joueur-ligne .s {
  font-weight: 800;
  color: var(--vert);
  min-width: 38px;
  text-align: right;
}

/* --- Modales -------------------------------------------------------- */

.voile {
  position: fixed;
  inset: 0;
  background: rgba(5, 3, 15, 0.86);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
  backdrop-filter: blur(6px);
}

.modale {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: 22px;
  padding: 26px;
  max-width: 620px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--ombre);
}

.modale h2 {
  margin-bottom: 16px;
}

.qr-boite {
  text-align: center;
}

.qr-boite img {
  width: min(72vw, 400px);
  border-radius: 18px;
  background: #fff;
  padding: 14px;
}

.qr-url {
  margin-top: 16px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  word-break: break-all;
  color: var(--accent-clair);
}

.champ {
  margin-bottom: 14px;
}

.champ label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--texte-doux);
}

.deux-champs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.actions-modale {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.actions-modale button {
  flex: 1;
}
