/* ======================= COMBAT TACTIQUE ======================= */
/* Le plateau montre OÙ ; la frise et la fiche montrent QUI et QUOI.
   Globes, XP et barre d'action restent en bas, à leur place habituelle. */

#combat-view { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px 8px; overflow: hidden; }

.tac-top { display: flex; align-items: center; gap: 14px; flex-shrink: 0; min-height: 66px; }

.tac-timeline { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; padding: 3px 2px; }
.tl-sep { color: var(--text-dim); font-size: 0.8rem; }

.tl-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: 66px;
    padding: 5px 4px 4px;
    background: linear-gradient(180deg, rgba(29, 29, 26, 0.9), rgba(12, 12, 9, 0.92));
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    color: inherit;
    cursor: pointer;
    transition: border-color var(--speed), transform var(--speed), opacity var(--speed);
}

.tl-unit.team-hero { border-color: rgba(79, 212, 138, 0.4); }
.tl-unit.team-enemy { border-color: rgba(214, 64, 78, 0.35); }
.tl-unit.focus { border-color: var(--text-soft); }

/* Un sort est armé : les monstres de la frise deviennent des cibles cliquables. */
.tac-timeline.aiming .tl-unit.team-enemy { cursor: crosshair; }
.tac-timeline.aiming .tl-unit.team-enemy:hover {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold), 0 0 12px rgba(217, 164, 65, 0.45);
}
.tl-unit.active { border-color: var(--gold-lit); box-shadow: 0 0 16px rgba(201, 171, 69, 0.4); transform: translateY(-2px); }
.tl-unit.dead { opacity: 0.32; filter: grayscale(1); }

.tl-avatar { width: 36px; height: 34px; display: grid; place-items: center; overflow: hidden; }
.tl-img { height: 64px; width: auto; align-self: start; margin-top: 2px; }
.tl-emoji { font-size: 1.5rem; line-height: 1; }

.tl-bars { position: relative; width: 100%; height: 5px; background: #090906; border-radius: 3px; overflow: hidden; }
.tl-hp { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #7d1b25, #ff3b5c); transition: width 0.3s ease; }
.tl-unit.team-hero .tl-hp { background: linear-gradient(90deg, #1f7a4a, var(--verdant)); }
.tl-armor { position: absolute; left: 0; top: 0; height: 2px; background: #c9d5ec; z-index: 1; }

.tl-hp-text { font-size: 0.66rem; line-height: 1; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.tl-intent { font-size: 0.68rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Le tour en cours, sur une pastille : c'est la première chose à savoir. */
.turn-status {
    padding: 7px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(12, 12, 9, 0.75);
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--gold-lit);
    white-space: nowrap;
}

.tac-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 12px; }
.tac-board { position: relative; min-width: 0; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.tac-scene { position: relative; flex-shrink: 0; }

/* ---------- Cases ----------
   Le fond de la case dessine le liseré, le ::before la face : les
   surlignages ne changent que la variable --face. */
.tac-cell {
    --face: var(--tile-face);
    position: absolute;
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

/* Pas de transition : un surlignage suit la souris instantanément. Un fondu
   traînait derrière le curseur, et des changements rapprochés (déplacement
   puis visée) pouvaient laisser des cases à mi-chemin. */
.tac-cell::before {
    content: '';
    position: absolute;
    inset: 1px 2px;
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    background: var(--face);
}

.tac-cell.v1 { --face: var(--tile-face-alt); }
.tac-cell.v2 { --face: color-mix(in srgb, var(--tile-face) 88%, #000); }
.tac-cell:hover { --face: color-mix(in srgb, var(--world-accent) 16%, var(--tile-face)); }
.tac-cell.hole { --face: radial-gradient(ellipse at 50% 55%, #000 35%, #11110e 80%); cursor: default; }
.tac-cell.under-block { --face: var(--tile-wall); }

.tac-cell.ov-reach { --face: color-mix(in srgb, var(--verdant) 17%, var(--tile-face)); }
.tac-cell.ov-threat { --face: color-mix(in srgb, var(--blood) 24%, var(--tile-face)); }
.tac-cell.ov-reach.ov-threat { --face: color-mix(in srgb, #e0913a 30%, var(--tile-face)); }
.tac-cell.ov-path { --face: color-mix(in srgb, var(--verdant) 50%, var(--tile-face)); }
.tac-cell.ov-range { --face: color-mix(in srgb, #3f8cff 32%, var(--tile-face)); }
.tac-cell.ov-blocked { --face: color-mix(in srgb, #3f8cff 9%, #0b0b08); }
.tac-cell.ov-zone { --face: color-mix(in srgb, var(--ember) 55%, var(--tile-face)); }
.tac-cell.ov-target { --face: color-mix(in srgb, var(--gold) 72%, var(--tile-face)); }

/*
 * Départs offerts, pendant le placement d'ouverture. Assez francs pour qu'on
 * les compte d'un coup d'œil, et qui respirent pour dire qu'on attend un geste.
 */
.tac-cell.ov-start {
    --face: color-mix(in srgb, var(--verdant) 34%, var(--tile-face));
    animation: startBeat 1.8s ease-in-out infinite;
    will-change: opacity;
}

@keyframes startBeat { 0%, 100% { opacity: 1; } 50% { opacity: 0.62; } }

@media (prefers-reduced-motion: reduce) { .tac-cell.ov-start { animation: none; } }

/* Barre d'action réduite au seul bouton d'engagement pendant le placement. */
.action-bar.combat.placing { justify-content: center; }
.act-btn.engage { --rar: var(--gold); min-width: 190px; color: var(--gold-lit); }
.tac-cell.fx-cast::before { animation: cellFlash 0.35s ease; }

/* ---------- Piliers : deux faces latérales et un chapeau éclairé ---------- */
/* Peints par la feuille de style, comme le sol et les murs : une illustration
   de pierre jurait avec un plateau qui, lui, reste géométrique. */
.tac-block {
    position: absolute;
    pointer-events: none;
    background: linear-gradient(90deg, #454b61 0%, #30354a 50%, #232320 50%, #171714 100%);
}

.tac-block::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: var(--th);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    background: linear-gradient(135deg, #6a7089, #3c4156);
}

/* ---------- Figurines ---------- */
/* Les figurines se placent instantanément et ne glissent que pendant une
   marche : un recalage du plateau ne doit jamais les laisser à mi-chemin. */
.tac-unit { position: absolute; width: 0; height: 0; transition: opacity 0.35s ease; }
.tac-unit.walking { transition: left 0.115s linear, top 0.115s linear, opacity 0.35s ease; }

.tac-shadow {
    position: absolute;
    left: calc(var(--tw) * -0.3);
    top: calc(var(--th) * -0.24);
    width: calc(var(--tw) * 0.6);
    height: calc(var(--th) * 0.48);
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.65), transparent 72%);
    border: 2px solid transparent;
    pointer-events: none;
}

.tac-unit.team-hero .tac-shadow { border-color: rgba(79, 212, 138, 0.75); }
.tac-unit.team-enemy .tac-shadow { border-color: rgba(255, 59, 92, 0.6); }
.tac-unit.active .tac-shadow { animation: ringPulse 1.1s ease-in-out infinite; }

.tac-figure { position: absolute; left: 0; bottom: 0; transform: translateX(-50%); display: grid; place-items: end center; }
.tac-sprite { display: block; height: calc(var(--th) * 2.55); width: auto; transform-origin: bottom center; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.7)); }
.tac-emoji { display: block; font-size: calc(var(--th) * 1.3); line-height: 1; filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.85)); }
.tac-unit.role-leader .tac-emoji { font-size: calc(var(--th) * 1.7); }

/* Hauteur de la figurine, en cases : barres, intention et PV se posent au-dessus.
   Une illustration de monstre est plus grande qu'un emoji ; s'il la remplace, les
   repères reviennent d'eux-mêmes à la taille de l'emoji. */
.tac-unit.team-enemy { --fig-top: 1.5; }
.tac-unit.role-leader { --fig-top: 1.9; }
.tac-unit.team-enemy:has(.tac-mob) { --fig-top: 2.15; }
.tac-unit.role-leader:has(.tac-mob) { --fig-top: 2.75; }
.tac-unit.tier-worldboss:has(.tac-mob) { --fig-top: 3.3; }
.tac-sprite.tac-mob { height: calc(var(--th) * var(--fig-top)); }
/* Le héros est une poupée (js/ui/paperdoll.js) : sa boîte garde la toile en 2:3. */
.tac-sprite.tac-hero { width: calc(var(--th) * 2.55 * 2 / 3); }

/* Le héros se retourne selon sa marche ; un monstre seulement si son dessin
   regarde de l'autre côté (ART_FACING, config/enemies.js). */
.tac-unit.team-hero.face-left .tac-sprite,
.tac-unit.face-left .tac-sprite.art-right,
.tac-unit:not(.face-left) .tac-sprite.art-left { transform: scaleX(-1); }
/* Goultard est rendu tourné vers la droite : il se retourne, arme et bouclier compris, quand il va à gauche. */
.tac-unit.face-left .tac-sprite.tac-hero { transform: scaleX(-1); }
.tac-unit.is-focus .tac-figure { filter: brightness(1.22) drop-shadow(0 0 8px rgba(255, 255, 255, 0.35)); }

/*
 * Cible retenue : un réticule au-dessus de la figurine.
 *
 * Le survol éclaire (`is-focus`), la cible marque (`is-aim`) — deux états
 * distincts, parce qu'on regarde un monstre sans forcément le viser. C'est
 * contre cette cible-là que se lisent les dégâts annoncés sur les boutons.
 */
.tac-unit.is-aim .tac-figure {
    filter: brightness(1.3) drop-shadow(0 0 10px color-mix(in srgb, var(--gold) 70%, transparent));
}

.tac-unit.is-aim::after {
    content: '';
    position: absolute;
    left: 0;
    /* Au-dessus de la tête : la figurine monte de `--fig-top` cases depuis ses
       pieds, comme la barre de vie et l'intention juste à côté. */
    bottom: calc(var(--th) * var(--fig-top, 1.5) + 8px + max(11px, var(--th) * 0.4) + 16px);
    width: 15px;
    height: 15px;
    margin-left: -7.5px;
    border: 2px solid var(--gold-lit);
    border-radius: 50%;
    box-shadow: 0 0 9px rgba(240, 180, 41, 0.85), inset 0 0 5px rgba(240, 180, 41, 0.6);
    pointer-events: none;
    animation: aimPulse 1.6s ease-in-out infinite;
    will-change: opacity, transform;
}

/* Le point central : sans lui, l'anneau se lit comme une bulle, pas une visée. */
.tac-unit.is-aim::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: calc(var(--th) * var(--fig-top, 1.5) + 8px + max(11px, var(--th) * 0.4) + 21.5px);
    width: 4px;
    height: 4px;
    margin-left: -2px;
    border-radius: 50%;
    background: var(--gold-lit);
    pointer-events: none;
}

@keyframes aimPulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.16); }
}

@media (prefers-reduced-motion: reduce) {
    .tac-unit.is-aim::after { animation: none; }
}
.tac-unit.walking .tac-figure { animation: unitBob 0.23s ease-in-out infinite; }
.tac-unit.hit .tac-figure { animation: unitHit 0.26s ease; }
.tac-unit.casting .tac-figure { animation: unitCast 0.23s ease; }
.tac-unit.dead { opacity: 0; pointer-events: none; }

/* ---------- Figurines animées (js/ui/tactical/figurine.js) ----------
   Une bande d'images par animation, jouée par paliers sur la position du
   fond. Le cadre est posé par son ancre (entre les pattes) sur le centre de
   la case ; le miroir tourne autour de cette ancre. */
.tac-anim, .tac-anim.tac-figure { position: absolute; bottom: auto; display: block; transform: none; pointer-events: none; }
.tac-anim .ta-corps { position: absolute; inset: 0; transform-origin: var(--ax, 50%) 100%; }
.tac-anim.miroir .ta-corps { transform: scaleX(-1); }
.tac-anim .ta {
    position: absolute;
    background: var(--bande) 0 0 / calc(var(--cadres) * 100%) 100% no-repeat;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.45));
}
.tac-anim .ta-corps.arret .ta, .tac-anim .ta-corps.fin .ta { background-position-x: 100%; }
.tac-anim .ta-corps.boucle .ta { animation: taBoucle var(--duree) steps(var(--images)) infinite; }
.tac-anim .ta-corps.unefois .ta { animation: taFois var(--duree) steps(var(--pas)) forwards; }
@keyframes taBoucle { from { background-position-x: 0%; } to { background-position-x: calc(100% * var(--images) / (var(--cadres) - 1)); } }
@keyframes taFois { from { background-position-x: 0%; } to { background-position-x: 100%; } }
/* Les gestes du dessin fixe ne s'appliquent pas à une figurine animée. */
.tac-unit.walking .tac-anim, .tac-unit.hit .tac-anim, .tac-unit.casting .tac-anim { animation: none; }
/* Goultard : il fond sur sa cible, s'illumine quand il encaisse, tombe quand il est vaincu. */
.tac-anim.fente { animation: taFente 0.52s ease-in-out; }
@keyframes taFente { 0%, 100% { transform: translate(0, 0); } 40%, 55% { transform: translate(var(--lx, 0), var(--ly, 0)); } }
.tac-anim.touche .ta { filter: brightness(2.4) drop-shadow(0 3px 4px rgba(0, 0, 0, 0.45)); }
.tac-anim.tombe { animation: taTombe 0.7s ease-in forwards; transform-origin: 50% 100%; }
@keyframes taTombe { to { opacity: 0; transform: translateY(8%) scaleY(0.6); } }
/* Une figurine animée s'efface après sa mort, en douceur. */
.tac-unit.dead:has(.tac-anim) { transition: opacity 0.35s ease; }
@media (prefers-reduced-motion: reduce) {
    .tac-anim .ta-corps.boucle .ta, .tac-anim.fente, .tac-anim.tombe { animation: none; }
}

/* ---------- Familier : au pied du héros, comme un familier équipé ----------
   Porté par la figurine du héros, il le suit à chaque pas et se tient au sol,
   à côté de ses pieds, du côté opposé à son regard — comme dans Dofus. */
.tac-familiar {
    --fam-glow: #a8c900;
    position: absolute;
    left: calc(var(--th) * -0.95);
    bottom: calc(var(--th) * -0.05);
    width: calc(var(--th) * 0.7);
    height: calc(var(--th) * 0.7);
    pointer-events: none;
}
.tac-unit.face-left .tac-familiar { left: calc(var(--th) * 0.25); }
/* Son modèle de Dofus : ancré par ses pattes aux pieds du héros, puis posé
   à son poste (renderer-iso.js, POSTE de promenade.js) selon la direction
   de la figurine — comme sur les cartes. */
.tac-familiar.modele { left: 0; top: 0; bottom: auto; width: 0; height: 0; transition: transform 0.18s ease-out; }
.tac-familiar.modele .tac-familiar-art { position: absolute; left: 0; top: 0; width: 0; height: 0; display: block; }
.tac-familiar.modele::before { inset: calc(var(--tw) * -0.25); }
.tac-familiar.fam-soin { --fam-glow: #5fd6a0; }
.tac-familiar.fam-frenesie { --fam-glow: #ff8a4c; }
.tac-familiar.fam-carapace { --fam-glow: #9fb6d6; }
.tac-familiar.fam-entrave { --fam-glow: #b58ae8; }
.tac-familiar.fam-ferveur { --fam-glow: #f2c46e; }
.tac-familiar.fam-morsure { --fam-glow: #ff6b7d; }

/* La lueur de sa famille, allumée quand son passif joue. */
.tac-familiar::before {
    content: '';
    position: absolute;
    inset: -45%;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--fam-glow) 70%, transparent), transparent 68%);
    opacity: 0;
}
.tac-familiar.acting::before { animation: familiarGlow 0.5s ease; }
.tac-familiar-art { position: relative; display: grid; place-items: end center; width: 100%; height: 100%; }
.tac-familiar-img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.8)); }
.tac-familiar-emoji { font-size: calc(var(--th) * 0.82); line-height: 1; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.85)); }
.tac-familiar.acting .tac-familiar-art { animation: familiarAct 0.45s ease; }

@keyframes familiarGlow { 0% { opacity: 0; } 35% { opacity: 1; } 100% { opacity: 0; } }
@keyframes familiarAct {
    0% { transform: scale(1); }
    40% { transform: scale(1.3) translateY(-4px); }
    100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .tac-familiar.acting .tac-familiar-art, .tac-familiar.acting::before { animation: none; }
}

.tac-bars {
    position: absolute;
    left: calc(var(--tw) * -0.26);
    width: calc(var(--tw) * 0.52);
    bottom: calc(var(--th) * 2.7);
    height: 5px;
    background: #090906;
    border: 1px solid rgba(0, 0, 0, 0.85);
    border-radius: 3px;
    overflow: hidden;
    pointer-events: none;
}

.tac-unit.team-enemy .tac-bars { bottom: calc(var(--th) * var(--fig-top)); }
.tac-hp { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #7d1b25, #ff3b5c); transition: width 0.3s ease; }
.tac-unit.team-hero .tac-hp { background: linear-gradient(90deg, #1f7a4a, var(--verdant)); }
.tac-armor { position: absolute; left: 0; top: 0; height: 2px; background: #c9d5ec; z-index: 1; }


/* PV des ennemis, lisibles sans avoir à survoler. */
.tac-hp-text {
    position: absolute;
    left: 0;
    bottom: calc(var(--th) * var(--fig-top, 1.5) + 6px);
    transform: translateX(-50%);
    font-size: max(10px, calc(var(--th) * 0.34));
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-shadow: 0 1px 2px #000, 0 0 5px rgba(0, 0, 0, 0.95);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}


/* Aperçu du sort visé : la part de jauge qui disparaîtrait, et le montant. */
.tac-armor { z-index: 3; }

.tac-ghost {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0;
    z-index: 2;
    background: rgba(255, 226, 150, 0.95);
    animation: ghostPulse 0.7s ease-in-out infinite alternate;
}

.tac-preview {
    display: none;
    position: absolute;
    left: 0;
    bottom: calc(var(--th) * var(--fig-top, 1.5) + 8px + max(11px, var(--th) * 0.4));
    transform: translateX(-50%);
    padding: 1px 7px;
    font-size: max(11px, calc(var(--th) * 0.38));
    font-weight: 800;
    line-height: 1.35;
    color: #ffd08a;
    background: rgba(24, 12, 4, 0.9);
    border: 1px solid rgba(255, 170, 80, 0.85);
    border-radius: 9px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
    z-index: 5;
}

.tac-unit.previewed .tac-preview { display: block; }
.tac-unit.lethal .tac-preview {
    color: #fff;
    background: rgba(150, 18, 36, 0.94);
    border-color: var(--blood-lit);
    box-shadow: 0 0 10px rgba(255, 59, 92, 0.6);
}

@keyframes ghostPulse { from { opacity: 0.5; } to { opacity: 1; } }

/* ---------- Fiche du combattant ---------- */
/* La fiche prend la hauteur de ce qu'elle dit, pas celle de la colonne. */
.tac-inspect {
    align-self: start;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 16px;
    background: radial-gradient(ellipse at 50% 0%, rgba(214, 64, 78, 0.12), transparent 60%), var(--pane);
    border: 1px solid rgba(214, 64, 78, 0.35);
    border-radius: var(--radius-lg);
    box-shadow: var(--lift);
}

.inspect-head { display: flex; align-items: center; gap: 10px; }
.inspect-avatar { width: 46px; height: 46px; flex-shrink: 0; display: grid; place-items: center; overflow: hidden; font-size: 2rem; }
.inspect-avatar .tl-img { height: 86px; margin-top: 4px; }

/* Portrait de monstre : l'illustration entière, contenue dans sa vignette. */
.tl-avatar .tl-img.tl-mob,
.inspect-avatar .tl-img.tl-mob,
.tac-inspect .inspect-avatar .tl-img.tl-mob { width: 100%; height: 100%; margin: 0; align-self: center; object-fit: contain; }
.inspect-ident { min-width: 0; }
.inspect-ident h3 { font-size: 0.9rem; letter-spacing: 0.06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.inspect-sub { color: var(--verdant); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.16em; }
.inspect-stats { display: flex; flex-wrap: wrap; gap: 5px 12px; font-size: 0.78rem; color: var(--text-soft); }
.inspect-stats b { font-family: var(--font-display); color: #fff; }
.inspect-stats em { color: var(--blood-lit); font-style: normal; }
.inspect-effects { display: flex; flex-wrap: wrap; gap: 4px; }
.inspect-hint { margin: 0; font-size: 0.62rem; color: var(--text-dim); }
.inspect-dead { margin: 0; color: var(--text-dim); font-family: var(--font-display); letter-spacing: 0.1em; }
.elan-inline { display: inline-flex; align-items: center; gap: 5px; }
.tac-inspect .enemy-sorts { margin-top: 2px; }

.elem-badges { display: flex; gap: 5px; flex-wrap: wrap; }

.elem-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    border: 1px solid;
}

.elem-badge { display: inline-flex; align-items: center; gap: 4px; }

/* Petites illustrations de la fiche : PA, PM, portée, armure, effets. */
.fi, .badge-ico, .chip-ico, .armor-ico, .tl-intent-ico, .res-ico {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 auto; line-height: 1;
}
.fi-art { width: 100%; height: 100%; object-fit: contain; }
.fi { width: 16px; height: 16px; margin-right: 3px; vertical-align: -3px; }
.badge-ico { width: 13px; height: 13px; }
.chip-ico { width: 13px; height: 13px; margin-right: 4px; vertical-align: -2px; }
.armor-ico { width: 13px; height: 13px; margin-right: 3px; vertical-align: -2px; }
.tl-intent { display: inline-flex; align-items: center; gap: 2px; }
.tl-intent-ico { width: 14px; height: 14px; }

/*
 * Résistances : quatre cases égales, l'élément puis son pourcentage. Le point
 * faible est cerclé d'or : c'est la case que l'œil doit trouver en premier.
 */
.inspect-res-title {
    font-size: 0.58rem; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--text-dim);
}
.res-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.res-cell {
    display: flex; align-items: center; justify-content: center; gap: 3px;
    padding: 3px 2px; border-radius: 6px; white-space: nowrap;
    background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.66rem; font-variant-numeric: tabular-nums; color: var(--text-soft);
}
.res-cell b { font-weight: 700; }
.res-ico { width: 15px; height: 15px; }
.res-cell.nul b { color: var(--text-dim); }
.res-cell.pos b { color: #a9c6f0; }
.res-cell.haut b { color: #7fb0ff; }
.res-cell.neg b { color: var(--verdant); }
.res-cell.faible { border-color: rgba(255, 200, 90, 0.75); background: rgba(255, 200, 90, 0.1); }

/* L'armure se lit au-dessus des PV : on la voit fondre avant d'entamer la vie. */
.armor-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }

.armor-bar-bg {
    flex: 1;
    height: 6px;
    background: #090906;
    border: 1px solid var(--stone-700);
    border-radius: 4px;
    overflow: hidden;
}

.armor-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6b7896, #b8c6e0);
    box-shadow: 0 0 8px rgba(184, 198, 224, 0.5);
    transition: width 0.3s ease;
}

.armor-value { font-size: 0.68rem; color: #b8c6e0; font-variant-numeric: tabular-nums; white-space: nowrap; }

.enemy-hp-wrap { display: flex; align-items: center; gap: 10px; }

.hp-bar-bg {
    flex: 1;
    height: 12px;
    background: #090906;
    border: 1px solid var(--stone-700);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.9);
}

.hp-bar-fill { height: 100%; transition: width 0.35s ease; }

.hp-bar-fill.enemy {
    background: linear-gradient(90deg, #7d1b25, #ff3b5c);
    box-shadow: 0 0 10px rgba(255, 59, 92, 0.5);
}

.hp-text { margin: 0; font-size: 0.74rem; color: var(--text-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }

/*
 * LES SORTS D'UN ENNEMI : comme dans Dofus, on ne sait pas ce qu'il va faire,
 * seulement ce qu'il PEUT faire — chaque sort, son coût, sa portée, sa
 * relance et ce qu'il vous ferait. Une ligne par sort, graduée par danger.
 */
.enemy-sorts { display: flex; flex-direction: column; gap: 5px; margin: 10px 0 0; padding: 0; list-style: none; }
.enemy-sort {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--stone-600);
    background: rgba(0, 0, 0, 0.45);
}
.enemy-sort .intent-icon { display: grid; place-items: center; width: 24px; height: 24px; font-size: 1.1rem; line-height: 1; }
.enemy-sort .intent-art { max-width: 100%; max-height: 100%; }
.enemy-sort .intent-body { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.enemy-sort .intent-text { font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.04em; }
.enemy-sort .intent-body small { font-size: 0.62rem; color: var(--text-dim); }
.enemy-sort .intent-value { margin-left: auto; font-family: var(--font-display); font-size: 0.9rem; font-weight: 700; }
.enemy-sort.danger-0 { border-color: rgba(127, 176, 255, 0.4); color: #a9c6f0; }
.enemy-sort.danger-1 { border-color: rgba(255, 122, 60, 0.45); color: #ffb185; }
.enemy-sort.danger-2 { border-color: rgba(255, 59, 92, 0.6); color: var(--blood-lit); }
/* Un sort en relance ne peut pas partir à ce tour : il s'efface. */
.enemy-sort.relance { opacity: 0.5; }

.effect-chip {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.66rem;
    font-weight: 700;
    border: 1px solid;
    white-space: nowrap;
}

.effect-chip.buff { background: rgba(79, 212, 138, 0.12); border-color: rgba(79, 212, 138, 0.5); color: var(--verdant); }
.effect-chip.debuff { background: rgba(255, 59, 92, 0.12); border-color: rgba(255, 59, 92, 0.5); color: var(--blood-lit); }

.hp-bar-fill.hero {
    background: linear-gradient(90deg, #1f7a4a, var(--verdant));
    box-shadow: 0 0 10px rgba(79, 212, 138, 0.45);
}

.elan-pips { display: flex; gap: 4px; }

.elan-pip {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 1px solid var(--stone-500);
    background: rgba(0, 0, 0, 0.6);
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}

.elan-pip.on {
    background: var(--gold-lit);
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(240, 180, 41, 0.8);
    transform: scale(1.14);
}

/* ---------- Jauge d'Élan, au bout de la barre d'action ---------- */

.act-elan {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 14px 0 4px;
    margin-right: 6px;
    border-right: 1px solid var(--stone-600);
    flex-shrink: 0;
}

.elan-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
}

.elan-row { display: flex; gap: 5px; }

/*
 * Un éclat, pas une pastille : le losange rappelle la forme des Éclats d'Âme
 * et se distingue au premier coup d'œil des globes ronds de PA et PM.
 */
.elan-shard {
    width: 13px;
    height: 19px;
    clip-path: polygon(50% 0, 100% 34%, 50% 100%, 0 34%);
    background: var(--stone-700);
    box-shadow: inset 0 0 0 1px var(--stone-500);
    transition: background 0.18s, filter 0.18s;
}

.elan-shard.on {
    background: linear-gradient(180deg, var(--gold-lit), var(--gold));
    filter: drop-shadow(0 0 7px rgba(240, 180, 41, 0.9));
}

/* Ce que le sort visé prélèverait : on le voit avant de le payer. */
.elan-shard.spent {
    animation: elanSpend 0.9s ease-in-out infinite;
    will-change: opacity;
}

@keyframes elanSpend {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.28; }
}

@media (prefers-reduced-motion: reduce) {
    .elan-shard.spent { animation: none; opacity: 0.45; }
}

@media (max-width: 1000px) {
    .act-elan { padding: 0 9px 0 2px; gap: 4px; }
    .elan-label { font-size: 0.6rem; letter-spacing: 0.1em; }
    .elan-shard { width: 10px; height: 15px; }
}

.combat-ticker {
    flex-shrink: 0;
    height: 52px;
    overflow: hidden;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--stone-700);
    border-radius: var(--radius);
    font-size: 0.7rem;
    line-height: 1.45;
}

.combat-ticker .log-line { border: none; padding: 0; }

/* Le journal de gauche raconte déjà le combat sur grand écran : le bandeau
   ne sert que lorsque le journal est masqué, et rend sa hauteur au plateau. */
@media (min-width: 1001px) {
    .combat-ticker { display: none; }
}
.combat-ticker .log-line:nth-child(2) { opacity: 0.66; }
.combat-ticker .log-line:nth-child(3) { opacity: 0.38; }

.act-btn.selected {
    --act-line: var(--gold);
    box-shadow: var(--bevel), inset 0 0 0 1px var(--gold), 0 0 18px rgba(217, 164, 65, 0.45);
    transform: translateY(-4px);
}

@keyframes cellFlash { 0% { filter: brightness(1); } 40% { filter: brightness(2.2); } 100% { filter: brightness(1); } }
@keyframes ringPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.12); opacity: 0.7; } }
@keyframes unitBob { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-3px); } }
@keyframes unitHit { 0%, 100% { transform: translateX(-50%); filter: none; } 30% { transform: translateX(calc(-50% - 4px)); filter: brightness(1.8) saturate(0.4) sepia(1) hue-rotate(-30deg); } 60% { transform: translateX(calc(-50% + 3px)); } }
@keyframes unitCast { 0%, 100% { transform: translateX(-50%) scale(1); } 45% { transform: translateX(-50%) scale(1.1); } }


/* =====================================================================
   COMBAT : badges élémentaires et bouton Passer
   ===================================================================== */

.elem-badge.own {
    color: var(--text-soft);
    border-color: var(--stone-500);
    background: rgba(255, 255, 255, 0.05);
}

.elem-badge.drained {
    color: #b8c6e0;
    border-color: rgba(184, 198, 224, 0.55);
    background: rgba(184, 198, 224, 0.12);
}

.act-btn.pass { --rar: var(--stone-500); min-width: 66px; }
