/* Undercover Pop — identité visuelle : nuit néon, trames manga, cartes secrètes à retourner.
   Mobile d'abord : tout se joue sur un téléphone qui passe de main en main. */

@font-face {
  font-family: "Unbounded"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("/static/undercover/fonts/unbounded-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Unbounded"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("/static/undercover/fonts/unbounded-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --bg: #07060d; --bg-2: #0d0b18; --surface: #141127; --surface-2: #1b1733; --surface-3: #272149;
  --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .16);
  --text: #f7f5ff; --muted: #aaa5cc; --dim: #726c98;
  --pink: #ff3d8b; --violet: #8b5cf6; --cyan: #22e3ff; --lime: #c6ff3d; --yellow: #ffd23f;
  --civil: #22e3ff; --imp: #ff3d8b; --white: #f4efdf;
  --danger: #ff4d5e; --ok: #3dffa8;
  --radius: 20px;
  --font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .85);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
/* auras de couleur qui dérivent lentement, puis trame de points façon manga */
body::before {
  content: ""; position: fixed; inset: -20%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(40% 35% at 15% 10%, rgba(255, 61, 139, .24), transparent 70%),
    radial-gradient(35% 30% at 90% 22%, rgba(34, 227, 255, .14), transparent 70%),
    radial-gradient(45% 40% at 50% 100%, rgba(139, 92, 246, .24), transparent 70%);
  animation: drift 26s ease-in-out infinite alternate;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.4px);
  background-size: 6px 6px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 38%, transparent 72%, rgba(0, 0, 0, .55));
  mask-image: linear-gradient(180deg, #000, transparent 38%, transparent 72%, rgba(0, 0, 0, .55));
}
@keyframes drift { to { transform: translate3d(3%, -2%, 0) rotate(4deg); } }

a { color: var(--cyan); }
button, input { font: inherit; color: inherit; }
button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
::selection { background: var(--pink); color: #fff; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* ---------- écrans ---------- */
.screen {
  max-width: 580px; margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 16px calc(128px + var(--safe-b));
  animation: screen-in .35s ease both;
}
/* Fondu seulement sur l'écran : une transformation (même terminée) en ferait le repère de ses éléments
   « position: fixed » (barre du bas, fond rayonnant). Le glissement est porté par ses enfants. */
@keyframes screen-in { from { opacity: 0; } }
:where(.screen > :not(.dock, .speedlines)) { animation: enter .45s var(--ease) both; }
.screen.still, .screen.still > :not(.speedlines) { animation: none; }
.screen.wide { max-width: 1080px; }
.screen.nodock { padding-bottom: calc(32px + var(--safe-b)); }
@keyframes enter { from { opacity: 0; transform: translateY(14px); } }

.nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; margin-bottom: 6px; }
.nav .back { color: var(--muted); text-decoration: none; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; padding: 8px 0; background: none; border: 0; cursor: pointer; }
.nav .back:hover { color: var(--text); }
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; display: inline-grid; place-items: center; flex: none;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text); font-size: 20px; cursor: pointer;
}

.kicker { font: 700 11px/1.2 var(--font-display); letter-spacing: .2em; text-transform: uppercase; color: var(--pink); }
.page-title { font: 800 clamp(26px, 7.5vw, 42px)/1.05 var(--font-display); text-transform: uppercase; margin: 6px 0 6px; letter-spacing: -.01em; }
.lead { color: var(--muted); margin: 0 0 20px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- logo ---------- */
.logo-wrap { position: relative; display: inline-block; margin-top: 8px; }
.logo {
  position: relative; display: block; margin: 0;
  font: 900 clamp(32px, 10.2vw, 100px)/.92 var(--font-display); letter-spacing: -.03em; text-transform: uppercase; white-space: nowrap;
  color: #fff; text-shadow: -2px 0 rgba(34, 227, 255, .75), 2px 0 rgba(255, 61, 139, .75), 0 10px 40px rgba(255, 61, 139, .35);
}
.logo::before, .logo::after {
  content: attr(data-text); position: absolute; inset: 0; clip-path: inset(0 0 100% 0); text-shadow: none;
}
.logo::before { color: var(--cyan); transform: translateX(-5px); animation: glitch 5s infinite steps(1); }
.logo::after { color: var(--pink); transform: translateX(5px); animation: glitch 5s .15s infinite steps(1); }
@keyframes glitch {
  0%, 86%, 100% { clip-path: inset(0 0 100% 0); }
  88% { clip-path: inset(18% 0 58% 0); }
  91% { clip-path: inset(62% 0 12% 0); }
  94% { clip-path: inset(38% 0 40% 0); }
}
.sticker {
  position: absolute; right: -.3em; bottom: -.95em;
  font: 900 clamp(22px, 7vw, 44px)/1 var(--font-display); text-transform: uppercase; color: #12051a;
  background: var(--yellow); padding: .14em .36em .18em; border-radius: 10px; border: 3px solid #12051a;
  transform: rotate(-8deg); box-shadow: 5px 5px 0 var(--pink); animation: pop-in .6s .25s cubic-bezier(.2, 1.6, .4, 1) both;
}
@keyframes pop-in { from { transform: rotate(-30deg) scale(0); } }
.tag {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  font: 700 11px/1 var(--font-display); letter-spacing: .16em; text-transform: uppercase;
  color: var(--text); background: rgba(255, 255, 255, .06); border: 1px solid var(--line-2);
}
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); }

/* ---------- boutons ---------- */
.btn {
  appearance: none; -webkit-appearance: none; position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 20px; border-radius: 15px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); cursor: pointer; text-decoration: none; user-select: none;
  font: 700 14px/1.15 var(--font-display); letter-spacing: .04em; text-transform: uppercase; text-align: center;
  transition: transform .12s, filter .2s, box-shadow .2s, background .2s, opacity .2s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .42; cursor: not-allowed; transform: none; filter: none; }
.btn-primary {
  border: 0; color: #fff; background: linear-gradient(135deg, var(--pink), var(--violet));
  box-shadow: 0 14px 34px -14px rgba(255, 61, 139, .9), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-primary::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .38) 50%, transparent 70%);
  transform: translateX(-130%); animation: shine 4.5s 1.2s infinite;
}
@keyframes shine { 0%, 70% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }
.btn-primary:disabled::after { display: none; }
.btn-cyan { border: 0; color: #04161b; background: linear-gradient(135deg, var(--cyan), #7cf7c8); box-shadow: 0 14px 34px -16px rgba(34, 227, 255, .9); }
.btn-danger { border: 0; color: #fff; background: linear-gradient(135deg, #ff5a4d, #d4145a); box-shadow: 0 14px 34px -16px rgba(255, 77, 94, .9); }
.btn-ghost { background: transparent; }
.btn-xl { min-height: 64px; font-size: 17px; border-radius: 18px; }
.btn-block { display: flex; width: 100%; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 11px; border-radius: 12px; }
.btn .arrow { font-size: 1.2em; line-height: 0; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-row .btn { white-space: nowrap; padding: 0 12px; font-size: 13px; }
.btn small { font: 700 11px/1 var(--font-display); padding: 4px 7px; border-radius: 99px; background: rgba(255, 255, 255, .1); }
.linkish { background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 10px; font-size: 14px; }
.linkish:hover { color: var(--text); }

/* bouton qui s'arme après un court délai : évite qu'un double appui du joueur précédent révèle la carte suivante */
.btn.arming { pointer-events: none; }
.btn .fill { position: absolute; inset: 0; background: rgba(255, 255, 255, .18); transform-origin: left; transform: scaleX(0); }
.btn.arming .fill { animation: arm var(--arm, 900ms) linear forwards; }
@keyframes arm { to { transform: scaleX(1); } }

/* ---------- panneaux et contrôles ---------- */
.panel {
  background: linear-gradient(180deg, rgba(27, 23, 51, .92), rgba(20, 17, 39, .92));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.panel-title {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px;
  font: 800 14px/1.2 var(--font-display); letter-spacing: .05em; text-transform: uppercase;
}
.panel-title small { color: var(--muted); font: 600 12px/1.2 var(--font); letter-spacing: 0; text-transform: none; }
.panel p { margin: 0 0 10px; }

.stepper { display: inline-flex; align-items: center; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; flex: none; }
.stepper button { width: 46px; height: 46px; background: none; border: 0; font-size: 24px; line-height: 1; cursor: pointer; color: var(--text); }
.stepper button:disabled { opacity: .3; cursor: default; }
.stepper output { min-width: 38px; text-align: center; font: 800 20px/1 var(--font-display); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row + .row { margin-top: 12px; }
.row .label b { display: block; font-weight: 700; }
.row .label small { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; margin-top: 2px; }

.switch {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; cursor: pointer; margin: 0;
  width: 52px; height: 30px; border-radius: 30px; background: var(--surface-3); border: 1px solid var(--line-2); transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .45); transition: transform .25s cubic-bezier(.3, 1.4, .6, 1);
}
.switch:checked { background: linear-gradient(135deg, var(--pink), var(--violet)); border-color: transparent; }
.switch:checked::after { transform: translateX(22px); }
label.row { cursor: pointer; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 15px; }
.segmented button {
  min-height: 42px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer;
  font: 700 11px/1.15 var(--font-display); letter-spacing: .04em; text-transform: uppercase; padding: 4px 6px;
}
.segmented button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2), 0 6px 18px -10px var(--pink); }
.seg-help { color: var(--muted); font-size: 13px; margin: 8px 2px 0; min-height: 2.6em; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-weight: 700; font-size: 14px;
}
.chip small { font-weight: 600; opacity: .75; }
.chip[aria-pressed="true"] { color: #10061a; background: var(--lime); border-color: transparent; box-shadow: 0 8px 22px -12px var(--lime); }
.chip.static { cursor: default; color: var(--text); background: var(--surface-3); border-color: transparent; }

.notes { display: grid; gap: 8px; margin-top: 12px; }
.notes:empty { display: none; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.4; }
.note::before { flex: none; }
.note.error { background: rgba(255, 77, 94, .12); border: 1px solid rgba(255, 77, 94, .38); color: #ffc7cc; }
.note.error::before { content: "⛔"; }
.note.warn { background: rgba(255, 210, 63, .09); border: 1px solid rgba(255, 210, 63, .32); color: #ffe9a8; }
.note.warn::before { content: "⚠️"; }
.note.info { background: rgba(34, 227, 255, .07); border: 1px solid rgba(34, 227, 255, .26); color: #c4f7ff; }
.note.info::before { content: "💡"; }

input.text {
  width: 100%; min-width: 0; height: 48px; padding: 0 14px; border-radius: 13px;
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); font-size: 16px;
}
input.text::placeholder { color: var(--dim); }
input.text:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 61, 139, .22); }

/* ---------- barre d'action en bas ---------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 18px 16px calc(12px + var(--safe-b));
  background: linear-gradient(180deg, transparent, rgba(7, 6, 13, .9) 34%);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.dock-inner { max-width: 548px; margin: 0 auto; display: grid; gap: 8px; }
.dock .hint { text-align: center; color: var(--muted); font-size: 13px; min-height: 1.2em; }
.dock .hint.error { color: #ffb3bb; }

/* ---------- avatars et rôles ---------- */
.avatar {
  --h: 320; position: relative; flex: none; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font: 800 16px/1 var(--font-display);
  background: linear-gradient(140deg, hsl(var(--h) 92% 62%), hsl(calc(var(--h) + 45) 80% 42%));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .28), 0 6px 16px -8px hsl(var(--h) 90% 50%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}
.avatar.lg { width: 92px; height: 92px; font-size: 36px; }
.avatar.xl { width: 128px; height: 128px; font-size: 52px; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .3), 0 0 60px -10px hsl(var(--h) 90% 55%); }
.avatar.out { filter: grayscale(1) brightness(.6); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  font: 800 10px/1.3 var(--font-display); letter-spacing: .08em; text-transform: uppercase;
}
.badge.civil { color: #04161b; background: var(--civil); }
.badge.imposteur { color: #fff; background: var(--imp); }
.badge.mrwhite { color: #1a1426; background: var(--white); }
.badge.out { color: var(--muted); background: var(--surface-3); }
.badge.win { color: #10061a; background: var(--yellow); }

.rolebar { display: flex; flex-wrap: wrap; gap: 7px; margin: 4px 0 2px; }
.rolebar i { width: 20px; height: 20px; border-radius: 50%; display: block; animation: pop-dot .35s var(--ease) both; }
.rolebar i.civil { background: var(--civil); box-shadow: 0 0 12px rgba(34, 227, 255, .55); }
.rolebar i.imposteur { background: var(--imp); box-shadow: 0 0 12px rgba(255, 61, 139, .65); }
.rolebar i.mrwhite { background: var(--white); box-shadow: 0 0 12px rgba(255, 255, 255, .55); }
@keyframes pop-dot { from { transform: scale(0); } }

.role-rows { display: grid; gap: 8px; }
.role-row { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 10px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); }
.role-row .ico { width: 42px; height: 42px; border-radius: 13px; flex: none; display: grid; place-items: center; font-size: 22px; }
.role-row .lbl { flex: 1; min-width: 0; }
.role-row .lbl b { display: block; font: 800 13px/1.2 var(--font-display); letter-spacing: .05em; text-transform: uppercase; }
.role-row .lbl small { display: block; color: var(--muted); font-size: 13px; line-height: 1.3; }
.role-row .count { width: 130px; flex: none; text-align: center; font: 800 22px/46px var(--font-display); }
.role-row.civil .ico { background: rgba(34, 227, 255, .13); box-shadow: inset 0 0 0 1px rgba(34, 227, 255, .4); }
.role-row.imposteur .ico { background: rgba(255, 61, 139, .13); box-shadow: inset 0 0 0 1px rgba(255, 61, 139, .45); }
.role-row.mrwhite .ico { background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.role-row.civil b { color: var(--civil); } .role-row.imposteur b { color: var(--imp); } .role-row.mrwhite b { color: var(--white); }

/* ---------- joueurs (configuration) ---------- */
.players { display: grid; gap: 8px; }
.player-row { display: flex; align-items: center; gap: 8px; animation: enter .3s var(--ease) both; }
.player-row .mini { width: 36px; height: 44px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg-2); color: var(--muted); font-size: 16px; cursor: pointer; flex: none; }
.player-row .mini:disabled { opacity: .25; cursor: default; }
.player-row .mini.del:hover { color: var(--danger); }
.add-player { margin-top: 10px; }

/* ---------- licences ---------- */
.searchbar { position: sticky; top: 0; z-index: 10; padding: 10px 0; margin: 0 0 4px; background: linear-gradient(180deg, rgba(7, 6, 13, .95) 70%, transparent); }
.cat { margin: 22px 0 8px; --c: var(--pink); }
.cat-head { display: flex; align-items: center; gap: 12px; }
.cat-emoji {
  width: 52px; height: 52px; border-radius: 16px; flex: none; display: grid; place-items: center; font-size: 26px;
  background: color-mix(in srgb, var(--c) 18%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
}
.cat-head h2 { margin: 0; font: 800 17px/1.15 var(--font-display); text-transform: uppercase; letter-spacing: .02em; }
.cat-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.cat-head .btn { margin-left: auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.tile {
  --c: var(--pink); position: relative; display: flex; flex-direction: column; gap: 6px; text-align: left;
  min-height: 108px; padding: 14px 12px 12px; border-radius: 16px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  transition: transform .15s, box-shadow .2s, border-color .2s, background .2s;
}
.tile:hover { transform: translateY(-2px); }
.tile .em { font-size: 28px; line-height: 1; }
.tile .nm { font-weight: 800; font-size: 14px; line-height: 1.2; padding-right: 22px; }
.tile .ct { margin-top: auto; color: var(--muted); font-size: 12px; }
.tile[aria-pressed="true"] {
  border-color: var(--c); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 24%, var(--surface)), var(--surface) 70%);
  box-shadow: 0 0 0 1px var(--c), 0 12px 30px -16px var(--c);
}
.tile[aria-pressed="true"]::after {
  content: "✓"; position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--c); color: #0b0716; font-weight: 900; font-size: 13px;
  animation: pop-dot .25s var(--ease) both;
}
.tile.dim { opacity: .45; }
.sel-summary { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.sel-summary .chip { min-height: 32px; font-size: 13px; padding: 0 10px; }

/* ---------- carte secrète ---------- */
.card3d { perspective: 1400px; width: min(100%, 330px); aspect-ratio: 3 / 4.15; margin: 14px auto 18px; cursor: pointer; }
.card3d .inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .75s var(--ease); }
.card3d.flipped .inner { transform: rotateY(180deg); }
.card3d.flipped { cursor: default; }
.face {
  position: absolute; inset: 0; border-radius: 26px; overflow: hidden; -webkit-backface-visibility: hidden; backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 22px;
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .9), inset 0 0 0 2px rgba(255, 255, 255, .1);
}
.face.front {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 61, 139, .35), transparent 55%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .045) 0 10px, transparent 10px 20px),
    linear-gradient(160deg, #2a1650, #120c26 70%);
}
.face.front .q {
  font: 900 120px/1 var(--font-display); color: #fff;
  text-shadow: -4px 0 var(--cyan), 4px 0 var(--pink), 0 0 50px rgba(255, 61, 139, .6);
  animation: float 3s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-8px) rotate(-3deg); } }
.face.front .tap { margin-top: 18px; font: 700 12px/1.3 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .85); }
.face.front .warn { margin-top: 8px; font-size: 13px; color: rgba(255, 255, 255, .55); }
.face.back {
  transform: rotateY(180deg); justify-content: space-between;
  background:
    radial-gradient(circle at 50% 30%, rgba(34, 227, 255, .22), transparent 60%),
    radial-gradient(circle at 50% 100%, rgba(255, 61, 139, .3), transparent 60%),
    linear-gradient(170deg, #1d1840, #0f0c22);
}
.face.back::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .1) 1px, transparent 1.3px); background-size: 7px 7px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 35%, #000 90%); mask-image: radial-gradient(circle at 50% 50%, transparent 35%, #000 90%);
}
.secret-top { font: 700 11px/1.3 var(--font-display); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.secret-word {
  font: 900 44px/1.05 var(--font-display); text-transform: uppercase; letter-spacing: -.01em; color: #fff;
  text-shadow: 0 0 30px rgba(34, 227, 255, .45);
}
.secret-licence { margin-top: 10px; font-weight: 700; color: var(--cyan); }
.secret-help { font-size: 13px; line-height: 1.4; color: rgba(255, 255, 255, .7); max-width: 26ch; }
.secret-role { font: 900 15px/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; padding: 8px 14px; border-radius: 999px; }
.secret-role.imposteur { background: var(--imp); color: #fff; box-shadow: 0 0 24px rgba(255, 61, 139, .6); }
.secret-role.mrwhite { background: var(--white); color: #1a1426; box-shadow: 0 0 24px rgba(255, 255, 255, .5); }
.white-mask { font-size: 76px; line-height: 1; filter: drop-shadow(0 0 24px rgba(255, 255, 255, .5)); }

/* ---------- passage du téléphone ---------- */
.stage { min-height: calc(100dvh - 200px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.pass-to { font: 700 12px/1.3 var(--font-display); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.big-name { font: 900 clamp(32px, 11vw, 66px)/1.02 var(--font-display); text-transform: uppercase; overflow-wrap: anywhere; letter-spacing: -.01em; }
.eyes { font-size: 15px; color: var(--muted); }
.dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 320px; margin: 0 auto; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); transition: background .3s, transform .3s; }
.dots i.done { background: var(--pink); }
.dots i.now { background: #fff; transform: scale(1.45); box-shadow: 0 0 10px #fff; }

/* ---------- discussion ---------- */
.game-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; min-height: 48px; }
.round-tag { font: 800 12px/1.2 var(--font-display); letter-spacing: .16em; text-transform: uppercase; }
.round-tag span { color: var(--pink); }
.spotlight {
  position: relative; overflow: hidden; isolation: isolate; text-align: center; padding: 22px 16px 18px; border-radius: 24px; margin-bottom: 14px;
  background: radial-gradient(circle at 50% 0%, rgba(255, 61, 139, .3), transparent 65%), var(--surface);
  border: 1px solid rgba(255, 61, 139, .35); box-shadow: 0 20px 50px -26px rgba(255, 61, 139, .8);
}
.spotlight::before {
  content: ""; position: absolute; inset: -60%; z-index: -1;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .06) 0deg 1.6deg, transparent 1.6deg 8deg);
  -webkit-mask-image: radial-gradient(circle, transparent 12%, #000 55%); mask-image: radial-gradient(circle, transparent 12%, #000 55%);
  animation: spin 80s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spotlight .avatar { margin: 0 auto 10px; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .3), 0 0 0 10px rgba(255, 61, 139, .15), 0 0 50px -6px hsl(var(--h) 90% 55%); } }
.spotlight .who-label { font: 700 11px/1.3 var(--font-display); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.spotlight .speaker { font: 900 clamp(26px, 8.5vw, 42px)/1.05 var(--font-display); text-transform: uppercase; margin: 4px 0 14px; animation: swap .35s var(--ease) both; }
.clue-form { display: flex; gap: 8px; }
.clue-form input { flex: 1; }
.spot-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; }
.tip { color: var(--muted); font-size: 13px; text-align: center; margin: 4px 0 14px; }

.order { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.order li {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, opacity .2s;
}
.order li .avatar { width: 36px; height: 36px; font-size: 14px; }
.order li .who { flex: 1; min-width: 0; }
.order li .nm { font-weight: 800; overflow-wrap: anywhere; }
.order li .state { font-size: 12px; color: var(--muted); white-space: nowrap; }
.order li.done .state { color: var(--ok); }
.order li.now { border-color: var(--pink); box-shadow: 0 0 0 1px var(--pink), 0 10px 30px -18px var(--pink); }
.order li.now .state { color: var(--pink); font-weight: 700; }
.order li.out { opacity: .55; }
.order li.out .nm { text-decoration: line-through; text-decoration-thickness: 2px; }
.clues { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.clue { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--surface-3); font-size: 12px; font-weight: 600; }
.clue.old { opacity: .6; }
.section-label { font: 800 11px/1.2 var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 20px 2px 10px; }
.done-box { text-align: center; padding: 18px; border-radius: 20px; margin-bottom: 14px; background: linear-gradient(160deg, rgba(198, 255, 61, .14), rgba(34, 227, 255, .06)); border: 1px solid rgba(198, 255, 61, .35); }
.done-box h2 { margin: 0 0 4px; font: 900 20px/1.15 var(--font-display); text-transform: uppercase; }
.done-box p { margin: 0 0 14px; color: var(--muted); }

/* ---------- vote ---------- */
.vote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(102px, 1fr)); gap: 8px; }
.vote-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 14px 6px 10px;
  border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: var(--text); cursor: pointer;
  transition: transform .15s, box-shadow .2s, border-color .2s;
}
.vote-card .nm { font-weight: 800; text-align: center; overflow-wrap: anywhere; line-height: 1.2; }
.vote-card .clues { justify-content: center; }
.vote-card[aria-pressed="true"] { border-color: var(--danger); transform: translateY(-3px); box-shadow: 0 0 0 2px var(--danger), 0 16px 34px -16px var(--danger); }
.vote-card[aria-pressed="true"] .avatar::after {
  content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 2px dashed var(--danger); animation: spin 6s linear infinite;
}
.vote-card[aria-pressed="true"]::before {
  content: "CIBLE"; position: absolute; top: 8px; right: 8px; font: 800 9px/1 var(--font-display); letter-spacing: .1em;
  color: #fff; background: var(--danger); padding: 4px 6px; border-radius: 6px;
}

/* ---------- révélations ---------- */
.speedlines {
  position: fixed; inset: -50%; z-index: -1; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .08) 0deg 1.4deg, transparent 1.4deg 7deg);
  -webkit-mask-image: radial-gradient(circle, transparent 14%, #000 58%); mask-image: radial-gradient(circle, transparent 14%, #000 58%);
  animation: spin 90s linear infinite;
}
.reveal-name { font: 900 clamp(28px, 9vw, 52px)/1.05 var(--font-display); text-transform: uppercase; overflow-wrap: anywhere; }
.reveal-sub { color: var(--muted); font-size: 16px; }
.suspense { font: 900 44px/1 var(--font-display); letter-spacing: .3em; color: var(--muted); animation: blink .6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.stamp {
  display: inline-block; padding: .16em .42em; border: 5px solid currentColor; border-radius: 14px;
  font: 900 clamp(24px, 8vw, 54px)/1 var(--font-display); text-transform: uppercase; letter-spacing: .02em;
  transform: rotate(-8deg); animation: stamp .55s cubic-bezier(.2, 1.7, .4, 1) both;
  background: rgba(0, 0, 0, .25); text-shadow: 0 0 30px currentColor;
}
.stamp.civil { color: var(--civil); }
.stamp.imposteur { color: var(--imp); }
.stamp.mrwhite { color: var(--white); }
.stamp.neutral { color: var(--muted); font-size: clamp(20px, 7vw, 34px); }
.stamp.ok { color: var(--ok); }
.stamp.ko { color: var(--danger); }
@keyframes stamp { from { transform: rotate(-8deg) scale(3.2); opacity: 0; } }
.shake { animation: shake .5s; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-9px); } 40%, 60% { transform: translateX(9px); }
}
.flash { position: fixed; inset: 0; z-index: 40; pointer-events: none; background: var(--c, #fff); animation: flash .7s ease-out forwards; }
@keyframes flash { from { opacity: .55; } to { opacity: 0; } }
.remaining { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.crack { position: relative; }
.crack::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: linear-gradient(115deg, transparent 46%, rgba(0, 0, 0, .85) 47%, rgba(0, 0, 0, .85) 49%, transparent 50%),
              linear-gradient(35deg, transparent 56%, rgba(0, 0, 0, .7) 57%, rgba(0, 0, 0, .7) 58.5%, transparent 59.5%);
  animation: enter .2s .35s both;
}

/* ---------- fin de partie ---------- */
.victory { text-align: center; padding: 22px 0 10px; }
.victory .crown { font-size: 54px; line-height: 1; animation: pop-in .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.victory .team { font: 900 clamp(32px, 11vw, 74px)/.95 var(--font-display); text-transform: uppercase; letter-spacing: -.02em; margin: 10px 0 8px; }
.victory .team.civils { color: var(--civil); text-shadow: 0 0 40px rgba(34, 227, 255, .5); }
.victory .team.infiltres { color: var(--imp); text-shadow: 0 0 40px rgba(255, 61, 139, .55); }
.victory .team.mrwhite { color: var(--white); text-shadow: 0 0 40px rgba(255, 255, 255, .45); }
.words { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.word-card { padding: 14px 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.word-card .lbl { font: 800 10px/1.2 var(--font-display); letter-spacing: .14em; text-transform: uppercase; }
.word-card .w { font: 900 clamp(17px, 5.5vw, 26px)/1.1 var(--font-display); text-transform: uppercase; margin: 8px 0 4px; overflow-wrap: anywhere; }
.word-card .lic { color: var(--muted); font-size: 12px; }
.word-card.civil { border-color: rgba(34, 227, 255, .5); } .word-card.civil .lbl { color: var(--civil); }
.word-card.imposteur { border-color: rgba(255, 61, 139, .5); } .word-card.imposteur .lbl { color: var(--imp); }
.recap li.won { border-color: rgba(255, 210, 63, .5); }
.confetti { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 15px; border-radius: 2px; animation: fall var(--d, 3s) var(--delay, 0s) cubic-bezier(.25, .6, .5, 1) forwards; }
@keyframes fall { to { transform: translate3d(var(--x, 0), 110dvh, 0) rotate(var(--r, 720deg)); } }
.tally { display: grid; gap: 6px; }
.tally div { display: flex; align-items: center; gap: 10px; }
.tally .bar { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.tally .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), var(--yellow)); border-radius: 99px; }
.tally b { min-width: 2ch; text-align: right; font-family: var(--font-display); }

/* ---------- feuille modale ---------- */
.sheet-bg {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(5, 4, 10, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .2s both;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: min(100%, 580px); max-height: 92dvh; overflow: auto; padding: 20px 16px calc(20px + var(--safe-b));
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 26px 26px 0 0; animation: up .32s var(--ease) both;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet h2 { margin: 0 0 6px; font: 900 20px/1.15 var(--font-display); text-transform: uppercase; }
.sheet p { color: var(--muted); margin: 0 0 16px; }
.sheet .stack { display: grid; gap: 10px; }
.sheet .pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 14px; }
@media (min-width: 640px) { .sheet-bg { align-items: center; } .sheet { border-radius: 26px; } }

.toast {
  position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); z-index: 60; transform: translateX(-50%);
  padding: 10px 16px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--line-2);
  box-shadow: var(--shadow); font-weight: 600; animation: up .25s var(--ease) both; max-width: calc(100% - 32px);
}

/* ---------- accueil ---------- */
.hero { text-align: center; padding: 18px 0 8px; }
.hero .tagline {
  font: 700 clamp(14px, 4vw, 18px)/1.45 var(--font-display); text-transform: uppercase; letter-spacing: .02em;
  max-width: 30ch; margin: 44px auto 26px;
}
.hero .tagline em { font-style: normal; color: var(--pink); }
.hero-actions { display: grid; gap: 10px; max-width: 440px; margin: 0 auto; }
.stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 20px 0 6px; color: var(--muted); font-size: 13px; }
.stats b { color: var(--text); font-family: var(--font-display); }
.demo { position: relative; display: flex; justify-content: center; gap: 16px; margin: 30px 0 4px; min-height: 210px; }
.mini-card {
  width: 148px; aspect-ratio: 3 / 4; border-radius: 18px; padding: 14px 12px; display: flex; flex-direction: column; justify-content: space-between; text-align: left;
  background: linear-gradient(170deg, #1d1840, #0f0c22); border: 1px solid var(--line-2); box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .9);
  transition: transform .5s var(--ease);
}
.mini-card.l { transform: rotate(-7deg) translateY(6px); border-color: rgba(34, 227, 255, .45); }
.mini-card.r { transform: rotate(6deg); border-color: rgba(255, 61, 139, .5); }
.mini-card .lbl { font: 800 9px/1.2 var(--font-display); letter-spacing: .16em; text-transform: uppercase; }
.mini-card.l .lbl { color: var(--civil); } .mini-card.r .lbl { color: var(--imp); }
.mini-card .w { font: 900 19px/1.1 var(--font-display); text-transform: uppercase; overflow-wrap: anywhere; }
.mini-card .lic { font-size: 11px; color: var(--muted); }
.demo .vs {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-8deg); z-index: 2;
  font: 900 15px/1 var(--font-display); padding: 8px 10px; border-radius: 10px; color: #12051a; background: var(--yellow); box-shadow: 3px 3px 0 var(--pink);
}
.demo-caption { text-align: center; color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.swap { animation: swap .5s var(--ease) both; }
@keyframes swap { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.home-grid { display: grid; gap: 14px; margin-top: 34px; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.steps li::before { content: counter(step, decimal-leading-zero); font: 900 22px/1 var(--font-display); color: var(--pink); padding-top: 2px; width: 2.1em; }
.steps b { display: block; }
.steps span { color: var(--muted); font-size: 14px; }
.role-cards { display: grid; gap: 10px; }
.role-card { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 14px; border-radius: 18px; background: var(--bg-2); border: 1px solid var(--line); }
.role-card .ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; }
.role-card.civil .ico { background: rgba(34, 227, 255, .14); box-shadow: inset 0 0 0 1px rgba(34, 227, 255, .4); }
.role-card.imposteur .ico { background: rgba(255, 61, 139, .14); box-shadow: inset 0 0 0 1px rgba(255, 61, 139, .45); }
.role-card.mrwhite .ico { background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.role-card b { font: 800 14px/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .04em; }
.role-card.civil b { color: var(--civil); } .role-card.imposteur b { color: var(--imp); } .role-card.mrwhite b { color: var(--white); }
.role-card p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.marquee { overflow: hidden; margin: 30px -16px 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee .track { display: flex; gap: 10px; width: max-content; animation: scroll 70s linear infinite; }
.marquee .track span { padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); white-space: nowrap; font-weight: 700; font-size: 14px; }
@keyframes scroll { to { transform: translateX(-50%); } }
.footer-link { text-align: center; margin-top: 26px; font-size: 14px; }
.footer-link a { color: var(--muted); }

/* ---------- règles ---------- */
.rules section { margin-bottom: 12px; }
.rules h2 { display: flex; gap: 12px; align-items: baseline; margin: 0 0 8px; font: 800 16px/1.25 var(--font-display); text-transform: uppercase; }
.rules h2 span { color: var(--pink); }
.rules p, .rules li { color: #d9d6ee; }
.rules ul { padding-left: 20px; margin: 6px 0 0; }
.rules li { margin: 4px 0; }

/* ---------- chargement ---------- */
.loading { min-height: 100dvh; display: grid; place-items: center; text-align: center; color: var(--muted); }
.loading .spinner { width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 50%; border: 4px solid var(--surface-3); border-top-color: var(--pink); animation: spin 1s linear infinite; }

/* ---------- écrans larges ---------- */
@media (min-width: 760px) {
  .home-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .home-grid .span { grid-column: 1 / -1; }
  .hero { padding-top: 36px; }
  .demo { min-height: 240px; }
  .mini-card { width: 170px; }
}
@media (max-width: 380px) {
  .role-row .count { width: 112px; }
  .role-row .stepper button { width: 38px; }
  .btn-row { grid-template-columns: 1fr; }
  .words { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* compléments */
.stack { display: grid; gap: 10px; }
.avatar.md { width: 64px; height: 64px; font-size: 25px; }
.recap li { align-items: flex-start; }
.recap li .badge { margin-top: 4px; }
