:root {
    --fond: #0d0b0c;
    --carte: #1a1617;
    --carte-2: #241e1f;
    --trait: #3a3032;
    --texte: #f2ebe6;
    --discret: #9a8d88;
    --sang: #c8102e;
    --sang-clair: #ff3b4e;
    --bleu: #4c8dff;
    --vert: #4cc27a;
    --orange: #ff9d3b;
    --rayon: 14px;
    /* Les marges des barres système. Dans un navigateur, env() les donne ;
       dans l'app Android, la WebVue ne les renseigne pas : MainActivity les
       mesure et pose --safe-haut / --safe-bas (voir « Hushaboo - Android »). */
    --haut: max(env(safe-area-inset-top), var(--safe-haut, 0px));
    --bas: max(env(safe-area-inset-bottom), var(--safe-bas, 0px));
    color-scheme: dark;
}

/* Les polices du dessin animé, copiées dans l'app (licence libre OFL) : elle
   doit s'afficher même sans réseau.
   Creepster : le titre, dégoulinant. Luckiest Guy : les gros titres. */
@font-face { font-family: 'Creepster'; src: url('../fonts/creepster.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Luckiest Guy'; src: url('../fonts/luckiestguy.woff2') format('woff2'); font-display: swap; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; height: 100%; }

body {
    background: var(--fond);
    color: var(--texte);
    font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    padding: var(--haut) 16px var(--bas);
    -webkit-user-select: none;
    user-select: none;
}

.ecran {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 0 40px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 100%;
}
.ecran[hidden] { display: none; }

/* ——— Titres ——— */
.titre { text-align: center; margin: 16px 0 12px; }
.titre h1 {
    font-family: 'Creepster', system-ui, sans-serif;
    font-weight: 400;
    /* « HUSHABOO » : huit lettres, il faut qu'elles tiennent sur un petit écran. */
    font-size: clamp(44px, 15vw, 72px);
    letter-spacing: .04em;
    line-height: 1;
    margin: 0;
    color: #f5c542;
    /* Le contour noir épais des titres de dessin animé, puis une lueur verte
       de clair de lune. */
    -webkit-text-stroke: 2px #1b1416;
    paint-order: stroke fill;
    text-shadow: 3px 4px 0 #1b1416, 0 0 26px rgba(160, 220, 120, .45);
}
.titre p { margin: 6px 0 0; color: var(--discret); }

h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 12px; color: var(--discret); }
h3 { margin: 12px 0 4px; font-size: 20px; }

.discret { color: var(--discret); }
.centre { text-align: center; }

/* ——— Champs et boutons ——— */
.champ { display: flex; flex-direction: column; gap: 6px; }
.champ span, .etiquette { font-size: 13px; color: var(--discret); }

input, select {
    font: inherit;
    color: var(--texte);
    background: var(--carte);
    border: 1px solid var(--trait);
    border-radius: 10px;
    padding: 13px 14px;
    width: 100%;
    -webkit-user-select: text;
    user-select: text;
}
input:focus, select:focus { outline: none; border-color: var(--sang); }
input.code { text-transform: uppercase; letter-spacing: .4em; text-align: center; font-size: 22px; font-weight: 700; }

.btn {
    font: inherit;
    font-weight: 600;
    color: var(--texte);
    background: var(--carte-2);
    border: 1px solid var(--trait);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    width: 100%;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; }
.btn.principal { background: var(--sang); border-color: var(--sang); }
.btn.danger { background: transparent; border-color: #5a2a30; color: #ff8a95; }
.btn.lien { background: none; border: none; color: var(--discret); font-weight: 400; padding: 10px; }
.btn.petit { padding: 8px 12px; font-size: 14px; width: auto; }

.separateur { display: flex; align-items: center; gap: 10px; color: var(--discret); font-size: 13px; }
.separateur::before, .separateur::after { content: ""; flex: 1; height: 1px; background: var(--trait); }

.carte {
    background: var(--carte);
    border: 1px solid var(--trait);
    border-radius: var(--rayon);
    padding: 16px;
}
.carte[hidden] { display: none; }

/* ——— Salon ——— */
.code-partie {
    text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 8px 0 4px;
}
.code-partie span { color: var(--discret); font-size: 13px; }
.code-partie b { font-size: 44px; letter-spacing: .3em; padding-left: .3em; font-family: ui-monospace, Menlo, monospace; }

.groupe + .groupe { margin-top: 16px; }
.groupe .etiquette { display: block; margin-bottom: 8px; }

.segments { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.segments button {
    font: inherit; font-weight: 600; color: var(--texte);
    background: var(--carte-2); border: 1px solid var(--trait); border-radius: 10px;
    padding: 10px 4px; display: flex; flex-direction: column; align-items: center; cursor: pointer;
}
.segments button small { font-weight: 400; font-size: 12px; color: var(--discret); }
.segments button.choisi { border-color: var(--sang); background: #3a1219; }

.cases { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cases label {
    display: flex; align-items: center; gap: 8px;
    background: var(--carte-2); border: 1px solid var(--trait); border-radius: 10px; padding: 10px;
    font-size: 14px;
}
.cases input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--sang); margin: 0; }

.liste-joueurs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.liste-joueurs li {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 12px; background: var(--carte-2); border-radius: 10px;
}
.liste-joueurs li.moi { outline: 1px solid var(--sang); }
.liste-joueurs .marque { font-size: 12px; color: var(--discret); }
.liste-joueurs li.mort { opacity: .45; text-decoration: line-through; }

/* ——— En jeu ——— */
.bandeau { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bandeau > div {
    background: var(--carte); border: 1px solid var(--trait); border-radius: 12px;
    padding: 10px 6px; text-align: center; display: flex; flex-direction: column;
}
.bandeau b { font-size: 22px; font-variant-numeric: tabular-nums; }
.bandeau span { font-size: 12px; color: var(--discret); }

.secret {
    position: relative;
    min-height: 330px;
    border-radius: 18px;
    border: 1px solid var(--trait);
    background:
        radial-gradient(circle at 50% 30%, rgba(200, 16, 46, .18), transparent 60%),
        var(--carte);
    display: grid;
    touch-action: none;
    cursor: pointer;
    outline: none;
}
.secret > div { grid-area: 1 / 1; padding: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.secret-cache { gap: 6px; color: var(--discret); }
.secret-cache b { color: var(--texte); font-size: 18px; }
.secret-cache .oeil { font-size: 48px; color: var(--sang-clair); }
.secret-revele { visibility: hidden; }
.secret.ouvert .secret-cache { visibility: hidden; }
.secret.ouvert .secret-revele { visibility: visible; }
.secret.ouvert { border-color: var(--sang); }
.cible { font-size: 38px; margin: 4px 0 10px; color: var(--sang-clair); word-break: break-word; }
.secret-revele p { margin: 0; font-size: 17px; }

.pastilles { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pastille { font-size: 12px; padding: 3px 10px; border-radius: 99px; border: 1px solid currentColor; color: var(--discret); }
.pastille.bleu { color: var(--bleu); }
.pastille.vert { color: var(--vert); }
.pastille.orange { color: var(--orange); }

.secret.nouveau { animation: battement .6s ease 3; }
@keyframes battement { 50% { box-shadow: 0 0 0 6px rgba(255, 59, 78, .4); } }

.statut {
    margin: 0; padding: 12px 14px; border-radius: 12px; text-align: center;
    background: var(--carte-2); border: 1px dashed var(--trait); color: var(--discret);
}
.statut[hidden] { display: none; }

/* ——— Mort : le cimetière ——— */
.tombe { text-align: center; display: flex; flex-direction: column; align-items: center; }
.tombe p { margin: 0 0 6px; }
.cimetiere {
    position: relative;
    margin: calc(-24px - var(--haut)) -16px 0;   /* jusqu'aux bords de l'écran */
    container-type: inline-size;
    /* Le bas de l'image n'est que du brouillard : on le coupe pour que les
       compteurs tiennent sous la tombe sans faire défiler l'écran. */
    /* …et jamais plus de la moitié de l'écran : sous la tombe, il faut voir
       tout de suite qu'on est devenu fantôme et qu'on peut encore jouer. */
    max-height: min(148cqw, 52vh);
    overflow: hidden;
}
/* La scène garde les proportions de l'image : la stèle s'y place en %. */
.scene { position: relative; }
.scene img { width: 100%; display: block; }
/* Le bas de l'image se fond dans le fond de l'app. */
.cimetiere::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 18%;
    background: linear-gradient(to bottom, transparent, var(--fond));
}
.cimetiere-titre {
    position: absolute; left: 0; right: 0; top: calc(var(--haut) + 5cqw); margin: 0;
    text-align: center; font-family: 'Creepster', system-ui, sans-serif; font-weight: 400;
    font-size: 13cqw; line-height: 1; color: #b8f07a;
    -webkit-text-stroke: 2px #1b1416; paint-order: stroke fill;
    text-shadow: 3px 4px 0 #1b1416, 0 0 22px rgba(160, 220, 120, .5);
}
/* La face de la stèle, en % de l'image : mesuré sur img/mort.webp (la pierre
   va de 25 à 74 % en largeur et de 22 à 68 % en hauteur ; on grave dans le
   panneau intérieur, sous l'arrondi). À remesurer si l'image change. */
.stele {
    position: absolute;
    left: 30%; width: 40%;
    top: 30%; height: 34%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 1cqw; text-align: center;
    /* De la pierre gravée : creusée sombre, un liseré clair en dessous et une
       ombre au-dessus, comme une lettre taillée qui prend la lumière. */
    color: #221c1e;
    text-shadow: 0 1.5px 0 rgba(255, 255, 255, .4), 0 -1px 0 rgba(0, 0, 0, .5);
}
.stele .ici-repose { font-family: 'Luckiest Guy', system-ui, sans-serif; font-size: 4.2cqw; letter-spacing: .08em; }
.stele .avatar { width: 20cqw; height: 20cqw; filter: grayscale(.85) contrast(.9); opacity: .9; }
.stele b {
    font-family: 'Luckiest Guy', system-ui, sans-serif; font-weight: 400;
    font-size: 7.5cqw; line-height: 1.05; max-width: 100%; overflow-wrap: anywhere;
}
.stele b.long { font-size: 5.6cqw; }
.stele small { font-size: 3.6cqw; font-weight: 700; }
.tombe h1 { margin: 8px 0; font-size: 34px; }

/* ——— Fin ——— */
.prix { display: flex; flex-direction: column; gap: 10px; }
.prix .carte { display: flex; align-items: center; gap: 14px; }
.prix .icone { font-size: 32px; }
.prix .carte span { display: block; font-size: 13px; color: var(--discret); }
.prix .carte b { font-size: 19px; }

.journal { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.journal li { padding-left: 4px; }
.journal small { display: block; color: var(--discret); }

/* ——— Fenêtres et toasts ——— */
#voile {
    position: fixed; inset: 0; z-index: 10;
    background: rgba(0, 0, 0, .72);
    display: flex; align-items: center; justify-content: center;
    padding: calc(16px + var(--haut)) 16px calc(16px + var(--bas));
}
#voile[hidden] { display: none; }
#fenetre {
    width: 100%; max-width: 420px;
    background: var(--carte); border: 1px solid var(--sang); border-radius: 18px;
    padding: 22px;
    max-height: 90vh; overflow: auto;
}
#fenetre h2 { color: var(--texte); font-size: 20px; text-transform: none; letter-spacing: 0; }
#fenetre-texte p { margin: 0 0 10px; }
#fenetre-texte blockquote { margin: 10px 0; padding: 10px 12px; border-left: 3px solid var(--sang); background: var(--carte-2); border-radius: 0 8px 8px 0; }
#fenetre-boutons { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

#toast {
    position: fixed; left: 50%; bottom: calc(24px + var(--bas)); transform: translateX(-50%);
    z-index: 20; max-width: calc(100% - 32px);
    background: var(--texte); color: var(--fond); font-weight: 600;
    padding: 12px 18px; border-radius: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
    text-align: center;
}
#toast[hidden] { display: none; }

.liens { display: flex; justify-content: center; gap: 4px; }
.liens .btn { width: auto; }
.compteur-missions { margin-top: 10px; color: var(--sang-clair); }

/* ——— La liste des missions ——— */
#liste-missions {
    position: fixed; inset: 0; z-index: 5;
    background: var(--fond);
    overflow-y: auto;
    padding: var(--haut) 16px calc(24px + var(--bas));
}
#liste-missions[hidden] { display: none; }
#liste-missions > * { max-width: 480px; margin-left: auto; margin-right: auto; }
.liste-tete {
    position: sticky; top: 0; z-index: 1;
    display: flex; align-items: center; gap: 12px;
    padding: 16px 0 12px; background: var(--fond);
}
.liste-tete h1 { margin: 0; font-size: 24px; }
.segments.deux { margin-bottom: 8px; }
#liste-resume { margin: 4px auto 12px; font-size: 14px; }
.liste-groupe h2 { margin: 22px 0 10px; }
.liste-groupe h2 small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.mission {
    background: var(--carte); border: 1px solid var(--trait); border-radius: 12px;
    padding: 12px 14px; margin-bottom: 8px;
}
.mission b { display: block; }
.mission p { margin: 4px 0 8px; color: var(--texte); font-size: 15px; }
.mission .pastilles { justify-content: flex-start; }
.mission.exclue { opacity: .38; }

/* ——— Les portraits ——— */
.avatar { display: inline-block; flex-shrink: 0; line-height: 0; }
.avatar svg { width: 100%; height: 100%; display: block; }
.avatar.mini { width: 36px; height: 36px; }
.avatar.moyen { width: 96px; height: 96px; margin: 6px 0 2px; }
.avatar.grand { width: 120px; height: 120px; }
.avatar.geant { width: 168px; height: 168px; }

.avatar-bouton {
    align-self: center;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: none; border: none; color: var(--discret); font: inherit; font-size: 13px;
    cursor: pointer; padding: 0;
}
.avatar-bouton:active { transform: scale(.97); }
.avatar-retouche { text-decoration: underline; text-underline-offset: 3px; }

.liste-joueurs li .qui { display: flex; align-items: center; gap: 10px; min-width: 0; }
.liste-joueurs li .qui span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prix .avatar { width: 52px; height: 52px; }
.journal li { display: flex; gap: 10px; align-items: flex-start; }
.journal li > div { min-width: 0; }

/* ——— L'éditeur ——— */
#editeur-avatar {
    position: fixed; inset: 0; z-index: 6;
    background: var(--fond);
    display: flex; flex-direction: column;
    padding: var(--haut) 16px var(--bas);
}
#editeur-avatar[hidden] { display: none; }
#editeur-avatar > * { width: 100%; max-width: 480px; margin-left: auto; margin-right: auto; }
.editeur-haut { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-bottom: 8px; }
.onglets {
    display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px;
    scrollbar-width: none;
}
.onglets::-webkit-scrollbar { display: none; }
.onglets button {
    flex-shrink: 0; font: inherit; font-size: 14px; font-weight: 600;
    color: var(--discret); background: var(--carte); border: 1px solid var(--trait);
    border-radius: 99px; padding: 7px 14px; cursor: pointer;
}
.onglets button.choisi { color: var(--texte); border-color: var(--sang); background: #3a1219; }
.couleurs { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 10px; }
.couleurs:empty { display: none; }
.couleurs button {
    width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
    border: 3px solid var(--fond); box-shadow: 0 0 0 1px var(--trait);
}
.couleurs button.choisi { box-shadow: 0 0 0 3px var(--sang); }
.formes {
    flex: 1; overflow-y: auto;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px;
    align-content: start; padding-bottom: 8px;
}
.formes button {
    background: var(--carte); border: 2px solid var(--trait); border-radius: 14px;
    padding: 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px;
    color: var(--discret); font: inherit; font-size: 12px;
}
.formes button .avatar { width: 64px; height: 64px; }
.formes button.choisi { border-color: var(--sang); color: var(--texte); }
.editeur-pied { padding: 10px 0 12px; }

/* ——— Le décor de l'accueil : le manoir sous la lune ———
   L'image couvre tout l'écran ; un voile s'épaissit vers le bas pour que les
   champs et les boutons restent lisibles par-dessus le brouillard. */
body.decor-manoir {
    background:
        linear-gradient(to bottom, rgba(13, 11, 12, 0) 0%, rgba(13, 11, 12, 0) 46%, rgba(13, 11, 12, .6) 60%, rgba(13, 11, 12, .92) 74%, var(--fond) 100%),
        url('../img/accueil.webp') center top / cover no-repeat fixed,
        var(--fond);
}
body.decor-manoir .titre p { color: #e9e2f2; text-shadow: 0 2px 6px rgba(0, 0, 0, .9); }
body.decor-manoir #ecran-accueil .titre { margin-top: 10px; }
body.decor-manoir input { background: rgba(26, 22, 23, .88); }
body.decor-manoir .champ span, body.decor-manoir .avatar-bouton { color: #e9e2f2; text-shadow: 0 1px 4px #000, 0 0 2px #000; }

/* L'accueil : le titre en haut, le manoir au milieu, le formulaire en bas. */
#ecran-accueil { gap: 12px; }
.accueil-decor { flex: 1; min-height: 120px; }
.identite { display: flex; align-items: flex-end; gap: 12px; }
.identite .champ { flex: 1; }
.identite .avatar { width: 64px; height: 64px; }
.identite .avatar-bouton { gap: 2px; font-size: 12px; }

/* ——— Le décor de la fin : le masque arraché dans le hall du manoir ——— */
body.decor-fin {
    background:
        linear-gradient(to bottom, rgba(13, 11, 12, 0) 0%, rgba(13, 11, 12, 0) 38%, rgba(13, 11, 12, .8) 56%, var(--fond) 72%),
        url('../img/fin.webp') center top / 100% auto no-repeat,
        var(--fond);
}
/* Le titre passe sous le masque arraché : c'est le clou de l'image. */
body.decor-fin #ecran-fin .titre { margin-top: min(74vw, 355px); }
body.decor-fin #ecran-fin .titre p { color: #e9e2f2; text-shadow: 0 2px 6px #000; }
body.decor-fin .prix .carte { background: rgba(26, 22, 23, .9); }

/* ——— Les décors du salon et du jeu ———
   Générées déjà sombres (design/essais/salon_1, jeu_1) : un voile léger
   suffit, un peu plus épais là où se lisent la liste ou la carte secrète. */
body.decor-salon {
    background:
        linear-gradient(to bottom, rgba(13, 11, 12, .05) 0%, rgba(13, 11, 12, .25) 35%, rgba(13, 11, 12, .55) 100%),
        url('../img/salon.webp') center top / cover no-repeat fixed,
        var(--fond);
}
body.decor-jeu {
    background:
        radial-gradient(ellipse at 50% 45%, rgba(13, 11, 12, .5) 0%, rgba(13, 11, 12, .1) 75%),
        url('../img/jeu.webp') center / cover no-repeat fixed,
        var(--fond);
}
body.decor-salon .carte { background: rgba(26, 22, 23, .74); backdrop-filter: blur(2px); }
body.decor-jeu .bandeau > div, body.decor-jeu .statut { background: rgba(26, 22, 23, .86); }
body.decor-salon .cases label, body.decor-salon .segments button:not(.choisi) { background: rgba(36, 30, 31, .82); }
body.decor-salon .liste-joueurs li { background: rgba(36, 30, 31, .9); }
body.decor-jeu .secret { background: radial-gradient(circle at 50% 30%, rgba(200, 16, 46, .2), transparent 60%), rgba(26, 22, 23, .92); }
body.decor-jeu .btn:not(.principal):not(.lien), body.decor-salon .btn:not(.principal):not(.lien) { background: rgba(36, 30, 31, .92); }
body.decor-salon .code-partie span, body.decor-jeu .btn.lien, body.decor-salon .btn.lien { text-shadow: 0 1px 4px #000; }
body.decor-salon .code-partie b {
    font-family: 'Luckiest Guy', ui-monospace, monospace; font-weight: 400; color: #f5c542;
    -webkit-text-stroke: 1.5px #1b1416; paint-order: stroke fill; text-shadow: 3px 3px 0 #1b1416;
}

/* ——— Le chrono du salon ——— */
.chrono-valeur {
    display: block; text-align: center;
    font-family: 'Luckiest Guy', system-ui, sans-serif; font-weight: 400;
    font-size: 34px; color: #f5c542; letter-spacing: .03em;
    -webkit-text-stroke: 1.2px #1b1416; paint-order: stroke fill; text-shadow: 2px 2px 0 #1b1416;
    margin: 4px 0 8px;
}
.chrono-reglage input[type=range] { width: 100%; padding: 0; background: none; border: none; accent-color: var(--sang); height: 28px; }
.chrono-bornes { display: flex; justify-content: space-between; font-size: 12px; color: var(--discret); margin-top: -2px; }
.chrono-reglage small { display: block; margin-top: 8px; font-size: 13px; }
.duree-invite { text-align: center; }
.duree-invite .etiquette { display: block; }

/* ——— Fin : le vainqueur et le classement ——— */
.vainqueur { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; margin-bottom: 6px; }
.vainqueur .portraits { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.vainqueur .couronne { position: relative; padding-top: 26px; }
/* La couronne, posée sur le portrait. */
.vainqueur .couronne::before {
    content: "👑"; position: absolute; top: -4px; left: 50%; transform: translateX(-50%) rotate(-8deg);
    font-size: 40px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6));
}
.vainqueur .avatar { border-radius: 50%; box-shadow: 0 0 0 4px #f5c542, 0 0 30px rgba(245, 197, 66, .45); }
.vainqueur .etiquette { margin-top: 10px; text-transform: uppercase; letter-spacing: .12em; color: #e9e2f2; }
.nom-vainqueur {
    font-family: 'Luckiest Guy', system-ui, sans-serif; font-weight: 400; font-size: 38px; line-height: 1.1;
    color: #f5c542; -webkit-text-stroke: 1.5px #1b1416; paint-order: stroke fill; text-shadow: 3px 3px 0 #1b1416;
    overflow-wrap: anywhere;
}
.vainqueur small { color: #e9e2f2; text-shadow: 0 1px 3px #000; }

.classement { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.classement li {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; background: var(--carte-2); border-radius: 12px;
}
.classement li.gagne { outline: 2px solid #f5c542; background: #2e2716; }
.classement li.moi:not(.gagne) { outline: 1px solid var(--sang); }
.classement .rang { width: 22px; text-align: center; font-weight: 800; color: var(--discret); flex-shrink: 0; }
.classement li.gagne .rang { color: #f5c542; }
.classement .qui { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.classement .qui b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.classement .qui small { color: var(--discret); font-size: 12px; }
.classement .score { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; min-width: 44px; }
.classement .score b { font-size: 20px; line-height: 1; }
.classement .score small { font-size: 11px; color: var(--discret); }
body.decor-fin .classement li { background: rgba(36, 30, 31, .92); }
body.decor-fin .classement li.gagne { background: rgba(46, 39, 22, .95); }

/* ——— Le fantôme ——— */
.fantome { display: flex; flex-direction: column; gap: 14px; }
.fantome[hidden] { display: none; }
/* L'annonce du fantôme, juste sous la tombe : elle doit sauter aux yeux. */
.fantome-annonce {
    margin: 0; padding: 14px 16px; border-radius: 14px; text-align: center;
    font-size: 17px; line-height: 1.35; font-weight: 600;
    background: rgba(107, 76, 194, .25); border: 1px solid #8a6fd8; color: var(--texte);
}
.fantome-annonce[hidden] { display: none; }
/* L'image de l'annonce « un joueur a été tué », dans la fenêtre. */
.hasards { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.annonce-image { width: 100%; max-height: 180px; object-fit: cover; object-position: center 38%; border-radius: 14px; display: block; }
.fantome-titre {
    margin: 10px 0 0; text-align: center; text-transform: none; letter-spacing: .02em;
    font-family: 'Luckiest Guy', system-ui, sans-serif; font-weight: 400; font-size: 26px;
    color: #b8f07a; -webkit-text-stroke: 1px #1b1416; paint-order: stroke fill; text-shadow: 2px 2px 0 #1b1416;
}
.fantome-carte {
    min-height: 270px;
    background: radial-gradient(circle at 50% 30%, rgba(150, 230, 120, .14), transparent 60%), var(--carte);
}
.fantome-carte .secret-cache .oeil { color: #b8f07a; }
.fantome-carte.ouvert { border-color: #7fc45a; }
.fantome-carte .cible { color: #b8f07a; }
.fantome-carte.nouveau { animation: battement-fantome .6s ease 3; }
@keyframes battement-fantome { 50% { box-shadow: 0 0 0 6px rgba(150, 230, 120, .35); } }
.pari { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.pari b { font-size: 22px; }
.pari .btn { margin-top: 8px; }
.classement.fantomes li.gagne { outline-color: #b8f07a; background: #1d2a17; }
.classement.fantomes li.gagne .rang { color: #b8f07a; }

/* ——— L'invitation et le QR code ——— */
.invitation {
    margin: 0; padding: 10px 14px; border-radius: 12px; text-align: center;
    background: rgba(200, 16, 46, .22); border: 1px solid var(--sang); color: var(--texte); font-weight: 600;
}
.invitation[hidden] { display: none; }
/* L'invitation arrive en premier : plus grande, et elle respire. */
.invitation { font-size: 17px; line-height: 1.35; padding: 14px 16px; margin-bottom: 4px; }
#accueil-ou[hidden], #accueil-code-champ[hidden], #btn-creer[hidden], #btn-creer-plutot[hidden] { display: none; }
.qr {
    display: block; width: 184px; height: 184px; padding: 0; margin: 6px 0 2px;
    border: none; border-radius: 14px; overflow: hidden; background: #fff; cursor: zoom-in;
    box-shadow: 0 0 0 4px #1b1416, 0 6px 22px rgba(0, 0, 0, .55);
}
.qr svg { width: 100%; height: 100%; display: block; }
.qr.grand { width: min(78vw, 360px); height: min(78vw, 360px); margin: 4px auto 14px; cursor: default; }
.code-partie small { font-size: 12px; text-shadow: 0 1px 4px #000; }

/* ——— Le rappel de l'app, dans un navigateur de téléphone ——— */
#bandeau-appli {
    max-width: 480px; margin: 0 auto;
    display: flex; align-items: center; gap: 10px;
    background: rgba(26, 22, 23, .94); border: 1px solid var(--trait); border-radius: 14px;
    padding: 8px 6px 8px 10px; font-size: 14px; font-weight: 600;
}
#bandeau-appli[hidden] { display: none; }
/* La place du bandeau se prend sur l'écran : l'accueil tient toujours sans défiler. */
body.avec-bandeau .ecran { min-height: calc(100% - 62px); }
body.avec-bandeau .accueil-decor { min-height: 60px; }
#bandeau-appli img { border-radius: 8px; flex-shrink: 0; }
#bandeau-appli span { flex: 1; }
#bandeau-appli .btn.lien { width: auto; padding: 6px 8px; }

/* ——— Les liens qui ont l'air de boutons ——— */
a.btn { display: block; text-align: center; text-decoration: none; }
a.btn.petit { display: inline-block; }
a.btn[hidden] { display: none; }

/* ——— Après la partie ——— */
.suite { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; border-color: #f5c542; }
.suite > b {
    font-family: 'Luckiest Guy', system-ui, sans-serif; font-weight: 400; font-size: 26px; color: #f5c542;
    -webkit-text-stroke: 1px #1b1416; paint-order: stroke fill; text-shadow: 2px 2px 0 #1b1416;
}
.suite .btn { margin-top: 6px; }
.suite > span { color: #e9e2f2; }
body.decor-fin .suite { background: rgba(46, 39, 22, .95); }
.btn.appel { animation: appel .7s ease 3; }
@keyframes appel { 50% { box-shadow: 0 0 0 7px rgba(255, 59, 78, .45); } }

/* ——— Le studio ——— */
.btn.studio { font-size: 13px; padding: 4px; margin-top: -6px; }
body.decor-manoir .btn.studio, body.decor-fin .btn.studio { color: #c9bdb8; text-shadow: 0 1px 4px #000; }
.studio-tete { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; color: var(--discret); font-size: 14px; }
.studio-tete img { border-radius: 12px; flex-shrink: 0; }
.jeu {
    display: flex; align-items: center; gap: 12px;
    background: var(--carte-2); border: 1px solid var(--trait); border-radius: 14px; padding: 10px; margin-bottom: 10px;
}
.jeu img { border-radius: 14px; flex-shrink: 0; }
.jeu > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.jeu small { color: var(--discret); font-size: 13px; line-height: 1.3; }

/* ——— « Éliminé·e par… » ——— */
#elimine {
    position: fixed; inset: 0; z-index: 30;
    background: radial-gradient(circle at 50% 35%, rgba(200, 16, 46, .35), transparent 65%), #0d0b0c;
    display: flex; align-items: center; justify-content: center;
    padding: calc(24px + var(--haut)) 20px calc(24px + var(--bas));
    animation: elimine-entree .45s ease-out;
}
#elimine[hidden] { display: none; }
@keyframes elimine-entree { from { transform: scale(1.15); opacity: 0; } }
.elimine-carte { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.elimine-titre {
    font-family: 'Creepster', system-ui, sans-serif; font-size: clamp(48px, 15vw, 76px); line-height: 1; color: var(--sang-clair);
    -webkit-text-stroke: 2px #1b1416; paint-order: stroke fill; text-shadow: 3px 4px 0 #1b1416;
}
#elimine .avatar { width: 140px; height: 140px; margin: 14px 0 4px; filter: grayscale(.9); }
.elimine-nom { font-size: 26px; }
.elimine-par { color: var(--discret); margin-top: 8px; }
.elimine-tueur {
    font-family: 'Luckiest Guy', system-ui, sans-serif; font-weight: 400; font-size: 40px; color: #f5c542;
    -webkit-text-stroke: 1.5px #1b1416; paint-order: stroke fill; text-shadow: 3px 3px 0 #1b1416;
}
#elimine blockquote { margin: 14px 0 0; padding: 10px 12px; width: 100%; text-align: left; border-left: 3px solid var(--sang); background: var(--carte); border-radius: 0 8px 8px 0; }
#elimine blockquote[hidden] { display: none; }
.elimine-secret { color: var(--discret); margin-top: 18px; }
.elimine-signature { font-family: 'Creepster', system-ui, sans-serif; color: #5a4f4c; font-size: 22px; margin-top: 18px; letter-spacing: .05em; }

/* ——— La révélation ——— */
.filmer { margin: -4px 0 0; text-align: center; font-size: 13px; color: #e9e2f2; text-shadow: 0 1px 3px #000; }
#revelation {
    position: fixed; inset: 0; z-index: 25; background: var(--fond);
    display: flex; flex-direction: column;
    padding: calc(12px + var(--haut)) 16px calc(16px + var(--bas));
}
#revelation[hidden] { display: none; }
#revelation > * { width: 100%; max-width: 480px; margin-left: auto; margin-right: auto; }
.revelation-tete { display: flex; align-items: center; justify-content: space-between; }
#revelation-compteur { color: var(--discret); font-size: 14px; }
.revelation-carte {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px;
    cursor: pointer; animation: carte-retournee .4s ease-out;
}
@keyframes carte-retournee { from { transform: rotateY(80deg); opacity: 0; } }
.revelation-carte h2 {
    margin: 0; text-transform: none; letter-spacing: .02em; color: #f5c542;
    font-family: 'Luckiest Guy', system-ui, sans-serif; font-weight: 400; font-size: 34px; line-height: 1.1;
    -webkit-text-stroke: 1.2px #1b1416; paint-order: stroke fill; text-shadow: 2px 2px 0 #1b1416;
}
.revelation-duel { display: flex; align-items: center; justify-content: center; gap: 16px; }
.revelation-duel > div { display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 40%; }
.revelation-duel .avatar { width: 104px; height: 104px; }
/* Les noms longs : « overflow-wrap: anywhere » coupait « Floriandothécaire »
   en plein milieu d'une syllabe. On coupe au mot, on rétrécit un peu sur les
   petits écrans, et au-delà de deux lignes on met des points de suspension. */
.revelation-duel b {
    font-size: clamp(15px, 4.4vw, 20px); line-height: 1.15;
    overflow-wrap: break-word; hyphens: auto;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.revelation-duel .fleche { font-size: 34px; color: var(--sang-clair); }
.revelation-carte blockquote { margin: 6px 0 0; padding: 12px 14px; width: 100%; text-align: left; border-left: 3px solid var(--sang); background: var(--carte); border-radius: 0 10px 10px 0; }
.revelation-carte small { color: var(--discret); }
.revelation-liste { width: 100%; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.revelation-liste > div { background: var(--carte); border: 1px solid var(--trait); border-radius: 12px; padding: 10px 12px; }
.revelation-liste small { display: block; }
.revelation-pied { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }

/* ——— Les missions de l'hôte ——— */
.perso small.discret { display: block; margin-bottom: 8px; }
/* Un « display: block » plus fort que le [hidden] du navigateur laissait la
   note de l'hôte d'origine visible pour tout le monde. */
.perso small.discret[hidden] { display: none; }
.perso-liste { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.perso-liste li {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px;
    background: var(--carte-2); border: 1px solid var(--trait); border-radius: 10px;
}
.perso-liste li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.perso-liste small { color: var(--discret); overflow-wrap: anywhere; }
.perso-liste .btn { width: auto; flex-shrink: 0; }
#fenetre textarea {
    width: 100%; box-sizing: border-box; font: inherit; color: var(--texte); background: var(--carte-2);
    border: 1px solid var(--trait); border-radius: 10px; padding: 10px; resize: vertical;
}

/* ——— La partie d'essai, le rappel ——— */
.btn.essai { margin-top: 2px; }
.essai-bandeau, .rappel {
    margin: 0; padding: 10px 14px; border-radius: 12px; font-size: 14px; text-align: center;
    background: #2a2414; border: 1px solid #6b5a22; color: #f5dc8a;
}
.essai-bandeau[hidden], .rappel[hidden] { display: none; }

/* ——— Les titres de fin ——— */
.titres { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.titres li { display: flex; align-items: center; gap: 10px; }
.titres li > div { display: flex; flex-direction: column; }
.titres b { color: #f5c542; }
.titres small { color: var(--discret); }

/* ——— Le leurre : une liste de courses toute simple ——— */
#leurre {
    position: fixed; inset: 0; z-index: 40; background: #fbfaf6; color: #222;
    padding: calc(16px + var(--haut)) 20px calc(16px + var(--bas));
    font-family: -apple-system, system-ui, Roboto, sans-serif; display: flex; flex-direction: column;
}
#leurre[hidden] { display: none; }
.leurre-tete { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.leurre-tete span { color: #c9a227; font-size: 15px; }
.leurre-tete b { font-size: 30px; }
.leurre-liste { margin: 0; padding-left: 22px; font-size: 18px; line-height: 2; flex: 1; }
.leurre-aide { color: #bbb; text-align: center; font-size: 12px; }

/* ——— La vidéo de la révélation ——— */
#video {
    position: fixed; inset: 0; z-index: 30; background: var(--fond);
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: calc(12px + var(--haut)) 16px calc(16px + var(--bas));
}
#video[hidden] { display: none; }
#video-toile { flex: 1; min-height: 0; max-width: 100%; aspect-ratio: 9 / 16; height: auto; border-radius: 12px; background: #000; object-fit: contain; }
#video-etat { margin: 0; color: var(--discret); text-align: center; }
.video-pied { display: flex; gap: 10px; width: 100%; max-width: 480px; }
.video-pied .btn { flex: 1; }

/* ——— Les notifications ——— */
.notifs { display: flex; flex-direction: column; gap: 6px; text-align: center; border-color: #6b5a22; }
.notifs[hidden] { display: none; }
.notifs .btn { align-self: center; width: auto; margin-top: 4px; }
.perso-liste .perso-pour { color: #f5c542; }
#fenetre select {
    width: 100%; box-sizing: border-box; font: inherit; color: var(--texte); background: var(--carte-2);
    border: 1px solid var(--trait); border-radius: 10px; padding: 10px;
}
.elimine-note { color: #f5c542; text-align: center; max-width: 320px; }
.elimine-note[hidden] { display: none; }
