/* Undercouverture : un seul thème, coloré et nocturne (ambiance soirée entre amis). */
:root {
  --bg1: #1b1035;
  --bg2: #35136b;
  --ink: #ffffff;
  --muted: #cbbfee;
  --glass: rgba(255, 255, 255, 0.09);
  --glass2: rgba(255, 255, 255, 0.16);
  --line: rgba(255, 255, 255, 0.16);
  --yellow: #ffd23f;
  --yellow-d: #d9a400;
  --pink: #ff5d8f;
  --green: #3ddc97;
  --red: #ff4d6d;
  --blue: #4dc9ff;
  --violet: #b388ff;
  --r: 22px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(120% 80% at 50% 0%, var(--bg2), var(--bg1) 70%) fixed, var(--bg1);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { cursor: default; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
h2 { font-size: 1.05rem; margin: 18px 4px 10px; color: var(--muted); font-weight: 800; letter-spacing: .02em; }
p { margin: 8px 0; line-height: 1.4; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; justify-content: center; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .12em; }
.row { display: flex; align-items: center; }
.gap { gap: 10px; flex-wrap: wrap; }

/* fond animé */
.blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blobs i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(70px); opacity: .35; animation: drift 22s ease-in-out infinite alternate; }
.blobs i:nth-child(1) { background: #ff5d8f; left: -20vmax; top: -25vmax; }
.blobs i:nth-child(2) { background: #4dc9ff; right: -25vmax; top: 20vh; animation-delay: -7s; opacity: .22; }
.blobs i:nth-child(3) { background: #ffd23f; left: 10vw; bottom: -40vmax; animation-delay: -14s; opacity: .16; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.15); } }

#app { max-width: 540px; margin: 0 auto; padding: 0 16px calc(28px + env(safe-area-inset-bottom)); }
.screen { min-height: 100dvh; padding-top: env(safe-area-inset-top); display: flex; flex-direction: column; }
.screen.center { align-items: center; justify-content: center; text-align: center; gap: 12px; }

/* barre du haut */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 0 4px; gap: 8px; }
.icon { width: 44px; height: 44px; border-radius: 50%; background: var(--glass); font-size: 1.25rem; display: grid; place-items: center; transition: transform .15s; }
.icon:active { transform: scale(.9); }
.codechip { background: var(--glass); border-radius: 999px; padding: 9px 16px; color: var(--muted); font-weight: 700; }
.codechip b { color: var(--yellow); letter-spacing: .15em; margin-left: 4px; }
.offline { background: #ff4d6d33; border: 1px solid #ff4d6d88; border-radius: 14px; padding: 10px 14px; margin: 6px 0; font-weight: 700; animation: pulse 1.6s infinite; }

/* boutons */
.btn {
  background: var(--yellow); color: #2b1600; font-weight: 900; border-radius: 18px;
  padding: 14px 20px; font-size: 1.05rem; box-shadow: 0 5px 0 var(--yellow-d), 0 10px 24px rgba(0,0,0,.25);
  transition: transform .08s, box-shadow .08s, filter .2s; min-height: 50px;
}
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--yellow-d); }
.btn:disabled { filter: grayscale(.8) brightness(.7); box-shadow: none; }
.btn.big { width: 100%; font-size: 1.2rem; padding: 18px; border-radius: 22px; }
.btn.sec { background: var(--glass2); color: var(--ink); box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.btn.ghost { background: transparent; color: var(--muted); box-shadow: none; border: 1.5px solid var(--line); }
.btn.small { padding: 9px 14px; min-height: 40px; font-size: .9rem; border-radius: 14px; }
.btn.danger { background: var(--red); color: #fff; box-shadow: 0 5px 0 #b3203d; }
.btn.go { background: linear-gradient(135deg, #3ddc97, #2ec4b6); color: #062b20; box-shadow: 0 5px 0 #1d8a6a, 0 10px 30px rgba(61,220,151,.35); }
.btn.go:not(:disabled) { animation: breathe 2.4s ease-in-out infinite; }
.link { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 12px; font-weight: 700; display: block; margin: 0 auto; }

.card { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 10px 0; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.note { background: var(--glass2); border-radius: 16px; padding: 12px 14px; margin: 10px 0; font-weight: 700; text-align: center; }
.note.dead { background: #ff4d6d2b; }

/* accueil */
.brand { text-align: center; padding: 14px 0 6px; }
.logo { width: 112px; height: 112px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff8fb1, #ff5d8f); display: inline-block; overflow: hidden; box-shadow: 0 0 0 5px rgba(255,255,255,.18), 0 14px 30px rgba(0,0,0,.35); }
.logo .spy { display: block; width: 100%; height: 100%; animation: sneak 4s ease-in-out infinite; transform-origin: 50% 90%; }
.logo .char { width: 100%; height: 100%; display: block; }
.brand h1 { font-size: clamp(2rem, 9vw, 2.8rem); font-weight: 900; letter-spacing: -.02em; background: linear-gradient(90deg, #ffd23f, #ff5d8f 55%, #b388ff); -webkit-background-clip: text; background-clip: text; color: transparent; margin-top: 6px; }
.tagline { color: var(--muted); font-weight: 700; margin-top: 4px; }
.profile { display: flex; gap: 14px; align-items: center; }
.avbtn { position: relative; flex: none; }
.avbtn .edit { position: absolute; right: -4px; bottom: -2px; background: var(--yellow); border-radius: 50%; width: 30px; height: 30px; display: grid; place-items: center; font-size: .9rem; box-shadow: 0 3px 8px rgba(0,0,0,.3); }
.namebox { flex: 1; min-width: 0; }
.namebox label { font-size: .85rem; color: var(--muted); font-weight: 800; }
.namebox .row { gap: 8px; margin-top: 6px; }
input { background: rgba(0,0,0,.25); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 16px; width: 100%; min-width: 0; outline: none; transition: border-color .2s, box-shadow .2s; }
input:focus { border-color: var(--yellow); box-shadow: 0 0 0 4px #ffd23f33; }
.dice { flex: none; }
.dice:active { animation: spin .4s; }
.actions { display: grid; gap: 12px; margin-top: 8px; }
.joinrow { display: flex; gap: 10px; padding: 10px; margin: 0; }
.codein { text-transform: uppercase; letter-spacing: .4em; font-weight: 900; font-size: 1.4rem; text-align: center; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.invited { text-align: center; border-color: #ffd23f88; background: #ffd23f1a; }
.foot a { color: inherit; }
.foot { text-align: center; color: var(--muted); opacity: .6; font-size: .8rem; margin-top: auto; padding-top: 18px; }

/* avatars */
.av { --s: 46px; width: var(--s); height: var(--s); border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 70%, white), var(--c)); display: inline-grid; place-items: center; flex: none; overflow: hidden; box-shadow: inset 0 -4px 0 rgba(0,0,0,.18), 0 4px 10px rgba(0,0,0,.25); position: relative; }
.av .em { font-size: calc(var(--s) * .58); line-height: 1; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.xs { --s: 24px; box-shadow: 0 0 0 2px var(--bg1); }
.av.sm { --s: 36px; }
.av.lg { --s: 64px; }
.av.xl { --s: 88px; }
.av.xxl { --s: 150px; box-shadow: 0 0 0 6px rgba(255,255,255,.2), 0 20px 50px rgba(0,0,0,.45); }
.av.bounce { animation: bob 3s ease-in-out infinite; }

/* salon */
.invite { text-align: center; }
.bigcode { display: flex; justify-content: center; gap: 10px; margin: 8px 0 14px; cursor: pointer; }
.bigcode span { width: 58px; height: 70px; border-radius: 16px; background: #fff; color: #2b0f5c; font-weight: 900; font-size: 2.3rem; display: grid; place-items: center; box-shadow: 0 6px 0 #c7b8f0; animation: wobble 3s ease-in-out infinite; animation-delay: calc(var(--i) * .15s); font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.bigcode.small span { width: 46px; height: 54px; font-size: 1.8rem; }
.invite .row { justify-content: center; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 8px; }
.chip { display: grid; justify-items: center; gap: 6px; background: var(--glass); border: 1px solid var(--line); border-radius: 20px; padding: 12px 6px 10px; position: relative; min-width: 0; text-align: center; }
.chip .av { --s: 54px; }
.chip .nm { font-weight: 800; font-size: .88rem; line-height: 1.15; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.chip .pts { font-size: .75rem; color: var(--yellow); font-weight: 800; white-space: nowrap; }
.chip.me { border-color: var(--yellow); background: #ffd23f1f; }
.chip.off { opacity: .5; }
.chip.dead { filter: grayscale(1); opacity: .55; }
.chip .badge { position: absolute; left: 6px; top: 6px; font-size: .8rem; }
.chip .x { position: absolute; right: 4px; top: 4px; }
.chip .x, .kickline .x { width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.3); font-size: .75rem; flex: none; color: var(--muted); }
.kickline { display: inline-flex; gap: 6px; align-items: center; background: var(--glass); border-radius: 999px; padding: 4px 4px 4px 12px; font-size: .85rem; margin: 3px; }
.chips.small { display: flex; flex-wrap: wrap; margin-top: 10px; }
.settings h2:first-child { margin-top: 2px; }
.counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.counts.two { grid-template-columns: repeat(2, 1fr); }
.count { background: rgba(0,0,0,.2); border-radius: 18px; padding: 10px 4px; text-align: center; display: grid; gap: 2px; justify-items: center; }
.count .ce { font-size: 1.7rem; }
.count b { font-size: 1.5rem; min-width: 26px; display: inline-block; }
.count small { color: var(--muted); font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 32px; height: 32px; border-radius: 50%; background: var(--glass2); font-size: 1.2rem; font-weight: 900; }
.stepper button:active { transform: scale(.85); background: var(--yellow); color: #2b1600; }
.packs { display: flex; flex-wrap: wrap; gap: 8px; }
.pack { background: rgba(0,0,0,.22); border: 1.5px solid var(--line); border-radius: 999px; padding: 9px 14px; font-weight: 800; font-size: .92rem; transition: transform .1s, background .2s; }
.pack.on { background: var(--yellow); color: #2b1600; border-color: var(--yellow); }
.pack:active:not(:disabled) { transform: scale(.94); }
.pack:disabled, .opt:disabled { opacity: .85; }
.opts { display: grid; gap: 8px; }
.opt { display: flex; align-items: center; gap: 12px; background: rgba(0,0,0,.22); border: 1.5px solid var(--line); border-radius: 18px; padding: 12px; text-align: left; transition: background .2s, border-color .2s; }
.opt .oe { font-size: 1.6rem; flex: none; }
.opt .ol { flex: 1; display: grid; }
.opt .ol small { color: var(--muted); font-size: .82rem; }
.opt .sw { width: 46px; height: 28px; border-radius: 99px; background: rgba(255,255,255,.18); position: relative; flex: none; transition: background .2s; }
.opt .sw::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: transform .25s cubic-bezier(.5, 1.8, .5, 1); }
.opt.on { border-color: #3ddc97aa; background: #3ddc971f; }
.opt.on .sw { background: var(--green); }
.opt.on .sw::after { transform: translateX(18px); }
.sticky { position: sticky; bottom: 0; padding: 14px 0 calc(6px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg1) 35%); display: grid; gap: 10px; margin-top: auto; z-index: 2; }
.waiting { text-align: center; font-weight: 800; color: var(--muted); padding: 14px; background: var(--glass); border-radius: 18px; margin: 0; }
.dots i { animation: blink 1.4s infinite; font-style: normal; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }

/* partie */
.gamehead { display: flex; justify-content: space-between; align-items: center; padding: 6px 4px; color: var(--muted); font-weight: 800; font-size: .9rem; }
.wordpill { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; width: 100%; background: var(--glass2); border-radius: 16px; padding: 12px; font-weight: 800; margin: 4px 0 8px; }
.wordpill b { color: var(--yellow); font-size: 1.15rem; }
.wordpill.ghost { background: #b388ff33; }
.trait { background: rgba(0,0,0,.25); border-radius: 999px; padding: 3px 10px; font-size: .85rem; }
.trait.big { display: block; text-align: center; border-radius: 16px; padding: 10px 14px; font-size: .95rem; margin: 8px 0; animation: pop .4s both; }
.gm { text-align: center; font-weight: 800; }
.hostbar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 14px 0 4px; }

/* carte à retourner */
.reveal { display: grid; gap: 14px; padding-top: 8px; }
.flip { perspective: 1200px; height: 300px; cursor: pointer; position: relative; }
.flip .face { position: absolute; inset: 0; border-radius: 28px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-content: center; text-align: center; padding: 22px; transition: transform .7s cubic-bezier(.3, 1.5, .5, 1); gap: 8px; }
.flip .front { background: repeating-linear-gradient(45deg, #ff5d8f, #ff5d8f 18px, #f0487d 18px, #f0487d 36px); box-shadow: 0 16px 40px rgba(0,0,0,.4), inset 0 0 0 6px rgba(255,255,255,.35); animation: tease 2.4s ease-in-out infinite; }
.flip .front .qm { font-size: 80px; }
.flip .front b { font-size: 1.3rem; }
.flip .back { background: #fff; color: #2b0f5c; transform: rotateY(180deg); box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.flip.flipped .front { transform: rotateY(-180deg); animation: none; }
.flip.flipped .back { transform: rotateY(0); }
.flip .back .muted { color: #7a6aa6; }
.secret { font-size: clamp(2.2rem, 11vw, 3.4rem); font-weight: 900; letter-spacing: -.02em; color: #5b1fd1; word-break: break-word; }
.role-ghost { font-size: 84px; }
.float { animation: floaty 2.6s ease-in-out infinite; display: inline-block; }
.waitlist { text-align: center; }
.minis { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.mini { position: relative; display: inline-block; transition: transform .3s, opacity .3s; }
.mini i { position: absolute; right: -4px; bottom: -4px; background: var(--green); color: #062b20; border-radius: 50%; width: 18px; height: 18px; font-size: .7rem; display: grid; place-items: center; font-style: normal; font-weight: 900; animation: pop .3s both; }
.mini:not(.ok) .av { opacity: .55; }

/* indices */
.speaker { text-align: center; padding: 12px 0 6px; display: grid; justify-items: center; gap: 10px; animation: pop .45s both; }
.spot { position: relative; width: 120px; height: 120px; display: grid; place-items: center; }
.spot::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; background: conic-gradient(from 0deg, #ffd23f, #ff5d8f, #b388ff, #4dc9ff, #ffd23f); animation: spin 3s linear infinite; opacity: .8; filter: blur(2px); }
.spot .av { position: relative; z-index: 1; box-shadow: 0 0 0 5px var(--bg1); }
.speaker.mine .spot::before { animation-duration: 1.2s; }
.ring { position: absolute; inset: -14px; width: calc(100% + 28px); height: calc(100% + 28px); transform: rotate(-90deg); z-index: 2; }
.ring circle { fill: none; stroke: rgba(255,255,255,.15); stroke-width: 8; }
.ring .pr { stroke: var(--yellow); stroke-linecap: round; stroke-dasharray: 339.3; transition: stroke-dashoffset .25s linear; }
.ring.hurry .pr { stroke: var(--red); }
.ring.hurry { animation: shake .5s infinite; }
.secs { position: absolute; right: -18px; top: -14px; z-index: 3; background: var(--yellow); color: #2b1600; font-weight: 900; border-radius: 999px; min-width: 36px; padding: 4px 8px; }
.speaker h2 { color: var(--ink); font-size: 1.35rem; margin: 6px 0 0; }
.cluebox { display: flex; gap: 8px; width: 100%; }
.order { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px; margin: 10px 0; }
.order .arrow { color: var(--muted); opacity: .5; }
.order .mini.now .av { box-shadow: 0 0 0 3px var(--yellow); transform: scale(1.15); }
.order .mini.now { transform: translateY(-3px); }
.order .mini.done .av { opacity: .6; }
.order .mini.out { display: none; }
.board { display: grid; gap: 10px; margin-top: 6px; }
.tourblock h3 { font-size: .85rem; color: var(--muted); margin: 6px 4px; text-transform: uppercase; letter-spacing: .08em; }
.clue { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.clue .who { font-weight: 800; font-size: .85rem; color: var(--muted); max-width: 30%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bubble { background: #fff; color: #2b0f5c; font-weight: 800; padding: 9px 14px; border-radius: 18px 18px 18px 6px; position: relative; word-break: break-word; }
.bubble .muted { color: #7a6aa6; }

/* vote */
.vote { text-align: center; }
.vote h2 { color: var(--ink); font-size: 1.5rem; margin: 10px 0 2px; }
.cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 12px 0; }
.cand { background: var(--glass); border: 2px solid var(--line); border-radius: 22px; padding: 14px 8px; display: grid; justify-items: center; gap: 6px; position: relative; transition: transform .15s, border-color .2s, background .2s; }
.cand:active:not(:disabled) { transform: scale(.94); }
.cand small { color: var(--muted); font-size: .78rem; min-height: 1em; word-break: break-word; }
.cand.sel { border-color: var(--red); background: #ff4d6d2e; animation: pop .35s; }
.cand.self { opacity: .5; }
.cand:disabled:not(.sel) { cursor: default; }
.cand .target { position: absolute; top: -10px; right: -6px; font-size: 2rem; animation: stampIn .35s cubic-bezier(.3, 1.8, .5, 1) both; }
.cand .voted { position: absolute; top: 8px; left: 8px; background: var(--green); color: #062b20; width: 22px; height: 22px; border-radius: 50%; font-size: .75rem; font-weight: 900; display: grid; place-items: center; }
.ghostturn { display: grid; gap: 10px; justify-items: center; padding: 20px 0; }

/* résultats */
.result { text-align: center; padding: 24px 16px; }
.result .trophy { font-size: 80px; animation: boom .7s cubic-bezier(.3, 1.6, .5, 1) both, bob 3s 1s ease-in-out infinite; }
.result h2 { color: var(--ink); font-size: 1.7rem; margin: 6px 0 12px; }
.result.civil { background: linear-gradient(160deg, #3ddc9733, #2ec4b622); border-color: #3ddc9777; }
.result.infiltre { background: linear-gradient(160deg, #ff4d6d33, #ff5d8f22); border-color: #ff4d6d77; }
.result.fantome { background: linear-gradient(160deg, #b388ff44, #5b7cfa22); border-color: #b388ff77; }
.words { display: grid; gap: 6px; }
.words b { color: var(--yellow); }
.rolelist { display: grid; gap: 6px; }
.rl { display: flex; align-items: center; gap: 10px; background: var(--glass); border-radius: 16px; padding: 6px 10px 6px 6px; animation-delay: var(--d) !important; }
.rl .nm { flex: 1; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: .8rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.tag.civil { background: #3ddc9733; }
.tag.infiltre { background: #ff4d6d44; }
.tag.fantome { background: #b388ff44; }
.plus { font-weight: 900; color: var(--muted); min-width: 34px; text-align: right; }
.plus.yes { color: var(--yellow); animation: pop .5s .6s both; }
.podium { display: grid; gap: 6px; }
.pod { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 16px; background: rgba(0,0,0,.2); }
.pod .rank { width: 30px; text-align: center; font-size: 1.3rem; font-weight: 900; }
.pod .nm { flex: 1; font-weight: 800; }
.pod b { color: var(--yellow); font-size: 1.15rem; }

/* fenêtres du bas */
.sheet-bg { position: fixed; inset: 0; background: rgba(10, 4, 25, .6); z-index: 20; animation: fade .25s both; backdrop-filter: blur(3px); }
.sheet { position: fixed; left: 50%; bottom: 0; width: min(560px, 100%); transform: translateX(-50%); max-height: 88dvh; overflow-y: auto; background: #2a1458; border-radius: 28px 28px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); z-index: 21; box-shadow: 0 -20px 60px rgba(0,0,0,.5); }
.sheet.up { animation: sheetUp .38s cubic-bezier(.2, 1.3, .4, 1) both; }
.sheet h2 { color: var(--ink); font-size: 1.35rem; margin: 0 40px 12px 0; }
.sheet-x { position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; border-radius: 50%; background: var(--glass2); }
.sheet label { display: grid; gap: 6px; font-weight: 800; color: var(--muted); margin: 10px 0; }
.sheet .btn.big { margin-top: 16px; }
.avpreview { text-align: center; margin: 4px 0 12px; }
.chars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 16px 0 12px; }
.chars button { aspect-ratio: 1; border-radius: 50%; background: var(--c); overflow: hidden; transition: transform .15s; box-shadow: inset 0 -4px 0 rgba(0,0,0,.15); }
.chars button .char { width: 100%; height: 100%; display: block; }
.chars button.on { box-shadow: 0 0 0 3px #2a1458, 0 0 0 6px var(--yellow); transform: scale(1.06); }
.chars button:active { transform: scale(.88); }
.colors { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.colors button { aspect-ratio: 1; border-radius: 50%; background: var(--c); box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); }
.colors button.on { box-shadow: 0 0 0 3px #2a1458, 0 0 0 6px #fff; }
.rules ol { padding-left: 20px; margin: 0; }
.rules li { margin: 8px 0; line-height: 1.45; }
.qr { background: #fff; border-radius: 22px; padding: 10px; width: min(260px, 70vw); margin: 10px auto; }
.qr svg { display: block; width: 100%; height: auto; }
.menu { display: grid; gap: 10px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #fff; color: #2b0f5c; font-weight: 800; padding: 12px 18px; border-radius: 16px; z-index: 40; box-shadow: 0 10px 30px rgba(0,0,0,.35); max-width: calc(100% - 32px); text-align: center; }
.toast.bad { background: var(--red); color: #fff; }
.toast.pop { animation: toastIn .4s cubic-bezier(.2, 1.6, .4, 1) both; }

.spinner { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; background: var(--pink); animation: sneak 1.5s ease-in-out infinite; }
.spinner .char { width: 100%; height: 100%; display: block; }

/* scène plein écran des grands moments */
.fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 60; }
.stage { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; background: radial-gradient(circle at 50% 40%, rgba(60, 20, 120, .97), rgba(10, 4, 25, .99)); padding: 24px; text-align: center; cursor: pointer; }
.stage.on { display: grid; animation: fade .25s both; }
.scene { display: grid; justify-items: center; gap: 14px; animation: sceneIn .45s cubic-bezier(.2, 1.5, .4, 1) both; max-width: 520px; }
.sc-title { font-size: clamp(1.8rem, 8vw, 2.6rem); font-weight: 900; letter-spacing: -.01em; }
.sc-title.good { color: var(--green); }
.sc-title.bad { color: var(--red); }
.sc-sub { font-size: 1.15rem; font-weight: 800; color: var(--yellow); }
.sc-emoji { font-size: 96px; line-height: 1; }
.sc-emoji.bounce { animation: bob 1s ease-in-out infinite; }
.sc-emoji.boom { animation: boom .6s cubic-bezier(.3, 1.8, .5, 1) both; }
.sc-emoji.spin { animation: spin .5s linear infinite; }
.sc-emoji.zap { animation: zap .3s steps(2) infinite; }
.sc-emoji.duel { animation: duel .5s ease-in-out infinite alternate; }
.sc-cards { display: flex; gap: 6px; font-size: 64px; }
.sc-cards span { animation: deal .7s cubic-bezier(.2, 1.4, .4, 1) both; }
.sc-cards span:nth-child(2) { animation-delay: .12s; }
.sc-cards span:nth-child(3) { animation-delay: .24s; }
.tallies { display: grid; gap: 12px; width: min(420px, 90vw); }
.tally { display: flex; align-items: center; gap: 12px; background: var(--glass); border-radius: 20px; padding: 10px 14px; animation: slideIn .4s both; animation-delay: calc(var(--i) * .15s); }
.tally .vv { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; }
.vchip { animation: flyIn .45s cubic-bezier(.2, 1.5, .4, 1) both; animation-delay: calc(.4s + var(--i) * .15s + var(--j) * .12s); }
.tally .cnt { font-size: 2rem; color: var(--yellow); }
.roulette { display: flex; gap: 10px; justify-content: center; }
.roulette span { animation: roulette .5s steps(1) infinite; animation-delay: calc(var(--i) * .5s / var(--n)); }
.sc-drop { position: relative; animation: trapdoor 1.8s cubic-bezier(.5, 0, .7, .4) both; }
.stamp { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-14deg); border: 6px solid var(--red); color: var(--red); background: rgba(255,255,255,.92); font-weight: 900; font-size: 2.1rem; padding: 4px 16px; border-radius: 12px; letter-spacing: .08em; animation: stamp .35s .6s cubic-bezier(.3, 1.8, .5, 1) both; }
.sc-card { width: 180px; height: 220px; border-radius: 26px; background: #fff; color: #2b0f5c; display: grid; place-content: center; gap: 10px; font-size: 1.5rem; animation: cardReveal .8s cubic-bezier(.3, 1.5, .5, 1) both; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.sc-card .re { font-size: 84px; }
.sc-card.bad { box-shadow: 0 0 0 8px var(--red), 0 20px 60px rgba(0,0,0,.5); }
.sc-card.good { box-shadow: 0 0 0 8px var(--green), 0 20px 60px rgba(61,220,151,.4); }
.sc-card.ghost { box-shadow: 0 0 0 8px var(--violet), 0 20px 60px rgba(179,136,255,.5); }
.sc-guess { font-size: 2rem; font-weight: 900; background: #fff; color: #2b0f5c; padding: 10px 22px; border-radius: 20px; animation: pop .5s .3s both; }
.sc-heart .l { font-size: 110px; display: inline-block; animation: heartbreak 1.2s both; }
.stage.sc-bad { background: radial-gradient(circle at 50% 40%, rgba(120, 20, 50, .93), rgba(25, 4, 12, .97)); }
.stage.sc-good { background: radial-gradient(circle at 50% 40%, rgba(20, 110, 80, .93), rgba(4, 25, 18, .97)); }
.stage.sc-ghost { background: radial-gradient(circle at 50% 40%, rgba(80, 60, 160, .93), rgba(8, 6, 30, .97)); }
.stage.sc-zap { animation: flash .4s 3; }
.av.sad { filter: grayscale(.6); animation: sad 1.6s ease-in-out both; }
.av.wobble { animation: wobble .6s ease-in-out infinite; }

/* secousses */
body.shake #app { animation: shake .45s; }
body.shake-strong #app, body.shake-strong .stage { animation: shake .6s; }

/* animations */
.pop { animation: pop .4s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
@keyframes sheetUp { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
@keyframes toastIn { from { transform: translate(-50%, 40px) scale(.8); opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-3deg); } }
@keyframes floaty { 50% { transform: translateY(-14px) rotate(4deg); } }
@keyframes sneak { 0%, 100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-8px) rotate(-8deg); } 75% { transform: translateX(8px) rotate(8deg); } }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg) translateY(-2px); } 75% { transform: rotate(4deg); } }
@keyframes breathe { 50% { transform: scale(1.025); } }
@keyframes pulse { 50% { opacity: .65; } }
@keyframes blink { 0%, 100% { opacity: .2; } 30% { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes tease { 0%, 100% { transform: rotate(0); } 10% { transform: rotate(-2deg); } 20% { transform: rotate(2deg); } 30% { transform: rotate(0); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px) rotate(-1deg); } 40% { transform: translateX(9px) rotate(1deg); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
@keyframes sceneIn { from { transform: scale(.7) translateY(30px); opacity: 0; } }
@keyframes boom { from { transform: scale(0) rotate(-30deg); } to { transform: scale(1) rotate(0); } }
@keyframes zap { 50% { transform: scale(1.2) rotate(8deg); filter: brightness(2); } }
@keyframes duel { from { transform: rotate(-15deg) scale(1); } to { transform: rotate(15deg) scale(1.15); } }
@keyframes deal { from { transform: translateY(-120px) rotate(-40deg); opacity: 0; } }
@keyframes slideIn { from { transform: translateX(-40px); opacity: 0; } }
@keyframes flyIn { from { transform: translate(-60px, -40px) scale(0); opacity: 0; } }
@keyframes roulette { 0% { transform: scale(1.25); filter: brightness(1.4) drop-shadow(0 0 12px #ffd23f); } 30%, 100% { transform: scale(1); filter: none; } }
@keyframes trapdoor { 0% { transform: translateY(0) rotate(0); } 45% { transform: translateY(0) rotate(0); } 55% { transform: translateY(-14px) rotate(-6deg); } 100% { transform: translateY(0) rotate(0); } }
@keyframes stamp { from { transform: translate(-50%, -50%) rotate(-14deg) scale(3); opacity: 0; } to { transform: translate(-50%, -50%) rotate(-14deg) scale(1); opacity: 1; } }
@keyframes stampIn { from { transform: scale(2.4) rotate(30deg); opacity: 0; } }
@keyframes cardReveal { 0% { transform: rotateY(90deg) scale(.6); } 100% { transform: rotateY(0) scale(1); } }
@keyframes heartbreak { 0% { transform: scale(0); } 40% { transform: scale(1.3); } 60% { transform: scale(1) rotate(-8deg); } 80% { transform: rotate(8deg); } 100% { transform: translateY(20px) rotate(0); opacity: .8; } }
@keyframes sad { 0% { transform: scale(1); } 100% { transform: scale(.9) translateY(10px) rotate(-6deg); } }
@keyframes flash { 50% { background: #fff8; } }

@media (min-width: 720px) {
  #app { padding-top: 12px; }
  .flip { height: 340px; }
}
/* « Réduire les animations » (réglage iPhone fréquent) : on garde les grands moments du jeu
   (vote, élimination, victoire), on calme seulement ce qui bouge en continu ou secoue l'écran. */
@media (prefers-reduced-motion: reduce) {
  .blobs i, .logo .spy, .av.bounce, .bigcode span, .btn.go, .flip .front, .spot::before, .ring.hurry,
  .result .trophy, .float, .dots i, .spinner { animation: none !important; }
  body.shake #app, body.shake-strong #app, body.shake-strong .stage { animation: none !important; }
}

/* dessins et icônes */
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.btn, .link, .wordpill, .note { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.note { display: flex; }
.btn.big { display: flex; }
.icon .ic { width: 22px; height: 22px; }
.av .char { width: 100%; height: 100%; display: block; }
.avbtn .edit { color: #2b1600; }
.avbtn .edit .ic { width: 16px; height: 16px; }
.chip .crown { position: absolute; left: 8px; top: 6px; }
.chip .crown .ic { width: 22px; height: 22px; }
.chip .badge .ic { width: 16px; height: 16px; color: var(--red); }
.chip .x .ic, .sheet-x .ic { width: 14px; height: 14px; }
.chip .x, .sheet-x { display: grid; place-items: center; }
.count .ce { width: 58px; height: 58px; border-radius: 50%; overflow: hidden; background: rgba(255,255,255,.14); display: block; }
.count .ce.ghost { background: none; overflow: visible; }
.count .ce svg { width: 100%; height: 100%; display: block; }
.opt .oe .ic { width: 28px; height: 28px; }
.qm .art { width: 110px; height: 110px; filter: drop-shadow(0 6px 0 rgba(0,0,0,.18)); }
.role-ghost .art { width: 120px; height: 120px; }
.flip .back .role-ghost .art { width: 96px; height: 96px; }
.mini i .ic { width: 12px; height: 12px; }
.cand .voted .ic { width: 14px; height: 14px; }
.cand .target { top: -12px; right: -8px; width: 40px; height: 40px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 10px rgba(0,0,0,.3); }
.cand .target .ic { width: 26px; height: 26px; }
.cand small .ic { width: 14px; height: 14px; }
.bubble .ic { width: 16px; height: 16px; }
.result .trophy { font-size: 0; }
.result .trophy svg { width: 120px; height: 120px; }
.result .trophy .char { border-radius: 50%; background: rgba(255,255,255,.15); }
.tag { display: inline-flex; align-items: center; gap: 4px; }
.tag .ic { width: 14px; height: 14px; }
.rl .st .ic { width: 18px; height: 18px; }
.rl .st { color: var(--muted); }
.words span { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pod .rank { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .95rem; background: rgba(255,255,255,.12); }
.pod .rank.r0 { background: #ffd23f; color: #2b1600; }
.pod .rank.r1 { background: #d9dce8; color: #2b1600; }
.pod .rank.r2 { background: #d8975b; color: #2b1600; }
.players h2 .ic, .vote h2 .ic { width: 1em; height: 1em; }
.sc-emoji { font-size: 0; }
.sc-emoji .art { width: 130px; height: 130px; display: block; }
.sc-card .re { font-size: 0; display: block; }
.sc-card .re svg { width: 120px; height: 120px; display: block; }
.sc-card .re .char { border-radius: 50%; background: #ffe7ef; }
.sc-cards { font-size: 0; gap: 10px; }
.sc-cards span { width: 62px; height: 86px; border-radius: 12px; display: block; background: repeating-linear-gradient(45deg, #ff5d8f, #ff5d8f 8px, #f0487d 8px, #f0487d 16px); box-shadow: inset 0 0 0 3px rgba(255,255,255,.4), 0 8px 18px rgba(0,0,0,.35); }
.sc-cards span:nth-child(1) { transform: rotate(-10deg); }
.sc-cards span:nth-child(3) { transform: rotate(10deg); }

/* choix du mode à l'accueil */
.modes { display: grid; gap: 12px; margin-top: 4px; }
.mode { display: grid; gap: 12px; margin: 0; }
.mode .mh { display: flex; align-items: center; gap: 12px; }
.mode .mh .ic { width: 34px; height: 34px; padding: 6px; border-radius: 12px; background: var(--glass2); flex: none; }
.mode .mh span { display: grid; }
.mode .mh b { font-size: 1.08rem; }
.mode .mh small { color: var(--muted); font-weight: 700; }
.mode .joinrow { display: flex; gap: 10px; }

/* un seul téléphone */
.local .codechip { display: inline-flex; align-items: center; gap: 6px; }
.addrow { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.addrow .avbtn .av { --s: 52px; }
.addrow input { flex: 1; min-width: 120px; }
.addrow .btn { min-height: 46px; padding: 10px 14px; }
.chip .avbtn { padding: 0; }
.pass { display: grid; justify-items: center; gap: 10px; padding: 24px 0; text-align: center; }
.pass h2 { color: var(--ink); font-size: 1.3rem; margin: 6px 0 0; }
.pass .bigname { font-size: clamp(2rem, 9vw, 2.8rem); font-weight: 900; background: linear-gradient(90deg, #ffd23f, #ff5d8f); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 4px 0; }
.pass .btn.big { margin-top: 12px; }

/* ---------- après une pub : « Plus de pub ! » */
.noads { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding-top: 6px; }
.noads h2 { margin: 4px 0 0; font-size: 2rem; }
.noads-price { margin: 0; font-size: 1.15rem; font-weight: 800; color: var(--yellow); }
.noads-family { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; opacity: .9; }
.noads-family svg { width: 22px; height: 22px; }
.noads-badge { position: relative; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.08); border: 4px solid var(--pink); animation: noadsPop .5s cubic-bezier(.3,1.6,.5,1) both; }
.noads-badge span { font-weight: 900; font-size: 1.6rem; letter-spacing: .04em; opacity: .85; }
.noads-badge::after { content: ''; position: absolute; left: 10px; right: 10px; top: 50%; height: 6px; margin-top: -3px;
  background: var(--pink); border-radius: 3px; transform: rotate(-35deg); }
@keyframes noadsPop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- choix de la langue (menu) */
.langs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 4px 0; }
.langs .lang { border: 0; border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 800; font-size: .95rem;
  background: rgba(255,255,255,.1); color: inherit; cursor: pointer; }
.langs .lang.on { background: var(--yellow); color: #2b1600; }

/* vote secret (un seul téléphone) */
.vsarrow { color: var(--yellow); display: grid; place-items: center; }
.vsarrow .ic { width: 30px; height: 30px; }
