/* ========== Ambiance — styles ========== */
:root {
  --bg: #3a2a86;
  --bg2: #4a379c;
  --card: rgba(255, 255, 255, .13);
  --card2: rgba(255, 255, 255, .22);
  --line: rgba(255, 255, 255, .2);
  --text: #ffffff;
  --muted: #e2dbff;
  --accent: #ff4d8d;
  --accent2: #7c5cff;
  --ok: #22d39a;
  --warn: #ffb020;
  --bad: #ff5a5f;
  --g1: #ff4d8d;
  --g2: #7c5cff;
  --radius: 20px;
  --shadow: 0 8px 20px rgba(30, 10, 80, .16);
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Icônes de l'interface (js/icons.js), à la place des emojis : taille et couleur du texte autour. */
.ic { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; overflow: visible; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font, ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
/* Fond coloré fixe sur tout l'écran (background-attachment: fixed ne marche pas sur iPhone). */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: var(--page-bg,
    radial-gradient(120vmax 80vmax at 0% 0%, rgba(124, 92, 255, .9), transparent 60%),
    radial-gradient(110vmax 80vmax at 100% 10%, rgba(255, 77, 141, .75), transparent 55%),
    radial-gradient(120vmax 90vmax at 50% 110%, rgba(46, 197, 255, .55), transparent 60%),
    linear-gradient(160deg, #5a3cc0, #8a3aae 55%, #3d50c4));
}

/* ---------- Thèmes ---------- */
html[data-anim="shift"] body::before { background-size: 400% 400%; animation: bgshift 22s ease-in-out infinite alternate; }
html[data-anim="hue"] body::before { animation: bghue 14s linear infinite; }
html[data-anim="pulse"] body::before { inset: -20%; animation: bglava 16s ease-in-out infinite alternate; }
@keyframes bgshift { 0% { background-position: 0% 0%; } 50% { background-position: 100% 60%; } 100% { background-position: 30% 100%; } }
@keyframes bghue { to { filter: hue-rotate(360deg); } }
@keyframes bglava { 0% { transform: translate(0, 0) rotate(0) scale(1); } 50% { transform: translate(6%, -5%) rotate(8deg) scale(1.1); } 100% { transform: translate(-6%, 6%) rotate(-6deg) scale(1.05); } }

#theme-fx { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
#theme-fx span { position: absolute; left: var(--x); top: 0; font-size: var(--s); line-height: 1; opacity: var(--o); white-space: pre; will-change: transform; }
.fx-fall span { animation: fxfall var(--d) linear var(--delay) infinite; }
.fx-rise span { animation: fxrise var(--d) linear var(--delay) infinite; }
#theme-fx.fx-drift span { animation: fxdrift var(--d) ease-in-out var(--delay) infinite alternate; top: var(--y); }
#theme-fx.fx-twinkle span { top: var(--y); animation: fxtwinkle var(--d) ease-in-out var(--delay) infinite alternate; }
.fx-code span { color: #22ff88; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; text-shadow: 0 0 6px #22ff88; animation: fxfall var(--d) linear var(--delay) infinite; }
@keyframes fxfall { from { transform: translate(0, -20vh) rotate(0); } to { transform: translate(var(--sway), 115vh) rotate(var(--r)); } }
@keyframes fxrise { from { transform: translate(0, 115vh) rotate(0); } to { transform: translate(var(--sway), -20vh) rotate(var(--r)); } }
@keyframes fxdrift { from { transform: translate(-30vw, 0) rotate(-12deg); } to { transform: translate(30vw, var(--sway)) rotate(12deg); } }
@keyframes fxtwinkle { from { transform: scale(.4); opacity: .15; } to { transform: scale(1.15); opacity: var(--o); } }

html[data-extra="neon"] .logo, html[data-extra="neon"] .logo-big { filter: drop-shadow(0 0 10px rgba(255, 43, 214, .7)); }
html[data-extra="neon"] .btn-primary { box-shadow: 0 0 18px var(--g1), 0 0 34px rgba(0, 229, 255, .35); }
html[data-extra="neon"] h1, html[data-extra="neon"] h2 { text-shadow: 0 0 12px rgba(0, 229, 255, .6); }
html[data-extra="minimal"] .tile { filter: saturate(.75); }

.theme-cat { font-weight: 800; font-size: 14px; color: var(--muted); margin-top: 4px; }
.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.theme-sw {
  position: relative; aspect-ratio: 1 / 1.05; border: 2px solid rgba(255, 255, 255, .25); border-radius: 16px; padding: 8px 6px 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; color: #fff; overflow: hidden; background-size: cover;
}
.theme-sw.on { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .55), var(--shadow); transform: scale(1.03); }
.theme-sw.on::after { content: '✓'; position: absolute; top: 4px; left: 6px; font-weight: 900; font-size: 14px; background: #fff; color: #1d1440; border-radius: 50%; width: 20px; height: 20px; display: grid; place-items: center; }
.theme-emo { font-size: 30px; line-height: 1; margin-top: 4px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .3)); }
.theme-dots { display: flex; gap: 4px; }
.theme-dots i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .8); }
.theme-name { font-size: 12px; font-weight: 800; line-height: 1.1; text-align: center; text-shadow: 0 1px 4px rgba(0, 0, 0, .55); }
.theme-tag { position: absolute; top: 4px; right: 5px; font-size: 12px; }
.theme-btn { display: flex; align-items: center; gap: 12px; text-align: left; justify-content: flex-start; }
.theme-btn .sw-mini { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; font-size: 22px; border: 2px solid rgba(255, 255, 255, .5); }

input, textarea { -webkit-user-select: text; user-select: text; font: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }
a { color: #c9b8ff; }

#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.screen {
  flex: 1; width: 100%; max-width: 680px; margin: 0 auto;
  padding: calc(var(--st) + 14px) 16px calc(var(--sb) + 24px);
  display: flex; flex-direction: column; gap: 16px;
}
.splash { flex: 1; display: grid; place-items: center; }
.logo-big, .logo {
  font-weight: 900; letter-spacing: -.03em;
  background: var(--logo, linear-gradient(90deg, #ffd166, #ff4d8d 45%, #9b7bff));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.logo-big { font-size: 48px; animation: pulse 1.2s ease-in-out infinite alternate; }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.grow { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hidden { display: none !important; }
.sep { height: 1px; background: var(--line); margin: 4px 0; }

/* ---------- Boutons ---------- */
.btn {
  border: 0; border-radius: 16px; padding: 14px 18px; font-weight: 700; font-size: 16px;
  background: var(--card2); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .08s ease, filter .15s ease, opacity .15s;
  min-height: 48px; text-align: center;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-primary { background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: 0 8px 22px rgba(255, 77, 141, .25); color: #fff; }
.btn-ok { background: var(--ok); color: #05261b; }
.btn-bad { background: var(--bad); color: #fff; }
.btn-warn { background: var(--warn); color: #2b1c00; }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-soft { background: rgba(255, 255, 255, .08); }
.btn-big { font-size: 20px; padding: 18px 22px; min-height: 60px; border-radius: 20px; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; min-height: 36px; font-size: 14px; border-radius: 12px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; border: 0; background: rgba(255, 255, 255, .08);
  display: grid; place-items: center; font-size: 20px; flex: none;
}
.icon-btn:active { transform: scale(.94); }

/* ---------- Champs ---------- */
.input, select.input, textarea.input {
  width: 100%; background: rgba(255, 255, 255, .07); border: 1px solid var(--line); color: var(--text);
  border-radius: 14px; padding: 13px 14px; font-size: 16px; outline: none; min-height: 48px;
}
.input:focus { border-color: var(--accent2); background: rgba(255, 255, 255, .1); }
textarea.input { min-height: 110px; resize: vertical; }
select.input { appearance: none; }
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; color: var(--muted); }
.code-input { text-transform: uppercase; letter-spacing: .35em; font-weight: 800; font-size: 26px; text-align: center; }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: rgba(255, 255, 255, .05); border-radius: 999px;
  padding: 9px 14px; font-weight: 700; font-size: 14px; white-space: nowrap;
}
.chip.on { background: linear-gradient(135deg, var(--g1), var(--g2)); border-color: transparent; color: #fff; }
.chip .lock { opacity: .8; margin-left: 4px; }
.scroll-x { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.scroll-x::-webkit-scrollbar { display: none; }

.seg { display: flex; background: rgba(255, 255, 255, .06); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 10px; padding: 10px 6px; font-weight: 700; font-size: 14px; }
.seg button.on { background: var(--card2); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }

/* ---------- Panneaux ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel h3 { font-size: 17px; margin-bottom: 10px; }
.rules p { color: var(--muted); }
.rules p + p { margin-top: 8px; }
.rules b { color: var(--text); }
details.panel summary { font-weight: 700; cursor: pointer; list-style: none; }
details.panel summary::-webkit-details-marker { display: none; }
details.panel summary::after { content: ' ▾'; color: var(--muted); }
details.panel[open] summary { margin-bottom: 10px; }

/* ---------- Accueil ---------- */
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { font-size: 34px; }
.tagline { color: var(--muted); font-size: 14px; margin-top: 2px; }
.players-bar {
  display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 10px 12px; width: 100%; text-align: left;
}
.players-bar .names { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 14px; }
.players-bar b { color: var(--text); }
.online-banner {
  position: relative; overflow: hidden; border-radius: 24px; padding: 18px;
  background: linear-gradient(135deg, var(--ob1, #2a7bff), var(--ob2, #7c5cff) 55%, var(--ob3, #ff4d8d));
  box-shadow: var(--shadow);
}
.online-banner h2 { font-size: 22px; }
.online-banner p { opacity: .9; font-size: 14px; margin: 4px 0 14px; max-width: 30ch; }
.online-banner .deco { position: absolute; right: -6px; top: -6px; font-size: 76px; opacity: .25; transform: rotate(12deg); }
.online-banner .btn { background: rgba(255, 255, 255, .95); color: #2a1a5e; }
.online-banner .btn.btn-ghost { background: rgba(0, 0, 0, .18); color: #fff; border-color: rgba(255, 255, 255, .35); }
.online-banner .tv-link { display: block; margin: 12px auto 0; border: 0; background: none; color: #fff; font-weight: 700; font-size: 14px; opacity: .92; text-decoration: underline; text-underline-offset: 3px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Case d'un jeu, style « boîte de jeu » : silhouettes blanches (img/jeux/<id>.webp, fond transparent, générée par
   scripts/gen-images.mjs) posées sur le dégradé du jeu (couleurs du thème), une lumière douce en haut à droite,
   une trame de points qui s'efface vers la gauche et un liseré clair ; nom incrusté en bas à gauche. */
.tile, .mini-tile, .pick-tile {
  background:
    radial-gradient(120% 95% at 88% 8%, rgba(255, 255, 255, .3), rgba(255, 255, 255, .08) 45%, rgba(255, 255, 255, 0) 62%),
    linear-gradient(150deg, var(--g1), var(--g2));
}
.tile::before, .mini-tile::before, .pick-tile::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit;
  background: radial-gradient(rgba(255, 255, 255, .16) 1.1px, transparent 1.6px) 0 0 / 11px 11px;
  -webkit-mask-image: linear-gradient(115deg, transparent 25%, #000 75%); mask-image: linear-gradient(115deg, transparent 25%, #000 75%);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .2);
}
.tile, .mini-tile {
  position: relative; isolation: isolate; border: 0; padding: 0; text-align: left; color: #fff; overflow: hidden;
  aspect-ratio: 3 / 2;
  transition: transform .1s ease;
}
.tile { display: block; width: 100%; border-radius: 20px; box-shadow: 0 4px 12px rgba(30, 10, 80, .16); }
.tile:active { transform: scale(.97); }
.tile-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; transition: transform .3s ease; }
@media (hover: hover) { .tile:hover .tile-art, .mini-tile:hover .tile-art { transform: scale(1.05); } }
.tile-emo { position: absolute; left: 68%; top: 44%; transform: translate(-50%, -50%); font-size: 52px; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .25)); }
/* Voile sombre en bas : le nom reste lisible sur toutes les couleurs. */
.tile::after, .mini-tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(20, 5, 40, .32)); pointer-events: none; }
.tile .name {
  position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 1;
  font-weight: 900; font-size: clamp(14px, 4.1vw, 17px); line-height: 1.12; letter-spacing: -.01em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
.tile .badges { position: absolute; top: 9px; left: 9px; right: 40px; display: flex; flex-wrap: wrap; gap: 4px; z-index: 1; }
.tile .badge { font-size: 10.5px; padding: 2px 7px; }
/* Petit écran : « Nouveau » + nombre de joueurs ne tiennent plus sur une ligne, on garde « Nouveau ». */
.tile-wrap { container-type: inline-size; }
@container (max-width: 171px) { .tile .badge.new + .badge { display: none; } }
.badge.new { background: #fff; color: #e0245e; }
.badge { font-size: 11px; font-weight: 800; background: rgba(0, 0, 0, .2); padding: 3px 7px; border-radius: 999px; backdrop-filter: blur(4px); }
.section-title { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
/* ---------- Accueil : cases des modes, d'après la maquette (js/modes-art.js) ---------- */
@font-face { font-family: 'Fredoka'; src: url('../fonts/fredoka-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url('../fonts/fredoka-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
.screen.home { min-height: 100vh; min-height: 100dvh; }
.modes { flex: 1; display: flex; flex-direction: column; gap: 14px; min-height: min(620px, calc(100dvh - 150px)); }
.mode-card {
  --px: 0; --py: 0; --ink: #5b1a12; --bg: linear-gradient(135deg, #fb5a26, #ff6d2c 55%, #ff4f3a);
  position: relative; isolation: isolate; overflow: hidden; flex: 1; min-height: 150px; border: 0; border-radius: 26px; padding: 0;
  text-align: left; color: #fff; font-family: 'Fredoka', var(--font, ui-rounded, system-ui, sans-serif);
  background: #6d28d9; box-shadow: 0 10px 26px rgba(30, 10, 80, .28);
  transition: transform .15s ease, box-shadow .2s ease; animation: up .5s cubic-bezier(.2, .9, .3, 1.15) backwards;
}
.mode-card:nth-child(2) { animation-delay: .08s; }
.mode-card:nth-child(3) { animation-delay: .16s; }
.mode-card:active { transform: scale(.97); }
@media (hover: hover) { .mode-card:hover { box-shadow: 0 16px 34px rgba(30, 10, 80, .36); } }
/* Couleurs de chaque case, assorties à son illustration (fixes : elles ne suivent pas le thème). */
.mode-local {
  --ink: #5b1a12;
  --bg: radial-gradient(45% 80% at 72% 42%, rgba(255, 196, 84, .9), rgba(255, 150, 50, .35) 55%, transparent 80%),
        repeating-conic-gradient(from 8deg at 72% 42%, rgba(255, 214, 120, .26) 0deg 5deg, transparent 5deg 15deg),
        linear-gradient(160deg, #fc5524, #fd6a2a 55%, #fe7a45);
}
.mode-online {
  --ink: #0b1f8a;
  --bg: radial-gradient(50% 80% at 72% 50%, rgba(120, 200, 255, .55), transparent 75%),
        linear-gradient(170deg, #035ffc, #0b78ff 60%, #1f98ff);
}
.mode-tv {
  --ink: #1e0f6e;
  --bg: radial-gradient(50% 85% at 70% 35%, rgba(170, 120, 255, .55), transparent 75%),
        linear-gradient(165deg, #3906c4, #4a26e6 55%, #4565f2);
}
.mode-in { position: absolute; inset: 0; z-index: 0; container-type: size; overflow: hidden; border-radius: inherit; background: var(--bg); }
/* Illustration découpée dans la maquette : à droite, fondue vers la gauche, qui respire doucement. */
.mode-bg { position: absolute; inset: 0; pointer-events: none; }
.mode-art {
  position: absolute; right: 0; top: 0; height: 100%; width: min(66%, 128cqh); object-fit: cover; object-position: 100% 50%;
  -webkit-mask: linear-gradient(90deg, transparent, #000 26%); mask: linear-gradient(90deg, transparent, #000 26%);
  translate: calc(var(--px) * -1.4%) calc(var(--py) * -1.2%); transition: translate .3s ease-out;
  transform-origin: 70% 55%; animation: modeArt 7s ease-in-out infinite;
}
/* Reflet qui balaie la case de temps en temps. */
.mode-card::before { content: ''; position: absolute; inset: -30% -60%; z-index: 1; pointer-events: none; background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .24) 50%, transparent 58%); transform: translateX(-70%); animation: modeShine 7s ease-in-out infinite; }
.mode-card:nth-child(2)::before { animation-delay: 2.3s; }
.mode-card:nth-child(3)::before { animation-delay: 4.6s; }
/* Étincelles à quatre branches, comme sur la maquette. */
.mode-spark { position: absolute; width: 5cqh; height: 5cqh; background: #fff; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); filter: drop-shadow(0 0 1.5cqh rgba(255, 255, 255, .9)); animation: modeTwinkle 2.8s ease-in-out infinite; }
.mode-spark.s1 { left: 46%; top: 12%; }
.mode-spark.s2 { left: 40%; top: 74%; width: 3.6cqh; height: 3.6cqh; animation-delay: -1s; }
.mode-spark.s3 { right: 4%; top: 8%; width: 4cqh; height: 4cqh; animation-delay: -1.9s; }
.mode-local .mode-spark { background: #ffe27a; }
/* Texte : icône au trait, grand titre blanc cerné, sous-titre, bouton foncé avec flèche. */
.mode-txt { position: absolute; z-index: 1; left: 7cqh; top: 0; bottom: 0; max-width: 62%; display: flex; flex-direction: column; justify-content: center; gap: 2.2cqh; }
.mode-ico { display: block; width: 23cqh; height: 20cqh; margin: 0 0 -.5cqh -1cqh; }
.mode-ico svg { width: 100%; height: 100%; overflow: visible; fill: none; stroke: #fff; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 .6cqh 0 rgba(0, 0, 0, .12)); }
.mode-ico .sp { stroke-width: 3; }
.mode-name {
  font-weight: 700; font-size: 24cqh; line-height: .95; letter-spacing: -.01em; white-space: nowrap; color: #fff;
  text-shadow: 0 .7cqh 0 var(--ink), .7cqh 0 0 var(--ink), -.7cqh 0 0 var(--ink), 0 -.7cqh 0 var(--ink),
    .5cqh .5cqh 0 var(--ink), -.5cqh .5cqh 0 var(--ink), .5cqh -.5cqh 0 var(--ink), -.5cqh -.5cqh 0 var(--ink),
    0 1.6cqh 0 var(--ink), 0 2.2cqh 2cqh rgba(0, 0, 0, .25);
}
.mode-sub { font-weight: 600; font-size: 9.4cqh; line-height: 1.1; white-space: nowrap; text-shadow: 0 .4cqh 1.2cqh rgba(0, 0, 0, .3); }
.mode-more {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 2.6cqh; margin-top: .6cqh;
  font-weight: 600; font-size: 7.6cqh; line-height: 1.1; padding: 2.4cqh 4.4cqh; border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 82%, transparent); box-shadow: 0 .8cqh 2cqh rgba(0, 0, 0, .22);
}
.mode-more .chev { font-size: 1.5em; line-height: .6; font-weight: 700; margin-top: -.12em; }
@keyframes modeArt { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035) translateY(-1%); } }
@keyframes modeShine { 0%, 62% { transform: translateX(-70%); } 100% { transform: translateX(70%); } }
@keyframes modeTwinkle { 0%, 100% { opacity: .35; transform: scale(.55) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(20deg); } }
@media (prefers-reduced-motion: reduce) { .mode-art, .mode-spark, .mode-card::before { animation: none !important; } }
.local-sub { margin-top: -8px; }
.install-card { display: flex; gap: 12px; align-items: center; }
.install-card .emo { font-size: 30px; }
/* Partie en ligne à reprendre (hôte) ou à rejoindre (joueur). */
.resume-card { border: 2px solid rgba(255, 255, 255, .55); background: linear-gradient(135deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, .1)); box-shadow: var(--shadow); animation: up .3s ease; }
.resume-card p { margin-top: 2px; }
/* Accueil : emoji | texte | × , puis le bouton sous le texte. */
.panel.resume-card:not(.col) { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.resume-card .emo { font-size: 30px; }
.resume-card .icon-btn { align-self: start; width: 36px; height: 36px; font-size: 18px; }
.resume-card .go { grid-column: 2 / 4; margin-top: 8px; }

/* Accueil : recherche, « On est combien ? », nombre de jeux, tirage au hasard. */
.search-box { position: relative; display: flex; align-items: center; }
.search-box .search-ico { position: absolute; left: 14px; font-size: 16px; pointer-events: none; }
.search-box .input { padding-left: 42px; padding-right: 46px; }
.search-box .input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.search-box .input::placeholder { color: var(--muted); opacity: .85; }
.search-clear { position: absolute; right: 6px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); font-size: 20px; line-height: 1; display: grid; place-items: center; padding: 0; }
.search-box:not(.has-text) .search-clear { display: none; }
.count-row { align-items: center; }
.count-row .count-label { font-weight: 800; font-size: 14px; color: var(--muted); white-space: nowrap; flex: none; }
.chip.chip-n { min-width: 46px; text-align: center; padding: 9px 12px; flex: none; }
.result-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; }
.result-bar .section-title { margin-top: 0; }
.dice-btn { flex: none; }
.empty-find b { font-size: 17px; }
/* Tirage au hasard : les jeux défilent puis s'arrêtent sur l'un d'eux. */
.reel { width: min(100%, 340px); margin: 0 auto; pointer-events: none; }
.reel-face { position: absolute; inset: 0; }
.reel-face.spin { animation: reel-in .09s ease-out; }
.reel-face.land { animation: reel-land .45s cubic-bezier(.2, .9, .3, 1.3); }
.reel .name { position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 1; font-weight: 900; font-size: 20px; line-height: 1.12; text-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.reel-desc { min-height: 3.2em; }
@keyframes reel-in { from { transform: translateY(-38%); opacity: .3; } }
@keyframes reel-land { 0% { transform: translateY(-30%) scale(.92); } 60% { transform: translateY(4%) scale(1.04); } 100% { transform: none; } }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding-top: 8px; }

/* ---------- Barre du haut ---------- */
.topbar { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.topbar h1 { flex: 1; font-size: 20px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .emo { font-size: 24px; }

/* ---------- Modale / toast ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(5, 3, 15, .7); backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center; padding: 16px; padding-bottom: calc(var(--sb) + 16px);
  animation: fade .15s ease;
}
@media (min-width: 560px) { .modal-overlay { align-items: center; } }
.modal {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 24px; width: 100%; max-width: 520px;
  max-height: 88vh; overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px;
  animation: up .2s cubic-bezier(.2, .9, .3, 1.2); box-shadow: var(--shadow);
}
.modal h2 { font-size: 21px; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }
#toasts { position: fixed; left: 0; right: 0; top: calc(var(--st) + 10px); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: rgba(30, 22, 60, .96); border: 1px solid var(--line); padding: 10px 16px; border-radius: 14px;
  font-weight: 600; font-size: 15px; box-shadow: var(--shadow); animation: down .2s ease; max-width: 90vw; pointer-events: auto;
}

.plist { display: flex; flex-wrap: wrap; gap: 8px; }
.pchip { display: inline-flex; align-items: center; gap: 6px; background: var(--card2); border-radius: 999px; padding: 6px 6px 6px 14px; font-weight: 700; }
.pchip .x { border: 0; background: rgba(255, 255, 255, .1); width: 28px; height: 28px; border-radius: 50%; font-size: 16px; line-height: 1; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.toggle-row .lbl { display: flex; flex-direction: column; }
.toggle-row .lbl span { font-size: 13px; color: var(--muted); }
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: rgba(255, 255, 255, .15); border-radius: 999px; transition: background .2s; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(22px); }

/* ---------- Cartes (jeux de questions) ---------- */
.play-area { flex: 1; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.qcard {
  flex: 1; min-height: 300px; border-radius: 28px; padding: 26px 22px; position: relative;
  background: linear-gradient(160deg, var(--g1), var(--g2)); box-shadow: var(--shadow);
  display: flex; flex-direction: column; justify-content: center; gap: 16px; text-align: center; overflow: hidden;
}
.qcard.anim { animation: cardin .32s cubic-bezier(.2, .9, .3, 1.15); }
.qcard .lvl { position: absolute; top: 14px; left: 14px; }
.qcard .count { position: absolute; top: 16px; right: 16px; font-size: 12px; font-weight: 700; opacity: .75; }
.qcard .kicker { font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.qcard .big { font-size: clamp(24px, 6.4vw, 34px); font-weight: 800; line-height: 1.2; text-wrap: balance; }
.qcard .foot { font-size: 14px; opacity: .9; font-weight: 600; }
.qcard .who { font-size: 18px; font-weight: 800; background: rgba(0, 0, 0, .22); border-radius: 999px; padding: 6px 14px; align-self: center; }
.card-stack { position: relative; flex: 1; min-height: 360px; }
.card-stack::before, .card-stack::after {
  content: ''; position: absolute; inset: 10px 6px 0; border-radius: 28px; background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .06); transform: rotate(-3deg); z-index: 0;
}
.card-stack::after { transform: rotate(2.5deg); inset: 6px 10px 4px; background: rgba(255, 255, 255, .04); }
.card-stack .qcard { position: absolute; inset: 0; min-height: 0; z-index: 1; cursor: pointer; -webkit-user-select: none; user-select: none; }
.card-stack .qcard:active { filter: brightness(1.06); }
.qcard.in-first { animation: cardin .35s cubic-bezier(.2, .9, .3, 1.15); }
.qcard.in-next, .qcard.in-prev { animation: risein .42s cubic-bezier(.2, .9, .3, 1.1); }
.qcard.out-next { z-index: 2; pointer-events: none; animation: flyleft .4s cubic-bezier(.5, 0, .9, .5) forwards; }
.qcard.out-prev { z-index: 2; pointer-events: none; animation: flyright .4s cubic-bezier(.5, 0, .9, .5) forwards; }
.card-foot { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.card-foot .btn { flex: none; }
.tap-hint { flex: 1; text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; margin: 0; transition: opacity .4s; }
.tap-hint.gone { opacity: 0; }
.card-nav { display: flex; gap: 10px; }
.card-nav .btn:last-child { flex: 1; }

.tp { display: flex; flex-direction: column; gap: 10px; flex: 1; justify-content: center; }
.tp-opt {
  border: 0; border-radius: 22px; padding: 22px 16px; font-size: clamp(19px, 5.2vw, 25px); font-weight: 800; line-height: 1.2;
  background: rgba(0, 0, 0, .2); color: #fff; transition: transform .15s, background .2s, opacity .2s; min-height: 110px; text-wrap: balance;
}
.tp-opt.sel { background: rgba(255, 255, 255, .95); color: #251a4f; transform: scale(1.02); }
.tp-opt.dim { opacity: .45; }
.tp-or { font-weight: 900; font-size: 18px; opacity: .8; }

/* ---------- Timer ---------- */
.timer { position: relative; height: 12px; background: rgba(255, 255, 255, .1); border-radius: 999px; overflow: hidden; }
.timer > i { position: absolute; inset: 0; transform-origin: left; background: linear-gradient(90deg, var(--ok), var(--warn)); border-radius: 999px; transition: transform .2s linear; }
.timer.low > i { background: var(--bad); }
.timer-num { font-variant-numeric: tabular-nums; font-weight: 900; font-size: 22px; min-width: 2.5ch; text-align: right; }
.timer-num.low { color: var(--bad); animation: pulse .5s ease-in-out infinite alternate; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .09); border-radius: 999px; padding: 6px 12px; font-weight: 800; font-size: 14px; }

/* ---------- Jeux en équipes ---------- */
.team-list { display: flex; flex-direction: column; gap: 10px; }
.team-row { display: flex; gap: 8px; align-items: center; }
.team-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.team-members { font-size: 13px; color: var(--muted); margin: -4px 0 4px 22px; }
.scoreboard { display: flex; flex-direction: column; gap: 8px; }
.score-row { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 14px; padding: 12px 14px; border: 1px solid var(--line); }
.score-row .n { flex: 1; font-weight: 700; }
.score-row .s { font-weight: 900; font-size: 20px; font-variant-numeric: tabular-nums; }
.score-row.lead { border-color: var(--warn); background: linear-gradient(90deg, rgba(255, 176, 32, .18), var(--card)); }
.word-card {
  flex: 1; min-height: 260px; border-radius: 28px; background: #fff; color: #1d1440; padding: 22px;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; text-align: center; box-shadow: var(--shadow);
}
.word-card .w { font-size: clamp(30px, 9vw, 46px); font-weight: 900; line-height: 1.1; text-wrap: balance; }
.word-card .forbid { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 280px; }
.word-card .forbid span { background: #ffe1e6; color: #c21d3b; border-radius: 10px; padding: 6px 10px; font-weight: 800; font-size: 18px; }
.word-card .hint { font-size: 14px; font-weight: 700; color: #7a6aa8; text-transform: uppercase; letter-spacing: .06em; }
.answer-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.answer-btns.three { grid-template-columns: 1fr 1fr 1fr; }
.result-list { display: flex; flex-direction: column; gap: 6px; }
.result-item { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 12px; padding: 10px 12px; border: 0; width: 100%; text-align: left; }
.result-item .t { flex: 1; font-weight: 700; }
.result-item .r { font-size: 20px; }
.result-item.pass { opacity: .55; }
.big-center { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 18px; text-align: center; padding: 10px; }
.big-center h2 { font-size: 30px; }
.countdown-num { font-size: 120px; font-weight: 900; animation: pop .9s ease; }
.hero-emo { font-size: 80px; line-height: 1; }

/* ---------- Dessin ---------- */
.board-wrap { position: relative; width: 100%; border-radius: 18px; overflow: hidden; background: #fff; box-shadow: var(--shadow); aspect-ratio: 4 / 3; flex: none; }
canvas.board { display: block; width: 100%; height: 100%; touch-action: none; background: #fff; }
.board-wrap.locked canvas.board { pointer-events: none; }
.tools { display: flex; flex-direction: column; gap: 8px; }
.tool-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; flex: none; padding: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }
.swatch.on { border-color: #fff; transform: scale(1.12); }
.size-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, .08); display: grid; place-items: center; }
.size-btn.on, .tool-btn.on { background: var(--accent2); }
.size-btn i { display: block; border-radius: 50%; background: #fff; }
.tool-btn { height: 40px; min-width: 40px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, .08); font-size: 18px; padding: 0 10px; }
.word-banner { text-align: center; font-weight: 900; font-size: 22px; letter-spacing: .02em; }
.word-mask { letter-spacing: .28em; font-family: ui-monospace, monospace; font-size: 22px; font-weight: 900; }
.overlay-card {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: rgba(18, 13, 38, .9); color: #fff; padding: 16px; text-align: center; z-index: 2; backdrop-filter: blur(3px);
}
.overlay-card h3 { font-size: 22px; }
.choices { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 320px; }
.chat { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; min-height: 120px; max-height: 34vh; padding: 8px; background: rgba(0, 0, 0, .2); border-radius: 14px; }
.chat .m { font-size: 14px; line-height: 1.3; word-break: break-word; }
.chat .m b { color: #c9b8ff; }
.chat .m.found { color: var(--ok); font-weight: 800; }
.chat .m.close { color: var(--warn); font-weight: 700; }
.chat .m.sys { color: var(--muted); font-style: italic; }
.chat .m.priv { opacity: .75; }
.chat-form { display: flex; gap: 8px; }
.chat-form .input { min-height: 46px; padding: 10px 12px; }
.mini-scores { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.mini-scores::-webkit-scrollbar { display: none; }
.mini-score { flex: none; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; font-size: 13px; font-weight: 700; display: flex; gap: 6px; align-items: center; }
.mini-score.me { border-color: var(--accent2); }
.mini-score.ok { background: rgba(34, 211, 154, .2); border-color: var(--ok); }
.mini-score.off { opacity: .45; }
.mini-score .sc { color: var(--warn); }

/* ---------- En ligne ---------- */
.room-code { font-size: 44px; font-weight: 900; letter-spacing: .2em; text-align: center; font-family: ui-monospace, monospace; }
.qr { background: #fff; border-radius: 16px; padding: 10px; width: 170px; height: 170px; margin: 0 auto; }
.qr svg, .qr img { width: 100%; height: 100%; display: block; }
.lobby-players { display: flex; flex-wrap: wrap; gap: 8px; }
.lp { background: var(--card2); border-radius: 999px; padding: 8px 14px; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.lp.off { opacity: .45; }
.lp .kick { border: 0; background: rgba(255, 255, 255, .12); border-radius: 50%; width: 24px; height: 24px; font-size: 13px; padding: 0; }
/* Salon : jeux en ligne illustrés (même image que l'accueil), 3 par ligne ; le chef choisit, les autres votent. */
.game-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .game-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pick-tile {
  position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 3 / 2; border: 3px solid transparent; border-radius: 16px; padding: 0;
  color: #fff; text-align: left; box-shadow: 0 3px 10px rgba(30, 10, 80, .16); transition: transform .1s ease, opacity .2s ease, border-color .2s ease;
}
.pick-tile:active { transform: scale(.95); }
.pick-tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(20, 5, 40, .42)); pointer-events: none; }
.pick-tile .tile-emo { font-size: 30px; }
.pick-tile .nm { position: absolute; left: 7px; right: 6px; bottom: 5px; z-index: 1; font-weight: 900; font-size: 11.5px; line-height: 1.1; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.pick-tile .badges { position: absolute; top: 5px; left: 5px; z-index: 1; }
.pick-tile .badge { font-size: 9.5px; padding: 1px 6px; }
.pick-tile .vote-badge { position: absolute; top: 4px; right: 4px; z-index: 2; background: #fff; color: #5b2bd6; font-weight: 900; font-size: 11px; border-radius: 999px; padding: 2px 7px; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); animation: pop .35s ease; }
.pick-tile.on { border-color: #fff; box-shadow: 0 0 0 3px var(--accent), 0 6px 16px rgba(30, 10, 80, .3); }
.pick-tile.armed { border-color: #fff; box-shadow: 0 0 0 3px var(--ok), 0 6px 16px rgba(30, 10, 80, .3); }
.pick-tile.few { opacity: .55; }
.pick-tile.few.on { opacity: 1; }
.pick-tile .go { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; text-align: center; padding: 6px; background: rgba(12, 150, 100, .93); color: #fff; font-size: 12px; font-weight: 900; line-height: 1.15; text-shadow: 0 1px 2px rgba(0, 0, 0, .3); animation: fade .2s ease; }
.pick-info { color: var(--muted); font-size: 13.5px; font-weight: 700; }
.vote-strip { align-items: center; }
.lobby-bar { position: sticky; bottom: calc(var(--sb) + 10px); z-index: 5; display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border-radius: 18px; background: var(--bg2); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(20, 5, 50, .35); }
.lobby-bar .lb-name { flex: 1; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-bar .lb-name small { font-weight: 700; color: var(--warn); }
.lobby-bar .btn { flex: none; padding-left: 14px; padding-right: 14px; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-banner.soft { background: var(--card2); color: var(--text); font-weight: 700; }
/* Online : deux grands choix */
.online-choice { border-radius: 24px; padding: 18px; display: flex; flex-direction: column; gap: 14px; color: #fff; box-shadow: var(--shadow); }
.online-choice.create { background: linear-gradient(135deg, var(--ob1, #2a7bff), var(--ob2, #7c5cff)); }
.online-choice.join { background: linear-gradient(135deg, var(--ob2, #7c5cff), var(--ob3, #ff4d8d)); }
.online-choice .oc-head { display: flex; gap: 12px; align-items: center; }
.online-choice .oc-emo { font-size: 40px; line-height: 1; }
.online-choice h2 { font-size: 24px; }
.online-choice p { font-size: 14px; opacity: .92; margin-top: 2px; }
.online-choice .btn { background: rgba(255, 255, 255, .96); color: #2a1a5e; border: 0; }
.online-choice .code-input { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .5); color: #fff; }
.online-choice .code-input::placeholder { color: rgba(255, 255, 255, .7); }
/* TV Mode : écran de départ */
.tvmode-hero { border-radius: 26px; padding: 22px 20px; text-align: center; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 8px; background: linear-gradient(140deg, #7c3aed, #14b8a6); box-shadow: var(--shadow); }
.tvmode-hero .tvmode-emo { font-size: 64px; line-height: 1; animation: pop .6s ease; }
.tvmode-hero h2 { font-size: 26px; }
.tvmode-hero p { opacity: .95; max-width: 34ch; }
.tvmode-go { margin-top: 6px; background: #fff; color: #3b1a7a; border: 0; min-width: 70%; }
.tvmode-steps { margin: 0; padding-left: 34px; display: flex; flex-direction: column; gap: 8px; color: var(--muted); }
.tvmode-steps b { color: var(--text); }
.room-head { display: flex; align-items: center; gap: 10px; }
.room-head .code, .topbar .code { font-family: ui-monospace, monospace; font-weight: 900; letter-spacing: .15em; background: rgba(255, 255, 255, .09); padding: 6px 10px; border-radius: 10px; }
.vote-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.vote-grid.nums { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.vote-grid button { border: 0; border-radius: 14px; background: rgba(0, 0, 0, .22); color: #fff; font-weight: 800; padding: 14px 6px; font-size: 16px; min-height: 52px; }
.vote-grid button.on { background: #fff; color: #251a4f; }
.bar-res { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.bar-res .lbl { display: flex; justify-content: space-between; font-weight: 800; }
.bar-res .bar { height: 14px; background: rgba(0, 0, 0, .25); border-radius: 999px; overflow: hidden; }
.bar-res .bar i { display: block; height: 100%; background: #fff; border-radius: 999px; transition: width .6s ease; }
.bar-res .names { font-size: 13px; opacity: .9; }
.status-line { text-align: center; color: var(--muted); font-weight: 700; font-size: 14px; }
.conn-banner { background: var(--warn); color: #2b1c00; border-radius: 12px; padding: 10px 12px; font-weight: 700; text-align: center; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 10px 0; }
.podium .st { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 30%; }
.podium .blk { width: 100%; border-radius: 14px 14px 4px 4px; display: grid; place-items: center; font-size: 28px; font-weight: 900; background: linear-gradient(180deg, var(--g1), var(--g2)); }
.podium .nm { font-weight: 800; text-align: center; font-size: 14px; word-break: break-word; }
.reveal-word { font-size: 34px; font-weight: 900; background: #fff; color: #1d1440; padding: 10px 18px; border-radius: 16px; }

/* ---------- Plein écran (front, doigt) ---------- */
.fullscreen-game { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; background: var(--bg); }
.front-play { position: fixed; inset: 0; z-index: 30; display: grid; grid-template-columns: 1fr 1fr; background: linear-gradient(150deg, var(--g1), var(--g2)); }
.front-play .zone { border: 0; background: transparent; }
.front-play .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; padding: 20px; text-align: center; gap: 10px; }
.front-play .word { font-size: clamp(36px, 11vmin, 92px); font-weight: 900; line-height: 1.05; text-shadow: 0 4px 16px rgba(0, 0, 0, .25); text-wrap: balance; }
.front-play .t { position: absolute; top: calc(var(--st) + 10px); left: 0; right: 0; text-align: center; font-size: 26px; font-weight: 900; pointer-events: none; }
.front-play .help { position: absolute; bottom: calc(var(--sb) + 10px); left: 0; right: 0; display: flex; justify-content: space-between; padding: 0 18px; font-weight: 800; opacity: .8; pointer-events: none; font-size: 14px; }
.front-play.flash-ok { background: var(--ok); }
.front-play.flash-pass { background: var(--warn); }
.front-play .exit { position: absolute; top: calc(var(--st) + 8px); right: 10px; pointer-events: auto; z-index: 2; }

.touch-zone { position: fixed; inset: 0; z-index: 30; background: var(--bg); touch-action: none; overflow: hidden; }
.touch-zone .hint { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; pointer-events: none; color: var(--muted); font-weight: 700; font-size: 20px; gap: 10px; }
.finger { position: absolute; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; pointer-events: none; transition: transform .25s, opacity .3s; box-shadow: 0 0 0 6px rgba(255, 255, 255, .2), 0 0 40px currentColor; }
.finger.loser { transform: scale(.4); opacity: .15; }
.finger.winner { transform: scale(1.5); animation: pulse .45s ease-in-out infinite alternate; }
.touch-zone .top-ui { position: absolute; top: calc(var(--st) + 10px); left: 10px; right: 10px; display: flex; justify-content: space-between; z-index: 2; }

/* ---------- Roue ---------- */
.wheel-wrap { position: relative; width: min(84vw, 380px); aspect-ratio: 1; margin: 0 auto; }
.wheel-wrap canvas { width: 100%; height: 100%; display: block; transition: transform 4.2s cubic-bezier(.12, .7, .15, 1); }
.wheel-pointer { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); font-size: 36px; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .5)); z-index: 1; }
.wheel-pointer.flap { animation: flap .14s ease-out; }
@keyframes flap { 35% { transform: translateX(-50%) rotate(-24deg); } }
.bt-name.pass { animation: btpass .35s ease-out; }
@keyframes btpass { 0% { background: #fff; color: #1d1440; box-shadow: 0 0 16px rgba(255, 255, 255, .8); } }

/* ---------- Cartes à jouer ---------- */
.playing-card {
  width: min(62vw, 240px); aspect-ratio: 5 / 7; background: #fff; border-radius: 18px; margin: 0 auto; position: relative;
  box-shadow: var(--shadow); color: #1d1440; display: grid; place-items: center;
}
.playing-card.red { color: #d61f45; }
.playing-card .corner { position: absolute; font-weight: 900; font-size: 26px; line-height: 1; text-align: center; }
.playing-card .corner.tl { top: 12px; left: 14px; }
.playing-card .corner.br { bottom: 12px; right: 14px; transform: rotate(180deg); }
.playing-card .mid { font-size: 84px; }
.playing-card.back { background: repeating-linear-gradient(45deg, #ff4d8d 0 12px, #7c5cff 12px 24px); }
.flip { animation: flip .45s ease; }
.anim-late { animation: cardin .4s ease .45s both; }

/* ---------- Loup / rôles ---------- */
.role-card { border-radius: 28px; padding: 26px; text-align: center; background: linear-gradient(160deg, var(--g1), var(--g2)); display: flex; flex-direction: column; gap: 10px; align-items: center; box-shadow: var(--shadow); }
.role-card .emo { font-size: 84px; line-height: 1; }
.role-card h2 { font-size: 30px; }
.secret-btn { min-height: 220px; border-radius: 28px; border: 2px dashed rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .04); font-size: 20px; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px; }
.secret-btn .emo { font-size: 56px; }
/* Carte secrète qu'on retourne (rôle, mot secret) */
.reveal-in { animation: revealIn .5s cubic-bezier(.3, 1.3, .5, 1); }
@keyframes revealIn { from { transform: perspective(900px) rotateY(-95deg) scale(.92); opacity: .3; } to { transform: none; opacity: 1; } }
.plist-sel { display: flex; flex-direction: column; gap: 8px; }
.plist-sel button { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 12px 14px; font-weight: 700; text-align: left; }
.plist-sel button.on { border-color: var(--accent); background: var(--card2); }
.plist-sel button.dead { opacity: .4; text-decoration: line-through; }
.plist-sel .rl { margin-left: auto; font-size: 13px; color: var(--muted); }
.step-card { background: var(--card); border-radius: 20px; padding: 18px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.step-card .say { font-size: 18px; font-weight: 700; font-style: italic; color: #e4dcff; }
.step-num { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Divers ---------- */
.dice-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.die { width: 84px; height: 84px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 12px; gap: 4px; }
.die i { border-radius: 50%; }
.die i.on { background: #1d1440; }
.die.tumble { animation: tumble var(--dur, .6s) cubic-bezier(.25, .7, .4, 1); }
.die.land { animation: dieland .28s ease-out; }
@keyframes tumble { 0% { transform: translateY(-38px) rotate(var(--spin, 300deg)) scale(.75); } 55% { transform: translateY(5px) rotate(calc(var(--spin, 300deg) * .12)) scale(1.04); } 75% { transform: translateY(-7px) rotate(calc(var(--spin, 300deg) * -.03)); } 100% { transform: none; } }
@keyframes dieland { 0% { transform: scale(1.14); } 60% { transform: scale(.97); } 100% { transform: none; } }
.coin { width: 160px; height: 160px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; font-size: 30px; font-weight: 900; background: radial-gradient(circle at 35% 30%, #ffe28a, #e0a40a 70%); color: #6a4800; box-shadow: var(--shadow), inset 0 -6px 0 rgba(0, 0, 0, .15); }
.coin.spin { animation: coin 1s ease; }
.letter-big { font-size: 140px; font-weight: 900; line-height: 1; text-align: center; background: linear-gradient(135deg, #ffd166, #ff4d8d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cat-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cat-list span { background: var(--card); border-radius: 12px; padding: 10px; font-weight: 700; font-size: 14px; border: 1px solid var(--line); }
.bomb { font-size: 130px; line-height: 1; text-align: center; }
.bomb.shake { animation: shake .25s linear infinite; }
.bomb.fast { animation-duration: .12s; }
.flash-bg { animation: flash .6s ease 3; }

@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@keyframes down { from { transform: translateY(-16px); opacity: 0; } }
@keyframes flyleft { 0% { transform: none; opacity: 1; } 75% { opacity: 1; } 100% { transform: translateX(-130%) rotate(-16deg); opacity: 0; } }
@keyframes flyright { 0% { transform: none; opacity: 1; } 75% { opacity: 1; } 100% { transform: translateX(130%) rotate(16deg); opacity: 0; } }
@keyframes risein { from { transform: translateY(22px) scale(.92); filter: brightness(.55); } to { transform: none; filter: none; } }
@keyframes cardin { from { transform: translateY(24px) scale(.96) rotate(-1.5deg); opacity: 0; } }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 40% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
@keyframes flip { 0% { transform: rotateY(90deg); } 100% { transform: rotateY(0); } }
@keyframes roll { 0% { transform: rotate(0) scale(.6); } 60% { transform: rotate(340deg) scale(1.1); } 100% { transform: rotate(360deg) scale(1); } }
@keyframes coin { 0% { transform: rotateY(0); } 100% { transform: rotateY(1800deg); } }
@keyframes shake { 0% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(-4px, 2px) rotate(-4deg); } 50% { transform: translate(3px, -2px) rotate(3deg); } 75% { transform: translate(-2px, -3px) rotate(-2deg); } }
@keyframes flash { 0%, 100% { background-color: var(--bg); } 50% { background-color: var(--bad); } }

@media (prefers-reduced-motion: reduce) {
  #theme-fx { display: none; }
  html[data-anim] body::before { animation: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Jeux de rapidité ---------- */
.emoji-big { font-size: clamp(54px, 16vw, 86px); line-height: 1.15; letter-spacing: .06em; text-align: center; margin-top: 14px; }
.tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 6px; }
.tiles span { width: 40px; height: 48px; border-radius: 10px; background: #fff; color: #1d1440; display: grid; place-items: center; font-weight: 900; font-size: 24px; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); }
.quiz-opts { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt { display: flex; align-items: center; gap: 12px; text-align: left; border: 2px solid var(--line); background: var(--card); border-radius: 16px; padding: 12px 14px; font-weight: 700; font-size: 16px; min-height: 52px; transition: opacity .2s, border-color .2s, background .2s; }
.quiz-opt b { width: 30px; height: 30px; border-radius: 9px; background: rgba(255, 255, 255, .1); display: grid; place-items: center; flex: none; }
.quiz-opt.on { border-color: var(--accent2); background: var(--card2); }
.quiz-opt.dim { opacity: .45; }
.quiz-opt.good { border-color: var(--ok); background: rgba(34, 211, 154, .2); opacity: 1; }
.quiz-opt.bad { border-color: var(--bad); background: rgba(255, 90, 95, .22); opacity: 1; }
.quiz-opt:disabled { color: inherit; }
.calc-big { font-size: clamp(40px, 13vw, 64px); font-weight: 900; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.quiz-opts.vf { display: grid; grid-template-columns: 1fr 1fr; }
.quiz-opts.vf .quiz-opt { justify-content: center; font-size: 20px; min-height: 64px; }
.quiz-opts.vf .quiz-opt b { display: none; }
.answer-reveal { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; background: #fff; color: #1d1440; border-radius: 18px; padding: 14px; box-shadow: var(--shadow); animation: pop .4s ease; }
.answer-reveal b { font-size: 24px; font-weight: 900; line-height: 1.15; }
.answer-reveal .muted { color: #6b5d99; }

/* ---------- Punchlines / Dico bluff ---------- */
.blank { display: inline-block; border-bottom: 3px solid #fff; min-width: 3em; color: transparent; line-height: 1; margin: 0 4px; }
.reveal-opt { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; animation: cardin .35s ease; }
.reveal-opt .txt { font-weight: 800; font-size: 17px; }
.reveal-opt .meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.reveal-opt .meta b { color: var(--text); }
.reveal-opt.real { border-color: var(--ok); background: linear-gradient(135deg, rgba(34, 211, 154, .22), var(--card)); }
.plist-sel button span { text-align: left; }
.pill:empty { display: none; }

/* ---------- Téléphone dessiné ---------- */
.tel-img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; border-radius: 16px; box-shadow: var(--shadow); display: block; }
.tel-step { display: flex; flex-direction: column; gap: 8px; animation: cardin .35s ease; }
.tel-step p { margin: 0; font-weight: 700; color: var(--muted); }
.tel-text { background: #fff; color: #1d1440; border-radius: 16px; padding: 14px; font-weight: 800; font-size: 20px; text-align: center; box-shadow: var(--shadow); }

/* ---------- Bingo ---------- */
.bingo-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.bingo-cell { aspect-ratio: 1; border: 0; border-radius: 10px; background: var(--card); color: var(--text); font-size: clamp(8.5px, 2.35vw, 12px); font-weight: 700; line-height: 1.15; padding: 4px; overflow: hidden; display: flex; align-items: center; justify-content: center; text-align: center; hyphens: auto; word-break: break-word; }
.bingo-cell.on { background: linear-gradient(135deg, #fc466b, #3f5efb); color: #fff; }
.bingo-cell.hl { box-shadow: inset 0 0 0 3px #ffd23f; }
.bingo-cell.free { background: #ffd23f; color: #3a2a00; }
.bingo-cell.stamp { animation: stamp .35s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes stamp { 0% { transform: scale(1.45) rotate(-8deg); opacity: .4; } 100% { transform: none; opacity: 1; } }
.bingo-feed { background: var(--card); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); animation: cardin .35s ease; }
.bingo-feed.full { border-color: #ffd23f; }

/* ---------- Menteur (dés) ---------- */
.die.md { width: 56px; height: 56px; padding: 8px; gap: 3px; border-radius: 13px; }
.die.xs { width: 24px; height: 24px; padding: 3px; gap: 1px; border-radius: 6px; display: inline-grid; vertical-align: middle; margin: 0 3px; box-shadow: none; }
.die.hl { box-shadow: 0 0 0 3px var(--ok), var(--shadow); }
.die.xs.hl { box-shadow: 0 0 0 2px var(--ok); }
.die.dim { opacity: .35; }
.liar-players { display: flex; flex-wrap: wrap; gap: 6px; }
.liar-p { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 6px 10px; display: flex; gap: 8px; align-items: center; font-size: 14px; }
.liar-p.turn { border-color: var(--warn); box-shadow: 0 0 14px rgba(255, 176, 32, .4); }
.liar-p.me b { color: #c9b8ff; }
.liar-p.out { opacity: .4; }
.face-pick { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.face-btn { border: 2px solid transparent; background: rgba(255, 255, 255, .06); border-radius: 12px; padding: 6px; }
.face-btn .die.xs { width: 34px; height: 34px; padding: 5px; margin: 0; }
.face-btn.on { border-color: var(--accent); background: var(--card2); }
.qty { font-size: 34px; min-width: 2ch; text-align: center; font-variant-numeric: tabular-nums; }
.bid-txt { font-weight: 900; white-space: nowrap; }
.liar-roll { display: flex; flex-direction: column; gap: 4px; }

/* ---------- Duel ---------- */
.duel { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; background: var(--bg); }
.duel-half { flex: 1; display: flex; align-items: center; justify-content: center; touch-action: none; transition: background .15s; border-bottom: 3px solid rgba(255, 255, 255, .15); padding: 12px; }
.duel-half.top { transform: rotate(180deg); }
.duel-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; pointer-events: auto; }
.duel-name { font-weight: 800; opacity: .85; }
.duel-msg { font-size: clamp(34px, 11vw, 64px); font-weight: 900; line-height: 1.05; }
.duel-sub { font-size: 14px; opacity: .85; font-weight: 600; max-width: 30ch; }
.duel-close { position: absolute; left: 10px; bottom: calc(var(--sb) + 10px); z-index: 3; width: 38px; height: 38px; font-size: 16px; background: rgba(0, 0, 0, .35); }

/* ---------- La Séquence ---------- */
.seq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: min(86vw, 380px); margin: 0 auto; aspect-ratio: 1; }
.seq-grid.shake { animation: shake .25s linear 2; }
.seq-pad { border: 0; border-radius: 26px; background: var(--c); opacity: .45; transition: opacity .1s, transform .1s, box-shadow .1s; touch-action: none; }
.seq-pad.lit { opacity: 1; transform: scale(1.04); box-shadow: 0 0 34px var(--c); }
.seq-wrap { position: relative; width: min(86vw, 380px); margin: 0 auto; }
.seq-wrap .seq-grid { width: 100%; }
.seq-grid.dim .seq-pad { opacity: .18; }
.seq-count { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font-size: 140px; font-weight: 900; line-height: 1; text-shadow: 0 8px 30px rgba(0, 0, 0, .55); }
.seq-count:empty { display: none; }
.seq-count.pop { animation: pop .9s ease; }

/* ---------- Le Bon Mot ---------- */
.bm-card {
  min-height: 170px; border-radius: 24px; padding: 18px 16px; background: linear-gradient(160deg, var(--g1), var(--g2)); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; color: #fff;
}
.bm-card.shake { animation: shake .25s linear 2; }
.bm-card .kicker { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; opacity: .9; }
.bm-card .sub { font-size: 14px; font-weight: 600; opacity: .92; }
.bm-card .res { font-size: 19px; font-weight: 900; }
.bm-card .res .by { font-weight: 700; opacity: .8; font-size: 15px; }
.bm-card .btn { margin-top: 4px; background: #fff; color: #1d1440; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.bm-tiles { margin-top: 0; }
.bm-tiles span { width: 58px; height: 68px; font-size: 40px; border-radius: 13px; animation: pop .35s ease both; }
.bm-count { font-size: 76px; font-weight: 900; line-height: 1; min-height: 76px; }
.bm-count.pop { animation: pop .9s ease; }
.bm-fail { display: flex; flex-direction: column; gap: 6px; align-items: center; padding-bottom: 10px; margin-bottom: 2px; border-bottom: 1px solid rgba(255, 255, 255, .25); width: 100%; }
.bm-ex { font-size: 15px; background: rgba(0, 0, 0, .18); border-radius: 12px; padding: 6px 12px; }
.bm-form .input { font-size: 20px; font-weight: 800; }
.bm-form .btn { flex: none; }
.bm-form.shake { animation: shake .25s linear 2; }
.bm-input.ok { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(34, 211, 154, .35); }
.bm-msg { min-height: 22px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; text-align: center; font-weight: 700; font-size: 15px; color: var(--muted); }
.bm-msg.bad { color: #ffb3b6; }
.bm-malus { animation: shake .25s linear 2; }
.bm-levelup { background: #ffd23f; color: #3a2a00; font-weight: 900; border-radius: 999px; padding: 6px 14px; animation: pop .5s ease; }
.bm-malus .timer-num { color: var(--bad); }
.bm-pick { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; width: 100%; max-width: 380px; }
.bm-pick button { aspect-ratio: 1; border: 0; border-radius: 11px; background: #fff; color: #1d1440; font-weight: 900; font-size: 20px; padding: 0; box-shadow: 0 3px 0 rgba(0, 0, 0, .22); }
.bm-pick button:active { transform: translateY(2px); box-shadow: none; }
.bm-pick button.rare { background: rgba(255, 255, 255, .7); }
.bm-pick button.rnd { background: #ffd23f; }
.bm-used { display: flex; flex-direction: column; gap: 6px; }
.bm-lives { display: flex; flex-wrap: wrap; gap: 6px; }
.bm-lives:empty { display: none; }
.bm-life { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.bm-life.cur { border-color: #fff; background: var(--card2); }
.bm-life.dead { opacity: .45; text-decoration: line-through; }
.bm-life.off { opacity: .55; font-style: italic; }
.bm-typing { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--card); border: 1px dashed var(--line); border-radius: 16px; padding: 12px; }
.bm-typing b { font-size: 26px; letter-spacing: .03em; min-height: 32px; }
.bm-chain { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bm-chain .arr { color: var(--muted); font-weight: 900; }

/* ---------- Favoris ---------- */
.tile-wrap { position: relative; display: flex; }
.tile-wrap > .tile { flex: 1; width: 100%; }
.fav-btn {
  position: absolute; right: 7px; top: 7px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, .18); color: #fff; font-size: 17px; line-height: 1; display: grid; place-items: center; padding: 0;
}
.fav-btn.on { color: #ffd23f; background: rgba(0, 0, 0, .45); text-shadow: 0 0 10px rgba(255, 210, 63, .7); }
.fav-btn.pop, .fav-top.pop { animation: pop .4s ease; }
.icon-btn.fav-top.on { color: #ffd23f; }
.fav-row { padding-bottom: 2px; }
.mini-tile { flex: none; width: 138px; border-radius: 16px; box-shadow: 0 4px 10px rgba(30, 10, 80, .16); }
.mini-tile:active { transform: scale(.96); }
.mini-tile .tile-emo { font-size: 36px; }
.mini-tile .nm {
  position: absolute; left: 9px; right: 9px; bottom: 7px; z-index: 1;
  font-weight: 900; font-size: 13px; line-height: 1.12; text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}

/* ---------- La Bouteille ---------- */
.bt-ring { position: relative; width: min(86vw, 380px); aspect-ratio: 1; margin: 0 auto; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03) 70%); border: 2px dashed rgba(255, 255, 255, .25); flex: none; }
.bt-name { position: absolute; transform: translate(-50%, -50%); background: var(--card2); border: 2px solid transparent; border-radius: 999px; padding: 5px 11px; font-weight: 800; font-size: 14px; white-space: nowrap; max-width: 34%; overflow: hidden; text-overflow: ellipsis; transition: transform .2s, background .2s; }
.bt-name.cur { border-color: #fff; }
.bt-name.hit { background: #ffd23f; color: #3a2a00; transform: translate(-50%, -50%) scale(1.18); box-shadow: 0 0 22px rgba(255, 210, 63, .8); }
.bt-bottle { position: absolute; left: 50%; top: 50%; width: 22%; height: 62%; transform: translate(-50%, -50%) rotate(0deg); transition: transform 3.6s cubic-bezier(.12, .7, .15, 1); cursor: pointer; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4)); }

/* ---------- Cartes à jouer ---------- */
.pc { position: relative; width: 74px; height: 104px; border-radius: 10px; background: #fff; color: #1d1440; box-shadow: 0 6px 16px rgba(0, 0, 0, .3); flex: none; font-weight: 900; }
.pc.red { color: #d61f3c; }
.pc .tl, .pc .br { position: absolute; font-size: 14px; line-height: 1; text-align: center; }
.pc .tl { top: 6px; left: 7px; }
.pc .br { bottom: 6px; right: 7px; transform: rotate(180deg); }
.pc .mid { position: absolute; inset: 0; display: grid; place-items: center; font-size: 38px; }
.pc.back { background: repeating-linear-gradient(45deg, var(--g1), var(--g1) 6px, var(--g2) 6px, var(--g2) 12px); border: 4px solid #fff; display: grid; place-items: center; color: rgba(255, 255, 255, .6); font-size: 30px; }
.pc.big { width: 120px; height: 168px; border-radius: 14px; }
.pc.big .tl, .pc.big .br { font-size: 22px; }
.pc.big .mid { font-size: 64px; }
.pc.mid-size { width: 70px; height: 98px; }
.pc.mini { width: 34px; height: 48px; border-radius: 6px; box-shadow: none; }
.pc.mini .tl, .pc.mini .br { display: none; }
.pc.mini .mid { font-size: 13px; }
.pc.flip { animation: flip .4s ease; }
.pc.pop-in { animation: pop .35s ease; }
/* Carte qui se retourne en 3D (js/games/paquet.js : flip3) */
.flip3 { display: inline-grid; align-self: center; perspective: 900px; flex: none; }
.flip3-in { display: grid; transform-style: preserve-3d; animation: flip3 .62s cubic-bezier(.3, 1.15, .5, 1) .06s both; }
.flip3-in > * { grid-area: 1 / 1; margin: 0; justify-self: center; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.flip3-in > .f3-front { transform: rotateY(180deg); }
@keyframes flip3 { 0% { transform: translateY(-10px) rotateY(0) scale(1.04); } 100% { transform: rotateY(180deg); } }
.pc.good { box-shadow: 0 0 0 4px var(--ok), 0 6px 16px rgba(0, 0, 0, .3); }
.pc.bad { box-shadow: 0 0 0 4px var(--bad), 0 6px 16px rgba(0, 0, 0, .3); }
.pc.next { outline: 3px dashed #fff; outline-offset: 3px; }
.pc-table { display: flex; justify-content: center; gap: 18px; padding: 8px 0; }
.pc-table.four { gap: 8px; }
.pc-trail { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; min-height: 48px; }
.bus-steps { display: flex; justify-content: center; gap: 8px; }
.bus-step { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: var(--card); border: 2px solid var(--line); }
.bus-step.cur { border-color: #fff; background: var(--card2); }
.bus-step.done { background: var(--ok); color: #05261b; border-color: transparent; }
.answer-btns.four-opts { grid-template-columns: 1fr 1fr; }

/* ---------- Couleurs pièges ---------- */
.stroop-word { text-align: center; font-size: clamp(54px, 17vw, 96px); font-weight: 900; letter-spacing: .02em; padding: 18px 0; text-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.stroop-word.pop { animation: pop .25s ease; }
.stroop-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: 1; max-height: 340px; }
.stroop-btns.six { grid-template-columns: 1fr 1fr 1fr; }
.stroop-btn { border: 0; border-radius: 20px; background: var(--c); min-height: 90px; font-weight: 900; font-size: 18px; touch-action: none; box-shadow: 0 5px 0 rgba(0, 0, 0, .25); }
.stroop-btn:active { transform: translateY(3px); box-shadow: none; }
.stroop-btn.piege span { background: rgba(255, 255, 255, .92); padding: 4px 8px; border-radius: 8px; }
.stroop-btn.wrong { animation: shake .25s linear 2; outline: 4px solid #fff; }

/* ---------- Pendu & Mot mystère ---------- */
.pendu-svg { width: 150px; height: 150px; margin: 0 auto; color: #fff; }
.pendu-svg .new { animation: draw .55s ease-out; }
.pendu-svg.oops { animation: shake .25s linear 2; }
.pendu-word .ltr.pop-in { animation: pop .4s ease; }
.pendu-word { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pendu-word .ltr { width: 30px; height: 40px; border-bottom: 3px solid #fff; display: grid; place-items: end center; font-size: 26px; font-weight: 900; padding-bottom: 2px; }
.pendu-word .ltr.miss { color: #ffb3b6; }
.pendu-word .sp { width: 14px; }
.kb { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.kb-key { min-width: 32px; height: 46px; border: 0; border-radius: 8px; background: var(--card2); font-weight: 900; font-size: 17px; padding: 0 4px; }
.kb-key:disabled { opacity: 1; }
.kb-key.good { background: var(--ok); color: #05261b; }
.kb-key.bad, .kb-key.absent { background: rgba(0, 0, 0, .35); color: rgba(255, 255, 255, .45); }
.kb-key.near { background: #f0b429; color: #2b1c00; }
.kb-key.wide { min-width: 52px; font-size: 14px; }
.kb.done { opacity: .5; pointer-events: none; }
.mm-kb { flex-direction: column; align-items: center; gap: 6px; }
.kb-row { display: flex; gap: 4px; justify-content: center; width: 100%; }
.mm-kb .kb-key { min-width: 0; flex: 1; max-width: 40px; }
.mm-kb .kb-key.wide { max-width: 60px; flex: 1.5; }
.mm-grid { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.mm-row { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 6px; width: min(calc(var(--n) * 58px), 92vw); }
.mm-row.shake { animation: shake .25s linear 2; }
.mm-cell { aspect-ratio: 1; border: 2px solid rgba(255, 255, 255, .25); border-radius: 8px; display: grid; place-items: center; font-size: clamp(20px, 6vw, 28px); font-weight: 900; text-transform: uppercase; }
.mm-cell.filled { border-color: rgba(255, 255, 255, .7); animation: pop .15s ease; }
.mm-cell.flip { animation: flip .35s ease; border-color: transparent; }
.mm-cell.good { background: var(--ok); color: #05261b; }
.mm-cell.near { background: #f0b429; color: #2b1c00; }
.mm-cell.absent { background: rgba(0, 0, 0, .35); }

/* ---------- Morpion & 4 en ligne (js/morpion-vue.js) ---------- */
/* Trait qui se trace (avec pathLength="1" sur un <path>) ; à la fin le trait redevient plein. */
@keyframes draw { from { stroke-dasharray: 1; stroke-dashoffset: 1; } to { stroke-dasharray: 1; stroke-dashoffset: 0; } }
.ttt { position: relative; width: min(84vw, 330px); aspect-ratio: 1; margin: 0 auto; flex: none; border-radius: 26px; background: #fff; box-shadow: 0 10px 26px rgba(30, 10, 80, .22); }
.ttt-grid-wrap, .ttt-line { position: absolute; inset: 0; pointer-events: none; }
.ttt-line { z-index: 2; }
.ttt-grid-wrap svg, .ttt-line svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ttt-grid path { fill: none; stroke: #ddd5f6; stroke-width: 6; stroke-linecap: round; animation: draw .3s ease-out backwards; }
.ttt-grid path:nth-child(2) { animation-delay: .08s; }
.ttt-grid path:nth-child(3) { animation-delay: .16s; }
.ttt-grid path:nth-child(4) { animation-delay: .24s; }
.ttt-cells { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.ttt-c { border: 0; background: transparent; padding: 16%; display: grid; place-items: center; border-radius: 22px; color: inherit; transition: background .15s; }
.ttt.mine .ttt-c:not(.on):active { background: rgba(124, 92, 255, .1); }
.ttt-c svg { width: 100%; height: 100%; display: block; overflow: visible; transition: opacity .35s, transform .25s; }
.mk path { fill: none; stroke-width: 11; stroke-linecap: round; }
.mk.x path { stroke: #ff3b6b; }
.mk.o path { stroke: #2f7bff; }
.mk.draw path { animation: draw .2s ease-out backwards; }
.mk.draw.x path:nth-child(2) { animation-delay: .16s; }
.mk.draw.o path { animation-duration: .36s; }
.ttt.over .ttt-c:not(.win) svg { opacity: .3; }
.ttt-c.win svg { animation: pulse .45s ease-in-out .35s 4 alternate; }
.ttt-c.erase svg { opacity: 0; transform: scale(.5) rotate(-12deg); }
.ttt-line path { fill: none; stroke: #ffc21a; stroke-width: 12; stroke-linecap: round; animation: draw .4s .12s ease-out backwards; }

.c4 { position: relative; width: min(94vw, 430px); margin: 0 auto; flex: none; isolation: isolate; -webkit-user-select: none; user-select: none; }
.c4-board { position: absolute; left: 0; right: 0; }
.c4-discs { position: absolute; inset: 0; z-index: 1; }
.c4-face-wrap { position: absolute; inset: 0; z-index: 2; pointer-events: none; filter: drop-shadow(0 10px 12px rgba(20, 16, 90, .3)); }
.c4-face-wrap svg, .c4-line svg { width: 100%; height: 100%; display: block; }
.c4-line { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.c4-line svg { filter: drop-shadow(0 0 5px rgba(255, 255, 255, .9)); overflow: visible; }
.c4-line path { fill: none; stroke: #fff; stroke-width: 13; stroke-linecap: round; animation: draw .45s .1s ease-out backwards; }
.c4-disc { position: absolute; aspect-ratio: 1; border-radius: 50%; }
.c4-disc.p0 {
  background: radial-gradient(circle, transparent 49%, rgba(110, 0, 20, .3) 51%, transparent 54%, rgba(255, 255, 255, .28) 57%, transparent 60%),
    radial-gradient(circle at 34% 28%, #ff9da7, #ff3048 36%, #d3192f 70%, #a10e21);
  box-shadow: inset 0 -3px 5px rgba(80, 0, 12, .35), inset 0 2px 3px rgba(255, 255, 255, .45);
}
.c4-disc.p1 {
  background: radial-gradient(circle, transparent 49%, rgba(130, 80, 0, .3) 51%, transparent 54%, rgba(255, 255, 255, .4) 57%, transparent 60%),
    radial-gradient(circle at 34% 28%, #fff7c8, #ffd61f 38%, #f1b500 72%, #c68b00);
  box-shadow: inset 0 -3px 5px rgba(110, 66, 0, .35), inset 0 2px 3px rgba(255, 255, 255, .6);
}
.c4-disc.win { animation: c4win .5s ease-in-out infinite alternate; }
.c4-disc.dim { filter: saturate(.5) brightness(.8); transition: filter .4s; }
@keyframes c4win { to { filter: brightness(1.3); } }
.c4-held, .c4-hand { position: absolute; aspect-ratio: 1; transition-property: left, top; transition-timing-function: cubic-bezier(.3, .7, .4, 1); }
.c4-held { z-index: 1; }
.c4-held.gone { visibility: hidden; }
.c4-hand { z-index: 3; pointer-events: none; }
.c4-hand img { position: absolute; width: 232%; max-width: none; left: -106%; top: -79%; transform-origin: 45% 60%; transition: transform .22s cubic-bezier(.3, .7, .4, 1), opacity .3s; filter: drop-shadow(0 8px 10px rgba(30, 10, 80, .3)); }
.c4-hand.release img { transform: translate(-6%, -22%) rotate(-14deg); }
.c4-hand.away img { opacity: 0; transform: translateY(-45%) rotate(-10deg); }
.c4-feet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 0; }
.c4-feet i { position: absolute; top: 0; bottom: 6%; width: 12%; border-radius: 6px 6px 12px 12px; background: linear-gradient(90deg, #1a3bb0, #3a66f0 45%, #1d42c2); box-shadow: 0 4px 6px rgba(20, 16, 90, .3); }
.c4-feet i:first-child { left: 4%; transform: skewX(-10deg); }
.c4-feet i:last-child { right: 4%; transform: skewX(10deg); }
.c4-feet::after { content: ''; position: absolute; left: 2%; right: 2%; bottom: 0; height: 22%; border-radius: 50%; background: radial-gradient(closest-side, rgba(20, 10, 70, .32), transparent); z-index: -1; }
.c4-cols { position: absolute; left: 0; right: 0; top: 0; z-index: 4; display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 calc(30 / 760 * 100%); touch-action: pan-y; }
.c4-col { border: 0; background: transparent; padding: 0; border-radius: 12px; }
.c4-col:focus-visible { outline: 3px solid #ffd23f; outline-offset: -3px; }
.c4.mine .c4-cols { cursor: pointer; }

/* ---------- Jeux en ligne (nouveaux) ---------- */
.debate-sides { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.debate-sides .side { background: rgba(0, 0, 0, .2); border-radius: 999px; padding: 5px 12px; font-weight: 800; font-size: 14px; opacity: .75; }
.debate-sides .side.on { opacity: 1; background: #fff; color: #1d1440; }
.reveal-opt { border: 1px solid var(--line); }
.reveal-opt.mine { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.reveal-opt.lie { border-color: var(--bad); background: linear-gradient(135deg, rgba(255, 90, 95, .3), var(--card)); }
.reveal-opt.truth { opacity: .7; }
.reflex-zone { width: 100%; min-height: 50vh; border: 0; border-radius: 28px; display: grid; place-items: center; touch-action: none; transition: background .08s; }
.reflex-zone.wait { background: #c62839; }
.reflex-zone.go { background: #1fd17a; }
.reflex-zone.early { background: #5a2a3a; }
.reflex-zone.done { background: var(--card2); }
.reflex-txt { font-size: clamp(28px, 9vw, 44px); font-weight: 900; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.pb-form .field { gap: 4px; }
.pb-cat { gap: 6px; padding: 12px; }
.pb-ans { display: flex; gap: 8px; align-items: center; border: 0; border-radius: 10px; padding: 8px 10px; text-align: left; background: rgba(255, 255, 255, .08); color: inherit; font-size: 14px; }
.pb-ans .n { font-weight: 800; min-width: 64px; opacity: .85; }
.pb-ans .t { flex: 1; font-weight: 700; }
.pb-ans .s { font-weight: 900; }
.pb-ans.uniq { background: rgba(34, 211, 154, .25); }
.pb-ans.shared { background: rgba(240, 180, 41, .25); }
.pb-ans.bad { opacity: .6; text-decoration: line-through; }
.mm-others { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.mm-other { display: flex; align-items: center; gap: 6px; background: var(--card); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 700; }
.mm-other.won { background: rgba(34, 211, 154, .3); }
.mm-other .dots { display: flex; gap: 2px; }
.mm-other .dots i { width: 9px; height: 9px; border-radius: 2px; background: rgba(0, 0, 0, .35); }
.mm-other .dots i.good { background: var(--ok); }
.mm-other .dots i.near { background: #f0b429; }
.eq-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.eq-team { background: var(--card); border: 2px solid transparent; border-radius: 14px; padding: 8px 10px; }
.eq-team.cur { border-color: var(--c); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 50%, transparent); }
.eq-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 14px; }
.eq-score { font-weight: 900; font-size: 22px; color: var(--c); }
.eq-mem { font-size: 12px; color: var(--muted); }
.loup-secret { border: 0; color: #fff; cursor: pointer; }
.loup-secret.hidden-role { --g1: #2b2d6e; --g2: #121236; }

/* ---------- Jeux d'ambiance (lot 3) ---------- */
.sort-wrap { display: flex; flex-direction: column; gap: 6px; }
.sort-edge { font-size: 13px; font-weight: 800; color: var(--muted); text-align: center; }
.sort-list { display: flex; flex-direction: column; gap: 8px; }
.sort-item {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 10px 12px 10px 10px;
  background: #fff; color: #1d1440; border-radius: 16px; font-weight: 800; line-height: 1.2;
  box-shadow: 0 3px 0 rgba(29, 20, 64, .08), 0 6px 14px rgba(30, 10, 80, .12);
  touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none;
  transition: transform .22s cubic-bezier(.2, .8, .3, 1), box-shadow .2s, background-color .35s;
}
.sort-item:focus-visible { outline: 3px solid #ffd23f; outline-offset: 2px; }
.sort-item .rk { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #fff; background: linear-gradient(135deg, var(--g1), var(--g2)); transition: background .35s; }
.sort-item .t { flex: 1; }
.sort-item .yr { font-size: 14px; font-weight: 900; color: #6b5d99; text-align: right; opacity: 0; transform: translateX(8px); transition: opacity .35s, transform .35s; }
.sort-item .yr.show { opacity: 1; transform: none; }
.sort-item .yr:empty { display: none; }
.sort-item .grip { width: 14px; height: 22px; flex: none; opacity: .45; background: radial-gradient(circle, #6b5d99 1.7px, transparent 2.2px) 0 0 / 7px 7.4px; }
.sort-item.drag { z-index: 5; cursor: grabbing; transition: box-shadow .2s; box-shadow: 0 18px 34px rgba(30, 10, 80, .35); }
.sort-item.settling { z-index: 4; transition: transform .2s cubic-bezier(.2, .8, .3, 1.15), box-shadow .2s; }
.sort-item.moving { z-index: 3; box-shadow: 0 14px 26px rgba(30, 10, 80, .28); }
.sort-wrap.locked .sort-item { cursor: default; }
.sort-wrap.locked .grip { display: none; }
.sort-item.good { background: #dcfbef; box-shadow: 0 0 0 3px var(--ok), 0 6px 14px rgba(30, 10, 80, .12); }
.sort-item.bad { background: #ffe3e4; box-shadow: 0 0 0 3px var(--bad), 0 6px 14px rgba(30, 10, 80, .12); }
.sort-item.good .rk { background: var(--ok); }
.sort-item.bad .rk { background: var(--bad); }
.scale { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.scale-bar { position: relative; height: 34px; border-radius: 999px; background: linear-gradient(90deg, #2ec5ff, #b07cff 50%, #ff4d6d); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .25); }
.scale-target { position: absolute; top: -4px; bottom: -4px; width: 36px; transform: translateX(-50%); border-radius: 10px; background: rgba(255, 255, 255, .35); border: 3px solid #ffd23f; box-shadow: 0 0 16px rgba(255, 210, 63, .8); }
.scale-mark { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.scale-mark.me { width: 20px; height: 20px; background: #1d1440; border: 3px solid #fff; }
.scale-mark span { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 800; white-space: nowrap; }
.scale-labels { display: flex; justify-content: space-between; gap: 12px; font-weight: 800; font-size: 14px; }
.scale-labels span:last-child { text-align: right; }
.scale-bar.with-marks { margin-bottom: 20px; }
.scale-range { width: 100%; accent-color: #ffd23f; height: 34px; }
/* Curseur posé directement sur l'échelle */
.scale-bar.with-input { margin: 12px 0; }
.scale-bar .scale-range { position: absolute; left: -2px; right: -2px; top: -12px; width: calc(100% + 4px); height: 58px; margin: 0; padding: 0; background: transparent; -webkit-appearance: none; appearance: none; touch-action: none; cursor: grab; }
.scale-bar .scale-range:focus-visible { outline: 3px solid #ffd23f; outline-offset: 2px; border-radius: 14px; }
.scale-bar .scale-range::-webkit-slider-runnable-track { height: 58px; background: transparent; border: 0; }
.scale-bar .scale-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 30px; height: 50px; margin-top: 4px; border-radius: 12px; background: #fff; border: 4px solid #1d1440; box-shadow: 0 6px 14px rgba(20, 10, 60, .4); }
.scale-bar .scale-range:active::-webkit-slider-thumb { transform: scale(1.1); }
.scale-bar .scale-range::-moz-range-track { height: 58px; background: transparent; border: 0; }
.scale-bar .scale-range::-moz-range-thumb { width: 22px; height: 42px; border-radius: 12px; background: #fff; border: 4px solid #1d1440; box-shadow: 0 6px 14px rgba(20, 10, 60, .4); }
.scale-bar.with-marks .scale-target { animation: pop .45s ease; }
.scale-bar.with-marks .scale-mark { animation: markdrop .45s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes markdrop { from { transform: translate(-50%, -260%); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } }
.qsj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.qsj-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.qsj-card .nm { font-size: 13px; color: var(--muted); font-weight: 700; }
.qsj-card .w { font-weight: 900; font-size: 17px; }
.qsj-card.me { border-color: #ffd23f; }
.qsj-card.found { background: rgba(34, 211, 154, .2); }
.chi-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.chi-btn { border: 2px solid transparent; border-radius: 20px; background: var(--card2); padding: 16px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 800; color: inherit; }
.chi-btn .e { font-size: 48px; line-height: 1; }
.chi-btn.on { border-color: #fff; background: rgba(255, 255, 255, .25); transform: scale(1.04); }
.chi-btns.wait { opacity: .55; pointer-events: none; transition: opacity .2s; }
.chi-arena { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; padding: 16px 8px 12px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); min-height: 150px; }
.chi-side { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.chi-side small { font-weight: 800; font-size: 13px; color: var(--muted); max-width: 100%; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chi-hand { font-size: 66px; line-height: 1; display: inline-block; transform-origin: 50% 85%; transition: transform .3s, filter .3s, opacity .3s; }
.chi-hand.bot { transform: scaleX(-1); }
.chi-word { font-size: 24px; font-weight: 900; min-width: 2.8em; text-align: center; }
.chi-arena.pump .chi-hand { animation: chipump .32s ease-in-out; }
.chi-arena.pump .chi-hand.bot { animation-name: chipumpb; }
.chi-arena.pump .chi-word { animation: pop .3s ease; }
@keyframes chipump { 45% { transform: translateY(-24px) rotate(-14deg); } }
@keyframes chipumpb { 0%, 100% { transform: scaleX(-1); } 45% { transform: scaleX(-1) translateY(-24px) rotate(-14deg); } }
.chi-arena.done .chi-hand { animation: pop .35s ease; }
.chi-arena.done .chi-hand.bot { animation: chipopb .35s ease; }
@keyframes chipopb { 0% { transform: scaleX(-1) scale(.3); opacity: 0; } 40% { transform: scaleX(-1) scale(1.15); opacity: 1; } 100% { transform: scaleX(-1); } }
.chi-arena.lw .chi-side:first-child .chi-hand { transform: scale(1.18); filter: drop-shadow(0 0 14px #ffd23f); }
.chi-arena.rw .chi-side:last-child .chi-hand { transform: scaleX(-1) scale(1.18); filter: drop-shadow(0 0 14px #ffd23f); }
.chi-arena.lw .chi-side:last-child .chi-hand, .chi-arena.rw .chi-side:first-child .chi-hand { opacity: .45; filter: grayscale(.7); }
.chi-scores .score-row { animation: cardin .35s ease both; }
.chi-scores .score-row:nth-child(2) { animation-delay: .07s; }
.chi-scores .score-row:nth-child(3) { animation-delay: .14s; }
.chi-scores .score-row:nth-child(n + 4) { animation-delay: .21s; }

/* ---------- Plateau : Bataille navale, Memory, Yam's ---------- */
.bn-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; width: min(92vw, 380px); margin: 0 auto; padding: 6px; border-radius: 14px; background: #0d4d8c; }
.bn-grid.small { width: min(60vw, 230px); gap: 2px; padding: 4px; }
.bn-cell { aspect-ratio: 1; border: 0; border-radius: 4px; background: #1f6fbf; padding: 0; font-size: clamp(11px, 3.4vw, 17px); color: #fff; display: grid; place-items: center; }
.bn-cell:not(:disabled):active { background: #ffd23f; }
.bn-cell.ship { background: #7b8794; }
.bn-cell.miss { background: #164f8a; color: rgba(255, 255, 255, .7); }
.bn-cell.hit { background: #ff8a1f; }
.bn-cell.sunk { background: #c62839; }
.bn-cell:disabled { opacity: 1; }
.bn-cell { position: relative; }
.bn-cell > span { display: block; line-height: 1; }
/* Dernier tir : gerbe d'eau (raté), explosion (touché, coulé) */
.bn-cell.fx-miss { animation: bnsplash .6s ease-out; }
.bn-cell.fx-miss::before, .bn-cell.fx-miss::after { content: ''; position: absolute; inset: 18%; border-radius: 50%; border: 2px solid #c8ecff; opacity: 0; animation: bnring .8s ease-out forwards; pointer-events: none; }
.bn-cell.fx-miss::after { animation-delay: .18s; }
.bn-cell.fx-hit, .bn-cell.fx-sunk { z-index: 2; animation: bnboom .55s ease-out; }
.bn-cell.fx-hit > span, .bn-cell.fx-sunk > span { animation: pop .5s ease; }
.bn-grid.fx-shake { animation: shake .22s linear 2; }
@keyframes bnsplash { 0% { background: #e6f7ff; transform: scale(.85); } 100% { transform: none; } }
@keyframes bnring { 0% { transform: scale(.2); opacity: 1; } 100% { transform: scale(2.3); opacity: 0; } }
@keyframes bnboom { 0% { background: #fff4a8; transform: scale(.5); box-shadow: 0 0 0 0 rgba(255, 170, 0, .9); } 35% { background: #ffb020; transform: scale(1.4); box-shadow: 0 0 24px 10px rgba(255, 110, 0, .65); } 100% { transform: none; box-shadow: none; } }
.mem-grid { display: grid; gap: 6px; width: min(94vw, 460px); margin: 0 auto; }
.mc { aspect-ratio: 3 / 4; border: 0; padding: 0; background: transparent; perspective: 700px; color: #1d1440; }
.mc:disabled { opacity: 1; }
.mc-in { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.3, 1.35, .5, 1); }
.mc.up .mc-in { transform: rotateY(180deg); }
.mc-face { position: absolute; inset: 0; border-radius: 12px; display: grid; place-items: center; -webkit-backface-visibility: hidden; backface-visibility: hidden; box-shadow: 0 3px 0 rgba(0, 0, 0, .2), 0 6px 12px rgba(30, 10, 80, .15); }
.mc-back { background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .35) 0 14%, transparent 15%), repeating-linear-gradient(45deg, rgba(255, 255, 255, .12) 0 6px, transparent 6px 12px), linear-gradient(135deg, var(--g1), var(--g2)); border: 3px solid rgba(255, 255, 255, .85); }
.mc-front { background: #fff; transform: rotateY(180deg); font-size: clamp(22px, 7vw, 36px); }
.mem-grid.mine .mc:not(.up):active .mc-in { transform: scale(.94); }
.mc.done .mc-front { background: #e3fbf1; box-shadow: 0 0 0 3px var(--ok), 0 6px 12px rgba(30, 10, 80, .15); }
.mc.done { animation: mcpair .5s ease .35s; }
.mc.miss { animation: shake .25s linear .45s 2; }
@keyframes mcpair { 40% { transform: scale(1.14) rotate(-3deg); } 100% { transform: none; } }
.ys-dice { gap: 8px; }
.ys-die { border: 0; background: transparent; padding: 0; }
.ys-die.held { transform: translateY(-6px); }
.ys-wrap { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
.ys { width: 100%; border-collapse: collapse; font-size: 14px; }
.ys th, .ys td { padding: 5px 6px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ys th { font-size: 13px; color: var(--muted); }
.ys th.cur { color: #fff; }
.ys td.cat { text-align: left; font-weight: 700; }
.ys td.cur { background: rgba(255, 255, 255, .08); }
.ys td.val { font-weight: 800; }
.ys tr.tot td { font-weight: 900; color: var(--muted); }
.ys tr.tot.big td { color: #fff; font-size: 16px; border-bottom: 0; }
.ys-pick { border: 0; border-radius: 8px; background: #ffd23f; color: #3a2a00; font-weight: 900; min-width: 38px; padding: 4px 6px; }
.ys-pick.zero { background: rgba(255, 255, 255, .2); color: #fff; }

/* Qui commence ? en ligne : gros bouton à garder appuyé */
.hold-pad { width: min(68vw, 250px); aspect-ratio: 1; margin: 4px auto; border-radius: 50%; border: 4px dashed rgba(255, 255, 255, .45); background: var(--card); color: var(--text); display: grid; place-items: center; font-size: 20px; font-weight: 900; text-align: center; padding: 22px; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: transform .15s, background .15s, box-shadow .15s; }
.hold-pad.on { border-style: solid; border-color: #fff; background: linear-gradient(135deg, var(--g1), var(--g2)); transform: scale(1.05); box-shadow: 0 0 40px var(--g1); }
.hold-pad.win { border-style: solid; border-color: #ffd23f; background: #ffd23f; color: #3a2a00; animation: pulse .45s ease-in-out infinite alternate; }
.hold-pad.lose { opacity: .35; }
.hold-pad .n { font-size: 72px; line-height: 1; }

/* Salon : jeu touché une fois, un 2e appui le lance */
.game-pick button.armed { border-color: var(--ok); box-shadow: 0 0 0 3px rgba(34, 211, 154, .25); }
.game-pick .go { font-size: 12px; font-weight: 800; color: var(--ok); }

/* ---------- Écran télé (js/online/tv.js) : grand écran en paysage, tout est en em pour grandir avec l'écran ---------- */
body.tv-mode .screen { max-width: none; padding: 0; gap: 0; }
body.tv-mode .screen > .conn-banner { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 40; font-size: clamp(15px, 1.3vw, 28px); }
.tv { box-sizing: border-box; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 1em; height: 100vh; height: 100dvh; padding: 1em 1.5em 1.2em; font-size: clamp(15px, 1.3vw, 30px); overflow: hidden; }
.tv-head { display: flex; align-items: center; gap: 1.2em; }
.tv-head .logo { font-size: 1.9em; }
.tv-title { flex: 1; text-align: center; font-size: 1.7em; font-weight: 900; }
.tv-join { display: flex; align-items: center; gap: .8em; background: var(--card); border: 1px solid var(--line); border-radius: 1em; padding: .4em .45em .4em 1em; box-shadow: var(--shadow); }
.tv-join-txt { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; }
.tv-join-txt span { font-size: .8em; font-weight: 700; color: var(--muted); }
.tv-code { font-size: 2em; font-weight: 900; letter-spacing: .14em; }
.tv-qr, .tv-bigqr { background: #fff; border-radius: .5em; padding: .25em; flex: none; }
.tv-qr { width: 4.2em; height: 4.2em; }
.tv-qr svg, .tv-bigqr svg { width: 100%; height: 100%; display: block; }
.tv-fs { width: 2.2em; height: 2.2em; font-size: 1em; }
.tv-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(11em, 17em); gap: 1.3em; min-height: 0; }
.tv-stage { min-height: 0; display: flex; flex-direction: column; gap: 1em; }
.tv-side { background: var(--card); border: 1px solid var(--line); border-radius: 1.2em; padding: .9em; overflow: auto; display: flex; flex-direction: column; gap: .6em; box-shadow: var(--shadow); }
.tv-side .section-title { font-size: .85em; margin: 0; }
.tv-board { display: flex; flex-direction: column; gap: .4em; }
.tv-row { display: flex; align-items: center; gap: .55em; padding: .45em .6em; border-radius: .7em; background: rgba(255, 255, 255, .08); font-weight: 800; }
.tv-row.off { opacity: .45; }
.tv-row .rk { width: 1.4em; text-align: center; color: var(--muted); flex: none; }
.tv-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-row .sc { font-variant-numeric: tabular-nums; font-size: 1.1em; }
.tv-row .gain { color: var(--ok); font-size: .85em; animation: pop .6s ease; }
/* Salon : on invite à rejoindre */
.tv-invite { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2em; align-items: center; border-radius: 1.5em; padding: 1.8em 2em; color: #fff; background: linear-gradient(135deg, var(--ob1, #2a7bff), var(--ob2, #7c5cff) 55%, var(--ob3, #ff4d8d)); box-shadow: var(--shadow); }
.tv-invite h1 { font-size: 2.6em; }
.tv-invite p { font-size: 1.15em; margin: .5em 0 .3em; opacity: .95; }
.tv-bigcode { font-size: 5.5em; font-weight: 900; letter-spacing: .16em; line-height: 1; }
.tv-bigqr { width: 12em; height: 12em; padding: .5em; border-radius: 1em; }
.tv-next { display: flex; gap: .7em; align-items: baseline; justify-content: center; flex-wrap: wrap; font-size: 1.35em; }
.tv-bubbles { display: flex; flex-wrap: wrap; gap: .6em; justify-content: center; }
.tv-bubble { background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: .45em 1.1em; font-weight: 900; font-size: 1.35em; }
.tv-bubble.pop-in { animation: pop .55s cubic-bezier(.2, .9, .3, 1.3); }
.tv-bubble.off { opacity: .45; }
/* Écran commun */
.tv-generic { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .5em; }
.tv-hero { font-size: 6.5em; line-height: 1; animation: pop .6s ease; }
.tv-generic h1, .tv-stage h1 { font-size: 2.8em; }
.tv-sub { font-size: 1.35em; color: var(--muted); }
.tv-phones { font-size: 1.6em; font-weight: 800; margin-top: .8em; animation: pulse 1.6s ease-in-out infinite alternate; }
.tv-podium { width: min(100%, 26em); zoom: 1.4; }
.tv-podium .scoreboard { display: none; } /* le classement complet est déjà à droite */
/* Éléments communs des écrans spéciaux */
.tv-bar { display: flex; align-items: center; gap: .8em; }
.tv-bar .pill { font-size: 1.1em; padding: .35em .9em; }
.tv-timer { width: 2.6em; height: 2.6em; border-radius: 50%; display: grid; place-items: center; font-size: 1.7em; font-weight: 900; background: var(--card2); border: .12em solid rgba(255, 255, 255, .55); font-variant-numeric: tabular-nums; flex: none; }
.tv-timer.low { background: var(--bad); border-color: #fff; animation: pulse .5s ease infinite alternate; }
.tv-who { display: flex; flex-wrap: wrap; gap: .5em; justify-content: center; }
.tv-chip { padding: .3em .9em; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 2px solid var(--line); font-weight: 800; transition: background .3s, color .3s; }
.tv-chip.done { background: var(--ok); color: #053b2a; border-color: transparent; animation: pop .4s ease; }
.tv-card { position: relative; border-radius: 1.4em; padding: 1.4em 1.8em; color: #fff; text-align: center; background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: var(--shadow); animation: cardin .4s cubic-bezier(.2, .9, .3, 1.15); }
.tv-card .kicker { font-size: .95em; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.tv-card .q { font-size: 2.3em; font-weight: 900; line-height: 1.15; text-wrap: balance; margin-top: .25em; }
.tv-quote { background: #fff; color: #1d1440; border-radius: 1.2em; padding: .9em 1.2em; font-size: 2.1em; font-weight: 900; text-align: center; box-shadow: var(--shadow); text-wrap: balance; animation: pop .45s ease; }
.tv-status { text-align: center; font-size: 1.2em; font-weight: 800; color: var(--muted); }
/* Quiz et jeux de rapidité */
.tv-opts { display: grid; grid-template-columns: 1fr 1fr; gap: .8em; }
.tv-opt { display: flex; align-items: center; gap: .7em; border-radius: 1em; padding: .7em 1em; font-size: 1.5em; font-weight: 900; color: #fff; min-height: 2.6em; box-shadow: 0 .2em 0 rgba(0, 0, 0, .2); transition: opacity .35s, transform .35s, filter .35s; }
.tv-opt b { width: 1.6em; height: 1.6em; border-radius: .4em; background: rgba(0, 0, 0, .2); display: grid; place-items: center; flex: none; }
.tv-opt .t { flex: 1; }
.tv-opt .who { font-size: .55em; font-weight: 800; opacity: .95; text-align: right; }
.tv-opt.c0 { background: #e2445c; } .tv-opt.c1 { background: #2a7bff; } .tv-opt.c2 { background: #f5a524; } .tv-opt.c3 { background: #1fb57a; }
.tv-opt.dim { opacity: .3; filter: grayscale(.6); transform: scale(.97); }
.tv-opt.good { outline: .18em solid #fff; transform: scale(1.03); }
.tv-answer { display: flex; flex-direction: column; align-items: center; gap: .2em; background: #fff; color: #1d1440; border-radius: 1.2em; padding: .8em 1.2em; text-align: center; box-shadow: var(--shadow); animation: pop .45s ease; }
.tv-answer b { font-size: 2.2em; font-weight: 900; line-height: 1.1; }
.tv-answer span { color: #6b5d99; font-weight: 700; }
.tv-results { display: flex; flex-wrap: wrap; gap: .5em; justify-content: center; }
.tv-res { padding: .35em .9em; border-radius: 999px; font-weight: 800; background: rgba(255, 255, 255, .1); }
.tv-res.ok { background: var(--ok); color: #053b2a; }
.tv-stage .emoji-big { font-size: 5em; margin-top: .1em; }
.tv-stage .tiles span { width: 1.9em; height: 2.3em; font-size: 1.6em; border-radius: .35em; }
.tv-stage .calc-big { font-size: 4.5em; }
/* Je dessine, tu devines */
.tv-draw { display: grid; grid-template-columns: minmax(0, 1fr) minmax(10em, 15em); gap: 1em; min-height: 0; flex: 1; }
.tv-draw .board-wrap { width: auto; height: 100%; max-height: 100%; max-width: 100%; margin: 0 auto; aspect-ratio: 4 / 3; align-self: center; }
.tv-draw .overlay-card { font-size: 1.3em; }
.tv-draw .chat { max-height: none; min-height: 0; font-size: 1.05em; }
.tv-draw .chat .m { font-size: 1em; }
.tv-word { text-align: center; font-size: 2.1em; font-weight: 900; letter-spacing: .02em; }
.tv-word .word-mask { font-size: 1em; letter-spacing: .3em; }
/* Punchlines, Dico bluff, Qui a écrit ça ? */
.tv-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(14em, 1fr)); gap: .8em; }
.tv-option { background: #fff; color: #1d1440; border-radius: 1em; padding: .8em 1em; font-size: 1.35em; font-weight: 800; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .35em; animation: pop .45s ease backwards; }
.tv-option .n { font-size: .7em; color: #6b5d99; font-weight: 900; }
.tv-option .by { font-size: .72em; color: #6b5d99; font-weight: 800; }
.tv-option .votes { display: flex; flex-wrap: wrap; gap: .3em; }
.tv-option .votes span { font-size: .62em; background: #ece6ff; border-radius: 999px; padding: .15em .6em; }
.tv-option.real { outline: .2em solid var(--ok); }
.tv-option.top { outline: .2em solid var(--warn); }
.tv-author { text-align: center; font-size: 2.2em; font-weight: 900; animation: pop .5s ease; }
/* Loup-garou : le script du meneur en grand, nuit / jour */
.tv-loup { flex: 1; display: flex; flex-direction: column; gap: 1.2em; justify-content: center; border-radius: 1.5em; padding: 1.5em; transition: background 1.2s ease; background: linear-gradient(160deg, #18163d, #3b2a7a); }
.tv-loup.day { background: linear-gradient(160deg, #ff9a3c, #ffd36b 60%, #8fd3ff); color: #2b1c00; }
.tv-loup .script { font-size: 2.6em; font-weight: 900; text-align: center; text-wrap: balance; animation: pop .6s ease; }
.tv-loup .day-n { text-align: center; font-size: 1.2em; font-weight: 800; opacity: .8; }
.tv-village { display: flex; flex-wrap: wrap; gap: .7em; justify-content: center; }
.tv-villager { display: flex; flex-direction: column; align-items: center; gap: .2em; min-width: 6.5em; padding: .6em .8em; border-radius: 1em; background: rgba(255, 255, 255, .14); font-weight: 900; font-size: 1.15em; }
.tv-loup.day .tv-villager { background: rgba(255, 255, 255, .55); }
.tv-villager .e { font-size: 1.8em; line-height: 1; }
.tv-villager .r { font-size: .7em; font-weight: 800; opacity: .85; }
.tv-villager.dead { opacity: .5; text-decoration: line-through; }
.tv-win { text-align: center; font-size: 1.8em; font-weight: 900; background: rgba(0, 0, 0, .25); border-radius: 1em; padding: .4em .8em; align-self: center; }
/* Écran étroit ou vertical (téléphone utilisé comme écran) : tout en colonne */
@media (max-width: 820px), (orientation: portrait) {
  .tv { height: auto; min-height: 100dvh; overflow: visible; font-size: 15px; }
  .tv-main, .tv-draw { grid-template-columns: 1fr; }
  .tv-invite { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .tv-bigcode { font-size: 3.6em; }
  .tv-bigqr { width: 10em; height: 10em; }
  .tv-head .logo { display: none; }
  .tv-opts { grid-template-columns: 1fr; }
  .tv-split, .tv-split.wide-l { grid-template-columns: 1fr; }
}
body.tv-mode #toasts { top: auto; bottom: 24px; font-size: clamp(15px, 1.2vw, 26px); }
.tv-votes { display: flex; flex-direction: column; gap: .45em; width: min(100%, 34em); margin: 0 auto; }
.tv-votes .section-title { font-size: .9em; text-align: center; }
.tv-vote { display: grid; grid-template-columns: minmax(0, 11em) 1fr auto; align-items: center; gap: .7em; font-weight: 800; font-size: 1.2em; }
.tv-vote .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-vote .bar { height: .7em; border-radius: 999px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.tv-vote .bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--ok), #7cf0c8); transition: width .5s ease; }

/* ---------- Écrans télé des jeux : outils communs (kit.js : tvTurn, tvSplit, tvBars, tvSay) ---------- */
.tv-stage > .tv-fill { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 1em; justify-content: center; }
.tv-turn { display: flex; align-items: center; justify-content: center; gap: .55em; font-size: 1.55em; animation: pop .5s ease; }
.tv-turn .e { font-size: 1.7em; line-height: 1; }
.tv-turn b { display: block; font-size: 1.15em; font-weight: 900; line-height: 1.05; }
.tv-turn .sub { display: block; font-size: .62em; font-weight: 800; color: var(--muted); }
.tv-split { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.4em; align-items: center; }
.tv-split > * { min-width: 0; }
.tv-split.wide-l { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.tv-col { display: flex; flex-direction: column; gap: .9em; min-width: 0; }
.tv-say { text-align: center; font-size: 1.9em; font-weight: 900; line-height: 1.15; text-wrap: balance; }
.tv-say.pop-in { animation: pop .45s ease; }
.tv-bars { display: flex; flex-direction: column; gap: .75em; width: 100%; max-width: 46em; margin: 0 auto; }
.tv-barrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: .25em .8em; font-weight: 900; font-size: 1.3em; animation: cardin .4s ease both; }
.tv-barrow:nth-child(2) { animation-delay: .08s; } .tv-barrow:nth-child(3) { animation-delay: .16s; } .tv-barrow:nth-child(n + 4) { animation-delay: .24s; }
.tv-barrow .lb { overflow: hidden; text-overflow: ellipsis; }
.tv-barrow .nb { font-variant-numeric: tabular-nums; }
.tv-barrow .bar { grid-column: 1 / -1; height: .85em; border-radius: 999px; background: rgba(0, 0, 0, .2); overflow: hidden; }
.tv-barrow .bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: rgba(255, 255, 255, .85); transition: width 1.1s cubic-bezier(.2, .9, .3, 1) .2s; }
.tv-barrow.win .bar i { background: linear-gradient(90deg, #ffd23f, #ffe98a); box-shadow: 0 0 14px rgba(255, 210, 63, .7); }
.tv-barrow .names { grid-column: 1 / -1; font-size: .62em; font-weight: 800; color: var(--muted); }
.tv-card .tv-bars .names { color: inherit; opacity: .9; }
.tv-card .lvl-b { display: inline-block; font-size: .85em; font-weight: 800; background: rgba(0, 0, 0, .22); border-radius: 999px; padding: .2em .8em; margin-bottom: .3em; }
.tv-card .foot { font-size: 1.05em; font-weight: 700; opacity: .92; margin-top: .6em; }
.tv-big-emo { font-size: 5em; line-height: 1; text-align: center; animation: pop .6s ease; }
.tv-pills { display: flex; gap: .5em; flex-wrap: wrap; justify-content: center; }
.tv-pills .pill { font-size: 1.05em; padding: .3em .9em; }
/* Votes (vote.js) */
.tv-vs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: .8em; margin-top: .8em; }
.tv-vs .or { align-self: center; font-size: 1.4em; font-weight: 900; opacity: .85; }
.tv-side { display: flex; flex-direction: column; justify-content: center; gap: .4em; min-height: 5.5em; background: rgba(255, 255, 255, .16); border: .12em solid rgba(255, 255, 255, .35); border-radius: 1em; padding: .8em 1em; transition: transform .5s, opacity .5s, background .5s; }
.tv-side .t { font-size: 1.9em; font-weight: 900; line-height: 1.15; text-wrap: balance; }
.tv-side .res { display: flex; flex-direction: column; gap: .3em; }
.tv-side .res:empty { display: none; }
.tv-side .res b { font-size: 2.2em; line-height: 1; animation: pop .5s ease; }
.tv-side .res .bar { height: .7em; border-radius: 999px; background: rgba(0, 0, 0, .25); overflow: hidden; }
.tv-side .res .bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: #fff; transition: width 1.1s cubic-bezier(.2, .9, .3, 1) .15s; }
.tv-side .res .names { font-weight: 800; font-size: .95em; opacity: .95; }
.tv-side.win { background: rgba(255, 255, 255, .95); color: #251a4f; transform: scale(1.03); }
.tv-side.win .res .bar i { background: linear-gradient(90deg, var(--g1), var(--g2)); }
.tv-side.lose { opacity: .6; transform: scale(.97); }
.tv-avg { display: flex; align-items: baseline; justify-content: center; gap: .4em; font-weight: 900; font-size: 1.3em; }
.tv-avg b { font-size: 3.6em; line-height: 1; background: linear-gradient(135deg, #ffd166, #ff4d8d); -webkit-background-clip: text; background-clip: text; color: transparent; animation: pop .6s ease; }
.tv-avg span { color: var(--muted); }
/* Cartes à tour de rôle (cartes.js) */
.tv-bigcard { padding: 1.8em 2.2em; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .3em; min-height: 11em; }
.tv-bigcard .q { font-size: 2.6em; }
.tv-aov { margin: 0; }
.tv-aov .tv-side { background: linear-gradient(135deg, var(--g1), var(--g2)); border: 0; min-height: 8em; text-align: center; color: #fff; box-shadow: var(--shadow); animation: pulse 1s ease-in-out infinite alternate; }
.tv-aov .tv-side:last-child { animation-delay: .5s; }
.tv-aov .tv-side .t { font-size: 2.8em; }
/* Hasard (hasard.js) : bouteille, roue, qui commence, boîte à outils */
.tv-stage .bt-ring.tv-ring, .tv-stage .wheel-wrap.tv-wheel { width: min(100%, 30em, 64vh); margin: 0 auto; }
.tv-stage .tv-ring .bt-name { font-size: 1.15em; padding: .3em .85em; }
.tv-stage .tv-wheel .wheel-pointer { font-size: 2.6em; top: -.35em; }
.tv-wheel-disc { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; }
.tv-count { text-align: center; font-size: 7em; font-weight: 900; line-height: 1; min-height: 1em; color: #ffd23f; text-shadow: 0 .05em .2em rgba(0, 0, 0, .25); }
.tv-count:empty { min-height: 0; }
.tv-count.pop-in { animation: pop .45s ease; }
.tv-fingers .tv-chip { font-size: 1.3em; padding: .4em 1em; }
.tv-teams { display: flex; flex-wrap: wrap; gap: 1em; justify-content: center; width: 100%; }
.tv-team { flex: 1 1 14em; max-width: 24em; border-radius: 1.2em; padding: 1em 1.2em; background: var(--card); border: .15em solid var(--c); display: flex; flex-direction: column; gap: .3em; text-align: center; animation: pop .5s ease both; }
.tv-team:nth-child(2) { animation-delay: .12s; } .tv-team:nth-child(n + 3) { animation-delay: .24s; }
.tv-team b { align-self: center; background: var(--c); color: #fff; font-size: 1.4em; border-radius: 999px; padding: .15em .9em; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.tv-team span { font-size: 1.4em; font-weight: 800; }
.tv-order { margin: 0 auto; padding: 0; list-style: none; counter-reset: o; display: flex; flex-wrap: wrap; justify-content: center; gap: .6em; max-width: 46em; }
.tv-order li { counter-increment: o; font-size: 1.5em; font-weight: 900; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .3em 1em .3em .4em; display: flex; align-items: center; gap: .5em; animation: pop .45s ease both; }
.tv-order li::before { content: counter(o); width: 1.6em; height: 1.6em; border-radius: 50%; display: grid; place-items: center; background: #ffd23f; color: #3a2a00; }
.tv-tool { align-items: center; }
.tv-dice { gap: 1.2em; }
.tv-dice .die { width: 6.5em; height: 6.5em; padding: .9em; gap: .3em; border-radius: 1.3em; }
.tv-coin { font-size: 2.6em; width: 5em; height: 5em; }
.tv-chrono { font-size: 11em; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; text-align: center; }
.tv-chrono.low { color: #ffd23f; animation: pulse .5s ease infinite alternate; }
.tv-points { display: flex; flex-direction: column; gap: .5em; width: min(100%, 30em); }
.tv-pt { display: flex; justify-content: space-between; align-items: center; font-size: 1.7em; font-weight: 900; background: var(--card); border-radius: .7em; padding: .35em .8em; }
.tv-pt.lead { background: #ffd23f; color: #3a2a00; }
/* Cartes à jouer (paquet.js) */
.tv-kings { display: flex; gap: .3em; font-size: 1.7em; }
.tv-kings span { opacity: .22; transition: opacity .4s; }
.tv-kings span.on { opacity: 1; animation: pop .5s ease; }
.tv-stage .playing-card { width: min(13em, 46vh); border-radius: 1.1em; }
.tv-stage .playing-card .corner { font-size: 2em; top: .4em; left: .45em; }
.tv-stage .playing-card .corner.br { top: auto; left: auto; bottom: .4em; right: .45em; }
.tv-stage .playing-card .mid { font-size: 5.5em; }
.pc.tvc { font-size: inherit; width: 9em; height: 12.6em; border-radius: .9em; }
.pc.tvc .tl, .pc.tvc .br { font-size: 1.7em; }
.pc.tvc .tl { top: .3em; left: .35em; } .pc.tvc .br { bottom: .3em; right: .35em; }
.pc.tvc .mid { font-size: 4.8em; }
.pc.tvc.back { border-width: .3em; }
.pc.tvc.good { box-shadow: 0 0 0 .3em var(--ok), 0 .4em 1em rgba(0, 0, 0, .3); }
.pc.tvc.bad { box-shadow: 0 0 0 .3em var(--bad), 0 .4em 1em rgba(0, 0, 0, .3); }
.pc.tvc-mini { font-size: inherit; width: 2.6em; height: 3.6em; border-radius: .35em; box-shadow: none; }
.pc.tvc-mini .tl, .pc.tvc-mini .br { display: none; }
.pc.tvc-mini .mid { font-size: 1.1em; }
.tv-table { gap: 1.6em; padding: .5em 0; }
.tv-trail { min-height: 3.6em; gap: .3em; }
.tv-steps .bus-step { width: 2.4em; height: 2.4em; font-size: 1.3em; }
/* Plateaux (plateau.js) */
.tv-seas { display: grid; grid-template-columns: 1fr 1fr; gap: 2em; align-items: start; }
.tv-sea { display: flex; flex-direction: column; align-items: center; gap: .5em; font-size: 1.2em; }
.tv-sea .bn-grid { width: min(100%, 19em, 50vh); gap: .15em; padding: .3em; border-radius: .7em; transition: box-shadow .3s; }
.tv-sea .bn-cell { font-size: 1em; border-radius: .2em; }
.tv-sea.aimed .bn-grid { box-shadow: 0 0 0 .2em #ffd23f, 0 0 1.2em rgba(255, 210, 63, .5); }
.tv-mem { display: flex; justify-content: center; min-width: 0; }
.tv-mem .mem-grid { width: min(100%, calc(var(--cols) / var(--rows) * 23em)); gap: .5em; }
.tv-mem .mc-front { font-size: 2.4em; }
.tv-mem .mc-face { border-radius: .6em; }
.tv-yams-dice { display: flex; flex-direction: column; gap: .8em; align-items: center; }
.tv-yams-dice .dice-row { gap: .8em; }
.tv-yams-dice .die.md { width: 4.4em; height: 4.4em; padding: .6em; gap: .2em; border-radius: .9em; }
.tv-yams-dice .ys-die.held { transform: translateY(-.7em); }
.tv-sheet { min-width: 0; }
.tv-sheet .ys-wrap { margin: 0; padding: 0; }
.tv-sheet .ys { font-size: 1em; }
.tv-sheet .ys th, .tv-sheet .ys td { padding: .2em .45em; }
.tv-sheet .ys th { font-size: .9em; }
.tv-sheet .ys tr.tot.big td { font-size: 1.15em; }
/* Morpion & 4 en ligne : l'écran du spectateur, plateau à gauche, textes à droite */
.tv-morpion { flex: 1; min-height: 0; display: flex; }
.tv-morpion > .col { flex: 1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: 1fr auto auto 1fr; align-items: center; gap: 1em 2em; }
.tv-morpion > .col > :nth-child(1) { grid-column: 2; grid-row: 2; font-size: 1.4em; }
.tv-morpion > .col > :nth-child(2) { grid-column: 2; grid-row: 3; font-size: 2.3em; margin: 0; }
.tv-morpion > .col > :nth-child(3) { grid-column: 1; grid-row: 1 / 5; min-width: 0; }
.tv-morpion > .col > :nth-child(4) { grid-column: 2; grid-row: 4; align-self: start; font-size: 1.3em; }
.tv-morpion .ttt { width: min(100%, 26em, 62vh); border-radius: 1.6em; }
.tv-morpion .c4 { width: min(100%, 30em, 62vh); }
.tv-morpion .small { font-size: .9em; }
/* Lettres (mots.js) */
.tv-letter { font-size: 15em; }
.tv-cats { display: flex; flex-wrap: wrap; gap: .6em; justify-content: center; }
.tv-cats span { background: var(--card); border: 1px solid var(--line); border-radius: .8em; padding: .45em 1em; font-size: 1.4em; font-weight: 900; animation: pop .45s ease both; }
.tv-pb { display: grid; gap: .3em .4em; align-items: center; font-weight: 800; min-height: 0; overflow: hidden; }
.tv-pb .hd { font-weight: 900; text-align: center; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-pb .cat { font-weight: 900; }
.tv-pb .ans { border-radius: .5em; padding: .2em .5em; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--card); animation: pop .4s ease both; }
.tv-pb .ans.uniq { background: var(--ok); color: #053b2a; }
.tv-pb .ans.shared { background: #f0b429; color: #2b1c00; }
.tv-pb .ans.bad { background: rgba(0, 0, 0, .3); text-decoration: line-through; opacity: .75; }
.tv-pb .ans.none { opacity: .4; }
.tv-mm { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(11em, 1fr)); gap: 1em; align-content: center; }
.tv-mm-p { background: var(--card); border: 1px solid var(--line); border-radius: 1em; padding: .7em; display: flex; flex-direction: column; gap: .5em; align-items: center; font-size: 1.1em; transition: opacity .4s; }
.tv-mm-p.won { box-shadow: 0 0 0 .2em var(--ok); }
.tv-mm-p.lost { opacity: .55; }
.tv-mm-g { display: grid; grid-template-columns: repeat(var(--n), 1.85em); gap: .25em; }
.tv-mm-g i { aspect-ratio: 1; border-radius: .25em; border: .12em solid rgba(255, 255, 255, .25); }
.tv-mm-g i.good { background: var(--ok); border-color: transparent; }
.tv-mm-g i.near { background: #f0b429; border-color: transparent; }
.tv-mm-g i.absent { background: rgba(0, 0, 0, .35); border-color: transparent; }
.tv-pendu { width: min(100%, 22em, 54vh); height: auto; aspect-ratio: 1; }
.tv-pendu svg { width: 100%; height: 100%; display: block; }
.tv-pword { gap: .25em; }
.tv-pword .ltr { font-size: clamp(1.3em, calc(26em / var(--len, 8)), 2.6em); width: 1.15em; height: 1.45em; border-bottom-width: .1em; padding-bottom: .05em; }
.tv-pword .sp { width: .6em; }
.tv-kb { gap: .3em; }
.tv-kb .kb-key { min-width: 1.9em; height: 1.9em; font-size: 1.1em; border-radius: .4em; display: grid; place-items: center; }
/* Chacun son tour (tour.js) */
.tv-debate { margin: 0; }
.tv-debate .tv-side { text-align: center; min-height: 0; padding: .7em 1em; }
.tv-debate .tv-side .k { font-weight: 900; font-size: 1.05em; opacity: .9; }
.tv-debate .tv-side .t { font-size: 2.2em; }
.tv-debate .tv-side.on { background: rgba(255, 255, 255, .95); color: #251a4f; transform: scale(1.05); box-shadow: 0 0 2em rgba(255, 255, 255, .45); }
.tv-anec { display: flex; align-items: center; gap: .8em; background: var(--card); border: .12em solid var(--line); border-radius: 1em; padding: .6em 1em; font-size: 1.35em; font-weight: 800; animation: cardin .4s ease both; transition: background .5s, opacity .5s, transform .5s; }
.tv-anec:nth-child(2) { animation-delay: .1s; } .tv-anec:nth-child(3) { animation-delay: .2s; }
.tv-anec > b { width: 1.8em; height: 1.8em; flex: none; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .25); }
.tv-anec .t { flex: 1; }
.tv-anec .m { font-size: .8em; font-weight: 900; white-space: nowrap; }
.tv-anec.lie { background: var(--bad); border-color: #fff; transform: scale(1.03); }
.tv-anec.truth { opacity: .65; }
/* Soirée (soiree.js) : Curseur, Dans sa tête, Dans l'ordre, Chifoumi */
.tv-scale .scale { margin-top: .8em; gap: .5em; }
.tv-scale .scale-labels { font-size: 1.5em; }
.tv-scale .scale-bar { height: 2.4em; }
.tv-scale .scale-bar.with-marks { margin-bottom: 2.4em; }
.tv-scale .scale-target { width: 2.6em; top: -.3em; bottom: -.3em; border-width: .2em; border-radius: .6em; }
.tv-scale .scale-mark { width: 1.1em; height: 1.1em; }
.tv-scale .scale-mark span { top: 1.3em; font-size: 1em; }
.tv-sort { width: min(100%, 44em); margin: 0 auto; }
.tv-sort .sort-wrap { gap: .4em; }
.tv-sort .sort-edge { font-size: .95em; }
.tv-sort .sort-list { gap: .45em; }
.tv-sort .sort-item { font-size: 1.3em; min-height: 0; padding: .45em .7em; gap: .6em; border-radius: .7em; }
.tv-sort .sort-item .rk { width: 1.6em; height: 1.6em; }
.tv-sort .sort-item .yr { font-size: .8em; }
.tv-items { display: flex; flex-wrap: wrap; justify-content: center; gap: .6em; }
.tv-items span { background: #fff; color: #1d1440; border-radius: .8em; padding: .5em 1em; font-size: 1.35em; font-weight: 800; box-shadow: var(--shadow); animation: pop .45s ease both; }
.tv-items span:nth-child(2) { animation-delay: .08s; } .tv-items span:nth-child(3) { animation-delay: .16s; } .tv-items span:nth-child(4) { animation-delay: .24s; } .tv-items span:nth-child(5) { animation-delay: .32s; }
.tv-chi { flex: 1; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 1.2em 2em; }
.tv-chi-p { display: flex; flex-direction: column; align-items: center; gap: .2em; min-width: 6em; transition: opacity .4s; }
.tv-chi-p .chi-hand { font-size: 5em; }
.tv-chi-p b { font-size: 1.3em; }
.tv-chi-p .g { font-size: 1.4em; font-weight: 900; color: #ffd23f; min-height: 1.2em; }
.tv-chi.pump .chi-hand { animation: chipump .32s ease-in-out; }
.tv-chi.done .chi-hand { animation: pop .35s ease; }
.tv-chi.done .tv-chi-p:not(.best) { opacity: .6; }
.tv-chi-p.best .chi-hand { filter: drop-shadow(0 0 .3em #ffd23f); transform: scale(1.15); }
/* Par équipes (equipes.js) */
.tv-eq { display: grid; grid-template-columns: 1fr 1fr; gap: 1em; }
.tv-eqt { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .1em .8em; padding: .7em 1.1em; border-radius: 1.1em; background: var(--card); border: .15em solid transparent; transition: transform .4s, border-color .4s, box-shadow .4s; }
.tv-eqt b { font-size: 1.4em; }
.tv-eqt .sc { grid-row: 1 / 3; grid-column: 2; font-size: 3.4em; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.tv-eqt .mem { font-weight: 700; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-eqt.cur { border-color: var(--c); box-shadow: 0 0 1.4em color-mix(in srgb, var(--c) 55%, transparent); transform: scale(1.02); }
/* À l'unisson */
.tv-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(14em, 1fr)); gap: .7em; }
.tv-group { display: flex; flex-direction: column; gap: .15em; background: var(--card); border: .12em solid var(--line); border-radius: 1em; padding: .6em .9em; animation: pop .45s ease both; }
.tv-group:nth-child(2) { animation-delay: .1s; } .tv-group:nth-child(3) { animation-delay: .2s; } .tv-group:nth-child(n + 4) { animation-delay: .3s; }
.tv-group b { font-size: 1.6em; line-height: 1.1; }
.tv-group .n { font-weight: 900; color: #ffd23f; }
.tv-group .who { font-weight: 700; color: var(--muted); }
.tv-group.many { background: #fff; color: #1d1440; border-color: transparent; }
.tv-group.many .n { color: #0a8a5c; }
.tv-group.many .who { color: #6b5d99; }
/* Le Bon Mot */
.tv-bm-lives .tv-chip { font-size: 1.15em; }
.tv-bm-lives .tv-chip.dead { opacity: .4; text-decoration: line-through; }
.tv-bm-card { display: flex; flex-direction: column; align-items: center; gap: .4em; min-height: 9em; justify-content: center; }
.tv-bm-card .kicker { font-size: 1.1em; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tv-bm-card .tiles span { width: 2.2em; height: 2.6em; font-size: 2.4em; border-radius: .3em; }
.tv-bm-typing { display: flex; justify-content: center; align-items: baseline; gap: .6em; min-height: 3em; }
.tv-bm-typing span { font-weight: 800; color: var(--muted); font-size: 1.2em; }
.tv-bm-typing b { font-size: 2.6em; letter-spacing: .04em; }
.tv-bm-used { display: flex; flex-wrap: wrap; justify-content: center; gap: .4em; }
.tv-bm-timer { max-width: 40em; width: 100%; margin: 0 auto; font-size: 1.3em; }
.tv-bm-timer .timer { height: .8em; }
.tv-starter { font-size: 1.6em !important; }
/* Bingo */
.tv-bingo { display: flex; flex-wrap: wrap; justify-content: center; gap: .8em; }
.tv-bingo-p { display: flex; flex-direction: column; align-items: center; min-width: 7em; padding: .6em 1em; border-radius: 1em; background: var(--card); border: 1px solid var(--line); font-weight: 800; }
.tv-bingo-p b { font-size: 1.2em; }
.tv-bingo-p .n { font-size: 2.6em; font-weight: 900; line-height: 1.05; }
.tv-bingo-p.full { background: #ffd23f; color: #3a2a00; }
/* Patate chaude, La Séquence (live.js) */
.tv-bomb { font-size: 11em; }
.tv-seq { width: min(100%, 28em, 60vh); }
.tv-seq .seq-grid { gap: .8em; }
.tv-seq .seq-pad { border-radius: 1.4em; }
.tv-seq .seq-count { font-size: 9em; }
.vote-strip .count-label { font-weight: 800; font-size: 14px; color: var(--muted); white-space: nowrap; flex: none; }
.game-pick { margin-bottom: 4px; }

/* ---------- Dans la foule (js/online/foule.js) : manette du téléphone et place à la télé ---------- */
.pick-tile .badge.tvonly { background: linear-gradient(135deg, #5b6cff, #22c1c3); color: #fff; }
.foule-pad { display: flex; flex-direction: column; gap: 10px; min-height: calc(100dvh - 120px); user-select: none; -webkit-user-select: none; }
.fp-top { display: flex; align-items: center; gap: 12px; }
.fp-avatar { width: 66px; height: 66px; flex: none; }
.fp-top .pill { align-self: flex-start; }
.fp-status { margin: 0; font-weight: 700; font-size: 14px; line-height: 1.3; color: var(--text); }
.fp-goals { display: flex; justify-content: center; gap: 12px; padding: 4px 0; }
.fp-goal { --c: #3fa9f5; position: relative; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 20px;
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .75), rgba(255, 255, 255, 0) 42%), var(--c); border: 3px solid #fff;
  box-shadow: 0 3px 10px rgba(40, 20, 80, .18); opacity: .5; transition: transform .3s, opacity .3s; }
.fp-goal b { text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.fp-goal.next { opacity: 1; transform: scale(1.18); animation: pulse .8s ease-in-out infinite alternate; }
.fp-goal.done { opacity: 1; }
.fp-goal.done b { visibility: hidden; }
.fp-goal.done::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 26px; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.fp-next { margin: 0; text-align: center; font-weight: 800; font-size: 16px; }
.fp-msg { padding: 10px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-weight: 800; text-align: center; box-shadow: var(--shadow); }
.fp-msg.good { background: #e7f8ee; color: #137a43; border-color: #bfe8cf; }
.fp-msg.bad { background: #ffeef0; color: #b3261e; border-color: #f6c7cc; }
.fp-msg.pop-in { animation: pop .4s ease; }
.fp-over { padding: 18px 16px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); text-align: center; font-weight: 800; font-size: 18px; line-height: 1.35; }
.fp-ctrl { margin-top: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 14px; padding-bottom: 6px; touch-action: none; }
.fp-ctrl.wait { opacity: .55; }
.fp-stick { position: relative; height: min(46vh, 260px); min-height: 180px; border-radius: 26px; touch-action: none; cursor: grab;
  background: repeating-radial-gradient(circle at 50% 50%, rgba(91, 108, 255, .05) 0 14px, transparent 14px 28px), var(--card2); border: 2px dashed var(--line); }
.fp-base { position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .9), rgba(91, 108, 255, .16)); border: 3px solid rgba(91, 108, 255, .35); box-shadow: inset 0 3px 10px rgba(40, 20, 80, .12); }
.fp-knob { position: absolute; left: 28px; top: 28px; width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(145deg, #7d8bff, #4b5bea);
  box-shadow: 0 6px 14px rgba(60, 50, 200, .35), inset 0 3px 6px rgba(255, 255, 255, .45); transition: transform .12s ease-out; }
.fp-stick.on .fp-knob { transition: none; }
.fp-stick.on { cursor: grabbing; }
.fp-hint { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); pointer-events: none; }
.fp-stick.on .fp-hint { opacity: 0; }
.fp-push { position: relative; overflow: hidden; width: 132px; height: 132px; border-radius: 50%; border: 0; color: #fff; font-weight: 900; font-size: 16px; touch-action: none;
  background: radial-gradient(circle at 35% 28%, #ff9ab4, #ff3d6e 60%, #d81b55); box-shadow: 0 8px 0 #b3134a, 0 12px 22px rgba(216, 27, 85, .35); transition: transform .08s, box-shadow .08s; }
.fp-push-in { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.fp-push-in .ic { font-size: 30px; }
.fp-push:active, .fp-push.hit { transform: translateY(6px); box-shadow: 0 2px 0 #b3134a, 0 4px 10px rgba(216, 27, 85, .3); }
.fp-push.hit { animation: fp-hit .25s ease; }
@keyframes fp-hit { 0% { transform: translateY(6px) scale(.94); } 100% { transform: none; } }
.fp-cd { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(40, 20, 60, .45); }
.fp-push.cool .fp-cd { animation: fp-cool 2.5s linear forwards; }
@keyframes fp-cool { from { height: 100%; } to { height: 0; } }
/* Télé */
.foule-tv { position: relative; flex: 1; min-height: 0; border-radius: 1.2em; overflow: hidden; background: #c4e4a6; box-shadow: var(--shadow); }
.foule-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.foule-hud { position: absolute; top: .7em; left: .8em; right: .8em; display: flex; gap: .6em; align-items: center; pointer-events: none; }
.fh-pill { background: rgba(255, 255, 255, .92); color: #2b1f45; border-radius: 999px; padding: .3em .9em; font-weight: 900; box-shadow: 0 .15em .5em rgba(40, 20, 80, .15); }
.fh-time { margin-left: auto; font-variant-numeric: tabular-nums; }
.fh-time.low { background: #ff4d6d; color: #fff; animation: pulse .5s ease-in-out infinite alternate; }
.foule-say { position: absolute; left: 4%; right: 4%; top: 36%; pointer-events: none; }
.foule-say.num .tv-say { font-size: 7em; }
.foule-say .tv-say { font-size: 2.6em; color: #fff; -webkit-text-stroke: .06em #3b2a5e; paint-order: stroke fill; text-shadow: 0 .12em .4em rgba(40, 20, 80, .35); }
.fh-tip { position: absolute; left: 50%; bottom: .7em; transform: translateX(-50%); max-width: 92%; background: rgba(255, 255, 255, .9); color: #2b1f45; border-radius: 999px; padding: .3em 1em; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
@media (orientation: landscape) and (max-height: 520px) {
  .foule-pad { min-height: calc(100dvh - 80px); }
  .fp-stick { height: 52vh; min-height: 150px; }
  .fp-push { width: 116px; height: 116px; }
}

/* ---------- Choix du thème (Quiz) : themeGrid de js/common.js ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.theme-tile { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; text-align: left; min-height: 58px;
  background: var(--card); border: 2px solid var(--line); color: var(--text); font: inherit; font-weight: 800; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s; }
.theme-tile:active { transform: scale(.97); }
.theme-tile .th-emo { font-size: 24px; line-height: 1; flex: none; }
.theme-tile .th-txt { display: flex; flex-direction: column; min-width: 0; }
.theme-tile b { font-size: 15px; line-height: 1.2; }
.theme-tile small { color: var(--muted); font-weight: 700; font-size: 12px; }
.theme-tile.all { grid-column: 1 / -1; }
.theme-tile.on { background: linear-gradient(135deg, var(--g1), var(--g2)); border-color: transparent; color: #fff; }
.theme-tile.on small { color: rgba(255, 255, 255, .85); }
.modal .theme-grid { max-height: 62vh; overflow: auto; padding: 2px; }
