:root {
  --bg: #0b0706; --card: rgba(24, 15, 11, .82); --card2: rgba(40, 26, 18, .9); --line: rgba(255, 170, 80, .22);
  --ember: #ff8a1f; --gold: #ffd27a; --text: #f6ece0; --muted: #b9a592; --good: #5fd08a; --bad: #ff5d4d;
  --display: 'Cinzel', 'Trajan Pro', Georgia, serif; --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button, .btn, .chip, [data-act], [data-ui] { touch-action: manipulation; -webkit-touch-callout: none; }
button, .btn, .chip, .timer, .brand { -webkit-user-select: none; user-select: none; }
body { overscroll-behavior-y: none; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.45; }
body { min-height: 100dvh; }
#bg { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; z-index: 0; background: #000; transition: filter .6s; }
#veil { position: fixed; inset: 0; z-index: 1; pointer-events: none; transition: background .6s;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.05) 0%, rgba(0,0,0,.35) 55%, rgba(0,0,0,.8) 100%); }
body:not([data-screen="intro"]) #veil { background: rgba(8, 4, 3, .6); }

#app { min-height: 100dvh; position: relative; z-index: 2; }
h1, h2, h3 { margin: 0 0 .4rem; font-family: var(--display); letter-spacing: .02em; line-height: 1.15; }
h2 { font-size: 1.45rem; } h3 { font-size: 1.05rem; color: var(--gold); }
p { margin: .35rem 0; }
.muted { color: var(--muted); } .small { font-size: .82rem; } .center { text-align: center; }
em { color: var(--muted); font-style: normal; font-size: .85em; }

/* ── accueil ── */
.intro { position: relative; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; text-align: center; }
.intro-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 760px; }
.kicker { text-transform: uppercase; letter-spacing: .28em; font-size: .72rem; color: var(--gold); text-shadow: 0 1px 8px #000; margin: 0; }
.title { font-size: clamp(2.6rem, 11vw, 6.2rem); font-weight: 900; margin: 0; color: #fff3df;
  text-shadow: 0 0 22px rgba(255, 140, 30, .75), 0 0 60px rgba(255, 90, 0, .45), 0 3px 12px #000; }
.hook { font-size: clamp(1rem, 3.2vw, 1.3rem); color: #ffe9c9; text-shadow: 0 2px 10px #000; margin: 0 0 6px; }
.games-line { font-size: .85rem; color: #e8d3bb; text-shadow: 0 2px 8px #000; margin-top: 18px; }
.sound { position: absolute; right: 14px; top: 14px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: rgba(0,0,0,.45); color: #fff; font-size: 1.2rem; cursor: pointer; }

/* ── boutons / champs ── */
.btn { display: block; width: 100%; padding: 13px 16px; margin: 8px 0; border-radius: 12px; border: 1px solid var(--line); background: var(--card2);
  color: var(--text); font: 600 1rem var(--body); cursor: pointer; transition: transform .08s, background .15s, border-color .15s; }
.btn:hover:not(:disabled) { border-color: var(--ember); } .btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #ff9d3c, #e2650a); border-color: #ffb866; color: #1a0c04; box-shadow: 0 6px 22px rgba(255, 120, 20, .35); }
.btn.danger { background: rgba(120, 25, 15, .55); border-color: rgba(255, 93, 77, .6); }
.btn.xl { width: auto; min-width: 240px; padding: 16px 38px; font-size: 1.2rem; font-family: var(--display); letter-spacing: .12em; text-transform: uppercase; border-radius: 999px; animation: pulse 2.4s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 18px rgba(255,120,20,.5); } 50% { box-shadow: 0 0 42px rgba(255,150,40,.9); } }
.btn.sm { display: inline-block; width: auto; padding: 9px 14px; margin: 4px; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; font: inherit; cursor: pointer; padding: 10px; display: block; margin: 8px auto; }
.link.danger { color: #e77; }
.ghost { background: rgba(0,0,0,.35); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 7px 13px; cursor: pointer; font: 600 .85rem var(--body); }
.field { display: block; margin: 10px 0; } .field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 5px; }
input[type=text], input:not([type]), textarea { width: 100%; padding: 12px 13px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.45);
  color: var(--text); font: 1rem var(--body); }
input:focus, textarea:focus { outline: 2px solid var(--ember); outline-offset: 1px; }
.codein { text-transform: uppercase; letter-spacing: .4em; text-align: center; font-weight: 700; font-size: 1.3rem; }
.err { color: var(--bad); min-height: 1.2em; font-size: .9rem; text-align: center; }
.or { text-align: center; color: var(--muted); font-size: .85rem; margin: 6px 0; }
.check { display: flex; gap: 10px; align-items: center; padding: 8px 4px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--ember); flex: none; }

/* ── structure ── */
.center-screen { min-height: 100dvh; display: grid; place-items: center; padding: 20px 16px; }
.join { width: min(420px, 100%); }
.shell { max-width: 760px; margin: 0 auto; padding: 0 16px 60px; padding-top: env(safe-area-inset-top); }
.top { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 0; }
.brand { font-family: var(--display); font-weight: 700; color: var(--gold); display: flex; gap: 8px; align-items: center; font-size: .95rem; }
.right { display: flex; gap: 8px; align-items: center; }
.code { background: rgba(0,0,0,.4); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 7px 12px; font: 600 .85rem var(--body); cursor: pointer; }
.code b { letter-spacing: .15em; color: var(--gold); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #744; display: inline-block; } .dot.on { background: var(--good); box-shadow: 0 0 8px var(--good); }
.players { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 0 14px; }
.cnt { font-size: .8rem; color: var(--muted); margin-right: 4px; }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: .88rem; font-weight: 600; }
.chip.me { border-color: var(--ember); color: var(--gold); } .chip.off { opacity: .4; text-decoration: line-through; }
.stage { display: block; }
.gametitle { font-family: var(--display); font-size: 1.5rem; text-align: center; color: var(--gold); margin: 4px 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 12px 0; backdrop-filter: blur(6px); }
.card h3 { margin-bottom: 6px; }
.row { display: flex; gap: 8px; } .row .btn { margin: 4px 0; } .between { justify-content: space-between; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; } .chips .btn { width: auto; flex: 1 1 140px; margin: 4px 0; }

/* ── salon ── */
.invite .bigcode { font-family: var(--display); font-size: 3rem; font-weight: 900; letter-spacing: .25em; color: var(--gold); text-shadow: 0 0 18px rgba(255,140,30,.5); margin: 4px 0 8px; padding-left: .25em; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.game { text-align: center; margin: 0; display: flex; flex-direction: column; } .game p { flex: 1; color: #dccbb8; font-size: .92rem; }
.game { padding: 0 0 16px; overflow: hidden; } .game > :not(.gimg) { margin-left: 16px; margin-right: 16px; } .game h3 { margin-top: 12px; }
.gimg { height: 150px; background: #000 center / cover no-repeat; position: relative; border-bottom: 1px solid var(--line); }
.gimg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(24,15,11,.95)); }
.gimg .ge { position: absolute; z-index: 1; left: 12px; bottom: 6px; font-size: 2.2rem; filter: drop-shadow(0 2px 6px #000); }
.gbanner { height: 130px; border-radius: 16px; border: 1px solid var(--line); background: #000 center / cover no-repeat; position: relative; overflow: hidden; margin: 4px 0 12px; display: flex; align-items: flex-end; justify-content: center; }
.gbanner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.1), rgba(0,0,0,.8)); }
.gbanner .gametitle { position: relative; z-index: 1; margin: 0 0 10px; text-shadow: 0 2px 12px #000; }

/* ── minuteur ── */
.timer { position: sticky; top: 0; z-index: 5; height: 28px; margin: 8px 0; border-radius: 999px; background: rgba(0,0,0,.6); border: 1px solid var(--line); overflow: hidden; }
.timer i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #e2650a, #ffb23c); transition: width .2s linear; }
.timer span { position: relative; display: block; text-align: center; line-height: 26px; font-weight: 700; font-size: .85rem; }
.timer.low i { background: linear-gradient(90deg, #b3180b, #ff5d4d); }

/* ── jeux ── */
.letter { font-family: var(--display); font-size: 6rem; font-weight: 900; line-height: 1; color: var(--gold); text-shadow: 0 0 28px rgba(255,140,30,.6); } .letter.sm { font-size: 3rem; }
.stop { font-size: 1.5rem; font-family: var(--display); letter-spacing: .15em; padding: 18px; margin-top: 16px; }
.big-msg { font-size: 1.15rem; font-weight: 700; }
.answers { list-style: none; margin: 0; padding: 0; }
.answers li { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; align-items: center; padding: 9px 4px; border-bottom: 1px solid rgba(255,255,255,.06); }
.answers li:last-child { border: 0; } .answers .nm { color: var(--muted); font-size: .85rem; }
.answers li.ok b { color: var(--good); } .answers li.ko { opacity: .6; text-decoration: line-through; } .answers li.ko b { color: var(--bad); text-decoration: none; }
.answers li.tap { cursor: pointer; } .answers li.tap:hover { background: rgba(255,255,255,.05); }
.score { list-style: none; margin: 0; padding: 0; } .score li { display: flex; gap: 10px; padding: 8px 6px; border-radius: 8px; align-items: center; }
.score li.me { background: rgba(255,138,31,.15); } .score .rk { width: 2rem; text-align: center; } .score .nm { flex: 1; } .score b { color: var(--gold); font-size: 1.1rem; }
.fact { font-size: 1.15rem; color: #fff1d6; font-weight: 600; }
.truth { border-color: rgba(95, 208, 138, .55); background: rgba(14, 40, 25, .82); } .liar { border-color: rgba(255, 93, 77, .6); background: rgba(55, 14, 10, .85); }
.st .nm, .opt .nm { font-weight: 700; } .st.sel, .opt.sel { border-color: var(--ember); }
.st.liarcard { border-color: rgba(255, 93, 77, .6); } .votes { color: var(--gold); font-weight: 700; font-size: .9rem; }
.opt .ans { font-size: 1.1rem; font-weight: 600; margin: 4px 0 8px; }
.opt .row .btn { flex: 1; }
.word h1 { font-size: clamp(2.2rem, 10vw, 3.4rem); color: #fff3df; text-shadow: 0 0 20px rgba(255,140,30,.6); margin: 6px 0; }
.forbid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0; }
.forbid span { background: rgba(120,25,15,.6); border: 1px solid rgba(255,93,77,.6); border-radius: 999px; padding: 6px 14px; font-weight: 700; }
.blanks { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; margin-top: 8px; } .blanks i { width: 18px; height: 3px; background: var(--gold); border-radius: 2px; }
.feed { list-style: none; margin: 8px 0; padding: 0; } .feed li { padding: 6px 10px; border-radius: 8px; background: rgba(0,0,0,.35); margin: 4px 0; } .feed li.good { background: rgba(14,40,25,.8); }
.emoji { font-size: 3.2rem; } .rolecard h2 { font-size: 1.8rem; } .rolecard { text-align: center; }
.night { background: rgba(10, 12, 38, .88); border-color: rgba(120, 140, 255, .4); } .day { border-color: rgba(255, 210, 122, .5); }
.plist { list-style: none; margin: 0; padding: 0; } .plist li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 4px; border-bottom: 1px solid rgba(255,255,255,.06); }
.plist li.dead { opacity: .55; } .death { font-size: 1.05rem; }
.radios { margin: 4px 0 10px; max-height: 240px; overflow: auto; }

/* ── divers ── */
.spinner { width: 44px; height: 44px; border: 4px solid rgba(255,255,255,.15); border-top-color: var(--ember); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: #000d; border: 1px solid var(--ember); padding: 10px 18px; border-radius: 999px; z-index: 50; }
@media (max-width: 420px) { .brand span { display: none; } .code b { letter-spacing: .08em; } }
@media (prefers-reduced-motion: reduce) { .btn.xl { animation: none; } }

#playbtn { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 20; padding: 12px 22px; border-radius: 999px; border: 1px solid var(--ember); background: rgba(0,0,0,.7); color: #fff; font: 700 1rem var(--body); cursor: pointer; }
#playbtn[hidden] { display: none; }
.intro-inner { position: relative; }
.intro-inner::before { content: ''; position: absolute; inset: -50px -70px; background: radial-gradient(ellipse at center, rgba(0,0,0,.55) 0%, rgba(0,0,0,.25) 50%, transparent 72%); z-index: -1; pointer-events: none; }
.game .btn { width: calc(100% - 32px); }
.gimg { height: 170px; background-position: center 35%; }

#bgimg { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; z-index: 0; background: #000; }
#bgimg[hidden] { display: none; }

/* ───── téléphone (iPhone, Pixel…) ───── */
#bg, #bgimg { height: 100vh; height: 100lvh; }
.intro { min-height: 100vh; min-height: 100svh; padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.center-screen { min-height: 100vh; min-height: 100svh; padding-top: max(20px, env(safe-area-inset-top)); padding-bottom: max(20px, env(safe-area-inset-bottom)); }
.shell { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); padding-bottom: max(60px, calc(env(safe-area-inset-bottom) + 40px)); }
.sound { top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); }
.timer { top: max(0px, env(safe-area-inset-top)); }
input, textarea, select { font-size: 16px; } /* évite le zoom automatique d'iOS */
.btn, .ghost, .code, .link { min-height: 44px; }
.btn.sm { min-height: 44px; }
.check { min-height: 44px; }
.answers li.tap { min-height: 44px; }
@media (max-width: 700px) {
  .card { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(20, 12, 9, .9); }
  .title { font-size: clamp(2.4rem, 13vw, 4rem); }
  .btn.xl { width: min(100%, 320px); }
  .games-line { font-size: .78rem; line-height: 1.7; }
  .intro-inner::before { inset: -30px -20px; }
  .grid { grid-template-columns: 1fr; }
  .gimg { height: 150px; }
  .invite .bigcode { font-size: 2.4rem; letter-spacing: .2em; }
  .letter { font-size: 5rem; }
  .answers li { grid-template-columns: .9fr 1.3fr auto; gap: 6px; font-size: .92rem; }
  .gbanner { height: 100px; }
}
@media (max-width: 360px) {
  .shell { padding-left: 10px; padding-right: 10px; }
  .chip { padding: 5px 10px; font-size: .82rem; }
  .code { padding: 7px 10px; font-size: .8rem; }
  h2 { font-size: 1.25rem; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .intro-inner { gap: 8px; } .title { font-size: 2.4rem; } .hook, .games-line { display: none; }
}
@media (max-width: 700px) { .kicker { letter-spacing: .14em; font-size: .68rem; } }

.ver { position: absolute; left: 12px; bottom: max(8px, env(safe-area-inset-bottom)); font-size: .65rem; color: rgba(255,255,255,.3); }

.chip.add { cursor: pointer; color: var(--gold); border-style: dashed; border-color: var(--ember); background: transparent; font-family: inherit; min-width: 40px; min-height: 32px; }
.chip.add:active { transform: scale(.94); } .chip.add:disabled { opacity: .35; }

.gimg .ge { text-shadow: 0 2px 8px #000; }
.steps { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; flex-wrap: wrap; }
.steps span { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: .8rem; opacity: .5; }
.steps span.on { opacity: 1; border-color: var(--ember); color: var(--gold); } .steps span.done { opacity: .35; text-decoration: line-through; }
.script { font-style: italic; color: var(--gold); border-left: 3px solid var(--ember); padding-left: 10px; margin: 6px 0 12px; }
.wordcard h1 { margin: 6px 0; }
