@font-face { font-family: Archivo; src: url(fonts/Archivo-100-900-latin.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url(fonts/JetBrainsMono-400-latin.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
:root { --bg: #0a0a0a; --surface: rgba(18, 18, 18, .82); --text: #f5f5f0; --muted: #8f8f8a; --line: #262624; --accent: #d3fd50; --on-accent: #0a0a0a; --red: #ff6b5a; --ease: cubic-bezier(.2, .8, .2, 1); --pad: clamp(16px, 4vw, 56px); color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 400 17px/1.55 Archivo, system-ui, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
#orb { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; padding: 80px 0; }
.kicker { font: 400 12px/1.2 'JetBrains Mono', monospace; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
.kicker::before { content: '// '; }
h1 { font-size: clamp(46px, 9vw, 120px); font-weight: 900; letter-spacing: -.04em; line-height: .92; text-transform: uppercase; margin: 0 0 26px; }
mark { background: none; color: transparent; -webkit-text-stroke: max(1px, .022em) var(--accent); }
.h { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 14px; }
.lead { font-size: clamp(17px, 1.8vw, 21px); color: color-mix(in srgb, var(--text) 82%, var(--muted)); max-width: 52ch; margin: 0 0 30px; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px; padding: 14px var(--pad); backdrop-filter: blur(12px); background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--line); }
.logo { font: 900 22px/1 Archivo; letter-spacing: -.04em; text-decoration: none; color: var(--text); }
.logo span { color: var(--accent); }
.top__code { margin-left: auto; font-size: 12px; letter-spacing: .14em; color: var(--muted); }
.link { background: none; border: 0; padding: 6px 0; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); transition: color .25s; }
.link:hover { color: var(--accent); }
.top .link:only-of-type { margin-left: 0; }

main { max-width: 1180px; margin: 0 auto; padding: clamp(30px, 6vw, 70px) var(--pad) 90px; }
.screen, .home { animation: rise .6s var(--ease) backwards; }
.no-anim { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 15px 22px; border: 0; border-radius: 4px; background: var(--accent); color: var(--on-accent); font: 700 13px/1 'JetBrains Mono', monospace; letter-spacing: .16em; text-transform: uppercase; transition: background .25s, color .25s, transform .25s var(--ease), box-shadow .25s, opacity .25s; }
.btn:hover:not(:disabled) { background: var(--text); transform: translateY(-2px); }
.btn:disabled { opacity: .35; }
.btn--ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn--ghost:hover:not(:disabled) { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.btn--wide { width: 100%; margin-top: 14px; }
.btn--sm { padding: 11px 16px; font-size: 11px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: clamp(18px, 3vw, 28px); backdrop-filter: blur(6px); margin-bottom: 18px; }
.lbl { display: block; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
input { width: 100%; padding: 14px 16px; background: #0d0d0d; border: 1px solid var(--line); border-radius: 4px; transition: border-color .25s; }
input:focus { outline: none; border-color: var(--accent); }
input::placeholder { color: #5a5a56; }

/* Accueil */
.home { max-width: 640px; }
.home form { margin-bottom: 18px; }
.home #name { font-size: 20px; margin-bottom: 20px; }
.join { display: flex; gap: 10px; }
.code-in { flex: 1; font-size: 20px; letter-spacing: .3em; text-transform: uppercase; }
.or { text-align: center; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 18px 0 4px; display: flex; align-items: center; gap: 12px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Salon */
.codebox { text-align: center; margin-bottom: 40px; }
.code-big { display: block; margin: 0 auto 16px; background: none; border: 0; font-size: clamp(64px, 16vw, 132px); font-weight: 700; letter-spacing: .14em; line-height: 1; color: var(--text); transition: color .25s; }
.code-big:hover { color: var(--accent); }
.cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(20px, 4vw, 48px); align-items: start; }
.players { list-style: none; margin: 0 0 18px; padding: 0; border-top: 1px solid var(--line); }
.pl { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 13px 4px; border-bottom: 1px solid var(--line); transition: padding-left .3s var(--ease), opacity .3s; }
.pl:hover { padding-left: 10px; }
.pl__name { font-weight: 700; }
.pl__score { margin-left: auto; font-size: 13px; color: var(--muted); }
.pl.is-me .pl__name { color: var(--accent); }
.pl.is-out { opacity: .55; }
.pl.is-out .pl__name { text-decoration: line-through; text-decoration-color: var(--muted); }
.tag { font: 400 10px/1 'JetBrains Mono', monospace; letter-spacing: .12em; text-transform: uppercase; padding: 5px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tag--me { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.tag--off { border-style: dashed; }
.tag--ok { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.tag--civil { color: var(--text); }
.tag--undercover { color: var(--red); border-color: color-mix(in srgb, var(--red) 50%, var(--line)); }
.tag--mrwhite { color: var(--bg); background: var(--text); border-color: var(--text); }
.x { background: none; border: 1px solid var(--line); width: 28px; height: 28px; border-radius: 50%; color: var(--muted); line-height: 1; transition: color .2s, border-color .2s; }
.x:hover { color: var(--red); border-color: var(--red); }
.events { list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--muted); }
.events li { padding: 5px 0; }
.events li:first-child { color: var(--text); }

.settings { display: grid; gap: 18px; }
.set { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.set .lbl { margin: 0; }
.set--cats { display: block; }
.set--cats .lbl { margin-bottom: 10px; }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper b { font-size: 20px; min-width: 1ch; text-align: center; }
.step { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: none; font-size: 18px; transition: border-color .2s, color .2s; }
.step:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.step:disabled { opacity: .3; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 9px 14px; font: 400 12px/1 'JetBrains Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); transition: background .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.seg button:disabled { opacity: .35; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; font-size: 13px; color: var(--muted); transition: border-color .2s, color .2s, background .2s; }
.chip:hover:not(:disabled) { border-color: var(--accent); color: var(--text); }
.chip[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: var(--accent); color: var(--text); }
.chip:disabled:not([aria-pressed="true"]) { opacity: .45; }
.hint { margin: 0; font-size: 12px; color: var(--muted); }
.hint.is-warn { color: var(--red); }
.wait { color: var(--muted); font-size: 13px; text-align: center; padding: 16px; border: 1px dashed var(--line); border-radius: 4px; margin-top: 14px; }
.leave { display: block; margin: 50px auto 0; }

/* Partie */
.word { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: clamp(20px, 3vw, 30px); margin-bottom: 18px; backdrop-filter: blur(6px); transition: border-color .3s; }
.word:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.word__w { font-size: clamp(38px, 7vw, 64px); font-weight: 900; letter-spacing: -.035em; line-height: 1; margin: 4px 0 12px; text-transform: uppercase; overflow-wrap: anywhere; }
.word.is-shown .word__w { color: var(--accent); }
.word.is-white { border-color: var(--text); }
.word p { margin-top: 0; }
.stage .h { font-size: clamp(26px, 4vw, 38px); font-weight: 900; text-transform: uppercase; letter-spacing: -.03em; }
.send { display: flex; gap: 10px; margin: 6px 0 16px; }
.send input { flex: 1; min-width: 0; font-size: 18px; }
.order { list-style: none; margin: 18px 0 6px; padding: 0; border-top: 1px solid var(--line); }
.order li { display: flex; justify-content: space-between; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); transition: padding-left .3s var(--ease), color .3s; }
.order li.is-cur { padding-left: 12px; color: var(--accent); font-weight: 700; }
.order li.is-cur::before { content: '▸'; }
.order li > span:first-of-type { margin-right: auto; }
.order li.is-out { opacity: .4; }
.clue { color: var(--muted); font-style: italic; text-align: right; overflow-wrap: anywhere; }
.order li.is-cur .clue { color: var(--accent); }
.votes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 16px 0; }
.vote { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; text-align: left; background: #0d0d0d; border: 1px solid var(--line); border-radius: 4px; transition: border-color .2s, background .2s, transform .25s var(--ease); }
.vote:hover { border-color: var(--accent); transform: translateY(-2px); }
.vote[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.vote[aria-pressed="true"] .clue { color: color-mix(in srgb, var(--on-accent) 70%, transparent); }
.vote .clue { text-align: left; font-size: 14px; }
.history summary { cursor: pointer; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.history ul { list-style: none; padding: 0; margin: 0 0 14px; }
.history li { padding: 4px 0; }
.history .kicker { margin-top: 16px; }

/* Fin */
.result { text-align: center; margin-bottom: 44px; }
.result h1 { font-size: clamp(38px, 7vw, 92px); margin-bottom: 18px; }
.result.is-civil h1 { color: var(--text); }
.result.is-imposteurs h1, .result.is-mrwhite h1 { color: transparent; -webkit-text-stroke: max(1px, .022em) var(--accent); }
.reveal { font-size: 14px; color: var(--muted); }
.reveal b { color: var(--accent); font-weight: 700; }
.rank { margin: 0 0 10px; padding: 0 0 0 26px; border-top: 1px solid var(--line); }
.rank li { padding: 12px 4px; border-bottom: 1px solid var(--line); }
.rank li::marker { font: 700 13px 'JetBrains Mono', monospace; color: var(--muted); }
.rank li > * { vertical-align: middle; }
.rank li b { float: right; }
.rank li.is-me span { color: var(--accent); font-weight: 700; }
.endbtns { display: grid; gap: 0; }

/* Règles */
.rules { max-width: 620px; width: calc(100% - 32px); background: #111; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: clamp(22px, 4vw, 38px); }
.rules::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px); }
.rules h2 { font-size: 40px; font-weight: 900; text-transform: uppercase; letter-spacing: -.035em; line-height: 1; margin: 0 0 18px; }
.rules ul { padding-left: 18px; }
.rules li { margin-bottom: 8px; }
.rules li::marker { color: var(--accent); }
.close { float: right; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; z-index: 30; max-width: calc(100% - 32px); padding: 13px 18px; border-radius: 4px; background: var(--text); color: var(--bg); font-size: 13px; transition: opacity .3s, transform .3s var(--ease); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Récap des tours : indices et votes */
.recap { padding-bottom: 6px; }
.ballots ul { list-style: none; padding: 0; margin: 4px 0 10px; display: grid; gap: 4px; }
.ballots li { display: flex; align-items: center; gap: 8px; }
.ballots .fx-av { width: 20px; height: 20px; font-size: 10px; }
.arrow { color: var(--muted); }
.pl .fx-av { margin-right: 2px; }

/* Élimination : plein écran, le rôle se retourne */
.elim { position: fixed; inset: 0; z-index: 52; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px; text-align: center; background: rgba(8, 8, 8, .9); backdrop-filter: blur(8px); animation: elim-in .45s var(--ease); cursor: pointer; }
.elim.is-out { animation: elim-out .4s var(--ease) forwards; }
@keyframes elim-in { from { opacity: 0; } }
@keyframes elim-out { to { opacity: 0; } }
.elim__name { font: 900 clamp(46px, 11vw, 120px) / .95 Archivo; letter-spacing: -.045em; text-transform: uppercase; margin: 0; animation: elim-name .7s cubic-bezier(.2, 1.2, .3, 1) .1s backwards; overflow-wrap: anywhere; }
@keyframes elim-name { from { opacity: 0; transform: scale(1.6); filter: blur(10px); } }
.elim__sub { color: var(--muted); letter-spacing: .2em; text-transform: uppercase; font-size: 13px; margin: 6px 0 22px; animation: elim-in .6s .6s backwards; }
.elim__card { width: min(320px, 78vw); aspect-ratio: 2.2; perspective: 900px; animation: elim-in .5s .9s backwards; }
.elim__in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.3, 1.4, .5, 1); }
.elim__card.is-rev .elim__in { transform: rotateY(180deg); }
.elim__front, .elim__back { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 10px; backface-visibility: hidden; -webkit-backface-visibility: hidden; font: 900 clamp(28px, 6vw, 44px) / 1 Archivo; text-transform: uppercase; letter-spacing: -.03em; }
.elim__front { background: #151515; border: 1px solid var(--line); color: var(--muted); }
.elim__back { transform: rotateY(180deg); background: var(--c); color: #0a0a0a; box-shadow: 0 0 60px color-mix(in srgb, var(--c) 40%, transparent); }
.word.is-white { border-color: var(--text); }
@media (prefers-reduced-motion: reduce) { .elim, .elim__name, .elim__sub, .elim__card { animation: none; } .elim__in { transition: none; } }

@media (max-width: 820px) { .cols { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .screen, .home { animation: none; } * { transition: none !important; } }

/* en-tête sur une ligne sur téléphone (logo + code + son + règles) */
.logo { white-space: nowrap; }
@media (max-width: 520px) { .top { gap: 12px; } .logo { font-size: 18px; } .top__code { font-size: 10px; letter-spacing: .08em; white-space: nowrap; } .top .link { font-size: 11px; letter-spacing: .08em; } }
