:root { --nuit: #1b1330; --nuit2: #2a1f47; --papier: #fff4dc; --papier2: #f6e6c2; --encre: #241a3a; --doux: #6a5f80; --jaune: #ffd23f; --a: #9b5de5; --b: #1fb37e; --vit: #e5484d; --souffle: #3a8fe0; --moral: #f2a900; --alerte: #b3261e; --titre: 'Lilita One', 'Arial Rounded MT Bold', 'Trebuchet MS', sans-serif; --texte: 'Space Grotesk', system-ui, 'Segoe UI', sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--nuit); color: var(--papier); font: 16px/1.45 var(--texte); }
main { max-width: 1180px; margin: 0 auto; padding: 14px 16px 40px; }
h1, h2, h3 { font-family: var(--titre); font-weight: 400; letter-spacing: .01em; }
.tete { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 4px 0 14px; }
h1 { font-size: 30px; margin: 0; color: var(--jaune); text-shadow: 0 3px 0 var(--encre); }
.tete p { margin: 0; color: #cdbfe6; font-size: 15px; max-width: 64ch; }
h2 { font-size: 20px; margin: 22px 0 10px; color: var(--papier); }
button { font: inherit; font-weight: 700; min-height: 44px; padding: 8px 16px; border: 3px solid var(--encre); border-radius: 12px; background: var(--papier); color: var(--encre); cursor: pointer; box-shadow: 0 4px 0 var(--encre); transition: transform .06s, box-shadow .06s; }
button:hover { background: #fff; }
button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--encre); }
button.principal { background: var(--jaune); font-family: var(--titre); font-weight: 400; font-size: 19px; padding: 8px 22px; }
button.principal:hover { background: #ffe07a; }
button:disabled { opacity: .5; cursor: default; transform: none; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--jaune); outline-offset: 2px; }
input, select { font: inherit; min-height: 44px; padding: 8px 10px; border: 3px solid var(--encre); border-radius: 12px; background: #fff; color: var(--encre); }

/* Écurie */
.ecurie { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.ecurie button { display: grid; grid-template-rows: auto auto; justify-items: center; gap: 4px; padding: 8px 6px 10px; min-width: 0; text-align: center; font-weight: 400; background: var(--nuit2); color: var(--papier); border-color: #000; box-shadow: 0 4px 0 #000; }
.ecurie button:hover { background: #352759; }
.ecurie button[aria-pressed="true"] { background: var(--papier); color: var(--encre); border-color: var(--jaune); box-shadow: 0 4px 0 var(--jaune); }
.ecurie .portrait { width: 74px; height: 74px; border-radius: 50%; background: var(--a); border: 3px solid var(--encre); }
.ecurie button.repos .portrait { filter: grayscale(.9); opacity: .7; }
.ecurie strong { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--titre); font-weight: 400; font-size: 16px; }
.ecurie small { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; opacity: .85; }
.ecurie .infos { min-width: 0; max-width: 100%; }
.ecurie button.libre { border-style: dashed; border-color: #6a5f80; box-shadow: none; color: #cdbfe6; align-content: center; min-height: 150px; }
.ecurie button.libre[aria-pressed="true"] { background: #3a2b62; color: var(--papier); border-color: var(--jaune); box-shadow: none; }
.ecurie .plus { font-family: var(--titre); font-size: 38px; line-height: 1; color: var(--jaune); }
.etat { display: inline-block; margin-top: 4px; padding: 1px 9px; border-radius: 10px; font-size: 12px; font-weight: 700; background: #c9f2d9; color: #0c5136; }
.etat.blesse { background: #ffe2a8; color: #6b4300; }
.etat.repos { background: #ffc9c2; color: #7a1a13; }
.barre-ecurie { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 12px 0 0; }

/* Arène */
.scene { margin-top: 18px; border: 4px solid #000; border-radius: 18px; overflow: hidden; background: var(--encre); container-type: inline-size; box-shadow: 0 8px 0 #000; }
.ecran { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.ecran > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fx-texte { font-family: var(--titre); paint-order: stroke; stroke: var(--encre); stroke-width: 10px; stroke-linejoin: round; }
.pansement.grave rect { fill: #ff9d94; }
.hud { position: absolute; inset: 1.6cqw 1.8cqw auto; display: grid; grid-template-columns: 1fr auto 1fr; gap: 1.6cqw; align-items: start; pointer-events: none; }
.hud-cote { display: flex; gap: 1cqw; align-items: center; min-width: 0; }
.hud-cote.b { flex-direction: row-reverse; text-align: right; }
.hud .portrait { width: 6.4cqw; height: 6.4cqw; flex: none; border-radius: 50%; border: .35cqw solid var(--encre); background: var(--a); }
.hud-cote.b .portrait { background: var(--b); transform: scaleX(-1); }
.hud-infos { flex: 1; min-width: 0; }
.hud-nom { font-family: var(--titre); font-size: clamp(13px, 2.3cqw, 30px); line-height: 1.1; color: #fff; text-shadow: 0 .2cqw 0 var(--encre), 0 0 .6cqw var(--encre); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-sous { font-size: clamp(10px, 1.25cqw, 15px); font-weight: 700; color: #f3e9ff; text-shadow: 0 1px 0 var(--encre), 0 0 4px var(--encre); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: .3cqw; }
.hud-vie { position: relative; height: 2.1cqw; min-height: 12px; border: .3cqw solid var(--encre); border-radius: 1.2cqw; background: #3b2f57; overflow: hidden; }
.hud-vie i { position: absolute; inset: 0 auto 0 0; width: 100%; border-radius: 1cqw; }
.hud-cote.b .hud-vie i { inset: 0 0 0 auto; }
.hud-vie .fantome { background: #fff4dc; transition: width .5s .35s; }
.hud-vie .plein { background: linear-gradient(#ff7a6b, var(--vit)); transition: width .14s; }
.hud-vie b { position: absolute; inset: 0 .8cqw; font-size: clamp(9px, 1.2cqw, 14px); line-height: 1.5cqw; color: #fff; text-shadow: 0 1px 0 var(--encre); }
.hud-mini { display: grid; grid-template-columns: 1fr 1fr; gap: .6cqw; margin-top: .45cqw; }
.hud-mini div { height: 1cqw; min-height: 6px; border: .22cqw solid var(--encre); border-radius: 1cqw; background: #3b2f57; overflow: hidden; display: flex; }
.hud-cote.b .hud-mini div { flex-direction: row-reverse; }
.hud-mini i { width: 100%; transition: width .2s; }
.hud-mini .souffle i { background: #6ab6ff; }
.hud-mini .moral i { background: var(--jaune); }
.hud-legende { display: grid; grid-template-columns: 1fr 1fr; gap: .6cqw; font-size: clamp(9px, 1cqw, 12px); font-weight: 700; color: #fff; text-shadow: 0 1px 0 var(--encre), 0 0 3px var(--encre); }
.hud-centre { display: grid; justify-items: center; gap: .3cqw; padding-top: .2cqw; }
.hud-centre b { display: grid; place-items: center; min-width: 6.6cqw; height: 4.6cqw; padding: 0 1cqw; font-family: var(--titre); font-weight: 400; font-size: clamp(14px, 2.6cqw, 34px); color: var(--encre); background: var(--jaune); border: .35cqw solid var(--encre); border-radius: 1.4cqw; box-shadow: 0 .4cqw 0 var(--encre); }
.hud-centre span { font-size: clamp(10px, 1.2cqw, 14px); font-weight: 700; color: #fff; text-shadow: 0 1px 0 var(--encre), 0 0 4px var(--encre); white-space: nowrap; }
.commentaire { display: grid; place-items: center; min-height: 3.3em; margin: 0; padding: 6px 16px; font-size: clamp(13px, 1.7cqw, 19px); line-height: 1.3; font-weight: 700; text-align: center; color: var(--papier); background: var(--encre); border-top: 4px solid #000; }
.commentaire.critique, .commentaire.blessure { color: #ffb3a8; }
.commentaire.evenement, .commentaire.arme, .commentaire.effet { color: var(--jaune); }
.commentaire.fin { color: var(--jaune); font-family: var(--titre); font-weight: 400; }
.bandeau, .annonce { position: absolute; left: 50%; top: 17%; transform: translate(-50%, -30%) scale(.9); opacity: 0; transition: opacity .16s, transform .16s; pointer-events: none; text-align: center; }
.bandeau.visible, .annonce.visible { opacity: 1; transform: translate(-50%, 0) scale(1); }
.bandeau { display: grid; gap: .2cqw; padding: .8cqw 2.4cqw 1cqw; background: var(--jaune); color: var(--encre); border: .35cqw solid var(--encre); border-radius: 1.4cqw; box-shadow: 0 .5cqw 0 var(--encre); rotate: -2deg; }
.bandeau b { font-family: var(--titre); font-weight: 400; font-size: clamp(15px, 2.6cqw, 32px); }
.bandeau span { font-size: clamp(11px, 1.4cqw, 17px); font-weight: 700; }
.annonce { top: 24%; padding: .5cqw 2.2cqw .7cqw; font-family: var(--titre); font-size: clamp(16px, 3.2cqw, 42px); color: #fff; background: var(--a); border: .35cqw solid var(--encre); border-radius: 1.4cqw; box-shadow: 0 .5cqw 0 var(--encre); rotate: -3deg; white-space: nowrap; }
.annonce.b { background: var(--b); rotate: 3deg; }
.scene.vide .hud { display: none; }
.issue { margin-top: 12px; padding: 12px 18px 8px; background: var(--papier); color: var(--encre); border: 4px solid var(--encre); border-radius: 18px; box-shadow: 0 6px 0 #000; display: grid; grid-template-columns: auto 1fr; gap: 0 18px; align-items: baseline; }
.issue .bilan { grid-column: 1 / -1; }
.issue h3 { margin: 0; font-size: 30px; }
.issue h3.defaite { color: var(--alerte); }
.issue p { margin: 2px 0 10px; color: var(--doux); font-size: 14px; }
.bilan { margin: 0 0 12px; padding: 0; list-style: none; text-align: left; }
.bilan li { padding: 5px 10px; margin: 4px 0; border-left: 6px solid #d9c9a0; background: var(--papier2); border-radius: 6px; font-size: 15px; }
.bilan .niveau, .bilan .art { border-color: var(--a); font-weight: 700; }
.bilan .arme { border-color: var(--b); font-weight: 700; }
.bilan .repos { border-color: var(--alerte); }

.commandes { display: flex; gap: 12px 14px; flex-wrap: wrap; align-items: center; margin: 18px 0 6px; }
.commandes label { font-size: 14px; color: #cdbfe6; display: flex; gap: 8px; align-items: center; }
.commandes input { width: 120px; }
.vitesses { display: flex; }
.vitesses button { border-radius: 0; margin-left: -3px; padding: 8px 12px; }
.vitesses button:first-child { border-radius: 12px 0 0 12px; margin-left: 0; }
.vitesses button:last-child { border-radius: 0 12px 12px 0; }
.vitesses button[aria-pressed="true"] { background: var(--encre); color: var(--jaune); }

/* Fiches */
.fiches { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 16px; }
.carte, .creation, .journal-bloc { background: var(--papier); color: var(--encre); border: 4px solid var(--encre); border-radius: 18px; box-shadow: 0 6px 0 #000; padding: 14px 16px; min-width: 0; }
.carte.a { border-top: 12px solid var(--a); }
.carte.b { border-top: 12px solid var(--b); }
.entete { display: flex; gap: 12px; align-items: center; }
.entete .portrait { width: 84px; height: 84px; flex: none; border-radius: 16px; border: 3px solid var(--encre); background: var(--a); }
.carte.b .entete .portrait { background: var(--b); }
.entete > div { flex: 1; min-width: 0; }
.role { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--doux); }
.nom { display: flex; gap: 8px; flex-wrap: wrap; }
.nom input { flex: 1 1 170px; min-width: 0; font-weight: 700; }
.nom strong { flex: 1 1 170px; font-family: var(--titre); font-weight: 400; font-size: 22px; align-self: center; }
.erreur { color: var(--alerte); font-size: 14px; min-height: 20px; margin: 4px 0 0; }
.identite { margin: 0 0 10px; color: var(--doux); font-size: 14px; }
.jauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.jauges div { border-radius: 10px; padding: 4px 8px; color: #fff; font-size: 13px; font-weight: 700; }
.jauges b { display: block; font-family: var(--titre); font-weight: 400; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.jauges .vit { background: var(--vit); } .jauges .souffle { background: #2c78c4; } .jauges .moral { background: #9a6b00; }
.xp { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; margin: 8px 0; }
.xp div { height: 12px; background: #e3d6b8; border: 2px solid var(--encre); border-radius: 8px; overflow: hidden; }
.xp i { display: block; height: 100%; background: var(--a); }
.grille { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; margin: 10px 0; }
.grille div { border: 2px solid var(--encre); border-radius: 9px; padding: 3px 2px; text-align: center; background: #fff; }
.grille b { display: block; font-size: 18px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.grille small { color: var(--doux); font-size: 11px; font-weight: 700; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 8px 0 0; font-size: 14px; }
dt { color: var(--doux); font-weight: 700; } dd { margin: 0; }
.pied-carte { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
summary { cursor: pointer; font-family: var(--titre); font-size: 18px; }
.journal-bloc { margin-top: 18px; }
.journal { max-height: 340px; overflow-y: auto; margin-top: 8px; }
.journal p { margin: 3px 0; font-size: 15px; }
.journal .n { display: inline-block; min-width: 34px; color: var(--doux); font-variant-numeric: tabular-nums; }
.journal .critique, .journal .blessure { font-weight: 700; color: var(--alerte); }
.journal .evenement, .journal .arme, .journal .effet { color: #7a4b00; font-weight: 700; }
.journal .fin { font-weight: 700; }
.journal .rate, .journal .garde, .journal .feinte, .journal .deplacement, .journal .perdu, .journal .saignement, .vide { color: var(--doux); }
.bas { margin: 26px 0 8px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; color: #cdbfe6; font-size: 14px; }

/* Création */
.creation { margin-top: 18px; border-top: 12px solid var(--a); display: grid; grid-template-columns: 1fr 240px; gap: 6px 20px; align-items: start; }
.creation h2 { margin: 0 0 4px; color: var(--encre); grid-column: 1 / -1; }
.creation .etapes { min-width: 0; }
.apercu { position: sticky; top: 12px; border: 3px solid var(--encre); border-radius: 16px; background: linear-gradient(#cdb8f2, #f6e6c2 78%, #b9a57c 78%); overflow: hidden; }
.apercu svg { display: block; width: 100%; height: auto; }
.apercu p { margin: 0; padding: 6px 10px; font-size: 13px; font-weight: 700; text-align: center; background: var(--encre); color: var(--papier); }
.etape { border-top: 2px solid #e3d2a6; padding: 10px 0; }
.etape h3 { margin: 0 0 4px; font-size: 18px; }
.etape p { margin: 4px 0; }
.lignees { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.lignees button { display: grid; grid-template-columns: 62px 1fr; gap: 2px 10px; align-items: start; align-content: start; text-align: left; font-weight: 400; min-width: 0; padding: 8px 10px; }
.lignees .portrait { width: 62px; height: 62px; grid-row: span 3; border-radius: 12px; border: 3px solid var(--encre); background: #d9c8f5; }
.lignees strong { font-family: var(--titre); font-weight: 400; font-size: 18px; }
.lignees small { color: var(--doux); font-size: 12.5px; line-height: 1.25; }
.lignees button.destin { background: var(--encre); color: var(--papier); grid-template-columns: 1fr; }
.lignees button.destin small { color: #e6def5; }
.tirage { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tirage th, .tirage td { border: 1px solid #d9c9a0; padding: 4px 6px; text-align: center; }
.tirage th:first-child, .tirage td:first-child { text-align: left; font-weight: 700; }
.tirage td:last-child { font-weight: 700; background: #fff; }
.table-defilante { overflow-x: auto; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
[hidden] { display: none !important; }
@media (max-width: 900px) { .ecurie { grid-template-columns: repeat(3, 1fr); } .grille { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 720px) { .fiches { grid-template-columns: 1fr; } .creation { grid-template-columns: 1fr; } .apercu { position: static; max-width: 220px; justify-self: center; grid-row: 2; } .scene { border-radius: 12px; } }
@container (max-width: 560px) { .hud-sous, .hud-legende, .hud-vie b { display: none; } .hud-centre span { display: none; } }
@media (prefers-reduced-motion: reduce) { .bandeau, .annonce, button { transition: none; } }

/* Barre d'outils : joueurs en ligne, compte, son */
.tete { align-items: center; }
.tete > p { flex-basis: 100%; }
.outils { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.outils button { min-height: 40px; padding: 4px 12px; font-size: 14px; }
.outils button[aria-pressed="false"] { background: var(--nuit2); color: #a99cc4; text-decoration: line-through; }
.volume { display: flex; gap: 6px; align-items: center; font-size: 13px; color: #cdbfe6; }
.volume input { width: 90px; min-height: 0; padding: 0; border: 0; background: none; accent-color: var(--jaune); }
.enligne { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 20px; background: var(--nuit2); border: 2px solid #000; font-size: 14px; font-weight: 700; color: #c9f2d9; }
.enligne::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #35d68a; box-shadow: 0 0 0 3px rgba(53, 214, 138, .25); }
.avis { margin: 0 0 12px; padding: 10px 14px; border: 3px solid var(--encre); border-radius: 12px; background: #ffe2a8; color: #4d3200; font-weight: 700; }
.avis.erreur { background: #ffc9c2; color: #6d140d; min-height: 0; }
#duel.recherche { background: var(--encre); color: var(--jaune); }
.bas a { color: var(--jaune); }

/* Fenêtre du compte */
dialog.compte { width: min(94vw, 520px); max-height: 92vh; padding: 0; border: 4px solid var(--encre); border-radius: 18px; background: var(--papier); color: var(--encre); box-shadow: 0 8px 0 #000; }
dialog.compte::backdrop { background: rgba(27, 19, 48, .78); }
.compte-tete { display: flex; align-items: center; gap: 10px; padding: 14px 18px 0; }
.compte-tete h2 { flex: 1; margin: 0; color: var(--encre); font-size: 24px; }
.compte-tete button { min-height: 40px; padding: 4px 12px; }
.compte-corps { padding: 6px 18px 18px; }
.compte form, .compte section { display: grid; gap: 10px; padding: 12px 0; border-top: 2px solid #e3d2a6; }
.compte form:first-child, .compte section:first-child { border-top: 0; }
.compte h3 { margin: 0; font-size: 18px; }
.compte label { display: grid; gap: 3px; font-size: 14px; font-weight: 700; }
.compte label.case { grid-template-columns: 24px 1fr; align-items: start; gap: 8px; font-weight: 400; }
.compte label.case input { min-height: 0; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--a); }
.compte input:not([type="checkbox"]) { width: 100%; }
.compte small, .compte p { margin: 0; font-size: 13.5px; color: var(--doux); }
.compte a { color: #5b2bb0; }
.compte .message { min-height: 20px; font-weight: 700; color: var(--alerte); }
.compte .message.bon { color: #0c6b45; }
.compte .liens { display: flex; gap: 14px; flex-wrap: wrap; }
.compte .liens button, .compte button.lien { min-height: 0; padding: 0; border: 0; box-shadow: none; background: none; color: #5b2bb0; text-decoration: underline; font-weight: 700; }
.compte button.danger { background: #ffc9c2; }
