:root {
  --vide: #07090c; --fond: #0e1217; --bord: #232a33; --texte: #d9d4c7; --pale: #8a8577;
  --ambre: #f2a93b; --lcd: #191307; --danger: #e5484d; --ok: #4cc38a; --plan: #6fb3d9;
  --titre: "Bahnschrift", "Arial Narrow", "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", Consolas, "Courier New", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--vide); color: var(--texte); font-family: var(--titre); overflow: hidden; }
button, input { font: inherit; }
kbd { font-family: var(--mono); font-size: .85em; border: 1px solid var(--bord); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--fond); }
.cache { display: none !important; }

.ecran { display: none; position: fixed; inset: 0; align-items: center; justify-content: center; padding: 20px; }
.ecran.actif { display: flex; }
#jeu { padding: 0; }

.carte { width: min(520px, 100%); background: var(--fond); border: 1px solid var(--bord); border-radius: 10px; padding: 28px; text-align: center; box-shadow: 0 20px 60px #000a; }
h1 { font-weight: 600; font-stretch: condensed; letter-spacing: .04em; text-transform: uppercase; color: var(--ambre); margin: 0 0 6px; font-size: 34px; }
h2 { font-size: 16px; text-transform: uppercase; letter-spacing: .08em; color: var(--ambre); margin: 0 0 10px; }
.sous { color: var(--pale); margin: 0 0 20px; }
.petit { font-size: 13px; color: var(--pale); }
.message { min-height: 1.3em; color: var(--ambre); }
.message.erreur { color: var(--danger); }

.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; text-align: left; }
.role { border: 1px solid var(--bord); border-radius: 8px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.role input { position: absolute; opacity: 0; }
.role span { font-size: 13px; color: var(--pale); }
.role:has(input:checked) { border-color: var(--ambre); background: #f2a93b14; }
.role:has(input:focus-visible) { outline: 2px solid var(--ambre); }

.bouton { background: var(--ambre); color: #1a1205; border: 0; border-radius: 6px; padding: 10px 20px; font-weight: 600; cursor: pointer; letter-spacing: .03em; }
.bouton:hover { filter: brightness(1.1); }
.bouton:disabled { opacity: .4; cursor: default; filter: none; }
.bouton.secondaire { background: transparent; color: var(--ambre); border: 1px solid var(--ambre); }
.ou { color: var(--pale); margin: 14px 0; font-size: 13px; }
.rejoindre { display: flex; gap: 8px; justify-content: center; }
#i-code { width: 150px; text-align: center; font-family: var(--mono); letter-spacing: .3em; text-transform: uppercase; background: var(--vide); color: var(--texte); border: 1px solid var(--bord); border-radius: 6px; padding: 8px; }

.code { font-family: var(--mono); font-size: 46px; letter-spacing: .25em; color: var(--ambre); margin: 4px 0 10px; user-select: all; }
.aide { text-align: left; font-size: 14px; background: var(--vide); border: 1px solid var(--bord); border-radius: 8px; padding: 10px 14px; margin: 10px 0; line-height: 1.5; }
.micro-ligne { display: flex; align-items: center; gap: 12px; justify-content: center; margin: 12px 0 4px; }
.vumetre { width: 140px; height: 8px; background: var(--vide); border: 1px solid var(--bord); border-radius: 4px; overflow: hidden; }
.vumetre > * { display: block; height: 100%; width: 0; background: var(--ok); transition: width .08s; }
.vumetre > .fort { background: var(--danger); }

/* Partie */
#toile { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.hud { position: absolute; top: 12px; left: 12px; display: flex; gap: 18px; background: #07090ccc; border: 1px solid var(--bord); border-radius: 8px; padding: 8px 14px; font-size: 15px; }
.etiq { color: var(--pale); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.barres { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; vertical-align: middle; }
.barres i { width: 4px; background: var(--bord); }
.barres i:nth-child(1) { height: 20%; } .barres i:nth-child(2) { height: 40%; } .barres i:nth-child(3) { height: 60%; }
.barres i:nth-child(4) { height: 80%; } .barres i:nth-child(5) { height: 100%; }
.barres i.on { background: var(--ambre); }

.radio { position: absolute; left: 12px; bottom: 12px; width: min(440px, calc(100% - 24px)); background: #1f1b14; border: 1px solid #3a3226; border-radius: 10px; padding: 10px; }
.lcd { background: var(--lcd); color: var(--ambre); font-family: var(--mono); font-size: 14px; border-radius: 4px; padding: 8px 10px; min-height: 40px; text-shadow: 0 0 6px #f2a93b66; }
.radio-bas { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 13px; }
.voyant-parle { padding: 2px 8px; border-radius: 10px; border: 1px solid #3a3226; color: var(--pale); }
.voyant-parle.on { background: var(--ok); color: #06140d; border-color: var(--ok); }
.petit-vu { width: 80px; }

.indice { position: absolute; left: 50%; top: 64%; transform: translateX(-50%); background: #07090cd0; border: 1px solid var(--bord); border-radius: 6px; padding: 6px 12px; font-size: 14px; pointer-events: none; }
.indice:empty { display: none; }

.panneau { position: absolute; right: 12px; top: 12px; width: min(380px, calc(100% - 24px)); background: var(--fond); border: 1px solid var(--bord); border-radius: 10px; padding: 16px; }
.voyant-ligne { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.voyant { width: 18px; height: 18px; border-radius: 50%; display: inline-block; }
.voyant.rouge { background: #ff3b30; box-shadow: 0 0 12px #ff3b30; }
.voyant.vert { background: #34c759; box-shadow: 0 0 12px #34c759; }
.fils { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.fil { display: flex; align-items: center; gap: 10px; background: var(--vide); border: 1px solid var(--bord); border-radius: 6px; padding: 6px 10px; cursor: pointer; color: var(--texte); text-align: left; }
.fil:hover { border-color: var(--ambre); }
.fil .num { font-family: var(--mono); color: var(--pale); width: 16px; }
.fil .trait { flex: 1; height: 8px; border-radius: 4px; }
.fil.coupe { opacity: .35; cursor: default; }
.fil.coupe .trait { background-image: linear-gradient(90deg, transparent 46%, var(--vide) 46%, var(--vide) 54%, transparent 54%) !important; }
.consigne { font-size: 18px; line-height: 1.45; background: var(--vide); border: 1px solid var(--plan); color: #cfe7f5; border-radius: 8px; padding: 12px; margin-bottom: 8px; }
#b-scan { margin: 10px 0 4px; width: 100%; }

.voile { position: absolute; inset: 0; background: #000b; display: flex; align-items: center; justify-content: center; }
.boutons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
