/* Code Rouge : interface du jeu. Charte XEFI : noir, gris, rouge #E10600 ; titres en capitales espacées. */
:root {
  --verre: rgba(20, 20, 20, .72); --verre-fort: rgba(14, 14, 14, .9); --trait: rgba(255, 255, 255, .09);
  --trait-fort: rgba(255, 255, 255, .18); --ombre: 0 20px 50px -20px rgba(0, 0, 0, .8);
  --lueur: 0 0 0 1px rgba(225, 6, 0, .5), 0 8px 30px -6px rgba(225, 6, 0, .55);
  --doux: cubic-bezier(.2, .8, .2, 1);
}
html { color-scheme: dark; }
body { background: #000; overflow-x: hidden; scrollbar-color: #3a3a3a #000; }
.liste-bilan { scrollbar-color: #555 transparent; scrollbar-width: thin; }
#scene { max-width: 1140px; margin: 0 auto; padding: 28px 16px 0; position: relative; z-index: 1; min-height: calc(100vh - 140px); }
.centre { text-align: center; }
.chargement { text-align: center; color: var(--g50); padding: 5rem 0; }
.erreur { color: #ff6b66; min-height: 1.2em; margin: .8em 0 0; font-size: .9rem; }
.discret { color: var(--g30); font-size: .9rem; }
.icone { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icone.petite { width: 18px; height: 18px; }
.icone.mini { width: 13px; height: 13px; }
.icone.grande { width: 44px; height: 44px; }
.icone.rouge { color: var(--rouge); }
kbd { font: 600 .7rem var(--texte); border: 1px solid currentColor; border-radius: 4px; padding: 0 .35em; opacity: .55; margin-left: .3em; }
.surtitre, .heure { font: 600 .75rem var(--titre); letter-spacing: .18em; text-transform: uppercase; color: var(--rouge); margin: 0 0 .7rem; }

/* Fond vivant : grille fine, halo rouge qui respire */
.fond { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.fond-grille { position: absolute; inset: -50%; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
  linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 48px 48px;
  transform: perspective(600px) rotateX(55deg) translateY(-10%); transform-origin: top;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 60%, transparent); mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 60%, transparent); }
.fond-halo { position: absolute; width: 900px; height: 900px; left: 50%; top: -420px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(225, 6, 0, .28), transparent); animation: respire 7s ease-in-out infinite; }
body.alerte-temps .fond-halo { animation-duration: 1.2s; background: radial-gradient(closest-side, rgba(225, 6, 0, .45), transparent); }
@keyframes respire { 50% { opacity: .55; transform: translateX(-50%) scale(1.08); } }

/* Transitions d'écran */
.ecran { animation: entree .5s var(--doux) both; }
@keyframes entree { from { opacity: 0; transform: translateY(14px); } }
body.secousse #scene { animation: secousse .35s; }
@keyframes secousse { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

/* Panneaux translucides */
.panneau, .carte { background: var(--verre); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--trait);
  border-radius: 18px; padding: 1.5rem; box-shadow: var(--ombre); }
.message { max-width: 520px; margin: 3rem auto; }
.btn { border-radius: 10px; box-shadow: 0 6px 20px -8px rgba(225, 6, 0, .8); background: linear-gradient(180deg, #f0140e, var(--rouge)); }
.btn:hover:not(:disabled) { background: linear-gradient(180deg, #ff2a24, #c90500); box-shadow: var(--lueur); transform: translateY(-1px); }
.btn.large { padding: 1em 1.7em; font-size: 1rem; }
.btn.clair { background: #fff; color: #000; box-shadow: none; }
.btn.clair:hover:not(:disabled) { background: var(--g10); box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .5); }
.btn.secondaire { background: rgba(255, 255, 255, .04); box-shadow: none; border: 1px solid var(--trait-fort); }
.btn.secondaire:hover:not(:disabled) { background: rgba(255, 255, 255, .1); box-shadow: none; }
.boutons { display: flex; gap: .8rem; flex-wrap: wrap; }

/* Barre du haut */
#hud { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1.1rem; padding: .65rem 18px;
  background: rgba(0, 0, 0, .7); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--trait); }
#hud .logo { height: 22px; }
.hud-salles { display: flex; gap: 6px; list-style: none; margin: 0 auto 0 .4rem; padding: 0; }
.hud-salles li { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--g60); border: 1px solid var(--trait); transition: all .4s; }
.hud-salles li .icone { width: 16px; height: 16px; }
.hud-salles li.faite { color: #fff; background: rgba(255, 255, 255, .08); }
.hud-salles li.en-cours { color: #fff; background: var(--rouge); border-color: var(--rouge); box-shadow: 0 0 16px rgba(225, 6, 0, .7); }
.hud-code { display: flex; gap: 4px; }
.hud-code span { width: 26px; height: 32px; display: grid; place-items: center; border: 1px solid var(--trait-fort); border-radius: 6px;
  font: 800 1rem var(--titre); color: var(--g60); background: rgba(255, 255, 255, .03); transition: all .5s; }
.hud-code span.trouve { color: #fff; border-color: var(--rouge); background: rgba(225, 6, 0, .2); box-shadow: inset 0 0 12px rgba(225, 6, 0, .4); }
.hud-chrono { font: 800 1.55rem/1 var(--titre); font-variant-numeric: tabular-nums; letter-spacing: .04em; min-width: 4.3ch; text-align: right; }
.hud-chrono.urgent { color: var(--rouge); animation: pouls 1s infinite; text-shadow: 0 0 18px rgba(225, 6, 0, .8); }
.hud-chrono.mort { color: var(--rouge); }
@keyframes pouls { 50% { opacity: .5; } }
.bouton-son { background: none; border: 1px solid var(--trait); color: var(--g30); border-radius: 8px; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; }
.bouton-son:hover { color: #fff; border-color: var(--trait-fort); }
.bouton-son .icone { width: 18px; height: 18px; }
#flash { position: fixed; top: 64px; right: 22px; z-index: 30; font: 800 1.7rem var(--titre); color: var(--rouge); opacity: 0; pointer-events: none; text-shadow: 0 0 20px rgba(225, 6, 0, .8); }
#flash.anim { animation: penalite 1.4s ease-out; }
@keyframes penalite { 0% { opacity: 0; transform: translateY(-8px) scale(1.4); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(26px); } }

/* Accueil */
.accueil { max-width: 660px; margin: 4vh auto 0; }
.decor-accueil { position: fixed; right: -120px; top: 12vh; width: 560px; height: 560px; border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(225, 6, 0, .25); box-shadow: 0 0 0 60px rgba(225, 6, 0, .03), 0 0 0 120px rgba(225, 6, 0, .02); animation: radar 8s linear infinite; }
.decor-accueil::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(225, 6, 0, .25), transparent 25%); }
@keyframes radar { to { transform: rotate(360deg); } }
.alerte-badge { display: inline-flex; align-items: center; gap: .6rem; padding: .45rem .9rem; border-radius: 99px; border: 1px solid rgba(225, 6, 0, .5);
  background: rgba(225, 6, 0, .1); font: 600 .78rem var(--titre); letter-spacing: .12em; text-transform: uppercase; }
.point-rouge { width: 8px; height: 8px; border-radius: 50%; background: var(--rouge); box-shadow: 0 0 0 0 rgba(225, 6, 0, .7); animation: ping 1.6s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(225, 6, 0, 0); } }
.titre-jeu { font: 800 clamp(3.2rem, 12vw, 6rem)/.95 var(--titre); letter-spacing: .02em; margin: 1.6rem 0 1rem; text-shadow: 0 10px 40px rgba(0, 0, 0, .6); }
.titre-jeu .rouge { text-shadow: 0 0 40px rgba(225, 6, 0, .55); }
.accroche { font-size: 1.12rem; color: var(--g10); line-height: 1.6; }
.puces { list-style: none; padding: 0; margin: 1.4rem 0 1.8rem; display: grid; gap: .55rem; color: var(--g20); }
.puces li { display: flex; align-items: center; gap: .7rem; }
.puces .icone { color: var(--rouge); }
.formulaire label { margin-top: 0; }
.formulaire input, .formulaire select { margin-top: .5rem; }
.formulaire .btn { width: 100%; justify-content: center; margin-top: 1.2rem; }
.identite { display: flex; align-items: center; gap: .6rem; margin: 0; font-size: 1.05rem; }
.identite .icone { color: var(--rouge); }
.confidentialite { font-size: .85rem; color: var(--g30); border-left: 3px solid var(--rouge); padding-left: .8rem; margin: 1.2rem 0 0; }
.reprise p { margin-top: 0; }

/* Briefing */
.briefing { max-width: 720px; margin: 8vh auto 0; position: relative; }
.terminal { font: 1.05rem/1.7 Consolas, 'Cascadia Mono', monospace; color: var(--g10); min-height: 12em; padding: 1.4rem 1.6rem;
  border-radius: 14px; background: rgba(0, 0, 0, .55); border: 1px solid var(--trait); box-shadow: inset 0 0 40px rgba(225, 6, 0, .06); }
.terminal p { margin: 0 0 .5rem; }
.terminal p::before { content: '› '; color: var(--rouge); }
.terminal p.en-cours::after { content: '▋'; color: var(--rouge); animation: pouls .8s infinite; margin-left: 2px; }
.briefing-suite { animation: entree .6s var(--doux) both; margin-top: 1.6rem; }
.lien-passer { position: absolute; right: 0; top: 0; background: none; border: 0; color: var(--g50); cursor: pointer; font: inherit; text-decoration: underline; }
.regles { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.6rem; }
.regles div { display: grid; grid-template-columns: auto 1fr; gap: .1rem .8rem; align-items: center; background: var(--verre); border: 1px solid var(--trait); border-radius: 14px; padding: 1rem 1.1rem; }
.regles .icone { grid-row: span 2; width: 30px; height: 30px; }
.regles span { color: var(--g30); font-size: .9rem; }

/* Plan de l'étage */
.hub { max-width: 980px; margin: 0 auto; }
.plan { list-style: none; padding: 0; margin: 0 0 1.6rem; display: grid; grid-template-columns: repeat(7, 1fr); gap: .6rem; }
.porte { position: relative; border-radius: 14px; padding: .9rem .8rem 1rem; border: 1px solid var(--trait); background: var(--verre);
  display: flex; flex-direction: column; gap: .3rem; min-height: 128px; animation: entree .5s var(--doux) both; animation-delay: calc(var(--i) * 60ms); }
.porte-icone { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .05); margin-bottom: .3rem; }
.porte-heure { font: 600 .7rem var(--titre); letter-spacing: .1em; color: var(--g50); }
.porte-titre { font: 600 .85rem/1.25 var(--titre); }
.porte.fermee { opacity: .45; }
.porte.fermee .porte-icone { color: var(--g50); }
.porte.ouverte { border-color: var(--rouge); box-shadow: var(--lueur); background: linear-gradient(180deg, rgba(225, 6, 0, .16), var(--verre) 70%); }
.porte.ouverte .porte-icone { background: var(--rouge); }
.porte.faite .porte-icone { color: #fff; }
.porte-chiffre { position: absolute; top: .7rem; right: .7rem; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 8px; display: grid; place-items: center;
  font: 800 1rem var(--titre); background: #fff; color: #000; }
.prochaine { background: var(--verre-fort); border: 1px solid var(--trait); border-radius: 20px; padding: 1.8rem; box-shadow: var(--ombre); }
.prochaine-tete { display: flex; align-items: center; gap: 1.1rem; margin-bottom: .6rem; }
.prochaine-tete h1 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.3rem); }
.prochaine-tete .heure { margin-bottom: .3rem; }
.prochaine-icone { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; background: var(--rouge); box-shadow: var(--lueur); flex: none; }
.prochaine-icone .icone { width: 32px; height: 32px; }
.astuce { background: rgba(255, 255, 255, .05); border-radius: 12px; padding: .8rem 1rem; color: var(--g10); font-size: .95rem; }

/* Chiffre récupéré : rouleau de machine à sous */
.fin-salle, .victoire { max-width: 640px; margin: 8vh auto 0; text-align: center; }
.rouleau { width: 130px; height: 160px; margin: 2rem auto; overflow: hidden; border-radius: 18px; border: 2px solid var(--rouge);
  background: linear-gradient(180deg, rgba(225, 6, 0, .25), rgba(0, 0, 0, .6) 30%, rgba(0, 0, 0, .6) 70%, rgba(225, 6, 0, .25)); box-shadow: var(--lueur); }
.rouleau-bande { display: flex; flex-direction: column; transform: translateY(-1600px); }
.rouleau-bande span { height: 160px; flex: none; display: grid; place-items: center; font: 800 6rem/1 var(--titre); }
.rouleau.roule .rouleau-bande { animation: roule 1.1s cubic-bezier(.15, .85, .25, 1) both; }
@keyframes roule { from { transform: translateY(0); } to { transform: translateY(-1600px); } }
.code-partiel { font: 800 1.3rem var(--titre); letter-spacing: .3em; color: #fff; }

/* Victoire */
.victoire { position: relative; }
.medaille { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 1.4rem; display: grid; place-items: center; background: var(--rouge); box-shadow: var(--lueur);
  animation: apparition .7s var(--doux) both; }
.medaille .icone { width: 48px; height: 48px; stroke-width: 1.6; }
.medaille.petite { width: 64px; height: 64px; margin-bottom: 1rem; }
.medaille.petite .icone { width: 30px; height: 30px; }
.victoire h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); margin: .6rem 0 1rem; }
.onde { position: absolute; left: 50%; top: 0; width: 96px; height: 96px; border-radius: 50%; transform: translateX(-50%); border: 2px solid var(--rouge); animation: onde 2.2s ease-out infinite; }
@keyframes onde { to { transform: translateX(-50%) scale(4); opacity: 0; } }
@keyframes apparition { from { transform: scale(.4); opacity: 0; } }
.confettis { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confettis i { position: absolute; top: -20px; left: var(--x); width: 8px; height: 14px; background: var(--c); border-radius: 2px;
  animation: tombe-c var(--d) linear var(--t) both; }
@keyframes tombe-c { to { transform: translateY(110vh) rotate(var(--r)); } }

/* En-tête de salle */
.salle-tete { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.3rem; }
.salle-icone { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--rouge); box-shadow: var(--lueur); flex: none; }
.salle-tete h2 { margin: 0; font-size: 1.35rem; }
.salle-tete .heure { margin: 0 0 .15rem; }
.compteur { margin-left: auto; font: 600 .8rem var(--titre); letter-spacing: .08em; color: var(--g30); background: rgba(255, 255, 255, .05);
  border: 1px solid var(--trait); padding: .4rem .8rem; border-radius: 99px; white-space: nowrap; }

/* Messagerie (claire, comme un vrai client mail) */
.messagerie { display: grid; grid-template-columns: 290px 1fr; border-radius: 18px; overflow: hidden; background: #fff; color: #191919; min-height: 540px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .1); }
.boite { background: #f6f6f7; border-right: 1px solid #e6e6e8; }
.boite-titre { display: flex; justify-content: space-between; font: 600 .78rem var(--titre); text-transform: uppercase; letter-spacing: .1em; padding: 1.1rem 1rem; margin: 0; border-bottom: 1px solid #e6e6e8; }
.boite-titre span { background: var(--rouge); color: #fff; border-radius: 99px; padding: 0 .55rem; }
.boite-mail { padding: .75rem 1rem .75rem 1.3rem; border-bottom: 1px solid #ececee; font-size: .85rem; position: relative; transition: background .2s; }
.boite-de { display: flex; justify-content: space-between; gap: .5rem; font-weight: 600; }
.boite-de time { color: var(--g50); font-weight: 400; font-size: .78rem; }
.boite-objet { color: #4a4a4a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.boite-mail.actif { background: #fff; box-shadow: inset 4px 0 0 var(--rouge); }
.boite-mail.non-lu .boite-de { font-weight: 700; }
.boite-mail.non-lu::before { content: ''; position: absolute; left: 7px; top: 1.15rem; width: 6px; height: 6px; border-radius: 50%; background: #1a5fb4; }
.boite-mail.traite { opacity: .55; }
.boite-marque { display: inline-block; margin-top: .2rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--g50); }
.boite-mail.ko .boite-marque { color: var(--rouge); }
.lecteur { padding: 1.7rem 2rem; display: flex; flex-direction: column; animation: entree .4s var(--doux) both; }
.compteur-mobile { display: none; margin: 0 0 .6rem; font: 600 .72rem var(--titre); letter-spacing: .12em; text-transform: uppercase; color: var(--rouge); }
.lecteur-objet { color: #000; font: 700 1.2rem/1.35 var(--texte); text-transform: none; letter-spacing: 0; margin: 0 0 1rem; }
.lecteur-de { display: flex; gap: .8rem; align-items: center; padding-bottom: 1rem; border-bottom: 1px solid #ececee; }
.lecteur-de div { display: flex; flex-direction: column; min-width: 0; }
.lecteur-de time { margin-left: auto; color: var(--g50); font-size: .8rem; white-space: nowrap; }
.adresse { color: #6b6b6b; font-size: .85rem; word-break: break-all; }
.avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, #3a3a3a, #111); color: #fff; display: grid; place-items: center; font-weight: 700; }
.pj { display: inline-flex; align-self: flex-start; align-items: center; gap: .4rem; margin-top: .9rem; padding: .45rem .8rem; border: 1px solid #e3e3e6; border-radius: 8px; font-size: .85rem; background: #fafafa; }
.lecteur-corps { padding: 1rem 0; line-height: 1.65; }
.lien-mail { color: #1a5fb4; font-weight: 600; }
.statut-lien { background: #f2f2f4; border-radius: 8px; padding: .55rem .85rem; font-size: .85rem; word-break: break-all; animation: entree .3s both; }
.statut-lien strong { color: var(--rouge); }
.note-contexte { font-size: .85rem; color: #555; background: #f6f6f7; padding: .65rem .85rem; border-radius: 8px; border-left: 3px solid var(--g30); }
.actions-mail { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: auto; padding-top: 1.2rem; }
.lecteur .btn.clair { border: 1px solid #d0d0d4; }
.lecteur > .btn { align-self: flex-start; margin-top: 1rem; }

/* Corrections */
.correction { border-radius: 14px; padding: 1rem 1.2rem; margin-top: 1rem; border: 1px solid; animation: entree .4s var(--doux) both; }
.correction p { margin: .3rem 0; }
.correction .verdict { display: flex; align-items: center; gap: .5rem; font: 700 .95rem var(--titre); text-transform: uppercase; letter-spacing: .06em; }
.correction.ok { border-color: rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .06); }
.correction.ko { border-color: var(--rouge); background: rgba(225, 6, 0, .1); }
.correction.ko .verdict { color: var(--rouge); }
.lecteur .correction.ok { background: #f4f6f4; border-color: #dfe3df; }
.lecteur .correction.ko { background: #fff1f0; }
.indices { margin: .6rem 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; }
.indices li { font-size: .78rem; padding: .25rem .65rem; border-radius: 99px; background: var(--rouge); color: #fff; }

/* Situations à choix */
.choix-grille { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 1.6rem; align-items: start; }
.situation p { margin: 0 0 .6rem; font-size: 1.06rem; line-height: 1.6; }
.question h3 { color: #fff; text-transform: none; letter-spacing: 0; font-size: 1.2rem; margin-bottom: .9rem; }
.options { display: flex; flex-direction: column; gap: .65rem; }
.option { display: flex; gap: .95rem; align-items: center; text-align: left; font: inherit; color: #fff; cursor: pointer; background: var(--verre);
  border: 1px solid var(--trait-fort); border-radius: 14px; padding: 1rem 1.1rem; transition: transform .2s var(--doux), border-color .2s, background .2s, box-shadow .2s;
  animation: entree .45s var(--doux) both; animation-delay: calc(var(--i) * 70ms); }
.option:hover:not(:disabled) { border-color: var(--rouge); background: rgba(225, 6, 0, .08); transform: translateX(4px); box-shadow: -4px 0 0 var(--rouge); }
.option-lettre { flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; border: 1px solid var(--trait-fort); font: 700 .85rem var(--titre); }
.option:disabled { cursor: default; }
.option.bonne { border-color: #fff; background: rgba(255, 255, 255, .1); }
.option.bonne .option-lettre { background: #fff; color: #000; border-color: #fff; }
.option.mauvaise { border-color: var(--rouge); background: rgba(225, 6, 0, .14); }
.option.mauvaise .option-lettre { background: var(--rouge); border-color: var(--rouge); }
.option.grisee { opacity: .4; }
.question > .btn { margin-top: 1rem; }

.appel { background: linear-gradient(160deg, #1d1d1d, #090909); border: 1px solid var(--trait-fort); border-radius: 22px; padding: 1.5rem; box-shadow: var(--ombre); }
.appel-tete { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.1rem; }
.appel-tete div { display: flex; flex-direction: column; }
.appel-icone { width: 56px; height: 56px; border-radius: 50%; background: var(--rouge); display: grid; place-items: center; animation: sonne 1.6s infinite; flex: none; }
.appel-duree { color: var(--g30); font-size: .85rem; }
@keyframes sonne { 0%, 100% { box-shadow: 0 0 0 0 rgba(225, 6, 0, .6); } 70% { box-shadow: 0 0 0 16px rgba(225, 6, 0, 0); } }
.appel blockquote { margin: 0; padding: 1.1rem 1.25rem; background: rgba(255, 255, 255, .06); border-radius: 4px 18px 18px 18px; font-size: 1.06rem; line-height: 1.6; }
.telephone { position: relative; width: min(300px, 100%); margin: 0 auto; border: 11px solid #1b1b1b; border-radius: 40px; background: radial-gradient(120% 80% at 50% 0%, #2a1514, #0a0a0a 60%);
  min-height: 460px; padding: 2.2rem .85rem 1.2rem; box-shadow: 0 0 0 1px #333, var(--ombre); }
.tel-encoche { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 90px; height: 22px; border-radius: 12px; background: #000; }
.tel-heure { text-align: center; font: 300 3rem var(--titre); margin: .4rem 0 1.4rem; letter-spacing: .02em; }
.tel-de { font-size: .8rem; color: var(--g30); margin: 0 0 .35rem; }
.bulle { background: rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-radius: 18px 18px 18px 6px; padding: .85rem 1rem; font-size: .95rem; line-height: 1.5; animation: entree .5s .2s both; }
.tel-notifs { display: flex; flex-direction: column; gap: 7px; }
.notif { background: rgba(255, 255, 255, .13); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-radius: 14px; padding: .6rem .75rem; font-size: .8rem; display: flex; flex-direction: column;
  animation: tombe .45s calc(var(--i) * .4s) both var(--doux); }
.notif strong { display: flex; align-items: center; gap: .35rem; }
.notif-btns { display: flex; gap: .4rem; margin-top: .4rem; }
.notif-btns span { flex: 1; text-align: center; background: rgba(255, 255, 255, .14); border-radius: 8px; padding: .25rem; }
@keyframes tombe { from { opacity: 0; transform: translateY(-16px) scale(.96); } }
.mini-mail { background: #fff; color: #191919; border-radius: 18px; padding: 1.3rem 1.5rem; box-shadow: var(--ombre); }
.mini-mail .lecteur-objet { margin: 1rem 0 0; }
.wifi { list-style: none; margin: 1rem 0 0; padding: 0; }
.wifi li { display: flex; gap: .8rem; align-items: center; padding: .7rem .2rem; border-bottom: 1px solid var(--trait); }
.wifi em { margin-left: auto; font-size: .75rem; font-style: normal; color: var(--g50); }

/* Bureau */
.bureau-grille { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(270px, 1fr); gap: 1.4rem; align-items: start; }
.cadre-scene { border-radius: 18px; overflow: hidden; border: 1px solid var(--trait-fort); box-shadow: var(--ombre); }
.scene-bureau { display: block; width: 100%; height: auto; }
.vapeur { animation: vapeur 3s ease-in-out infinite; }
@keyframes vapeur { 50% { opacity: .2; transform: translateY(-4px); } }
.zone { cursor: pointer; outline: none; }
.zone .cadre { fill: transparent; stroke: transparent; stroke-width: 3; transition: all .2s; }
.scene-bureau:not(.bilan) .zone:hover .cadre, .zone:focus-visible .cadre { stroke: rgba(255, 255, 255, .7); stroke-dasharray: 8 6; fill: rgba(255, 255, 255, .06); }
.scene-bureau .zone.choisi .cadre, .scene-bureau:not(.bilan) .zone.choisi:hover .cadre { stroke: var(--rouge); fill: rgba(225, 6, 0, .16); stroke-dasharray: none; filter: drop-shadow(0 0 8px rgba(225, 6, 0, .8)); }
.bilan .zone { cursor: default; }
.zone.trouve .cadre { stroke: #fff; fill: rgba(255, 255, 255, .1); }
.zone.manque .cadre { stroke: var(--rouge); stroke-dasharray: 10 6; fill: rgba(225, 6, 0, .12); animation: clignote 1.4s infinite; }
@keyframes clignote { 50% { fill: rgba(225, 6, 0, .02); } }
.zone.faux .cadre { stroke: var(--g50); stroke-dasharray: 4 4; }
.pastille { fill: var(--rouge); stroke: #000; stroke-width: 2; }
.zone.trouve .pastille { fill: #fff; }
.pastille-txt { font: 800 15px 'Segoe UI', Arial, sans-serif; fill: #fff; }
.zone.trouve .pastille-txt { fill: #000; }
.panneau-bureau { background: var(--verre); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--trait); border-radius: 18px; padding: 1.3rem; box-shadow: var(--ombre); }
.panneau-bureau > p:first-child { margin-top: 0; }
.jauge-selection { display: flex; gap: 6px; margin: 1rem 0 .4rem; }
.jauge-selection i { flex: 1; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .1); transition: background .3s; }
.jauge-selection i.pleine { background: var(--rouge); box-shadow: 0 0 10px rgba(225, 6, 0, .7); }
.compte-selection strong { font: 800 1.8rem var(--titre); color: var(--rouge); }
.verdict-bureau strong { font: 800 2rem var(--titre); }
.liste-bilan { padding-left: 1.4rem; margin: 0 0 1rem; max-height: 52vh; overflow: auto; }
.liste-bilan li { margin-bottom: .8rem; animation: entree .4s var(--doux) both; }
.liste-bilan li::marker { font: 800 1rem var(--titre); color: var(--rouge); }
.liste-bilan em { display: inline-block; margin-left: .5rem; font-style: normal; font-size: .72rem; padding: .1rem .55rem; border-radius: 99px; background: rgba(255, 255, 255, .12); }
.liste-bilan li.manque em, .liste-bilan li.faux em { background: var(--rouge); }
.liste-bilan p { margin: .2rem 0 0; font-size: .88rem; color: var(--g20); }

/* Atelier et code */
.atelier, .saisie-code { max-width: 640px; margin: 0 auto; }
.avertissement { display: flex; gap: .6rem; align-items: center; background: rgba(255, 255, 255, .05); border-left: 3px solid var(--rouge); padding: .65rem .85rem; border-radius: 0 10px 10px 0; font-size: .9rem; }
#phrase { font: 1.2rem Consolas, monospace; padding: .9em 1em; }
.atelier .barre { margin-top: .8rem; height: 10px; }
.barre.force-faible > i { background: var(--rouge); }
.barre.force-moyen > i { background: var(--g30); }
.barre.force-fort > i { background: #fff; box-shadow: 0 0 12px rgba(255, 255, 255, .6); }
.force { min-height: 1.5em; font-size: .95rem; }
.atelier-actions { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 1rem 0; }
.saisie-code { text-align: center; }
.cases { display: flex; justify-content: center; gap: .6rem; margin: 1.4rem 0 .4rem; }
.case-code { width: 58px; height: 72px; text-align: center; font: 800 2.2rem var(--titre); border-radius: 12px; border: 2px solid var(--trait-fort); background: rgba(0, 0, 0, .4); padding: 0; }
.case-code:focus { border-color: var(--rouge); outline: none; box-shadow: var(--lueur); }
.saisie-code.vibre { animation: secousse .4s; }

/* Bilan */
.explosion { position: fixed; inset: 0; z-index: 50; background: rgba(40, 0, 0, .94); display: grid; place-items: center; padding: 16px; animation: alarme .9s 3; }
@keyframes alarme { 50% { background: rgba(225, 6, 0, .94); } }
.explosion-contenu { max-width: 520px; text-align: center; }
.explosion-chrono { font: 800 5.5rem var(--titre); color: #fff; }
.debrief { max-width: 940px; margin: 1rem auto; }
.debrief > * { animation: entree .6s var(--doux) both; }
.debrief > *:nth-child(2) { animation-delay: .1s; } .debrief > *:nth-child(3) { animation-delay: .2s; } .debrief > *:nth-child(4) { animation-delay: .3s; }
.debrief-tete { text-align: center; margin: 1rem 0 1.8rem; }
.debrief-tete h1 { font-size: clamp(2rem, 6vw, 3rem); }
.debrief-grille { display: grid; grid-template-columns: 1fr 1.4fr; gap: 1.2rem; margin-bottom: 1.2rem; }
.score { text-align: center; }
.anneau-zone { position: relative; width: 170px; height: 170px; margin: 0 auto .6rem; }
.anneau { width: 100%; height: 100%; transform: rotate(-90deg); }
.anneau-fond { fill: none; stroke: rgba(255, 255, 255, .08); stroke-width: 10; }
.anneau-plein { fill: none; stroke: var(--rouge); stroke-width: 10; stroke-linecap: round; stroke-dasharray: var(--c); stroke-dashoffset: var(--c);
  animation: anneau 1.6s .2s var(--doux) forwards; filter: drop-shadow(0 0 8px rgba(225, 6, 0, .7)); }
@keyframes anneau { to { stroke-dashoffset: var(--v); } }
.anneau-texte { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.score-chiffre { font: 800 3.4rem/1 var(--titre); }
.anneau-texte small { color: var(--g50); font-size: .9rem; }
.niveau { font: 700 1.3rem var(--titre); text-transform: uppercase; letter-spacing: .12em; margin: .2rem 0 .5rem; color: var(--rouge); }
.theme-ligne { margin-bottom: .85rem; }
.theme-nom { display: flex; justify-content: space-between; font-size: .92rem; margin-bottom: .3rem; }
.theme-ligne .barre > i { width: 0; animation: remplit 1.2s var(--doux) forwards; animation-delay: calc(.3s + var(--i) * 90ms); }
@keyframes remplit { to { width: var(--w); } }
.atelier .barre > i { transition: width .3s; }
.erreurs details { border-top: 1px solid var(--trait); padding: .75rem 0; }
.erreurs summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; gap: .6rem; align-items: center; }
.erreurs summary::-webkit-details-marker { display: none; }
.erreurs summary::before { content: '+'; width: 22px; height: 22px; flex: none; border-radius: 6px; display: grid; place-items: center; background: rgba(225, 6, 0, .2); color: var(--rouge); font-weight: 800; }
.erreurs details[open] summary::before { content: '−'; }
.erreurs details p { margin: .5rem 0 0 2rem; color: var(--g20); font-size: .93rem; }
.erreurs .bonne { color: #fff; }
.parfait { display: flex; align-items: center; gap: 1rem; font-size: 1.1rem; margin-bottom: 1.2rem; }
.parfait .icone { color: var(--rouge); }
.panneau.erreurs, .panneau.reflexes, .panneau.doute { margin-bottom: 1.2rem; }
.reflexes ol { margin: 0; padding-left: 1.4rem; }
.reflexes li { margin-bottom: .65rem; line-height: 1.5; }
.reflexes li::marker { color: var(--rouge); font-weight: 800; }
.doute { display: flex; gap: 1rem; align-items: center; border-color: rgba(225, 6, 0, .4); }
.doute .icone { color: var(--rouge); width: 30px; height: 30px; }
.doute p { margin: 0; }
.debrief-actions { display: flex; justify-content: center; gap: .9rem; flex-wrap: wrap; margin: 1.6rem 0 1rem; }
.edition { color: var(--g60); font-size: .8rem; }
.chargeur { width: 42px; height: 42px; margin: 0 auto 1rem; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .1); border-top-color: var(--rouge); animation: radar .8s linear infinite; }

.pied { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: .6rem; }
.pied-logo { height: 14px; opacity: .6; }
body.en-jeu .pied { display: none; }

/* Téléphone */
@media (max-width: 860px) {
  #scene { padding-top: 18px; }
  .messagerie { grid-template-columns: 1fr; min-height: 0; }
  .boite { display: none; }
  .compteur-mobile { display: block; }
  .lecteur { padding: 1.2rem; }
  .choix-grille, .bureau-grille, .debrief-grille, .regles { grid-template-columns: 1fr; }
  .plan { grid-template-columns: repeat(4, 1fr); }
  .porte { min-height: 104px; padding: .7rem; }
  .porte-titre { font-size: .78rem; }
  #hud { gap: .55rem; padding: .55rem 12px; }
  #hud .logo { display: none; }
  .hud-salles { margin-left: 0; gap: 4px; }
  .hud-salles li { width: 22px; height: 22px; border-radius: 6px; }
  .hud-salles li .icone { width: 12px; height: 12px; }
  .hud-code span { width: 19px; height: 26px; font-size: .8rem; }
  .hud-chrono { font-size: 1.2rem; }
  .actions-mail .btn { flex: 1; justify-content: center; }
  .actions-mail kbd { display: none; }
  .decor-accueil { opacity: .4; right: -300px; }
  .prochaine { padding: 1.3rem; }
  .salle-tete .compteur { display: none; }
  .case-code { width: 48px; height: 62px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Impression : fiche des réflexes, ou attestation seule */
.attestation { display: none; }
@media print {
  @page { margin: 12mm; }
  body { background: #fff !important; color: #000; }
  .fond, #hud, .pied, #flash, .confettis, .debrief-actions, .decor-accueil { display: none !important; }
  .panneau { background: #fff; border-color: #ccc; color: #000; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .debrief .discret, .theme-nom, .erreurs details p { color: #333; }
  .debrief > * { animation: none; }
  .barre { background: #e5e5e5; }
  .theme-ligne .barre > i { animation: none; width: var(--w); }
  .barre.claire > i { background: #000; }
  .anneau-plein { animation: none; stroke-dashoffset: var(--v); }
  body[data-impression="attestation"] > *:not(#attestation) { display: none !important; }
  body[data-impression="attestation"] .attestation { display: block; }
  body[data-impression="fiche"] #attestation { display: none !important; }
}
.att-cadre { position: relative; border: 2px solid #000; outline: 6px solid #fff; box-shadow: 0 0 0 8px #E10600; padding: 18mm 20mm; text-align: center;
  font-family: Arial, sans-serif; color: #000; min-height: 160mm; display: flex; flex-direction: column; justify-content: center;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.att-logo { height: 18mm; margin: 0 auto 8mm; }
.att-sur { font: 600 11pt Arial; letter-spacing: .25em; text-transform: uppercase; color: #E10600; margin: 0 0 8mm; }
.att-intro { font-size: 13pt; margin: 0; color: #4C4C4C; }
.att-nom { font: 700 30pt Arial; margin: 4mm 0 6mm; letter-spacing: .02em; }
.att-texte { font-size: 12.5pt; line-height: 1.6; max-width: 200mm; margin: 0 auto; }
.att-date { margin-top: 10mm; color: #4C4C4C; font-size: 11pt; }
.att-pied { margin-top: 12mm; display: flex; justify-content: center; align-items: center; gap: 4mm; font-size: 9pt; color: #7F7F7F; }
.att-chevrons { width: 14mm; height: 6mm; background: url(/static/chevron-rouge.svg) right/contain no-repeat, url(/static/chevron-rouge.svg) left/contain no-repeat; }
