/* Combat explanations: native buttons retain keyboard and screen-reader access. */
body #fight-hud .fight-vital{position:relative;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:3px;height:auto;min-height:37px;padding:4px 7px 7px;font-size:11.5px;min-width:90px;border-radius:7px}
body #fight-hud .vital-label{font-size:11.5px;font-weight:700;width:100%;text-align:center;line-height:1.1}
body #fight-hud .fight-vital>img{width:14px;height:14px}
body #fight-hud .fight-vital>b{font-size:12px;font-weight:800;line-height:1.2;white-space:nowrap;color:inherit;text-shadow:none}
body #fight-hud .fight-vital.mana{cursor:pointer;color:var(--theme-mana-ink,#1c5d87)!important;background:var(--theme-mana-bg,#d4e3e8)!important;border:1px solid var(--theme-chrome-line,#b78a3d)}
body #fight-hud .fight-vital.health{color:var(--theme-hp-ink,#963c23)!important;background:var(--theme-hp-bg,#f7d7b0)!important}
body #cast-action{position:relative;padding-right:62px!important;min-height:28px}
body #cast-action.has-selected-spell #cast-info{display:flex!important;flex-wrap:wrap;justify-content:center;gap:4px 9px;font-size:11.5px}
body #cast-action .combat-help-button{position:absolute;right:0;top:0;bottom:auto;padding:5px 8px;font-size:11.5px;color:var(--theme-chrome-text,#fff0be);background:var(--theme-chrome-2,#44371d);border:1px solid var(--theme-chrome-line,#b78a3d)}:where(html[data-theme="nuit"]) body #cast-action .combat-help-button{background:var(--theme-chrome-2,#222d3f)}
body #cast-action #cast-self{position:static!important;margin:4px 0 0}
.combat-glossary{display:flex;flex-wrap:wrap;gap:7px 14px;padding:9px 0;font-size:11.5px;line-height:1.5;color:var(--theme-muted,#654824)}
.combat-glossary button,.loadout-editor [data-combat-help],#prepare-dialog [data-combat-help]{font-size:11.5px}
#prepare-dialog .prepare-opponent{margin:5px 0 12px;font-size:12px;color:var(--theme-muted,#654824)}
#prepare-dialog .prepare-resources{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:14px;align-items:stretch}
#prepare-dialog .prepare-resources>span,#prepare-dialog .prepare-resources>button{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:4px;padding:10px;border-radius:8px;font-size:12px;border:1px solid var(--theme-border,#b68742);background:var(--theme-paper-deep,#dfbd78);color:var(--theme-ink,#392711)}
#prepare-dialog .prepare-resources small{width:100%;font-size:11.5px;color:var(--theme-muted,#654824)}
#prepare-dialog .prepare-loadout-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
#prepare-dialog .prepare-loadout-heading h3{font-size:14px;margin:0}
#prepare-dialog .prepare-loadout-heading button{font-size:11.5px}
#prepare-dialog .prepared-list{margin:0 0 12px;display:grid;grid-template-columns:1fr 1fr;gap:8px}
#prepare-dialog .prepared-list>div{min-width:0;padding:9px}
#prepare-dialog .prepared-list small{font-size:11.5px;line-height:1.4}
#prepare-dialog .prepare-controls{padding-left:22px;margin:10px 0;font-size:12px;line-height:1.6;color:var(--theme-ink,#392711)}
#prepare-dialog .prepare-controls li+li{margin-top:5px}
#prepare-dialog .basic-attack-note{font-size:11.5px;line-height:1.5}
:is(#combat-ui,#prepare-dialog) [data-combat-help]:focus-visible{outline:3px solid var(--theme-gold,#ffd468);outline-offset:3px}
@media(max-width:470px){body #fight-hud{gap:6px!important}body #fight-status{max-width:55px!important;font-size:11.5px!important}body #fight-hud .fight-vital{min-width:72px;padding:4px 4px 7px}body #fight-resources{gap:4px!important}body #fight-enemies{font-size:11.5px!important}#prepare-dialog .prepare-resources{gap:6px}#prepare-dialog .prepare-resources>span,#prepare-dialog .prepare-resources>button{font-size:11.5px;padding:8px}#prepare-dialog .prepared-list{grid-template-columns:1fr}#prepare-dialog .prepare-loadout-heading{align-items:flex-start}body #cast-action{padding-right:52px!important}}
/* Action hierarchy remains explicit after theme button overrides. */
body #prepare-dialog .prepare-resources>button[data-combat-help="mana"]{background:var(--theme-mana-bg,#d4e3e8)!important;color:var(--theme-mana-ink,#1c5d87)!important;border-color:var(--theme-border,#b68742)!important}
body #prepare-dialog .prepare-resources>button[data-combat-help="mana"] small{color:var(--theme-mana-ink,#1c5d87)!important}
body #prepare-dialog #confirm-prepare{background:var(--theme-accent,#477316)!important;color:var(--theme-accent-text,#fff7dc)!important;border-color:var(--theme-accent,#477316)!important;font-weight:700}
body #prepare-dialog :is(#change-prepare,.prepare-actions [data-combat-help]){background:var(--theme-card,#fff0c7)!important;color:var(--theme-ink,#392711)!important;border:1px solid var(--theme-border,#b68742)!important}

body #cast-action #cast-cancel{position:static;min-height:32px;padding:4px 9px;border:1px solid var(--theme-chrome-line);border-radius:7px;color:var(--theme-chrome-text);background:var(--theme-chrome-2);font-size:11.5px;flex-shrink:0}body #cast-cancel[hidden]{display:none!important}body #combat-ui .monster-tag.auto-target{border-color:var(--theme-gold,#ffd468)!important;box-shadow:0 0 0 1px var(--theme-gold,#ffd468),0 3px 12px #0006}body #combat-ui .monster-tag.auto-target small{color:var(--theme-chrome-text,#fff0bd)!important}

/* Compact solo preparation keeps the decision and four shortcuts above the fold. */
body #prepare-dialog{width:min(480px,calc(100vw - 24px));max-height:min(650px,calc(100dvh - 32px));padding:18px;border-radius:14px;box-sizing:border-box}
body #prepare-dialog header{gap:12px}body #prepare-dialog h2{font-size:22px}body #prepare-dialog header>button{width:36px;min-height:36px;padding:5px;flex-shrink:0}
body #prepare-dialog .prepare-opponent{margin:7px 0 10px;font-size:12px;line-height:1.45}
body #prepare-dialog .prepare-essential{display:flex;gap:14px;align-items:center;margin:0 0 15px;color:var(--theme-ink,#392711);font-size:12px}
body #prepare-dialog .prepare-essential>span{display:flex;align-items:center;gap:5px;font-weight:700}body #prepare-dialog .prepare-essential img{width:17px;height:17px;object-fit:contain}
body #prepare-dialog .prepare-loadout-heading{align-items:center;margin-bottom:9px}body #prepare-dialog .prepare-loadout-heading h3{font-size:12px}body #prepare-dialog #change-prepare{min-height:34px;padding:5px 9px;font-size:11.5px}
body #prepare-dialog .prepared-list.compact-loadout{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;margin-bottom:14px}
body #prepare-dialog .compact-loadout>div{position:relative;min-width:0;min-height:110px;padding:10px 5px 7px;gap:5px;border-radius:9px;background:var(--theme-card,#fff0c7);border:1px solid var(--theme-border,#b68742);color:var(--theme-ink,#392711);box-sizing:border-box}
body #prepare-dialog .compact-loadout>div>img{width:34px;height:34px;object-fit:contain}body #prepare-dialog .compact-loadout strong{font-size:11.5px;line-height:1.25;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;min-height:29px;text-align:center}
body #prepare-dialog .compact-loadout small{font-size:11.5px;color:var(--theme-muted,#654824);line-height:1.2}
body #prepare-dialog .prepared-key{position:absolute;top:3px;left:5px;font-size:11.5px;color:var(--theme-muted,#654824)}body #prepare-dialog .empty-symbol{height:63px;display:flex;align-items:center;font-size:24px;color:var(--theme-muted,#654824)}
body #prepare-dialog .prepared-empty{border-style:dashed;opacity:.7}body #prepare-dialog .prepare-actions{margin:0;display:flex}body #prepare-dialog #confirm-prepare{width:100%;min-height:42px;font-size:13px;border-radius:8px}
body #prepare-dialog .prepare-more{margin-top:13px;padding-top:10px;border-top:1px solid var(--theme-border,#b68742)}body #prepare-dialog .prepare-more>summary{cursor:pointer;font-size:12px;font-weight:600;color:var(--theme-muted,#654824);min-height:22px}
body #prepare-dialog .prepare-more p{font-size:11.5px;line-height:1.5}body #prepare-dialog .prepare-help-actions{display:flex;flex-wrap:wrap;gap:7px}body #prepare-dialog .prepare-help-actions>button{font-size:11.5px;min-height:34px;padding:5px 9px}
@media(max-width:420px){body #prepare-dialog{padding:14px}body #prepare-dialog h2{font-size:20px}body #prepare-dialog .prepared-list.compact-loadout{gap:5px}body #prepare-dialog .compact-loadout>div{padding-left:3px;padding-right:3px}body #prepare-dialog .compact-loadout>div>img{width:31px;height:31px}}

/* Plaques de combat (15/10/2026) : nom, barre de vie, PV ; rouge = ennemi, bleu = allié, or = toi. Lisibles sur tous les thèmes. */
html body .monster-tag.in-fight.fight-plate{transform:translate(-50%,-100%)!important;padding:3px 8px 4px!important;min-width:84px;min-height:0!important;border-radius:6px!important;background:#1b130ed0!important;border:1px solid #d0584a!important;box-shadow:0 2px 6px #0009!important;text-align:center;line-height:1.1!important;white-space:nowrap;transition:none!important}html:where([data-theme="nuit"]) body .monster-tag.in-fight.fight-plate{background:#0f131ad0!important}
html body .monster-tag.in-fight.fight-plate[hidden]{display:none!important}
html body .monster-tag.in-fight.fight-plate>b{display:block!important;font:700 12px/1.2 var(--font-ui,system-ui,sans-serif)!important;color:#fff4de!important;max-width:160px;overflow:hidden;text-overflow:ellipsis;text-shadow:0 1px 1px #000;margin:0 0 2px!important}
html body .monster-tag.in-fight.fight-plate>.fp-bar{display:block;height:7px;min-width:70px;border-radius:4px;background:#000a;box-shadow:inset 0 0 0 1px #000c;overflow:hidden}
html body .monster-tag.in-fight.fight-plate>.fp-bar>i{display:block;height:100%;border-radius:4px;background:linear-gradient(#8ee985,#3c9a39);transition:width .25s}
html body .monster-tag.in-fight.fight-plate[data-hp=mid]>.fp-bar>i{background:linear-gradient(#ffd863,#c58f1c)}
html body .monster-tag.in-fight.fight-plate[data-hp=low]>.fp-bar>i{background:linear-gradient(#ff8068,#b42c25)}
html body .monster-tag.in-fight.fight-plate>small{display:block!important;font:700 10.5px/1.15 var(--font-ui,system-ui,sans-serif)!important;color:#f3e3c4!important;margin:2px 0 0!important;opacity:1!important}
html body .monster-tag.in-fight.fight-plate.ally{border-color:#5aa6e6!important;cursor:default}
html body .monster-tag.in-fight.fight-plate.self{border-color:#e9c45c!important}
html body .monster-tag.in-fight.fight-plate.auto-target{border-color:var(--theme-gold,#ffd468)!important;box-shadow:0 0 0 1px var(--theme-gold,#ffd468),0 3px 10px #000a!important;background:#3a1a12ee!important}html:where([data-theme="nuit"]) body .monster-tag.in-fight.fight-plate.auto-target{background:#192333ee!important}
html body .monster-tag.in-fight.fight-plate.valid-target{border-color:#9fe6a0!important;box-shadow:0 0 0 1px #9fe6a0,0 3px 10px #000a!important}
@media (max-width:700px){html body .monster-tag.in-fight.fight-plate{min-width:64px;padding:2px 6px 3px!important}html body .monster-tag.in-fight.fight-plate>b{font-size:11px!important;max-width:110px}html body .monster-tag.in-fight.fight-plate>small{font-size:9.5px!important}}

/* Combat chargé (15/10/2026) : plaques compactes au-delà de 8 combattants ; doublons des étiquettes de nom masqués en combat */
html body #combat-effects.fp-compact .monster-tag.in-fight.fight-plate{min-width:58px;padding:1px 5px 2px!important;border-radius:5px!important;background:#1b130eb8!important}html:where([data-theme="nuit"]) body #combat-effects.fp-compact .monster-tag.in-fight.fight-plate{background:#0f131ab8!important}
html body #combat-effects.fp-compact .monster-tag.in-fight.fight-plate>b{font-size:10.5px!important;max-width:96px;margin:0 0 1px!important}
html body #combat-effects.fp-compact .monster-tag.in-fight.fight-plate>.fp-bar{height:4px;min-width:52px}
html body #combat-effects.fp-compact .monster-tag.in-fight.fight-plate>small{display:none!important}
html body #combat-effects.fp-compact .monster-tag.in-fight.fight-plate:is(.self,.auto-target,[data-hp=low],:hover)>small{display:block!important;font-size:9.5px!important}
html body #combat-effects.fp-compact .monster-tag.in-fight.fight-plate:hover{z-index:5}
/* étiquettes de nom des combattants de ton combat : remplacées par les plaques */
body.in-battle .remote-player-label.my-fight{display:none!important}

/* Ligne de vue (15/10/2026) : ennemi hors de vue pendant la visée d'un sort */
html body .monster-tag.in-fight.fight-plate.no-sight{border-style:dashed!important;opacity:.6}
html body .monster-tag.in-fight.fight-plate.no-sight>b::after{content:" · hors de vue";font-weight:600;font-size:.85em;color:#d9b8ff}

/* Plaques compactes (15/10/2026, dès 4 combattants) : une barre de vie fine au-dessus de la tête ; nom et PV chiffrés seulement pour la cible,
   toi, un monstre blessé ou au survol — les monstres restent visibles et chacun garde sa barre juste au-dessus de lui. */
html body #combat-effects.fp-compact .monster-tag.in-fight.fight-plate{min-width:0!important;padding:2px 3px!important;border-radius:4px!important;background:#1b130e99!important;box-shadow:0 1px 3px #0007!important}html:where([data-theme="nuit"]) body #combat-effects.fp-compact .monster-tag.in-fight.fight-plate{background:#0f131a99!important}
html body #combat-effects.fp-compact .monster-tag.in-fight.fight-plate>b{display:none!important}
html body #combat-effects.fp-compact .monster-tag.in-fight.fight-plate>.fp-bar{height:5px;min-width:46px;width:46px}
html body #combat-effects.fp-compact .monster-tag.in-fight.fight-plate>small{display:none!important}
html body #combat-effects.fp-compact .monster-tag.in-fight.fight-plate:is(.auto-target,.valid-target,:hover){padding:2px 6px 3px!important;background:#1b130ee0!important;z-index:5}html:where([data-theme="nuit"]) body #combat-effects.fp-compact .monster-tag.in-fight.fight-plate:is(.auto-target,.valid-target,:hover){background:#0f131ae0!important}
html body #combat-effects.fp-compact .monster-tag.in-fight.fight-plate:is(.auto-target,.valid-target,:hover)>b{display:block!important;font-size:11px!important;max-width:120px;margin:0 0 1px!important}
html body #combat-effects.fp-compact .monster-tag.in-fight.fight-plate:is(.auto-target,.self,:hover,[data-hp=low])>small{display:block!important;font-size:9.5px!important;margin:1px 0 0!important}
