/* ========== Gloop — interface ========== */
:root {
  --bg-1: #1b1d33;
  --bg-2: #262a4a;
  --card: rgba(44, 48, 82, 0.72);
  --card-solid: #2c3052;
  --card-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f1f2fb;
  --muted: #a3a8c9;
  --accent: #ffd54f;
  --accent-2: #ffb347;
  --mint: #6fe3b5;
  --pink: #ff8fb8;
  --sky: #8fd3f4;
  --danger: #ff6b7d;
  --radius: 18px;
  --radius-s: 12px;
  --shadow: 0 10px 30px rgba(8, 9, 25, 0.45), 0 2px 6px rgba(8, 9, 25, 0.3);
  --font: "Fredoka", "Nunito", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(143, 211, 244, 0.18), transparent 60%),
    radial-gradient(700px 500px at 100% 0%, rgba(255, 143, 184, 0.14), transparent 60%),
    radial-gradient(800px 600px at 50% 120%, rgba(111, 227, 181, 0.12), transparent 60%),
    linear-gradient(160deg, var(--bg-2), var(--bg-1));
  background-attachment: fixed;
}

button, input { font-family: inherit; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

/* ----- Boutons ----- */
.btn {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s, filter 0.12s;
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-primary {
  background: linear-gradient(180deg, #ffe27a, var(--accent-2));
  color: #3b2a00;
  box-shadow: 0 4px 0 #c97f1d, 0 8px 18px rgba(255, 179, 71, 0.35);
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-primary:active { box-shadow: 0 2px 0 #c97f1d; transform: translateY(2px); }
.btn-soft { background: var(--card-2); color: var(--text); border: 1px solid var(--line); }
.btn-soft:hover { background: rgba(255, 255, 255, 0.12); }
.btn-ghost { background: rgba(255, 255, 255, 0.08); color: var(--text); padding: 6px 14px; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.16); }

/* ----- Mise en page ----- */
#app {
  max-width: 1680px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ----- Barre du haut ----- */
#hud {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-right: 4px;
  background: linear-gradient(90deg, var(--mint), var(--sky));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}
.brand-blob {
  width: 26px; height: 20px;
  border-radius: 55% 55% 45% 45% / 70% 70% 30% 30%;
  background: radial-gradient(circle at 35% 30%, #c9ffe9, var(--mint) 55%, #2fae80);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15);
  animation: blob-bounce 2.4s ease-in-out infinite;
}
@keyframes blob-bounce {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  40% { transform: translateY(-3px) scale(0.94, 1.06); }
  60% { transform: translateY(0) scale(1.08, 0.92); }
}
.pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.pill-ico { font-size: 14px; opacity: 0.9; }
.map-pill { color: var(--muted); }
.map-pill #mapName { color: var(--text); }
.round-chip {
  margin-left: 2px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(143, 211, 244, 0.16);
  color: var(--sky);
  font-size: 12px;
}
.round-chip:empty { display: none; }
.round-chip.last { background: rgba(255, 213, 79, 0.2); color: var(--accent); }
.objective-pill {
  flex: 1;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--accent);
  background: linear-gradient(90deg, rgba(255, 213, 79, 0.1), rgba(255, 213, 79, 0.18), rgba(255, 213, 79, 0.1));
  border-color: rgba(255, 213, 79, 0.25);
}
.objective-pill:empty, .objective-pill.off { visibility: hidden; } /* (off : sur la Place et dans l'Atelier, game.js) */
.objective-pill.pop { animation: pop 0.35s ease-out; }
@keyframes pop {
  0% { transform: scale(0.96); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}
.hud-right { display: flex; gap: 8px; align-items: center; }
/* pièces */
.coin-pill { color: #ffe08a; font-variant-numeric: tabular-nums; padding-left: 8px; }
.coin-pill[hidden] { display: none; }
.coin-pill.pop { animation: coin-pop 0.6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes coin-pop {
  30% { transform: scale(1.25); background: rgba(255, 213, 79, 0.3); }
  100% { transform: scale(1); }
}
.coin-icon {
  position: relative;
  width: 18px; height: 18px;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6c2, #ffd54f 45%, #e0a526 80%);
  box-shadow: inset 0 0 0 1.5px #b8860b, inset 0 -2px 0 rgba(140, 90, 0, 0.35);
}
.coin-icon::after { /* étoile gravée au centre */
  content: "★";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #c98a0e;
}
.icon-btn {
  width: 36px; height: 36px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.12s, transform 0.12s, opacity 0.12s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.14); transform: scale(1.06); }
.icon-btn.off { opacity: 0.45; filter: grayscale(1); }
/* volume général (curseur à côté des boutons son / musique) */
.volume-pill { height: 36px; padding: 0 12px 0 14px; gap: 8px; cursor: pointer; }
.volume-pill.off #volumeVal { color: var(--danger); }
#volumeVal { width: 3ch; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
#volumeSlider {
  -webkit-appearance: none;
  appearance: none;
  width: 84px; height: 6px;
  margin: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint), var(--sky)) 0 0 / var(--fill, 100%) 100% no-repeat, rgba(255, 255, 255, 0.14);
  cursor: pointer;
}
#volumeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.12);
  transition: transform 0.12s;
}
#volumeSlider::-moz-range-thumb {
  width: 16px; height: 16px;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.12);
  transition: transform 0.12s;
}
.volume-pill:hover #volumeSlider::-webkit-slider-thumb { transform: scale(1.15); }
.volume-pill:hover #volumeSlider::-moz-range-thumb { transform: scale(1.15); }
#volumeSlider:focus { outline: none; }
#volumeSlider:focus-visible { outline: 2px solid var(--sky); outline-offset: 5px; }
.timer-pill {
  position: relative;
  overflow: hidden;
  min-width: 96px;
  justify-content: center;
}
#timer { font-variant-numeric: tabular-nums; font-size: 16px; }
.timer-bar {
  position: absolute;
  left: 10px; right: 10px; bottom: 3px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
#timerFill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--mint), var(--sky));
  transition: width 0.3s linear;
}
.timer-pill.low { color: var(--danger); border-color: rgba(255, 107, 125, 0.4); animation: tick 1s ease-in-out infinite; }
.timer-pill.low #timerFill { background: var(--danger); }
@keyframes tick { 50% { background: rgba(255, 107, 125, 0.16); } }

#main { display: flex; gap: 12px; align-items: flex-start; justify-content: center; }

/* ----- Zone de jeu ----- */
/* Le plus grand possible : toute la largeur disponible, sans dépasser la hauteur de la fenêtre
   (le jeu garde ses proportions 2:1 ; ~270 px sont réservés au reste de l'interface) */
#stage {
  --fit: calc((100vh - 270px) * 2 + 12px);
  flex: 0 1 auto;
  width: min(100%, var(--fit));
  min-width: 0;
  padding: 6px;
  overflow: hidden;
}
@supports (height: 100dvh) {
  #stage { --fit: calc((100dvh - 270px) * 2 + 12px); }
}
.canvas-wrap { position: relative; }
#game {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  background: #a8dcf0;
  border-radius: calc(var(--radius) - 6px);
  cursor: crosshair;
}

/* notifications au-dessus du jeu */
#toasts {
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  width: 90%;
}
body[data-mode="memorie"] #toasts { top: 29%; } /* (sous le grand tableau du Mémorie) */
body[data-mode="attente"] #toasts { top: 34%; } /* (sous le panneau de la salle d'attente : attente.js) */
.toast {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(30, 33, 60, 0.82);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
  animation: toast-in 0.3s cubic-bezier(.2, 1.4, .4, 1) both;
  max-width: 100%;
  text-align: center;
}
.toast.out { animation: toast-out 0.35s ease-in forwards; }

/* prison (site/prison.js) : bandeau en haut du jeu, avec le temps qui reste (les notifications passent dessous) */
body.in-prison #toasts { top: 58px; }
#prisonBar {
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  max-width: 92%;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(20, 22, 34, 0.88);
  border: 1px solid rgba(255, 107, 125, 0.55);
  color: var(--text);
  font-size: 13px;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
#prisonBar[hidden] { display: none; }
#prisonBar b { color: var(--danger); font-weight: 600; }
#prisonBar small { display: block; color: var(--muted); font-size: 11px; }
#prisonBar small[hidden] { display: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(0.9); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px) scale(0.95); } }

/* ----- Bilan de fin de manche ----- */
#summary {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: calc(var(--radius) - 6px);
  background: rgba(20, 22, 40, 0.35);
  backdrop-filter: blur(3px);
  z-index: 2;
}
#summary[hidden] { display: none; }
.sm-card {
  width: min(460px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 12px;
  border-radius: var(--radius);
  background: rgba(36, 39, 70, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: sm-in 0.4s cubic-bezier(.2, 1.3, .4, 1) both;
}
@keyframes sm-in { from { opacity: 0; transform: translateY(14px) scale(0.94); } }
.sm-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sm-head h3 { margin: 0; font-size: 20px; font-weight: 700; color: var(--mint); }
.sm-map { color: var(--muted); font-size: 13px; }
.sm-avatar {
  display: inline-block;
  flex: none;
  width: 18px; height: 13px;
  margin: 0 5px -1px 0;
  border-radius: 55% 55% 45% 45% / 70% 70% 30% 30%;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2), inset 2px 2px 0 rgba(255, 255, 255, 0.35);
}
.sm-shiny {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 13px;
  background: linear-gradient(90deg, rgba(255, 213, 79, 0.18), rgba(255, 143, 184, 0.14));
  color: #fff4c2;
}
.sm-shiny.lost { background: rgba(255, 255, 255, 0.05); color: var(--muted); }
.sm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  min-height: 0;
}
.sm-list li, .sm-guide {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 10px;
  background: var(--card-2);
  font-size: 14px;
  animation: msg-in 0.3s ease-out both;
}
.sm-list li:nth-child(2) { animation-delay: 0.06s; }
.sm-list li:nth-child(3) { animation-delay: 0.12s; }
.sm-list li:nth-child(4) { animation-delay: 0.18s; }
.sm-list li.me, .sm-guide.me { box-shadow: inset 0 0 0 1px rgba(255, 213, 79, 0.45); }
.sm-place { width: 24px; text-align: center; font-size: 15px; color: var(--muted); }
.sm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sm-chip {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
}
.sm-chip.home { background: rgba(111, 227, 181, 0.2); color: var(--mint); }
.sm-chip.dead { background: rgba(255, 107, 125, 0.18); color: var(--danger); }
.sm-chip.shiny { background: rgba(255, 213, 79, 0.22); }
/* mode Vampires */
.sm-chip.vamp, #scoreList .badge.vamp { background: rgba(208, 80, 111, 0.2); color: #ff9ab3; }
.sm-chip.original, #scoreList .badge.original { background: rgba(160, 60, 220, 0.25); color: #e3b5ff; }
.sm-chip.human, #scoreList .badge.human { background: rgba(111, 227, 181, 0.18); color: var(--mint); }
.sm-chip.gloopie, #scoreList .badge.gloopie { background: rgba(63, 140, 255, 0.24); color: #a9cdff; } /* (bleu, comme son pseudo) */
.sm-chip.last, #scoreList .badge.last { background: rgba(255, 213, 79, 0.22); color: #fff4c2; }
.sm-shiny.night { background: linear-gradient(90deg, rgba(120, 40, 90, 0.4), rgba(60, 30, 110, 0.35)); color: #f3d4ff; }
.sm-bites { font-size: 12px; color: #ff9ab3; white-space: nowrap; }
/* Bataille de neige : les deux équipes */
.sm-chip.snow-a, #scoreList .badge.snow-a { background: rgba(63, 140, 255, 0.24); color: #a9cdff; }
.sm-chip.snow-b, #scoreList .badge.snow-b { background: rgba(255, 79, 94, 0.22); color: #ffb0b6; }
.sm-shiny.snow-a { background: linear-gradient(90deg, rgba(63, 140, 255, 0.35), rgba(140, 200, 255, 0.2)); color: #e3f0ff; }
.sm-shiny.snow-b { background: linear-gradient(90deg, rgba(255, 79, 94, 0.35), rgba(255, 160, 170, 0.2)); color: #ffe6e8; }
/* Football : les deux équipes, et un Gloopie englué */
.sm-chip.foot-a, #scoreList .badge.foot-a { background: rgba(63, 140, 255, 0.24); color: #a9cdff; }
.sm-chip.foot-b, #scoreList .badge.foot-b { background: rgba(255, 79, 94, 0.22); color: #ffb0b6; }
#scoreList .badge.foot-glue { background: rgba(108, 198, 63, 0.25); color: #c8ffa8; }
.sm-shiny.foot-a { background: linear-gradient(90deg, rgba(63, 140, 255, 0.35), rgba(140, 200, 255, 0.2)); color: #e3f0ff; }
.sm-shiny.foot-b { background: linear-gradient(90deg, rgba(255, 79, 94, 0.35), rgba(255, 160, 170, 0.2)); color: #ffe6e8; }
.sm-teams { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 8px 0 2px; }
.sm-points {
  min-width: 38px;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.sm-points.up { color: var(--accent); }
.sm-points.down { color: var(--danger); }
.sm-guide {
  background: linear-gradient(90deg, rgba(255, 213, 79, 0.14), rgba(255, 213, 79, 0.04));
  border: 1px solid rgba(255, 213, 79, 0.22);
  flex-wrap: wrap;
}
.sm-guide.fail { background: rgba(255, 107, 125, 0.1); border-color: rgba(255, 107, 125, 0.3); }
.sm-guide-tag { font-size: 12px; font-weight: 700; color: var(--accent); margin-right: 2px; }
.sm-guide .sm-name { flex: 0 1 auto; }
.sm-guide-detail { flex: 1; font-size: 12px; color: var(--muted); min-width: 120px; }
.sm-guide.fail .sm-guide-detail b { color: var(--danger); }
.sm-foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.sm-foot b { color: var(--text); }
.sm-bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.sm-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--sky));
  animation: sm-bar linear forwards;
}
@keyframes sm-bar { from { width: 100%; } to { width: 0%; } }

/* ----- Barre d'outils du guide ----- */
#guideBar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-s);
  background: linear-gradient(180deg, rgba(255, 213, 79, 0.1), rgba(255, 213, 79, 0.03));
  border: 1px solid rgba(255, 213, 79, 0.22);
}
#guideBar[hidden] { display: none; }
.gb-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
}
#gbTools { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.gb-tool {
  position: relative;
  width: 74px;
  padding: 6px 2px 5px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  overflow: hidden;
  transition: transform 0.12s, background 0.12s, box-shadow 0.12s;
}
.gb-tool[hidden] { display: none; } /* (un outil que le guide n'a pas sur cette carte) */
.gb-tool:hover { background: rgba(255, 255, 255, 0.13); transform: translateY(-1px); }
.gb-tool canvas { width: 44px; height: 44px; display: block; }
.gb-tool .gb-name { font-size: 12px; font-weight: 600; white-space: nowrap; }
.gb-tool .gb-key {
  position: absolute; top: 4px; left: 5px;
  width: 17px; height: 17px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.3); color: var(--muted); font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.gb-tool .gb-count {
  position: absolute; top: 4px; right: 5px;
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: #3b2a00; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.gb-tool.selected {
  border-color: var(--accent);
  background: rgba(255, 213, 79, 0.16);
  box-shadow: 0 0 14px rgba(255, 213, 79, 0.4);
  transform: translateY(-2px);
}
.gb-tool.selected .gb-key { background: var(--accent); color: #3b2a00; }
.gb-tool.empty { opacity: 0.38; filter: grayscale(1); }
.gb-tool.empty .gb-count { background: #6b7080; color: #ddd; }
/* remplissage circulaire pendant l'incantation */
.gb-tool .gb-cast {
  position: absolute; inset: 0;
  background: conic-gradient(rgba(255, 213, 79, 0.45) calc(var(--p, 0) * 1turn), transparent 0);
  pointer-events: none;
  display: none;
}
.gb-tool.casting .gb-cast { display: block; }

/* ----- L'Atelier : éditeur de cartes (editor.js) ----- */
#editorBar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-s);
  background: linear-gradient(180deg, rgba(143, 211, 255, 0.1), rgba(143, 211, 255, 0.03));
  border: 1px solid rgba(143, 211, 255, 0.22);
}
#editorBar[hidden] { display: none; }
.ed-group { display: flex; align-items: stretch; gap: 4px; padding-right: 8px; border-right: 1px solid var(--line); }
.ed-group:last-child { border-right: 0; }
.ed-group.game { background: rgba(255, 213, 79, 0.06); border-radius: 10px; padding: 0 4px; }
.ed-gl {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
  text-align: center;
}
.ed-tool {
  min-width: 56px;
  padding: 5px 4px 4px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font: 600 11px Fredoka, Segoe UI, sans-serif;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: transform 0.12s, background 0.12s;
}
.ed-tool .ed-ico { font-size: 18px; line-height: 1.1; }
.ed-decor { display: flex; flex-direction: column; gap: 3px; }
.ed-minis { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.ed-minis > span { width: 52px; font-size: 10px; color: var(--muted); }
.ed-minis.mine > span { color: var(--accent, #ffd27a); font-weight: 700; }
.ed-mini {
  width: 28px; height: 26px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}
.ed-mini:hover { background: rgba(255, 255, 255, 0.15); }
.ed-mini.selected { border-color: #8fd3ff; background: rgba(143, 211, 255, 0.18); }
.ed-fields .ed-check { flex-direction: row; align-items: center; gap: 5px; grid-column: span 2; }
.ed-tool:hover:not(:disabled) { background: rgba(255, 255, 255, 0.13); transform: translateY(-1px); }
.ed-tool.selected { border-color: #8fd3ff; background: rgba(143, 211, 255, 0.16); }
.ed-tool:disabled { opacity: 0.35; cursor: default; }
body.in-editor #scores, body.in-editor #chat { display: none; }
body.in-editor #game { cursor: crosshair; }
#editorPanel { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; }
#editorPanel[hidden] { display: none; }
#editorPanel h2 { display: flex; justify-content: space-between; align-items: center; }
.ed-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 2px; }
.ed-line { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
#editorPanel select, #editorPanel input:not([type="color"]),
#themePanel select, #themePanel input:not([type="color"]):not([type="range"]):not([type="checkbox"]) {
  width: 100%;
  min-width: 0;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: 500 13px Fredoka, Segoe UI, sans-serif;
}
#editorPanel option, #themePanel option { background: var(--card-solid); }
#edProps { padding: 8px; border-radius: 10px; background: var(--card-2); }
.ed-hint { margin: 0; font-size: 12px; color: var(--muted); }
.ed-sel { font-weight: 700; margin-bottom: 6px; }
.ed-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ed-fields label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); }
.ed-fields input[type="color"] { width: 100%; height: 28px; border: 0; background: none; padding: 0; }
.ed-row { display: flex; gap: 6px; margin-top: 8px; }
.ed-row .btn, .ed-actions .btn { padding: 6px 10px; font-size: 13px; }
.ed-sub { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
/* pouvoirs du guide d'une carte du Sauvetage */
#edTools { display: flex; flex-direction: column; gap: 4px; }
#edTools[hidden] { display: none; }
#edTools .ed-check { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
#editorPanel #edTools .ed-check input { width: auto; margin: 0; }
.ed-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 6px; }
.ed-tools label { display: grid; grid-template-columns: 1fr 52px; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
#editorPanel .ed-tools input { padding: 3px 6px; }
#editorPanel .ed-tools input:disabled { opacity: 0.5; }
#edProblems { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
#edProblems li { padding: 4px 8px; border-radius: 8px; background: rgba(255, 107, 125, 0.12); color: #ffc0c8; }
#edProblems li.ok { background: rgba(111, 227, 181, 0.15); color: var(--mint); }
.ed-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ed-actions .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ed-danger { color: #ff9aa8; grid-column: 1 / -1; }
.ed-quit { flex: none; padding: 6px 12px; font-size: 13px; }
.ed-keys { margin: 0; font-size: 10.5px; color: var(--muted); line-height: 1.4; }

/* ----- Colonne de droite ----- */
/* sa hauteur est calée sur celle de la zone de jeu (voir game.js) */
#side {
  flex: 0 0 300px;
  min-width: 240px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#side h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
}
.count-chip {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  text-align: center;
  letter-spacing: 0;
}

#scores { padding: 12px; flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; }
#scoreList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 210px;
  min-height: 0;
  overflow-y: auto;
}
#scoreList li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 10px;
  background: var(--card-2);
  font-size: 14px;
  font-weight: 500;
}
#scoreList li.me { background: rgba(255, 213, 79, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 213, 79, 0.35); }
#scoreList li.out { opacity: 0.55; }
#scoreList .rank { width: 16px; color: var(--muted); font-size: 12px; text-align: center; }
#scoreList li:nth-child(1) .rank { color: #ffd54f; }
#scoreList li:nth-child(2) .rank { color: #d6dbe8; }
#scoreList li:nth-child(3) .rank { color: #e0a77a; }
#scoreList .avatar {
  flex: none;
  width: 20px; height: 15px;
  border-radius: 55% 55% 45% 45% / 70% 70% 30% 30%;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2), inset 2px 2px 0 rgba(255, 255, 255, 0.35);
}
#scoreList .pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#scoreList .next-guide { color: var(--accent); font-size: 13px; cursor: help; }
#scoreList .badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}
#scoreList .badge.guide { background: rgba(255, 213, 79, 0.2); color: var(--accent); }
#scoreList .badge.home { background: rgba(111, 227, 181, 0.2); color: var(--mint); }
#scoreList .badge.carry { background: rgba(255, 143, 184, 0.2); color: var(--pink); }
#scoreList .badge.shiny { background: linear-gradient(90deg, rgba(255, 213, 79, 0.3), rgba(255, 143, 184, 0.3)); color: #fff4c2; }
#scoreList .badge.dead { background: rgba(255, 107, 125, 0.18); color: var(--danger); }
#scoreList .score {
  min-width: 30px;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* La discussion occupe la place restante, sans jamais grandir avec les messages :
   au-delà, une barre de défilement apparaît */
#chat {
  flex: 1 1 0px;
  display: flex;
  flex-direction: column;
  padding: 12px;
  min-height: 180px;
  overflow: hidden;
}
#messages {
  flex: 1 1 0px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 2px;
}
#messages > div {
  padding: 3px 9px;
  border-radius: 10px;
  background: var(--card-2);
  overflow-wrap: anywhere;
  animation: msg-in 0.2s ease-out;
}
#messages > div b { font-weight: 600; }
#messages .info {
  background: none;
  color: var(--sky);
  font-size: 12px;
  font-style: italic;
  padding: 1px 9px;
}
@keyframes msg-in { from { opacity: 0; transform: translateY(4px); } }

#chatInput {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#chatInput::placeholder { color: var(--muted); }
#chatInput:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(143, 211, 244, 0.2); }

/* barres de défilement discrètes */
#messages, #scoreList, #slots { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }

/* ----- Aide (touches) ----- */
#help {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: center;
  font-size: 12.5px;
  color: var(--muted);
  padding: 2px 4px;
}
#help .hint { display: inline-flex; align-items: center; gap: 4px; }
/* Sur la Place (hub.js) : pas de minuteur ni d'outils du guide, mais l'aide des portails */
#help .hub-hint { display: none; }
body.in-hub #help .hub-hint { display: inline-flex; }
/* Cosmos : un vaisseau, pas de sauts ni de guide */
#help .cosmos-hint { display: none; }
body[data-mode="cosmos"] #help .cosmos-hint { display: inline-flex; }
body[data-mode="cosmos"] #help .walk-hint,
body[data-mode="cosmos"] #help .guide-hint { display: none; }
/* Train de la mine : un wagonnet, pas de guide */
#help .train-hint { display: none; }
body[data-mode="train"] #help .train-hint { display: inline-flex; }
body[data-mode="train"] #help .walk-hint,
body[data-mode="train"] #help .guide-hint { display: none; }
body.in-hub #help .guide-hint,
body[data-mode="attente"] #help .guide-hint, /* (salle d'attente d'une partie : attente.js) */
body[data-mode="parcours"] #help .guide-hint, /* (Parcours : chacun pour soi, pas de guide) */
body[data-mode="meduse"] #help .guide-hint, /* (Méduse : chacun pour soi, pas de guide) */
body.in-hub #timerBox { display: none; }
#help em { font-style: normal; opacity: 0.7; }
#help b { color: var(--accent); font-weight: 600; margin-right: 2px; }
kbd {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom-width: 3px;
  color: var(--text);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

/* ----- Trophées ----- */
#trophyModal {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(16, 17, 34, 0.7);
  backdrop-filter: blur(5px);
}
#trophyModal[hidden] { display: none; }

/* ----- Choix de la partie (portail « Jouer » de la Place) ----- */
#sessionsModal {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(16, 17, 34, 0.7);
  backdrop-filter: blur(5px);
}
#sessionsModal[hidden] { display: none; }
.tr-panel.gm-panel { width: min(980px, 100%); text-align: left; font-weight: 500; }
#sessionsClose { display: grid; place-items: center; color: var(--text); }
/* le jeu choisi : aperçu animé à gauche, ce qu'il faut savoir à droite */
.gm-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 18px;
  margin: 14px 0 18px;
}
.gm-stage {
  position: relative;
  border-radius: 16px;
  padding: 3px;
  background: linear-gradient(135deg, var(--mode-color), rgba(255, 255, 255, 0.08) 55%, var(--mode-color));
  box-shadow: 0 10px 30px rgba(8, 9, 25, 0.45), 0 0 34px -6px var(--mode-color);
  align-self: start;
}
.gm-live {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  border-radius: 13px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.25)), var(--card-solid);
  opacity: 0;
  transition: opacity 0.35s;
}
.gm-live.ready { opacity: 1; }
.gm-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.gm-name {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.05;
  color: var(--mode-color);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}
.gm-desc { margin: 0; font-size: 14px; line-height: 1.45; color: var(--text); opacity: 0.88; }
.gm-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.gm-facts span {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
}
.gm-create { align-self: flex-start; padding: 11px 26px; font-size: 16px; margin-top: 2px; }
.gm-create:disabled { opacity: 0.5; cursor: default; filter: grayscale(0.6); }
.gm-sessions-head {
  display: flex; align-items: center; gap: 6px;
  margin-top: 4px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.gm-sessions-head span:not(:empty) {
  font-size: 11px; letter-spacing: 0; padding: 0 7px; border-radius: 999px;
  background: var(--mode-color); color: #1b1d33;
}
.gm-sessions { display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow-y: auto; }
.gm-empty {
  padding: 12px; border-radius: 12px;
  font-size: 13px; line-height: 1.4; color: var(--muted);
  background: var(--card-2); border: 1px dashed var(--line);
}
.gm-session {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px 9px 12px;
  border-radius: 12px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--mode-color);
}
.gm-s-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.gm-s-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gm-s-title b { font-size: 14px; }
.gm-s-info { font-size: 12px; color: var(--muted); }
.gm-s-info b { color: var(--text); font-weight: 600; }
.gm-s-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.gm-s-count { font-size: 12px; color: var(--muted); }
.gm-s-count b { font-size: 15px; color: var(--text); }
.ss-chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.ss-chip.playing { background: rgba(79, 209, 161, 0.18); color: #6fe3b5; }
.ss-chip.pause { background: rgba(106, 168, 255, 0.18); color: #9cc4ff; }
.ss-chip.podium { background: rgba(255, 210, 87, 0.18); color: #ffd257; }
.ss-chip.waiting { background: rgba(208, 80, 111, 0.18); color: #ff9ab3; }
.ss-players { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; color: var(--text); }
.ss-player { display: inline-flex; align-items: center; gap: 4px; }
.ss-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.ss-join { padding: 6px 14px; font-size: 13px; }
.ss-join:disabled { opacity: 0.5; cursor: default; }
/* tous les jeux : une vignette chacun */
.gm-sub {
  margin: 0 0 10px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.gm-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gm-game {
  display: flex; flex-direction: column; gap: 7px;
  padding: 0; border: none; background: none;
  font: inherit; color: var(--text); text-align: left; cursor: pointer;
}
.gm-thumb {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 2 / 1;
  background: linear-gradient(135deg, var(--mode-color), rgba(27, 29, 51, 0.9));
  border: 2px solid transparent;
  box-shadow: 0 4px 12px rgba(8, 9, 25, 0.35);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.gm-thumb canvas {
  display: block; width: 100%; height: 100%;
  opacity: 0; transition: opacity 0.3s, transform 0.3s;
}
.gm-thumb canvas.ready { opacity: 1; }
.gm-game:hover .gm-thumb { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(8, 9, 25, 0.45); }
.gm-game:hover .gm-thumb canvas { transform: scale(1.05); }
.gm-game.picked .gm-thumb { border-color: var(--mode-color); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08), 0 6px 22px -4px var(--mode-color); }
.gm-game:focus-visible { outline: none; }
.gm-game:focus-visible .gm-thumb { border-color: var(--text); }
.gm-game-name { font-size: 14px; font-weight: 600; padding-left: 2px; }
.gm-game.picked .gm-game-name { color: var(--mode-color); }
.gm-badge {
  position: absolute; left: 6px; top: 6px;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  color: #fff; background: rgba(16, 17, 34, 0.72);
}
.gm-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 6px var(--mint); }
.gm-badge[hidden] { display: none; }
.gm-soon {
  position: absolute; right: 6px; top: 6px;
  font-size: 10px; font-weight: 700; color: #3b2a00; background: #ffd257; padding: 1px 7px; border-radius: 4px;
}
.gm-game.soon .gm-thumb { filter: grayscale(0.7); opacity: 0.7; }
@media (max-width: 760px) {
  .gm-feature { grid-template-columns: 1fr; gap: 12px; }
  .gm-name { font-size: 24px; }
  .gm-games { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .gm-thumb, .gm-thumb canvas, .gm-live { transition: none; }
  .gm-game:hover .gm-thumb, .gm-game:hover .gm-thumb canvas { transform: none; }
}
.tr-panel {
  width: min(720px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 18px 20px;
  background: rgba(44, 48, 82, 0.96);
  animation: sm-in 0.35s cubic-bezier(.2, 1.3, .4, 1) both;
}
.tr-head { display: flex; align-items: center; justify-content: space-between; }
.tr-head h2 { margin: 0; font-size: 22px; color: var(--accent); }
.tr-hint { margin: 6px 0 14px; font-size: 13px; color: var(--muted); }
.tr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-bottom: 14px; }
.tr-stat {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 4px; border-radius: 12px; background: var(--card-2);
}
.tr-stat b { font-size: 20px; color: var(--text); }
.tr-stat span { font-size: 11px; color: var(--muted); text-align: center; }
.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.tr-card {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: 14px;
  background: var(--card-2); border: 1px solid var(--line);
}
.tr-card .tr-icon { font-size: 26px; filter: grayscale(1); opacity: 0.45; }
.tr-card.have { background: linear-gradient(135deg, rgba(255, 213, 79, 0.16), rgba(255, 143, 184, 0.08)); border-color: rgba(255, 213, 79, 0.35); }
.tr-card.have .tr-icon { filter: none; opacity: 1; }
.tr-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.tr-body b { font-size: 14px; }
.tr-body small { font-size: 12px; color: var(--muted); }
.tr-bar { height: 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.1); overflow: hidden; margin: 2px 0; }
.tr-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--mint), var(--accent)); }
.tr-card.have .tr-reward { color: var(--accent); }
/* paliers : bronze, argent, or, légende */
.tr-tier {
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  vertical-align: 1px;
  background: rgba(255, 255, 255, 0.08);
}
.tier-bronze .tr-tier { color: #e0a77a; }
.tier-argent .tr-tier { color: #d6dbe8; }
.tier-or .tr-tier { color: #ffd54f; }
.tier-legende .tr-tier { color: #ff8fb8; }
.tr-card.have.tier-legende {
  background: linear-gradient(135deg, rgba(255, 143, 184, 0.2), rgba(143, 211, 244, 0.14), rgba(255, 213, 79, 0.14));
  border-color: rgba(255, 143, 184, 0.5);
  box-shadow: 0 0 14px rgba(255, 143, 184, 0.2);
}
.tr-cat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 16px 0 8px;
  font-size: 15px;
  color: var(--text);
}
.tr-cat span { font-size: 12px; color: var(--muted); font-weight: 500; }
.tr-total { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.tr-total b { font-size: 22px; color: var(--accent); }
.tr-total .tr-bar { flex: 1; height: 7px; }
.trophy-toast.tier-legende { border-color: #ff8fb8; box-shadow: 0 0 20px rgba(255, 143, 184, 0.45); }

/* annonce d'un trophée débloqué */
.toast.trophy-toast {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 10px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(120, 80, 10, 0.92), rgba(60, 40, 90, 0.92));
  border: 1px solid rgba(255, 213, 79, 0.6);
  text-align: left;
  font-size: 13px;
}
.trophy-toast b { color: #ffe08a; }
.trophy-toast small { color: rgba(255, 255, 255, 0.8); }
.trophy-toast .tt-icon { font-size: 26px; animation: coin-pop 0.8s ease-out; }

/* ----- Connexion / création de compte ----- */
#authView {
  position: relative;
  width: min(400px, 100%);
  margin: auto;
  padding: 26px 28px 22px;
  text-align: center;
  background: rgba(44, 48, 82, 0.92);
}
#authView[hidden], #loginForm[hidden] { display: none; }
.auth-tabs {
  display: flex;
  gap: 4px;
  margin: 20px 0 16px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
}
.auth-tab {
  flex: 1;
  padding: 8px 10px;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.auth-tab.active { background: rgba(255, 255, 255, 0.12); color: var(--text); }
#authForm { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-field[hidden] { display: none; }
.auth-field > span:first-child {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}
.auth-field input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 213, 79, 0.2); }
.auth-pass { position: relative; display: block; }
.auth-pass input { padding-right: 42px; }
.auth-eye {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border: none;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  opacity: 0.7;
}
.auth-eye:hover { opacity: 1; background: rgba(255, 255, 255, 0.08); }
.auth-hint { margin: -4px 0 0; font-size: 12px; color: var(--muted); }
.auth-hint[hidden] { display: none; }
.auth-error { min-height: 18px; margin: 0; font-size: 13px; color: var(--danger); }
#authSubmit { padding: 11px; font-size: 16px; }
#authSubmit:disabled { opacity: 0.6; cursor: wait; }
.auth-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  color: var(--muted);
  font-size: 12px;
}
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#guestBtn { width: 100%; padding: 10px; }
.auth-note { margin: 10px 0 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
/* bandeau « Connecté en tant que… » au-dessus de la garde-robe */
.account-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}
.account-bar:empty { display: none; }
.account-bar b { color: var(--accent); }
.link-btn {
  border: none;
  background: none;
  color: var(--sky);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ----- Écran d'accueil / garde-robe ----- */
#login {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(16, 17, 34, 0.78);
  backdrop-filter: blur(6px);
  overflow-y: auto;
}
.bg-blobs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.bg-blobs i {
  position: absolute;
  width: 340px; height: 260px;
  border-radius: 55% 45% 50% 50% / 60% 60% 40% 40%;
  filter: blur(50px);
  opacity: 0.35;
  animation: drift 14s ease-in-out infinite alternate;
}
.bg-blobs i:nth-child(1) { background: var(--mint); left: 8%; top: 12%; }
.bg-blobs i:nth-child(2) { background: var(--pink); right: 6%; top: 40%; animation-delay: -5s; }
.bg-blobs i:nth-child(3) { background: var(--sky); left: 35%; bottom: 0; animation-delay: -9s; }
@keyframes drift {
  to { transform: translate(40px, -30px) scale(1.15) rotate(12deg); }
}

#loginForm {
  position: relative;
  width: min(1060px, 100%);
  padding: 26px 28px 24px;
  text-align: center;
  background: rgba(44, 48, 82, 0.9);
  margin: auto;
}
.title {
  margin: 0;
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.5px;
  color: var(--mint);
  text-shadow: 0 4px 0 #2a8f6b, 0 10px 24px rgba(111, 227, 181, 0.35);
}
.title span { color: var(--accent); text-shadow: 0 4px 0 #c97f1d, 0 10px 24px rgba(255, 213, 79, 0.3); }
.tagline { margin: 12px 0 0; color: var(--muted); font-size: 15px; }

#wardrobe {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  justify-content: center;
  margin-top: 20px;
  text-align: left;
}
.preview-box { display: flex; flex-direction: column; align-items: center; gap: 10px; }
#preview {
  touch-action: none; /* on attrape le Gloopie au doigt sans faire défiler la page */
  border-radius: 20px;
  background:
    linear-gradient(180deg, #d9f2fb 0%, #a8dcf0 90.5%, #9fd98a 91%, #86c96f 100%);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.35), 0 8px 20px rgba(0, 0, 0, 0.3);
}

#slots { flex: 1; min-width: 0; display: flex; gap: 12px; }
#slots[hidden], #randomBtn[hidden], .closet-name[hidden] { display: none; }
/* Invité : la garde-robe est remplacée par ce message */
.guest-lock {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 18px 16px; border-radius: var(--radius-s); text-align: center;
  background: var(--card-2); border: 1px dashed var(--line); color: var(--muted); font-size: 13.5px;
}
.guest-lock[hidden] { display: none; }
.guest-lock p { margin: 0; }
.guest-lock b { color: var(--text); }
.guest-lock-icon { font-size: 30px; }

/* ----- Garde-robe et boutique (wardrobe.js) ----- */
.preview-actions { display: flex; align-items: center; justify-content: center; gap: 10px; }
.closet-coins { font-size: 15px; }
/* Sous l'aperçu : le pseudo et le titre, comme dans le jeu (clic : l'onglet des titres) */
.closet-name {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  width: 100%; max-width: 300px; padding: 6px 14px; border-radius: var(--radius-s);
  background: var(--card-2); border: 1px solid var(--line); color: var(--text);
  font: inherit; cursor: pointer; transition: background 0.12s;
}
.closet-name:hover { background: rgba(255, 255, 255, 0.11); }
.closet-name b { font-size: 15px; line-height: 1.2; }
.closet-name i {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12.5px; font-weight: 600; color: var(--accent);
}
.closet-name.untitled i { color: var(--muted); font-weight: 500; }
.closet-name.trying { border: 1px dashed var(--accent); }

/* Les onglets : une colonne (une ligne qui défile sur un petit écran) */
.closet-rail { position: relative; display: flex; flex-direction: column; gap: 3px; width: 160px; flex: none; }
.closet-tab {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 5px 8px; border-radius: var(--radius-s); text-align: left;
  border: 1px solid transparent; background: none; color: var(--text);
  font: inherit; cursor: pointer; transition: background 0.12s, opacity 0.12s;
}
.closet-tab:hover { background: rgba(255, 255, 255, 0.08); }
.closet-tab.active { background: rgba(255, 213, 79, 0.13); border-color: rgba(255, 213, 79, 0.45); }
.ct-ico { flex: none; width: 22px; font-size: 18px; text-align: center; }
.ct-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.2; }
.ct-label { font-size: 13.5px; font-weight: 600; }
.closet-tab.active .ct-label { color: var(--accent); }
.ct-worn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--muted); }
.ct-count { flex: none; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.closet-tab.found .ct-count { padding: 0 6px; border-radius: 999px; background: var(--accent); color: #3b2a00; font-weight: 700; }
.closet-tab.none { opacity: 0.4; }

.closet-main { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 8px; }
.closet-tools { display: flex; gap: 8px; }
.closet-search {
  display: flex; align-items: center; flex: 1; min-width: 0; gap: 6px; padding: 0 6px 0 11px;
  border-radius: 999px; background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line);
}
.closet-search:focus-within { border-color: rgba(255, 213, 79, 0.6); }
.closet-search > span { font-size: 12px; opacity: 0.75; }
.closet-search input {
  flex: 1; min-width: 0; padding: 7px 0; border: none; outline: none;
  background: none; color: var(--text); font: inherit; font-size: 13.5px;
}
.closet-search input::placeholder { color: var(--muted); }
.closet-search input::-webkit-search-cancel-button { display: none; } /* (notre ✕, le même partout) */
#closetClear {
  flex: none; width: 22px; height: 22px; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12); color: var(--text); font-size: 10px; cursor: pointer;
}
#closetClear:hover { background: rgba(255, 255, 255, 0.22); }
#closetClear[hidden] { display: none; }
#closetSort {
  padding: 0 10px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22); color: var(--text); font: inherit; font-size: 13px; cursor: pointer;
}
#closetSort option { background: var(--card-solid); color: var(--text); }
.closet-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.closet-filters { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(0, 0, 0, 0.22); }
.closet-filter {
  border: none; background: none; color: var(--muted);
  padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.closet-filter.active { background: rgba(255, 255, 255, 0.15); color: var(--text); }
.closet-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.closet-grid {
  position: relative; /* (repère des cases : wardrobe.js les place et les dessine d'après leur offsetTop) */
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px;
  height: 300px; overflow-y: auto; padding: 2px 4px 2px 2px; align-content: start;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.closet-grid.titles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.closet-section {
  grid-column: 1 / -1; margin: 6px 2px -2px;
  font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted);
}
.closet-section:first-child { margin-top: 0; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px 7px; border-radius: var(--radius-s);
  background: var(--card-2); border: 2px solid transparent; color: var(--text);
  font: inherit; cursor: pointer; transition: transform 0.12s, background 0.12s;
}
.tile:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.11); }
/* (le ciel en attendant le dessin : wardrobe.js ne dessine que les cases visibles) */
.tile-img {
  display: block; width: 72px; height: 72px; overflow: hidden; border-radius: 10px;
  background: linear-gradient(180deg, #d9f2fb 0%, #a8dcf0 86%, #9fd98a 86.5%, #86c96f 100%);
}
.tile-img canvas { display: block; width: 100%; height: 100%; }
.tile.st-shop .tile-img, .tile.st-trophy .tile-img { filter: saturate(0.5) brightness(0.8); }
.tile.worn { border-color: var(--mint); }
.tile.tried { border-color: var(--accent); background: rgba(255, 213, 79, 0.1); }
.tile.tried .tile-img { filter: none; }
.tile-name {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11.5px; font-weight: 600; line-height: 1.2;
}
.tile-badge { display: inline-flex; align-items: center; gap: 3px; min-height: 14px; font-size: 11px; color: var(--muted); }
.tile-badge .coin-icon { width: 11px; height: 11px; }
.tile.st-shop .tile-badge { color: #ffe08a; }
.tile.st-trophy .tile-badge { display: block; color: var(--pink); font-size: 10.5px; line-height: 1.25; text-align: center; }
.tile.worn .tile-badge { color: var(--mint); }
.tile-lock { position: absolute; top: 3px; right: 5px; font-size: 13px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6)); }
/* avancée vers le trophée qui donne l'objet */
.tile-bar { position: absolute; left: 10px; right: 10px; bottom: 3px; height: 3px; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, 0.1); }
.tile-bar span { display: block; height: 100%; border-radius: 2px; background: var(--pink); }
/* un titre : une plaque */
.tile-title { justify-content: center; gap: 3px; min-height: 76px; padding: 8px 8px 10px; }
.tile-title .tile-icon { font-size: 20px; line-height: 1; }
.tile-title .tile-name { white-space: normal; text-align: center; font-style: italic; font-size: 12.5px; color: var(--accent); }
.tile-title.st-trophy .tile-name { color: var(--muted); }
.tile-title.st-trophy .tile-icon { filter: grayscale(0.7); opacity: 0.7; }
.closet-empty {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin: 30px 0; text-align: center; color: var(--muted); font-size: 13px;
}
.closet-empty p { flex-basis: 100%; margin: 0 0 4px; }
.closet-elsewhere { padding: 6px 12px; font-size: 13px; }
.closet-info {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 54px;
  padding: 8px 12px; border-radius: var(--radius-s); background: var(--card-2); border: 1px solid var(--line);
}
.ci-head { display: flex; flex-direction: column; flex: 1; min-width: 150px; }
.ci-head small { font-size: 12px; color: var(--muted); }
.ci-buy { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; }
.ci-buy:disabled { opacity: 0.5; cursor: not-allowed; }
.ci-trophy { display: flex; align-items: center; gap: 10px; flex: 1 1 100%; }
.ci-tr-icon { font-size: 24px; }
.ci-tr-text { display: flex; flex-direction: column; flex: 1; gap: 2px; }
.ci-tr-text small { font-size: 12px; color: var(--muted); }
.ci-note { flex: 1 1 100%; margin: 0; font-size: 12px; color: var(--muted); }
.ci-note.bad { color: var(--danger); }

.login-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}
#playBtn { padding: 11px 28px; font-size: 17px; }

/* ----- Page d'accueil d'un compte (site/accueil.js) ----- */
#homeView {
  position: relative;
  width: min(780px, 100%);
  margin: auto;
  padding: 22px 28px 20px;
  text-align: center;
  background: rgba(44, 48, 82, 0.92);
}
#homeView[hidden] { display: none; }
.home-brand { font-size: 30px; }
.home-hero { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 8px; text-align: left; }
/* (haute, mais remontée : de la place pour les grands chapeaux quand il saute, sans pousser le texte) */
#homeGloopie { display: block; flex: none; width: 170px; height: 180px; margin-top: -48px; cursor: pointer; }
.home-hello { min-width: 0; }
.home-hello h2 { margin: 0; font-size: 30px; font-weight: 700; line-height: 1.15; }
.home-hello h2 b { color: var(--accent); }
.home-title {
  display: inline-block;
  margin: 6px 0 0;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 213, 79, 0.14);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.home-title[hidden] { display: none; }
.home-sub { margin: 6px 0 0; font-size: 16px; }
.home-since { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.home-since:empty { display: none; }
#homeView.loading .home-sub { color: var(--muted); }

.home-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 18px; }
.home-tile {
  --c: var(--sky);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 12px 8px 10px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--c);
  border-radius: var(--radius-s);
  background: var(--card-2);
  animation: home-in 0.45s ease-out both;
}
.home-tile:nth-child(2) { animation-delay: 0.06s; }
.home-tile:nth-child(3) { animation-delay: 0.12s; }
.home-tile:nth-child(4) { animation-delay: 0.18s; }
.home-tile:nth-child(5) { animation-delay: 0.24s; }
.home-tile.coins { --c: var(--accent); }
.home-tile.games { --c: var(--sky); }
.home-tile.wins { --c: #ffb347; }
.home-tile.podiums { --c: var(--pink); }
.home-tile.trophies { --c: var(--mint); }
.ht-ico { display: flex; align-items: center; height: 26px; font-size: 21px; }
.ht-ico .coin-icon { width: 22px; height: 22px; }
.home-tile b { color: var(--c); font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.home-tile > span:not(.ht-ico):not(.tr-bar) { color: var(--text); font-size: 13px; }
.home-tile small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.home-tile .tr-bar { width: 80%; margin-top: 5px; }
@keyframes home-in {
  from { opacity: 0; transform: translateY(8px); }
}

.home-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; text-align: left; }
.home-box {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: rgba(0, 0, 0, 0.18);
  animation: home-in 0.45s 0.3s ease-out both;
}
.home-box:empty { display: none; }
/* annonces du serveur : sous le bonjour, avant les chiffres */
.home-news {
  margin-top: 14px;
  text-align: left;
  border-left: 3px solid var(--sky);
  background: rgba(143, 211, 244, 0.08);
  animation-delay: 0s;
}
.home-news-list { margin: 0; padding: 0; list-style: none; }
.home-news-list li { display: flex; align-items: baseline; gap: 10px; padding: 5px 0; }
.home-news-list li + li { border-top: 1px solid var(--line); }
.home-news-list p { flex: 1; min-width: 0; margin: 0; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.home-news-list span { display: flex; flex: none; align-items: center; gap: 6px; }
.home-news-list time { color: var(--muted); font-size: 12px; }
.home-new { padding: 1px 7px; border-radius: 999px; background: var(--sky); color: #1b1d33; font-size: 11px; font-style: normal; font-weight: 700; }
.home-box h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 6px; font-size: 15px; }
.home-box h3 .link-btn { padding: 0; font-size: 12px; }
.home-empty { margin: 4px 0; color: var(--muted); font-size: 13px; }
.home-tr { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.home-tr + .home-tr { border-top: 1px solid var(--line); }
.home-tr-ico { flex: none; width: 26px; font-size: 21px; text-align: center; }
.home-tr > div { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.home-tr b { font-size: 14px; }
.home-tr small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.home-tr .tr-tier { margin-left: 6px; }
.home-tr-n { flex: none; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.home-ranked {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--rank) 14%, transparent);
}
.home-rank-name {
  flex: none;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--rank);
  color: #1b1d33;
  font-size: 13px;
  font-weight: 700;
}
.home-ranked > span:last-child { display: flex; flex-direction: column; }
.home-ranked b { color: var(--rank); font-size: 15px; }
.home-ranked small { color: var(--muted); font-size: 12px; }
.home-records { margin: 0; padding: 0; list-style: none; }
.home-records li { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 14px; }
.home-records li + li { border-top: 1px solid var(--line); }
.home-game { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-records b { flex: none; color: var(--accent); }
.home-place { flex: none; padding: 1px 7px; border-radius: 999px; background: rgba(255, 213, 79, 0.14); color: var(--accent); font-size: 11px; font-weight: 600; }
.home-place.week { background: rgba(143, 211, 244, 0.14); color: var(--sky); }
.home-more { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

.home-online { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 18px; margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.home-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgba(111, 227, 181, 0.2); animation: home-pulse 1.6s ease-in-out infinite; }
@keyframes home-pulse {
  50% { box-shadow: 0 0 0 6px rgba(111, 227, 181, 0); }
}
#homeView .login-actions { margin-top: 12px; }
#homePlay { padding: 12px 38px; font-size: 18px; }
@media (prefers-reduced-motion: reduce) {
  .home-tile, .home-box, .home-dot { animation: none; }
}

/* ----- Petits écrans ----- */
@media (max-width: 900px) {
  #main { flex-direction: column; align-items: center; }
  #stage { flex: none; }
  #side { flex: none; width: 100%; flex-direction: row; }
  #side > * { flex: 1 1 0px; }
  #chat { height: 240px; } /* hauteur fixe : les messages défilent à l'intérieur */
  .map-pill { display: none; }
}
@media (max-width: 640px) {
  #app { padding: 10px; }
  #hud { flex-wrap: wrap; }
  .hud-right { flex-wrap: wrap; justify-content: flex-end; }
  .volume-pill { padding: 0 10px; }
  #volumeSlider { width: 64px; }
  #volumeVal { display: none; }
  .objective-pill { order: 5; flex-basis: 100%; white-space: normal; text-align: center; }
  .objective-pill:empty, .objective-pill.off { display: none; } /* (pas de ligne vide) */
  .brand { flex: 1; }
  #side { flex-direction: column; }
  #side > * { flex: none; } /* l'un sous l'autre : chacun sa hauteur */
  #wardrobe { flex-direction: column; }
  #wardrobe { align-items: stretch; }
  /* garde-robe : les onglets en une ligne qui défile, au-dessus des objets */
  #slots { flex-direction: column; }
  .closet-rail { flex-direction: row; width: auto; overflow-x: auto; scrollbar-width: none; }
  .closet-tab { flex: none; width: auto; }
  .ct-worn { display: none; }
  .closet-bar { flex-wrap: wrap; }
  .closet-grid { height: 46vh; min-height: 260px; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
  .closet-grid.titles { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .tile-img { width: 64px; height: 64px; }
  .login-actions { flex-direction: column; }
  #homeView { padding: 18px 16px 16px; }
  .home-hero { flex-direction: column; gap: 4px; text-align: center; }
  #homeGloopie { margin-top: -36px; }
  .home-hello h2 { font-size: 24px; }
  .home-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
  .home-tile { padding: 8px 4px; }
  .home-tile b { font-size: 22px; }
  .home-tile small { display: none; }
  .home-tile.trophies { grid-column: span 2; }
  .home-cols { grid-template-columns: 1fr; }
  .home-records li { flex-wrap: wrap; }
  .home-game { flex-basis: 100%; }
  .home-records b { margin-left: auto; }
  .home-news-list li { flex-wrap: wrap; gap: 2px 8px; }
  .home-news-list p { flex-basis: 100%; }
  /* « Jouer » toujours à portée de pouce : collé en bas de l'écran tant que la page défile */
  #homeView .login-actions {
    position: sticky;
    bottom: -16px;
    z-index: 1;
    flex-direction: column-reverse;
    margin: 12px -16px 0;
    padding: 14px 16px 16px;
    background: linear-gradient(rgba(44, 48, 82, 0), rgba(44, 48, 82, 0.97) 28%);
  }
  #homePlay { width: 100%; }
  .title { font-size: 36px; }
  #help { display: none; }
}

/* ----- Console de debug (F2) ----- */
#debugPanel {
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  max-width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: rgba(18, 20, 36, 0.96);
  border-left: 1px solid var(--line);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  z-index: 20;
  overflow-y: auto;
}
#debugPanel[hidden] { display: none; }
@media (min-width: 900px) {
  body.debug-open #app { margin-right: 340px; }
}
.dbg-head { display: flex; align-items: center; gap: 8px; }
.dbg-head b { color: var(--accent); font-size: 14px; }
#dbgFps { flex: 1; color: #8a91a8; }
#debugPanel button {
  background: rgba(255, 255, 255, 0.08);
  color: #eee;
  border: none;
  border-radius: 8px;
  padding: 4px 9px;
  cursor: pointer;
  font-size: 12px;
}
#debugPanel button:hover { background: rgba(255, 255, 255, 0.16); }
#debugPanel button.primary, #debugPanel button.on { background: var(--accent); color: #222; font-weight: 600; }
#dbgLog {
  flex: 1;
  min-height: 140px;
  max-height: 40vh;
  overflow-y: auto;
  background: #0d0f1c;
  border-radius: 8px;
  padding: 6px;
  font-family: Consolas, monospace;
  white-space: pre-wrap;
  color: #c9cfdf;
}
#dbgLog .cmd { color: var(--accent); }
#dbgLog .ok { color: #7dffa1; }
#dbgLog .err { color: #ff7a7a; }
#debugPanel input:not([type="checkbox"]) {
  background: #0d0f1c;
  color: #eee;
  border: 1px solid #3a3f5c;
  border-radius: 6px;
  padding: 5px 6px;
  font-family: Consolas, monospace;
}
#dbgInput { width: 100%; }
.dbg-section { border-top: 1px solid var(--line); padding-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.dbg-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dbg-row input:not([type="checkbox"]) { flex: 1; min-width: 0; }
#dbgSel { color: var(--accent); font-weight: 600; }
#dbgProps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
#dbgProps label { display: flex; flex-direction: column; color: #8a91a8; }
#dbgProps input { width: 100%; }
.dbg-help { color: #8a91a8; margin: 0; line-height: 1.5; }

/* ---------- Éditeur de thèmes (theme-editor.js) ---------- */
#themePanel { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; }
#themePanel[hidden] { display: none; }
#themePanel h2 { display: flex; justify-content: space-between; align-items: center; }
.ed-theme-btn { padding: 6px 10px; font-size: 13px; }
.te-range { display: grid; grid-template-columns: 1fr; gap: 2px; font-size: 12px; color: var(--muted); }
.te-range b { color: var(--text, #fff); font-weight: 600; }
.te-range input { width: 100%; }
.te-effects { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; font-size: 12px; }
.te-effects .ed-check { display: flex; align-items: center; gap: 5px; color: var(--muted); }
.te-cgroup { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 8px; font-size: 11px; color: var(--muted); }
.te-cgroup > span { grid-column: 1 / -1; font-weight: 600; margin-top: 4px; }
.te-cgroup label { display: flex; align-items: center; gap: 5px; }
.te-cgroup input[type="color"] { width: 26px; height: 20px; border: 0; padding: 0; background: none; flex: none; }
.te-layers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.te-layers li { display: flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 8px; cursor: pointer; background: rgba(255, 255, 255, 0.04); }
.te-layers li span { flex: 1; }
.te-layers li.selected { background: rgba(255, 213, 79, 0.18); }
.te-layers li.ed-hint { cursor: default; background: none; }
.te-layers button { border: 0; background: rgba(255, 255, 255, 0.08); color: inherit; border-radius: 6px; cursor: pointer; font-size: 10px; padding: 2px 5px; }

/* ----- Atelier : petite carte des zones de la Place (editor.js, renderZoneMap) ----- */
.ed-zonemap { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; }
.zm-world > span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.zm-grid { display: grid; align-items: stretch; row-gap: 0; }
.zm-cell {
  min-height: 22px; padding: 2px 3px; border-radius: 6px; font-size: 9.5px; line-height: 1.1;
  display: flex; align-items: center; justify-content: center; text-align: center;
  overflow: hidden; text-overflow: ellipsis; word-break: break-word;
  background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line); color: var(--text);
}
.zm-open { background: rgba(143, 211, 244, 0.18); border-color: rgba(143, 211, 244, 0.45); cursor: pointer; }
.zm-open:hover { background: rgba(143, 211, 244, 0.32); }
.zm-mine { background: rgba(255, 213, 79, 0.25); border: 1.5px solid var(--accent); font-weight: 700; }
.zm-clash { background: rgba(255, 107, 125, 0.3); border-color: var(--danger); }
.zm-free { background: none; border: 1px dashed rgba(255, 255, 255, 0.18); color: var(--muted); cursor: pointer; }
.zm-free:hover { border-color: var(--accent); color: var(--accent); }
.zm-void { background: none; border: none; }
.zm-link { align-self: center; height: 3px; border-radius: 2px; }
.zm-link.zm-v { height: 6px; width: 3px; justify-self: center; }
.zm-link.on { background: var(--mint); }

/* ----- Fenêtres du site : menu ☰, Mon compte (public/site/) ----- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(16, 17, 34, 0.7);
  backdrop-filter: blur(5px);
}
.modal[hidden] { display: none; }
.menu-panel { width: min(420px, 100%); }
.acc-panel { width: min(560px, 100%); }

/* Panthéon (public/site/halloffame.js) : onglets des jeux, champions, podium et classement */
.hof-panel { width: min(860px, 100%); }
.hof-period { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.22); }
.hof-per {
  padding: 6px 14px; border: none; border-radius: 999px; background: none;
  color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.hof-per:hover { color: var(--text); }
.hof-per.active { color: #3b2a00; background: linear-gradient(180deg, #ffe27a, var(--accent-2)); }
.hof-when { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.hof-when b { color: var(--text); }
.hof-when:empty { display: none; }
.hof-coins {
  flex: none; display: inline-flex; align-items: center; gap: 3px;
  font-style: normal; font-size: 11px; font-weight: 700; white-space: nowrap;
  padding: 1px 4px 1px 7px; border-radius: 999px; color: var(--accent);
  background: rgba(255, 213, 79, 0.12); border: 1px solid rgba(255, 213, 79, 0.35);
}
.hof-coins .coin-icon { width: 12px; height: 12px; }
.hof-coins .coin-icon::after { font-size: 7px; }
.hof-prev { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hof-note { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.hof-last { margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.16); }
.hof-last h4 { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.hof-last ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.hof-last li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.hof-last li b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hof-last li.me b { color: var(--accent); }
.hof-last li em { font-style: normal; color: var(--accent); font-weight: 700; }
.hof-last .hof-rank { width: 22px; height: 22px; font-size: 12px; }
.hof-last .hof-rank.r1 { background: linear-gradient(180deg, #ffe27a, #e0a12f); color: #7a4a00; }
.hof-last .hof-rank.r2 { background: linear-gradient(180deg, #eef1fa, #a3abc6); color: #4a5170; }
.hof-last .hof-rank.r3 { background: linear-gradient(180deg, #f3b07a, #b46634); color: #5a2c10; }
.hof-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: thin; }
.hof-tab {
  flex: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card-2); color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.hof-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); }
.hof-tab.active { color: #2a1f00; background: var(--mode-color, var(--accent)); border-color: transparent; }
.hof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.hof-card {
  display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; text-align: left;
  border: 1px solid var(--line); border-top: 3px solid var(--mode-color); border-radius: 14px;
  background: var(--card-2); color: var(--text); font: inherit; cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.hof-card:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-2px); }
.hof-card-head { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.hof-card-head b { color: var(--mode-color); }
.hof-ico { font-size: 18px; }
.hof-mini { display: block; width: 100%; height: 104px; }
.hof-podium { display: block; width: 100%; height: 250px; margin: 4px 0 10px; }
.hof-champ { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 15px; }
.hof-champ b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hof-champ span { color: var(--accent); font-weight: 700; white-space: nowrap; }
.hof-champ.none { color: var(--muted); font-size: 13px; }
.hof-champ.me b, .hof-next li.me b { color: var(--accent); }
.hof-next { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.hof-next li { display: flex; gap: 6px; align-items: baseline; color: var(--muted); }
.hof-next li span { width: 14px; text-align: right; }
.hof-next li b { flex: 1; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hof-next li em { font-style: normal; }
.hof-mine { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.hof-mine b { color: var(--accent); }
.hof-desc { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.hof-desc .hof-ico { font-size: 15px; }
.hof-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.hof-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px;
  border-radius: 12px; background: var(--card-2); border: 1px solid transparent;
}
.hof-row.me { border-color: rgba(255, 213, 79, 0.45); background: rgba(255, 213, 79, 0.1); }
.hof-rank {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 13px; background: rgba(255, 255, 255, 0.08); color: var(--muted);
}
.hof-row.r1 .hof-rank { background: linear-gradient(180deg, #ffe27a, #e0a12f); color: #7a4a00; }
.hof-row.r2 .hof-rank { background: linear-gradient(180deg, #eef1fa, #a3abc6); color: #4a5170; }
.hof-row.r3 .hof-rank { background: linear-gradient(180deg, #f3b07a, #b46634); color: #5a2c10; }
.hof-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2); }
.hof-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hof-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hof-who small { font-size: 12px; color: var(--muted); }
.hof-score { flex: none; font-weight: 700; color: var(--accent); }
.hof-game .hof-mine { margin-top: 10px; font-size: 13px; }
.hof-empty { margin: 12px 0; text-align: center; color: var(--muted); font-size: 14px; }
.menu-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--card-2);
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.menu-item:hover { background: rgba(255, 255, 255, 0.11); }
.menu-ico { font-size: 22px; width: 28px; text-align: center; }
.menu-text { display: flex; flex-direction: column; }
.menu-text b { font-weight: 600; }
.menu-text small { color: var(--muted); font-size: 12px; }
.menu-text small:empty { display: none; }
.menu-sep { height: 1px; margin: 4px 0; background: var(--line); }

.acc-since { margin: 4px 0 10px; color: var(--muted); font-size: 13px; }
.acc-sec { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--card-2); }
.acc-sec h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.acc-email { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; word-break: break-all; }
.acc-badge { font-size: 12px; padding: 2px 8px; border-radius: 99px; }
.acc-badge.ok { background: rgba(111, 227, 181, 0.18); color: var(--mint); }
.acc-badge.warn { background: rgba(255, 213, 79, 0.18); color: var(--accent); }
.acc-badge:empty { display: none; }
.acc-note { margin: 6px 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.acc-form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.acc-form input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 11, 30, 0.35);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}
.acc-form input:focus { border-color: var(--accent); }
.acc-btn { padding: 7px 14px; font-size: 13px; }
.acc-btn[hidden] { display: none; }
.btn-danger { background: var(--danger); color: #fff; }
.acc-msg { margin: 6px 0 0; min-height: 0; font-size: 13px; color: var(--danger); }
.acc-msg.ok { color: var(--mint); }
.acc-msg:empty { display: none; }
.acc-danger summary { cursor: pointer; font-weight: 600; color: var(--danger); }
.acc-legal, .auth-legal { margin: 12px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
.acc-legal a, .auth-legal a, .auth-hint a { color: var(--sky); }

/* écran de connexion : mot de passe oublié, messages */
.auth-forgot { align-self: flex-end; margin-top: -6px; padding: 0; font-size: 12px; }
.auth-forgot[hidden] { display: none; }
.auth-sub { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.auth-sub[hidden] { display: none; }
.auth-sub-title { margin: 0; font-size: 18px; color: var(--accent); }
.auth-sub .link-btn { align-self: center; }
.auth-error.auth-ok { color: var(--mint); }
#authMain[hidden] { display: none; }
.auth-notice { margin: 12px 0 0; padding: 8px 12px; border-radius: 10px; background: rgba(111, 227, 181, 0.15); color: var(--mint); font-size: 13px; }
.auth-notice.bad { background: rgba(255, 107, 125, 0.15); color: var(--danger); }
.auth-notice[hidden] { display: none; }
.account-warn { color: var(--accent); }
#messages .info { white-space: pre-line; }

/* ----- Administration (site/admin.js) : fenêtre 🛡️, menu d'un joueur, gel, annonce ----- */
body.is-admin #scoreList li[data-id], body.is-admin #messages b[data-id] { cursor: pointer; }
body.is-admin #scoreList li[data-id]:hover { background: rgba(255, 255, 255, 0.08); }
body.is-admin #messages b[data-id]:hover { text-decoration: underline; }
#game.adm-hover { cursor: pointer; }

.adm-panel { width: min(760px, 100%); }
/* la carte où est l'administrateur, et « Éditer cette carte » (ouvre l'Atelier dessus) */
.adm-here {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 8px 12px;
  border-radius: var(--radius-s); background: var(--card-2); border: 1px solid var(--line);
}
.adm-here-text { flex: 1; min-width: 0; font-size: 14px; }
.adm-here-text small { display: block; color: var(--muted); font-size: 12px; }
.adm-here-btn { flex: none; padding: 6px 12px; font-size: 13px; }
.adm-here-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.adm-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.adm-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card-2); color: var(--muted);
  font: inherit; font-size: 14px; font-weight: 600;
}
.adm-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); }
.adm-tab.active { color: #3b2a00; background: linear-gradient(180deg, #ffe27a, var(--accent-2)); border-color: transparent; }
.adm-tab.active .count-chip { background: rgba(59, 42, 0, 0.18); color: #3b2a00; }
.adm-tab .count-chip:empty { display: none; }
.adm-input {
  width: 100%; min-width: 0; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(10, 11, 30, 0.35); color: var(--text);
  font: inherit; font-size: 14px; outline: none;
}
.adm-input:focus { border-color: var(--accent); }
.adm-line { display: flex; gap: 6px; align-items: center; }
.adm-line .adm-input { flex: 1; }
.adm-send { flex: none; }
.adm-h { margin: 14px 0 8px; font-size: 15px; font-weight: 600; }
.adm-backup { align-items: flex-start; font-size: 13px; }
.adm-backup #admBackup { flex: 1; min-width: 0; }
.adm-backup small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; word-break: break-all; }
.adm-backup .btn { flex: none; }
.adm-backup-bad { color: var(--accent); }
.adm-empty { color: var(--muted); font-size: 13px; text-align: center; margin: 14px 0; list-style: none; }
.adm-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.adm-feedback { margin: 6px 0 0; font-size: 13px; }
.adm-feedback:empty { display: none; }
.adm-feedback { white-space: pre-line; }
/* onglet « Commandes » */
.adm-clock { margin-left: 6px; color: var(--muted); font-size: 12px; font-weight: 400; }
.adm-dial { margin-top: 8px; }
.adm-dial input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); }
.adm-dial .adm-clock { flex: 0 0 auto; width: 270px; max-width: 48%; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* (largeur fixe : le curseur ne change pas de taille pendant qu'on le glisse) */
.adm-cmds { display: flex; flex-direction: column; gap: 5px; }
.adm-cmd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 6px 10px; border-radius: var(--radius-s); background: var(--card-2); border: 1px solid var(--line); }
.adm-cmd.off { opacity: 0.55; }
.adm-cmd-lbl { flex: 1 1 210px; min-width: 0; font-size: 14px; }
.adm-cmd-lbl small { display: block; color: var(--muted); font-size: 11px; }
.adm-cmd-args { display: flex; flex-wrap: wrap; gap: 5px; }
.adm-cmd-args .adm-input { width: auto; padding: 5px 8px; font-size: 13px; }
.adm-cmd-args .adm-num { width: 78px; }
.adm-cmd-args .adm-txt { width: 130px; }
.adm-cmd-args .adm-sel { max-width: 190px; }
.adm-cmd-go { flex: none; }
/* la carte des zones (commande « Aller dans une zone ») : les zones de la Place sur leur grille */
.adm-zmap { flex: 1 1 100%; min-width: 0; overflow-x: auto; overflow-y: hidden; padding: 6px; border-radius: 10px; background: rgba(10, 11, 30, 0.35); }
.adm-zgrid { position: relative; flex: none; }
.adm-zcell {
  position: absolute; width: 112px; height: 56px; padding: 0; overflow: hidden; cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.14); border-radius: 8px; color: #fff; font: inherit;
  transition: border-color 0.15s, transform 0.15s;
}
.adm-zcell:hover:not(:disabled), .adm-zcell:focus-visible { border-color: var(--accent); transform: translateY(-2px); outline: none; z-index: 1; }
.adm-zcell.picked { border-color: var(--accent); }
.adm-zcell.here { border-color: var(--mint); box-shadow: 0 0 0 2px rgba(111, 227, 181, 0.35); cursor: default; }
.adm-zcell:disabled:not(.here) { cursor: not-allowed; }
.adm-zpic { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 0.3s; }
.adm-zpic.ready { opacity: 1; }
.adm-zname {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 5px 2px; text-align: left;
  font-size: 11px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72) 55%); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.adm-zwho { position: absolute; top: 3px; right: 3px; display: flex; align-items: center; gap: 2px; }
.adm-zwho i { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.5); }
.adm-zwho b { padding: 0 3px; border-radius: 6px; background: rgba(0, 0, 0, 0.55); font-size: 10px; line-height: 13px; }
.adm-zapart { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.adm-zlbl { color: var(--muted); font-size: 12px; }
.adm-feedback.ok { color: var(--mint); }
.adm-feedback.bad { color: var(--danger); }
.adm-dot { width: 14px; height: 14px; flex: none; border-radius: 50%; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18), 0 0 0 2px rgba(255, 255, 255, 0.12); }
.adm-tag { margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; background: rgba(255, 255, 255, 0.1); color: var(--muted); vertical-align: 1px; }
.adm-tag.acc { background: rgba(143, 211, 244, 0.16); color: var(--sky); }
.adm-tag.admin { background: rgba(255, 213, 79, 0.18); color: var(--accent); }
.adm-tag.me { background: rgba(111, 227, 181, 0.18); color: var(--mint); }

/* liste des joueurs en ligne */
.adm-prow {
  display: grid; grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-s); cursor: pointer; text-align: left;
  border: 1px solid var(--line); background: var(--card-2); color: var(--text); font: inherit;
}
.adm-prow:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 213, 79, 0.35); }
.adm-pname { display: flex; flex-wrap: wrap; align-items: baseline; min-width: 0; }
.adm-pname b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-pname small { flex-basis: 100%; color: var(--muted); font-size: 11px; }
.adm-pwhere { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-picons { letter-spacing: 2px; }
.adm-picons i { font-style: normal; }

/* sanctions en cours, journal, serveur */
.adm-srow { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-s); background: var(--card-2); border: 1px solid var(--line); }
.adm-sico { font-size: 20px; }
.adm-stext { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.adm-stext small { color: var(--muted); font-size: 12px; }
.adm-who { color: var(--sky); font-weight: 600; text-decoration: none; }
.adm-who:hover { text-decoration: underline; }
.adm-liftbtn { flex: none; padding: 6px 12px; font-size: 13px; }
.adm-log { gap: 2px; }
.adm-lrow { display: flex; gap: 10px; padding: 5px 8px; border-radius: 8px; font-size: 13px; }
.adm-lrow:nth-child(odd) { background: var(--card-2); }
.adm-lrow time { flex: none; width: 92px; color: var(--muted); font-size: 12px; }
.adm-lrow small { color: var(--muted); }
.adm-stats { margin: 6px 0 0; }
.adm-rooms { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.adm-rooms small { display: block; color: var(--muted); font-size: 12px; margin-left: 24px; }
.adm-version { margin: 12px 0 0; color: var(--muted); font-size: 11px; word-break: break-word; }

/* menu d'un joueur : une carte près du clic, sans voile (le jeu reste visible) */
.adm-pop { z-index: 16; display: block; padding: 0; background: transparent; backdrop-filter: none; }
.adm-card {
  position: fixed; width: min(372px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow-y: auto;
  padding: 12px 14px; background: rgba(40, 44, 76, 0.98); border-color: rgba(255, 213, 79, 0.25);
  animation: sm-in 0.25s cubic-bezier(.2, 1.3, .4, 1) both;
}
.adm-card.adm-wait { visibility: hidden; animation: none; } /* (sa fiche arrive : il apparaîtra à sa vraie taille) */
.adm-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.adm-headline { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; min-width: 0; }
.adm-headline .adm-dot { margin-right: 6px; }
.adm-name { font-size: 18px; font-weight: 600; color: var(--accent); overflow: hidden; text-overflow: ellipsis; }
.adm-x { width: 30px; height: 30px; font-size: 13px; }
.adm-sub { margin-top: 4px; font-size: 13px; color: var(--text); }
.adm-sub small { display: block; color: var(--muted); font-size: 11px; }
.adm-sub .coin-icon { display: inline-flex; width: 13px; height: 13px; vertical-align: -2px; margin-right: 2px; }
.adm-sub .coin-icon::after { font-size: 8px; }
.adm-status { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.adm-status:empty { display: none; }
.adm-chip { padding: 2px 8px; border-radius: 999px; font-size: 12px; background: rgba(255, 213, 79, 0.16); color: #ffe9a6; }
.adm-chip.bad { background: rgba(255, 107, 125, 0.18); color: #ffb3bd; }
.adm-chip.ice { background: rgba(143, 211, 244, 0.2); color: #cdeeff; }
.adm-sec { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.adm-sec[hidden] { display: none; }
.adm-sec h4 { margin: 0 0 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.adm-btns { display: flex; flex-wrap: wrap; gap: 5px; }
.adm-b {
  padding: 5px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.07); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 500;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}
.adm-b:hover:not(:disabled) { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.25); }
.adm-b:active:not(:disabled) { transform: scale(0.96); }
.adm-b:disabled { opacity: 0.4; cursor: not-allowed; }
.adm-b.adm-lift { background: rgba(111, 227, 181, 0.16); border-color: rgba(111, 227, 181, 0.35); color: var(--mint); }
.adm-b.adm-sure, .btn.adm-sure { background: var(--danger); border-color: var(--danger); color: #fff; }
.adm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 6px; }
.adm-lbl { width: 70px; flex: none; font-size: 13px; font-weight: 600; }
#admReason { margin-bottom: 2px; }
.adm-line .adm-num { flex: 0 0 84px; }
.adm-keep { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--muted); font-size: 12px; cursor: pointer; }
.adm-keep input { flex: none; margin: 0; accent-color: var(--accent); }
.adm-lrow .adm-newsdel { flex: none; margin-left: auto; padding: 2px 9px; font-size: 12px; }
.adm-lrow.adm-off { opacity: 0.55; }
.adm-note { margin: 10px 0 0; padding: 6px 10px; border-radius: 10px; background: rgba(255, 213, 79, 0.1); color: var(--accent); font-size: 12px; }
.adm-note[hidden] { display: none; }
.adm-more { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; }
.adm-more[hidden] { display: none; }
.adm-more summary { cursor: pointer; font-weight: 600; color: var(--sky); }
.adm-more pre { margin: 6px 0; white-space: pre-wrap; font: inherit; font-size: 12px; color: var(--muted); }
.adm-more ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; }
.adm-more li { font-size: 12px; word-break: break-word; }
.adm-more time { color: var(--muted); margin-right: 4px; }

/* gelé (en bas du jeu : la prison est en haut) ; annonce (en haut : les notifications se décalent) */
#frozenBar {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); max-width: 92%;
  padding: 6px 16px; border-radius: 999px; pointer-events: none; text-align: center;
  background: rgba(20, 34, 52, 0.9); border: 1px solid rgba(143, 211, 244, 0.7); color: var(--text); font-size: 13px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 18px rgba(143, 211, 244, 0.25);
}
#frozenBar[hidden] { display: none; }
#frozenBar b { color: var(--sky); font-weight: 600; }
#announceBar {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 2;
  display: flex; align-items: center; gap: 10px; width: max-content; max-width: 92%;
  padding: 8px 18px; border-radius: 14px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 226, 122, 0.97), rgba(255, 179, 71, 0.97)); color: #3b2a00;
  font-size: 15px; font-weight: 600; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  animation: toast-in 0.35s cubic-bezier(.2, 1.3, .4, 1) both;
}
#announceBar[hidden] { display: none; }
#announceBar.out { animation: toast-out 0.4s ease forwards; }
#announceBar .ann-ico { font-size: 20px; }
.canvas-wrap.announcing #toasts, .canvas-wrap.announcing #prisonBar { top: 58px; }

/* la pluie de cadeaux (pluie.js) : en haut du jeu, sous l'annonce s'il y en a une (les notifications passent dessous) */
#rainBar {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 2;
  width: max-content; max-width: 92%; padding: 6px 16px; border-radius: 999px; pointer-events: none; text-align: center;
  background: linear-gradient(180deg, rgba(122, 76, 196, 0.94), rgba(79, 45, 140, 0.94)); color: #fff;
  border: 1px solid rgba(255, 210, 87, 0.75); font-size: 14px; font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), 0 0 18px rgba(255, 210, 87, 0.25);
  animation: toast-in 0.35s cubic-bezier(.2, 1.3, .4, 1) both;
}
#rainBar[hidden] { display: none; }
#rainBar.now { background: linear-gradient(180deg, rgba(232, 80, 143, 0.95), rgba(176, 46, 104, 0.95)); animation: toast-in 0.35s cubic-bezier(.2, 1.3, .4, 1) both, rain-glow 1.2s ease-in-out infinite alternate; }
@keyframes rain-glow { to { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), 0 0 26px rgba(255, 210, 87, 0.6); } }
.canvas-wrap.announcing #rainBar { top: 58px; }
.canvas-wrap.raining #toasts { top: 50px; }
.canvas-wrap.raining.announcing #toasts { top: 98px; }

@media (max-width: 560px) {
  .adm-prow { grid-template-columns: auto minmax(0, 1fr) auto; }
  .adm-pwhere { grid-column: 2 / 4; grid-row: 2; }
  .adm-lrow { flex-direction: column; gap: 0; }
}

/* ----- Retours des joueurs (site/feedback.js) : bouton 📝, fenêtre, « Cette partie t'a plu ? », onglet « Retours » ----- */
#feedbackBtn, #adminBtn { position: relative; }
#feedbackBtn.has-dot::after {
  content: ""; position: absolute; top: 1px; right: 1px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--danger); box-shadow: 0 0 0 2px var(--bg-1);
}
#adminBtn[data-badge]:not([data-badge=""])::after {
  content: attr(data-badge); position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
}
.fb-panel { width: min(600px, 100%); }
.fb-tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card-2); color: var(--muted); font: inherit; font-size: 14px; font-weight: 600;
}
.fb-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); }
.fb-tab.active { color: #3b2a00; background: linear-gradient(180deg, #ffe27a, var(--accent-2)); border-color: transparent; }
.fb-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.fb-dot[hidden] { display: none; }
.fb-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.fb-kind {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; text-align: center;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card-2); color: var(--text); font: inherit; cursor: pointer;
  transition: background 0.12s, transform 0.12s, border-color 0.12s;
}
.fb-kind:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-1px); }
.fb-kind.active { border-color: var(--accent); background: rgba(255, 213, 79, 0.14); box-shadow: inset 0 0 0 1px var(--accent); }
.fb-kind-ico { font-size: 26px; line-height: 1.2; }
.fb-kind b { font-size: 14px; }
.fb-kind small { font-size: 11px; color: var(--muted); }
.fb-q { margin: 2px 0 6px; font-size: 13px; color: var(--muted); }
.fb-moods { display: flex; gap: 6px; margin-bottom: 10px; }
.fb-mood {
  flex: 1; display: flex; flex-direction: column; align-items: center; padding: 6px 4px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card-2); color: var(--text); font: inherit; font-size: 26px;
  filter: grayscale(0.7); opacity: 0.75; transition: filter 0.12s, opacity 0.12s, transform 0.12s;
}
.fb-mood:hover { filter: none; opacity: 1; transform: translateY(-1px); }
.fb-mood small { font-size: 11px; color: var(--muted); }
.fb-mood.active { filter: none; opacity: 1; border-color: var(--accent); background: rgba(255, 213, 79, 0.14); }
.fb-text { display: block; min-height: 100px; resize: vertical; line-height: 1.4; }
.fb-under { display: flex; justify-content: flex-end; margin: 3px 2px 8px; }
.fb-count { font-size: 11px; color: var(--muted); }
.fb-shot { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-2); cursor: pointer; }
.fb-shot input { flex: none; width: 16px; height: 16px; accent-color: var(--accent); }
.fb-shot img { flex: none; width: 120px; height: 60px; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; transition: opacity 0.15s, filter 0.15s; }
.fb-shot span { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.fb-shot small { color: var(--muted); font-size: 11px; }
.fb-shot.off img { opacity: 0.35; filter: grayscale(1); }
.fb-where { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.fb-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.fb-actions .btn:disabled { opacity: 0.6; cursor: wait; }
/* « Mes retours » (et les réponses, aussi dans le panneau) */
.fb-mine { display: flex; flex-direction: column; gap: 8px; }
.fb-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--card-2); }
.fb-item.fresh { border-color: rgba(255, 213, 79, 0.55); box-shadow: inset 0 0 0 1px rgba(255, 213, 79, 0.25); }
.fb-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.fb-item-head small { color: var(--muted); font-size: 11px; }
.fb-item-text, .fb-row-text { margin: 6px 0 0; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.fb-item-mood { font-size: 18px; vertical-align: -2px; }
.fb-st { flex: none; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: rgba(255, 255, 255, 0.1); color: var(--text); }
.fb-st.st-nouveau { background: rgba(255, 213, 79, 0.18); color: var(--accent); }
.fb-st.st-vu { background: rgba(143, 211, 244, 0.16); color: var(--sky); }
.fb-st.st-encours { background: rgba(255, 179, 71, 0.2); color: var(--accent-2); }
.fb-st.st-corrige { background: rgba(111, 227, 181, 0.18); color: var(--mint); }
.fb-st.st-refuse { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.fb-reply { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--mint); border-radius: 10px; background: rgba(111, 227, 181, 0.1); font-size: 13px; }
.fb-reply small { color: var(--muted); font-size: 11px; }
.fb-reply p { margin: 3px 0 0; white-space: pre-wrap; word-break: break-word; }

/* fin de partie : « Cette partie t'a plu ? » (en haut à droite du jeu, pendant le podium : les roues
   de la chance sont à gauche, le titre au milieu) */
#rateCard {
  position: absolute; top: 10px; right: 10px; z-index: 3; max-width: calc(100% - 20px);
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 10px 6px;
  border: 1px solid rgba(255, 213, 79, 0.45); border-radius: 16px; background: rgba(30, 33, 60, 0.9);
  color: #fff; font-size: 13px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); backdrop-filter: blur(6px);
  animation: toast-in 0.35s cubic-bezier(.2, 1.4, .4, 1) both;
}
#rateCard[hidden] { display: none; }
#rateCard.out { animation: toast-out 0.35s ease-in forwards; }
.rate-q { padding: 0 14px; font-weight: 600; text-align: center; }
.rate-big { font-size: 18px; vertical-align: -2px; }
.rate-faces { display: flex; gap: 2px; }
.rate-face { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: transparent; font-size: 22px; cursor: pointer; transition: transform 0.12s, background 0.12s; }
.rate-face:hover { transform: scale(1.22); background: rgba(255, 255, 255, 0.12); }
.rate-x { position: absolute; top: 2px; right: 3px; padding: 3px 5px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 11px; cursor: pointer; }
.rate-x:hover { color: #fff; }
.rate-why { margin-bottom: 2px; padding: 4px 10px; border: 1px solid rgba(255, 213, 79, 0.5); border-radius: 999px; background: rgba(255, 213, 79, 0.15); color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.rate-why:hover { background: rgba(255, 213, 79, 0.25); }

/* fin de partie : « On continue ? » (podium.js) : sous le titre du podium, à la place de son compte
   à rebours ; la barre du bas se vide jusqu'à la partie suivante */
#endMenu {
  position: absolute; top: 16.5%; left: 0; right: 0; z-index: 3; width: fit-content; max-width: calc(100% - 20px); margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 16px; padding: 8px 14px 11px; overflow: hidden;
  border: 1px solid rgba(255, 213, 79, 0.45); border-radius: 16px; background: rgba(30, 33, 60, 0.9);
  color: #fff; font-size: 13px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); backdrop-filter: blur(6px);
  animation: toast-in 0.35s cubic-bezier(.2, 1.4, .4, 1) both;
}
#endMenu[hidden] { display: none; }
#endMenu.out { animation: toast-out 0.35s ease-in forwards; }
.em-q { display: flex; flex-direction: column; align-items: center; line-height: 1.3; }
.em-ask, .em-ok { font-size: 15px; font-weight: 600; }
.em-ok { display: none; color: var(--mint); }
.em-q small { color: rgba(255, 255, 255, 0.75); font-size: 12px; }
.em-q b { color: #ffd27a; }
.em-btns { display: inline-flex; gap: 8px; }
.em-btns .btn { padding: 6px 16px; font-size: 14px; }
#endMenu.stay .em-ask, #endMenu.stay .em-btns { display: none; }
#endMenu.stay .em-ok { display: inline; }
.em-time { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.08); }
.em-time i { display: block; height: 100%; background: #ffd54f; transform-origin: left; animation: knock-time linear forwards; }

/* les tipis (site/maison.js) : quelqu'un frappe chez moi (en haut du jeu), et la fenêtre ⛺ */
#knockCards {
  position: absolute; top: 10px; left: 50%; z-index: 4; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(440px, calc(100% - 20px));
}
#knockCards[hidden] { display: none; }
.knock-card {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px;
  width: 100%; padding: 8px 12px 10px; overflow: hidden;
  border: 1px solid rgba(240, 160, 75, 0.6); border-radius: 16px; background: rgba(30, 33, 60, 0.92);
  color: #fff; font-size: 13px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); backdrop-filter: blur(6px);
  animation: toast-in 0.35s cubic-bezier(.2, 1.4, .4, 1) both;
}
.knock-q { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.knock-q b { color: #ffd27a; }
.knock-dot, .house-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2); }
.knock-btns { display: inline-flex; gap: 6px; }
.knock-btns .btn { padding: 5px 14px; font-size: 13px; }
.knock-time { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.08); }
.knock-time i { display: block; height: 100%; background: #f0a04b; transform-origin: left; animation: knock-time linear forwards; }
@keyframes knock-time { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.house-panel { width: min(480px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.house-sec { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--card-2); }
.house-sec h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.house-sec > .btn { margin: 0 6px 6px 0; }
.house-where { margin: 0 0 8px; font-size: 14px; }
.house-where b { color: #ffd27a; }
.house-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.house-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: rgba(0, 0, 0, 0.16); }
.house-list b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.house-list small { flex: 1; min-width: 0; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.house-list .btn { flex: none; margin-left: auto; padding: 4px 12px; font-size: 13px; }
.house-list small + .btn { margin-left: 0; }
.house-wait { color: #ffd27a !important; }
.house-tag { flex: none; margin-left: auto; font-size: 14px; }
.house-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.house-mode {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; text-align: left;
  border: 1px solid var(--line); border-radius: 12px; background: rgba(0, 0, 0, 0.16); color: var(--text); font: inherit; cursor: pointer;
}
.house-mode b { font-size: 13px; font-weight: 600; }
.house-mode small { font-size: 11px; color: var(--muted); line-height: 1.3; }
.house-mode:hover { background: rgba(255, 255, 255, 0.08); }
.house-mode.on { border-color: #f0a04b; background: rgba(240, 160, 75, 0.16); }
.house-mode.on b { color: #ffd27a; }
@media (max-width: 480px) { .house-modes { grid-template-columns: 1fr; } }
/* les modèles de maison (maisons.js) : un dessin de chacun, à acheter ou à choisir */
.house-models { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.house-model {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 8px 8px; text-align: center;
  border: 1px solid var(--line); border-radius: 12px; background: rgba(0, 0, 0, 0.16);
}
.house-model canvas { width: 132px; height: 86px; }
.house-model b { font-size: 13px; font-weight: 600; }
.house-model small { flex: 1; font-size: 11px; color: var(--muted); line-height: 1.3; }
.house-model .btn { margin-top: 4px; padding: 4px 12px; font-size: 13px; }
.house-model.mine { border-color: rgba(111, 227, 181, 0.5); }
.house-model.on { border-color: #f0a04b; background: rgba(240, 160, 75, 0.16); }
.house-chosen { margin-top: 4px; padding: 4px 0; font-size: 13px; font-weight: 600; color: #ffd27a; }
.knock-q small { color: var(--muted); }
.knock-card.invite { border-color: rgba(111, 227, 181, 0.6); }
.knock-card.invite .knock-time i { background: #6fe3b5; }
.house-note { margin: 6px 0 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.house-note.warn { color: var(--accent); }

/* quêtes du jour (public/site/quetes.js) : le bonus de connexion, les quêtes et leur progression */
.qd-panel { width: min(480px, 100%); }
.qd-bonus { margin: 10px 0; padding: 10px 12px; border-radius: var(--radius-s); background: rgba(255, 213, 79, 0.1); border: 1px solid rgba(255, 213, 79, 0.25); font-size: 14px; }
.qd-bonus b { color: var(--accent); }
.qd-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.qd-quest { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-s); background: var(--card-2); border: 1px solid var(--line); }
.qd-quest.done { background: linear-gradient(135deg, rgba(111, 227, 181, 0.14), rgba(255, 213, 79, 0.06)); border-color: rgba(111, 227, 181, 0.35); }
.qd-ico { flex: none; font-size: 26px; }
.qd-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.qd-body b { font-size: 14px; }
.qd-body small { font-size: 12px; color: var(--muted); }
.qd-coins { color: var(--accent); }
.qd-act { flex: none; display: flex; gap: 6px; align-items: center; }
.qd-act .btn { padding: 5px 10px; font-size: 13px; }
.qd-check { font-size: 20px; color: var(--mint); }
.qd-swap { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; }
.qd-swap .btn { flex: none; padding: 5px 10px; font-size: 13px; }
.qd-swap small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.qd-all { margin: 10px 0 0; font-size: 14px; }
.qd-all b { color: var(--accent); }
.qd-all.done { color: var(--mint); }
.qd-note { margin: 10px 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.qd-note b { color: var(--text); }
@media (max-width: 480px) { .qd-quest { flex-wrap: wrap; } .qd-act { width: 100%; justify-content: flex-end; } }

/* panneau d'administration, onglet « Retours » : satisfaction, filtres, retours */
.fb-sat { margin-bottom: 4px; border-radius: 10px; background: var(--card-2); }
.fb-sat > summary, .fb-sat-map {
  display: grid; grid-template-columns: minmax(90px, 170px) minmax(50px, 1fr) auto; align-items: center; gap: 10px;
  padding: 6px 10px; font-size: 13px;
}
.fb-sat > summary { cursor: pointer; list-style: none; }
.fb-sat > summary::-webkit-details-marker { display: none; }
.fb-sat[open] > summary { border-bottom: 1px solid var(--line); }
.fb-sat-map { margin: 0; padding-left: 24px; background: transparent; color: var(--muted); }
.fb-sat-game { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-bar { display: flex; height: 10px; overflow: hidden; border-radius: 5px; background: rgba(255, 255, 255, 0.08); }
.fb-bar i { display: block; height: 100%; }
.fb-sat-num { font-size: 12px; white-space: nowrap; }
.fb-sat-num small { margin-left: 4px; color: var(--muted); }
.fb-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fb-filters .hof-tab { display: inline-flex; align-items: center; gap: 6px; }
.fb-filters .hof-tab.active .count-chip { background: rgba(59, 42, 0, 0.18); color: #3b2a00; }
.fb-sep { width: 1px; height: 20px; margin: 0 4px; background: var(--line); }
.fb-search { margin: 8px 0; }
.fb-search .adm-b { white-space: nowrap; }
#fbAdmList { transition: opacity 0.15s; }
#fbAdmList.fb-stale { opacity: 0.45; pointer-events: none; } /* (d'autres filtres : la nouvelle liste arrive) */
.fb-more { align-self: center; }
.fb-only-mood { color: var(--muted); }
.fb-row { padding: 8px 12px; border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: var(--radius-s); background: var(--card-2); }
.fb-row.st-nouveau { border-left-color: var(--accent); }
.fb-row.st-encours { border-left-color: var(--accent-2); }
.fb-row.st-corrige { border-left-color: var(--mint); }
.fb-row.open { background: rgba(255, 255, 255, 0.08); }
.fb-row-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.fb-row-ico { flex: none; font-size: 22px; }
.fb-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fb-row-who { font-size: 14px; }
.fb-row-who small { color: var(--muted); font-size: 11px; }
.fb-row-where { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.fb-row:not(.open) .fb-row-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fb-row-has { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.fb-row-more { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.fb-row-more .fb-row-has { margin: 0; }
.fb-row-shot { align-self: flex-start; max-width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.fb-row-shot img { display: block; max-width: 100%; max-height: 180px; border: 1px solid var(--line); border-radius: 8px; }
.fb-row-shot.big { align-self: stretch; cursor: zoom-out; }
.fb-row-shot.big img { width: 100%; max-height: none; }
.adm-b.fb-on { border-color: rgba(255, 213, 79, 0.55); background: rgba(255, 213, 79, 0.2); color: var(--accent); }
.fb-tech { display: grid; gap: 3px; padding: 8px 10px; border-radius: 10px; background: rgba(10, 11, 30, 0.3); font-size: 12px; }
.fb-tech > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px; word-break: break-word; }
.fb-tech span { color: var(--muted); }
.fb-tech ul { margin: 0; padding-left: 16px; }
@media (max-width: 560px) {
  .fb-kind small, .fb-mood small { display: none; }
  .fb-sat > summary, .fb-sat-map { grid-template-columns: minmax(0, 1fr) auto; }
  .fb-sat .fb-bar { grid-column: 1 / 3; grid-row: 2; }
  .fb-tech > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

/* ----- Signaler un joueur (public/site/signalements.js) : la fenêtre, et l'onglet du panneau ----- */
.rp-panel { width: min(520px, 100%); }
.rp-reasons .fb-kind { padding: 8px 6px; }
.rp-reasons .fb-kind b { font-size: 13px; }
.rp-text { min-height: 64px; }
.rp-against { color: var(--danger); font-weight: 600; }
.rp-sec h4 { margin: 0 0 4px; font-size: 13px; }
.rp-sec h4 small { color: var(--muted); font-weight: 400; }
.rp-chat { margin: 0; padding: 6px 8px; list-style: none; border-radius: 10px; background: rgba(10, 11, 30, 0.3); font-size: 13px; }
.rp-chat li { padding: 1px 4px; border-radius: 6px; word-break: break-word; }
.rp-chat time { color: var(--muted); font-size: 11px; }
.rp-chat li.them { background: rgba(255, 107, 125, 0.16); }
.rp-chat li.them b { color: var(--danger); }
.rp-chat li.me b { color: var(--mint); }
.rp-chat li.me b::after { content: " (a signalé)"; color: var(--muted); font-size: 11px; font-weight: 400; }
.rp-row.st-traite { border-left-color: var(--mint); }
.fb-st.st-traite { background: rgba(111, 227, 181, 0.18); color: var(--mint); }
.fb-st.st-rejete { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
@media (max-width: 560px) { .rp-reasons { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ----- Partie classée (public/site/classe.js) ----- */
/* la pastille du bandeau : la recherche, puis le jeu n/5 et ma place */
.ranked-pill { gap: 7px; padding: 4px 8px 4px 6px; color: var(--text); border-color: rgba(242, 195, 61, 0.45); background: linear-gradient(90deg, rgba(242, 195, 61, 0.16), rgba(242, 195, 61, 0.06)); }
.ranked-pill[hidden] { display: none; }
.ranked-pill b { color: #f2c33d; font-weight: 700; }
.ranked-pill.searching .rk-emblem { animation: rk-pulse 1.4s ease-in-out infinite; }
.ranked-pill .rk-x {
  display: grid; place-items: center; width: 22px; height: 22px; padding: 0;
  border: none; border-radius: 50%; cursor: pointer; font-size: 11px;
  color: var(--text); background: rgba(255, 255, 255, 0.1);
}
.ranked-pill .rk-x:hover { background: rgba(255, 107, 125, 0.35); }
@keyframes rk-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.rk-emblem { flex: none; display: inline-block; vertical-align: middle; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35)); }
@media (max-width: 640px) { .ranked-pill { order: 4; } }

/* au podium de chaque jeu : le classement de la partie classée, sur le jeu */
.rk-card {
  position: absolute; right: 10px; top: 10px; z-index: 2;
  width: min(290px, calc(100% - 20px));
  padding: 10px 12px 9px; border-radius: 14px;
  background: rgba(27, 29, 51, 0.88); border: 1px solid rgba(242, 195, 61, 0.45);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45); backdrop-filter: blur(6px);
  font-size: 13px; animation: toast-in 0.35s cubic-bezier(.2, 1.3, .4, 1) both;
}
.rk-card[hidden] { display: none; }
.rk-card-head { font-weight: 700; color: #f2c33d; margin-bottom: 6px; }
.rk-card-foot { margin-top: 7px; font-size: 12px; color: var(--muted); }
.rk-card-foot b { color: var(--text); }
.rk-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.rk-rows li { display: flex; align-items: center; gap: 7px; padding: 3px 6px; border-radius: 8px; }
.rk-rows li.me { background: rgba(242, 195, 61, 0.14); }
.rk-rows li.gone { opacity: 0.55; }
.rk-place { width: 28px; flex: none; font-weight: 700; color: var(--muted); }
.rk-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-name small { color: var(--muted); }
.rk-pts { flex: none; min-width: 46px; text-align: right; }
.rk-chips { display: inline-flex; gap: 2px; flex: none; }
.rk-chip {
  display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 5px;
  font-size: 10px; font-weight: 700; color: var(--text); background: rgba(255, 255, 255, 0.1);
}
.rk-chip.gold { background: #f2c33d; color: #4a3200; }
.rk-chip.silver { background: #c9d0e2; color: #363c55; }
.rk-chip.bronze { background: #cd8b52; color: #3d1f08; }
.rk-chip.empty { background: rgba(255, 255, 255, 0.04); color: var(--muted); }
.rk-delta { flex: none; font-weight: 700; font-size: 12px; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.rk-delta.up { background: rgba(111, 227, 181, 0.18); color: var(--mint); }
.rk-delta.down { background: rgba(255, 107, 125, 0.18); color: var(--danger); }

/* les fenêtres : « Partie classée trouvée ! », les résultats */
.rk-panel { width: min(680px, 100%); text-align: left; }
.rk-players { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 12px 0; }
.rk-player {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 6px 10px;
  border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); text-align: center;
}
.rk-gloop { width: 120px; height: 96px; }
.rk-gloop.small { width: 64px; height: 56px; flex: none; }
.rk-pname { font-size: 15px; }
.rk-pname small { color: var(--muted); font-weight: 500; }
.rk-prank { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.rk-games { display: flex; flex-wrap: wrap; gap: 6px; }
.rk-game {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--mode-color);
}
.rk-game small { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--mode-color); color: #1b1d33; font-weight: 700; }
.rk-note { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.rk-mine { display: flex; align-items: center; gap: 14px; margin: 10px 0 12px; padding: 10px 14px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); }
.rk-mine > div { display: flex; flex-direction: column; gap: 2px; }
.rk-mine-rank { font-size: 22px; }
.rk-mine-mmr { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.rk-mine small { color: var(--muted); }
.rk-news { color: #f2c33d; font-weight: 600; }
.rk-final { display: flex; flex-direction: column; gap: 6px; }
.rk-frow { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 6px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); }
.rk-frow.me { border-color: rgba(242, 195, 61, 0.6); background: rgba(242, 195, 61, 0.1); }
.rk-frow.gone { opacity: 0.6; }
.rk-medal { flex: none; width: 38px; height: 26px; display: grid; place-items: center; border-radius: 8px; font-weight: 700; font-size: 13px; background: rgba(255, 255, 255, 0.08); }
.rk-medal.p1 { background: #f2c33d; color: #4a3200; }
.rk-medal.p2 { background: #c9d0e2; color: #363c55; }
.rk-medal.p3 { background: #cd8b52; color: #3d1f08; }
.rk-fname { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rk-fname b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-fname small { color: var(--muted); font-size: 12px; }
.rk-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.rk-final .rk-chip { width: 22px; height: 22px; border-radius: 6px; font-size: 12px; }
.rk-final .rk-chips { gap: 3px; }

/* la case « Classé » de la fenêtre « Jouer » (sans émojis : l'écusson du rang) */
.rk-thumb { display: flex; align-items: center; justify-content: center; gap: 8px; background: radial-gradient(circle at 50% 30%, rgba(242, 195, 61, 0.45), rgba(27, 29, 51, 0.95) 75%); }
.rk-thumb-text { font-size: 11px; font-weight: 700; color: #f8e3a0; max-width: 60px; line-height: 1.2; }
.rk-stage { padding: 14px; display: flex; flex-direction: column; gap: 8px; background: linear-gradient(160deg, rgba(242, 195, 61, 0.22), rgba(27, 29, 51, 0.92) 55%); }
.rk-card-me { display: flex; align-items: center; gap: 14px; }
.rk-me-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.rk-me-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.rk-me-rank { font-size: 26px; line-height: 1.05; }
.rk-me-mmr { font-weight: 600; }
.rk-me-stats { font-size: 12px; color: var(--muted); }
.rk-bar { display: block; height: 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; margin-top: 2px; }
.rk-bar span { display: block; height: 100%; border-radius: 999px; }
.rk-bar-text { font-size: 11px; color: var(--muted); }
.rk-hist-head { margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.rk-hists { display: flex; flex-wrap: wrap; gap: 4px; }
.rk-hist { display: inline-flex; flex-direction: column; align-items: center; min-width: 38px; padding: 2px 6px; border-radius: 8px; font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, 0.07); }
.rk-hist small { font-size: 10px; font-weight: 600; color: var(--muted); }
.rk-hist.up small { color: var(--mint); }
.rk-hist.down small { color: var(--danger); }
.rk-board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 210px; overflow-y: auto; }
.rk-board li { display: flex; align-items: center; gap: 7px; padding: 3px 6px; border-radius: 8px; font-size: 13px; }
.rk-board li.me { background: rgba(242, 195, 61, 0.14); }
.rk-board li b { font-size: 12px; color: #f2c33d; }
.rk-board-empty { color: var(--muted); font-size: 12px; }
.rk-queue-line { font-size: 12px; color: var(--muted); }
.rk-pools { display: flex; flex-wrap: wrap; gap: 4px; }
.rk-pool { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border-left: 3px solid var(--mode-color); }
.rk-ranks { display: flex; flex-wrap: wrap; gap: 8px; }
.rk-ranks span { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.rk-ranks small { font-size: 10px; color: var(--muted); }
@media (max-width: 1400px) { .ranked-pill .rk-long { display: none; } }
/* (au podium, « Cette partie t'a plu ? » est déjà en haut à droite : le classement de la partie classée passe dessous) */
.canvas-wrap:has(#rateCard:not([hidden])) .rk-card { top: 104px; }

/* ----- Les amis et les messages privés (site/friends.js) : bouton 👥, fenêtre, conversation, fiche d'un joueur ----- */
#friendsBtn { position: relative; }
#friendsBtn[data-badge]:not([data-badge=""])::after {
  content: attr(data-badge); position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
}
.fr-panel { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.fr-add, .fr-write { display: flex; gap: 8px; margin-top: 12px; }
.fr-add[hidden] { display: none; }
.fr-add .btn, .fr-write .btn { flex: none; padding: 8px 16px; }
.fr-input {
  flex: 1; min-width: 0; padding: 9px 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(10, 11, 30, 0.35); color: var(--text); font: inherit; font-size: 14px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.fr-input::placeholder { color: var(--muted); }
.fr-input:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(143, 211, 244, 0.2); }
.fr-msg { min-height: 0; margin: 6px 4px 0; font-size: 13px; color: var(--mint); }
.fr-msg:empty { display: none; }
.fr-msg.bad { color: var(--accent); }
.fr-count { margin-left: 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.fr-list li { padding: 0; background: none; }
.fr-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px;
  background: rgba(0, 0, 0, 0.16); color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: background 0.12s;
}
.fr-row:hover { background: rgba(255, 255, 255, 0.08); }
.fr-row.on .house-dot { box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2), 0 0 0 2px rgba(111, 227, 181, 0.7); }
.fr-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fr-row-text b, .fr-row-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-row-text small { color: var(--muted); font-size: 12px; }
.fr-row-text .fr-last { color: var(--text); opacity: 0.75; }
.fr-unread {
  flex: none; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center;
}
.fr-go { flex: none; opacity: 0.45; }
.fr-row:hover .fr-go { opacity: 1; }
.fr-conv-head { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.fr-back { width: 32px; height: 32px; font-size: 16px; color: var(--text); }
.fr-conv-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.fr-conv-who > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.fr-conv-who b { font-size: 17px; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-conv-who small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-remove { flex: none; }
.fr-msgs {
  display: flex; flex-direction: column; gap: 6px; height: min(48vh, 380px); margin-top: 10px; padding: 10px;
  overflow-y: auto; overscroll-behavior: contain; border-radius: var(--radius-s); background: rgba(0, 0, 0, 0.2);
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.fr-bubble {
  display: flex; flex-direction: column; max-width: 80%; padding: 6px 11px 4px; border-radius: 14px;
  font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; animation: msg-in 0.2s ease-out;
}
.fr-bubble.mine { align-self: flex-end; background: rgba(255, 213, 79, 0.2); border-bottom-right-radius: 4px; }
.fr-bubble.theirs { align-self: flex-start; background: rgba(143, 211, 244, 0.18); border-bottom-left-radius: 4px; }
.fr-bubble time { align-self: flex-end; margin-top: 1px; font-size: 10px; color: var(--muted); }
.fr-empty { margin: auto; color: var(--muted); font-size: 13px; text-align: center; }
.fr-note { margin: 8px 2px 0; font-size: 11px; color: var(--muted); line-height: 1.4; }
#messages .dm { background: rgba(255, 143, 184, 0.14); border-left: 3px solid var(--pink); cursor: pointer; }
#messages .dm:hover { background: rgba(255, 143, 184, 0.22); }
.fr-card { width: min(300px, calc(100vw - 16px)); }
.fr-card-note { margin: 6px 0 8px; font-size: 13px; color: var(--muted); }
.fr-card-note:empty { display: none; }
#admFriendBtns .fr-card-note { display: block; width: 100%; margin: 0 0 4px; }

/* jouer entre amis (site/parties.js) : le code de la partie privée dans le bandeau, le champ du code et
   « Partie privée » dans la fenêtre « Jouer », « Rejoindre » et « Inviter » dans la fenêtre 👥 */
.party-pill {
  gap: 5px; padding: 4px 12px; cursor: pointer; color: var(--text); font: inherit; font-weight: 600; font-size: 14px;
  border-color: rgba(111, 227, 181, 0.45); background: linear-gradient(90deg, rgba(111, 227, 181, 0.16), rgba(111, 227, 181, 0.06));
}
.party-pill[hidden], body.in-hub .party-pill { display: none; }
.party-pill b { color: var(--mint); letter-spacing: 0.12em; }
.party-pill:hover { background: rgba(111, 227, 181, 0.24); }

/* le tournoi (site/tournoi.js) : la pastille du bandeau, la fenêtre et son tableau */
.tour-pill {
  gap: 5px; padding: 4px 12px; cursor: pointer; color: var(--text); font: inherit; font-weight: 600; font-size: 14px;
  border-color: rgba(255, 213, 79, 0.45); background: linear-gradient(90deg, rgba(255, 213, 79, 0.16), rgba(255, 213, 79, 0.05));
}
.tour-pill[hidden] { display: none; }
.tour-pill:hover { background: rgba(255, 213, 79, 0.24); }
.tour-pill.calling { color: #3b2a00; background: linear-gradient(180deg, #ffe27a, var(--accent-2)); animation: rk-pulse 1.4s ease-in-out infinite; }
.tour-card { border-color: rgba(255, 213, 79, 0.7); }
.tour-card .knock-time i { background: var(--accent); }
.to-panel { width: min(860px, 100%); }
.to-head { display: flex; align-items: center; gap: 12px; margin: 12px 0 6px; }
.to-ico { flex: none; font-size: 34px; }
.to-what { display: flex; flex-direction: column; min-width: 0; }
.to-what b { font-size: 18px; }
.to-what small { color: var(--muted); font-size: 13px; }
.to-prize { margin: 6px 0 10px; padding: 8px 12px; border-radius: var(--radius-s); font-size: 14px;
  background: rgba(255, 213, 79, 0.1); border: 1px solid rgba(255, 213, 79, 0.25); }
.to-prize b { color: var(--accent); }
.to-prize small { color: var(--muted); }
.to-sub { margin: 14px 0 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.to-none { margin: 12px 0; font-size: 14px; color: var(--muted); line-height: 1.45; }
.to-muted { margin: 8px 0; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.to-note { margin: 8px 0; font-size: 13px; color: var(--mint); }
.to-note.bad { color: var(--danger); }
.to-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.to-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px;
  background: var(--card-2); border: 1px solid var(--line); }
.to-chip.me { border-color: rgba(255, 213, 79, 0.55); }
.to-x { padding: 0 2px; border: none; background: none; color: var(--muted); font: inherit; font-size: 11px; cursor: pointer; }
.to-x:hover { color: var(--danger); }
.to-dot { flex: none; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.15); }
.to-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.to-acts .btn { padding: 7px 14px; font-size: 14px; }
.to-admin { padding-top: 10px; border-top: 1px dashed var(--line); }
.to-in { color: var(--mint); font-weight: 600; }
.to-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 6px 0 4px; padding: 10px 12px;
  border-radius: var(--radius-s); background: var(--card-2); border: 1px solid var(--line); font-size: 14px; }
.to-status .btn { padding: 5px 14px; font-size: 13px; }
.to-status small { flex-basis: 100%; color: var(--muted); font-size: 12.5px; }
.to-status.won { background: linear-gradient(135deg, rgba(255, 213, 79, 0.18), rgba(111, 227, 181, 0.08)); border-color: rgba(255, 213, 79, 0.4); }
.to-status.won b { color: var(--accent); }
.to-left { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600; }
/* le tableau : un tour par colonne, les matchs centrés en hauteur (le tour suivant entre ceux qui le nourrissent) */
.to-bracket { display: flex; gap: 14px; margin-top: 12px; padding-bottom: 6px; overflow-x: auto; }
.to-round { flex: 1 0 168px; display: flex; flex-direction: column; min-width: 168px; }
.to-round h4 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); text-align: center; }
.to-matches { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 8px; }
.to-match { padding: 5px 6px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); }
.to-match ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.to-match.st-call { border-color: rgba(255, 213, 79, 0.45); }
.to-match.st-play { border-color: rgba(111, 227, 181, 0.5); box-shadow: 0 0 0 1px rgba(111, 227, 181, 0.2) inset; }
.to-match.mine { background: rgba(255, 213, 79, 0.1); }
.to-p { display: flex; align-items: center; gap: 6px; padding: 2px 4px; border-radius: 6px; font-size: 13px; min-width: 0; }
.to-p span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.to-p em { flex: none; font-style: normal; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.to-p.won { background: rgba(255, 213, 79, 0.16); }
.to-p.won span { color: var(--accent); font-weight: 600; }
.to-p.lost span { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.25); }
.to-p.empty span { color: var(--muted); }
.to-p.me span { font-weight: 700; }
.to-crown { flex: none; padding: 0 2px; border: none; background: none; font: inherit; font-size: 12px; cursor: pointer; opacity: 0.6; }
.to-crown:hover { opacity: 1; }
.to-crown[data-armed] { color: var(--danger); font-size: 11px; opacity: 1; }
.to-badge { display: block; margin: 3px 4px 0; font-size: 11px; color: var(--muted); }
.to-past { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.to-past li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; background: var(--card-2); }
.to-pico { flex: none; font-size: 20px; }
.to-ptext { display: flex; flex-direction: column; min-width: 0; }
.to-ptext b { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.to-ptext small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.to-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; margin-top: 6px; }
.to-form[hidden] { display: none; }
.to-form > .to-sub, .to-form .wide { grid-column: 1 / -1; }
.to-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.to-form label.wide { grid-column: span 2; }
.to-form .btn { justify-self: start; padding: 8px 16px; }
@media (max-width: 640px) {
  .tour-pill { order: 4; }
  .to-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.gm-panel .tr-head { flex-wrap: wrap; gap: 8px; }
.gm-code { display: flex; align-items: center; gap: 8px; margin: 0 6px 0 auto; font-size: 13px; color: var(--muted); }
.gm-code-input { flex: none; width: 96px; padding: 6px 10px; font-weight: 600; letter-spacing: 0.14em; text-align: center; text-transform: uppercase; }
.gm-code-input::placeholder { font-weight: 400; letter-spacing: 0; text-transform: none; }
.gm-code .btn { padding: 6px 14px; font-size: 13px; }
.gm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gm-private { padding: 10px 18px; font-size: 15px; }
.fr-list li .fr-row { flex: 1; min-width: 0; }
.fr-acts { flex: none; display: flex; flex-direction: column; gap: 4px; }
.fr-conv-acts { flex-direction: row; }
.fr-conv-acts:empty { display: none; }
.fr-act { padding: 4px 10px; font-size: 12px; }
.fr-act:disabled { opacity: 0.5; cursor: default; }
.party-card .knock-q small { margin-left: -2px; }
@media (max-width: 640px) { .gm-code label { display: none; } }

/* ----- Commandes tactiles (touch.js) : téléphone, tablette ----- */
/* les boutons, par-dessus le bas de l'écran : la croix à gauche, ceux du lieu à droite (Espace le plus à droite) */
#touchControls {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; pointer-events: none;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  padding: 0 max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}
#touchControls[hidden], .tc-pad[hidden], #tcTurn[hidden] { display: none; }
.tc-pad, .tc-btn, #tcTurn {
  pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.tc-pad {
  position: relative; flex: none; width: 136px; height: 136px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0 22%, rgba(20, 22, 44, 0.42) 23%);
  border: 2px solid rgba(255, 255, 255, 0.24); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.tc-arrow {
  position: absolute; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px;
  color: rgba(255, 255, 255, 0.85); font-size: 18px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); transition: background 0.08s;
}
.tc-arrow.up { top: 3px; left: 50%; transform: translateX(-50%); }
.tc-arrow.down { bottom: 3px; left: 50%; transform: translateX(-50%); }
.tc-arrow.left { left: 3px; top: 50%; transform: translateY(-50%); }
.tc-arrow.right { right: 3px; top: 50%; transform: translateY(-50%); }
.tc-arrow.on { background: rgba(111, 227, 181, 0.5); color: #fff; }
.tc-pad small {
  position: absolute; left: -10px; right: -10px; top: -18px; text-align: center;
  font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, 0.8); text-shadow: 0 1px 2px #000;
}
.tc-btns {
  margin-left: auto; display: flex; flex-direction: row-reverse; flex-wrap: wrap-reverse; align-items: flex-end;
  gap: 10px; max-width: 250px;
}
.tc-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; width: 66px; height: 66px;
  border-radius: 50%; background: rgba(20, 22, 44, 0.45); border: 2px solid rgba(255, 255, 255, 0.32);
  color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.06s, filter 0.06s;
}
.tc-btn b { font-size: 14px; font-weight: 700; line-height: 1.05; text-align: center; }
.tc-btn small { margin-top: 1px; font-size: 10px; font-weight: 600; opacity: 0.9; }
.tc-a { width: 88px; height: 88px; background: rgba(111, 227, 181, 0.32); border-color: rgba(111, 227, 181, 0.75); }
.tc-a b { font-size: 15px; }
.tc-e { background: rgba(255, 213, 79, 0.28); border-color: rgba(255, 213, 79, 0.75); }
.tc-e b { font-size: 22px; color: #ffe27a; }
.tc-btn.on { transform: scale(0.9); filter: brightness(1.45); }
/* en portrait : tourne le téléphone */
#tcTurn {
  position: fixed; left: 50%; bottom: 170px; z-index: 30; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 24px);
  padding: 8px 12px; border-radius: 999px; background: rgba(30, 33, 60, 0.92); border: 1px solid var(--line);
  color: var(--text); font-size: 13px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
#tcTurnX { margin-left: 8px; padding: 0 4px; color: var(--muted); cursor: pointer; }
/* la page au doigt : le jeu le plus grand possible, sans l'aide du clavier ni la colonne de droite */
#chatBtn, #fullBtn { position: relative; }
#chatBtn[hidden], #fullBtn[hidden] { display: none; }
#chatBtn[data-badge]:not([data-badge=""])::after {
  content: attr(data-badge); position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
}
#chatClose { display: none; margin-left: auto; width: 30px; height: 30px; font-size: 14px; color: var(--text); }
body.touch { overscroll-behavior: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
body.touch #app { padding: 6px max(8px, env(safe-area-inset-right)) 6px max(8px, env(safe-area-inset-left)); gap: 6px; }
body.touch #hud { min-height: 40px; gap: 6px; }
body.touch .brand { font-size: 0; gap: 0; margin-right: 0; }
body.touch .volume-pill, body.touch #musicBtn, body.touch #trophyBtn, body.touch #houseBtn, body.touch #feedbackBtn,
body.touch #adminBtn, body.touch #wardrobeBtn, body.touch #help { display: none !important; } /* (dans le menu ☰) */
body.touch #stage { --fit: calc((100vh - 60px) * 2); padding: 0; }
@supports (height: 100dvh) {
  body.touch #stage { --fit: calc((100dvh - 60px) * 2); }
}
body.touch #game { touch-action: none; cursor: default; }
/* les outils du guide : par-dessus le haut du jeu (sous le jeu, ils seraient hors de l'écran) */
body.touch #stage { position: relative; }
body.touch #guideBar {
  position: absolute; top: 6px; left: 50%; z-index: 6; transform: translateX(-50%); margin: 0; padding: 4px 6px;
  background: rgba(30, 33, 60, 0.82); backdrop-filter: blur(4px);
}
body.touch .gb-label, body.touch .gb-tool .gb-name, body.touch .gb-tool .gb-key { display: none; }
body.touch #gbTools { gap: 4px; flex-wrap: nowrap; }
body.touch .gb-tool { width: 46px; padding: 3px 2px; touch-action: manipulation; }
body.touch .gb-tool canvas { width: 32px; height: 32px; }
body.touch .gb-tool .gb-count { top: 1px; right: 1px; min-width: 15px; height: 15px; font-size: 9px; padding: 0 3px; }
body.touch #side { display: none; }
body.touch.chat-open #side {
  display: flex; flex-direction: column; position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(340px, 90vw);
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 10px 10px; gap: 10px;
  background: rgba(27, 29, 51, 0.97); box-shadow: -8px 0 30px rgba(0, 0, 0, 0.5); animation: tc-drawer 0.2s ease-out;
}
body.touch.chat-open #side > * { flex: none; }
body.touch.chat-open #scores { max-height: 34vh; overflow-y: auto; }
body.touch.chat-open #chat { flex: 1 1 0px; height: auto; min-height: 0; }
body.touch.chat-open #chatClose { display: grid; place-items: center; }
@keyframes tc-drawer { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
/* en portrait, la place sous le jeu : la discussion y reste (au-dessus des boutons) */
@media (orientation: portrait) {
  body.touch #side { display: flex; }
  body.touch #app { padding-bottom: calc(230px + env(safe-area-inset-bottom)); }
  body.touch #chatBtn { display: none; }
}
/* un petit écran en paysage : des boutons plus petits */
@media (max-height: 430px) {
  .tc-pad { width: 118px; height: 118px; }
  .tc-arrow { width: 40px; height: 40px; }
  .tc-btn { width: 58px; height: 58px; }
  .tc-a { width: 76px; height: 76px; }
  #touchControls { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
}

/* ========== Parrainage (site/parrainage.js) ========== */
.ref-panel { width: min(660px, 100%); text-align: left; }
.ref-hero {
  display: flex; align-items: center; gap: 14px; margin: 12px 0;
  padding: 12px 16px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 111, 168, 0.28), rgba(166, 107, 255, 0.22) 55%, rgba(63, 217, 200, 0.18));
  border: 1px solid rgba(255, 143, 184, 0.35);
}
.ref-hero-cv { flex: none; width: 200px; height: 112px; }
.ref-hero-text h3 { margin: 0 0 6px; font-size: 20px; color: #fff; }
.ref-hero-text p { margin: 0; font-size: 13.5px; line-height: 1.45; color: #e9e6ff; }
.ref-hero-text b { color: var(--accent); }
.ref-ticket {
  position: relative; padding: 12px 14px; border-radius: var(--radius-s);
  background: rgba(255, 213, 79, 0.08); border: 2px dashed rgba(255, 213, 79, 0.45);
}
/* (les encoches du ticket) */
.ref-ticket::before, .ref-ticket::after {
  content: ""; position: absolute; top: 50%; width: 16px; height: 16px; margin-top: -8px;
  border-radius: 50%; background: rgba(44, 48, 82, 0.96);
}
.ref-ticket::before { left: -9px; }
.ref-ticket::after { right: -9px; }
.ref-ticket-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ref-ticket-top span { font-size: 13px; color: var(--muted); }
.ref-code {
  padding: 2px 10px; border: 0; border-radius: 10px; cursor: pointer;
  font: 700 26px/1.2 var(--font); letter-spacing: 2px; color: var(--accent); background: rgba(0, 0, 0, 0.2);
  transition: transform 0.15s, background 0.15s;
}
.ref-code:hover { transform: scale(1.04); background: rgba(0, 0, 0, 0.32); }
.ref-link {
  width: 100%; margin: 10px 0 8px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25); color: var(--muted); font: 13px/1.3 ui-monospace, Consolas, monospace;
}
.ref-share { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-share .btn { padding: 7px 14px; font-size: 14px; }
.ref-msg { min-height: 1.2em; margin: 6px 0 0; font-size: 13px; color: var(--mint); }
.ref-sec { margin-top: 16px; }
.ref-sec h4 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 8px; font-size: 16px; }
.ref-sec h4 small { font-size: 12px; font-weight: 500; color: var(--muted); }
.ref-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ref-step {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px;
  border-radius: var(--radius-s); background: var(--card-2); border: 1px solid var(--line); text-align: center;
}
.ref-step.last { border-color: rgba(255, 213, 79, 0.4); background: linear-gradient(160deg, rgba(255, 213, 79, 0.12), var(--card-2)); }
.ref-step-ico { font-size: 22px; }
.ref-step b { font-size: 13px; line-height: 1.2; }
.ref-step small { font-size: 11px; line-height: 1.25; color: var(--muted); flex: 1; }
.ref-gain { display: flex; gap: 4px; margin-top: 4px; }
.ref-gain i, .ref-legend i {
  font-style: normal; font-weight: 600; font-size: 12px; padding: 1px 6px; border-radius: 8px;
  color: #3a2a00; background: var(--accent);
}
.ref-gain i.pal, .ref-legend i.pal { color: #053a2c; background: var(--mint); }
.ref-total { margin: 8px 0 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.ref-total b { color: var(--accent); }
.ref-legend { display: inline-flex; gap: 4px; }
.ref-rewards { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 8px; }
.ref-rw {
  --tier: #e0a77a;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px 10px; text-align: center;
  border-radius: var(--radius-s); background: var(--card-2); border: 1px solid var(--line);
}
.ref-rw.tier-argent { --tier: #d6dbe8; }
.ref-rw.tier-or { --tier: #ffd54f; }
.ref-rw.tier-legende { --tier: #ff8fb8; }
.ref-rw.have {
  border-color: var(--tier);
  background: linear-gradient(160deg, color-mix(in srgb, var(--tier) 22%, transparent), var(--card-2));
  box-shadow: 0 0 14px color-mix(in srgb, var(--tier) 30%, transparent);
}
.ref-rw-pic {
  position: relative; width: 84px; height: 84px; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--tier) 26%, transparent), transparent 70%);
}
.ref-rw-pic canvas { width: 84px; height: 84px; }
.ref-rw-ico { font-size: 36px; }
.ref-rw-ok, .ref-rw-lock { position: absolute; right: -2px; bottom: 2px; font-size: 14px; }
.ref-rw-ok { color: var(--mint); font-weight: 700; }
.ref-rw b { font-size: 13px; color: var(--tier); }
.ref-rw small { font-size: 11px; color: var(--muted); }
.ref-rw-what { font-size: 11px; line-height: 1.3; }
.ref-rw .tr-bar { width: 80%; }
.ref-rw-n { font-size: 11px; color: var(--muted); }
.ref-rw-n.done { color: var(--mint); font-weight: 600; }
.ref-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ref-fil { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 4px; border-radius: var(--radius-s); background: var(--card-2); border: 1px solid var(--line); }
.ref-fil.all { border-color: rgba(255, 213, 79, 0.4); }
.ref-mini { flex: none; width: 58px; height: 48px; }
.ref-fil-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.ref-fil-body b { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.ref-fil-body small { font-size: 12px; color: var(--muted); }
.ref-pips { display: flex; gap: 4px; }
.ref-pip { font-size: 14px; width: 24px; height: 22px; display: grid; place-items: center; border-radius: 7px; background: rgba(0, 0, 0, 0.25); filter: grayscale(1); opacity: 0.45; }
.ref-pip.on { filter: none; opacity: 1; background: rgba(111, 227, 181, 0.2); box-shadow: inset 0 0 0 1px rgba(111, 227, 181, 0.5); }
.ref-fil-coins { flex: none; display: flex; align-items: center; gap: 4px; font-weight: 700; color: var(--accent); }
.ref-fil-coins.none { color: var(--muted); }
.ref-empty { margin: 0; padding: 12px; border-radius: var(--radius-s); border: 1px dashed var(--line); font-size: 13px; color: var(--muted); text-align: center; }
.ref-note { margin: 8px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.ref-note b { color: var(--text); }
.ref-parrain-who { display: flex; align-items: center; gap: 10px; }
.ref-parrain-who p { margin: 0; font-size: 13.5px; line-height: 1.4; }
.ref-parrain-who b { color: var(--accent); }
.ref-mysteps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ref-mysteps li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--card-2); font-size: 13px; }
.ref-mysteps li span { width: 22px; text-align: center; }
.ref-mysteps li small { margin-left: auto; color: var(--muted); }
.ref-mysteps li b { color: var(--mint); }
.ref-mysteps li.done { opacity: 0.6; }
.ref-mysteps li.done span { color: var(--mint); }
.ref-enter { display: flex; gap: 8px; margin-top: 8px; }
.ref-enter .fr-input { flex: 1; text-transform: uppercase; }
.ref-enter-box .ref-msg { color: var(--danger); }
/* la case de la page d'accueil, et l'invitation sur l'écran de création de compte */
.home-ref {
  display: flex; align-items: center; gap: 12px; margin-top: 12px; text-align: left;
  border-color: rgba(255, 143, 184, 0.35);
  background: linear-gradient(135deg, rgba(255, 111, 168, 0.16), rgba(166, 107, 255, 0.12));
}
.home-ref-ico { flex: none; font-size: 30px; }
.home-ref-text { flex: 1; min-width: 0; }
.home-ref-text h3 { margin: 0 0 3px; font-size: 15px; }
.home-ref-text p { margin: 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.home-ref-text b { color: var(--accent); }
.home-ref .btn { flex: none; padding: 7px 14px; font-size: 14px; }
.auth-invite {
  display: flex; align-items: center; gap: 10px; margin: 12px 0 0; padding: 8px 12px; text-align: left;
  border-radius: var(--radius-s); border: 1px solid rgba(255, 143, 184, 0.4);
  background: linear-gradient(135deg, rgba(255, 111, 168, 0.2), rgba(166, 107, 255, 0.14));
  animation: sm-in 0.35s cubic-bezier(.2, 1.3, .4, 1) both;
}
.auth-invite p { margin: 0; font-size: 13.5px; line-height: 1.4; }
.auth-invite b { color: var(--accent); }
.auth-invite .auth-invite-bad { color: var(--muted); }
.auth-field small { font-weight: 400; color: var(--muted); }
.fr-ref { display: block; margin: 12px auto 0; font-size: 13px; }
@media (max-width: 560px) {
  .ref-hero { flex-direction: column; text-align: center; }
  .ref-hero-cv { width: 100%; max-width: 260px; }
  .ref-steps { grid-template-columns: repeat(2, 1fr); }
  .ref-step:first-child { grid-column: span 2; }
  .home-ref { flex-wrap: wrap; }
  .home-ref .btn { width: 100%; }
}

/* ----- Acheter des pièces en euros (site/paiement.js) ----- */
.pay-plus {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; margin-left: 4px; padding: 0;
  border: none; border-radius: 50%; cursor: pointer;
  background: rgba(255, 213, 79, 0.22); color: var(--accent); font: 700 14px/1 var(--font);
}
.pay-plus:hover { background: rgba(255, 213, 79, 0.4); }
.pay-plus[hidden] { display: none; }
.pay-panel { width: min(640px, 100%); text-align: left; }
.pay-test {
  margin: 10px 0 0; padding: 8px 12px; border-radius: var(--radius-s);
  background: rgba(143, 211, 244, 0.12); border: 1px dashed rgba(143, 211, 244, 0.45); color: var(--sky); font-size: 13px;
}
.pay-have { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 12px 0; font-size: 14px; color: var(--muted); }
.pay-have b { color: var(--text); margin-right: 6px; }
.pay-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.pay-pack {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; border-radius: 14px; cursor: pointer;
  background: var(--card-2); border: 1px solid var(--line); color: var(--text); font-family: var(--font);
  transition: transform 0.15s, border-color 0.15s;
}
.pay-pack:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(255, 213, 79, 0.5); }
.pay-pack:disabled { opacity: 0.45; cursor: not-allowed; }
.pay-pack b { display: inline-flex; align-items: center; gap: 5px; font-size: 18px; color: #ffe08a; }
.pay-pack small { font-size: 11.5px; color: var(--muted); text-align: center; }
.pay-ico { font-size: 30px; }
.pay-price { margin-top: 4px; padding: 3px 12px; border-radius: 999px; background: var(--accent); color: #3b2a00; font-weight: 700; }
.pay-renonce { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; font-size: 13px; cursor: pointer; }
.pay-renonce input { margin-top: 2px; accent-color: var(--accent); }
.pay-error { margin: 10px 0 0; font-size: 13px; color: var(--danger); }
.pay-order { padding: 14px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); }
.pay-order p { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 6px 0; }
.pay-order.done { border-color: rgba(111, 227, 181, 0.5); background: rgba(111, 227, 181, 0.08); }
.pay-caisse { border-style: dashed; border-color: rgba(143, 211, 244, 0.5); }
.pay-caisse h4 { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 16px; }
.pay-caisse h4 small { font-size: 12px; font-weight: 500; color: var(--muted); }
.pay-big { font-size: 17px; font-weight: 600; }
.pay-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pay-row a.btn { text-decoration: none; }
.pay-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.pay-line {
  display: grid; grid-template-columns: 84px 90px 70px 1fr auto; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 10px; background: var(--card-2); font-size: 13px;
}
.pay-line b { display: inline-flex; align-items: center; gap: 4px; }
.pay-line small { color: var(--muted); }
.pay-line.payee small { color: var(--mint); }
.pay-line.remboursee, .pay-line.abandonnee { opacity: 0.7; }
@media (max-width: 520px) {
  .pay-packs { grid-template-columns: repeat(2, 1fr); }
  .pay-line { grid-template-columns: 1fr 1fr; }
}
