/* =========================================================
   GACHA CARDS — ARÈNE DE COMBAT
   Réutilise arcade.css (tokens, .ar-root + effets)
   Card battler tactique : champs, unités, énergie/cristal,
   main, journal, résultat. Orienté affichage + hooks data-*.
   ========================================================= */

.cb-root { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
/* scanlines : texture forte sur le fond, légère sur l'UI de lecture */
.cb-root[data-fx="soft"]::after { opacity: .18; }
.cb-root[data-fx="full"]::after { opacity: .28; }

/* ===== TOPBAR ===== */
.cb-top {
  position: sticky; top: 0; z-index: 40; flex-shrink: 0;
  background: rgba(4,7,5,0.94); border-bottom: 1px solid var(--primary-border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; gap: 16px; padding: 0 18px; height: 52px; min-height: 52px;
}
.cb-top-title { font-family: var(--f-pixel); font-size: 13px; color: var(--combat); letter-spacing: 1px; text-shadow: 0 0 14px rgba(var(--combat-rgb), 0.4); white-space: nowrap; }
.cb-vs { font-family: var(--f-term); font-size: 18px; color: var(--ink-mute); }
.cb-vs b { color: var(--combat); }
.cb-turn {
  font-family: var(--f-pixel); font-size: 10px; color: var(--amber); letter-spacing: 1px;
  border: 1px solid rgba(var(--amber-rgb), 0.4); background: rgba(var(--amber-rgb), 0.08); border-radius: 8px; padding: 8px 13px; white-space: nowrap;
}
.cb-top-spacer { flex: 1; }
.cb-phase { font-family: var(--f-pixel); font-size: 8px; letter-spacing: 1px; padding: 7px 12px; border-radius: 999px; white-space: nowrap; }
.cb-phase--you { color: var(--primary); border: 1px solid rgba(var(--primary-rgb), 0.4); background: rgba(var(--primary-rgb), 0.08); animation: ar-blink 2s ease-in-out infinite; }

/* ===== ARENA (plein écran, sol = grille synthwave) ===== */
.cb-arena {
  flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; overflow: hidden; position: relative;
}
/* bandeaux HUD (haut ennemi / bas joueur) */
.cb-hud {
  flex-shrink: 0; width: 100%; display: flex; align-items: center; justify-content: center;
  gap: clamp(14px, 2.4vw, 30px); padding: clamp(8px, 1.4vh, 13px) 20px;
}
.cb-hud--enemy { background: linear-gradient(180deg, rgba(var(--combat-rgb), 0.16), transparent); border-bottom: 1px solid rgba(var(--combat-rgb), 0.18); }
.cb-hud--player { background: linear-gradient(0deg, rgba(var(--primary-rgb), 0.16), transparent); border-top: 1px solid rgba(var(--primary-rgb), 0.18); }
/* champ de bataille (la grille de la page sert de sol) */
.cb-battle {
  flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: space-evenly; gap: clamp(10px, 2vh, 20px);
  padding: clamp(10px, 2vh, 22px) 16px; overflow: hidden;
}
.cb-battle::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(var(--combat-rgb), 0.08), transparent 50%),
    radial-gradient(ellipse at 50% 70%, rgba(var(--primary-rgb), 0.08), transparent 50%);
}

/* ----- plaque héros (nameplate compacte) ----- */
.cb-hero {
  --hc: var(--combat); --hc-rgb: var(--combat-rgb);
  display: inline-flex; align-items: center; gap: 14px; width: auto; max-width: 100%; flex-shrink: 0;
  background: linear-gradient(90deg, rgba(var(--hc-rgb), 0.14), rgba(0,0,0,0.34));
  border: 1px solid rgba(var(--hc-rgb), 0.4); border-radius: 999px; padding: clamp(5px, 0.8vh, 9px) 16px;
  box-shadow: 0 0 22px rgba(var(--hc-rgb), 0.12);
}
.cb-hero--player { --hc: var(--primary); --hc-rgb: var(--primary-rgb); flex-direction: row-reverse; text-align: right; }
.cb-hero-av {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 11px; border: 2px solid var(--hc); color: var(--hc);
  display: flex; align-items: center; justify-content: center; font-size: 21px;
  background: radial-gradient(circle, rgba(0,0,0,0.4), rgba(0,0,0,0.7)); box-shadow: 0 0 16px rgba(var(--hc-rgb), 0.3);
}
.cb-hero-main { width: clamp(150px, 24vw, 240px); }
.cb-hero-row1 { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.cb-hero--player .cb-hero-row1 { flex-direction: row-reverse; }
.cb-hero-name { font-family: var(--f-pixel); font-size: 9px; color: var(--hc); letter-spacing: .5px; white-space: nowrap; }
.cb-hero-hpnum { font-family: var(--f-term); font-size: 21px; color: #eafff0; white-space: nowrap; text-shadow: 0 0 10px rgba(0,0,0,0.6); }
.cb-hp { height: 12px; border-radius: 6px; background: rgba(0,0,0,0.5); border: 1px solid rgba(var(--hc-rgb), 0.3); overflow: hidden; position: relative; }
.cb-hp-fill { height: 100%; border-radius: 5px; transition: width .5s; }
.cb-hero--player .cb-hp-fill { background: linear-gradient(90deg, #1f8a3a, var(--primary)); box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.4); }
.cb-hero--enemy .cb-hp-fill { background: linear-gradient(90deg, #aa2222, var(--combat)); box-shadow: 0 0 8px rgba(var(--combat-rgb), 0.4); }
/* ressources */
.cb-res { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.cb-hero--player .cb-res { flex-direction: row-reverse; }
.cb-energy { display: flex; align-items: center; gap: 4px; }
.cb-energy-pip { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(var(--amber-rgb), 0.5); background: rgba(0,0,0,0.4); }
.cb-energy-pip.is-on { background: radial-gradient(circle, #ffe98a, var(--amber)); box-shadow: 0 0 8px rgba(var(--amber-rgb), 0.6); border-color: var(--amber); }
.cb-energy-lab { font-family: var(--f-pixel); font-size: 9px; color: var(--amber); letter-spacing: .5px; }
.cb-crystal { display: flex; flex-direction: column; gap: 4px; min-width: 64px; }
.cb-crystal-lab { font-family: var(--f-pixel); font-size: 7px; color: #c79bff; letter-spacing: 1px; }
.cb-crystal-bar { height: 7px; border-radius: 4px; background: rgba(80,30,120,0.3); border: 1px solid rgba(170,90,255,0.3); overflow: hidden; }
.cb-crystal-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #7a33cc, #cc88ff); box-shadow: 0 0 7px rgba(170,90,255,0.4); }
.cb-pile { display: flex; gap: 10px; flex-shrink: 0; }
.cb-pile-chip { font-family: var(--f-term); font-size: 14px; color: var(--ink-mute); display: flex; flex-direction: column; align-items: center; line-height: 1; gap: 3px; }
.cb-pile-chip b { color: #eafff0; font-weight: 400; font-size: 17px; }
.cb-pile-chip span { font-family: var(--f-pixel); font-size: 6px; color: var(--ink-mute); letter-spacing: .5px; }

/* ----- champs ----- */
.cb-field { display: flex; gap: clamp(10px, 1.6vw, 18px); justify-content: center; align-items: stretch; width: 100%; max-width: 760px; flex-shrink: 0; position: relative; z-index: 1; }
.cb-slot {
  flex: 1; max-width: 200px; min-height: clamp(120px, 19vh, 176px); border-radius: 12px; position: relative;
  border: 2px dashed rgba(var(--primary-rgb), 0.14); display: flex; align-items: center; justify-content: center;
  transition: border-color .2s, background .2s;
}
.cb-field--enemy .cb-slot { border-color: rgba(var(--combat-rgb), 0.12); }
/* zones distinctes mais discrètes — les cartes restent les stars */
.cb-field--enemy, .cb-field--player { padding: 10px 12px; border-radius: 18px; transition: box-shadow .45s ease; }
.cb-field--enemy { background: linear-gradient(180deg, rgba(var(--combat-rgb),0.06), transparent 78%); border: 1px solid rgba(var(--combat-rgb),0.1); }
.cb-field--player { background: linear-gradient(0deg, rgba(var(--primary-rgb),0.06), transparent 78%); border: 1px solid rgba(var(--primary-rgb),0.1); }
/* glow de la zone dont c'est le tour */
.cb-field--enemy.is-turn { animation: cb-turn-enemy 2.6s ease-in-out infinite; }
.cb-field--player.is-turn { animation: cb-turn-you 2.6s ease-in-out infinite; }
@keyframes cb-turn-you { 0%,100% { box-shadow: 0 0 0 1px rgba(var(--primary-rgb),0.28), 0 0 22px rgba(var(--primary-rgb),0.1); } 50% { box-shadow: 0 0 0 1px rgba(var(--primary-rgb),0.5), 0 0 42px rgba(var(--primary-rgb),0.2); } }
@keyframes cb-turn-enemy { 0%,100% { box-shadow: 0 0 0 1px rgba(var(--combat-rgb),0.28), 0 0 22px rgba(var(--combat-rgb),0.1); } 50% { box-shadow: 0 0 0 1px rgba(var(--combat-rgb),0.5), 0 0 42px rgba(var(--combat-rgb),0.2); } }
.cb-zone-tag {
  position: absolute; left: 12px; z-index: 4; pointer-events: none; white-space: nowrap;
  font-family: var(--f-pixel); font-size: 6px; letter-spacing: 1px; padding: 4px 9px; border-radius: 999px;
}
.cb-zone-tag--enemy { top: -9px; color: var(--combat); border: 1px solid rgba(var(--combat-rgb),0.5); background: rgba(14,3,3,0.95); box-shadow: 0 0 12px rgba(var(--combat-rgb),0.25); }
.cb-zone-tag--player { bottom: -9px; color: var(--primary); border: 1px solid rgba(var(--primary-rgb),0.5); background: rgba(2,14,7,0.95); box-shadow: 0 0 12px rgba(var(--primary-rgb),0.25); }
/* nos unités plus grandes que celles de l'adversaire */
.cb-field--enemy .cb-slot { max-width: 176px; min-height: clamp(104px, 16.5vh, 150px); }
.cb-field--player .cb-slot { max-width: 218px; min-height: clamp(136px, 21.5vh, 198px); }
.cb-field--player .cb-unit { padding: 0; }
.cb-field--player .cb-unit-emoji { font-size: clamp(27px, 4vh, 38px); }
.cb-field--player .cb-unit-body { padding: 4px 9px 9px; }
.cb-field--player .cb-unit-atk, .cb-field--player .cb-unit-def, .cb-field--player .cb-unit-hp-pill { font-size: 10px; padding: 5px 9px; }
.cb-field--player .cb-unit-hp-txt { font-size: 11px; }
.cb-field--player .cb-unit-hpbar { height: 13px; }
.cb-field--player .cb-unit-ability-name { font-size: 16px; }
.cb-field--player .cb-unit-ability-desc { font-size: 14px; }
.cb-field--enemy .cb-unit-emoji { font-size: clamp(19px, 2.8vh, 26px); }
.cb-field--enemy .cb-unit-name { font-size: 6px; }
.cb-field--enemy .cb-unit-atk, .cb-field--enemy .cb-unit-def, .cb-field--enemy .cb-unit-hp-pill { font-size: 7px; padding: 3px 5px; }
/* unité dont le menu est ouvert */
.cb-unit.is-action-open { box-shadow: 0 0 0 2px var(--primary), 0 10px 28px rgba(0,0,0,0.5), 0 0 24px rgba(var(--primary-rgb),0.5) !important; }
.cb-slot-empty { font-family: var(--f-pixel); font-size: 7px; color: var(--ink-dim); letter-spacing: 1px; }
/* slot ciblable quand une carte est sélectionnée */
.cb-arena.is-targeting .cb-field--player .cb-slot.is-free {
  border-style: solid; border-color: rgba(var(--primary-rgb), 0.5); background: rgba(var(--primary-rgb), 0.05);
  animation: cb-slot-pulse 1.3s ease-in-out infinite; cursor: pointer;
}
@keyframes cb-slot-pulse { 0%,100% { box-shadow: 0 0 0 rgba(var(--primary-rgb),0); } 50% { box-shadow: inset 0 0 22px rgba(var(--primary-rgb), 0.18); } }

/* ----- ligne centrale VS ----- */
.cb-centerline {
  position: relative; width: 100%; max-width: 760px; height: 2px; border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(90deg, transparent, rgba(var(--combat-rgb), 0.5) 28%, rgba(var(--primary-rgb), 0.5) 72%, transparent);
}
.cb-vs-badge {
  font-family: var(--f-pixel); font-size: 11px; letter-spacing: 1px; color: #fff; flex-shrink: 0;
  padding: 7px 14px; border-radius: 9px; background: rgba(4,6,5,0.92); border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 0 18px rgba(var(--combat-rgb), 0.25), 0 0 18px rgba(var(--primary-rgb), 0.2);
}

/* ===== UNITÉ (style aligné sur les cartes) ===== */
.cb-unit {
  --uc: #8a8a8a; --uc-rgb: 138,138,138;
  width: 100%; height: 100%; padding: 0; border-radius: 11px; position: relative; overflow: hidden;
  border: 2px solid rgba(var(--uc-rgb),0.7); background: rgba(1,5,3,0.98);
  display: flex; flex-direction: column; box-shadow: 0 0 14px rgba(var(--uc-rgb), 0.22);
  cursor: pointer; transition: transform .15s, box-shadow .2s;
}
.cb-unit:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,0.4), 0 0 18px rgba(var(--uc-rgb), 0.3); }
/* bandeau coloré en haut (idem carte) */
.cb-unit::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 28px; z-index: 0;
  background: linear-gradient(115deg, var(--uc) 0%, rgba(var(--uc-rgb),0.5) 45%, transparent 100%); pointer-events: none; }
/* header */
.cb-unit-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 5px 6px 3px; height: 28px; }
.cb-unit-elem { font-size: 12px; line-height: 1; }
.cb-unit-mana { font-family: var(--f-pixel); font-size: 7px; color: #1a0d00; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 38% 32%, #fff5c8, #ffc800 55%, #9a7000); border: 1px solid rgba(255,255,255,0.5); box-shadow: 0 0 6px rgba(255,200,0,0.5); }
/* corps de l'unité */
.cb-unit-body { flex: 1; display: flex; flex-direction: column; padding: 4px 7px 7px; }
.cb-unit--feu { --uc: #ff5a3c; --uc-rgb: 255,90,60; }
.cb-unit--eau { --uc: #4ba3ff; --uc-rgb: 75,163,255; }
.cb-unit--terre { --uc: #6bcf4a; --uc-rgb: 107,207,74; }
.cb-unit--lumiere { --uc: #ffd24a; --uc-rgb: 255,210,74; }
.cb-unit--ombre { --uc: #c06bff; --uc-rgb: 192,107,255; }
.cb-unit-top { display: flex; align-items: center; justify-content: space-between; }
.cb-unit-elem { font-size: 13px; line-height: 1; }
.cb-unit-mana { font-family: var(--f-pixel); font-size: 8px; color: #ffd24a; background: rgba(0,0,0,0.5); border-radius: 4px; padding: 3px 5px; }
.cb-unit-emoji { font-size: clamp(22px, 3.2vh, 30px); text-align: center; line-height: 1; margin: 2px 0 3px; }
.cb-unit-name { font-family: var(--f-pixel); font-size: 7px; color: #ffffff; text-align: center; line-height: 1.35; margin-bottom: 5px; min-height: 1.35em; text-shadow: 0 1px 2px rgba(0,0,0,0.7); }
.cb-unit-stats { display: flex; justify-content: center; gap: 5px; margin-bottom: 6px; white-space: nowrap; }
.cb-unit-atk, .cb-unit-def, .cb-unit-hp-pill { font-family: var(--f-pixel); font-size: 8px; color: #fff; padding: 4px 6px; border-radius: 7px; display: inline-flex; align-items: center; gap: 2px; line-height: 1; text-shadow: 0 1px 1px rgba(0,0,0,0.5); }
.cb-unit-atk { background: rgba(255,80,52,0.92); box-shadow: 0 0 8px rgba(255,90,60,0.3); }
.cb-unit-def { background: rgba(60,135,255,0.88); box-shadow: 0 0 8px rgba(75,150,255,0.3); }
.cb-unit-hp-pill { background: rgba(46,200,92,0.95); box-shadow: 0 0 10px rgba(70,220,110,0.45); }
.cb-unit-hp { display: flex; align-items: center; gap: 6px; }
.cb-unit-hpbar { flex: 1; height: 11px; border-radius: 6px; background: rgba(255,255,255,0.1); overflow: hidden; }
.cb-unit-hpbar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #22bb22, #66ff44); box-shadow: 0 0 6px rgba(68,221,68,0.4); transition: width .5s; }
.cb-unit-hpbar-fill.is-low { background: linear-gradient(90deg, #cc3300, #ff6644); }
.cb-unit-hp-txt { font-family: var(--f-pixel); font-size: 9px; color: #b6ffc6; flex-shrink: 0; text-shadow: 0 1px 2px rgba(0,0,0,0.6); }
.cb-unit-ability { margin-top: 6px; border-top: 1px dashed rgba(204,68,255,0.3); padding-top: 5px; }
.cb-unit-ability-name { font-family: var(--f-term); font-size: 15px; color: #d9b3ff; line-height: 1; }
.cb-unit-ability-desc { font-family: var(--f-term); font-size: 13px; color: #b69ad0; line-height: 1.15; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cb-unit-ability.is-used { opacity: .35; }
/* statuts */
.cb-unit-status { display: flex; gap: 5px; justify-content: center; margin-top: 6px; flex-wrap: wrap; }
.cb-badge {
  font-family: var(--f-term); font-size: 12px; display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 6px; border-radius: 5px; border: 1px solid currentColor; line-height: 1.4;
}
.cb-badge--poison { color: #7cdf30; background: rgba(50,120,10,0.2); }
.cb-badge--stun { color: #ffcc00; background: rgba(120,100,10,0.2); }
.cb-badge--shield { color: #44cccc; background: rgba(0,80,80,0.2); }
.cb-badge--buff { color: #ffaa44; background: rgba(120,70,10,0.2); }
/* mal d'invocation */
.cb-unit.is-sick { opacity: .7; }
.cb-sick-badge { position: absolute; top: 6px; right: 6px; font-size: 13px; z-index: 4; }
/* attaquant prêt (liseré) */
.cb-unit.is-ready::after {
  content: ''; position: absolute; inset: 0; border-radius: 7px; pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(var(--primary-rgb), 0.5); animation: cb-slot-pulse 1.6s ease-in-out infinite;
}

/* ===== MAIN (éventail tenu + fiche au survol) ===== */
.cb-handbar {
  flex-shrink: 0; position: relative; height: clamp(190px, 25vh, 218px);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 24px;
  background: none; overflow: visible;
}
/* support / liaison néon qui tient la main */
.cb-hand-dock {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: clamp(330px, 44vw, 580px); height: 70%; z-index: 0; pointer-events: none;
  border: 1px solid rgba(var(--primary-rgb),0.22); border-bottom: none; border-radius: 26px 26px 0 0;
  background: linear-gradient(180deg, rgba(0,28,13,0.5), rgba(0,9,5,0.88));
  box-shadow: 0 -8px 34px rgba(0,0,0,0.45), inset 0 1px 0 rgba(var(--primary-rgb),0.3), 0 0 46px rgba(var(--primary-rgb),0.07);
}
.cb-handbar.is-expanded .cb-hand-dock { width: clamp(380px, 52vw, 640px); }
.cb-hand { display: flex; align-items: flex-end; justify-content: center; gap: 0; position: relative; z-index: 1; padding-bottom: 2px; }
.cb-fan-slot { position: relative; margin: 0 clamp(-22px, -1.4vw, -10px); transition: transform .18s; }
.cb-fan-slot:hover { z-index: 80; }
/* carte (mini version du modèle atelier) */
.cb-card {
  --cc: #8a8a8a; --cc-rgb: 138,138,138;
  width: clamp(120px, 9.5vw, 138px); height: clamp(170px, 22.5vh, 198px);
  border-radius: 13px; border: 2px solid rgba(var(--cc-rgb),0.7); overflow: hidden; position: relative; cursor: pointer;
  display: flex; flex-direction: column; background: rgba(3,8,6,0.98);
  box-shadow: 0 7px 18px rgba(0,0,0,0.5), 0 0 14px rgba(var(--cc-rgb), 0.28);
  transform: rotate(var(--rot, 0deg)) translateY(var(--arc, 0px)); transform-origin: 50% 120%;
  transition: transform .18s, box-shadow .2s;
}
/* bandeau rareté */
.cb-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 34px; z-index: 0;
  background: linear-gradient(115deg, var(--cc) 0%, rgba(var(--cc-rgb),0.55) 45%, transparent 100%); }
/* header */
.cb-card-banner { position: relative; z-index: 1; display: flex; align-items: center; gap: 5px; padding: 5px 6px 3px; height: 34px; }
.cb-card-elem-badge { width: 24px; height: 24px; flex-shrink: 0; border-radius: 7px; font-size: 12px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.22); }
.cb-card-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cb-card-name { font-family: var(--f-pixel); font-size: 6px; color: #fff; letter-spacing: .3px; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px rgba(0,0,0,0.6); }
.cb-card-rarity { font-family: var(--f-pixel); font-size: 5px; letter-spacing: 1px; color: rgba(255,255,255,0.65); }
.cb-card-mana { flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-family: var(--f-pixel); font-size: 8px;
  color: #1a0d00; background: radial-gradient(circle at 38% 32%, #fff5c8, #ffc800 55%, #9a7000);
  border: 1.5px solid rgba(255,255,255,0.55); box-shadow: 0 0 8px rgba(255,200,0,0.55); }
/* illustration */
.cb-card-art { flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: clamp(28px, 3.8vh, 38px); margin: 3px 7px 0;
  border-radius: 8px; background: radial-gradient(circle at 50% 38%, rgba(var(--cc-rgb),0.18), rgba(0,0,0,0.45)); }
/* pastilles ATK / DEF */
.cb-card-statline { display: flex; gap: 4px; padding: 4px 5px 3px; }
.cb-card-atk, .cb-card-def { flex: 1; font-family: var(--f-pixel); font-size: 7px; color: #fff; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; gap: 2px; padding: 4px 2px;
  text-shadow: 0 1px 1px rgba(0,0,0,0.5); }
.cb-card-atk { background: rgba(255,80,52,0.9); }
.cb-card-def { background: rgba(60,135,255,0.88); }
/* barre HP */
.cb-card-hpzone { display: flex; align-items: center; gap: 4px; padding: 2px 5px 5px; }
.cb-card-hpic { font-size: 9px; color: #84ff92; flex-shrink: 0; line-height: 1; }
.cb-card-hpbar { flex: 1; height: 5px; border-radius: 3px; background: rgba(0,0,0,0.45); overflow: hidden; }
.cb-card-hpbar span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #22bb44, #66ff88); box-shadow: 0 0 6px rgba(70,220,110,0.5); }
.cb-card-hpval { font-family: var(--f-pixel); font-size: 6px; color: #84ff92; flex-shrink: 0; }
.cb-fan-slot:hover .cb-card { transform: translateY(-20px) rotate(0deg) scale(1.06); box-shadow: 0 20px 38px rgba(0,0,0,0.6), 0 0 28px rgba(var(--cc-rgb), 0.55); }
.cb-card.is-selected { transform: translateY(-22px) rotate(0deg) scale(1.08) !important; outline: 2px solid var(--cc); outline-offset: 1px; box-shadow: 0 22px 40px rgba(0,0,0,0.65), 0 0 32px rgba(var(--cc-rgb), 0.7) !important; }
.cb-card.is-unplayable { opacity: .46; cursor: not-allowed; filter: saturate(.55); }
.cb-fan-slot:hover .cb-card.is-unplayable { transform: translateY(-8px) rotate(0deg); }

/* ----- fiche détaillée au survol ----- */
.cb-preview {
  position: absolute; left: 50%; bottom: calc(100% + 14px); width: 258px;
  transform: translateX(-50%) translateY(12px) scale(.96); transform-origin: bottom center;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 90;
}
.cb-fan-slot:hover .cb-preview { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.cb-pcard {
  --pc: var(--cc); --pc-rgb: var(--cc-rgb);
  position: relative; border: 2px solid var(--pc); border-radius: 14px; padding: 14px 15px 15px;
  background: linear-gradient(160deg, rgba(8,16,10,0.88), rgba(3,8,5,0.9));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 18px 48px rgba(0,0,0,0.6), 0 0 34px rgba(var(--pc-rgb), 0.3);
}
.cb-pcard::after {
  content: ''; position: absolute; left: 50%; bottom: -8px; width: 14px; height: 14px; transform: translateX(-50%) rotate(45deg);
  background: rgba(3,8,5,0.9); border-right: 2px solid var(--pc); border-bottom: 2px solid var(--pc);
}
.cb-pc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cb-pc-elem { font-size: 15px; }
.cb-pc-name { font-family: var(--f-pixel); font-size: 10px; color: #fff; letter-spacing: .5px; flex: 1; text-align: center; }
.cb-pc-mana { font-family: var(--f-pixel); font-size: 9px; color: #000; background: radial-gradient(circle, #ffe98a, var(--amber)); width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 0 10px rgba(var(--amber-rgb), 0.5); }
.cb-pc-hero { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.cb-pc-emoji {
  width: 58px; height: 58px; flex-shrink: 0; border-radius: 10px; font-size: 32px;
  display: flex; align-items: center; justify-content: center; border: 1px solid rgba(var(--pc-rgb), 0.4);
  background: radial-gradient(circle, rgba(var(--pc-rgb), 0.18), rgba(0,0,0,0.5));
}
.cb-pc-stats { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.cb-pc-srow { display: flex; align-items: center; gap: 7px; }
.cb-pc-slab { font-family: var(--f-pixel); font-size: 7px; width: 24px; flex-shrink: 0; }
.cb-pc-strack { flex: 1; height: 7px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; }
.cb-pc-sfill { height: 100%; border-radius: 4px; }
.cb-pc-sval { font-family: var(--f-term); font-size: 15px; width: 22px; text-align: right; flex-shrink: 0; }
.cb-pc-box { border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
.cb-pc-box--ability { border: 1px solid rgba(204,68,255,0.35); background: rgba(204,68,255,0.07); }
.cb-pc-box--passive { border: 1px solid rgba(255,170,68,0.32); background: rgba(255,170,68,0.06); }
.cb-pc-box-head { font-family: var(--f-pixel); font-size: 8px; letter-spacing: .5px; display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.cb-pc-box--ability .cb-pc-box-head { color: #cc88ff; }
.cb-pc-box--passive .cb-pc-box-head { color: #ffaa44; }
.cb-pc-box-cost { font-family: var(--f-term); font-size: 13px; color: var(--amber); }
.cb-pc-box-desc { font-family: var(--f-term); font-size: 16px; color: #d2dfd2; line-height: 1.25; }
.cb-card--feu { --cc: #ff5a3c; --cc-rgb: 255,90,60; }
.cb-card--eau { --cc: #4ba3ff; --cc-rgb: 75,163,255; }
.cb-card--terre { --cc: #6bcf4a; --cc-rgb: 107,207,74; }
.cb-card--lumiere { --cc: #ffd24a; --cc-rgb: 255,210,74; }
.cb-card--ombre { --cc: #c06bff; --cc-rgb: 192,107,255; }
.cb-card-mana {
/* gemme énergie mini-carte — dans le header flex, pas absolue */
.cb-card-mana {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-family: var(--f-pixel); font-size: 8px;
  color: #1a0d00; background: radial-gradient(circle at 38% 32%, #fff5c8, #ffc800 55%, #9a7000);
  border: 1.5px solid rgba(255,255,255,0.55); box-shadow: 0 0 8px rgba(255,200,0,0.55);
}
.cb-card-emoji { flex: 1; display: flex; align-items: center; justify-content: center; font-size: clamp(26px, 3.4vh, 34px);
  margin: 0 5px 0; border-radius: 7px; background: radial-gradient(circle at 50% 38%, rgba(var(--cc-rgb),0.18), rgba(0,0,0,0.45)); }
.cb-card-elem { display: none; }
.cb-card-name { font-family: var(--f-pixel); font-size: 6px; color: #f0f8ef; text-align: center; line-height: 1.4; padding: 4px 3px 2px; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }
.cb-card-stats { display: flex; justify-content: center; gap: 8px; line-height: 1; white-space: nowrap; padding: 3px 2px 5px;
  border-top: 1px solid rgba(var(--cc-rgb),0.2); background: linear-gradient(0deg, rgba(var(--cc-rgb),0.22), transparent); }0deg, rgba(0,0,0,0.5), transparent); }
.cb-card-atk, .cb-card-hp { font-family: var(--f-term); display: inline-flex; align-items: center; gap: 2px; text-shadow: 0 1px 2px rgba(0,0,0,0.7); }
.cb-card-atk { font-size: 15px; color: #ff9075; } .cb-card-hp { font-size: 17px; color: #84ff92; }
.cb-card-atk { color: #ff8a72; } .cb-card-def { color: #7bc0ff; } .cb-card-hp { color: #7ee27e; }

/* raretés pour mini-cartes (après les éléments pour les surcharger) */
.cb-card.rarity--common    { --cc: #9a9a9a; --cc-rgb: 154,154,154; }
.cb-card.rarity--uncommon  { --cc: #4bcf7f; --cc-rgb: 75,207,127; }
.cb-card.rarity--rare      { --cc: #4b9fff; --cc-rgb: 75,159,255; }
.cb-card.rarity--epic      { --cc: #c06bff; --cc-rgb: 192,107,255; }
.cb-card.rarity--legendary { --cc: #ffd24a; --cc-rgb: 255,210,74; }

/* main ennemie (face cachée) — en haut */
.cb-enemy-hand { display: flex; gap: 4px; justify-content: center; flex-shrink: 0; }
.cb-enemy-back {
  width: 28px; height: 40px; border-radius: 5px; border: 1px solid rgba(var(--combat-rgb), 0.35);
  background: repeating-linear-gradient(45deg, rgba(var(--combat-rgb),0.12) 0 5px, rgba(0,0,0,0.4) 5px 10px);
  display: flex; align-items: center; justify-content: center; font-family: var(--f-pixel); font-size: 10px; color: rgba(var(--combat-rgb), 0.6);
}

/* bouton Tweaks intégré */
.cb-tweaks-btn {
  position: fixed; bottom: 16px; left: 16px; z-index: 95;
  font-family: var(--f-pixel); font-size: 8px; letter-spacing: 1px; cursor: pointer;
  color: var(--ink-mute); background: rgba(3,8,6,0.92); border: 1px solid var(--primary-border);
  border-radius: 9px; padding: 8px 12px; transition: color .15s, border-color .15s, box-shadow .15s;
}
.cb-tweaks-btn:hover { color: var(--primary); border-color: rgba(var(--primary-rgb),0.5); box-shadow: 0 0 14px rgba(var(--primary-rgb),0.18); }
.cb-endturn {
  position: absolute; right: clamp(14px, 3vw, 40px); bottom: clamp(16px, 2.6vh, 28px); z-index: 6;
  font-family: var(--f-pixel); font-size: 10px; letter-spacing: 1px; cursor: pointer;
  color: #04140a; background: linear-gradient(180deg, #3fdc63, var(--primary-dim)); border: none; border-radius: 12px;
  padding: 13px 20px; box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 16px rgba(var(--primary-rgb), 0.22); transition: filter .2s, box-shadow .2s, transform .2s, background .2s; display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.cb-endturn:hover { filter: brightness(1.08); box-shadow: 0 6px 22px rgba(0,0,0,0.5), 0 0 32px rgba(var(--primary-rgb), 0.45); transform: translateY(-2px); }
.cb-endturn small { font-family: var(--f-term); font-size: 13px; color: rgba(0,0,0,0.65); letter-spacing: 0; }
.cb-endturn.is-ready { animation: cb-endturn-pulse 2.4s ease-in-out infinite; }
@keyframes cb-endturn-pulse { 0%,100% { box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 14px rgba(var(--primary-rgb),0.2); } 50% { box-shadow: 0 4px 18px rgba(0,0,0,0.45), 0 0 30px rgba(var(--primary-rgb),0.45); } }
.cb-endturn.is-pending { background: linear-gradient(180deg, #ffd24a, #e0a800); }
.cb-endturn.is-pending small { color: rgba(40,20,0,0.72); }

/* ===== JOURNAL DE COMBAT ===== */
.cb-log-btn {
  position: fixed; bottom: 16px; left: 16px; z-index: 90; font-family: var(--f-pixel); font-size: 8px; letter-spacing: .5px;
  color: #44ccff; background: rgba(0,12,18,0.9); border: 1px solid rgba(68,204,255,0.4); border-radius: 9px; padding: 11px 14px; cursor: pointer; transition: all .2s;
  display: flex; align-items: center; gap: 7px;
}
.cb-log-btn:hover { box-shadow: 0 0 14px rgba(68,204,255,0.3); border-color: #44ccff; }
.cb-log-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 320px; max-width: 86vw; z-index: 110;
  background: rgba(3,8,12,0.98); border-left: 1px solid rgba(68,204,255,0.25);
  transform: translateX(100%); transition: transform .28s ease; display: flex; flex-direction: column;
  box-shadow: -10px 0 40px rgba(0,0,0,0.6);
}
.cb-log-panel.open { transform: translateX(0); }
.cb-log-head { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid rgba(68,204,255,0.2); }
.cb-log-title { font-family: var(--f-pixel); font-size: 10px; color: #44ccff; letter-spacing: 1px; }
.cb-log-close { background: none; border: none; color: var(--ink-mute); font-size: 20px; cursor: pointer; transition: color .15s; }
.cb-log-close:hover { color: var(--combat); }
.cb-log-entries { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 7px; }
.cb-log-entry { font-family: var(--f-term); font-size: 16px; line-height: 1.25; padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.cb-log-entry .t { opacity: .5; font-size: 13px; margin-right: 6px; }
.log-deploy { color: #44ccff; } .log-pattack { color: #44ff44; } .log-eattack { color: #ff6644; }
.log-ability { color: #cc88ff; } .log-ko { color: #ff4444; font-weight: bold; } .log-shield { color: #44cccc; }
.log-poison { color: #7cdf30; } .log-draw { color: #888; } .log-turn { color: #ffaa00; }
.cb-log-scrim { position: fixed; inset: 0; z-index: 105; background: rgba(0,0,0,0.4); display: none; }
.cb-log-scrim.show { display: block; }

/* ===== OVERLAY RÉSULTAT ===== */
.cb-result { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; background: rgba(2,4,3,0.9); }
.cb-result.show { display: flex; }
.cb-result-box {
  --rc: var(--primary); --rc-rgb: var(--primary-rgb);
  text-align: center; padding: 44px 56px; border: 2px solid var(--rc); border-radius: 16px;
  background: radial-gradient(ellipse at 50% 0%, rgba(var(--rc-rgb), 0.12), rgba(0,6,3,0.96));
  box-shadow: 0 0 60px rgba(var(--rc-rgb), 0.3);
}
.cb-result-box--lose { --rc: var(--combat); --rc-rgb: var(--combat-rgb); }
.cb-result-title { font-family: var(--f-pixel); font-size: 34px; color: var(--rc); text-shadow: 0 0 26px rgba(var(--rc-rgb), 0.5); margin-bottom: 14px; }
.cb-result-sub { font-family: var(--f-term); font-size: 20px; color: var(--ink-mute); margin-bottom: 12px; }
.cb-result-rewards { display: flex; gap: 18px; justify-content: center; margin: 22px 0; }
.cb-result-rew { font-family: var(--f-term); font-size: 19px; color: var(--amber); }
.cb-result-btns { display: flex; gap: 12px; justify-content: center; }
.cb-result-btn { font-family: var(--f-pixel); font-size: 10px; color: #04140a; background: var(--rc); border: none; border-radius: 9px; padding: 14px 20px; cursor: pointer; transition: all .2s; }
.cb-result-btn--ghost { color: var(--ink-mute); background: none; border: 1px solid var(--primary-border); }
.cb-result-btn:hover { filter: brightness(1.1); }

/* ===== RESPONSIVE ===== */
@media (max-width: 760px) {
  .cb-hud { flex-wrap: wrap; gap: 10px; }
  .cb-hero { flex-wrap: wrap; gap: 10px; }
  .cb-slot { min-height: 116px; }
  .cb-unit-ability-desc { display: none; }
  .cb-hand { padding: 0 40px; }
  .cb-fan-slot { margin: 0 -14px; }
  .cb-endturn { right: 12px; bottom: 12px; padding: 12px 16px; }
}
@media (max-width: 520px) {
  .cb-field { gap: 7px; }
  .cb-card { width: 84px; height: 116px; }
  .cb-fan-slot { margin: 0 -10px; }
  .cb-unit-emoji { font-size: 24px; }
}

/* ===== ÉCRANS PEU HAUTS (petit PC) — on réduit, on ne masque rien ===== */
@media (max-height: 820px) {
  .cb-top { height: 48px; min-height: 48px; }
  .cb-hud { padding: 5px 18px; gap: clamp(10px, 2vw, 22px); }
  .cb-hero-av { width: 36px; height: 36px; font-size: 18px; }
  .cb-battle { gap: 7px; padding: 7px 16px; }
  .cb-slot { min-height: clamp(104px, 15vh, 132px); border-radius: 9px; }
  .cb-unit { padding: 6px 7px; }
  .cb-unit-emoji { font-size: clamp(20px, 3vh, 26px); margin: 0 0 2px; }
  .cb-unit-name { margin-bottom: 3px; font-size: 6px; }
  .cb-unit-stats { margin-bottom: 3px; font-size: 14px; }
  .cb-unit-ability { margin-top: 4px; padding-top: 3px; }
  .cb-unit-ability-name { font-size: 12px; }
  .cb-unit-ability-desc { font-size: 11px; }
  .cb-unit-status { margin-top: 4px; }
  .cb-handbar { height: clamp(108px, 14vh, 126px); padding-bottom: 9px; }
  .cb-card { height: clamp(98px, 13vh, 116px); }
  .cb-card-emoji { font-size: clamp(20px, 2.6vh, 28px); margin: 13px 5px 0; }
}
@media (max-height: 660px) {
  .cb-hud { padding: 4px 16px; }
  .cb-hero-main { width: clamp(130px, 20vw, 200px); }
  .cb-battle { gap: 5px; padding: 5px 16px; }
  .cb-slot { min-height: clamp(92px, 13.5vh, 116px); }
  .cb-unit { padding: 5px 6px; }
  .cb-unit-emoji { font-size: clamp(18px, 2.6vh, 22px); }
  .cb-unit-name { font-size: 5px; line-height: 1.3; }
  .cb-unit-stats { font-size: 13px; gap: 8px; margin-bottom: 2px; }
  .cb-unit-hp-txt { font-size: 6px; }
  .cb-unit-ability { margin-top: 3px; padding-top: 2px; }
  .cb-unit-ability-name { font-size: 11px; }
  .cb-unit-ability-desc { font-size: 10px; line-height: 1.05; }
  .cb-badge { font-size: 10px; }
  .cb-handbar { height: 104px; }
  .cb-card { width: clamp(70px, 6vw, 82px); height: clamp(90px, 12.5vh, 104px); }
}

/* =========================================================
   ===============   COUCHE FX / FEEDBACK   ================
   Annonces, tirage pile/face, explication de capacité,
   animations d'attaque, visuels de déploiement, faisceaux.
   ========================================================= */

/* ---------- secousse d'écran ---------- */
.cb-root.is-shake { animation: cb-shake .4s cubic-bezier(.36,.07,.19,.97); }
@keyframes cb-shake {
  10%,90% { transform: translate3d(-2px,0,0); }
  20%,80% { transform: translate3d(4px,0,0); }
  30%,50%,70% { transform: translate3d(-7px,0,0); }
  40%,60% { transform: translate3d(7px,0,0); }
}
@media (prefers-reduced-motion: reduce) { .cb-root.is-shake { animation: none; } }

/* ====================================================
   ANNONCES — bandeaux centraux (système de pop-up)
   ==================================================== */
.cb-announce-layer {
  position: fixed; top: 19%; left: 0; right: 0; z-index: 250;
  display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none;
}
.cb-announce {
  --ac: var(--primary); --ac-rgb: var(--primary-rgb);
  font-family: var(--f-pixel); font-size: 15px; letter-spacing: 1px; color: #fff;
  padding: 14px 26px; border-radius: 12px; white-space: nowrap;
  background: linear-gradient(180deg, rgba(var(--ac-rgb),0.22), rgba(3,7,5,0.94));
  border: 2px solid var(--ac); box-shadow: 0 0 34px rgba(var(--ac-rgb),0.4), inset 0 0 20px rgba(var(--ac-rgb),0.12);
  text-shadow: 0 0 16px rgba(var(--ac-rgb),0.7);
  display: flex; align-items: center; gap: 12px;
  opacity: 1;
  animation: cb-ann-in .34s cubic-bezier(.2,1.4,.4,1), cb-ann-out .34s ease-in var(--hold, 1.7s) forwards;
}
.cb-announce small { font-family: var(--f-term); font-size: 17px; letter-spacing: 0; color: rgba(255,255,255,0.78); text-shadow: none; }
.cb-announce-ic { font-size: 19px; line-height: 1; }
.cb-announce--turn   { --ac: var(--amber);   --ac-rgb: var(--amber-rgb); }
.cb-announce--deploy { --ac: var(--primary); --ac-rgb: var(--primary-rgb); }
.cb-announce--ability{ --ac: #cc88ff; --ac-rgb: 204,136,255; }
.cb-announce--pattack{ --ac: var(--primary); --ac-rgb: var(--primary-rgb); }
.cb-announce--eattack{ --ac: var(--combat); --ac-rgb: var(--combat-rgb); }
.cb-announce--combo  { --ac: var(--amber); --ac-rgb: var(--amber-rgb); font-size: 19px; }
.cb-announce--ko     { --ac: var(--combat); --ac-rgb: var(--combat-rgb); font-size: 18px; }
@keyframes cb-ann-in  { from { transform: translateY(-22px) scale(.9); } to { transform: none; } }
@keyframes cb-ann-out { to { opacity: 0; transform: translateY(-14px) scale(.96); } }

/* ====================================================
   TIRAGE PILE / FACE (porté de la page Pile ou Face)
   ==================================================== */
.cb-cf-overlay {
  position: fixed; inset: 0; z-index: 320; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 26px;
  background: radial-gradient(ellipse at 50% 35%, rgba(var(--primary-rgb),0.08), rgba(2,4,3,0.93) 60%);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  animation: cb-fade-in .3s ease both;
}
.cb-cf-overlay.is-out { animation: cb-fade-out .4s ease forwards; }
@keyframes cb-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes cb-fade-out { to { opacity: 0; } }
.cb-cf-head { font-family: var(--f-pixel); font-size: 13px; color: var(--primary); letter-spacing: 2px; text-shadow: 0 0 16px rgba(var(--primary-rgb),0.5); }
.cb-cf-scene { position: relative; perspective: 1000px; width: 220px; height: 230px; display: flex; align-items: center; justify-content: center; }
.cb-cf-shadow { position: absolute; bottom: 4px; width: 130px; height: 22px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0,0,0,0.6), rgba(var(--primary-rgb),0.18) 55%, transparent 72%); filter: blur(4px);
  animation: cb-cf-shadow var(--cf-dur,2.2s) cubic-bezier(.45,0,.35,1); }
@keyframes cb-cf-shadow { 0%,100% { transform: scale(1); opacity: .9; } 50% { transform: scale(.5); opacity: .28; } }
.cb-cf-coin { position: relative; width: 172px; height: 172px; transform-style: preserve-3d; --cf-t: 9px; }
.cb-cf-coin.spin-pile { animation: cb-cf-pile var(--cf-dur,2.2s) cubic-bezier(.42,0,.3,1) forwards; }
.cb-cf-coin.spin-face { animation: cb-cf-face var(--cf-dur,2.2s) cubic-bezier(.42,0,.3,1) forwards; }

/* ----- faces métalliques ----- */
.cb-cf-face {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  border: 6px solid var(--cf-c, var(--primary));
  box-shadow: 0 0 42px var(--cf-glow, rgba(var(--primary-rgb),0.45)),
    inset 0 0 30px rgba(0,0,0,0.5), inset 0 4px 10px rgba(255,255,255,0.18), inset 0 -6px 14px rgba(0,0,0,0.55);
}
.cb-cf-face--pile {
  --cf-c: #00ff7a; --cf-glow: rgba(0,255,90,0.45); transform: translateZ(var(--cf-t));
  background:
    radial-gradient(circle at 36% 28%, rgba(225,255,235,0.55), transparent 46%),
    radial-gradient(circle at 72% 80%, rgba(0,0,0,0.5), transparent 52%),
    conic-gradient(from 215deg, #053a1a, #1bd968, #064b22, #16c057, #053a1a, #0c7a38, #053a1a);
}
.cb-cf-face--face {
  --cf-c: #ffd24a; --cf-glow: rgba(255,204,0,0.45); transform: rotateX(180deg) translateZ(var(--cf-t));
  background:
    radial-gradient(circle at 36% 28%, rgba(255,250,225,0.6), transparent 46%),
    radial-gradient(circle at 72% 80%, rgba(50,28,0,0.55), transparent 52%),
    conic-gradient(from 215deg, #5a3d00, #ffd451, #7a5200, #ffe48a, #5a3d00, #c79520, #5a3d00);
}
/* anneau intérieur frappé */
.cb-cf-ring { position: absolute; inset: 16px; border-radius: 50%; pointer-events: none;
  border: 2px solid rgba(255,255,255,0.22); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.4), inset 0 0 18px rgba(0,0,0,0.4); }
/* glyphe en relief */
.cb-cf-glyph { position: relative; z-index: 2; font-family: var(--f-pixel); font-size: 58px; line-height: 1;
  text-shadow: 0 2px 1px rgba(0,0,0,0.55), 0 -1px 0 rgba(255,255,255,0.4), 0 0 20px var(--cf-glow, rgba(var(--primary-rgb),0.6)); }
.cb-cf-face--pile .cb-cf-glyph { color: #d8ffe6; }
.cb-cf-face--face .cb-cf-glyph { color: #fff3cf; }
.cb-cf-lab { position: relative; z-index: 2; font-family: var(--f-pixel); font-size: 11px; letter-spacing: 3px;
  text-shadow: 0 1px 1px rgba(0,0,0,0.6); }
.cb-cf-face--pile .cb-cf-lab { color: #9dffc4; }
.cb-cf-face--face .cb-cf-lab { color: #ffe49a; }
/* reflet spéculaire qui balaie */
.cb-cf-shine { position: absolute; inset: -20%; z-index: 3; pointer-events: none;
  background: linear-gradient(118deg, transparent 38%, rgba(255,255,255,0.55) 49%, rgba(255,255,255,0.15) 53%, transparent 62%);
  animation: cb-cf-shine 2.6s ease-in-out infinite; }
@keyframes cb-cf-shine { 0%,100% { transform: translateX(-46%) rotate(8deg); } 50% { transform: translateX(46%) rotate(8deg); } }

/* ----- tranche (épaisseur 3D, disques empilés) ----- */
.cb-cf-edge { position: absolute; inset: 0; transform-style: preserve-3d; }
.cb-cf-edge span { position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(180deg, #1a6b38 0%, #0a3a1e 42%, #04200f 70%, #0d4524 100%);
  box-shadow: inset 0 0 12px rgba(0,0,0,0.6); }

@keyframes cb-cf-pile {
  0%   { transform: translateY(0)     rotateX(0deg); }
  50%  { transform: translateY(-178px) rotateX(900deg); }
  90%  { transform: translateY(0)     rotateX(1816deg); }
  100% { transform: translateY(0)     rotateX(1800deg); }
}
@keyframes cb-cf-face {
  0%   { transform: translateY(0)     rotateX(0deg); }
  50%  { transform: translateY(-178px) rotateX(990deg); }
  90%  { transform: translateY(0)     rotateX(1996deg); }
  100% { transform: translateY(0)     rotateX(1980deg); }
}
.cb-cf-result { min-height: 46px; text-align: center; }
.cb-cf-result-line { font-family: var(--f-pixel); font-size: 16px; letter-spacing: 1px; opacity: 0; }
.cb-cf-result-line.show { opacity: 1; animation: cb-ann-in .4s cubic-bezier(.2,1.4,.4,1); }
.cb-cf-result-line .who { color: var(--amber); text-shadow: 0 0 14px rgba(var(--amber-rgb),0.5); }
.cb-cf-result-sub { font-family: var(--f-term); font-size: 16px; color: var(--ink-mute); margin-top: 8px; opacity: 0; }
.cb-cf-result-sub.show { opacity: 1; animation: cb-ann-in .4s ease; }
@media (prefers-reduced-motion: reduce) {
  .cb-cf-coin.spin-pile, .cb-cf-coin.spin-face, .cb-cf-shadow { animation-duration: .01s; }
  .cb-cf-shine { animation: none; }
}

/* ====================================================
   FICHE D'EXPLICATION DE CAPACITÉ (que se passe-t-il ?)
   ==================================================== */
.cb-explain-scrim {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: flex-start;
  pointer-events: none; background: transparent;
  padding: 20px clamp(16px, 3vw, 44px);
}
.cb-explain {
  --xc: #cc88ff; --xc-rgb: 204,136,255;
  width: min(380px, 92vw); pointer-events: auto; border: 2px solid var(--xc); border-radius: 18px; position: relative; overflow: hidden;
  background: linear-gradient(165deg, rgba(18,8,26,0.97), rgba(4,6,9,0.98));
  box-shadow: 0 24px 70px rgba(0,0,0,0.7), 0 0 50px rgba(var(--xc-rgb),0.3);
  opacity: 1; animation: cb-explain-slide .42s cubic-bezier(.2,1.2,.4,1);
}
@keyframes cb-explain-slide { from { transform: translateX(-32px) scale(.97); } to { transform: none; } }
.cb-explain--enemy { --xc: var(--combat); --xc-rgb: var(--combat-rgb); }
@keyframes cb-explain-in { from { transform: translateY(24px) scale(.94); } to { transform: none; } }
.cb-explain-bar {
  font-family: var(--f-pixel); font-size: 9px; letter-spacing: 1px; color: #04140a;
  background: var(--xc); padding: 9px 16px; display: flex; align-items: center; gap: 9px;
}
.cb-explain-bar .who { color: rgba(0,0,0,0.62); }
.cb-explain-body { padding: 18px 20px 20px; }
.cb-explain-name { font-family: var(--f-pixel); font-size: 18px; color: var(--xc); letter-spacing: 1px; text-shadow: 0 0 18px rgba(var(--xc-rgb),0.5); text-align: center; line-height: 1.4; }
/* schéma source -> cible */
.cb-explain-flow { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0; }
.cb-explain-actor { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 96px; }
.cb-explain-av {
  width: 60px; height: 60px; border-radius: 13px; font-size: 32px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--col, #888); background: radial-gradient(circle, rgba(255,255,255,0.06), rgba(0,0,0,0.5));
}
.cb-explain-actor.is-target .cb-explain-av { animation: cb-target-pop 1.1s ease-in-out infinite; }
@keyframes cb-target-pop { 0%,100% { box-shadow: 0 0 0 rgba(var(--combat-rgb),0); } 50% { box-shadow: 0 0 22px rgba(var(--combat-rgb),0.6); } }
.cb-explain-actor-name { font-family: var(--f-pixel); font-size: 7px; color: #cdd; text-align: center; line-height: 1.4; }
.cb-explain-actor-role { font-family: var(--f-pixel); font-size: 6px; letter-spacing: 1px; }
.cb-explain-arrow { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--xc); flex-shrink: 0; }
.cb-explain-arrow-line { font-size: 26px; line-height: 1; animation: cb-arrow-slide 1s ease-in-out infinite; }
@keyframes cb-arrow-slide { 0%,100% { transform: translateX(-3px); opacity: .6; } 50% { transform: translateX(3px); opacity: 1; } }
.cb-explain-arrow-lab { font-family: var(--f-pixel); font-size: 6px; letter-spacing: 1px; color: var(--xc); white-space: nowrap; }
/* effets concrets */
.cb-explain-effects { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.cb-explain-eff {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
  font-family: var(--f-term); font-size: 17px; color: #dfe7df; line-height: 1.2;
  border: 1px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.32);
}
.cb-explain-eff-ic { font-size: 17px; flex-shrink: 0; }
.cb-explain-eff--bad  { border-color: rgba(var(--combat-rgb),0.4); color: #ffb3b3; }
.cb-explain-eff--good { border-color: rgba(var(--primary-rgb),0.35); }
.cb-explain-eff b { color: #fff; font-weight: 400; }
.cb-explain-plain {
  font-family: var(--f-term); font-size: 17px; color: var(--ink-mute); line-height: 1.3;
  text-align: center; padding: 10px 6px 0; border-top: 1px dashed rgba(255,255,255,0.12); margin-top: 4px;
}
.cb-explain-btn {
  margin-top: 16px; width: 100%; font-family: var(--f-pixel); font-size: 11px; letter-spacing: 1px; cursor: pointer;
  color: #04140a; background: var(--xc); border: none; border-radius: 11px; padding: 14px; transition: filter .15s, transform .1s;
}
.cb-explain-btn:hover { filter: brightness(1.1); }
.cb-explain-btn:active { transform: scale(.98); }
.cb-explain-timer { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--xc); animation: cb-timer var(--xtimer,4s) linear forwards; }
@keyframes cb-timer { from { width: 100%; } to { width: 0; } }
/* PC : fiche dockée à gauche, écran libre. Mobile : modale centrée. */
@media (max-width: 760px) {
  .cb-explain-scrim { justify-content: center; pointer-events: auto; background: rgba(2,4,3,0.66); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); padding: 18px; }
  .cb-explain { width: min(440px, 94vw); animation: cb-explain-in .4s cubic-bezier(.2,1.3,.4,1); }
}

/* ====================================================
   COUCHE FX TRANSITOIRE — faisceau, réticule, slash, dégâts
   ==================================================== */
.cb-fx-layer { position: fixed; inset: 0; z-index: 240; pointer-events: none; overflow: hidden; }
.cb-fx-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cb-beam-path { fill: none; stroke-width: 3; stroke-linecap: round; filter: drop-shadow(0 0 6px currentColor); }
.cb-beam-dash { stroke-dasharray: 9 10; animation: cb-beam-march .5s linear infinite; }
@keyframes cb-beam-march { to { stroke-dashoffset: -38; } }
/* réticule sur cible */
.cb-reticle {
  position: absolute; width: 86px; height: 86px; transform: translate(-50%,-50%);
  border: 2px solid var(--combat); border-radius: 50%; box-shadow: 0 0 18px rgba(var(--combat-rgb),0.5), inset 0 0 14px rgba(var(--combat-rgb),0.3);
  animation: cb-reticle-spin 2.4s linear infinite;
}
.cb-reticle::before, .cb-reticle::after { content: ''; position: absolute; background: var(--combat); box-shadow: 0 0 8px var(--combat); }
.cb-reticle::before { left: 50%; top: -8px; bottom: -8px; width: 2px; transform: translateX(-50%); }
.cb-reticle::after  { top: 50%; left: -8px; right: -8px; height: 2px; transform: translateY(-50%); }
@keyframes cb-reticle-spin { to { transform: translate(-50%,-50%) rotate(360deg); } }
/* éclat de coup */
.cb-slash {
  position: absolute; transform: translate(-50%,-50%); width: 120px; height: 120px;
  background:
    linear-gradient(45deg, transparent 46%, #fff 49%, #fff 51%, transparent 54%),
    linear-gradient(-45deg, transparent 47%, rgba(255,90,60,0.9) 50%, transparent 53%);
  filter: drop-shadow(0 0 10px rgba(255,120,60,0.9)); mix-blend-mode: screen;
  animation: cb-slash .42s ease-out forwards;
}
@keyframes cb-slash {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(.4) rotate(-22deg); }
  35% { opacity: 1; transform: translate(-50%,-50%) scale(1.05) rotate(-8deg); }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(1.3) rotate(4deg); }
}
.cb-burst {
  position: absolute; transform: translate(-50%,-50%); width: 90px; height: 90px; border-radius: 50%;
  border: 3px solid var(--bc, #fff); animation: cb-burst .5s ease-out forwards;
}
@keyframes cb-burst { 0% { opacity: .9; transform: translate(-50%,-50%) scale(.2); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.5); } }
/* nombre flottant (dégâts / soin) */
.cb-float {
  position: absolute; transform: translate(-50%,-50%); font-family: var(--f-pixel); font-size: 26px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9); animation: cb-float-up 1.05s cubic-bezier(.2,.8,.3,1) forwards; white-space: nowrap;
}
.cb-float--dmg  { color: #ff5a4a; }
.cb-float--heal { color: #66ff88; }
.cb-float--poison { color: #9cff3a; }
@keyframes cb-float-up { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.6); } 18% { opacity: 1; transform: translate(-50%,-90%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%,-220%) scale(1); } }

/* ====================================================
   ANIMATION D'ATTAQUE (charge de l'unité)
   ==================================================== */
.cb-unit.is-lunging { z-index: 30; animation: cb-lunge .42s cubic-bezier(.5,0,.3,1); }
@keyframes cb-lunge {
  0% { transform: translate(0,0); }
  45% { transform: translate(var(--lx,0), var(--ly,0)) scale(1.08); }
  100% { transform: translate(0,0); }
}
.cb-unit.is-hit { animation: cb-hit .42s ease; }
@keyframes cb-hit { 0%,100% { transform: translate(0,0); } 20% { transform: translate(5px,-3px); } 45% { transform: translate(-6px,2px); filter: brightness(2) saturate(.4); } 70% { transform: translate(3px,0); } }

/* ====================================================
   VISUELS DE DÉPLOIEMENT (où poser sa carte)
   ==================================================== */
.cb-arena.is-targeting .cb-field--player .cb-slot.is-free {
  border-style: solid; border-color: var(--primary); background: rgba(var(--primary-rgb),0.07);
  box-shadow: inset 0 0 26px rgba(var(--primary-rgb),0.16); animation: cb-deploy-glow 1.1s ease-in-out infinite;
}
@keyframes cb-deploy-glow { 0%,100% { box-shadow: inset 0 0 20px rgba(var(--primary-rgb),0.12), 0 0 0 rgba(var(--primary-rgb),0); } 50% { box-shadow: inset 0 0 30px rgba(var(--primary-rgb),0.24), 0 0 22px rgba(var(--primary-rgb),0.32); } }
.cb-deploy-hint {
  display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--primary);
  font-family: var(--f-pixel); font-size: 8px; letter-spacing: 1px; text-align: center; pointer-events: none;
}
.cb-deploy-arrow { font-size: 26px; line-height: 1; animation: cb-deploy-bounce 1s ease-in-out infinite; text-shadow: 0 0 12px rgba(var(--primary-rgb),0.7); }
@keyframes cb-deploy-bounce { 0%,100% { transform: translateY(-3px); } 50% { transform: translateY(4px); } }
/* pop d'apparition au déploiement */
.cb-unit.is-deploying { animation: cb-deploy-pop .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes cb-deploy-pop { 0% { opacity: 0; transform: translateY(18px) scale(.7); } 60% { transform: translateY(0) scale(1.06); } 100% { opacity: 1; transform: none; } }

/* ====================================================
   MODE ATTAQUE — cibles ennemies sélectionnables
   ==================================================== */
.cb-arena.is-attacking .cb-field--enemy .cb-slot:not(.is-free) { cursor: crosshair; }
.cb-arena.is-attacking .cb-field--enemy .cb-unit {
  animation: cb-target-flash 1s ease-in-out infinite;
}
.cb-arena.is-attacking .cb-field--enemy .cb-unit::before {
  content: '⌖ CIBLE'; position: absolute; top: 4px; left: 50%; transform: translateX(-50%); z-index: 6;
  font-family: var(--f-pixel); font-size: 6px; letter-spacing: 1px; color: var(--combat);
  background: rgba(4,4,4,0.8); padding: 3px 6px; border-radius: 5px; border: 1px solid rgba(var(--combat-rgb),0.5);
}
@keyframes cb-target-flash { 0%,100% { box-shadow: 0 0 14px rgba(var(--combat-rgb),0.22); } 50% { box-shadow: 0 0 26px rgba(var(--combat-rgb),0.6); border-color: #fff; } }
/* lanceur d'une capacité (télégraphe) */
.cb-unit.is-casting { z-index: 20; box-shadow: 0 0 28px rgba(204,136,255,0.65), inset 0 0 18px rgba(204,136,255,0.25) !important; animation: cb-cast-pulse .8s ease-in-out infinite; }
@keyframes cb-cast-pulse { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.5); } }
/* attaquant sélectionné */
.cb-unit.is-attacker-sel::after {
  content: ''; position: absolute; inset: -2px; border-radius: 9px; pointer-events: none;
  box-shadow: 0 0 0 2px var(--primary), 0 0 22px rgba(var(--primary-rgb),0.6); animation: none;
}
/* indice cliquable sur une unité prête */
.cb-unit.is-ready { cursor: pointer; }
.cb-unit.is-ready .cb-ready-tag {
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); z-index: 6;
  font-family: var(--f-pixel); font-size: 6px; letter-spacing: 1px; color: #04140a;
  background: var(--primary); padding: 3px 6px; border-radius: 5px; white-space: nowrap;
}

/* ====================================================
   RAIL DÉMO FX
   ==================================================== */
.cb-demo {
  position: fixed; top: 50%; right: 14px; transform: translateY(-50%); z-index: 92;
  display: flex; flex-direction: column; gap: 9px; align-items: stretch;
}
.cb-demo-title { font-family: var(--f-pixel); font-size: 6px; letter-spacing: 1px; color: var(--ink-mute); text-align: center; margin-bottom: 2px; }
.cb-demo-btn {
  font-family: var(--f-pixel); font-size: 7px; letter-spacing: .5px; cursor: pointer; text-align: left;
  color: var(--ink-mute); background: rgba(3,8,6,0.92); border: 1px solid var(--primary-border); border-radius: 9px;
  padding: 9px 11px; transition: all .18s; display: flex; align-items: center; gap: 8px; min-width: 118px;
}
.cb-demo-btn .ic { font-size: 14px; width: 16px; text-align: center; flex-shrink: 0; }
.cb-demo-btn:hover { color: #fff; border-color: rgba(var(--primary-rgb),0.5); box-shadow: 0 0 16px rgba(var(--primary-rgb),0.18); transform: translateX(-3px); }
.cb-demo-btn:disabled { opacity: .35; cursor: not-allowed; transform: none; box-shadow: none; }
.cb-demo-btn--combat:hover { border-color: rgba(var(--combat-rgb),0.5); box-shadow: 0 0 16px rgba(var(--combat-rgb),0.18); }
.cb-demo-btn--combat .ic { color: var(--combat); }
@media (max-width: 900px) {
  .cb-demo { flex-direction: row; top: auto; bottom: 64px; right: 50%; transform: translateX(50%); }
  .cb-demo-title { display: none; }
  .cb-demo-btn { min-width: 0; padding: 8px; }
  .cb-demo-btn span:not(.ic) { display: none; }
}

/* ---------- bandeau d'aide (coachmark) ---------- */
.cb-hint {
  position: fixed; left: 50%; bottom: clamp(120px, 16vh, 150px); transform: translateX(-50%); z-index: 96;
  display: flex; align-items: center; gap: 10px; max-width: 92vw;
  font-family: var(--f-term); font-size: 16px; color: #cfe; line-height: 1.2;
  background: rgba(3,10,7,0.94); border: 1px solid rgba(var(--primary-rgb),0.4); border-radius: 11px;
  padding: 10px 14px; box-shadow: 0 8px 28px rgba(0,0,0,0.5); opacity: 1; animation: cb-ann-in .35s ease;
}
.cb-hint-ic { font-size: 18px; flex-shrink: 0; }
.cb-hint-x { background: none; border: none; color: var(--ink-mute); font-size: 18px; cursor: pointer; padding: 0 2px; }
.cb-hint-x:hover { color: var(--primary); }
.cb-hint b { color: var(--primary); font-weight: 400; }

/* ====================================================
   TOOLTIP STATUT / POUVOIR (semi-transparent, lisible)
   ==================================================== */
.cb-tip {
  position: fixed; z-index: 280; max-width: 252px; min-width: 130px; pointer-events: none;
  transform: translate(-50%, calc(-100% - 13px));
  background: rgba(7,12,9,0.8); backdrop-filter: blur(12px) saturate(1.25); -webkit-backdrop-filter: blur(12px) saturate(1.25);
  border: 1px solid var(--tc, var(--primary)); border-radius: 12px; padding: 11px 13px;
  box-shadow: 0 16px 38px rgba(0,0,0,0.55), 0 0 22px rgba(var(--tc-rgb, var(--primary-rgb)),0.28);
  animation: cb-tip-in .14s ease;
}
@keyframes cb-tip-in { from { transform: translate(-50%, calc(-100% - 4px)); } }
.cb-tip::after {
  content: ''; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; transform: translateX(-50%) rotate(45deg);
  background: rgba(7,12,9,0.92); border-right: 1px solid var(--tc, var(--primary)); border-bottom: 1px solid var(--tc, var(--primary));
}
.cb-tip-title { font-family: var(--f-pixel); font-size: 8px; letter-spacing: .5px; color: var(--tc, var(--primary)); line-height: 1.5; margin-bottom: 7px; text-shadow: 0 0 10px rgba(var(--tc-rgb, var(--primary-rgb)),0.4); }
.cb-tip-body { font-family: var(--f-term); font-size: 16px; color: #e8f1e8; line-height: 1.3; }
.cb-tip--poison  { --tc: #7cdf30; --tc-rgb: 124,223,48; }
.cb-tip--shield  { --tc: #44cccc; --tc-rgb: 68,204,204; }
.cb-tip--stun    { --tc: #ffcc00; --tc-rgb: 255,204,0; }
.cb-tip--buff    { --tc: #ffaa44; --tc-rgb: 255,170,68; }
.cb-tip--ability { --tc: #cc88ff; --tc-rgb: 204,136,255; }
.cb-tip--info    { --tc: var(--primary); --tc-rgb: var(--primary-rgb); }

/* ====================================================
   MENU D'ACTION D'UNE UNITÉ (Attaquer / Pouvoir)
   ==================================================== */
.cb-actmenu-scrim {
  position: fixed; inset: 0; z-index: 270;
  background: rgba(2,4,3,0.42); backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px);
}
.cb-actmenu {
  position: absolute; transform: translateX(-50%);
  width: 300px; max-width: 92vw; border: 2px solid var(--primary); border-radius: 16px; padding: 15px;
  background: linear-gradient(180deg, rgba(8,16,11,0.98), rgba(3,8,5,0.99));
  box-shadow: 0 22px 60px rgba(0,0,0,0.65), 0 0 40px rgba(var(--primary-rgb),0.25);
  animation: cb-actmenu-pop .18s ease;
}
@keyframes cb-actmenu-pop { from { transform: translateX(-50%) scale(.92); } to { transform: translateX(-50%) scale(1); } }
.cb-actmenu::before { content: ''; position: absolute; top: -8px; left: 50%; width: 14px; height: 14px; transform: translateX(-50%) rotate(45deg); background: rgba(8,16,11,0.98); border-left: 2px solid var(--primary); border-top: 2px solid var(--primary); }
.cb-actmenu-head { display: flex; align-items: center; gap: 13px; padding-bottom: 13px; margin-bottom: 13px; border-bottom: 1px solid rgba(var(--primary-rgb),0.2); }
.cb-actmenu-emoji { width: 52px; height: 52px; flex-shrink: 0; border-radius: 12px; font-size: 30px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--ac, var(--primary)); background: radial-gradient(circle, rgba(255,255,255,0.08), rgba(0,0,0,0.5)); }
.cb-actmenu-id { min-width: 0; }
.cb-actmenu-name { font-family: var(--f-pixel); font-size: 11px; color: #fff; letter-spacing: .5px; line-height: 1.4; }
.cb-actmenu-stats { font-family: var(--f-term); font-size: 15px; color: #9fb0a0; margin-top: 5px; }
.cb-actmenu-btns { display: flex; flex-direction: column; gap: 9px; }
.cb-actmenu-btn { display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer; border-radius: 11px; padding: 12px 14px; border: 1px solid var(--bc, var(--primary-border)); background: rgba(var(--bcr, var(--primary-rgb)),0.09); transition: transform .15s, box-shadow .15s, border-color .15s; }
.cb-actmenu-btn .ic { font-size: 22px; width: 26px; text-align: center; flex-shrink: 0; color: var(--bc); }
.cb-actmenu-btxt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cb-actmenu-btxt b { font-family: var(--f-pixel); font-size: 9px; letter-spacing: .5px; color: #fff; }
.cb-actmenu-btxt small { font-family: var(--f-term); font-size: 14px; color: #9fb0a0; line-height: 1.15; }
.cb-actmenu-btn--atk { --bc: #ff7a5c; --bcr: 255,122,92; }
.cb-actmenu-btn--pow { --bc: #cc88ff; --bcr: 204,136,255; }
.cb-actmenu-btn:not(:disabled):hover { transform: translateX(3px); box-shadow: 0 0 16px rgba(var(--bcr),0.25); border-color: var(--bc); }
.cb-actmenu-btn:disabled { opacity: .4; cursor: not-allowed; }
.cb-actmenu-locked { font-family: var(--f-term); font-size: 16px; color: #ffcc66; text-align: center; padding: 8px 6px 4px; line-height: 1.3; }
.cb-actmenu-cancel { width: 100%; margin-top: 12px; font-family: var(--f-pixel); font-size: 8px; letter-spacing: 1px; color: var(--ink-mute); background: none; border: 1px solid var(--primary-border); border-radius: 9px; padding: 11px; cursor: pointer; transition: color .15s, border-color .15s; }
.cb-actmenu-cancel:hover { color: #fff; border-color: rgba(var(--primary-rgb),0.4); }

/* ====================================================
   FLÈCHE DE CIBLAGE (glisser) + cible survolée
   ==================================================== */
.cb-drag-arrow { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 236; pointer-events: none; }
.cb-drag-arrow-path { fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 0 7px currentColor); opacity: .92; }
.cb-drag-arrow-dot { fill: currentColor; filter: drop-shadow(0 0 8px currentColor); }
.cb-unit.is-drag-target { box-shadow: 0 0 0 3px var(--combat), 0 0 28px rgba(var(--combat-rgb),0.7) !important; }
.cb-unit.is-drag-target::after { content: '⌖'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 46px; color: rgba(255,80,80,0.7); pointer-events: none; z-index: 6; }

/* ====================================================
   CONFIRMATION DE FIN DE TOUR (récap)
   ==================================================== */
.cb-confirm-scrim { position: fixed; inset: 0; z-index: 285; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(2,4,3,0.62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.cb-confirm { width: min(380px, 94vw); border: 2px solid var(--amber); border-radius: 16px; padding: 18px 20px 20px; background: linear-gradient(180deg, rgba(18,14,4,0.97), rgba(5,7,4,0.99)); box-shadow: 0 24px 64px rgba(0,0,0,0.7), 0 0 40px rgba(var(--amber-rgb),0.22); animation: cb-explain-slide .28s cubic-bezier(.2,1.2,.4,1); }
.cb-confirm-title { font-family: var(--f-pixel); font-size: 14px; color: var(--amber); letter-spacing: 1px; text-align: center; text-shadow: 0 0 16px rgba(var(--amber-rgb),0.4); }
.cb-confirm-sub { font-family: var(--f-term); font-size: 16px; color: var(--ink-mute); text-align: center; margin: 10px 0 12px; }
.cb-confirm-list { display: flex; flex-direction: column; gap: 7px; max-height: 200px; overflow-y: auto; margin-bottom: 12px; }
.cb-confirm-row { display: flex; align-items: center; gap: 10px; font-family: var(--f-term); font-size: 17px; color: #e6efe6; padding: 8px 11px; border-radius: 9px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); }
.cb-confirm-ic { font-size: 16px; flex-shrink: 0; }
.cb-confirm-empty { font-family: var(--f-term); font-size: 16px; color: var(--ink-mute); text-align: center; padding: 14px; border: 1px dashed rgba(255,255,255,0.12); border-radius: 9px; }
.cb-confirm-meta { font-family: var(--f-term); font-size: 14px; color: var(--ink-mute); text-align: center; margin-bottom: 15px; }
.cb-confirm-meta b { color: var(--amber); }
.cb-confirm-btns { display: flex; gap: 10px; }
.cb-confirm-btn { flex: 1; font-family: var(--f-pixel); font-size: 9px; letter-spacing: .5px; cursor: pointer; border-radius: 11px; padding: 13px; transition: filter .15s, transform .1s, border-color .15s; }
.cb-confirm-btn--back { color: var(--ink-mute); background: none; border: 1px solid var(--primary-border); }
.cb-confirm-btn--back:hover { color: #fff; border-color: rgba(var(--primary-rgb),0.4); }
.cb-confirm-btn--go { color: #04140a; background: linear-gradient(180deg, #ffe07a, var(--amber)); border: none; }
.cb-confirm-btn--go:hover { filter: brightness(1.08); }
.cb-confirm-btn--go:active { transform: scale(.98); }

/* ====================================================
   APERÇU DE LA PIOCHE (dans le tooltip)
   ==================================================== */
.cb-pile-chip--deck { cursor: help; transition: filter .15s; }
.cb-pile-chip--deck:hover { filter: brightness(1.3); }
.cb-deckbreak { display: flex; flex-direction: column; gap: 6px; min-width: 188px; }
.cb-deckbreak-row { display: flex; align-items: center; gap: 8px; font-family: var(--f-term); font-size: 15px; color: #dfe7df; }
.cb-deckbreak-ic { font-size: 14px; width: 16px; text-align: center; }
.cb-deckbreak-name { width: 56px; }
.cb-deckbreak-bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.1); overflow: hidden; }
.cb-deckbreak-bar span { display: block; height: 100%; border-radius: 3px; background: var(--ec, var(--primary)); box-shadow: 0 0 6px var(--ec, var(--primary)); }
.cb-deckbreak-row b { color: #fff; font-weight: 400; width: 14px; text-align: right; }

/* ====================================================
   MAIN RÉTRACTABLE (poignée + état agrandi)
   ==================================================== */
.cb-hand-grip {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%); z-index: 8;
  display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: grab; padding: 4px 16px; touch-action: none;
}
.cb-hand-grip:active { cursor: grabbing; }
.cb-hand-grip-bar { width: 46px; height: 5px; border-radius: 3px; background: rgba(var(--primary-rgb),0.45); box-shadow: 0 0 10px rgba(var(--primary-rgb),0.3); transition: width .2s, background .2s; }
.cb-hand-grip:hover .cb-hand-grip-bar { width: 60px; background: var(--primary); }
.cb-hand-grip-cue { font-family: var(--f-pixel); font-size: 6px; letter-spacing: 1px; color: var(--ink-mute); }
.cb-hand-grip:hover .cb-hand-grip-cue { color: var(--primary); }
.cb-handbar.is-expanded { height: clamp(180px, 26vh, 250px); }
.cb-handbar.is-expanded .cb-hand { gap: clamp(10px, 1.4vw, 20px); }
.cb-handbar.is-expanded .cb-card { width: clamp(104px, 9vw, 124px); height: clamp(146px, 20vh, 174px); }
.cb-handbar.is-expanded .cb-card-emoji { font-size: clamp(34px, 5vh, 46px); }
.cb-handbar.is-expanded .cb-card-name { font-size: 7px; }
.cb-handbar.is-expanded .cb-card-stats { font-size: 16px; }

/* ====================================================
   CARTE OUVERTE EN GRAND — modèle détaillé
   ==================================================== */
.cb-oc-scrim { position: fixed; inset: 0; z-index: 296; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(2,4,3,0.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: cb-fade-in .2s ease; }
.cb-oc {
  --cc: #8a8a8a; --cc-rgb: 138,138,138; /* commun par défaut — surchargé par rareté */
  position: relative; width: min(322px, 92vw); height: 516px; max-height: 94vh; overflow: hidden;
  display: flex; flex-direction: column;
  border: 2px solid var(--cc); border-radius: 18px;
  background: linear-gradient(180deg, rgba(var(--cc-rgb),0.16), rgba(4,9,6,0.99) 38%);
  box-shadow: 0 28px 72px rgba(0,0,0,0.72), 0 0 54px rgba(var(--cc-rgb),0.35);
  animation: cb-explain-slide .3s cubic-bezier(.2,1.2,.4,1);
}
.cb-oc::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: 18px 18px 0 0; background: linear-gradient(90deg, transparent, var(--cc) 30%, #fff 50%, var(--cc) 70%, transparent); box-shadow: 0 0 16px var(--cc); z-index: 3; opacity: .9; }

/* bouton fermer en coin */
.cb-oc-x { position: absolute; top: 11px; right: 11px; z-index: 5; width: 26px; height: 26px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 13px; color: #fff;
  background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.18); backdrop-filter: blur(4px); transition: background .15s, border-color .15s; }
.cb-oc-x:hover { background: rgba(255,80,80,0.85); border-color: transparent; }

/* en-tête en bandeau teinté élément */
.cb-oc-banner {
  position: relative; display: flex; align-items: center; gap: 13px;
  padding: 13px 46px 13px 13px; border-radius: 16px 16px 0 0; overflow: hidden;
  background: linear-gradient(115deg, var(--cc) 0%, rgba(var(--cc-rgb),0.7) 30%, rgba(var(--cc-rgb),0.22) 62%, rgba(0,0,0,0.35) 100%);
  border-bottom: 1px solid rgba(var(--cc-rgb),0.55);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.24), 0 4px 20px rgba(0,0,0,0.3);
}
.cb-oc-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,0.22), transparent 55%); pointer-events: none; }
.cb-oc-elem {
  width: 52px; height: 52px; flex-shrink: 0; border-radius: 14px; font-size: 28px; line-height: 1; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.32); backdrop-filter: blur(6px);
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4), inset 0 1px 2px rgba(255,255,255,0.28);
}
.cb-oc-titles { flex: 1; min-width: 0; z-index: 1; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.cb-oc-name { font-family: var(--f-pixel); font-size: 12px; color: #fff; letter-spacing: .5px; line-height: 1.3; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }
.cb-oc-sub { font-family: var(--f-pixel); font-size: 6px; letter-spacing: 2px; color: rgba(255,255,255,0.75); text-shadow: 0 1px 3px rgba(0,0,0,0.4); display: block; transform: translateY(1px); }
.cb-oc-mana {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; z-index: 1;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  font-family: var(--f-pixel); color: #2a1800;
  background: radial-gradient(circle at 38% 30%, #fff9d4, #ffd700 50%, #b8860b);
  border: 2px solid rgba(255,255,255,0.6);
  box-shadow: 0 0 18px rgba(255,200,0,0.7), 0 3px 8px rgba(0,0,0,0.4), inset 0 1px 3px rgba(255,255,255,0.55);
}
.cb-oc-mana b { font-size: 15px; font-weight: 400; display: block; line-height: 1; padding-top: 4px; }

/* illustration */
.cb-oc-art { position: relative; height: 134px; margin: 11px 14px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(var(--cc-rgb),0.45); background: radial-gradient(circle at 50% 36%, rgba(var(--cc-rgb),0.3), rgba(0,0,0,0.62)); overflow: hidden; }
.cb-oc-art::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(var(--cc-rgb),0.07) 0 9px, transparent 9px 18px); pointer-events: none; }
.cb-oc-emoji { font-size: 74px; line-height: 1; filter: drop-shadow(0 6px 14px rgba(0,0,0,0.65)); z-index: 1; }

/* corps */
.cb-oc-body { flex: 1; display: flex; flex-direction: column; gap: 9px; padding: 0 14px 14px; }

/* stats ATK / DEF — pastilles compactes horizontales */
.cb-oc-statline { display: flex; gap: 9px; }
.cb-oc-stat { flex: 1; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 11px; border: 1px solid; }
.cb-oc-stat-ic { font-size: 16px; line-height: 1; }
.cb-oc-stat-val { font-family: var(--f-pixel); font-size: 18px; line-height: 1; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.6); }
.cb-oc-stat-lab { font-family: var(--f-pixel); font-size: 6px; letter-spacing: 1px; opacity: .8; margin-left: auto; }
.cb-oc-stat--atk { color: #ff8a72; border-color: rgba(255,90,60,0.5); background: rgba(255,90,60,0.13); }
.cb-oc-stat--def { color: #7bc0ff; border-color: rgba(75,150,255,0.5); background: rgba(75,150,255,0.13); }

/* PV mis en avant mais compact */
.cb-oc-hp { display: flex; align-items: center; gap: 11px; padding: 9px 13px; border-radius: 12px;
  border: 1px solid rgba(70,220,110,0.6); background: linear-gradient(135deg, rgba(70,220,110,0.2), rgba(70,220,110,0.04));
  box-shadow: inset 0 0 18px rgba(70,220,110,0.13); }
.cb-oc-hp-ic { font-size: 24px; line-height: 1; color: #84ff92; text-shadow: 0 0 14px rgba(70,220,110,0.7); flex-shrink: 0; }
.cb-oc-hp-main { flex: 1; min-width: 0; }
.cb-oc-hp-row { display: flex; align-items: baseline; gap: 6px; }
.cb-oc-hp-val { font-family: var(--f-pixel); font-size: 22px; line-height: 1; color: #aaffb8; text-shadow: 0 2px 6px rgba(0,0,0,0.55), 0 0 16px rgba(70,220,110,0.5); }
.cb-oc-hp-max { font-family: var(--f-pixel); font-size: 12px; color: #5fbf75; }
.cb-oc-hp-lab { font-family: var(--f-pixel); font-size: 6px; letter-spacing: 1px; color: #7fd994; margin-left: auto; align-self: center; }
.cb-oc-hp-bar { margin-top: 7px; height: 6px; border-radius: 4px; background: rgba(0,0,0,0.45); overflow: hidden; }
.cb-oc-hp-bar span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #22bb44, #66ff88); box-shadow: 0 0 8px rgba(70,220,110,0.6); }

/* blocs pouvoir / passif : badge icône à gauche + texte aligné */
.cb-oc-box { display: flex; gap: 11px; border-radius: 12px; padding: 11px 13px; }
.cb-oc-box--ability { border: 1px solid rgba(192,107,255,0.55); background: linear-gradient(135deg, rgba(192,107,255,0.16), rgba(192,107,255,0.035)); box-shadow: inset 0 0 18px rgba(192,107,255,0.1); }
.cb-oc-box--passive { border: 1px solid rgba(56,214,200,0.55); background: linear-gradient(135deg, rgba(56,214,200,0.15), rgba(56,214,200,0.035)); box-shadow: inset 0 0 18px rgba(56,214,200,0.1); }
.cb-oc-box-badge { width: 32px; height: 32px; flex-shrink: 0; border-radius: 9px; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.cb-oc-box--ability .cb-oc-box-badge { color: #f0d8ff; background: rgba(192,107,255,0.22); border: 1px solid rgba(192,107,255,0.5); }
.cb-oc-box--ability .cb-oc-box-badge { font-size: 17px; }
.cb-oc-box--passive .cb-oc-box-badge { color: #c8fff7; background: rgba(56,214,200,0.2); border: 1px solid rgba(56,214,200,0.5); }
.cb-oc-box-main { flex: 1; min-width: 0; }
.cb-oc-box-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.cb-oc-box-name { font-family: var(--f-pixel); font-size: 9px; letter-spacing: .5px; line-height: 1.3; }
.cb-oc-box--ability .cb-oc-box-name { color: #e3c4ff; }
.cb-oc-box--passive .cb-oc-box-name { color: #8af2e6; }
.cb-oc-box-tag { font-family: var(--f-pixel); font-size: 6px; letter-spacing: 1px; padding: 3px 6px; border-radius: 5px; flex-shrink: 0; white-space: nowrap; }
.cb-oc-box--ability .cb-oc-box-tag { color: #1a0a26; background: #c06bff; }
.cb-oc-box--passive .cb-oc-box-tag { color: #042320; background: #38d6c8; }
.cb-oc-box-desc-spacer {}
.cb-oc-box-desc { font-family: var(--f-term); font-size: 16px; color: #dbe4db; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* mention discrète de déploiement (la carte entière est cliquable) */
.cb-oc.is-playable { cursor: pointer; }
.cb-oc-hint { margin-top: auto; padding-top: 10px; text-align: center; font-family: var(--f-pixel); font-size: 7px; letter-spacing: 1px; line-height: 1.6; color: var(--cc); opacity: .9; }
.cb-oc-hint--off { color: #ff8a72; }
.cb-oc.is-playable:hover .cb-oc-hint { opacity: 1; text-shadow: 0 0 10px rgba(var(--cc-rgb),0.6); }

/* pied : bouton déployer pleine largeur */
.cb-oc-foot { padding: 13px 15px 16px; }
.cb-oc-btn { width: 100%; font-family: var(--f-pixel); cursor: pointer; border-radius: 12px; transition: filter .15s, transform .1s; }
.cb-oc-btn--deploy { font-size: 11px; letter-spacing: 1px; color: #04140a; background: linear-gradient(180deg, color-mix(in srgb, var(--cc) 80%, #fff), var(--cc)); border: none; padding: 15px; box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 20px rgba(var(--cc-rgb),0.4); }
.cb-oc-btn--deploy:not(:disabled):hover { filter: brightness(1.1); transform: translateY(-2px); }
.cb-oc-btn--deploy:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; filter: grayscale(.4); }
/* ---- raretés (surchargent --cc sur le modèle ouvert) ---- */
.cb-oc.rarity--common   { --cc: #9a9a9a; --cc-rgb: 154,154,154; }
.cb-oc.rarity--uncommon { --cc: #4bcf7f; --cc-rgb: 75,207,127; }
.cb-oc.rarity--rare     { --cc: #4b9fff; --cc-rgb: 75,159,255; }
.cb-oc.rarity--epic     { --cc: #c06bff; --cc-rgb: 192,107,255; }
.cb-oc.rarity--legendary{ --cc: #ffd24a; --cc-rgb: 255,210,74; }

/* ===========================================================
   Intégration jeu (Gacha) — ajouts au modèle .cb-oc
   image d'art réelle, badges (shiny/fusion/éveil/temp),
   conteneur de modale de détail.
   =========================================================== */
.cb-oc-art-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 11px; z-index: 2; }
.cb-oc-art-img + .cb-oc-emoji { display: none; } /* l'image masque l'emoji de secours ; réapparaît si onerror la retire */

.cb-oc-badges { position: absolute; top: 12px; left: 12px; z-index: 6; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.cb-oc-badge { font-family: var(--f-pixel, monospace); font-size: 6px; letter-spacing: .5px; padding: 4px 6px; border-radius: 6px; color: #04140a; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.55); }
.cb-oc-badge--shiny { background: linear-gradient(90deg, #ffe14d, #ff8a3c); }
.cb-oc-badge--fused { background: linear-gradient(90deg, #4bd0ff, #9a7bff); color: #04121a; }
.cb-oc-badge--eveil { background: linear-gradient(90deg, #c06bff, #ff6ad5); color: #1a0a26; }
.cb-oc-badge--temp  { background: #3a3a3a; color: #fff; }

/* modale de détail : un .cb-oc centré */
.card-modal-oc { display: flex; align-items: center; justify-content: center; }
.card-modal-oc .cb-oc { max-height: 88vh; }

/* vignette : carte .cb-oc réduite à une largeur donnée (--ocw, sans unité) */
.oc-thumb { width: calc(var(--ocw, 178) * 1px); height: calc(var(--ocw, 178) * 1px * 516 / 322); position: relative; overflow: hidden; border-radius: 14px; }
.oc-thumb .cb-oc { width: 322px; height: 516px; max-height: none; margin: 0; transform-origin: top left; transform: scale(calc(var(--ocw, 178) / 322)); animation: none !important; }

/* cadre passif vide (carte sans passif) : présent mais discret */
.cb-oc-box--empty { opacity: .4; }
.cb-oc-box--empty .cb-oc-box-desc { font-style: italic; }
