/* Soirée by Roshan · neon party, mobile first */
/* fonts are self-hosted: no third-party request, no IP sent to Google */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/fonts/inter-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: 600 900; font-display: swap; src: url(/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; }
:root {
    --bg: #07050F; --bg2: #120C22; --ink: #F7F3FF; --muted: #A49CC0; --line: rgba(255,255,255,.12); --card: rgba(255,255,255,.055);
    --pink: #FF2E93; --cyan: #22E4FF; --lime: #C6FF3D; --violet: #B26BFF; --yellow: #FFD23F;
    --ease-out: cubic-bezier(.23, 1, .32, 1); --ease-io: cubic-bezier(.77, 0, .175, 1);
    --display: 'Unbounded', 'Inter', system-ui, sans-serif; --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --r: 18px; --c: var(--pink);
    color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; color: var(--ink); font: 500 16px/1.45 var(--body); overflow-x: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
[hidden] { display: none !important; }

/* living background: cheap radial gradients moved with transform */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg i { position: absolute; width: 90vmax; height: 90vmax; border-radius: 50%; opacity: .55; animation: drift 22s ease-in-out infinite alternate; }
.bg i:nth-child(1) { background: radial-gradient(circle, rgba(255,46,147,.45), transparent 62%); left: -40vmax; top: -40vmax; }
.bg i:nth-child(2) { background: radial-gradient(circle, rgba(34,228,255,.32), transparent 62%); right: -45vmax; top: 20vh; animation-delay: -7s; }
.bg i:nth-child(3) { background: radial-gradient(circle, rgba(178,107,255,.4), transparent 62%); left: -20vmax; bottom: -55vmax; animation-delay: -14s; }
@keyframes drift { to { transform: translate3d(12vmax, 8vmax, 0) scale(1.12); } }

#app { max-width: 520px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 10px) max(16px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 28px) max(16px, env(safe-area-inset-left)); }
.scr { min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 40px); display: flex; flex-direction: column; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.lead { font-size: 19px; font-weight: 600; text-align: center; margin: 4px 0 6px; }
.label { font: 700 12px var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.eyebrow { font-weight: 700; letter-spacing: .2em; text-transform: uppercase; font-size: 13px; color: var(--muted); }
.err { background: rgba(255,46,147,.14); border: 1px solid rgba(255,46,147,.5); color: #FFC2DD; border-radius: 14px; padding: 12px 14px; text-align: center; font-weight: 600; }
.tag { font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; background: rgba(255,255,255,.12); color: var(--ink); vertical-align: 2px; }
.tag.pink { background: var(--pink); color: #fff; }

/* entrance: only on a fresh screen, staggered with --i */
.fresh .rise, .fresh .plist li, .fresh .rank li, .fresh .wlist li, .fresh .order li, .fresh .ranklist li, .fresh .gcard, .fresh .code b span {
    animation: rise .38s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.92); } }
.plist li.pop { animation: pop .3s var(--ease-out) both; }

/* top bar */
.top { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; min-height: 52px; margin-bottom: 10px; }
.top h1 { font: 800 17px var(--display); text-align: center; letter-spacing: -.01em; }
.top.play { grid-template-columns: 1fr auto 44px; gap: 8px; }
.icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 18px; background: var(--card); border: 1px solid var(--line); transition: transform .12s var(--ease-out); }
.icon:active { transform: scale(.94); }
.gtag { justify-self: start; display: inline-flex; gap: 6px; align-items: center; padding: 7px 12px; border-radius: 99px; font-weight: 700; font-size: 14px; background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); }

/* buttons */
.btn { min-height: 54px; padding: 0 20px; border-radius: var(--r); font-weight: 700; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
    background: rgba(255,255,255,.08); border: 1px solid var(--line); transition: transform .12s var(--ease-out), box-shadow .2s ease, background-color .2s ease, opacity .2s ease; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .38; pointer-events: none; }
.btn.big { min-height: 62px; font-size: 18px; width: 100%; }
.btn.glow { background: linear-gradient(135deg, var(--pink), var(--violet)); border-color: transparent; color: #fff; box-shadow: 0 8px 30px rgba(255,46,147,.38), inset 0 1px 0 rgba(255,255,255,.25); }
.btn.alt { background: linear-gradient(135deg, var(--cyan), #6BFFCF); border-color: transparent; color: #06121A; box-shadow: 0 8px 28px rgba(34,228,255,.28); }
.btn.ghost { background: transparent; }
.btn.sq { width: 54px; padding: 0; font-size: 24px; flex: none; }
.btn.link { min-height: 44px; background: none; border: 0; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
    .btn.glow:hover { box-shadow: 0 10px 40px rgba(255,46,147,.55), inset 0 1px 0 rgba(255,255,255,.25); }
    .btn:not(.glow):not(.alt):hover { background-color: rgba(255,255,255,.12); }
    .gcard:hover, .mode:hover, .pbtn:hover { border-color: rgba(255,255,255,.3); }
}

/* home */
.home { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding-top: 4vh; }
.logo { display: flex; flex-direction: column; align-items: center; line-height: .95; }
.logo-s { font: 900 clamp(58px, 19vw, 96px) var(--display); letter-spacing: -.05em; background: linear-gradient(100deg, var(--pink), var(--violet), var(--cyan), var(--lime), var(--pink)); background-size: 300% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 22px rgba(255,46,147,.45)); animation: shimmer 9s linear infinite, flicker 1.1s steps(1) both; }
.logo-by { font: 600 13px var(--display); letter-spacing: .5em; text-transform: uppercase; color: var(--cyan); text-shadow: 0 0 12px rgba(34,228,255,.8); margin-top: 10px; padding-left: .5em; }
.logo.xl .logo-s { font-size: clamp(64px, 22vw, 112px); }
@keyframes shimmer { to { background-position: 300% 0; } }
@keyframes flicker { 0% { opacity: 0; } 10% { opacity: 1; } 18% { opacity: .2; } 26% { opacity: 1; } 40% { opacity: .5; } 46%, 100% { opacity: 1; } }
.tagline { text-align: center; color: var(--muted); font-size: 17px; }
.marquee { overflow: hidden; margin: 0 -16px; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee > div { display: flex; gap: 8px; width: max-content; animation: marquee 32s linear infinite; }
.mchip { white-space: nowrap; padding: 8px 14px; border-radius: 99px; font-weight: 700; font-size: 14px; border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); box-shadow: 0 0 18px color-mix(in srgb, var(--c) 22%, transparent); }
@keyframes marquee { to { transform: translateX(-50%); } }
.foot { text-align: center; font-size: 13px; color: var(--muted); margin-top: 8px; }
.foot a { text-decoration: none; padding: 6px 2px; }

/* mode cards */
.mode { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; text-align: left; padding: 20px; border-radius: 22px; background: var(--card); border: 1.5px solid var(--line); transition: transform .14s var(--ease-out), border-color .2s ease; }
.mode:active { transform: scale(.98); border-color: var(--c); }
.mode-ico { grid-row: span 2; font-size: 30px; align-self: center; filter: drop-shadow(0 0 10px var(--c)); }
.mode b { font: 800 19px var(--display); color: var(--c); }
.mode small { color: var(--muted); font-size: 15px; }

/* players */
.addrow { display: flex; gap: 10px; }
.field { width: 100%; min-height: 56px; border-radius: 16px; padding: 0 16px; font-size: 17px; background: rgba(255,255,255,.06); border: 1.5px solid var(--line); outline: 0; transition: border-color .2s ease, box-shadow .2s ease; }
.field:focus { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(255,46,147,.18); }
.field::placeholder { color: #6F6890; }
.code-in { text-align: center; font: 800 30px var(--display); letter-spacing: .45em; padding-left: .45em; text-transform: uppercase; }
.avpick { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.avpick::-webkit-scrollbar { display: none; }
.avpick button { flex: none; width: 44px; height: 44px; border-radius: 14px; font-size: 22px; background: var(--card); border: 1.5px solid transparent; transition: transform .14s var(--ease-out), border-color .16s ease; }
.avpick button.on { border-color: var(--pink); transform: scale(1.08); box-shadow: 0 0 16px rgba(255,46,147,.4); }
.plist { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.plist li { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 10px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.plist li > span:not(.av) { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist .icon { width: 38px; height: 38px; font-size: 14px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #5d5675; }
.dot.on { background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.av { width: var(--s); height: var(--s); flex: none; border-radius: 32%; display: inline-grid; place-items: center; font-size: calc(var(--s) * .5); font-weight: 800; color: #0B0614;
    background: var(--c); box-shadow: 0 0 calc(var(--s) * .35) color-mix(in srgb, var(--c) 45%, transparent); }

/* lobby code */
.code { text-align: center; padding: 18px; border-radius: 24px; background: var(--card); border: 1.5px solid rgba(34,228,255,.35); box-shadow: 0 0 40px rgba(34,228,255,.12); }
.code small { display: block; color: var(--muted); font-weight: 600; }
.code b { display: flex; justify-content: center; gap: 8px; margin: 8px 0; }
.code b span { font: 900 54px var(--display); color: var(--cyan); text-shadow: 0 0 22px rgba(34,228,255,.7); width: 1.05em; }
.url { font-size: 14px; color: var(--muted); word-break: break-all; }
.wait-dots::after { content: '…'; animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* games grid */
.ggrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gcard { text-align: left; padding: 14px; border-radius: 20px; background: var(--card); border: 1.5px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-height: 140px;
    transition: transform .14s var(--ease-out), border-color .2s ease, box-shadow .2s ease, background-color .2s ease; }
.gcard:active { transform: scale(.97); }
.gcard.on { border-color: var(--c); background-color: color-mix(in srgb, var(--c) 13%, transparent); box-shadow: 0 0 0 1px var(--c), 0 0 26px color-mix(in srgb, var(--c) 35%, transparent); }
.gcard:disabled { opacity: .4; }
.gemo { font-size: 32px; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--c) 70%, transparent)); }
.gcard b { font: 800 15px var(--display); line-height: 1.2; }
.gcard small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-weight: 700; }
.opt small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper .btn.sq { width: 44px; min-height: 44px; font-size: 20px; }
.stepper b { font: 800 22px var(--display); min-width: 1.2em; text-align: center; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 52px; height: 30px; border-radius: 99px; background: rgba(255,255,255,.16); position: relative; cursor: pointer; transition: background-color .2s ease; }
.switch::before { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .22s var(--ease-out); }
.switch:checked { background: var(--pink); box-shadow: 0 0 14px rgba(255,46,147,.5); }
.switch:checked::before { transform: translateX(22px); }

/* pass the phone */
.pass { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding-bottom: 6vh; }
.pass-av { border-radius: 36%; animation: pop .4s var(--ease-out) both, ring 1.8s ease-in-out .4s infinite; }
.pass-name { font: 900 clamp(34px, 11vw, 52px) var(--display); color: var(--c); text-shadow: 0 0 26px color-mix(in srgb, var(--c) 70%, transparent); letter-spacing: -.03em; word-break: break-word; }
.fresh .pass > * { animation: rise .4s var(--ease-out) both; }
.fresh .pass > :nth-child(3) { animation-delay: 60ms; } .fresh .pass > :nth-child(4) { animation-delay: 110ms; } .fresh .pass > :nth-child(5) { animation-delay: 160ms; }
.pass .btn { margin-top: 14px; }
@keyframes ring { 50% { box-shadow: 0 0 0 12px rgba(255,255,255,.06), 0 0 50px rgba(255,46,147,.35); } }

/* game intro */
.intro { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 14px; }
.intro-emo { font-size: 96px; filter: drop-shadow(0 0 30px var(--c)); animation: float 3s ease-in-out infinite; }
.fresh .intro-emo { animation: pop .5s var(--ease-out) both, float 3s ease-in-out .5s infinite; }
.intro h2 { font: 900 34px var(--display); color: var(--c); text-shadow: 0 0 24px color-mix(in srgb, var(--c) 60%, transparent); letter-spacing: -.03em; }
.intro > p { color: var(--muted); font-size: 17px; max-width: 34ch; }
.how { text-align: left; padding: 14px 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); font-size: 15px; }
.how small { display: block; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--c); font-size: 11px; margin-bottom: 4px; }
.intro .btn { margin-top: 10px; }
@keyframes float { 50% { transform: translateY(-8px); } }

/* round */
.round { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.foot-act { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.qcard { position: relative; padding: 24px 22px; border-radius: 26px; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 22%, #120C22), #0E0A1C); border: 1.5px solid color-mix(in srgb, var(--c) 60%, transparent);
    box-shadow: 0 0 40px color-mix(in srgb, var(--c) 22%, transparent), inset 0 1px 0 rgba(255,255,255,.08); }
.qcard small { font-weight: 800; letter-spacing: .16em; text-transform: uppercase; font-size: 12px; color: var(--c); }
.qcard p { font: 800 clamp(22px, 6.4vw, 30px)/1.2 var(--display); letter-spacing: -.02em; margin-top: 8px; overflow-wrap: anywhere; }
.qcard .sub { display: block; margin-top: 10px; color: var(--muted); font-size: 15px; }
.verdict { font: 900 26px var(--display); text-align: center; letter-spacing: -.02em; color: var(--c); text-shadow: 0 0 22px color-mix(in srgb, var(--c) 55%, transparent); }
.pchips { display: flex; flex-wrap: wrap; gap: 8px; }
.pchip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 5px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.pchip.win, .pchip.done { border-color: var(--lime); background: rgba(198,255,61,.1); }
.waiting { display: flex; flex-direction: column; gap: 12px; }

/* inputs */
.choices { display: flex; flex-direction: column; gap: 10px; position: relative; }
.choice { min-height: 120px; border-radius: 24px; padding: 18px; font: 800 20px/1.25 var(--display); letter-spacing: -.01em; transition: transform .12s var(--ease-out), box-shadow .2s ease; }
.choice.c0 { background: linear-gradient(135deg, var(--pink), #FF6A3D); color: #fff; box-shadow: 0 10px 30px rgba(255,46,147,.35); }
.choice.c1 { background: linear-gradient(135deg, var(--cyan), var(--lime)); color: #07121A; box-shadow: 0 10px 30px rgba(34,228,255,.3); }
.choice:active { transform: scale(.97); }
.or { align-self: center; margin: -22px 0; z-index: 1; font: 900 13px var(--display); text-transform: uppercase; padding: 8px 12px; border-radius: 99px; background: var(--bg); border: 1.5px solid var(--line); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.pbtn { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border-radius: 20px; background: var(--card); border: 1.5px solid var(--line); font-weight: 700; font-size: 14px;
    transition: transform .16s var(--ease-out), border-color .16s ease, box-shadow .16s ease, background-color .16s ease; }
.pbtn span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbtn.sel { border-color: var(--pink); background-color: rgba(255,46,147,.14); box-shadow: 0 0 0 1px var(--pink), 0 0 24px rgba(255,46,147,.4); transform: scale(1.04); }
.scale { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.scale button { aspect-ratio: 1; border-radius: 16px; font: 800 20px var(--display); background: hsl(var(--h) 90% 55% / .16); border: 1.5px solid hsl(var(--h) 90% 60% / .45);
    transition: transform .14s var(--ease-out), background-color .16s ease, box-shadow .16s ease; }
.scale button.sel { background: hsl(var(--h) 92% 58%); color: #0B0614; box-shadow: 0 0 22px hsl(var(--h) 92% 58% / .6); transform: scale(1.08); }
.olist { display: flex; flex-direction: column; gap: 8px; }
.obtn { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 14px; border-radius: 16px; background: var(--card); border: 1.5px solid var(--line); font-weight: 700; text-align: left; transition: border-color .16s ease, background-color .16s ease; }
.obtn b { width: 30px; height: 30px; flex: none; border-radius: 10px; display: grid; place-items: center; border: 1.5px dashed var(--line); font-family: var(--display); }
.obtn.on { border-color: var(--yellow); background: rgba(255,210,63,.1); }
.obtn.on b { background: var(--yellow); color: #120C22; border-color: transparent; animation: pop .22s var(--ease-out); }

/* flip card (Imposteur) */
.flip { perspective: 1200px; height: 280px; cursor: pointer; }
.flip-in { position: relative; height: 100%; transform-style: preserve-3d; transition: transform .6s var(--ease-io); }
.flip.on .flip-in { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; border-radius: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; -webkit-backface-visibility: hidden; backface-visibility: hidden; text-align: center; padding: 20px; }
.front { background: linear-gradient(135deg, var(--violet), var(--pink)); box-shadow: 0 20px 60px rgba(178,107,255,.4); }
.front span { font: 900 110px var(--display); line-height: 1; color: #fff; text-shadow: 0 0 30px rgba(255,255,255,.5); }
.front small { font-weight: 700; color: rgba(255,255,255,.85); }
.back { transform: rotateY(180deg); background: #120C22; border: 2px solid var(--violet); box-shadow: 0 0 50px rgba(178,107,255,.35); }
.back small { font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-size: 12px; }
.back b { font: 900 clamp(32px, 10vw, 48px) var(--display); letter-spacing: -.03em; overflow-wrap: anywhere; }
.back em { color: var(--muted); font-style: normal; }
.after-flip { animation: rise .3s var(--ease-out) .25s both; }

/* imposteur discussion + reveal */
.order { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.order li { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-weight: 700; }
.order li > span:not(.av) { flex: 1; }
.order li.first { border-color: var(--violet); box-shadow: 0 0 20px rgba(178,107,255,.3); }
.order em { font-style: normal; font-size: 12px; color: var(--violet); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.timer { font: 900 64px var(--display); text-align: center; font-variant-numeric: tabular-nums; margin-top: 10px; text-shadow: 0 0 24px rgba(178,107,255,.6); }
.timer.urgent { color: var(--pink); animation: beat 1s ease-in-out infinite; }
.timer.over { color: var(--lime); animation: none; }
@keyframes beat { 50% { transform: scale(1.06); } }
.spoiler { filter: blur(7px); transition: filter .2s ease; cursor: pointer; border-radius: 6px; }
.spoiler:hover, .spoiler:focus, .spoiler:active { filter: none; }
.words { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0; }
.words div { padding: 14px; border-radius: 18px; background: var(--card); border: 1.5px solid var(--lime); text-align: center; }
.words div.pink { border-color: var(--pink); }
.words small { display: block; font-weight: 800; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.words b { font: 800 20px var(--display); overflow-wrap: anywhere; }
.wlist { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.wlist li { display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 7px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-weight: 700; }
.wlist li > span:not(.av) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wlist li.out { border-color: var(--pink); }
.wlist li.win { border-color: var(--lime); background: rgba(198,255,61,.08); }
.wlist b { font-family: var(--display); }
.bignum { text-align: center; margin: 4px 0 6px; }
.bignum span { font: 900 72px var(--display); color: var(--c); text-shadow: 0 0 30px color-mix(in srgb, var(--c) 60%, transparent); font-variant-numeric: tabular-nums; }
.bignum small { display: block; color: var(--muted); font-weight: 600; }
.ranklist { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.ranklist li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-weight: 700; }
.ranklist li b { font: 900 18px var(--display); color: var(--c); width: 1.4em; }
.ranklist li:first-child { border-color: var(--c); box-shadow: 0 0 20px color-mix(in srgb, var(--c) 30%, transparent); }

/* vote bars */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 16px; overflow: hidden; background: var(--card); border: 1px solid var(--line); font-weight: 700; }
.bar > span:not(.av) { flex: 1; z-index: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar b { z-index: 1; font: 900 18px var(--display); }
.bar .av { z-index: 1; }
.bar i { position: absolute; inset: 0; background: color-mix(in srgb, var(--c) 32%, transparent); transform-origin: left; transform: scaleX(var(--p)); animation: grow .8s var(--ease-out) both; animation-delay: calc(.2s + var(--i) * 80ms); }
.bar.win { border-color: var(--c); box-shadow: 0 0 22px color-mix(in srgb, var(--c) 35%, transparent); }
@keyframes grow { from { transform: scaleX(0); } }

/* tu préfères */
.vs { display: flex; flex-direction: column; gap: 10px; }
.side { position: relative; overflow: hidden; padding: 16px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--card); display: flex; flex-direction: column; gap: 8px; }
.side::before { content: ''; position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--p)); animation: grow .9s var(--ease-out) .2s both; z-index: -1; }
.side { isolation: isolate; }
.side.a::before { background: rgba(255,46,147,.28); }
.side.b::before { background: rgba(34,228,255,.24); }
.side b { font: 900 40px var(--display); }
.side.a b { color: var(--pink); } .side.b b { color: var(--cyan); }
.side p { font-weight: 700; font-size: 17px; }

/* 3-2-1 before a reveal */
.cdown { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; pointer-events: none; background: radial-gradient(circle, rgba(7,5,15,.75), rgba(7,5,15,.95)); animation: cdout .25s ease 1.35s forwards; }
.cdown span { grid-area: 1 / 1; font: 900 150px var(--display); color: var(--c); text-shadow: 0 0 50px var(--c); opacity: 0; animation: cdnum .45s var(--ease-out) both; }
.cdown span:nth-child(2) { animation-delay: .45s; } .cdown span:nth-child(3) { animation-delay: .9s; }
@keyframes cdnum { 0% { opacity: 0; transform: scale(.7); } 30% { opacity: 1; transform: scale(1.08); } 100% { opacity: 0; transform: scale(1.18); } }
@keyframes cdout { to { opacity: 0; visibility: hidden; } }
.cdown + .after-cd { animation: rise .4s var(--ease-out) 1.35s both; }
.cdown + .after-cd .bar i, .cdown + .after-cd .side::before { animation-delay: calc(1.55s + var(--i, 0) * 80ms); }

/* scores */
.rank { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.rank li { display: flex; align-items: center; gap: 12px; padding: 9px 14px 9px 10px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-weight: 700; }
.rank li > span:not(.av) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .pos { width: 1.6em; text-align: center; font: 900 16px var(--display); color: var(--muted); }
.rank li > b:last-child { font: 900 20px var(--display); font-variant-numeric: tabular-nums; }
.rank li.top1 { border-color: var(--yellow); box-shadow: 0 0 22px rgba(255,210,63,.25); }
.rank li.top2 { border-color: rgba(220,220,255,.5); } .rank li.top3 { border-color: rgba(255,150,80,.5); }
.delta { font-style: normal; color: var(--lime); font-weight: 800; font-size: 14px; animation: pop .4s var(--ease-out) .5s both; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 6px 0 4px; }
.pod { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; animation: rise .55s var(--ease-out) both; animation-delay: calc(var(--i) * 160ms + .1s); }
.pod b { font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod > span:not(.av):not(.crown) { color: var(--muted); font-size: 14px; font-weight: 700; }
.pod i { width: 100%; display: grid; place-items: center; border-radius: 16px 16px 6px 6px; font: 900 28px var(--display); font-style: normal; }
.p1 i { height: 120px; background: linear-gradient(180deg, var(--yellow), rgba(255,210,63,.15)); color: #241a00; box-shadow: 0 0 40px rgba(255,210,63,.35); }
.p2 i { height: 86px; background: linear-gradient(180deg, #D8D8FF, rgba(216,216,255,.12)); color: #14122a; }
.p3 i { height: 64px; background: linear-gradient(180deg, #FF9A5A, rgba(255,154,90,.12)); color: #2a1306; }
.crown { font-size: 34px; animation: float 2.2s ease-in-out infinite; filter: drop-shadow(0 0 12px rgba(255,210,63,.8)); }
.ready { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 16px; border-radius: 24px; background: var(--card); border: 1.5px solid rgba(198,255,61,.4); }
.ready b { font: 800 20px var(--display); }
.ready small { color: var(--muted); }
.pulse { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; font-weight: 900; color: #10200a; background: var(--lime); animation: ping 1.6s ease-out infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(198,255,61,.55); } 100% { box-shadow: 0 0 0 22px rgba(198,255,61,0); } }

/* chrome */
#confetti { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 18px); z-index: 70; width: max-content; max-width: calc(100% - 32px); text-align: center; padding: 12px 18px; border-radius: 16px; background: #1D1533; border: 1px solid var(--line); font-weight: 700; box-shadow: 0 12px 40px rgba(0,0,0,.5);
    transform: translate(-50%, 140%); opacity: 0; transition: transform .24s var(--ease-out), opacity .2s ease; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.net { position: fixed; top: env(safe-area-inset-top); left: 0; right: 0; z-index: 70; text-align: center; padding: 8px; font-weight: 700; font-size: 14px; background: var(--pink); color: #fff; }
.sheet { margin: auto auto 0; width: min(520px, calc(100% - 16px)); max-height: 88dvh; border: 1px solid var(--line); border-radius: 26px 26px 0 0; background: var(--bg2); color: var(--ink); padding: 22px 18px calc(env(safe-area-inset-bottom) + 18px); }
.sheet[open] { display: flex; flex-direction: column; gap: 14px; animation: sheet .3s var(--ease-out); }
.sheet::backdrop { background: rgba(4,2,10,.7); }
.sheet h2 { font: 800 22px var(--display); }
.steps { padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.steps h3 { font-size: 16px; margin-bottom: 6px; }
.steps ol { padding-left: 20px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.steps b { color: var(--ink); }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }

/* photos, groups, levels, decks */
.av.ph { padding: 0; overflow: hidden; background: var(--c); }
.av.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-btn { flex: none; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 24px; cursor: pointer; overflow: hidden;
    background: var(--card); border: 1.5px dashed rgba(255,255,255,.3); transition: transform .12s var(--ease-out), border-color .2s ease; }
.photo-btn:active { transform: scale(.95); }
.photo-btn.has { border: 2px solid var(--pink); }
.photo-btn img { width: 100%; height: 100%; object-fit: cover; }
.av-edit { cursor: pointer; display: inline-flex; border-radius: 32%; }
.av-edit:active { transform: scale(.94); }
.group { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center; padding: 14px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.gfaces { display: flex; }
.gfaces .av { margin-left: -10px; box-shadow: 0 0 0 2px var(--bg); }
.gfaces .av:first-child { margin-left: 0; }
.ginfo { min-width: 0; }
.ginfo b { display: block; font: 800 17px var(--display); }
.ginfo small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gact { grid-column: 1 / -1; display: flex; gap: 8px; }
.gact .btn { flex: 1; min-height: 46px; }
.gact .icon { width: 46px; height: 46px; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(0,0,0,.3); }
.seg button { min-height: 40px; padding: 0 12px; border-radius: 11px; font-weight: 700; font-size: 14px; color: var(--muted); transition: background-color .2s ease, color .2s ease; }
.seg button.on { background: linear-gradient(135deg, var(--pink), var(--violet)); color: #fff; box-shadow: 0 4px 14px rgba(255,46,147,.35); }
.opt.level { flex-wrap: wrap; }
.hardnote { padding: 12px 14px; border-radius: 14px; background: rgba(255,46,147,.1); border: 1px solid rgba(255,46,147,.45); color: #FFC9E1; font-size: 14px; font-weight: 600; }
.hardtag { align-self: flex-start; padding: 5px 12px; border-radius: 99px; font-weight: 800; font-size: 13px; background: rgba(255,46,147,.18); border: 1px solid var(--pink); color: #FFB3D6; box-shadow: 0 0 16px rgba(255,46,147,.35); }
.hint { text-align: center; font-weight: 700; color: var(--c); }
.vsdeck { display: flex; flex-direction: column; gap: 10px; position: relative; }
.vsdeck small { font-weight: 800; letter-spacing: .16em; text-transform: uppercase; font-size: 12px; color: var(--c); text-align: center; }
.vsdeck .opt-a, .vsdeck .opt-b { min-height: 150px; display: grid; place-items: center; text-align: center; padding: 22px; border-radius: 26px; font: 800 clamp(21px, 6vw, 28px)/1.2 var(--display); letter-spacing: -.01em; overflow-wrap: anywhere; }
.vsdeck .opt-a { background: linear-gradient(135deg, var(--pink), #FF6A3D); color: #fff; box-shadow: 0 12px 34px rgba(255,46,147,.35); }
.vsdeck .opt-b { background: linear-gradient(135deg, var(--cyan), var(--lime)); color: #07121A; box-shadow: 0 12px 34px rgba(34,228,255,.3); }
.fresh .vsdeck .opt-a { animation: slideL .45s var(--ease-out) both; }
.fresh .vsdeck .opt-b { animation: slideR .45s var(--ease-out) .08s both; }
@keyframes slideL { from { opacity: 0; transform: translateX(-28px); } }
@keyframes slideR { from { opacity: 0; transform: translateX(28px); } }

.cam { position: relative; align-self: center; width: 180px; height: 180px; border-radius: 36%; overflow: hidden; background: var(--card); border: 2px solid var(--pink); box-shadow: 0 0 30px rgba(255,46,147,.35); display: grid; place-items: center; }
.cam video, .cam img { width: 100%; height: 100%; object-fit: cover; }
.cam video.mirror { transform: scaleX(-1); }
.cam-empty { font-size: 54px; opacity: .6; }
.cam-row .btn.sq { flex: none; }
#pedit-fields { display: flex; flex-direction: column; gap: 10px; }
.plist li .pname { flex: 1; text-align: left; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 0; }
.plist li .pname small { color: var(--muted); font-weight: 600; margin-left: 6px; }

@media (min-width: 700px) {
    #app { padding-top: 32px; }
    .ggrid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (orientation: landscape) and (max-height: 500px) {
    .home { padding-top: 0; gap: 14px; }
    .flip { height: 200px; }
    .choice { min-height: 80px; }
}

/* Reduced motion: keep fades for comprehension, drop movement and loops */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after { animation-duration: .2s !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
    .fresh .rise, .fresh .plist li, .fresh .rank li, .fresh .wlist li, .fresh .order li, .fresh .ranklist li, .fresh .gcard, .fresh .code b span, .pod, .after-flip { animation-name: fade !important; }
    .fresh .vsdeck .opt-a, .fresh .vsdeck .opt-b { animation-name: fade !important; }
    .bg i, .marquee > div, .intro-emo, .crown, .pulse, .timer.urgent, .pass-av { animation: none !important; }
    .logo-s { animation: none !important; background-position: 0 0; }
    .marquee > div { flex-wrap: wrap; width: auto; justify-content: center; }
    .mchip.dup { display: none; }
}
