/* =====================================================================
   CineQuiz — design v4.5 (validé le 28/11/2026)
   Mobile d'abord (iPhone 13 Pro Max 428 × 926). Verre dépoli façon iOS,
   couleurs officielles des catégories, bulle de navigation « Liquid Glass ».
   ===================================================================== */
@font-face {
    font-family: "Montserrat";
    src: url("fonts/montserrat.woff") format("woff");
    font-weight: 100 900;
    font-display: swap;
}

/* ---------- Couleurs ---------- */
@property --c { syntax: '<color>'; inherits: true; initial-value: #000000; }

:root {
    color-scheme: dark;
    /* Catégories (couleurs officielles de CineQuiz) */
    --c-films: #000000;
    --c-series: #ff0000;
    --c-acteurs: #6604d4;
    --c-personnages: #82066f;
    --c-dessins: #01879f;
    --c-jeux: #389a06;

    --base: #07081a;
    --verre: rgba(255, 255, 255, 0.075);
    --verre-2: rgba(255, 255, 255, 0.14);
    --verre-bord: rgba(255, 255, 255, 0.14);
    --texte: #ffffff;
    --texte-2: rgba(255, 255, 255, 0.82);
    --texte-3: rgba(255, 255, 255, 0.6);
    --encre: #0b1030;
    --rouge: #ff5d6c;

    /* Couleur principale (Réglages) : bleu par défaut */
    --g1: #2f7bff; --g2: #5b5cf6; --g3: #9b3de8;

    --police: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --nav-h: 70px;
    --nav-bas: max(10px, calc(var(--safe-bottom) - 11px));
}
[data-accent="violet"] { --g1: #8b5cf6; --g2: #a855f7; --g3: #ec4899; }
[data-accent="rose"]   { --g1: #f472b6; --g2: #e11d74; --g3: #7c3aed; }
[data-accent="rouge"]  { --g1: #ff4d5e; --g2: #e11d48; --g3: #7c1d6f; }
[data-accent="orange"] { --g1: #ffa53d; --g2: #ff5e3a; --g3: #b42bd8; }
[data-accent="or"]     { --g1: #f6c65b; --g2: #e3a21a; --g3: #9a4d0f; }

/* ---------- Fond (choisi dans Profil → Apparence ; posé sur <html data-fond>) ---------- */
:root {
    --fond:
        radial-gradient(30% 20% at 4% 4%, rgba(255, 0, 0, 0.30), transparent 70%),
        radial-gradient(34% 22% at 96% 10%, rgba(102, 4, 212, 0.42), transparent 70%),
        radial-gradient(30% 22% at 100% 58%, rgba(1, 135, 159, 0.34), transparent 70%),
        radial-gradient(34% 24% at 0% 66%, rgba(130, 6, 111, 0.40), transparent 70%),
        radial-gradient(40% 22% at 55% 104%, rgba(56, 154, 6, 0.28), transparent 70%),
        #07081a;
}
html[data-fond="halo"], .fonds [data-valeur="halo"] { --base: #06071a; --fond: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 428 926' preserveAspectRatio='xMidYMid slice'%3E%3Cdefs%3E%3Cfilter id='f' x='-50%' y='-50%' width='200%' height='200%'%3E%3CfeGaussianBlur stdDeviation='34'/%3E%3C/filter%3E%3C/defs%3E%3Cg filter='url(%23f)' fill-opacity='.75'%3E%3Ccircle cx='214' cy='250' r='80' fill='%23ff0000'/%3E%3Ccircle cx='360' cy='380' r='80' fill='%236604d4'/%3E%3Ccircle cx='330' cy='610' r='80' fill='%2301879f'/%3E%3Ccircle cx='100' cy='610' r='80' fill='%23389a06'/%3E%3Ccircle cx='70' cy='380' r='80' fill='%2382066f'/%3E%3C/g%3E%3C/svg%3E") center / cover no-repeat, radial-gradient(60% 40% at 50% 47%, #0d0f30, #06071a 80%); }
html[data-fond="ruban"], .fonds [data-valeur="ruban"] { --base: #06071a; --fond: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 428 926' preserveAspectRatio='xMidYMid slice'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%23ff0000'/%3E%3Cstop offset='.25' stop-color='%236604d4'/%3E%3Cstop offset='.5' stop-color='%2382066f'/%3E%3Cstop offset='.75' stop-color='%2301879f'/%3E%3Cstop offset='1' stop-color='%23389a06'/%3E%3C/linearGradient%3E%3Cfilter id='f'%3E%3CfeGaussianBlur stdDeviation='14'/%3E%3C/filter%3E%3C/defs%3E%3Cpath d='M-60 520 C80 380 200 680 330 480 S470 380 500 430 L500 640 C420 600 380 760 300 740 S120 680 -60 780 Z' fill='url(%23g)' opacity='.95' filter='url(%23f)'/%3E%3Cpath d='M-60 600 C80 470 200 730 330 560 S470 470 500 520' stroke='url(%23g)' stroke-width='2' fill='none' opacity='.7'/%3E%3C/svg%3E") center / cover no-repeat, linear-gradient(180deg, #06071a, #0b0c26 55%, #06071a); }
html[data-fond="mosaique"], .fonds [data-valeur="mosaique"] { --fond: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cg fill-opacity='.09'%3E%3Crect x='8' y='8' width='54' height='54' rx='12' fill='%23ff0000'/%3E%3Crect x='78' y='8' width='54' height='54' rx='12' fill='%236604d4'/%3E%3Crect x='8' y='78' width='54' height='54' rx='12' fill='%2301879f'/%3E%3Crect x='78' y='78' width='54' height='54' rx='12' fill='%23389a06'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 140px 140px, radial-gradient(70% 45% at 50% 0%, rgba(102,4,212,.28), transparent 70%), radial-gradient(70% 40% at 50% 100%, rgba(1,135,159,.22), transparent 70%), #07081a; }
html[data-fond="ecran"], .fonds [data-valeur="ecran"] { --base: #050614; --fond: radial-gradient(75% 26% at 50% 8%, rgba(255,255,255,.30), rgba(150,120,255,.14) 45%, transparent 75%), linear-gradient(180deg, rgba(5,6,20,0) 20%, #050614 68%), linear-gradient(90deg, rgba(255,0,0,.38), rgba(102,4,212,.42) 25%, rgba(130,6,111,.38) 50%, rgba(1,135,159,.40) 75%, rgba(56,154,6,.36)) 0 0 / 100% 75% no-repeat, #050614; }
html[data-fond="couleur"], .fonds [data-valeur="couleur"] { --fond:
        radial-gradient(60% 34% at 0% 0%, color-mix(in srgb, var(--g1) 55%, transparent), transparent 72%),
        radial-gradient(60% 34% at 100% 40%, color-mix(in srgb, var(--g2) 48%, transparent), transparent 72%),
        radial-gradient(70% 34% at 20% 100%, color-mix(in srgb, var(--g3) 50%, transparent), transparent 72%),
        var(--base); }
html { min-height: 100%; background-color: var(--base); }
html::before { content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none; background: var(--fond); }
html[data-fond]:not([data-fond="jeu"]) body::before { display: none; }   /* les cartes flottantes : fond « Couleurs du jeu » seulement */
/* Cartes flottantes floues aux couleurs des catégories (fond « Couleurs du jeu ») */
body { position: relative; }
body::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.34; background-repeat: repeat-y !important; background-size: 100% auto !important;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 428 926'><defs><filter id='f'><feGaussianBlur stdDeviation='3'/></filter></defs><g filter='url(%23f)' fill-opacity='.55'><rect x='330' y='120' width='70' height='98' rx='12' fill='%236604d4' transform='rotate(18 365 169)'/><rect x='-20' y='300' width='64' height='90' rx='11' fill='%23ff0000' transform='rotate(-16 12 345)'/><rect x='360' y='520' width='60' height='84' rx='10' fill='%2301879f' transform='rotate(-10 390 562)'/><rect x='20' y='700' width='58' height='80' rx='10' fill='%23389a06' transform='rotate(14 49 740)'/><rect x='250' y='840' width='66' height='92' rx='11' fill='%2382066f' transform='rotate(-20 283 886)'/></g></svg>") center / cover no-repeat;
}


/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; overflow-x: clip; }
/* Comme une appli : jamais de barre de défilement visible (la molette, le doigt et le pavé tactile défilent toujours) */
* { scrollbar-width: none; }
::-webkit-scrollbar { display: none; width: 0; height: 0; }
body { font-family: var(--police); color: var(--texte); min-height: 100dvh; line-height: 1.4;
       -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: none; background: none; cursor: pointer; }
.ico { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -0.18em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- Mise en page ---------- */
.ecran { width: 100%; max-width: 520px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column;
         padding: calc(14px + var(--safe-top)) 18px calc(26px + var(--safe-bottom)); }
.ecran.avec-nav { padding-bottom: calc(var(--nav-h) + 30px + var(--nav-bas)); }
/* Appli installée sur l'écran d'accueil (iPhone, iPad, Android) :
   - iOS raccourcit l'affichage de la hauteur de la barre d'état tant que la page n'est pas au moins aussi haute que l'écran
     (bug WebKit 301108 : bande vide en bas, qui ne partait qu'en tirant la page). La page fait donc toujours la hauteur de l'écran.
   - les pages avec la barre du bas font 1 px de plus que l'écran : la barre est à sa place dès la première image. */
@media all and (display-mode: standalone), all and (display-mode: fullscreen) {
    html { min-height: min(100lvh, calc(100% + env(safe-area-inset-top, 0px))); }
    .ecran.avec-nav { min-height: calc(100lvh + 1px); }
}
.ecran.avec-nav::after { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 150px; pointer-events: none; z-index: 40;
                         background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--base) 92%, transparent) 70%); }
.haut { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.titre-page { font-size: 1.25rem; font-weight: 900; letter-spacing: -0.03em; }
.section { margin-top: 24px; }
.section > h3 { display: flex; align-items: center; font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.09em;
                color: var(--texte-2); margin: 0 4px 10px; }
.section > h3::before { content: ""; width: 28px; height: 6px; border-radius: 3px; margin-right: 8px; flex: none;
    background: linear-gradient(90deg, #ff0000 0 16.6%, #6604d4 0 33.3%, #82066f 0 50%, #01879f 0 66.6%, #389a06 0 83.3%, #fff 0); }
.section > h3 a { margin-left: auto; color: #fff; text-transform: none; letter-spacing: 0; font-size: 0.85rem; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo img.icone { width: 38px; height: 38px; border-radius: 10px; box-shadow: 0 6px 16px rgba(0,0,0,.4); }
.logo img.nom { height: 22px; width: auto; }

/* ---------- Verre ---------- */
.verre, .btn-rond, .tuile {
    background: var(--verre); border: 1px solid var(--verre-bord);
    backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 10px 30px rgba(0,0,0,0.25);
}
.btn-rond { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; }
.tuile { border-radius: 22px; padding: 16px; }

/* ---------- Boutons ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 58px; padding: 0 22px;
       border-radius: 999px; font-weight: 800; font-size: 1.05rem; transition: transform .12s, opacity .15s; user-select: none; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .5; transform: none; cursor: default; }
.btn-blanc { background: #fff; color: var(--encre); box-shadow: 0 12px 30px rgba(0,0,0,0.35); }
.btn-verre { background: var(--verre-2); color: #fff; border: 1px solid var(--verre-bord); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.btn-degrade { background: linear-gradient(135deg, var(--g1), var(--g2) 60%, var(--g3)); color: #fff; box-shadow: 0 12px 30px rgba(0,0,0,0.35); }
.btn-petit { min-height: 46px; font-size: .92rem; width: auto; }

/* ---------- Champs ---------- */
.champ { display: flex; align-items: center; gap: 12px; background: #f4f4f8; color: #8f87a8; border-radius: 18px;
         padding: 0 16px; min-height: 56px; border: 2px solid transparent; transition: box-shadow .2s; }
.champ:focus-within { box-shadow: 0 0 0 3px rgba(255,255,255,0.45); color: var(--g2); }
.champ input { flex: 1; min-width: 0; height: 52px; background: none; border: none; outline: none; font-size: 16px; font-weight: 600; color: var(--encre); }
.champ input::placeholder { color: #8f87a8; font-weight: 500; }
.champ input:-webkit-autofill { -webkit-box-shadow: 0 0 0 100px #fff inset; -webkit-text-fill-color: var(--encre); }
.champ + .champ { margin-top: 10px; }
.champ .oeil { width: 40px; height: 40px; margin-right: -8px; display: grid; place-items: center; color: #8f87a8; border-radius: 12px; }
.aide { font-size: .8rem; color: var(--texte-3); margin: 6px 6px 0; font-weight: 600; }
.aide.ok { color: #6ee7a8; } .aide.ko { color: #ff9aa5; }

/* ---------- Segmenté ---------- */
.segment { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 5px; border-radius: 999px;
           background: var(--verre); border: 1px solid var(--verre-bord); }
.segment button { position: relative; z-index: 1; min-height: 46px; border-radius: 999px; font-weight: 800; font-size: .92rem;
                  color: rgba(255,255,255,.85); display: flex; align-items: center; justify-content: center; gap: 8px; transition: color .25s; }
.segment button[aria-selected="true"], .segment button.on { color: #fff; }
.segment .pastille { position: absolute; top: 5px; bottom: 5px; left: 5px; border-radius: 999px; background: var(--g2);
                     box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.segment.pret .pastille { transition: transform .42s cubic-bezier(.3,1.35,.5,1); }   /* pas d'animation à l'ouverture de la page */

/* ---------- Messages ---------- */
.alerte { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; font-size: .9rem; font-weight: 600; margin-bottom: 14px; }
.alerte .ico { margin-top: .1em; }
.alerte-erreur { background: rgba(255, 77, 94, .16); border: 1px solid rgba(255, 77, 94, .4); color: #ffd1d6; }
.alerte-succes { background: rgba(34, 197, 94, .16); border: 1px solid rgba(34, 197, 94, .4); color: #c9f7d9; }

/* ---------- Tuiles de catégories ---------- */
.cat { --c: var(--c-films); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; aspect-ratio: 1;
       border-radius: 22px; color: #fff; font-weight: 800; font-size: .74rem; text-align: center; padding: 6px; position: relative;
       background: linear-gradient(160deg, color-mix(in srgb, var(--c) 70%, #fff) 0%, var(--c) 55%, color-mix(in srgb, var(--c) 75%, #000) 100%);
       box-shadow: 0 10px 24px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.45); }
.cat .ico { width: 30px; height: 30px; }
.cat small { font-size: .66rem; font-weight: 700; opacity: .8; }
.cat.films { background: linear-gradient(160deg, #4a4a5a 0%, #15151c 55%, #000 100%); }
.cat.series { --c: var(--c-series); } .cat.acteurs { --c: var(--c-acteurs); } .cat.personnages { --c: var(--c-personnages); }
.cat.dessins { --c: var(--c-dessins); } .cat.jeux { --c: var(--c-jeux); }

/* ---------- Vignette : format unique 2:3, toujours rempli ---------- */
.vignette { position: relative; aspect-ratio: 2 / 3; border-radius: 16px; overflow: hidden; background: #111;
            box-shadow: 0 10px 24px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.14); }
.vignette img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vignette.sans-image { display: grid; place-items: center;
    background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.22), transparent 60%),
                repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 10px, rgba(255,255,255,.02) 10px 20px),
                color-mix(in srgb, var(--c) 70%, #000); }
.vignette.sans-image .ico { width: 42%; height: auto; aspect-ratio: 1; opacity: .9; stroke-width: 1.6; }

/* ---------- Avatar ---------- */
.avatar { --a: var(--c-acteurs); width: 44px; height: 44px; border-radius: 50%; background: var(--a); display: grid; place-items: center;
          font-weight: 900; font-size: 1.05rem; color: #fff; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.7), 0 6px 16px rgba(0,0,0,.35); }

/* ---------- Barre de navigation ----------
   Téléphone : barre de verre fixe en bas, l'onglet actif dans une bulle (pas d'animation entre les pages).
   Ordinateur : bandeau en haut avec le logo à gauche et les onglets à droite. */
.nav { position: fixed; z-index: 50; left: 12px; right: 12px; bottom: var(--nav-bas); margin: 0 auto; max-width: 480px;
       height: var(--nav-h); padding: 6px; border-radius: 26px; display: flex; gap: 4px;
       background: rgba(18, 20, 44, 0.72); border: 1px solid rgba(255,255,255,0.16);
       backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
       box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 16px 36px rgba(0,0,0,.45);
       transform: translateZ(0); -webkit-transform: translateZ(0); }
.nav .nav-logo { display: none; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 20px;
         font-size: .66rem; font-weight: 700; color: rgba(255,255,255,.65); -webkit-touch-callout: none; transition: background .2s, color .2s; }
.nav a .ico { width: 24px; height: 24px; }
.nav a.on { color: #fff; background: rgba(255,255,255,.16); box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.nav a.on .ico { color: #fff; }
.nav a:active { background: rgba(255,255,255,.1); }
@media (min-width: 900px) {
    .nav { top: 0; left: 0; right: 0; bottom: auto; max-width: none; height: 68px; border-radius: 0; padding: 0 max(24px, calc((100vw - 1100px) / 2));
           align-items: center; gap: 6px; border-width: 0 0 1px; background: rgba(10, 11, 30, 0.75); }
    .nav .nav-logo { display: flex; align-items: center; gap: 10px; margin-right: auto; }
    .nav .nav-logo img:first-child { width: 36px; height: 36px; border-radius: 10px; }
    .nav .nav-logo img:last-child { height: 22px; }
    .nav a { flex: none; flex-direction: row; gap: 8px; height: 44px; padding: 0 18px; font-size: .92rem; border-radius: 999px; }
    .nav a .ico { width: 20px; height: 20px; }
    .ecran.avec-nav { padding-top: calc(96px + var(--safe-top)); padding-bottom: 40px; }
    .ecran.avec-nav::after { display: none; }
    .ecran.avec-nav > .haut .logo { display: none; }
}

/* ---------- Listes réglages (iOS) ---------- */
.liste { border-radius: 24px; overflow: hidden; background: var(--verre); border: 1px solid var(--verre-bord);
         backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: inset 0 1px 0 rgba(255,255,255,.1); }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; font-weight: 700; width: 100%; text-align: left; min-height: 60px; }
.item + .item { border-top: 1px solid rgba(255,255,255,0.08); }
.item .pic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none;
             background: var(--g2); color: #fff; }
.item .droite { margin-left: auto; color: rgba(255,255,255,.55); display: flex; align-items: center; gap: 6px; font-size: .85rem; }
.item.danger { color: var(--rouge); }
.item.danger .pic { background: rgba(255,93,108,.18); color: var(--rouge); }
.interrupteur { position: relative; width: 52px; height: 32px; flex: none; margin-left: auto; }
.interrupteur input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; margin: 0; }
.interrupteur span { position: absolute; inset: 0; border-radius: 999px; background: rgba(255,255,255,.22); transition: background .25s; }
.interrupteur span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff;
                            box-shadow: 0 2px 6px rgba(0,0,0,.3); transition: transform .3s cubic-bezier(.3,1.4,.5,1); }
.interrupteur input:checked + span { background: var(--g2); }
.interrupteur input:checked + span::after { transform: translateX(20px); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* =====================================================================
   Écrans
   ===================================================================== */
/* ---------- Connexion / inscription ---------- */
.ecran.auth { justify-content: center; max-width: 460px; }
.hero { text-align: center; }
.hero img.icone { width: 92px; height: 92px; border-radius: 26px; box-shadow: 0 18px 40px rgba(0,0,0,.5); }
.hero img.nom { display: block; height: 44px; width: auto; margin: 16px auto 0; }
.hero p { color: var(--texte-2); font-weight: 600; margin-top: 10px; }
.ruban { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 24px 4px 22px; }
.ruban .cat { border-radius: 14px; padding: 0; }
.ruban .cat .ico { width: 22px; height: 22px; }
.ruban .cat:nth-child(1) { transform: rotate(-12deg) translateY(6px); }
.ruban .cat:nth-child(2) { transform: rotate(8deg) translateY(-6px); }
.ruban .cat:nth-child(3) { transform: rotate(-4deg) translateY(10px); }
.ruban .cat:nth-child(4) { transform: rotate(14deg) translateY(-2px); }
.ruban .cat:nth-child(5) { transform: rotate(-9deg) translateY(-8px); }
.ruban .cat:nth-child(6) { transform: rotate(6deg) translateY(8px); }
.formulaire { border-radius: 30px; padding: 18px; background: rgba(255,255,255,0.09); border: 1px solid var(--verre-bord);
              backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.formulaire .segment { margin-bottom: 16px; }
.formulaire .btn { margin-top: 18px; }
.vue { animation: apparait .35s cubic-bezier(.3,1.2,.5,1); }
.vue[hidden] { display: none; }
@keyframes apparait { from { opacity: 0; transform: translateY(8px); } }
.case { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: .84rem; font-weight: 600; color: var(--texte-2); cursor: pointer; }
.case input { width: 20px; height: 20px; flex: none; accent-color: var(--g2); margin-top: 1px; }
.case a { color: #fff; text-decoration: underline; }
.lien { text-align: center; margin-top: 14px; font-weight: 700; font-size: .88rem; color: var(--texte-2); }
.lien a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.force { display: flex; gap: 4px; margin: 8px 6px 0; }
.force i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.18); transition: background .25s; }

/* ---------- Accueil ---------- */
.salut h2 { font-size: 2rem; font-weight: 900; letter-spacing: -0.04em; line-height: 1.04; margin-top: 18px; }
.salut p { color: var(--texte-2); font-weight: 600; margin-top: 6px; font-size: .92rem; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode { border-radius: 28px; padding: 16px 14px 14px; min-height: 172px; display: flex; flex-direction: column; justify-content: space-between;
        position: relative; overflow: hidden; transition: transform .15s; }
.mode:active { transform: scale(.97); }
.mode .ico-g { width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; }
.mode .ico-g .ico { width: 26px; height: 26px; }
.mode b { font-size: 1.08rem; font-weight: 900; letter-spacing: -0.03em; line-height: 1.15; display: block; }
.mode small { font-size: .76rem; font-weight: 600; opacity: .85; }
.mode.un { background: linear-gradient(150deg, var(--g1), var(--g2) 60%, var(--g3)); border: 1px solid rgba(255,255,255,.25);
           box-shadow: 0 14px 34px rgba(0,0,0,.35); }
.mode.multi { background: var(--verre); border: 1px solid var(--verre-bord); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
              box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 10px 30px rgba(0,0,0,.25); }
.code { display: flex; gap: 10px; margin-top: 12px; }
.code .champ { flex: 1; min-width: 0; }
.code .champ input { letter-spacing: .32em; text-transform: uppercase; font-weight: 900; }
.code .champ input::placeholder { letter-spacing: .1em; }
.code .btn { width: auto; flex: none; padding: 0 20px; min-height: 56px; }
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.vide { text-align: center; padding: 26px 18px; border-radius: 24px; background: var(--verre); border: 1.5px dashed rgba(255,255,255,.3); }
.vide .ico { width: 40px; height: 40px; opacity: .85; }
.vide b { display: block; font-size: 1.05rem; font-weight: 900; margin-top: 8px; }
.vide p { color: var(--texte-2); font-size: .88rem; font-weight: 600; margin-top: 4px; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #fff; color: var(--encre); font-size: .7rem; font-weight: 900;
         text-transform: uppercase; letter-spacing: .06em; margin-top: 12px; }

/* ---------- Profil / réglages ---------- */
.profil { display: flex; flex-direction: column; align-items: center; text-align: center; margin-top: 6px; }
.profil .avatar { width: 88px; height: 88px; border-radius: 28px; font-size: 2.3rem; transform: rotate(-5deg); }
.profil h2 { font-size: 1.6rem; font-weight: 900; letter-spacing: -0.03em; margin-top: 14px; }
.profil p { color: var(--texte-3); font-weight: 700; font-size: .85rem; margin-top: 2px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.stat { border-radius: 20px; padding: 12px 6px; text-align: center; background: var(--verre); border: 1px solid var(--verre-bord);
        backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.stat b { display: block; font-size: 1.5rem; font-weight: 900; letter-spacing: -0.04em; }
.stat small { font-size: .7rem; font-weight: 700; color: var(--texte-2); }
.couleurs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; padding: 4px 14px 16px; }
.couleurs button { aspect-ratio: 1; border-radius: 14px; position: relative; box-shadow: 0 6px 14px rgba(0,0,0,.35); }
.couleurs button[aria-pressed="true"]::after { content: ""; position: absolute; inset: -5px; border-radius: 18px; border: 3px solid #fff; }
/* (anciens styles .fonds remplacés en v4.11, voir plus bas) */
.version { text-align: center; color: var(--texte-3); font-size: .75rem; font-weight: 600; margin-top: 22px; }

/* ---------- Petite notification ---------- */
.toast { position: fixed; left: 50%; top: calc(14px + var(--safe-top)); z-index: 80; transform: translate(-50%, -200%); opacity: 0; visibility: hidden; transition: transform .45s cubic-bezier(.3,1.4,.5,1), opacity .25s, visibility 0s .45s;
         padding: 12px 18px; border-radius: 999px; background: rgba(20,22,46,.88); border: 1px solid rgba(255,255,255,.18); font-weight: 700; font-size: .9rem;
         backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 14px 30px rgba(0,0,0,.4); white-space: nowrap; }
.toast.on { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform .45s cubic-bezier(.3,1.4,.5,1), opacity .2s, visibility 0s; }

@media (min-width: 900px) {
    .ecran.auth { max-width: 460px; }
}
.reprendre { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 12px 14px; border-radius: 22px; }
.reprendre .pic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #fff; color: var(--encre); }
.reprendre small { display: block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-3); }
.reprendre b { display: block; font-weight: 900; font-size: 1rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reprendre > span:nth-child(2) { min-width: 0; flex: 1; }
.reprendre .aller { display: flex; align-items: center; gap: 2px; font-weight: 800; font-size: .85rem; flex: none; }
a.vide { display: block; }

/* =====================================================================
   4b — Créer / rejoindre une partie, salle d'attente
   ===================================================================== */
/* ---------- Choix en tuiles (nombre de cartes, durée, type de cartes) ---------- */
.choix { display: grid; gap: 10px; }
.choix.c3 { grid-template-columns: repeat(3, 1fr); }
.choix.c4 { grid-template-columns: repeat(4, 1fr); }
.choix.c5 { grid-template-columns: repeat(5, 1fr); }
.choix label { position: relative; cursor: pointer; }
.choix input { position: absolute; opacity: 0; pointer-events: none; }
.choix .tuile-choix { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 100%; min-height: 92px;
    padding: 12px 4px 10px; border-radius: 20px; text-align: center; font-weight: 800; transition: transform .15s, background .2s, color .2s;
    background: var(--verre); border: 1px solid var(--verre-bord); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.choix .tuile-choix b { font-size: .95rem; letter-spacing: -0.02em; }
.choix .tuile-choix small { font-size: .66rem; font-weight: 700; color: var(--texte-3); }
.choix .tuile-choix .ico { width: 26px; height: 26px; }
.choix input:checked + .tuile-choix { background: #fff; color: var(--encre); border-color: #fff; box-shadow: 0 12px 26px rgba(0,0,0,.35); transform: translateY(-2px); }
.choix input:checked + .tuile-choix small { color: var(--g2); }
.choix input:focus-visible + .tuile-choix { outline: 2px solid #fff; outline-offset: 2px; }
.choix input:disabled + .tuile-choix { opacity: .45; cursor: not-allowed; }
.choix .bientot { position: absolute; top: -7px; right: -4px; z-index: 1; font-size: .56rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em;
                  background: var(--g2); color: #fff; padding: 3px 6px; border-radius: 999px; }
/* Pile de cartes qui grandit */
.pile { position: relative; width: 34px; height: 34px; }
.pile i { position: absolute; top: 4px; left: 8px; width: 18px; height: 25px; border-radius: 4px; background: rgba(255,255,255,.9);
          border: 2px solid rgba(255,255,255,.35); box-shadow: 0 1px 2px rgba(0,0,0,.35); }
.choix input:checked + .tuile-choix .pile i { background: #fff; border-color: var(--g2); }
/* Mini-chrono rempli selon la durée (90 s = cadran complet) */
.anneau { --p: 66; width: 34px; height: 34px; border-radius: 50%; position: relative;
          background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255,255,255,.18) 0);
          -webkit-mask: radial-gradient(circle, transparent 10px, #000 10.5px); mask: radial-gradient(circle, transparent 10px, #000 10.5px); }
.choix input:checked + .tuile-choix .anneau { background: conic-gradient(var(--g2) calc(var(--p) * 1%), rgba(11,16,48,.14) 0); }

/* ---------- Catégories à cocher ---------- */
.cats.cocher label { position: relative; cursor: pointer; display: block; }
.cats.cocher input { position: absolute; opacity: 0; pointer-events: none; }
.cats.cocher .cat { aspect-ratio: 1.2; transition: filter .25s, transform .15s; }
.cats.cocher input:not(:checked) + .cat { filter: saturate(.12) brightness(.5); }
.cats.cocher input:focus-visible + .cat { outline: 2px solid #fff; outline-offset: 2px; }
.cat .coche { position: absolute; top: 7px; right: 7px; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center;
              transition: transform .25s cubic-bezier(.3,1.5,.5,1); }
.cat .coche .ico { width: 13px; height: 13px; stroke-width: 3.2; }
.cats.cocher input:not(:checked) + .cat .coche { transform: scale(0); }
.section > h3 button { margin-left: auto; color: #fff; font-size: .85rem; font-weight: 700; text-transform: none; letter-spacing: 0; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Bouton principal collé en bas ---------- */
.bas-fixe { position: sticky; z-index: 45; bottom: calc(12px + var(--safe-bottom)); margin-top: 22px; }
.avec-nav .bas-fixe { bottom: calc(var(--nav-h) + 14px + var(--nav-bas)); }
@media (min-width: 900px) { .avec-nav .bas-fixe { bottom: 20px; } }
.bas-fixe p { text-align: center; color: var(--texte-2); font-weight: 700; font-size: .8rem; margin-top: 8px; text-shadow: 0 1px 6px rgba(0,0,0,.6); }

/* ---------- Parties ouvertes ---------- */
.ouvertes { display: grid; gap: 10px; }
.ouverte { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; border-radius: 20px; background: var(--verre); border: 1px solid var(--verre-bord);
           backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.ouverte .code-mini { flex: none; padding: 8px 10px; border-radius: 12px; background: #fff; color: var(--encre); font-weight: 900; letter-spacing: .14em; font-size: .9rem; }
.ouverte b { display: block; font-weight: 800; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ouverte small { color: var(--texte-3); font-weight: 700; font-size: .76rem; }
.ouverte > span:nth-child(2) { flex: 1; min-width: 0; }
.ouverte .aller { flex: none; display: flex; align-items: center; gap: 2px; font-weight: 800; font-size: .85rem; }

/* ---------- Salle d'attente ---------- */
.code-salon { text-align: center; margin-top: 6px; }
.code-salon small { font-weight: 800; font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--texte-3); }
.lettres { display: flex; justify-content: center; gap: 10px; margin: 10px 0 14px; }
.lettres span { width: 60px; height: 70px; border-radius: 18px; background: #fff; color: var(--encre); font-size: 2.3rem; font-weight: 900;
                display: grid; place-items: center; box-shadow: 0 14px 30px rgba(0,0,0,.35); }
.lettres span:nth-child(odd) { transform: rotate(-4deg); } .lettres span:nth-child(even) { transform: rotate(3deg) translateY(5px); }
.partage { display: flex; justify-content: center; gap: 10px; }
.partage .btn { width: auto; }
.equipes { display: grid; gap: 12px; }
.equipe { --e: #e11d48; display: block; width: 100%; text-align: left; border-radius: 26px; padding: 14px; color: #fff;
          background: linear-gradient(145deg, color-mix(in srgb, var(--e) 88%, transparent), color-mix(in srgb, var(--e) 55%, #000) 120%);
          border: 1px solid rgba(255,255,255,.2); box-shadow: 0 12px 28px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.25); transition: transform .15s; }
button.equipe:active { transform: scale(.98); }
.equipe header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.equipe header b { font-size: 1.1rem; font-weight: 900; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.equipe header span { flex: none; font-size: .72rem; font-weight: 800; background: rgba(0,0,0,.25); padding: 4px 9px; border-radius: 999px; }
.equipe.moi { box-shadow: 0 0 0 3px #fff, 0 12px 28px rgba(0,0,0,.3); }
.equipe .action { display: block; margin-top: 10px; text-align: center; font-weight: 800; font-size: .85rem; background: rgba(255,255,255,.2); border-radius: 999px; padding: 8px; }
.joueurs { display: flex; flex-wrap: wrap; gap: 8px; }
.joueur { display: inline-flex; align-items: center; gap: 7px; background: rgba(0,0,0,.24); border-radius: 999px; padding: 4px 12px 4px 4px; font-weight: 700; font-size: .88rem; max-width: 100%; }
.joueur .avatar { width: 30px; height: 30px; font-size: .8rem; box-shadow: 0 0 0 1.5px rgba(255,255,255,.7); }
.joueur .ico { width: 16px; height: 16px; flex: none; }
.joueur .ico.couronne { color: #ffd166; }
.ajout-equipe { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 16px; border-radius: 24px; font-weight: 800; color: var(--texte-2);
                border: 1.5px dashed rgba(255,255,255,.35); background: rgba(255,255,255,.04); }
.resume { display: flex; flex-wrap: wrap; gap: 8px; }
.resume span, .resume button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; font-weight: 700; font-size: .8rem;
    background: var(--verre); border: 1px solid var(--verre-bord); }
.resume .ico { width: 15px; height: 15px; }
.resume button { background: #fff; color: var(--encre); border-color: #fff; }
.secrete { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 22px; background: var(--verre); border: 1px solid var(--verre-bord); }
.secrete .pic { width: 44px; height: 54px; border-radius: 10px; display: grid; place-items: center; flex: none;
                background: repeating-linear-gradient(135deg, rgba(255,255,255,.14) 0 6px, rgba(255,255,255,.04) 6px 12px), linear-gradient(150deg, var(--g1), var(--g3)); }
.secrete b { display: block; font-weight: 800; } .secrete small { display: block; color: var(--texte-3); font-weight: 600; font-size: .78rem; line-height: 1.3; }
.secrete > span:nth-child(2) { flex: 1; min-width: 0; }
.attente { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; border-radius: 999px; font-weight: 800;
           background: var(--verre); border: 1px solid var(--verre-bord); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.points i { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: #fff; animation: rebond 1.2s infinite; }
.points i:nth-child(2) { animation-delay: .15s; } .points i:nth-child(3) { animation-delay: .3s; }
@keyframes rebond { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* ---------- Feuille du bas (réglages, nouvelle équipe, carte secrète) ---------- */
.voile { position: fixed; inset: 0; z-index: 60; background: rgba(3,4,14,.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
         opacity: 0; transition: opacity .3s; }
.feuille { position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
           border-radius: 30px 30px 0 0; padding: 10px 18px calc(22px + var(--safe-bottom));
           background: rgba(22,24,50,.9); backdrop-filter: blur(30px) saturate(160%); -webkit-backdrop-filter: blur(30px) saturate(160%);
           border-top: 1px solid rgba(255,255,255,.18); box-shadow: 0 -20px 50px rgba(0,0,0,.5);
           transform: translateY(105%); transition: transform .45s cubic-bezier(.3,1.15,.5,1); }
.feuille.ouverte-f { transform: none; }
.voile.ouverte-f { opacity: 1; }
.feuille[hidden], .voile[hidden] { display: block; visibility: hidden; pointer-events: none; }
.feuille .poignee { width: 40px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.35); margin: 0 auto 14px; }
.feuille h4 { font-size: 1.25rem; font-weight: 900; letter-spacing: -.02em; }
.feuille p.s { color: var(--texte-2); font-weight: 600; font-size: .86rem; margin: 4px 0 14px; }
.feuille .section:first-of-type { margin-top: 14px; }
.feuille .btn { margin-top: 18px; }
.choix-cat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.choix-cat label { cursor: pointer; position: relative; }
.choix-cat input { position: absolute; opacity: 0; pointer-events: none; }
.choix-cat .cat { aspect-ratio: auto; flex-direction: row; gap: 6px; padding: 10px 6px; border-radius: 16px; font-size: .72rem; }
.choix-cat .cat .ico { width: 18px; height: 18px; }
.choix-cat input:not(:checked) + .cat { filter: saturate(.15) brightness(.55); }
.choix-cat input:checked + .cat { box-shadow: 0 0 0 3px #fff, 0 8px 18px rgba(0,0,0,.35); }
/* Le bouton collé en bas masque proprement ce qui défile dessous */
.bas-fixe::before { content: ""; position: absolute; z-index: -1; left: -18px; right: -18px; top: -34px; bottom: calc(-14px - var(--safe-bottom));
                    background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--base) 90%, transparent) 38%); pointer-events: none; }
.avec-nav .bas-fixe::before { bottom: -16px; }
.attente { background: rgba(24,26,54,.88); }
.secrete.faite { cursor: default; }
.secrete.faite > .ico { display: none; }

/* =====================================================================
   4b — Écran de jeu
   ===================================================================== */
html.jeu { transition: --c .9s ease; background-color: color-mix(in srgb, var(--c) 42%, #000); overscroll-behavior: none; }
html.jeu::before { background:
    radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--c) 88%, #fff) 0%, color-mix(in srgb, var(--c) 80%, #000) 48%, color-mix(in srgb, var(--c) 42%, #000) 100%),
    var(--base); }
html.jeu body::before { display: none; }
.ecran.partie { padding-bottom: calc(18px + var(--safe-bottom)); gap: 0; }
.infos { display: flex; align-items: center; gap: 10px; }
.infos .btn-rond { width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.22); }
.manche-pill { flex: 1; min-width: 0; padding: 9px 14px; border-radius: 999px; font-weight: 800; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
               background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.18); }
.chronog { --t: 1; position: relative; flex: none; width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center;
           background: conic-gradient(#fff calc(var(--t) * 360deg), rgba(255,255,255,.22) 0); box-shadow: 0 10px 24px rgba(0,0,0,.3); }
.chronog::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: color-mix(in srgb, var(--c) 70%, #000); }
.chronog b { position: relative; z-index: 1; font-size: 1.5rem; font-weight: 900; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.chronog.urgent { animation: pouls .5s ease-in-out infinite alternate; }
.chronog.urgent::after { background: #b4002a; }
@keyframes pouls { to { transform: scale(1.08); } }
.scores-jeu { display: flex; gap: 8px; margin: 12px -18px 0; padding: 2px 18px 4px; overflow-x: auto; scrollbar-width: none; }
.scores-jeu::-webkit-scrollbar { display: none; }
.score-pill { flex: 1 0 auto; min-width: 46%; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 16px; font-weight: 800; font-size: .88rem;
              background: rgba(0,0,0,.24); border: 1px solid rgba(255,255,255,.16); transition: background .3s, color .3s, transform .3s; }
.score-pill i { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--e); box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.score-pill span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-pill b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.score-pill.actif { background: #fff; color: var(--encre); }
.score-pill.gagne b { animation: saut .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes saut { 40% { transform: scale(1.5); } }

/* La carte */
.carte { --c: var(--c-films); flex: 1; display: flex; flex-direction: column; align-items: center; margin: 14px 0; padding: 14px 16px 16px; border-radius: 30px;
         min-height: 0; position: relative; overflow: hidden;
         background: linear-gradient(170deg, rgba(255,255,255,.16), rgba(255,255,255,.05)); border: 1px solid rgba(255,255,255,.26);
         backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 20px 50px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.3);
         transform: perspective(1200px) rotateY(0deg); transition: transform .55s cubic-bezier(.45,0,.2,1); }
.carte.tourne { transform: perspective(1200px) rotateY(90deg); }
.carte.sans-anim { transition: none; }
.cat-tag { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 8px; border-radius: 999px; font-weight: 800; font-size: .8rem;
           background: rgba(0,0,0,.25); }
.cat-tag .ico { width: 18px; height: 18px; }
.carte .affiche { width: 54%; max-width: 220px; margin-top: 12px; flex: none; }
.carte .affiche.vignette { width: auto; max-width: none; aspect-ratio: 2 / 3; height: min(36dvh, calc(54vw * 1.5), 330px); }
.carte .nom { margin: 22px 0 0; padding: 0 6px; text-align: center; font-size: clamp(1.7rem, 8.5vw, 2.4rem); font-weight: 900; letter-spacing: -.035em; line-height: 1.06;
              overflow-wrap: anywhere; }
.carte .consigne { margin-top: auto; align-self: stretch; text-align: center; font-weight: 700; font-size: .88rem; padding: 10px 12px; border-radius: 14px;
                   background: rgba(0,0,0,.22); }
.carte .nom + .consigne { margin-top: auto; }
.carte .espace { flex: 1; min-height: 14px; }
.actions-jeu { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; }
.actions-jeu .btn { min-height: 68px; border-radius: 22px; font-size: 1.12rem; }
.actions-jeu .btn-blanc { color: color-mix(in srgb, var(--c) 75%, #000); }
.actions-jeu .btn-verre { background: rgba(0,0,0,.22); }
.trouvees { display: flex; gap: 5px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 12px; color: rgba(255,255,255,.8); font-weight: 700; font-size: .8rem; }
.trouvees i { width: 9px; height: 13px; border-radius: 3px; background: #fff; display: inline-block; }

/* Spectateur */
.spectateur { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; margin: 14px 0; padding: 24px 18px;
              border-radius: 30px; background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.18); }
.spectateur .avatar { width: 96px; height: 96px; border-radius: 30px; font-size: 2.6rem; transform: rotate(-5deg); }
.spectateur small { margin-top: 18px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: .74rem; color: rgba(255,255,255,.75); }
.spectateur b { font-size: 2.2rem; font-weight: 900; letter-spacing: -.04em; line-height: 1.1; margin-top: 2px; }
.spectateur .equipe-tag { margin-top: 8px; padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: .85rem; background: rgba(255,255,255,.2); }
.spectateur p { margin-top: 18px; font-weight: 700; font-size: 1.02rem; max-width: 300px; }
.spectateur .consigne { margin-top: 18px; padding: 10px 14px; border-radius: 14px; background: rgba(0,0,0,.22); font-weight: 700; font-size: .86rem; }
.spectateur.mon-equipe p { font-size: 1.25rem; font-weight: 900; }

/* Préparation (compte à rebours plein écran) */
.prepa { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px;
         background: color-mix(in srgb, var(--c) 55%, rgba(5,6,20,.92)); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.prepa[hidden] { display: none; }
.prepa small { font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; color: rgba(255,255,255,.8); }
.prepa b { display: block; font-size: 2.3rem; font-weight: 900; letter-spacing: -.04em; line-height: 1.08; margin-top: 8px; }
.prepa .compte { width: 140px; height: 140px; margin: 26px 0; border-radius: 50%; display: grid; place-items: center; font-size: 4.4rem; font-weight: 900;
                 background: #fff; color: var(--encre); box-shadow: 0 20px 50px rgba(0,0,0,.4); font-variant-numeric: tabular-nums; }
.prepa .compte.pop { animation: pop .45s cubic-bezier(.3,1.6,.5,1); }
@keyframes pop { from { transform: scale(.7); } }
.prepa p { font-weight: 700; font-size: 1rem; max-width: 320px; color: rgba(255,255,255,.9); }
@media (min-width: 700px) { .ecran.partie { max-width: 560px; } }

/* =====================================================================
   4b — Fin de manche et résultats
   ===================================================================== */
.etapes-manches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.etapes-manches span { text-align: center; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.55);
                       padding-top: 9px; position: relative; }
.etapes-manches span::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; border-radius: 3px; background: rgba(255,255,255,.22); }
.etapes-manches span.faite { color: #fff; }
.etapes-manches span.faite::before { background: #fff; }
.entete-bilan { text-align: center; margin-top: 22px; }
.badge-bilan { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; background: rgba(0,0,0,.25); font-weight: 800; font-size: .8rem; }
.badge-bilan .ico { width: 16px; height: 16px; }
.entete-bilan h1 { font-size: clamp(1.9rem, 9vw, 2.5rem); font-weight: 900; letter-spacing: -.04em; line-height: 1.05; margin-top: 12px; overflow-wrap: anywhere; }
.entete-bilan h1 span { font-size: .62em; font-weight: 800; letter-spacing: -.02em; opacity: .85; }
.entete-bilan p { margin-top: 8px; font-weight: 600; color: rgba(255,255,255,.88); }
.classement { display: grid; gap: 10px; margin-top: 22px; }
.ligne-bilan { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.14); }
.ligne-bilan.moi { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.4); }
.ligne-bilan .rang { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 900; background: var(--e); box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.ligne-bilan .milieu { flex: 1; min-width: 0; }
.ligne-bilan .milieu b { display: block; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne-bilan .milieu small { font-weight: 700; font-size: .72rem; opacity: .75; }
.jauge { display: block; height: 7px; margin-top: 7px; border-radius: 4px; background: rgba(255,255,255,.16); overflow: hidden; }
.jauge i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--e), color-mix(in srgb, var(--e) 50%, #fff)); transition: width 1s cubic-bezier(.3,1,.4,1); }
.ligne-bilan .pts { text-align: right; flex: none; }
.ligne-bilan .pts b { display: block; font-size: 1.5rem; font-weight: 900; line-height: 1; letter-spacing: -.03em; }
.ligne-bilan .pts small { font-size: .68rem; font-weight: 700; opacity: .8; }
.suite-manche { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 14px; border-radius: 22px; background: #fff; color: var(--encre); }
.suite-manche .num { width: 52px; height: 52px; border-radius: 16px; flex: none; display: grid; place-items: center; font-size: 1.6rem; font-weight: 900; color: #fff;
                     background: linear-gradient(140deg, var(--g1), var(--g3)); }
.suite-manche small { display: block; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--g2); }
.suite-manche b { display: block; font-size: 1.15rem; font-weight: 900; }
.suite-manche span > span { font-size: .85rem; font-weight: 600; color: #4b5175; }
.bilan .bas-fixe { margin-top: auto; padding-top: 22px; }
.bilan .bas-fixe::before { display: none; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin-top: 26px; }
.marche { flex: 1; max-width: 130px; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.marche b { font-weight: 900; font-size: .95rem; line-height: 1.15; max-width: 100%; overflow-wrap: anywhere; }
.marche small { font-weight: 700; font-size: .8rem; opacity: .85; margin: 2px 0 8px; }
.marche .couronne { width: 34px; height: 34px; color: #ffd166; margin-bottom: 4px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); animation: pop .6s .3s both cubic-bezier(.3,1.6,.5,1); }
.marche .socle { width: 100%; display: grid; place-items: start center; padding-top: 10px; border-radius: 18px 18px 8px 8px; font-size: 2rem; font-weight: 900;
                 background: linear-gradient(180deg, color-mix(in srgb, var(--e) 85%, #fff), color-mix(in srgb, var(--e) 70%, #000));
                 box-shadow: 0 14px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.4); transform-origin: bottom; animation: monte .7s cubic-bezier(.3,1.3,.5,1) both; }
.marche.p1 .socle { height: 150px; animation-delay: .25s; } .marche.p2 .socle { height: 110px; animation-delay: .1s; } .marche.p3 .socle { height: 80px; animation-delay: .4s; }
@keyframes monte { from { transform: scaleY(0); } }
.detail-bilan { margin-top: 18px; border-radius: 20px; overflow: hidden; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.14); }
.detail-bilan table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.detail-bilan th { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.7); font-weight: 800; padding: 10px 8px; text-align: center; }
.detail-bilan td { padding: 10px 8px; text-align: center; font-weight: 700; border-top: 1px solid rgba(255,255,255,.1); font-variant-numeric: tabular-nums; }
.detail-bilan th:first-child, .detail-bilan td:first-child { text-align: left; padding-left: 14px; }
.detail-bilan td:first-child { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-bilan td i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--e); margin-right: 7px; }
.detail-bilan tr.moi td { background: rgba(255,255,255,.1); }
.actions-bilan { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; margin-top: auto; padding-top: 22px; }
#confettis { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }



/* =====================================================================
   Retouches du 28/11 après la partie test
   ===================================================================== */
/* Tuiles de réglages en couleur (comme les catégories) */
.choix .tuile-choix { --t: var(--g2); color: #fff; border: none;
    background: linear-gradient(160deg, color-mix(in srgb, var(--t) 72%, #fff) 0%, var(--t) 55%, color-mix(in srgb, var(--t) 72%, #000) 100%);
    box-shadow: 0 10px 22px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.4); filter: saturate(.35) brightness(.62); transition: filter .25s, transform .2s, box-shadow .2s; }
.choix .tuile-choix small { color: rgba(255,255,255,.85); }
.choix input:checked + .tuile-choix { background: linear-gradient(160deg, color-mix(in srgb, var(--t) 72%, #fff) 0%, var(--t) 55%, color-mix(in srgb, var(--t) 72%, #000) 100%);
    color: #fff; filter: none; transform: translateY(-3px) scale(1.03); box-shadow: 0 0 0 3px #fff, 0 14px 28px rgba(0,0,0,.4); }
.choix input:checked + .tuile-choix small { color: #fff; }
.choix input:disabled + .tuile-choix { filter: saturate(.1) brightness(.5); opacity: 1; }
.choix.cartes-n label:nth-child(1) .tuile-choix { --t: #01879f; } .choix.cartes-n label:nth-child(2) .tuile-choix { --t: #389a06; }
.choix.cartes-n label:nth-child(3) .tuile-choix { --t: #6604d4; } .choix.cartes-n label:nth-child(4) .tuile-choix { --t: #82066f; }
.choix.cartes-n label:nth-child(5) .tuile-choix { --t: #ff0000; }
.choix.temps label:nth-child(1) .tuile-choix { --t: #ff0000; } .choix.temps label:nth-child(2) .tuile-choix { --t: #e3570c; }
.choix.temps label:nth-child(3) .tuile-choix { --t: #6604d4; } .choix.temps label:nth-child(4) .tuile-choix { --t: #01879f; }
.choix.source label:nth-child(1) .tuile-choix { --t: var(--g2); }
.choix .pile i, .choix input:checked + .tuile-choix .pile i { background: #fff; border-color: rgba(0,0,0,.15); }
.anneau, .choix input:checked + .tuile-choix .anneau { background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255,255,255,.28) 0); }

/* Bouton « Rejoindre avec un code » */
.btn-code { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 22px; color: #fff;
            background: color-mix(in srgb, var(--g2) 45%, rgba(255,255,255,.06));
            border: 1px solid rgba(255,255,255,.22); box-shadow: 0 10px 26px rgba(0,0,0,.25); }
.btn-code .pic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; background: rgba(255,255,255,.22); }
.btn-code b { display: block; font-weight: 800; } .btn-code small { display: block; font-size: .76rem; font-weight: 600; opacity: .8; }
.btn-code > span:nth-child(2) { flex: 1; }
.code-champ input { letter-spacing: .32em; text-transform: uppercase; font-weight: 900; font-size: 1.3rem !important; }
.code-champ input::placeholder { letter-spacing: .1em; }

/* Carte de jeu : tout est regroupé, pas de grand vide */
.carte { justify-content: center; }
.carte .cat-tag { position: absolute; top: 14px; left: 14px; }
.carte .affiche { margin-top: 34px; }
.carte .espace { display: none; }
.carte .consigne { margin-top: 18px; align-self: center; padding: 8px 14px; }

/* Bulle de la barre : elle grossit sous le doigt et le suit (comme sur iPhone) */
.nav .bulle.presse { transform-origin: center; background: rgba(255,255,255,.3);
    box-shadow: inset 0 1px 1px rgba(255,255,255,.8), 0 0 0 1px rgba(255,255,255,.35), 0 10px 26px rgba(0,0,0,.35); }

/* Avatar : choix de la couleur */
.couleurs.avatars button { border-radius: 50%; }
.couleurs.avatars button[aria-pressed="true"]::after { border-radius: 50%; }
/* Pages Historique, Règles, À propos */
.texte p { color: var(--texte-2); font-weight: 500; line-height: 1.55; font-size: .95rem; }
.texte p b { color: #fff; }
.chapo { font-size: 1.05rem !important; font-weight: 600 !important; color: #fff !important; }
.regle { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: 22px; color: #fff;
         background: linear-gradient(150deg, color-mix(in srgb, var(--e) 75%, transparent), color-mix(in srgb, var(--e) 40%, #000));
         border: 1px solid rgba(255,255,255,.2); }
.regle .num { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; font-weight: 900; font-size: 1.3rem; background: #fff; color: var(--e); }
.regle b { display: block; font-weight: 900; font-size: 1.05rem; margin-bottom: 2px; }
.regle span:last-child { font-weight: 600; font-size: .9rem; line-height: 1.45; }
.texte-liste .item { align-items: flex-start; font-weight: 600; font-size: .9rem; line-height: 1.4; }
.partie-histo { padding: 14px; border-radius: 22px; background: var(--verre); border: 1px solid var(--verre-bord); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.partie-histo.gagnee { border-color: rgba(255,209,102,.6); }
.partie-histo header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.partie-histo .resultat { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-3); }
.partie-histo.gagnee .resultat { color: #ffd166; }
.partie-histo .resultat .ico { width: 16px; height: 16px; }
.partie-histo header small { color: var(--texte-3); font-weight: 700; font-size: .78rem; }
.ligne-histo { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-weight: 700; }
.ligne-histo i { width: 10px; height: 10px; border-radius: 50%; background: var(--e); flex: none; }
.ligne-histo span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne-histo small { color: var(--texte-3); font-size: .72rem; }
.ligne-histo b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
/* Liste des cartes d'une catégorie */
a.cat { color: #fff; }
.onglets-cat { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 14px; }
.onglets-cat .cat { aspect-ratio: 1; border-radius: 16px; padding: 0; filter: saturate(.3) brightness(.6); }
.onglets-cat .cat.on { filter: none; box-shadow: 0 0 0 3px #fff, 0 8px 18px rgba(0,0,0,.35); }
.onglets-cat .cat .ico { width: 22px; height: 22px; }
.liste-cartes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.liste-cartes .cat { aspect-ratio: auto; display: inline-flex; flex-direction: row; padding: 9px 14px; border-radius: 14px; font-size: .86rem; font-weight: 700; }
.liste-cartes .cat[hidden] { display: none; }
@media (min-width: 900px) { .ecran.avec-nav > .haut:has(.logo) { justify-content: flex-end; } }

/* =====================================================================
   v4.9 — Cartes en partie : la main (Passer) + l'aimant (Trouvé)
   ===================================================================== */
.scene-carte { position: relative; flex: 1; min-height: 300px; margin: 6px -18px 8px; perspective: 1100px; }
.scene-carte.scene-main { clip-path: inset(-100vh -100vw 0 -100vw); }
.kc { --r: calc(var(--W) * .085); position: absolute; left: 50%; top: 50%; width: var(--W); height: var(--H); margin: calc(var(--H) / -2) 0 0 calc(var(--W) / -2);
      transform-style: preserve-3d; -webkit-transform-style: preserve-3d; will-change: transform; font-size: calc(var(--W) / 18.75); z-index: 10; pointer-events: none; }
.kc-cote { position: absolute; inset: 0; border-radius: var(--r); overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden;
           display: flex; flex-direction: column; align-items: center; color: #fff; border: 1px solid rgba(255,255,255,.3);
           box-shadow: 0 1px 2px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.25); }
/* Dos : l'icône et le nom de la catégorie, rien d'autre */
.kc-dos { justify-content: center; gap: .7em; transform: translateZ(1px);
          background: radial-gradient(circle at 50% 36%, rgba(255,255,255,.3), transparent 56%),
                      repeating-linear-gradient(135deg, rgba(255,255,255,.09) 0 .75em, rgba(255,255,255,.02) .75em 1.5em),
                      linear-gradient(160deg, color-mix(in srgb, var(--k) 78%, #fff), var(--k) 50%, color-mix(in srgb, var(--k) 58%, #000)); }
.kc-dos::before { content: ""; position: absolute; inset: .6em; border-radius: calc(var(--r) - .5em); border: 1.5px solid rgba(255,255,255,.28); }
.kc-dos > .ico { width: 38%; height: auto; aspect-ratio: 1; stroke-width: 1.5; filter: drop-shadow(0 .3em .6em rgba(0,0,0,.25)); }
.kc-dos b { font-size: 1.6em; font-weight: 900; letter-spacing: .01em; text-transform: uppercase; text-align: center; padding: 0 .5em; text-shadow: 0 .1em .4em rgba(0,0,0,.25); }
.kc-face { transform: rotateY(180deg) translateZ(1px); padding: 1em .9em .85em; gap: .55em;
           background: linear-gradient(170deg, rgba(255,255,255,.2), rgba(255,255,255,.05)), color-mix(in srgb, var(--k) 55%, #0b0c1e); }
.kc-tag { position: absolute; top: .75em; left: .75em; display: inline-flex; gap: .35em; align-items: center; font-size: .74em; font-weight: 800;
          background: rgba(0,0,0,.28); padding: .35em .7em .35em .5em; border-radius: 999px; z-index: 1; }
.kc-tag .ico { width: 1.25em; height: 1.25em; }
.kc-vig { position: relative; width: 58%; aspect-ratio: 2 / 3; margin-top: 1.5em; flex: none; border-radius: .95em; overflow: hidden; background: #111;
          box-shadow: 0 .6em 1.4em rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.16); display: grid; place-items: center; }
.kc-vig img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kc-vig.vide { background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.22), transparent 60%),
               repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 .6em, rgba(255,255,255,.02) .6em 1.2em), color-mix(in srgb, var(--k) 70%, #000); }
.kc-vig.vide .ico { width: 42%; height: auto; aspect-ratio: 1; opacity: .9; stroke-width: 1.6; }
.kc-nom { font-size: 1.75em; font-weight: 900; text-align: center; letter-spacing: -.03em; line-height: 1.05; overflow-wrap: anywhere; padding: 0 .15em; }
.kc-nom.long { font-size: 1.4em; } .kc-nom.tres-long { font-size: 1.15em; }
.kc-consigne { margin-top: auto; font-size: .76em; font-weight: 700; padding: .55em .9em; border-radius: .9em; background: rgba(0,0,0,.25); text-align: center; }
.kc-consigne:empty { display: none; }
.kc-lum, .kc-nuit { position: absolute; pointer-events: none; opacity: 0; z-index: 4; }
.kc-lum { inset: -5% -70%; background: linear-gradient(100deg, transparent 38%, rgba(255,255,255,.16) 44%, rgba(255,255,255,.62) 50%, rgba(255,255,255,.16) 56%, transparent 62%); }
.kc-nuit { inset: 0; background: #05060f; }
.kc-tr { position: absolute; top: calc(var(--r) * .7); bottom: calc(var(--r) * .7); width: 2px; backface-visibility: visible;
         background: linear-gradient(180deg, color-mix(in srgb, var(--k) 40%, #fff), #fff 50%, color-mix(in srgb, var(--k) 40%, #fff)); }
.kc-tr-g { left: -1px; transform: rotateY(90deg); } .kc-tr-d { right: -1px; transform: rotateY(90deg); }
.kc.sans-tranche .kc-tr, .kc.a-plat .kc-tr { display: none; }
.kc-ombre { position: absolute; left: 50%; top: 50%; width: var(--W); height: var(--H); margin: calc(var(--H) / -2) 0 0 calc(var(--W) / -2); border-radius: calc(var(--W) * .09);
            background: rgba(0,0,0,.62); filter: blur(calc(var(--W) * .05)); pointer-events: none; will-change: transform, opacity; z-index: 5; }
/* Trouvé : la carte devient une bille à la couleur de sa catégorie */
.kc .kc-orbe { position: absolute; inset: 0; z-index: 5; opacity: 0; pointer-events: none;
               background: radial-gradient(circle at 38% 34%, #fff 0 6%, color-mix(in srgb, var(--e) 55%, #fff) 22%, var(--e) 52%, color-mix(in srgb, var(--e) 55%, #000)); }
.score-pill { position: relative; }
.score-pill.aimantee { animation: aimantee .6s cubic-bezier(.3,1.7,.5,1); }
.score-pill.aimantee { box-shadow: 0 0 0 2px var(--aim, var(--e)), 0 0 26px 2px color-mix(in srgb, var(--aim, var(--e)) 70%, transparent); }
.score-pill.aimantee::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; border: 3px solid var(--aim, var(--e)); animation: onde-score .6s ease-out forwards; pointer-events: none; }
@keyframes aimantee { 0% { transform: scale(1); } 35% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes onde-score { from { opacity: .95; transform: scale(1); } to { opacity: 0; transform: scale(1.25, 1.6); } }
/* Nombre de cartes restantes, au bout de la main */
.main-reste { position: absolute; z-index: 25; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px 0 8px;
              border-radius: 999px; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.25); font-weight: 900; font-size: .86rem; color: #fff;
              -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); font-variant-numeric: tabular-nums; }
.main-reste .ico { width: 16px; height: 16px; }
.main-reste[hidden] { display: none; }
#vue-joueur .trouvees, #ecran-jeu > .trouvees { display: none; }
/* Mode « Un seul téléphone » */
body.en-partie .nav { display: none; }
body.en-partie .ecran.avec-nav { padding-bottom: calc(18px + var(--safe-bottom)); min-height: 100dvh; }
body.en-partie .ecran.avec-nav::after { display: none; }
.solo #ecran-bilan .bas-fixe, .solo #ecran-bilan .actions-bilan { margin-top: auto; padding-top: 22px; }
.solo #ecran-bilan .bas-fixe::before { display: none; }
.solo #ecran-bilan .liste-cartes { justify-content: center; margin-top: 16px; }
.solo #ecran-bilan .liste-cartes .cat { background: rgba(255,255,255,.18); box-shadow: none; }
/* L'attribut hidden l'emporte toujours (sauf les feuilles, qui gèrent leur propre animation) */
[hidden]:not(.feuille):not(.voile) { display: none !important; }
/* Choix du paquet dans les réglages */
.choix-paquet { display: grid; gap: 8px; margin-top: 12px; }
.choix-paquet label { cursor: pointer; position: relative; }
.choix-paquet input { position: absolute; opacity: 0; pointer-events: none; }
.choix-paquet span { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 18px; background: var(--verre); border: 1px solid var(--verre-bord); font-weight: 700; }
.choix-paquet span b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choix-paquet span small { color: var(--texte-3); font-weight: 700; font-size: .78rem; }
.choix-paquet input:checked + span { background: #fff; color: var(--encre); border-color: #fff; }
.choix-paquet input:checked + span small { color: var(--g2); }

/* =====================================================================
   Étape 5 — Paquets de cartes
   ===================================================================== */
.paquets-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.paquet { position: relative; display: flex; flex-direction: column; justify-content: flex-end; aspect-ratio: 1 / 1.12; border-radius: 24px; overflow: hidden; color: #fff; text-align: left;
          box-shadow: 0 14px 30px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.16); }
.paquet .couv { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2px; }
.paquet .couv img, .paquet .couv i { width: 100%; height: 100%; object-fit: cover; display: grid; place-items: center; }
.paquet .couv i .ico { width: 26px; height: 26px; opacity: .8; }
.paquet .couv::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,.78)); }
.paquet .txt { position: relative; z-index: 1; padding: 12px; }
.paquet b { display: block; font-weight: 900; font-size: 1.02rem; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paquet small { font-weight: 700; font-size: .76rem; opacity: .85; }
.paquet.nouveau { justify-content: center; align-items: center; text-align: center; gap: 6px; padding: 12px; background: var(--verre); border: 1.5px dashed rgba(255,255,255,.35); box-shadow: none; }
.paquet.nouveau .ico-g { width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; }
.tete-paquet { margin-top: 10px; display: flex; gap: 16px; align-items: flex-end; }
.tete-paquet h2 { font-size: 1.7rem; font-weight: 900; letter-spacing: -.03em; line-height: 1.05; overflow-wrap: anywhere; }
.tete-paquet p { color: rgba(255,255,255,.72); font-weight: 700; font-size: .85rem; margin-top: 4px; }
.repartition { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-top: 10px; background: rgba(255,255,255,.12); }
.repartition i { display: block; height: 100%; }
.actions-paquet { display: grid; grid-template-columns: 1fr 58px; gap: 10px; margin-top: 14px; }
.actions-paquet .btn-verre { padding: 0; }
.grille-cartes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
.carte-mini { display: flex; flex-direction: column; gap: 6px; text-align: left; min-width: 0; }
.carte-mini b { font-size: .8rem; font-weight: 800; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.carte-mini small { font-size: .68rem; font-weight: 700; color: var(--texte-3); margin-top: -4px; }
.vignette .pastille-cat { position: absolute; top: 6px; right: 6px; z-index: 1; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center;
                          background: var(--c, #333); box-shadow: 0 0 0 1.5px rgba(255,255,255,.8); }
.vignette .pastille-cat .ico { width: 14px; height: 14px; }
.vignette.sans-image .pastille-cat { display: none; }
.feuille.grande { min-height: 82dvh; }
.resultats { display: grid; gap: 8px; margin-top: 10px; }
.resultat { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border-radius: 18px; background: rgba(255,255,255,.07); border: 1px solid var(--verre-bord); }
.resultat .mini { width: 46px; aspect-ratio: 2 / 3; border-radius: 9px; flex: none; overflow: hidden; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 70%, #000); }
.resultat .mini img { width: 100%; height: 100%; object-fit: cover; }
.resultat .mini .ico { width: 20px; height: 20px; opacity: .85; }
.resultat .txt { flex: 1; min-width: 0; }
.resultat b { display: block; font-weight: 800; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resultat small { display: block; color: rgba(255,255,255,.65); font-weight: 600; font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resultat .add { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--encre); display: grid; place-items: center; flex: none; }
.resultat .add.deja { background: rgba(52,211,153,.2); color: #34d399; }
.paquets-defile { display: grid; grid-auto-flow: column; grid-auto-columns: 42%; gap: 12px; overflow-x: auto; margin: 0 -18px; padding: 0 18px 30px; scroll-snap-type: x mandatory; scrollbar-width: none; margin-bottom: -20px; }
.paquets-defile::-webkit-scrollbar { display: none; }
.paquets-defile .paquet { scroll-snap-align: start; }
.resultats { grid-template-columns: minmax(0, 1fr); }
.resultat { min-width: 0; }
.grille-cartes > * { min-width: 0; }
/* v4.10 — Boutons à deux appuis (effacer l'historique, supprimer les paquets) */
.item[data-confirmer] { transition: background .2s, color .2s; }
.item[data-confirmer].arme { background: #e11d48; color: #fff; }
.item[data-confirmer].arme .pic { background: rgba(255,255,255,.22); color: #fff; }
.item[data-confirmer]:disabled { opacity: .45; }
.btn-rond.effacer { background: rgba(255,93,108,.16); color: var(--rouge); transition: background .2s, color .2s, width .25s; }
.btn-rond.effacer .libelle:empty { display: none; }
.btn-rond.effacer.arme { width: auto; padding: 0 14px; display: inline-flex; gap: 6px; align-items: center; background: #e11d48; color: #fff; font-weight: 800; font-size: .85rem; border-radius: 999px; }

/* =====================================================================
   v4.11 — Jouer : « Un téléphone » / « Chacun le sien » glissent comme deux pages côte à côte
   ===================================================================== */
.glissable { position: relative; }
.glissable.sortie-gauche { animation: cq-sortie-g .2s cubic-bezier(.5,0,.8,.3) forwards; }
.glissable.sortie-droite { animation: cq-sortie-d .2s cubic-bezier(.5,0,.8,.3) forwards; }
html.entree-droite .glissable { animation: cq-entree-d .36s cubic-bezier(.2,.9,.25,1) both; }
html.entree-gauche .glissable { animation: cq-entree-g .36s cubic-bezier(.2,.9,.25,1) both; }
@keyframes cq-sortie-g { to { transform: translateX(-26%); opacity: 0; } }
@keyframes cq-sortie-d { to { transform: translateX(26%); opacity: 0; } }
@keyframes cq-entree-d { from { transform: translateX(26%); opacity: 0; } }
@keyframes cq-entree-g { from { transform: translateX(-26%); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .glissable, html .glissable { animation: none !important; } }
/* Un seul salon à la fois */
.deja { margin-top: 14px; }
.deja .aller { white-space: nowrap; }
.note-deja { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; padding: 12px 14px; border-radius: 16px; font-size: .84rem; font-weight: 600;
             background: rgba(255,209,102,.12); border: 1px solid rgba(255,209,102,.35); color: #ffe7a8; }
.note-deja .ico { flex: none; margin-top: .1em; }

/* =====================================================================
   v4.11 — Profil : arrière-plans, mes données
   ===================================================================== */
.fonds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; padding: 6px 14px 16px; }
.fonds button { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .7rem; font-weight: 700; color: var(--texte-2); }
.fonds .tuile-f { width: 100%; aspect-ratio: 9 / 14; border-radius: 14px; background: var(--fond); background-color: var(--base); position: relative; overflow: hidden;
                  box-shadow: 0 6px 14px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.12); }
.fonds [data-valeur="jeu"] .tuile-f::after { content: ""; position: absolute; inset: 0; opacity: .5; background:
    linear-gradient(#6604d4, #6604d4) 78% 14% / 22% 18% no-repeat, linear-gradient(#ff0000, #ff0000) 6% 38% / 20% 16% no-repeat,
    linear-gradient(#01879f, #01879f) 86% 62% / 18% 15% no-repeat, linear-gradient(#389a06, #389a06) 14% 82% / 18% 15% no-repeat; filter: blur(2px); }
.fonds button[aria-pressed="true"] { color: #fff; }
.fonds button[aria-pressed="true"] .tuile-f { box-shadow: 0 0 0 3px #fff, 0 8px 18px rgba(0,0,0,.4); }
.texte-donnees { padding: 14px 16px; font-size: .86rem; line-height: 1.5; color: var(--texte-2); font-weight: 600; }
.texte-donnees b { color: #fff; }
.texte-donnees ul { margin: 8px 0 0 18px; display: grid; gap: 4px; }
.champ-mdp { margin-top: 14px; }
.btn-danger { background: #e11d48; color: #fff; }
.btn-danger:disabled { opacity: .5; }
.liste > .couleurs + .item, .liste > .fonds + .item { border-top: 1px solid rgba(255,255,255,.08); }
.item:disabled { opacity: .45; }
.item .droite small { font-size: .78rem; font-weight: 600; }
/* =====================================================================
   v4.12 — Codes par e-mail (vérification, mot de passe oublié)
   ===================================================================== */
.titre-verif { font-size: 1.6rem; font-weight: 900; letter-spacing: -.03em; margin-top: 14px; }
.hero p b { color: #fff; }
.titre-oubli { font-size: 1.2rem; font-weight: 900; margin: 2px 2px 6px; }
.code-6 { display: block; }
.code-6 input { width: 100%; height: 74px; border-radius: 20px; border: 0; outline: none; text-align: center;
                font-size: 2.2rem; font-weight: 900; letter-spacing: .45em; padding-left: .45em; font-variant-numeric: tabular-nums;
                background: #f3f2f8; color: var(--encre); }
.code-6 input::placeholder { color: rgba(11,16,48,.25); }
.code-6 input:focus { box-shadow: 0 0 0 3px var(--g2); }
.renvoyer { margin-top: 14px; text-align: center; }
.renvoyer button { color: #fff; font-weight: 700; font-size: .88rem; text-decoration: underline; text-underline-offset: 3px; }
.renvoyer button:disabled { color: var(--texte-3); text-decoration: none; }
