/* Mode combat du joueur (chantier « Combat et mouvements », 23/11/2026) : bouton « Combat », boutons poing, pied, saut,
   garde, bouton « Courir » (écran tactile), barres de vie et d'endurance, K.-O. Voir jeu/combat/mode-combat.mjs. */
#v2-combat{position:fixed;z-index:58;right:calc(env(safe-area-inset-right) + 14px);bottom:calc(env(safe-area-inset-bottom) + 16px);
 width:206px;height:140px;pointer-events:none;font:700 12px/1 system-ui,sans-serif}
#v2-combat[hidden],#v2-combat-touches[hidden],#v2-courir[hidden],#v2-sauter[hidden],#v2-combat-jauges[hidden],#v2-ko[hidden]{display:none!important}
#v2-combat button{position:absolute;pointer-events:auto;display:grid;place-items:center;padding:0;border-radius:50%;
 border:2px solid #fff9;background:#1d2733cc;color:#fff;box-shadow:0 4px 14px #0006;touch-action:none;user-select:none;
 -webkit-user-select:none;-webkit-tap-highlight-color:transparent;font:inherit;letter-spacing:.02em}
#v2-combat button:active,#v2-combat button.tenu{transform:scale(.93);background:#f2b705;color:#1d1a10;border-color:#fff}
#v2-combat button:disabled{opacity:.45}
#v2-combat #v2-combat-bascule{right:0;bottom:0;width:62px;height:62px;background:#8f1d1dd9}
/* En combat : « Quitter », petit, à gauche des gestes (au-dessus d'eux, il recouvrait l'invite « Entrer… » du jeu). */
#v2-combat #v2-combat-bascule[aria-pressed="true"]{right:144px;bottom:62px;width:46px;height:46px;font-size:10px;background:#3a4452d9}
#v2-combat-touches{position:absolute;inset:0;pointer-events:none}
#v2-combat-touches [data-geste="poing"]{right:0;bottom:0;width:72px;height:72px;font-size:14px;background:#a82323e6}
#v2-combat-touches [data-geste="pied"]{right:80px;bottom:0;width:60px;height:60px;background:#a84a23e0}
#v2-combat-touches [data-geste="saut"]{right:6px;bottom:78px;width:56px;height:56px;background:#23558fe0}
#v2-combat-touches [data-geste="garde"]{right:74px;bottom:68px;width:56px;height:56px;background:#2f6b4ae0}
#v2-combat #v2-courir{right:70px;bottom:2px;width:56px;height:56px;background:#23558fd9}
#v2-combat.en-combat #v2-courir{right:148px;bottom:2px;width:52px;height:52px;font-size:11px}
/* Saut qui franchit : « Sauter » n'apparaît, hors combat, que devant un obstacle bas ; en combat, « Saut » s'allume. */
#v2-combat #v2-sauter{right:4px;bottom:72px;width:58px;height:58px;background:#f2b705;color:#1d1a10;border-color:#fff;animation:combat-franchir 1s ease-in-out infinite alternate}
#v2-combat-touches [data-geste="saut"].franchir{background:#f2b705;color:#1d1a10;border-color:#fff}
@keyframes combat-franchir{from{box-shadow:0 4px 14px #0006}to{box-shadow:0 0 0 6px #f2b70555,0 4px 14px #0006}}
#v2-combat-jauges{position:fixed;z-index:58;left:calc(50% + 18px);top:calc(env(safe-area-inset-top) + 12px);transform:translateX(-50%);
 display:grid;gap:5px;width:min(220px,34vw);pointer-events:none}
#v2-combat-jauges div{height:9px;border-radius:6px;background:#0b0f14a6;border:1px solid #fff6;overflow:hidden}
#v2-combat-jauges i{display:block;height:100%;width:100%;border-radius:5px;transition:width .12s linear}
#v2-combat-jauges .vie i{background:linear-gradient(#ff6a5c,#c81e1e)}
#v2-combat-jauges .vie.bas{animation:combat-alerte .6s steps(2,start) infinite}
#v2-combat-jauges .endurance{height:7px}
#v2-combat-jauges .endurance i{background:linear-gradient(#ffe27a,#e0a100)}
#v2-combat-jauges .endurance.vide{animation:combat-alerte .4s steps(2,start) 4}
@keyframes combat-alerte{to{border-color:#ff4d3d;box-shadow:0 0 0 2px #ff4d3d88}}
/* K.-O. : bords assombris, le bas de l'écran reste visible (on voit le personnage tomber et rester à terre). */
#v2-ko{position:fixed;inset:0;z-index:59;display:grid;place-items:start center;padding-top:14vh;box-sizing:border-box;
 background:radial-gradient(ellipse 80% 62% at 50% 68%,#0000 0 40%,#000c 100%);color:#fff;text-shadow:0 4px 26px #000,0 0 6px #000;
 font:900 clamp(40px,12vw,96px)/1 system-ui,sans-serif;letter-spacing:.08em;pointer-events:none;animation:combat-ko .5s ease-out}
@keyframes combat-ko{from{opacity:0}to{opacity:1}}
@media (max-height:430px){#v2-combat{transform:scale(.88);transform-origin:bottom right}}
@media (prefers-reduced-motion:reduce){#v2-combat-jauges .vie.bas,#v2-combat-jauges .endurance.vide,#v2-ko{animation:none}}
