/* Commun aux deux pages (spec §5) */

:root {
  --bg: #10131a;
  --ink: #eef2f8;
  --muted: #7d8798;
  --ball: #ffca3a;
  --accent: #4cc9f0;
}

* {
  box-sizing: border-box;
}

/* `hidden` doit l'emporter sur TOUTE règle d'affichage.
 *
 * L'attribut n'est qu'un `display: none` posé par la feuille de style du
 * navigateur : la moindre règle d'auteur qui donne un `display` à l'élément —
 * un `.pad { display: flex }` — le rend inopérant, et l'élément reste visible
 * alors que le code croit l'avoir caché. La panne est silencieuse et ne
 * ressemble pas à un problème de style : sur la page d'administration, le
 * formulaire de connexion restait affiché après une connexion réussie, et la
 * console qui s'affichait derrière était poussée hors de l'écran.
 *
 * Cette règle remplace les corrections au cas par cas (`.diag[hidden]`) qui
 * traitaient le symptôme là où il avait été remarqué. */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 1.25rem;
  pointer-events: none;
}

.hint {
  font-size: clamp(0.75rem, 1.6vw, 1rem);
  color: var(--muted);
}

/* Nom de l'équipe sur la manette : dans sa couleur, celle de la bille. */
.team {
  font-size: clamp(0.9rem, 3.5vw, 1.3rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.team[hidden] {
  display: none;
}

/* ─── Choix d'équipe sur la manette ────────────────────────────────────────── */
/* Opaque et plein écran : tant qu'il n'a pas choisi, le joueur ne pilote rien,
   et voir son plateau derrière lui ferait croire qu'il joue déjà. */
.teampick {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem 1.5rem;
  background: var(--bg);
}

.teampick[hidden] {
  display: none;
}

.teampick-title {
  margin: 0;
  font-size: clamp(1.2rem, 6vw, 1.8rem);
  font-weight: 700;
}

.teampick-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: min(100%, 22rem);
}

/* Hautes et pleine largeur : on choisit debout, téléphone en main, sans viser. */
.teampick-btn {
  min-height: 4.5rem;
  border: 2px solid var(--team);
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--team) 18%, transparent);
  color: var(--team);
  font-size: clamp(1.1rem, 5vw, 1.5rem);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.teampick-btn:active {
  background: color-mix(in srgb, var(--team) 40%, transparent);
  color: var(--bg);
}

/* Fond de l'ecran partage : une lueur centrale qui donne de la profondeur sans
   concurrencer la bille. */
.screen {
  display: flex;
  background:
    radial-gradient(ellipse at 50% 45%, #1b2231 0%, var(--bg) 65%);
}

/* Le terrain prend la place restante. min-width: 0 est indispensable : sans
   lui, un element flex refuse de passer sous sa taille de contenu et la
   colonne laterale deborderait de l'ecran au lieu de retrecir le labyrinthe. */
.screen .stage {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
}

/* ─── Décompte / chronomètre (écran partagé) ───────────────────────────────── */

.chrono {
  position: absolute;
  left: 50%;
  top: 2.5vh;
  transform: translateX(-50%);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
  text-align: center;
  font-size: clamp(1.2rem, 3vw, 2.4rem);
}

/* Le décompte prend tout l'écran : il doit se voir depuis le fond de la salle. */
.chrono.is-countdown {
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(6rem, 30vw, 22rem);
  color: var(--accent);
  opacity: 0.9;
}

.chrono.is-won {
  color: #50dc8c;
  font-size: clamp(1.6rem, 5vw, 4rem);
}

.chrono.is-free {
  display: none;
}

/* ─── Console du maître du jeu ─────────────────────────────────────────────── */

.master {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: max(1rem, env(safe-area-inset-top)) 1rem 1rem;
  overflow: auto;
}

.mj-head {
  text-align: center;
}

.mj-phase {
  font-size: clamp(1.4rem, 7vw, 2.2rem);
  font-weight: 700;
}

.mj-phase.is-running {
  color: var(--ball);
}

.mj-phase.is-won {
  color: #50dc8c;
}

.mj-meta {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Barre de scènes : la navigation d'abord, les commandes du jeu en dessous.
   Trois onglets larges, atteignables au pouce sans regarder. */
.mj-scenes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.mj-scene {
  min-height: 3.2rem;
  border: 1px solid rgba(238, 242, 248, 0.2);
  border-radius: 0.75rem;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
}

.mj-scene.is-on {
  border-color: var(--accent);
  background: rgba(76, 201, 240, 0.15);
  color: var(--ink);
  font-weight: 600;
}

.mj-empty {
  margin: 0;
  text-align: center;
  color: var(--muted);
  line-height: 1.5;
}

.mj-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  justify-content: center;
}

/* Boutons hauts et pleine largeur : la console se pilote à une main, debout,
   sans regarder — le maître du jeu a les yeux sur la salle. */
.mj-btn {
  min-height: 4.5rem;
  border: 1px solid rgba(238, 242, 248, 0.25);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font: inherit;
  font-size: clamp(1rem, 4.5vw, 1.3rem);
  font-weight: 600;
  cursor: pointer;
}

.mj-btn:active {
  transform: scale(0.985);
  background: rgba(255, 255, 255, 0.1);
}

.mj-btn.is-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #08202b;
  min-height: 6rem;
}

.mj-btn.is-quiet {
  min-height: 3.2rem;
  font-size: 1rem;
  color: var(--muted);
}

/* Bascules d'affichage : secondaires, elles ne doivent pas concurrencer les
   commandes de partie sous le pouce. */
.mj-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.mj-toggle {
  min-height: 3rem;
  border: 1px solid rgba(238, 242, 248, 0.2);
  border-radius: 0.75rem;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.mj-toggle.is-on {
  border-color: var(--accent);
  background: rgba(76, 201, 240, 0.15);
  color: var(--ink);
  font-weight: 600;
}

.mj-note {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Effectifs par équipe, sous le titre : lisible d'un coup d'œil, à une main. */
.mj-squads {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.mj-squad {
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--team);
  border-radius: 0.4rem;
  color: var(--team);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.mj-squad.is-done {
  background: color-mix(in srgb, var(--team) 25%, transparent);
  font-weight: 600;
}

/* Manettes sans équipe : neutre et discret, mais jamais absent — lancer une
   partie en les oubliant, c'est autant de joueurs qui ne pilotent rien. */
.mj-squad.is-pending {
  border-color: var(--muted);
  color: var(--muted);
}

/* ─── Menu Équipes ─────────────────────────────────────────────────────────── */

.mj-teams {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid rgba(238, 242, 248, 0.15);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.03);
}

.mj-teams[hidden] {
  display: none;
}

.mj-teams-rows {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.mj-team-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

/* La pastille est le seul repère de couleur : le nom, lui, est libre. */
.mj-team-dot {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--team);
}

.mj-team-row input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(238, 242, 248, 0.2);
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  /* 16 px minimum : en deçà, iOS zoome sur le champ et la console saute. */
  font-size: 16px;
  font-family: inherit;
}

.mj-team-row input:focus {
  outline: none;
  border-color: var(--team);
}

.mj-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
}

.mj-check input {
  width: 1.4rem;
  height: 1.4rem;
  accent-color: var(--accent);
}

.mj-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.mj-teams-foot {
  display: flex;
  gap: 0.6rem;
}

.mj-teams-foot .mj-btn {
  flex: 1 1 0;
}

/* Avertissement : écran ouvert à travers le tunnel */
.warn {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  max-width: min(90vw, 46rem);
  padding: 0.85rem 1.2rem;
  border-radius: 0.6rem;
  background: #f5b301;
  color: #201800;
  font-size: clamp(0.8rem, 1.4vw, 1rem);
  line-height: 1.5;
  text-align: center;
  z-index: 20;
}

.warn[hidden] {
  display: none;
}

.warn code {
  background: rgba(0, 0, 0, 0.15);
  padding: 0.1em 0.4em;
  border-radius: 0.25em;
}

/* ─── Panneau des manettes connectées (touche P) ───────────────────────────── */

.peers {
  position: absolute;
  left: clamp(0.75rem, 2vw, 2rem);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 88vh;
  flex-wrap: wrap;
  pointer-events: none; /* réactivé sur les seules manettes silencieuses */
}

.peers[hidden] {
  display: none;
}

/* À l'accueil, le panneau ne forme plus une bande : il se disperse en groupes
   posés à côté du carré de chaque équipe. Il couvre donc tout le terrain, et
   chaque groupe est placé au pixel par le script à partir de la grille dessinée
   sur le canvas — c'est la seule façon de faire coïncider du DOM et du canvas. */
.peers.is-home {
  left: 0;
  top: 0;
  transform: none;
  display: block;
  max-height: none;
  width: 100%;
  height: 100%;
}

.peer-group {
  position: absolute;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.4rem;
}

/* Les manettes qui n'ont pas encore choisi n'ont pas de carré où se ranger :
   elles se regroupent en bas à gauche, étiquetées. Lancer une partie en les
   laissant derrière est l'erreur la plus facile à commettre. */
.peer-group.is-pending {
  left: clamp(0.75rem, 2vw, 2rem);
  bottom: 1.5rem;
  top: auto;
  width: auto;
  height: auto;
  max-width: 40%;
  align-items: center;
}

.peer-group-label {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  align-self: center;
}

.peer {
  position: relative;
  width: clamp(44px, 5vw, 72px);
  aspect-ratio: 1;
  border: 1px solid rgba(238, 242, 248, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s;
}

.peer.is-idle {
  border-color: rgba(238, 242, 248, 0.12);
}

.peer-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  /* Couleur de l'équipe, posée par le script ; --ball tant qu'il n'y en a qu'une. */
  background: var(--team, var(--ball));
  transition:
    left 0.05s linear,
    top 0.05s linear;
}

.peer.is-idle .peer-dot {
  background: var(--muted);
}

/* Manette muette depuis longtemps : posée quelque part, sans doute oubliée.
   Cliquable pour la débrancher (le serveur revérifie qu'elle est bien muette). */
.peer.is-asleep {
  border-style: dashed;
  opacity: 0.45;
  cursor: pointer;
  pointer-events: auto;
}

.peer.is-asleep:hover {
  opacity: 0.8;
  border-color: #ff6b6b;
}

.peer-num {
  position: absolute;
  right: -0.2rem;
  bottom: -0.2rem;
  font-size: clamp(0.55rem, 0.9vw, 0.75rem);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* ─── Classement des équipes (écran partagé) ───────────────────────────────── */
/* En haut à droite du terrain : le chronomètre occupe déjà le haut au centre,
   et le bas est là où les billes finissent le plus souvent. */
.board {
  position: absolute;
  right: clamp(0.75rem, 2vw, 2rem);
  top: clamp(0.75rem, 2vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  pointer-events: none;
}

.board[hidden] {
  display: none;
}

.board-row {
  display: grid;
  grid-template-columns: 1.4em 1fr auto;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.35rem 0.7rem;
  border-left: 3px solid var(--team);
  border-radius: 0.3rem;
  background: color-mix(in srgb, var(--team) 12%, transparent);
  font-size: clamp(0.85rem, 1.6vw, 1.3rem);
  color: var(--team);
}

.board-rank {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  opacity: 0.65;
}

.board-name {
  font-weight: 600;
}

.board-time {
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}

/* Sortie trouvée : la ligne se remplit, lisible du fond de la salle. */
.board-row.is-done {
  background: color-mix(in srgb, var(--team) 30%, transparent);
}

.board-row.is-done .board-rank {
  opacity: 1;
}

/* ─── Colonne latérale : QR de la manette et de la console (spec §10) ─────── */

/* Colonne, jamais calque : elle occupe sa propre part de la largeur, le terrain
   se redessine dans ce qui reste. Rien ne passe donc au-dessus du labyrinthe. */
.side {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
  width: clamp(150px, 17vw, 270px);
  height: 100%;
  padding: clamp(0.75rem, 1.5vw, 1.5rem);
  border-left: 1px solid rgba(238, 242, 248, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.side[hidden],
.card[hidden] {
  display: none;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: clamp(0.6rem, 1.2vw, 1rem);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 0.9rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.45);
}

/* La console du maître du jeu n'est pas une invitation adressée à la salle :
   la carte se distingue au premier coup d'œil de celle des joueurs. */
.card.is-master {
  background: rgba(255, 255, 255, 0.9);
  outline: 2px solid var(--accent);
}

.card-title {
  margin: 0;
  font-size: clamp(0.65rem, 1vw, 0.85rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4a5666;
}

.card-qr {
  width: 100%;
  height: auto;
  display: block;
}

.card-url {
  margin: 0;
  width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
  font-size: clamp(0.6rem, 0.9vw, 0.8rem);
  font-weight: 600;
  color: #10131a;
}

/* ─── Ecran d'entree de la manette (spec §9.1) ─────────────────────────────── */

.gate {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  background: var(--bg);
}

.gate[hidden] {
  display: none;
}

/* Une main qui incline un plateau : la metaphore s'enseigne sans un mot. */
.gate-art {
  perspective: 600px;
}

.phone {
  width: min(38vw, 200px);
  aspect-ratio: 1 / 1.9;
  border: 3px solid rgba(238, 242, 248, 0.5);
  border-radius: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  animation: tilt 3.2s ease-in-out infinite;
}

.marble {
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff3c4, var(--ball));
  animation: roll 3.2s ease-in-out infinite;
}

@keyframes tilt {
  0%,
  100% {
    transform: rotateY(-22deg) rotateX(58deg);
  }
  50% {
    transform: rotateY(22deg) rotateX(58deg);
  }
}

@keyframes roll {
  0%,
  100% {
    transform: translateX(-90%);
  }
  50% {
    transform: translateX(90%);
  }
}

.gate-wait {
  margin: 0;
  font-size: clamp(1rem, 4vw, 1.5rem);
  color: var(--muted);
  letter-spacing: 0.08em;
}

.gate-wait[hidden] {
  display: none;
}

.gate-wait small {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.8em;
  opacity: 0.75;
  max-width: 22rem;
  line-height: 1.4;
}

/* ─── Quitter (manette) ────────────────────────────────────────────────────── */

/* Le HUD est transparent aux pointeurs : le bouton doit les reprendre, sinon le
   tap traverse jusqu'au plateau. */
.quit {
  pointer-events: auto;
  appearance: none;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  line-height: 1;
  /* Cible large : on vise ce bouton d'un pouce, telephone en main. */
  padding: 0.5rem 0.6rem;
  margin: -0.5rem -0.6rem;
  cursor: pointer;
  opacity: 0.55;
}

.quit:active {
  opacity: 1;
}

.bye {
  gap: 2.5rem;
}

.bye-title {
  margin: 0;
  font-size: clamp(1.4rem, 6vw, 2.4rem);
  font-weight: 600;
}

.bye-back {
  appearance: none;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: clamp(0.9rem, 3.5vw, 1.1rem);
  padding: 0.7rem 1.4rem;
  border: 1px solid rgba(238, 242, 248, 0.25);
  border-radius: 2rem;
  cursor: pointer;
}

/* Diagnostic (/play?debug=1) */
.diag {
  position: fixed;
  left: 0.75rem;
  bottom: 0.75rem;
  margin: 0;
  padding: 0.6rem 0.8rem;
  z-index: 10;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.6);
  border-radius: 0.5rem;
  white-space: pre;
  pointer-events: none;
}

.diag[hidden] {
  display: none;
}

/* ─── Étape 5 : page publique, administration ──────────────────────────────── */

/* Ces deux pages sont des documents, pas des terrains : elles défilent, alors
   que l'écran et la manette sont bloqués en plein cadre. */
body.page {
  overflow: auto;
  user-select: text;
  -webkit-user-select: text;
}

.pad {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  padding: 2rem 1.2rem;
  text-align: center;
}

.pad-title {
  margin: 0;
  font-size: clamp(1.3rem, 5vw, 2rem);
  font-weight: 600;
}

.pad-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 32rem;
}

/* Deux champs de trois chiffres, larges : on les vise avec un pouce, au fond
   d'une salle, et le code est lu à voix haute pendant qu'on tape. */
.code {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.code-part {
  width: 4.5em;
  padding: 0.5rem 0.3rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(2rem, 12vw, 3.5rem);
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.08em;
  color: var(--ink);
  background: rgba(238, 242, 248, 0.06);
  border: 1px solid rgba(238, 242, 248, 0.18);
  border-radius: 0.7rem;
}

.code-part:focus {
  outline: none;
  border-color: var(--accent);
}

.code-part::placeholder {
  color: rgba(125, 135, 152, 0.4);
}

.code-dash {
  font-size: clamp(1.6rem, 8vw, 2.6rem);
  color: var(--muted);
}

/* Le code sur l'écran partagé : lisible du fond de la salle, puisque c'est ce
   qu'on dicte quand le QR ne passe pas. */
.card-code {
  margin: 0.2rem 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(1.4rem, 2.6vw, 2.4rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ball);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  width: min(22rem, 100%);
}

.form.is-inline {
  flex-direction: row;
  width: auto;
  flex: 1 1 18rem;
}

.form input {
  padding: 0.65rem 0.85rem;
  font: inherit;
  color: var(--ink);
  background: rgba(238, 242, 248, 0.06);
  border: 1px solid rgba(238, 242, 248, 0.18);
  border-radius: 0.5rem;
  min-width: 0;
  flex: 1;
}

.form input:focus {
  outline: none;
  border-color: var(--accent);
}

.form button {
  padding: 0.65rem 1.2rem;
  font: inherit;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: 0;
  border-radius: 0.5rem;
  cursor: pointer;
  white-space: nowrap;
}

.linkish {
  appearance: none;
  background: none;
  border: 1px solid rgba(238, 242, 248, 0.2);
  border-radius: 2rem;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
}

.linkish:hover {
  border-color: var(--accent);
}

.linkish.is-danger:hover {
  border-color: #ff595e;
  color: #ff595e;
}

/* ─── Administration ─────────────────────────────────────────────────────── */
.adm {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.5rem 1.2rem 4rem;
}

.adm-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.adm-head h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
}

.adm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.adm-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.7rem 0.9rem;
  background: rgba(238, 242, 248, 0.04);
  border: 1px solid rgba(238, 242, 248, 0.1);
  border-radius: 0.6rem;
}

.adm-row.is-closed {
  opacity: 0.5;
}

.adm-code {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ball);
}

.adm-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adm-state {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* Une pastille verte pour l'évènement qui tourne : c'est la réponse à « ça
   marche ? », et elle doit se lire sans lire. */
.adm-row.is-live .adm-state::before {
  content: "● ";
  color: #8ac926;
}

.adm-actions {
  display: flex;
  gap: 0.4rem;
}

.adm-links {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(238, 242, 248, 0.1);
}

.adm-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.adm-link-label {
  color: var(--muted);
  font-size: 0.85rem;
  width: 8rem;
}

.adm-link code {
  font-size: 0.85rem;
  word-break: break-all;
  flex: 1;
}

.adm-qr {
  width: 9rem;
  height: 9rem;
  border-radius: 0.4rem;
  background: #fff;
  padding: 0.3rem;
}

@media (max-width: 40rem) {
  .adm-row {
    grid-template-columns: auto 1fr;
  }

  .adm-state,
  .adm-actions {
    grid-column: 1 / -1;
  }
}
