/* Vinchykulture — plateau de jeu télé rétro : studio violet, projecteurs, ampoules */
/* Polices embarquées (licence OFL, voir public/fonts) : le jeu marche aussi sans internet */
@font-face { font-family: 'Bungee'; src: url('fonts/bungee-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Rubik'; src: url('fonts/rubik-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Rubik'; src: url('fonts/rubik-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Rubik'; src: url('fonts/rubik-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --studio: #1b0b40;
  --studio-deep: #12062e;
  --panel: #251154;
  --panel-line: #3e2490;
  --cell: #3a1ea3;
  --cell-hi: #5232d6;
  --bulb: #ffd23f;
  --bulb-dim: #8a6d12;
  --pink: #ff3d7f;
  --mint: #2ee6a6;
  --violet: #7c5cff;
  --team0: #ff5ca8;
  --team1: #3ddcff;
  --ink: #f7f2ff;
  --ink-dim: #b7a9de;
  --display: 'Bungee', 'Arial Black', Impact, system-ui, sans-serif;
  --body: 'Rubik', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease-out: cubic-bezier(.2, .9, .25, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--studio-deep); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background:
    radial-gradient(ellipse 90% 45% at 50% 100%, rgba(124, 92, 255, 0.35), transparent 70%),
    radial-gradient(ellipse 70% 60% at 50% 0%, #2c1270, transparent 75%),
    var(--studio-deep);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Décor : deux projecteurs qui balaient la scène + sol à LED ---------- */
.stage { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.stage::after {
  content: '';
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -2px;
  height: 34vh;
  background-image: radial-gradient(circle, rgba(255, 210, 63, 0.22) 1.4px, transparent 2px);
  background-size: 22px 22px;
  transform: perspective(500px) rotateX(58deg);
  transform-origin: bottom;
  mask-image: linear-gradient(to top, #000 10%, transparent 95%);
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 95%);
}
.beam {
  position: absolute;
  top: -20vh;
  width: 46vw;
  height: 140vh;
  background: linear-gradient(to bottom, rgba(255, 236, 170, 0.16), rgba(255, 236, 170, 0) 75%);
  clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%);
  filter: blur(6px);
  transform-origin: 50% 0;
  mix-blend-mode: screen;
}
.beam.left { left: -6vw; animation: sweep-left 14s ease-in-out infinite alternate; }
.beam.right { right: -6vw; animation: sweep-right 17s ease-in-out infinite alternate; background: linear-gradient(to bottom, rgba(255, 61, 127, 0.14), rgba(255, 61, 127, 0) 75%); }
@keyframes sweep-left { from { transform: rotate(-24deg); } to { transform: rotate(10deg); } }
@keyframes sweep-right { from { transform: rotate(22deg); } to { transform: rotate(-12deg); } }

/* ---------- Barre du haut ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(18, 6, 46, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--panel-line);
}
.logo {
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.logo span { color: var(--bulb); text-shadow: 0 0 14px rgba(255, 210, 63, 0.55); }
.room-info { display: flex; align-items: center; gap: 6px; }
.to-tablee { color: var(--ink); opacity: .75; text-decoration: none; font-weight: 500; font-size: .9rem; margin-right: auto; padding-right: 12px; }
.to-tablee:hover { opacity: 1; }
.code-pill {
  font-family: var(--display);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--bulb);
  border: 1px solid var(--bulb-dim);
}
.offline { position: relative; z-index: 10; background: var(--pink); color: #fff; text-align: center; padding: 8px 16px; font-weight: 700; }

main { position: relative; z-index: 1; max-width: 1140px; margin: 0 auto; padding: 20px 16px 24px; }

/* ---------- Structure ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; align-items: start; }
@media (max-width: 820px) { .layout { grid-template-columns: minmax(0, 1fr); } }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 18px;
}
h1, h2 { margin: 0; font-weight: 700; }
h2 { font-size: 1.05rem; margin-bottom: 12px; }
.dim { color: var(--ink-dim); }
.center { text-align: center; }
.error { color: var(--pink); font-weight: 700; margin: 4px 0 0; }
.lede { color: var(--ink-dim); font-size: 1.05rem; max-width: 46ch; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.between h2 { margin: 0; }
.row.end { justify-content: flex-end; margin-top: 20px; }
.launch { margin-top: 20px; }
label { font-weight: 700; font-size: 0.95rem; }

/* ---------- Accueil ---------- */
.home { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 6vh; }
.home .lede { margin: 6px auto 28px; }
.home .form { width: 100%; max-width: 420px; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.marquee-title {
  font-family: var(--display);
  font-weight: 400;
  /* « Vinchykulture » fait ~9,2 fois la taille de la police : on la cale sur la largeur de l'écran */
  font-size: min(7rem, calc((100vw - 48px) / 9.4));
  line-height: 0.95;
  letter-spacing: 0.01em;
  margin-bottom: 12px;
}
.marquee-title span:first-child { color: var(--ink); }
.marquee-title span:last-child {
  color: var(--bulb);
  text-shadow: 0 0 6px rgba(255, 210, 63, 0.9), 0 0 28px rgba(255, 210, 63, 0.55), 0 0 70px rgba(255, 61, 127, 0.45);
  animation: neon 3.2s infinite;
}
.marquee-title.small { font-size: min(4.5rem, calc((100vw - 48px) / 9.4)); }
@keyframes neon {
  0%, 18%, 22%, 62%, 100% { opacity: 1; }
  20%, 64% { opacity: 0.55; }
}

.entry { width: 100%; max-width: 640px; text-align: left; }
.entry-name { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.entry-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.choice {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: 16px;
  background: var(--studio-deep);
  border: 1px solid var(--panel-line);
}
.choice h2 { margin: 0; }
.choice .dim { margin: 0; flex: 1; }
.choice .btn { width: 100%; }
.entry .code-input { font-family: var(--display); letter-spacing: 0.12em; text-transform: uppercase; }
.entry .code-input::placeholder { font-family: var(--body); letter-spacing: 0; text-transform: none; }
.entry .error:empty { display: none; }
.entry .error { margin-top: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 560px) { .entry-choices { grid-template-columns: 1fr; } }

/* ---------- Formulaires & boutons ---------- */
input:not([type]), input[type='text'] {
  width: 100%;
  font: inherit;
  font-size: 17px; /* évite le zoom auto sur iPhone */
  padding: 13px 16px;
  border-radius: 14px;
  border: 2px solid var(--panel-line);
  background: var(--studio-deep);
  color: var(--ink);
  transition: border-color 0.15s;
}
input:not([type]):focus, input[type='text']:focus { border-color: var(--bulb); outline: none; }
input::placeholder { color: #7d70a8; }
.btn:focus-visible, .cell:focus-visible, .theme:focus-within { outline: 3px solid var(--bulb); outline-offset: 2px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 700;
  padding: 11px 20px;
  border-radius: 999px;
  border: 2px solid var(--panel-line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.1s var(--ease-out), background 0.15s, box-shadow 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.06); }
.btn:active { transform: scale(0.96); }
.btn.primary { background: var(--bulb); border-color: var(--bulb); color: var(--studio-deep); box-shadow: 0 4px 0 var(--bulb-dim); }
.btn.primary:hover { box-shadow: 0 4px 0 var(--bulb-dim), 0 0 24px rgba(255, 210, 63, 0.4); }
.btn.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--bulb-dim); }
.btn.good { background: var(--mint); border-color: var(--mint); color: #062b1f; box-shadow: 0 4px 0 #168a62; }
.btn.bad { background: var(--pink); border-color: var(--pink); color: #fff; box-shadow: 0 4px 0 #a51d4c; }
.btn.good:active, .btn.bad:active { transform: translateY(3px); box-shadow: none; }
.btn.ghost { border-color: transparent; color: var(--ink-dim); }
.btn.ghost:hover { color: var(--ink); }
.btn.small { padding: 6px 12px; font-size: 0.88rem; }
.btn.icon { padding: 7px; }
.btn.big { padding: 15px 26px; font-size: 1.08rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

/* ---------- Lobby ---------- */
.share { display: flex; gap: 8px; }
.share input { font-size: 0.95rem; min-width: 0; color: var(--bulb); }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 14px; }
.theme {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid var(--panel-line);
  background: var(--studio-deep);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s var(--ease-out);
}
.theme:active { transform: scale(0.97); }
.theme input { position: absolute; opacity: 0; pointer-events: none; }
.theme.on { border-color: var(--bulb); background: rgba(255, 210, 63, 0.08); }
.theme.on .tname::after { content: ' ✓'; color: var(--bulb); }
.tname { font-weight: 700; font-size: 1.05rem; }
.tmeta { font-size: 0.85rem; color: var(--ink-dim); }
.empty-themes { margin: 14px 0 0; padding: 16px; border-radius: 14px; border: 2px dashed var(--panel-line); color: var(--ink-dim); }
code { font-family: ui-monospace, Menlo, monospace; font-size: 0.9em; padding: 1px 6px; border-radius: 6px; background: var(--studio-deep); color: var(--bulb); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  background: rgba(124, 92, 255, 0.22);
  color: var(--ink);
}
.waiting-room .lede { margin: 0 0 14px; }

/* ---------- Bandeau de tour ---------- */
.banner {
  padding: 14px 18px;
  margin-bottom: 18px;
  text-align: center;
  font-size: 1.1rem;
  color: var(--ink-dim);
}
.banner strong { color: var(--ink); }
.banner.you {
  font-family: var(--display);
  font-size: clamp(1.1rem, 3.4vw, 1.6rem);
  color: var(--bulb);
  text-shadow: 0 0 18px rgba(255, 210, 63, 0.5);
  animation: pop 0.5s var(--ease-out);
}
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- La grille : un tableau encadré d'ampoules qui défilent ---------- */
.board {
  --bulb-gap: 22px;
  position: relative;
  padding: 16px;
  border-radius: 22px;
  margin-bottom: 14px;
  background:
    radial-gradient(circle, var(--bulb) 0 3px, rgba(255, 210, 63, 0.35) 4px, transparent 7px) 0 0 / var(--bulb-gap) var(--bulb-gap),
    #160843;
  box-shadow: 0 0 0 2px #3b1f8f, 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  animation: chase 1.2s steps(2) infinite;
}
.board.mine { box-shadow: 0 0 0 2px var(--bulb), 0 0 40px rgba(255, 210, 63, 0.25), 0 30px 60px -20px rgba(0, 0, 0, 0.6); animation-duration: 0.5s; }
@keyframes chase { to { background-position: calc(var(--bulb-gap) / 2) 0, 0 0; } }
.grid-wrap { overflow-x: auto; border-radius: 12px; background: #160843; }
.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(108px, 1fr));
  gap: 8px;
  padding: 10px;
  min-width: calc(var(--cols) * 108px + (var(--cols) - 1) * 8px + 20px);
}
.ghead {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 6px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.15;
  color: var(--ink);
}
.cell {
  position: relative;
  height: 68px;
  border-radius: 10px;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--bulb);
  background: linear-gradient(to bottom, var(--cell-hi), var(--cell));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), inset 0 -3px 0 rgba(0, 0, 0, 0.25);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4), 0 0 14px rgba(255, 210, 63, 0.35);
}
button.cell.open { cursor: pointer; transition: transform 0.14s var(--ease-out), filter 0.14s; }
button.cell.open:hover { transform: translateY(-3px) scale(1.04); filter: brightness(1.18); z-index: 1; }
button.cell.open:active, button.cell.picked { transform: scale(0.94); filter: brightness(1.4); }
div.cell.open { filter: saturate(0.85); }
.cell.playing { background: var(--bulb); color: var(--studio); text-shadow: none; animation: blink 0.5s steps(2) infinite; }
@keyframes blink { 50% { background: #fff3c4; } }
.cell.right, .cell.wrong { background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); font-size: 1.15rem; text-shadow: none; }
.cell.right { color: var(--mint); }
.cell.wrong { color: var(--pink); }
.cell small {
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-dim);
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cell.empty { background: transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }

/* La grille s'allume case par case au lancement */
.board.intro .cell { animation: cell-in 0.5s var(--ease-out) backwards; animation-delay: calc(var(--i) * 45ms); }
.board.intro .ghead { animation: cell-in 0.5s var(--ease-out) backwards; }
@keyframes cell-in {
  from { transform: rotateX(90deg) scale(0.8); opacity: 0; filter: brightness(2.5); }
}

.host-tools { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }

/* ---------- Question ---------- */
.question {
  position: relative;
  padding: 24px;
  border-radius: 22px;
  margin-bottom: 18px;
  background: linear-gradient(to bottom, #3c1fa6, #2a1272);
  border: 2px solid #5a3ae0;
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.7), 0 0 50px rgba(124, 92, 255, 0.25);
  transform-origin: center;
}
.question.win { border-color: var(--mint); box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.7), 0 0 60px rgba(46, 230, 166, 0.3); }
.question.lose { border-color: var(--pink); animation: shake 0.5s; }
@keyframes shake {
  20% { transform: translateX(-10px) rotate(-1deg); }
  40% { transform: translateX(9px) rotate(1deg); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}
.qmeta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.points { font-family: var(--display); font-size: 1.3rem; color: var(--bulb); text-shadow: 0 0 12px rgba(255, 210, 63, 0.5); }
.qwho { color: var(--ink-dim); margin-left: auto; }
.qtext { font-size: clamp(1.35rem, 3.6vw, 1.9rem); font-weight: 700; line-height: 1.25; margin: 0 0 20px; max-width: 34ch; text-wrap: balance; }
.qimg { display: block; max-width: 100%; max-height: 46vh; border-radius: 14px; margin: 0 0 20px; }

.timer-row { display: flex; align-items: center; gap: 14px; }
.timer, .next-timer { flex: 1; height: 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); overflow: hidden; }
.next-timer { height: 6px; }
.timer .bar, .next-timer .bar { height: 100%; width: 100%; border-radius: inherit; transform-origin: left; }
.timer .bar { background: linear-gradient(to right, var(--mint), var(--bulb)); transition: background 0.3s; }
.timer .bar.low { background: var(--pink); }
.next-timer .bar { background: var(--ink-dim); }
.timer-text { font-family: var(--display); font-size: 1.6rem; min-width: 2ch; text-align: right; color: var(--bulb); font-variant-numeric: tabular-nums; }
.answer-row { display: flex; gap: 10px; margin-top: 18px; }
.answer-row input { font-size: 1.15rem; }
.waiting { text-align: center; color: var(--ink-dim); margin: 22px 0 4px; font-weight: 500; font-size: 1.05rem; }
.dots { display: inline-flex; gap: 4px; margin-right: 10px; vertical-align: middle; }
.dots::before, .dots::after, .dots { --d: 6px; }
.dots::before, .dots::after { content: ''; width: var(--d); height: var(--d); border-radius: 50%; background: var(--bulb); animation: bounce 1s infinite; }
.dots::after { animation-delay: 0.2s; }
@keyframes bounce { 50% { transform: translateY(-6px); opacity: 0.5; } }

.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ans { padding: 14px 16px; border-radius: 14px; background: rgba(0, 0, 0, 0.28); animation: slide-in 0.4s var(--ease-out) backwards; }
.ans.expected { background: rgba(46, 230, 166, 0.12); box-shadow: inset 0 0 0 2px rgba(46, 230, 166, 0.55); animation-delay: 0.12s; }
@keyframes slide-in { from { transform: translateY(12px); opacity: 0; } }
.ans .label { display: block; font-size: 0.85rem; color: var(--ink-dim); margin-bottom: 4px; }
.ans strong { font-size: 1.25rem; word-break: break-word; }
.ans em { font-weight: 400; color: var(--ink-dim); }
.judge-note { color: var(--ink-dim); margin: 14px 0 0; text-align: center; }
.verdict { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.result {
  text-align: center;
  padding: 10px 14px 16px;
  font-size: 1.15rem;
  font-weight: 700;
  animation: pop 0.45s var(--ease-out);
}
.result.good { color: var(--mint); }
.result.bad { color: var(--pink); font-family: var(--display); font-weight: 400; font-size: 1.3rem; }
.big-pts { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(2.6rem, 9vw, 4rem); line-height: 1; text-shadow: 0 0 30px rgba(46, 230, 166, 0.6); }
.note { color: var(--ink-dim); margin: 16px 0 0; }
.next-row { display: flex; align-items: center; gap: 10px; margin-top: 22px; }
.next-row .dim { flex: 1; }

/* ---------- Scores ---------- */
.scores h2 { margin-bottom: 10px; }
.players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.player {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  transition: background 0.25s;
}
.player.active { background: rgba(255, 210, 63, 0.14); box-shadow: inset 3px 0 0 var(--bulb); }
.player.off { opacity: 0.4; }
.player.flash { animation: flash 1.2s var(--ease-out); }
@keyframes flash { 0%, 40% { background: rgba(46, 230, 166, 0.35); } }
.pname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.pname em { font-style: normal; font-size: 0.78em; color: var(--ink-dim); margin-left: 6px; }
.crown { color: var(--bulb); margin-right: 6px; }
.pscore { font-family: var(--display); font-size: 1.1rem; font-variant-numeric: tabular-nums; color: var(--bulb); }

/* ---------- Fin de partie : podium ---------- */
.ended { text-align: center; overflow: hidden; }
.winner-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.8rem, 6vw, 3rem);
  line-height: 1.05;
  color: var(--bulb);
  text-shadow: 0 0 24px rgba(255, 210, 63, 0.5);
  margin: 6px 0 26px;
  animation: pop 0.6s var(--ease-out);
}
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; max-width: 520px; margin: 0 auto; }
.step { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.step .pname { max-width: 100%; font-weight: 700; }
.step .pts { font-family: var(--display); color: var(--ink-dim); }
.step .block {
  width: 100%;
  border-radius: 12px 12px 0 0;
  font-family: var(--display);
  font-size: 2rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10px;
  color: var(--studio);
  transform-origin: bottom;
  animation: rise 0.8s var(--ease-out) backwards;
}
.place-1 .block { height: 150px; background: var(--bulb); box-shadow: 0 0 40px rgba(255, 210, 63, 0.45); animation-delay: 0.5s; }
.place-2 .block { height: 105px; background: #d9d3f0; animation-delay: 0.25s; }
.place-3 .block { height: 75px; background: #e69a5b; }
.place-1 .pts { color: var(--bulb); }
@keyframes rise { from { transform: scaleY(0); } }
.ranking { list-style: none; margin: 22px auto 0; padding: 0; max-width: 520px; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.ranking li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); }
.ranking .rank { width: 2ch; text-align: center; color: var(--ink-dim); }
.ranking .pname { flex: 1; }
.ranking strong { font-family: var(--display); font-weight: 400; color: var(--bulb); }

/* ---------- Petits utilitaires ---------- */
.small { font-size: 0.88rem; }
.tight-top { margin-top: 10px; }
.code-inline { font-family: var(--display); font-weight: 400; color: var(--bulb); letter-spacing: 0.06em; }
.share + .dim { margin: 10px 0 0; }
.btn.tiny { padding: 2px 8px; font-size: 0.85rem; }

/* ---------- Mode de jeu & équipes ---------- */
.segmented { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--studio-deep); border: 1px solid var(--panel-line); }
.seg { font: inherit; font-weight: 700; border: 0; background: transparent; color: var(--ink-dim); padding: 9px 18px; border-radius: 999px; cursor: pointer; transition: background 0.15s, color 0.15s; }
.seg.on { background: var(--bulb); color: var(--studio-deep); }
.seg:focus-visible { outline: 3px solid var(--bulb); outline-offset: 2px; }
.mode-label { margin: 0; font-weight: 700; }
.panel .segmented + .dim { margin: 12px 0 0; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.team-card {
  --tc: var(--team0);
  position: relative;
  padding: 16px;
  border-radius: 16px;
  background: var(--studio-deep);
  border: 2px solid color-mix(in srgb, var(--tc) 35%, transparent);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.team-card.t1 { --tc: var(--team1); }
.team-card.mine { border-color: var(--tc); box-shadow: 0 0 24px color-mix(in srgb, var(--tc) 25%, transparent); }
.team-card h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.15rem; color: var(--tc); }
.team-card .team-name { font-family: var(--display); font-size: 1.05rem; color: var(--tc); padding: 8px 12px; border-width: 1px; }
.team-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.team-card li { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.team-card li em { font-style: normal; font-size: 0.8em; color: var(--ink-dim); }
.team-card .btn.small { align-self: flex-start; border-color: color-mix(in srgb, var(--tc) 50%, transparent); }
.tdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--team0); vertical-align: 1px; flex: none; }
.tdot.t1 { background: var(--team1); }

/* ---------- Vote & roulette ---------- */
.sub-banner { text-align: center; color: var(--ink-dim); margin: -10px 0 14px; }
.vote-timer { margin: 0 auto 16px; max-width: 520px; }
.ghead { flex-direction: column; gap: 6px; border-radius: 10px; transition: background 0.15s, box-shadow 0.15s; }
.ghead.closed { opacity: 0.35; }
.ghead.voted { background: rgba(255, 210, 63, 0.16); box-shadow: inset 0 0 0 2px var(--bulb); }
.voters { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.vchip { display: inline-flex; align-items: center; font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bulb); color: var(--studio-deep); text-transform: none; animation: pop 0.3s var(--ease-out); }
.vchip .tdot { margin-right: 4px; width: 7px; height: 7px; }
.cell.voted { box-shadow: inset 0 0 0 2px var(--bulb), 0 0 18px rgba(255, 210, 63, 0.25); }
.ghead.cand { box-shadow: inset 0 0 0 1px rgba(255, 210, 63, 0.45); }
.board .spot { filter: brightness(1.35); }
.ghead.spot { background: var(--bulb); color: var(--studio-deep); box-shadow: 0 0 30px rgba(255, 210, 63, 0.6); }
.cell.spot { box-shadow: inset 0 0 0 2px var(--bulb), 0 0 22px rgba(255, 210, 63, 0.45); }
.cell.chosen { background: var(--bulb); color: var(--studio); text-shadow: none; animation: blink 0.35s steps(2) infinite; }
.cell.done { background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); font-size: 1.05rem; color: var(--pink); text-shadow: none; }
.cell.done.some { color: var(--mint); }

/* ---------- Réponses simultanées ---------- */
.answer-status { margin: 12px 0 0; color: var(--ink-dim); font-size: 0.95rem; }
.answer-status.ok { color: var(--mint); }
.pchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.pchip { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: 500; color: var(--ink-dim); background: rgba(0, 0, 0, 0.28); }
.pchip.done { color: var(--studio-deep); background: var(--mint); font-weight: 700; animation: pop 0.3s var(--ease-out); }

/* ---------- Correction ---------- */
.expected { padding: 12px 16px; border-radius: 14px; background: rgba(46, 230, 166, 0.12); box-shadow: inset 0 0 0 2px rgba(46, 230, 166, 0.55); margin-bottom: 14px; animation: slide-in 0.4s var(--ease-out) backwards; }
.expected .label { display: block; font-size: 0.85rem; color: var(--ink-dim); margin-bottom: 2px; }
.expected strong { font-size: 1.3rem; }
.results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.res {
  display: grid;
  grid-template-columns: minmax(80px, 160px) 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 3px 0 0 transparent;
  animation: slide-in 0.35s var(--ease-out) backwards;
  transition: box-shadow 0.2s, background 0.2s;
}
.res:nth-child(2) { animation-delay: 0.05s; }
.res:nth-child(3) { animation-delay: 0.1s; }
.res:nth-child(n + 4) { animation-delay: 0.15s; }
.res.right { box-shadow: inset 4px 0 0 var(--mint); background: rgba(46, 230, 166, 0.08); }
.res.wrong { box-shadow: inset 4px 0 0 var(--pink); }
.res.me .rname { color: var(--bulb); }
.rname { font-weight: 700; display: flex; align-items: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranswer { font-size: 1.1rem; word-break: break-word; }
.ranswer em { color: var(--ink-dim); font-weight: 400; }
.mark { display: flex; gap: 6px; }
.btn.mk { width: 46px; height: 46px; padding: 0; font-size: 1.2rem; border-color: rgba(255, 255, 255, 0.22); }
.btn.mk-good { color: var(--mint); }
.btn.mk-bad { color: var(--pink); }
.btn.mk-good:hover { border-color: var(--mint); }
.btn.mk-bad:hover { border-color: var(--pink); }
.btn.mk-good.on { background: var(--mint); border-color: var(--mint); color: #062b1f; }
.btn.mk-bad.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.verdict-tag { font-family: var(--display); min-width: 3ch; text-align: right; }
.verdict-tag.small-tag { font-family: var(--body); font-size: 0.85rem; color: var(--ink-dim); }
.rvotes { display: block; margin-top: 2px; font-size: 0.8rem; color: var(--ink-dim); font-weight: 500; }
.res.right .verdict-tag { color: var(--mint); }
.res.wrong .verdict-tag { color: var(--pink); }
.res.pending .verdict-tag { color: var(--ink-dim); }
.judge-actions { margin-top: 18px; }
.team-round { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: -4px 0 16px; }
.tchip { padding: 6px 14px; border-radius: 999px; font-weight: 500; background: color-mix(in srgb, var(--team0) 18%, transparent); color: var(--team0); }
.tchip.t1 { background: color-mix(in srgb, var(--team1) 18%, transparent); color: var(--team1); }
.tchip strong { font-family: var(--display); font-weight: 400; margin-left: 4px; }

/* ---------- Scores par équipe ---------- */
.team-score { --tc: var(--team0); border-radius: 14px; padding: 10px 10px 6px; margin-bottom: 10px; background: color-mix(in srgb, var(--tc) 9%, transparent); box-shadow: inset 3px 0 0 var(--tc); }
.team-score.t1 { --tc: var(--team1); }
.team-head { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 6px; }
.team-head .tname { font-family: var(--display); color: var(--tc); font-size: 1rem; }
.team-head .pscore { font-size: 1.3rem; color: var(--tc); }
.team-score .player { padding: 6px 4px; }
.team-score .pscore { font-size: 0.95rem; }
.team-score .player .pscore { color: var(--ink-dim); }

/* ---------- Fin en équipes ---------- */
.team-final { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 560px; margin: 0 auto 26px; text-align: left; }
.team-final .team-card.winner { border-color: var(--tc); box-shadow: 0 0 40px color-mix(in srgb, var(--tc) 35%, transparent); animation: pop 0.6s var(--ease-out); }
.team-total { font-family: var(--display); font-size: 2.2rem; line-height: 1; color: var(--ink); }
.team-final li .dim { font-variant-numeric: tabular-nums; }
.best { font-size: 1rem; color: var(--ink-dim); margin: 0 0 14px; }

@media (max-width: 560px) {
  .teams, .team-final { grid-template-columns: 1fr; }
  .res { grid-template-columns: 1fr auto; }
  .res .rname { grid-column: 1 / -1; }
  .ghead { min-height: 52px; }
  .vchip { font-size: 0.6rem; padding: 1px 5px; }
  .segmented { display: flex; }
  .seg { flex: 1; padding: 9px 10px; }
}

/* ---------- Bonus de fin ---------- */
.bonus-rule { margin: 14px 0 0; color: var(--ink-dim); }
.bonus-rule strong { color: var(--bulb); font-weight: 700; }
.bonuses { max-width: 560px; margin: 0 auto 26px; text-align: left; }
.bonuses h2 { text-align: center; color: var(--ink-dim); font-size: 1rem; }
.bonus {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: rgba(255, 210, 63, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 210, 63, 0.35);
  animation: slide-in 0.5s var(--ease-out) backwards;
  animation-delay: calc(0.4s + var(--d) * 0.35s);
}
.bonus-text { display: flex; flex-direction: column; min-width: 0; }
.bonus-who { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.bonus-pts { font-family: var(--display); font-size: 1.3rem; color: var(--bulb); text-shadow: 0 0 14px rgba(255, 210, 63, 0.5); }
@media (max-width: 560px) {
  .bonus { grid-template-columns: 1fr auto; }
  .bonus-who { grid-column: 1 / -1; justify-content: flex-start; grid-row: 2; }
}

/* ---------- Vote sur une case & note ½ ---------- */
.cell.has-votes { box-shadow: inset 0 0 0 2px rgba(255, 210, 63, 0.55); }
.cell.voted { box-shadow: inset 0 0 0 3px var(--bulb), 0 0 22px rgba(255, 210, 63, 0.35); }
.vbadge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--body);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--studio-deep);
  background: var(--bulb);
  text-shadow: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  animation: pop 0.3s var(--ease-out);
}
.cell.cand { box-shadow: inset 0 0 0 2px rgba(255, 210, 63, 0.5); }
.grid { padding-top: 14px; } /* place pour les pastilles de votes */
.votes-list { list-style: none; margin: -2px 0 16px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; }
.votes-list li { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.votes-list strong { font-weight: 700; }
p.votes-list { display: block; text-align: center; }
.btn.mk-half { color: var(--bulb); font-weight: 700; }
.btn.mk-half:hover { border-color: var(--bulb); }
.btn.mk-half.on { background: var(--bulb); border-color: var(--bulb); color: var(--studio-deep); }
.res.half { box-shadow: inset 4px 0 0 var(--bulb); background: rgba(255, 210, 63, 0.07); }
.res.half .verdict-tag { color: var(--bulb); }
.result.half { color: var(--bulb); }
.result.half .big-pts { text-shadow: 0 0 30px rgba(255, 210, 63, 0.55); }
@media (max-width: 560px) {
  .btn.mk { width: 42px; height: 42px; }
  .vbadge { min-width: 18px; height: 18px; font-size: 0.68rem; top: -5px; right: -5px; }
}

/* ---------- Réglages, cases ★ et bonus ---------- */
.setting { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 14px; }
.setting-label { font-weight: 700; min-width: 150px; }
.target-line { margin: -6px 0 12px; font-size: 0.85rem; color: var(--bulb); }
.target-reached { text-align: center; color: var(--bulb); font-weight: 700; margin: -6px 0 14px; }

.cell.star { background: linear-gradient(to bottom, #7a3be0, #5521b8); }
.star-mark {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 0.8rem;
  color: #fff3c4;
  text-shadow: 0 0 8px rgba(255, 210, 63, 0.9);
  animation: twinkle 1.6s ease-in-out infinite;
}
@keyframes twinkle { 50% { opacity: 0.45; transform: scale(0.85); } }
.star-chip { background: linear-gradient(90deg, #7a3be0, #b14ae6); color: #fff; }

.items-panel h2 { margin-bottom: 4px; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.item-card {
  padding: 14px;
  border-radius: 16px;
  background: var(--studio-deep);
  border: 1px solid var(--panel-line);
  animation: slide-in 0.4s var(--ease-out) backwards;
  animation-delay: calc(var(--d) * 0.08s);
}
.item-card p { margin: 6px 0 10px; }
.item-head { display: flex; align-items: center; gap: 8px; }
.item-icon { font-size: 1.4rem; }
.item-malus { border-color: rgba(255, 61, 127, 0.55); }
.item-time { border-color: rgba(255, 210, 63, 0.55); }
.item-letters { border-color: rgba(124, 92, 255, 0.7); }
.item-shield { border-color: rgba(61, 220, 255, 0.55); }
.targets { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.target { border-color: var(--panel-line); }
.btn.target:hover { border-color: var(--pink); color: #fff; }
.pitems { margin-left: 6px; font-size: 0.85em; letter-spacing: 1px; }

.effects { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 14px; }
.effect { padding: 5px 12px; border-radius: 999px; background: rgba(255, 61, 127, 0.18); color: #ffd0e0; font-weight: 700; font-size: 0.9rem; animation: shake 0.5s; }
.verdict-tag.item-tag { font-family: var(--body); font-weight: 700; font-size: 0.9rem; color: var(--bulb); white-space: nowrap; }
.qtext { word-break: break-word; }
@media (max-width: 560px) {
  .star-mark { top: 2px; left: 4px; font-size: 0.65rem; }
  .setting-label { min-width: 0; width: 100%; }
}

/* ---------- Grille large (jusqu'à 10 thèmes) et grille en lignes sur téléphone ---------- */
.select-all { margin: 10px 0 0; gap: 4px; }
.grid-wrap { container-type: inline-size; }
/* 7 à 10 colonnes : les cases se partagent la largeur disponible, le texte suit */
.grid.wide { grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: clamp(4px, 0.8cqi, 8px); padding: clamp(6px, 1.2cqi, 10px); min-width: 0; }
.grid.wide .ghead { font-size: clamp(0.6rem, 1.4cqi, 0.82rem); min-height: 44px; padding: 4px 1px; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.grid.wide .cell { height: clamp(46px, 7.2cqi, 60px); font-size: clamp(0.8rem, 2.3cqi, 1.2rem); border-radius: 8px; }
.grid.wide .cell.done { font-size: clamp(0.7rem, 1.6cqi, 0.9rem); }
.grid.wide .cell small { display: none; }
.grid.wide .star-mark { top: 2px; left: 4px; font-size: 0.65rem; }

.grid.rows {
  grid-template-columns: minmax(70px, 1.35fr) repeat(5, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
  padding: 12px 8px 8px;
}
.grid.rows .grow-head {
  justify-content: flex-start;
  text-align: left;
  min-height: 0;
  padding: 0 4px 0 2px;
  font-size: 0.74rem;
  line-height: 1.15;
  overflow-wrap: break-word;
  hyphens: auto;
}
.grid.rows .cell { height: 46px; font-size: 0.95rem; border-radius: 8px; }
.grid.rows .cell.done { font-size: 0.8rem; }
.grid.rows .cell small { display: none; }
.grid.rows .star-mark { top: 1px; left: 3px; font-size: 0.6rem; }
.grid.rows .vbadge { min-width: 17px; height: 17px; font-size: 0.65rem; top: -6px; right: -4px; }

/* ---------- Pied de page ---------- */
.credits {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 8px 16px 28px;
  font-size: 0.85rem;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
}

/* ---------- Divers ---------- */
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 50; }
.toast {
  max-width: min(92vw, 520px);
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--bulb);
  color: var(--studio-deep);
  font-weight: 700;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: pop 0.3s var(--ease-out);
}
#toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast-attack { background: var(--pink); color: #fff; border-radius: 16px; }
.toast-blocked { background: var(--team1); color: var(--studio-deep); border-radius: 16px; }

/* ---------- Téléphone ---------- */
@media (max-width: 560px) {
  main { padding: 14px 12px 40px; }
  .topbar { padding: 8px 12px; }
  .room-info .btn.small { display: none; } /* le lien reste copiable dans le lobby */
  .tt-label { display: none; } /* « ← Boitajeux » devient « ← » : la barre tient sur un téléphone */
  .to-tablee { font-size: 1.3rem; padding-right: 6px; }
  .topbar { gap: 8px; }
  .panel { padding: 16px; }
  .board { padding: 10px; --bulb-gap: 16px; border-radius: 16px; }
  .grid { grid-template-columns: repeat(var(--cols), minmax(58px, 1fr)); gap: 6px; padding: 6px; min-width: calc(var(--cols) * 58px + (var(--cols) - 1) * 6px + 12px); }
  .ghead { font-size: 0.7rem; min-height: 44px; padding: 4px 1px; overflow-wrap: break-word; hyphens: auto; }
  .cell { height: 54px; font-size: 1rem; border-radius: 8px; }
  .cell.right, .cell.wrong { font-size: 0.95rem; }
  .cell small { font-size: 0.6rem; }
  .question { padding: 18px; }
  .answers, .verdict { grid-template-columns: 1fr; }
  .answer-row { flex-direction: column; }
  .share { flex-direction: column; }
  .qwho { margin-left: 0; }
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Épreuves spéciales : carte, Street View, engrenages ---------- */
.globe-box, .pano-box, .gears-box {
  margin: 14px 0 10px;
  border-radius: 18px;
  border: 2px solid rgba(124, 92, 255, 0.45);
  background: radial-gradient(ellipse at 50% 40%, #241a6b 0%, #0d0830 72%);
  overflow: hidden;
  position: relative;
}
/* Carte à plat (worldmap.js) */
.map-host { position: relative; width: 100%; height: min(60vh, 520px); transition: height 0.25s; }
.map-host.compact { height: min(38vh, 320px); }
.question:not(.special) .map-host, .special.win .map-host, .special.lose .map-host { height: min(56vh, 480px); }
.wmap-canvas { display: block; touch-action: none; cursor: crosshair; -webkit-user-select: none; user-select: none; }
.wmap.locked .wmap-canvas { cursor: grab; }
.wmap-ctrl { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.wmap-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(13, 8, 48, 0.82); color: #f7f2ff; font: 700 1.25rem/1 system-ui, sans-serif; cursor: pointer;
  display: grid; place-items: center; -webkit-tap-highlight-color: transparent;
}
.wmap-btn:hover { background: rgba(40, 24, 110, 0.95); }
.wmap-btn:focus-visible { outline: 3px solid var(--bulb); outline-offset: 1px; }
.wmap-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--ink-dim); }
.wmap-btn[hidden] { display: none; }
.wmap-style svg { width: 20px; height: 20px; display: block; }
/* crédits du fond de carte (obligatoires), discrets dans le coin */
.wmap-attr { position: absolute; left: 6px; bottom: 5px; margin: 0; padding: 1px 6px; border-radius: 6px; pointer-events: none;
  font: 600 10px/1.4 system-ui, sans-serif; color: #3a3550; background: rgba(255, 255, 255, 0.72); }
.wmap[data-style="relief"] .wmap-attr { color: #e8eef7; background: rgba(0, 0, 0, 0.45); }
.qimg.broken { display: none; }
.globe-loading, .pano-msg { padding: 40px 16px; margin: 0; }
.pano-box { height: min(52vh, 440px); background: #0d0830; }
.pano-host { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
/* le panorama Google occupe tout le cadre (le logo et les mentions de Google restent visibles, c'est obligatoire) */
.pano-view { position: absolute; inset: 0; width: 100%; height: 100%; flex: none; }
.pano-cover { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; background: #0d0830; pointer-events: none; }
.pano-cover .pano-msg { animation: pano-blink 1.4s ease-in-out infinite; }
@keyframes pano-blink { 50% { opacity: 0.45; } }
.timer-row.pano-wait .bar { background: rgba(255, 255, 255, 0.18); }
.timer-row.pano-wait .timer-text { color: var(--ink-dim); }
.pano-wait-msg { margin: 6px 0 0; }
.pano-box + .globe-box .globe-host { min-height: 220px; }
.pick-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pick-row .dim { flex: 1; min-width: 180px; }
.question.special .qtext { font-size: clamp(1.3rem, 3.4vw, 1.9rem); }

.gears-box { padding: 8px; display: flex; justify-content: center; }
.gears-svg { width: 100%; max-height: min(48vh, 420px); }
.gears-svg .gear path { fill: #3a2d8f; stroke: #c9b8ff; stroke-width: 2; stroke-linejoin: round; }
.gears-svg .gear .hub { fill: #0d0830; stroke: #c9b8ff; stroke-width: 2; }
.gears-svg .gear .spoke { stroke: rgba(255, 255, 255, 0.35); stroke-width: 3; stroke-linecap: round; }
.gears-svg .motor .gear path { fill: var(--bulb); stroke: #fff3c4; }
.gears-svg .target .gear path { fill: var(--pink); stroke: #ffd0e0; }
.gears-svg .extra .gear path { fill: #4b3aa8; }
.gears-svg .belt line { stroke: #9ff5d6; stroke-width: 3; stroke-dasharray: 7 5; opacity: 0.85; }
.gears-svg .belt.crossed line { stroke: #ffb36b; }
.gears-svg .axle { fill: #fff; stroke: #0d0830; stroke-width: 2; }
.gears-svg .gear-q { fill: #fff; font: 400 30px var(--display); text-anchor: middle; paint-order: stroke; stroke: #4a0b25; stroke-width: 6px; stroke-linejoin: round; }
.gears-svg .gear-lbl { fill: var(--bulb); font: 700 12px system-ui; text-anchor: middle; }
.gears-svg .gear { transform-box: view-box; }
.gears-svg .jammed .gear { animation: gear-jam 0.18s ease-in-out infinite alternate; }
@keyframes spin-cw { to { transform: rotate(360deg); } }
@keyframes spin-ccw { to { transform: rotate(-360deg); } }
@keyframes gear-jam { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
.gear-legend { margin: 4px 0 12px; }
.gchoices { display: flex; gap: 10px; flex-wrap: wrap; }
.gchoices .btn { flex: 1 1 180px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.choice-icon { font-size: 1.6rem; line-height: 1; }
@media (max-width: 700px) {
  .pano-box { height: 44vh; }
  .gchoices { flex-direction: column; }
  .gchoices .btn { flex: none; padding: 12px 18px; }
  .gears-box { padding: 2px; }
}

/* ---------- Sprint ---------- */
.sprint-card { text-align: left; }
.sprint-card.intro, .sprint-card.result { text-align: center; }
.sprint-kicker { margin: 0; color: var(--bulb); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.85rem; }
.sprint-title { font-family: var(--display); font-size: clamp(2.4rem, 8vw, 4rem); margin: 6px 0 12px; color: #fff; text-shadow: 0 0 18px rgba(255, 210, 63, 0.6), 0 4px 0 rgba(0, 0, 0, 0.35); }
.sprint-rules { max-width: 560px; margin: 0 auto 8px; font-size: 1.08rem; line-height: 1.5; }
.sprint-count { margin-top: 18px; }
.sprint-count .timer-text { font-family: var(--display); font-size: 5rem; color: var(--bulb); display: inline-block; min-width: 1.2em; }
.sprint-stats { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 10px 0 14px; }
.streak { display: flex; align-items: baseline; gap: 6px; padding: 6px 14px; border-radius: 999px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--panel-line); }
.streak strong { font-family: var(--display); font-size: 1.8rem; line-height: 1; }
.streak small { color: var(--ink-dim); }
.streak .flame { filter: grayscale(1); opacity: 0.6; transition: filter 0.2s, opacity 0.2s; }
.streak.hot { border-color: var(--bulb); box-shadow: 0 0 18px rgba(255, 210, 63, 0.35); }
.streak.hot .flame { filter: none; opacity: 1; }
.sprint-best strong { font-family: var(--display); }
.sprint-best .gain, .sprint-results .gain { color: var(--mint); }
.sprint-tally { margin-left: auto; }
.schoices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.btn.schoice { display: flex; align-items: center; gap: 12px; text-align: left; justify-content: flex-start; padding: 16px 16px; min-height: 64px; font-size: 1.05rem; white-space: normal; line-height: 1.25; }
.btn.schoice kbd { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: rgba(0, 0, 0, 0.3); font: 700 0.85rem var(--display); color: var(--bulb); }
.btn.schoice:disabled { cursor: default; opacity: 1; }
.btn.schoice.picked { border-color: var(--bulb); }
.btn.schoice.good { background: var(--mint); border-color: var(--mint); color: #08241b; animation: pop 0.25s ease-out; }
.btn.schoice.good kbd { color: #08241b; background: rgba(255, 255, 255, 0.35); }
.btn.schoice.bad { background: var(--pink); border-color: var(--pink); color: #fff; animation: shake 0.35s; }
.btn.schoice.faded { opacity: 0.45; }
.sprint-card.fb-bad { box-shadow: 0 0 0 2px var(--pink), 0 0 30px rgba(255, 61, 127, 0.35); }
.sprint-card.fb-good { box-shadow: 0 0 0 2px var(--mint), 0 0 30px rgba(46, 230, 166, 0.3); }
.sprint-board-panel { margin-top: 16px; }
.sprint-board, .sprint-results { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.sprint-board li, .sprint-results li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.22); }
.sprint-board li.me, .sprint-results li.me { outline: 1px solid var(--bulb); }
.sprint-board .bname, .sprint-results .bname { flex: 1; font-weight: 700; text-align: left; }
.sprint-board .bstreak.hot { color: var(--bulb); font-weight: 700; }
.sprint-board .bbest { color: var(--ink-dim); font-size: 0.88rem; min-width: 70px; text-align: right; }
.sprint-results { margin: 16px 0 18px; text-align: left; }
.sprint-results li { padding: 12px 14px; }
.sprint-results .rank { font-family: var(--display); color: var(--bulb); width: 1.4em; }
.sprint-results .gain { font-family: var(--display); font-size: 1.2rem; min-width: 70px; text-align: right; }
.sprint-results li:first-child { background: linear-gradient(90deg, rgba(255, 210, 63, 0.25), rgba(0, 0, 0, 0.2)); }
.sprint-timer { margin-bottom: 4px; }
@media (max-width: 700px) {
  .schoices { grid-template-columns: 1fr; gap: 8px; }
  .btn.schoice { min-height: 54px; padding: 12px 14px; }
  .sprint-tally { margin-left: 0; }
  .sprint-results li { flex-wrap: wrap; gap: 6px 10px; }
}

/* ---------- Petit bac ---------- */
.bac-letter { display: flex; align-items: center; gap: 14px; margin: 16px 0 6px; }
.bac-letter span { color: var(--ink-dim); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; }
.bac-letter strong {
  font-family: var(--display); font-size: 3.4rem; line-height: 1; color: var(--bulb);
  width: 1.5em; height: 1.5em; display: grid; place-items: center; border-radius: 18px;
  background: rgba(0, 0, 0, 0.3); box-shadow: inset 0 0 0 2px var(--bulb-dim), 0 0 30px rgba(255, 210, 63, 0.25);
}
.bac-letter.small { margin-top: 0; }
.bac-letter.small strong { font-size: 2rem; border-radius: 12px; }
.bac-form { display: grid; gap: 10px; margin-top: 12px; }
.bac-row { display: grid; grid-template-columns: minmax(110px, 0.8fr) 2fr; align-items: center; gap: 12px; }
.bac-cat { font-weight: 700; color: var(--ink-dim); font-size: 0.95rem; }
.bac-row input { width: 100%; font-size: 1.1rem; padding: 12px 14px; }
.bac-send { justify-self: end; min-width: 160px; margin-top: 4px; }
.bac-rules { color: var(--ink-dim); margin: 8px 0 14px; max-width: 62ch; }
.bac-sheets { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 12px 0; }
.bac-sheet { border-radius: 14px; background: rgba(0, 0, 0, 0.22); padding: 12px 14px; }
.bac-sheet.me { outline: 1px solid var(--bulb-dim); }
.bac-who { font-weight: 700; display: flex; align-items: center; margin-bottom: 8px; }
.bac-sheet.me .bac-who { color: var(--bulb); }
.bac-sheet ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bac-w { display: grid; grid-template-columns: minmax(84px, 0.8fr) 1.6fr auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); }
.bac-w .bac-cat { font-size: 0.8rem; font-weight: 600; }
.bac-w .bw { font-weight: 700; word-break: break-word; }
.bac-w .bw small { display: block; font-weight: 500; font-size: 0.78rem; color: var(--ink-dim); }
.bac-w.empty .bw { color: var(--ink-dim); font-weight: 400; }
.bac-w.bad { background: rgba(255, 61, 127, 0.12); }
.bac-w.bad .word { text-decoration: line-through; text-decoration-color: var(--pink); color: #ffb3cc; }
.bac-w.warn { background: rgba(255, 210, 63, 0.08); }
.bac-w.ok .bac-pt { color: var(--mint); }
.bac-w.half .bac-pt { color: var(--bulb); }
.bac-w.bad .bac-pt { color: var(--pink); }
.bac-pt { font-family: var(--display); font-size: 1rem; min-width: 2.2ch; text-align: right; }
.btn.tiny { padding: 5px 10px; font-size: 0.8rem; border-radius: 999px; box-shadow: none; }
.btn.tiny.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.bac-done-row { display: flex; justify-content: flex-end; margin-top: 4px; }
@media (max-width: 480px) {
  .bac-row { grid-template-columns: 1fr; gap: 4px; }
  .bac-send { justify-self: stretch; }
}

/* ---------- Calcul mental, orthographe ---------- */
.series-card { margin-top: 16px; padding: 18px; border-radius: 18px; background: rgba(0, 0, 0, 0.25); text-align: center; }
.sdots { display: flex; justify-content: center; gap: 8px; margin-bottom: 10px; }
.sdot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.15); transition: background 0.2s, transform 0.2s; }
.sdot.done { background: var(--mint); }
.sdot.now { background: var(--bulb); transform: scale(1.3); }
.series-num { color: var(--ink-dim); margin: 0 0 6px; font-weight: 600; }
.calc-prompt { font-family: var(--display); font-size: clamp(2rem, 9vw, 3.2rem); line-height: 1.1; margin: 6px 0 4px; color: var(--ink); font-variant-numeric: tabular-nums; }
.calc-prompt .eq { color: var(--bulb); }
.series-card .answer-row { max-width: 360px; margin: 14px auto 0; }
.series-card .answer-row input { text-align: center; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.ortho-prompt { font-size: clamp(1.15rem, 4.2vw, 1.5rem); font-weight: 700; margin: 6px 0 14px; text-wrap: balance; }
.ortho-prompt .blank { display: inline-block; min-width: 3.2em; border-bottom: 3px solid var(--bulb); color: var(--bulb); }
.ochoices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn.ochoice { font-size: 1.08rem; padding: 14px 10px; white-space: normal; word-break: break-word; }
.series-done { font-family: var(--display); font-size: 2rem; color: var(--mint); margin: 6px 0; }
.series-review { list-style: none; margin: 4px 0 14px; padding: 0; display: grid; gap: 6px; counter-reset: sr; }
.series-review li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.22); counter-increment: sr; }
.series-review li::before { content: counter(sr); font-family: var(--display); color: var(--ink-dim); min-width: 1.2em; }
.series-review .sr-q { flex: 1; font-variant-numeric: tabular-nums; }
.series-review .sr-q b { color: var(--mint); }
.series-review li.ok .sr-me { color: var(--mint); font-weight: 700; }
.series-review li.ko .sr-me { color: var(--pink); font-weight: 600; white-space: nowrap; }
.series-review li.ko { box-shadow: inset 3px 0 0 var(--pink); }
.series-review li.ok { box-shadow: inset 3px 0 0 var(--mint); }
@media (max-width: 420px) { .ochoices { grid-template-columns: 1fr; } }
@media (max-width: 380px) { .logo { font-size: 1.12rem; } }

/* ---------- Accueil d'un salon : même déroulé que les autres jeux de Boitajeux ---------- */
.lbl { display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 6px; }
.code-big {
  font-family: var(--display); font-size: clamp(2.2rem, 11vw, 3.2rem); line-height: 1; letter-spacing: 0.12em; color: var(--bulb);
  text-shadow: 0 0 8px rgba(255, 210, 63, 0.7), 0 0 30px rgba(255, 61, 127, 0.35); margin: 4px 0 16px;
}
.lobby-code .share + .dim { margin: 10px 0 0; }
.seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.seat { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px 12px; border-radius: 12px; background: var(--cell); border: 1px solid var(--cell-hi); font-weight: 700; }
.seat .sname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.seat.off .dot { background: var(--ink-dim); box-shadow: none; }
.seat.off { opacity: 0.6; }
.seat small { margin-left: auto; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bulb); }
.seat.free { justify-content: center; background: transparent; border-style: dashed; border-color: var(--panel-line); color: var(--ink-dim); font-weight: 500; }
.lobby-players .teams { margin-top: 0; }
.lobby-actions { margin-top: 16px; }
.lobby-players > .dim { margin: 14px 0 0; }
.lobby-actions + .dim { margin: 8px 0 0; }
/* thèmes repliés : la liste est longue */
.themes-box > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.themes-box > summary::-webkit-details-marker { display: none; }
.themes-box > summary h2 { margin: 0; }
.themes-box > summary h2::before { content: '▸'; display: inline-block; width: 1.1em; color: var(--bulb); transition: transform .2s; }
.themes-box[open] > summary h2::before { transform: rotate(90deg); }
.themes-box[open] > summary { margin-bottom: 12px; }
.themes-box > summary:focus-visible { outline: 2px solid var(--bulb); outline-offset: 4px; border-radius: 6px; }
/* pendant l'accueil, la liste des joueurs remplace le tableau des scores */
.layout.in-lobby { grid-template-columns: minmax(0, 1fr); max-width: 760px; margin: 0 auto; }
.layout.in-lobby .side { display: none; }
@media (max-width: 420px) { .code-pill .cp-l { display: none; } }
/* entrer par un lien */
.enter { max-width: 560px; margin: 4vh auto 0; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.enter .panel { width: 100%; margin: 0; }
.enter h2 { font-size: 1.25rem; }
.row.nowrap { flex-wrap: nowrap; }
.row.nowrap input { flex: 1; min-width: 0; }

/* Vue Street View : relance si elle reste noire */
.pano-again { position: absolute; right: 8px; top: 8px; z-index: 6; opacity: .82; font-size: 12px; padding: 6px 10px; min-height: 0; background: rgba(13, 8, 48, .78); color: #fff; border: 1px solid rgba(255, 255, 255, .25); }
.pano-again:hover, .pano-again:focus-visible { opacity: 1; }
.seg small { opacity: .7; font-size: .8em; margin-left: 3px; }

/* Amis et discussion de Boitajeux (modules partagés) : leurs couleurs prises dans le studio */
:root {
  --surface: var(--panel); --fg: var(--ink); --accent: var(--bulb); --accent-ink: var(--studio-deep); --hot: var(--pink);
  --muted: var(--ink-dim); --line: var(--panel-line); --glass: rgba(255, 255, 255, .06); --bg: var(--studio-deep);
  --f-body: var(--body); --f-display: var(--display); --sun: var(--bulb); --ok: var(--mint); --paper: var(--ink);
}
.cl-av { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; object-fit: cover; background: radial-gradient(circle at 35% 30%, #a48bff, #5232d6); color: #fff; font: 700 13px/1 var(--body); }
.fr-lobby h2 { margin-top: 0; }
.fr-lobby .fr-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.fr-lobby .fr-st { font-size: 13px; color: var(--ink-dim); }
.chat-head h2 { font-size: 18px; }
.room-info .chat-btn { min-height: 0; }
@media (max-width: 640px) { .room-info .btn.small.chat-btn { display: inline-flex; } }
.room-info .chat-btn { width: 40px; height: 40px; padding: 0; }
.seg:has(small) { white-space: nowrap; padding-left: 12px; padding-right: 12px; }
/* Barre du haut sur téléphone : logo, code, discussion et son tiennent sur une ligne */
@media (max-width: 560px) {
  .logo { font-size: 1.05rem; min-width: 0; white-space: nowrap; }
  .code-pill { font-size: .78rem; padding: 3px 8px; }
  .room-info { gap: 4px; flex: none; }
  .room-info .chat-btn, .room-info .btn.icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
}
@media (max-width: 380px) { .logo { font-size: .92rem; } }
/* Hôte : joueurs partis (les retirer, ou dire qui ils sont devenus) */
.absent-tools { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.player .absent-tools { flex-basis: 100%; justify-content: flex-end; margin-top: 4px; }
.seat:has(.absent-tools) { flex-wrap: wrap; }
.seat .absent-tools { flex-basis: 100%; justify-content: space-between; margin: 4px 0 0; }
.seat .absent-tools { flex-wrap: wrap; }
.seat .absent-tools .merge-sel { max-width: none; flex: 1 1 100px; min-width: 0; }
.absent-tools .btn.tiny { flex: none; padding: 4px 8px; }
.seat.off:has(.absent-tools) > :not(.absent-tools) { opacity: .6; }
.merge-sel { max-width: 120px; font: inherit; font-size: 12px; padding: 3px 6px; border-radius: 8px; background: var(--studio-deep); color: var(--ink); border: 1px solid var(--panel-line); }
.player:has(.absent-tools) { flex-wrap: wrap; opacity: 1; }
.player.off:has(.absent-tools) > :not(.absent-tools) { opacity: .4; }
.seat.off:has(.absent-tools) { opacity: 1; }

/* Spectateur arrivé en cours de partie */
.watchbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 12px; padding: 10px 14px; border-radius: 14px; background: var(--studio-deep); border: 1px dashed var(--panel-line); color: var(--ink); font-size: 14px; }
.watchbar[hidden] { display: none; }
.watch-eye { font-size: 18px; }
.watch-txt { flex: 1 1 200px; }
.watch-pick { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.watch-pick select { font: inherit; font-weight: 600; padding: 4px 8px; border-radius: 8px; background: var(--cell); color: var(--ink); border: 1px solid var(--cell-hi); }
.is-watching #main input[readonly], .is-watching #main textarea[readonly] { opacity: .85; }

/* ---------- Mode Série ---------- */
.serie-prog { display: block; flex: 1 1 80px; max-width: 160px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.serie-prog i { display: block; height: 100%; background: var(--bulb); border-radius: inherit; transition: width .3s ease-out; }
.qmeta .serie-prog { order: 9; flex: 1 0 100%; max-width: none; height: 5px; margin-top: 2px; }
.serie-prog.big { max-width: 320px; height: 8px; margin: 18px auto 0; }
.serie-next { text-align: center; padding: 40px 20px; }
.serie-next-n { margin: 0; font: 400 3.4rem/1 var(--f-display, inherit); }
.serie-next-n small { font-size: .45em; color: var(--ink-dim); }
.serie-who { margin: 0 0 6px; font-size: 1.5rem; }
.serie-who small { font-size: .9rem; font-weight: 500; color: var(--ink-dim); margin-left: 6px; }
.serie-past { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.serie-rows .srow { display: grid; grid-template-columns: 1fr; gap: 8px; align-items: stretch; }
.srow-q { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.srow-q p { flex: 1 1 100%; margin: 2px 0 0; color: var(--ink-dim); font-size: .95rem; line-height: 1.35; }
.srow-n { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink-dim); min-width: 1.6em; }
.srow-q .points { font-size: .85rem; }
.srow-a { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; }
.srow-exp { font-size: .95rem; word-break: break-word; }
.srow-exp .label { font-size: .75rem; color: var(--ink-dim); text-transform: none; }
.serie-foot { position: sticky; bottom: 0; margin: 14px -4px -4px; padding: 10px 4px 6px; padding-top: 24px; background: linear-gradient(rgba(42, 18, 114, 0), #2a1272 20px); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.serie-foot .answer-status { flex: 1 1 260px; margin: 0; }
.serie-foot .pchips { flex: 1 1 100%; margin: 0; }
@media (max-width: 600px) {
  .srow-a { grid-template-columns: minmax(0, 1fr) auto; }
  .srow-exp { grid-column: 1 / -1; }
}

.serie-who small { display: block; margin-top: 4px; font-size: .95rem; font-weight: 600; color: var(--ink-dim); }
.srow-a .ranswer { text-align: left; justify-self: start; }
