/* Police d'affichage du jeu (reconstruite depuis l'atlas TextMeshPro "Newyear Coffee") */
@font-face {
  font-family: "Newyear Coffee";
  src: url("../fonts/newyear-coffee.woff") format("woff");
  font-display: swap;
}

:root {
  --bg: #0b0a1d;
  --panel: #15132f;
  --panel2: #1d1a40;
  --line: #2f2b63;
  --text: #f1effc;
  --muted: #9a95c8;
  --accent: #ffd54a;
  --accent2: #b06bff;
  --kw: #ffff59;
  --buff: #00ff07;
  --debuff: #ff1717;
  --dmg: #ff8a8a;
  --heal: #00ff07;
  --bubble: rgba(26, 26, 46, .98);
  --radius: 12px;
  --gfont: "Newyear Coffee", "Raleway", system-ui, sans-serif;
  font-family: Raleway, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(1100px 600px at 25% -10%, #2b1f63 0%, transparent 60%),
    radial-gradient(900px 600px at 95% 110%, #3a1450 0%, transparent 60%), var(--bg);
  color: var(--text);
  font-size: 14px;
  overflow-x: hidden;
}
.gfont, .brand, .who, .tab-btn, button, .section h3, .dialog header h2, .bb-title, .bb-tox-title { font-family: var(--gfont); letter-spacing: .4px; }
button, input, select, textarea { color: inherit; }
input, select, textarea { font: inherit; }
button {
  font-size: 14px;
  background: #080029; border: 2px solid rgba(255, 255, 255, .85); border-radius: 10px;
  padding: 6px 14px; cursor: pointer; transition: background .15s, transform .05s, filter .15s;
}
button:hover { background: #17104a; }
button:active { transform: translateY(1px); }
button.primary { background: linear-gradient(180deg, #ffd54a, #f0a91c); color: #2a1a00; border-color: #fff3c4; }
button.primary:hover { filter: brightness(1.08); }
button.danger { border-color: #ff6a6a; color: #ffb3b3; }
button.ghost { background: transparent; border-color: rgba(255, 255, 255, .25); }
button.ghost:hover { background: rgba(255, 255, 255, .05); }
button.ghost.danger { border-color: rgba(255, 106, 106, .45); }
button.icon { width: 40px; padding: 4px 0; font-size: 18px; font-family: Raleway, sans-serif; }
button:disabled { opacity: .4; cursor: not-allowed; }
input[type=number], input[type=text], input[type=search], select {
  background: #0d0b24; border: 1px solid var(--line); border-radius: 7px; padding: 4px 7px; min-width: 0;
}
input[type=number] { width: 64px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #7b6cff; outline-offset: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }

/* ---------- barre du haut ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 10px 16px; flex-wrap: wrap;
  background: rgba(11, 10, 29, .88); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px);
}
.brand { font-size: 22px; margin: 0; font-weight: 400; line-height: 1.1; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 9px; }
.brand span { color: var(--accent); }
.brand-ico { width: 28px; height: 28px; border-radius: 7px; flex: none; }
.turn { flex: 1; color: var(--muted); min-width: 160px; }
.turn b { color: var(--text); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- mise en page ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; padding: 16px; align-items: start; }
.arena { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  position: sticky; top: 74px; max-height: calc(100vh - 90px); display: flex; flex-direction: column; overflow: hidden;
}
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tab-btn { flex: 1; border: none; border-radius: 0; background: transparent; padding: 10px; color: var(--muted); font-size: 15px; }
.tab-btn:hover { background: rgba(255, 255, 255, .04); }
.tab-btn.active { color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }
.tab { padding: 14px; overflow-y: auto; flex: 1; }

/* ---------- camps ---------- */
.side { background: rgba(21, 19, 47, .72); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.side.active { border-color: #7b5cff; box-shadow: 0 0 0 1px #7b5cff inset, 0 0 34px -12px #9b6bff; }
.hud { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.side.top .hud { margin-bottom: 18px; }
.side.bottom .hud { margin-top: 18px; }
.who { font-size: 17px; display: flex; align-items: center; gap: 8px; min-width: 130px; }
.who .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.elements { display: flex; gap: 6px; flex-wrap: wrap; }
.elchip {
  display: flex; align-items: center; gap: 2px; padding: 2px 8px 2px 2px; border-radius: 999px;
  background: color-mix(in srgb, var(--el) 16%, #0d0b24); border: 1px solid color-mix(in srgb, var(--el) 60%, transparent);
}
.elchip img { width: 26px; height: 26px; }
.elchip input { width: 42px; background: transparent; border: none; padding: 0; text-align: right; font-family: var(--gfont); font-size: 16px; }
.elchip.pulse { animation: pulse .6s ease; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--el); } 100% { box-shadow: 0 0 0 12px transparent; } }
.res { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.res input { width: 58px; }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 26px; padding: 0 14px; }
.slot { display: flex; justify-content: center; }
.slot > * { width: 100%; max-width: clamp(170px, calc((100vh - 330px) / 2 / 1.4), 270px); }
.graveyard { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--muted); align-items: center; }
.grave { padding: 2px 8px; border-radius: 999px; border: 1px dashed var(--line); cursor: pointer; }
.grave:hover { color: var(--text); }
.empty-slot {
  aspect-ratio: 286 / 400; border: 2px dashed var(--line); border-radius: 6%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted);
  cursor: pointer; transition: border-color .15s, color .15s; background: rgba(13, 11, 36, .45); font-family: var(--gfont);
}
.empty-slot:hover { border-color: var(--accent); color: var(--accent); }
.empty-slot .plus { font-size: 42px; line-height: 1; }

/* ---------- barre centrale ---------- */
.midbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 6px 14px;
  border-radius: var(--radius); background: transparent; border: 1px solid transparent; min-height: 42px; transition: background .15s, border-color .15s;
}
.midbar .hint { color: var(--muted); flex: 1; font-size: 13px; }
.midbar .hint b { color: var(--text); font-family: var(--gfont); font-weight: 400; letter-spacing: .4px; }
kbd { font-family: Raleway, sans-serif; font-size: 10px; padding: 1px 5px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .35); margin-left: 4px; opacity: .8; }
.terrain-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px 2px 4px; border-radius: 999px; font-size: 12px; border: 1px solid color-mix(in srgb, var(--el) 60%, transparent); background: color-mix(in srgb, var(--el) 14%, transparent); }
.terrain-chip .el-ico { width: 20px; height: 20px; vertical-align: 0; }
.midbar.selecting { border-style: solid; border-color: var(--accent); background: rgba(255, 213, 74, .08); }
.midbar.selecting .hint { color: var(--accent); font-weight: 600; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- boutique de Tox (ToxShopController) ---------- */
.midbar.shopping { border-style: solid; border-color: var(--accent); background: rgba(255, 213, 74, .06); padding: 10px 14px; }
.shop { flex: 1 1 100%; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.shop-head, .shop-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.shop-title { font-size: 22px; color: var(--accent); }
.shop-foot .hint { flex: 1 1 260px; color: var(--muted); }
.shop-odds { display: inline-flex; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.shop-odds b { color: var(--text); font-weight: 700; }
.shop-chip { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 2px 10px; border-radius: 999px; font-size: 12px; border: 1px solid rgba(255, 213, 74, .45); background: rgba(255, 213, 74, .08); }
.shop-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.shop-tox {
  --rar: #888; --rart: #ccc;
  display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--radius); cursor: pointer;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rar) 30%, #0d0b24), #0d0b24 85%);
  border: 2px solid color-mix(in srgb, var(--rar) 75%, transparent);
  transition: transform .12s, box-shadow .15s, opacity .15s;
}
.shop-tox:hover { transform: translateY(-2px); box-shadow: 0 0 18px -4px var(--rar); }
.shop-tox.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 0 24px -4px var(--accent); }
.shop-tox.poor { opacity: .5; cursor: not-allowed; }
.shop-tox.poor .gold { color: var(--debuff); }
.st-head { display: flex; align-items: center; gap: 8px; }
.st-head img { width: 30px; height: 30px; flex: none; }
.st-name { font-size: 18px; line-height: 1.1; }
.st-rar { font-size: 12px; color: var(--rart); }
.st-banned { color: var(--debuff); font-weight: 700; }
.st-desc { font-size: 12.5px; line-height: 1.4; flex: 1; }
.st-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.st-ban { padding: 2px 10px; font-size: 12px; }
.gold { display: inline-flex; align-items: center; gap: 3px; color: var(--accent); font-weight: 700; white-space: nowrap; }
.gold img { width: 18px; height: 18px; }
.shop-banned { color: #ffb3b3; }
.log .shop { color: var(--accent); }
/* emplacements de carte pendant l'achat d'un Tox */
.gcard .gc-row.pick { cursor: pointer; transition: transform .12s; }
.gcard .gc-row.pick:hover { transform: scale(1.04); }
.gcard .ab-row.pick .gc-row-border { opacity: 1; background: var(--accent); filter: drop-shadow(0 0 1.2cqw var(--accent)); }
.gcard .tox-row.pick { outline: .5cqw dashed var(--accent); outline-offset: -1.5cqw; border-radius: 3cqw; }
.empty-row .gc-row-bg { background: rgba(255, 213, 74, .2); }
.empty-row:hover .gc-row-bg { background: rgba(255, 213, 74, .38); }
.gc-empty-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--gfont); font-size: 5cqw; color: var(--accent); text-shadow: 0 .3cqw .5cqw #000; }
@media (max-width: 720px) {
  .shop-items { grid-template-columns: 1fr; }
}

/* =====================================================================
   Carte au format du jeu (prefab CardController : 286 × 400)
   ===================================================================== */
.gcard {
  --el: #888; --el2: #aaa;
  position: relative; width: 100%; aspect-ratio: 286 / 400; container-type: inline-size;
  transition: transform .15s, filter .15s, opacity .2s;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .55));
  user-select: none;
}
.gc-body {
  position: absolute; inset: 0;
  -webkit-mask: url("../img/ui/card_mask.webp") center / 100% 100% no-repeat;
  mask: url("../img/ui/card_mask.webp") center / 100% 100% no-repeat;
  background: #000;
}
.gc-ill { position: absolute; inset: 0; background-size: cover; background-position: center top; cursor: pointer; }
.gc-head { position: absolute; left: 0; right: 0; top: 0; height: 10%; background: linear-gradient(180deg, rgba(0, 0, 0, .78), transparent); pointer-events: none; }
.gc-front { position: absolute; inset: 0; background-size: 100% 100%; pointer-events: none; }
.gc-name {
  position: absolute; left: 18%; right: 13%; top: 1.6%; height: 5%;
  display: flex; align-items: center; justify-content: center; text-align: center; white-space: nowrap; overflow: hidden;
  font-family: var(--gfont); color: #fff; line-height: 1; cursor: pointer;
  text-shadow: 0 0 .5cqw #000, 0 .4cqw .6cqw #000;
}
.gc-el { position: absolute; left: 3%; top: -5%; height: 17%; aspect-ratio: 1; transform: translateX(-50%); pointer-events: none; }
.gc-el img { width: 100%; height: 100%; filter: drop-shadow(0 0 .8cqw rgba(0, 0, 0, .8)); }
.gc-gold {
  position: absolute; left: 90%; width: 16%; top: -2%; height: 12%;
  background: url("../img/ui/gold_icon.webp") center / contain no-repeat;
  display: flex; align-items: center; justify-content: center; pointer-events: auto;
}
.gc-gold span { font-family: var(--gfont); color: #987400; font-size: 5cqw; margin-top: .2cqw; }
.gc-talents { position: absolute; left: 97%; width: 8%; top: 10%; display: flex; flex-direction: column; gap: 1cqw; align-items: center; }
.gc-tdot { width: 5.5cqw; height: 5.5cqw; border-radius: 50%; background: #353535; border: .9cqw solid #000; cursor: help; }
.gc-tdot.on { background: #ff00e5; box-shadow: 0 0 1.5cqw #ff00e5; }
.gc-rarity { position: absolute; left: 40%; width: 20%; bottom: -5cqw; height: 10cqw; background: center / contain no-repeat; pointer-events: none; }

/* lignes de capacités : centre à --y du bas, largeur 3 % → 98 %, ratio du sprite 992 × 144 */
.gc-row {
  position: absolute; left: 3%; right: 2%; height: 13.8cqw; bottom: calc(var(--y) - 6.9cqw);
}
.ab-row { cursor: default; }
.ab-row.active { cursor: pointer; }
.gc-row-bg {
  position: absolute; inset: 0; background: rgba(0, 0, 0, .5);
  -webkit-mask: url("../img/ui/card_ability_active.webp") center / 100% 100% no-repeat;
  mask: url("../img/ui/card_ability_active.webp") center / 100% 100% no-repeat;
}
.gc-row-border {
  position: absolute; inset: 0; background: var(--ab); opacity: 0;
  -webkit-mask: url("../img/ui/card_ability_active_outline.webp") center / 100% 100% no-repeat;
  mask: url("../img/ui/card_ability_active_outline.webp") center / 100% 100% no-repeat;
  transition: opacity .15s;
}
.ab-row.ready .gc-row-border { opacity: 1; filter: drop-shadow(0 0 1.2cqw var(--ab)); }
.ab-row.ready .gc-row-bg { background: linear-gradient(90deg, color-mix(in srgb, var(--ab1) 45%, rgba(0, 0, 0, .5)), color-mix(in srgb, var(--ab) 22%, rgba(0, 0, 0, .5)) 55%, rgba(0, 0, 0, .5)); }
.ab-row.ready:hover .gc-row-bg { background: linear-gradient(90deg, color-mix(in srgb, var(--ab1) 65%, rgba(0, 0, 0, .4)), color-mix(in srgb, var(--ab) 35%, rgba(0, 0, 0, .45)) 60%, rgba(0, 0, 0, .45)); }
.ab-row.ready:hover { transform: scale(1.03); }
.ab-row { transition: transform .12s; }
.gc-row-content { position: absolute; inset: 0; }
.ab-row.dim .gc-row-content { opacity: .5; }
.me { position: absolute; left: 5%; width: 12%; top: 12%; bottom: 12%; display: block; }
.me img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.gc-row-name {
  position: absolute; left: 17.5%; right: 17.5%; top: 25%; bottom: 25%;
  display: flex; align-items: center; justify-content: center; text-align: center; white-space: nowrap; overflow: hidden;
  font-family: var(--gfont); color: #fff; line-height: 1; text-shadow: 0 .3cqw .5cqw #000;
}
.gc-cd {
  position: absolute; left: 81%; width: 10%; top: 10%; bottom: 10%;
  display: flex; align-items: center; justify-content: center; --cdc: var(--ab);
}
.gc-cd::before {
  content: ""; position: absolute; inset: 0; background: var(--cdc);
  -webkit-mask: url("../img/ui/card_cooldown.webp") center / contain no-repeat;
  mask: url("../img/ui/card_cooldown.webp") center / contain no-repeat;
}
.gc-cd b { position: relative; }
.gc-row-name.with-cd { right: 20%; }
.gc-cd b { font-family: var(--gfont); color: #fff; font-size: 4.6cqw; font-weight: 400; text-shadow: 0 0 .6cqw rgba(0, 0, 0, .9); }
.gc-cd.over b { color: var(--debuff); }

/* passifs (tox) affichés dans les emplacements comme dans le jeu */
.tox-row { cursor: help; }
.gc-tox-aura { position: absolute; left: 0; right: 0; top: 25%; bottom: 25%; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--rar) 75%, transparent) 25%, color-mix(in srgb, var(--rar) 75%, transparent) 75%, transparent); }
.gc-tox-name { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 1cqw; }
.gc-tox-name span { font-family: var(--gfont); color: #fff; white-space: nowrap; text-shadow: 0 .3cqw .5cqw #000; }
.gc-tox-name .ln { height: 55%; width: auto; }

/* hp : centre à 3 % du bas, largeur 4 % → 96 %, ratio 2045 × 198 */
.gc-hp {
  position: absolute; left: 4%; right: 4%; height: 8.9cqw; bottom: calc(3% - 4.45cqw);
  background: var(--hpb);
  -webkit-mask: url("../img/ui/card_hp_bar_mask.webp") center / 100% 100% no-repeat;
  mask: url("../img/ui/card_hp_bar_mask.webp") center / 100% 100% no-repeat;
}
.gc-hp-in {
  position: absolute; inset: 9% 1.2%; background: var(--hpbg); overflow: hidden;
  -webkit-mask: url("../img/ui/card_hp_bar_mask.webp") center / 100% 100% no-repeat;
  mask: url("../img/ui/card_hp_bar_mask.webp") center / 100% 100% no-repeat;
}
.gc-hp-fill { position: absolute; inset: 0 auto 0 0; background: var(--hpf); transition: width .35s ease; }
.gc-hp span {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--gfont); color: #fff; font-size: 5.4cqw; text-shadow: 0 0 .7cqw #000, 0 0 .7cqw #000;
}

/* états */
.gcard.selected { filter: drop-shadow(0 0 2px #ffd54a) drop-shadow(0 0 10px rgba(255, 213, 74, .7)); }
.gcard.caster { filter: drop-shadow(0 0 3px #c08bff) drop-shadow(0 0 14px #9b5cff); }
.gcard.targetable { cursor: crosshair; filter: drop-shadow(0 0 3px #4dff7a) drop-shadow(0 0 14px rgba(77, 255, 122, .8)); }
.gcard.targetable .gc-ill { cursor: crosshair; }
.gcard.targetable:hover { transform: translateY(-4px) scale(1.02); }
.gcard.dimmed { opacity: .45; }
.gcard.dead { filter: grayscale(.95) brightness(.6); }
.gcard.hit { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* aperçu et texte flottant */
.preview {
  position: absolute; left: 50%; top: 22%; transform: translateX(-50%); z-index: 5; pointer-events: none;
  background: rgba(10, 8, 30, .92); border: 2px solid rgba(255, 255, 255, .8); border-radius: 10px; padding: 4px 10px;
  font-size: 12px; text-align: center; white-space: nowrap; box-shadow: 0 6px 18px rgba(0, 0, 0, .6);
}
.preview .d { color: var(--dmg); font-family: var(--gfont); font-size: 20px; }
.preview .h { color: var(--heal); font-family: var(--gfont); font-size: 20px; }
.preview .c { color: var(--accent); font-weight: 700; }
.preview .k { color: var(--debuff); font-family: var(--gfont); }
.fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: visible; }
.float {
  position: absolute; left: 50%; top: 30%; transform: translateX(-50%); font-family: var(--gfont); font-size: 30px;
  text-shadow: 0 2px 4px #000, 0 0 10px rgba(0, 0, 0, .8); animation: floatUp 1.3s ease-out forwards; white-space: nowrap;
}
.float.dmg { color: var(--dmg); }
.float.heal { color: var(--heal); }
.float.crit { color: var(--accent); font-size: 38px; }
.float.miss { color: #cbd5e1; font-size: 20px; }
.float.boost { color: var(--el2, #fff); font-size: 18px; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.12); } 100% { opacity: 0; transform: translate(-50%, -56px) scale(1); } }

/* =====================================================================
   Bulles d'info (prefabs Tooltip Active / Passive Ability, keyword tooltips)
   ===================================================================== */
.bubbles { position: fixed; z-index: 60; display: flex; gap: 10px; align-items: flex-start; pointer-events: none; }
.bubbles.to-left { flex-direction: row-reverse; }
.bb-col { display: flex; flex-direction: column; gap: 10px; width: 360px; max-width: calc(100vw - 24px); }
.kw-col { width: 300px; }
.bubble {
  position: relative; padding: 15px; color: #fff; font-size: 13.5px; line-height: 1.45;
  isolation: isolate;
}
.bubble::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--bubble);
  -webkit-mask: url("../img/ui/drawed_square.webp") center / 100% 100% no-repeat;
  mask: url("../img/ui/drawed_square.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .6));
}
.bb-title { display: flex; align-items: center; gap: 8px; font-size: 19px; line-height: 1.1; margin-bottom: 8px; min-height: 26px; }
.bb-title > span:not(.me):not(.gc-cd) { flex: 1; }
.bb-title .me { position: relative; left: auto; top: auto; bottom: auto; width: 26px; height: 26px; flex: none; }
.bb-title .gc-cd { position: relative; left: auto; top: auto; bottom: auto; width: 28px; height: 28px; flex: none; --cdc: #aaaaaa; }
.bb-title .gc-cd b { font-size: 14px; }
.bb-ico { width: 26px; height: 26px; border-radius: 6px; }
.bb-star { color: #ff00e5; }
.bb-content { display: flex; gap: 10px; }
.bb-desc { flex: 1; min-width: 0; }
.bb-meta { color: var(--muted); font-size: 11.5px; margin-bottom: 4px; }
.bb-stats { width: 78px; flex: none; border-left: 2px solid rgba(255, 255, 255, .2); padding-left: 8px; display: flex; flex-direction: column; gap: 2px; }
.bb-st-h { display: flex; align-items: center; gap: 4px; font-size: 10px; text-transform: uppercase; color: rgba(255, 255, 255, .8); margin-top: 4px; }
.bb-st-h img { width: 13px; height: 13px; }
.bb-st { display: flex; align-items: center; gap: 5px; font-size: 14px; }
.bb-st img { width: 17px; height: 17px; }
.bb-st b { font-weight: 700; }
.bb-prev { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .15); font-size: 12.5px; }
.bb-tox-title { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 19px; position: relative; margin-bottom: 4px; padding: 4px 0; }
.bb-tox-title::before { content: ""; position: absolute; left: 0; right: 0; top: 22%; bottom: 22%; z-index: -1; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--rar) 75%, transparent) 25%, color-mix(in srgb, var(--rar) 75%, transparent) 75%, transparent); }
.bb-tox-title .ln { height: 18px; }
.kwl { font-weight: 700; cursor: help; }
.v { font-weight: 700; color: #fff; }
.v.up { color: #00ff00; }
.v.down { color: #ff0000; }
.el-ico { width: 16px; height: 16px; vertical-align: -3px; }
.el-tag { color: var(--el); font-weight: 700; white-space: nowrap; }
.kw { color: var(--kw); }
.auto { color: var(--muted); font-style: italic; }
.chain { margin-top: 4px; padding-left: 8px; border-left: 2px solid rgba(255, 255, 255, .2); }
.choice-opt { margin-top: 4px; padding: 4px 6px; border-radius: 6px; background: rgba(255, 255, 255, .05); }
.choice-n { display: inline-block; width: 16px; height: 16px; line-height: 16px; text-align: center; border-radius: 50%; background: var(--accent2); font-size: 10px; margin-right: 6px; }

/* ---------- panneau latéral ---------- */
.section { margin-bottom: 20px; }
.section h3 { margin: 0 0 8px; font-size: 15px; color: var(--accent); display: flex; justify-content: space-between; align-items: center; font-weight: 400; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.empty-state { text-align: center; padding: 26px 10px 18px; color: var(--muted); }
.empty-state .es-title { font-family: var(--gfont); font-size: 18px; color: var(--text); letter-spacing: .4px; margin-bottom: 6px; }
.empty-state p { margin: 0; font-size: 13px; line-height: 1.5; }
.howto { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.6; color: #ddd9f5; }
.howto b { color: var(--text); }
.hp-line { display: flex; align-items: flex-end; gap: 8px; }
.hp-line .field input { width: 90px; font-size: 15px; }
.hp-line > .muted { padding-bottom: 6px; white-space: nowrap; }
.panel .tab button:not(.x):not(.tab-btn) { font-size: 12.5px; padding: 4px 10px; border-width: 1.5px; border-radius: 8px; }
.panel .row { gap: 6px; }
.hp-line .btns { margin-left: auto; display: flex; gap: 6px; }
select.wide { width: 100%; }
.status-adder { flex-wrap: wrap; align-items: center; }
.adder.status-adder select { flex: 1 1 100%; }
.status-adder label { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.status-adder input { width: 52px; }
.list-item.warn { border-color: rgba(255, 106, 106, .5); }
.cast-btn { margin-left: auto; }
.stats-line { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); }
.stats-line b { color: var(--text); }
details.adv { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
details.adv > summary { font-family: var(--gfont); font-size: 14px; color: var(--accent); letter-spacing: .4px; margin: 0; }
details.adv .sub { font-size: 11.5px; color: var(--muted); margin: 12px 0 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); }
.field input, .field select { color: var(--text); font-size: 13px; width: 100%; }
.insp-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.insp-head .thumb { width: 72px; height: 100px; border-radius: 8px; background-size: cover; background-position: center top; flex: none; border: 2px solid rgba(255, 255, 255, .7); }
.insp-head h2 { margin: 0 0 2px; font-size: 20px; font-family: var(--gfont); font-weight: 400; letter-spacing: .4px; }
.insp-head .grow { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list-item { display: flex; gap: 8px; align-items: flex-start; padding: 8px; border-radius: 8px; background: #110f2a; border: 1px solid #28245a; margin-bottom: 6px; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-family: var(--gfont); font-size: 15px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.list-item .desc { font-size: 12.5px; color: #ddd9f5; margin-top: 3px; line-height: 1.45; }
.list-item img.ico { width: 30px; height: 30px; border-radius: 6px; flex: none; }
.x { border: none; background: transparent; color: var(--muted); padding: 0 4px; font-size: 18px; font-family: Raleway, sans-serif; }
.x:hover { color: var(--debuff); background: transparent; }
.badge { font-family: Raleway, sans-serif; font-size: 10px; padding: 1px 6px; border-radius: 999px; background: #262150; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.ab-detail { margin-top: 6px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px; }
details summary { cursor: pointer; color: var(--muted); font-size: 12px; margin-top: 4px; }
.tech { font-size: 11.5px; color: var(--muted); margin: 4px 0 0; padding-left: 16px; }
.adder { display: flex; gap: 6px; margin-top: 6px; }
.adder select, .adder input[type=text] { flex: 1; }
.list-item .title button { font-size: 12px; padding: 2px 10px; }

/* journal */
.log { font-size: 12.5px; line-height: 1.45; }
.log div { padding: 2px 0; border-bottom: 1px solid rgba(47, 43, 99, .5); }
.log .turn { color: var(--accent); font-family: var(--gfont); padding-top: 8px; }
.log .cast { color: #d5b8ff; font-weight: 700; }
.log .damage { color: var(--dmg); }
.log .heal { color: #7dff8c; }
.log .boost { color: #fff59a; }
.log .miss, .log .info, .log .cooldown { color: var(--muted); }
.log .passive, .log .status { color: #9fd0ff; }
.log .death { color: var(--debuff); font-weight: 700; }

/* glossaire */
.gloss-item { padding: 8px 0; border-bottom: 1px solid #28245a; }
.gloss-item b { display: block; margin-bottom: 2px; font-family: var(--gfont); font-weight: 400; font-size: 15px; }

/* ---------- fenêtres ---------- */
.modal { position: fixed; inset: 0; background: rgba(4, 3, 14, .75); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
/* Fenêtre ouverte : la page derrière ne défile plus, et une liste arrivée en bout de course ne transmet pas le défilement */
html { scrollbar-gutter: stable; }
body.modal-open { overflow: hidden; }
.modal, .cgrid, .dialog .body, .picker .right { overscroll-behavior: contain; }
.dialog {
  background: var(--panel); border: 2px solid rgba(255, 255, 255, .8); border-radius: 16px; width: min(1180px, 100%); max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .7);
}
.dialog.small { width: min(560px, 100%); }
.dialog.picker-dialog { height: calc(100vh - 32px); max-height: 940px; }
.dialog header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dialog header h2 { margin: 0; font-size: 19px; flex: 1; font-weight: 400; }
.dialog .body { padding: 14px 16px; overflow-y: auto; }
.dialog footer { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.picker { display: grid; grid-template-columns: minmax(0, 1fr) 340px; min-height: 0; flex: 1; }
.picker .left { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.filters { display: flex; gap: 6px; padding: 10px 16px; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--line); flex: none; }
.filters input[type=search] { flex: 1; min-width: 160px; }
.filt { padding: 2px 6px; border-radius: 999px; display: inline-flex; align-items: center; border-width: 1px; }
.filt.on { border-color: var(--accent); background: #3a3218; }
.filt img { width: 24px; height: 24px; }
.cgrid {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 22px 30px 30px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 26px 20px;
}
.pk-tile { position: relative; cursor: pointer; border-radius: 8%; padding: 0; transition: transform .12s; }
.pk-tile:hover { transform: translateY(-3px); }
.pk-tile.sel .gcard { filter: drop-shadow(0 0 3px #ffd54a) drop-shadow(0 0 12px rgba(255, 213, 74, .8)); }
.pk-tile .gcard { pointer-events: none; }
.pk-tile .gcard .ab-row, .pk-tile .gcard .tox-row { pointer-events: auto; }
.pk-badge { position: absolute; left: 50%; transform: translateX(-50%); bottom: -20px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.picker .right { overflow-y: auto; padding: 22px 18px 16px; }
.pk-big { width: 230px; margin: 10px auto 14px; }
#pkAdd { position: sticky; bottom: 0; z-index: 2; box-shadow: 0 -12px 18px var(--panel); }
.talent-opt { display: flex; gap: 8px; padding: 8px; border-radius: 8px; border: 1px solid #28245a; margin-bottom: 6px; cursor: pointer; align-items: flex-start; }
.talent-opt.on { border-color: #ff00e5; background: rgba(255, 0, 229, .08); }
.talent-opt input { margin-top: 3px; }
.choices { display: grid; gap: 10px; }
.choice-btn { text-align: left; padding: 10px 12px; border-radius: 10px; font-family: Raleway, sans-serif; letter-spacing: 0; }
.choice-btn b { font-family: var(--gfont); font-weight: 400; font-size: 16px; }
.choice-btn .desc { font-size: 12.5px; color: #ddd9f5; margin-top: 4px; }
.opt-group { margin-bottom: 14px; }
.opt-group > b { display: block; margin-bottom: 6px; }
.seg { display: inline-flex; border: 2px solid rgba(255, 255, 255, .8); border-radius: 10px; overflow: hidden; }
.seg button { border: none; border-radius: 0; background: transparent; padding: 5px 10px; }
.seg button.on { background: #3a3218; color: var(--accent); }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; cursor: pointer; }
.check input { margin-top: 3px; }
textarea.share { width: 100%; min-height: 90px; background: #0d0b24; border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 8px; font-family: ui-monospace, monospace; font-size: 11px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 70; background: #1d1a40; border: 2px solid var(--accent); border-radius: 10px; padding: 8px 14px; width: max-content; max-width: calc(100vw - 32px); text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }

.pk-back { display: none; }

/* ---------- petits écrans : barre d'actions en bas, panneau en tiroir ---------- */
.dock, .sheet-backdrop, .sheet-grip, .sheet-close { display: none; }
@media (max-width: 1350px) {
  .layout { grid-template-columns: minmax(0, 1fr) 330px; }
  .board { gap: 18px 16px; padding: 0 6px; }
}
@media (max-width: 1080px) {
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .topbar { position: static; }
  .topbar .turn { display: none; }
  .brand { flex: 1; }
  .layout { grid-template-columns: 1fr; }

  .dock {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; align-items: center; gap: 8px;
    padding: 8px max(12px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    background: rgba(11, 10, 29, .94); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  }
  .dock-turn { flex: 1 1 auto; min-width: 0; font-size: 12px; line-height: 1.25; color: var(--muted); white-space: nowrap; }
  .dock-turn > * { display: block; overflow: hidden; text-overflow: ellipsis; }
  .dock-turn b { color: var(--text); font-family: var(--gfont); font-weight: 400; letter-spacing: .4px; font-size: 14px; }
  .dock-turn .win { color: var(--accent); }
  .dock-actions { display: flex; gap: 6px; }
  .dock button { min-height: 44px; white-space: nowrap; }
  .dock button.icon { width: 44px; }
  .dock-panel { padding: 6px 12px; }
  .dock-panel .dp-ico { display: none; font-family: Raleway, sans-serif; font-size: 20px; }
  .dock-panel[aria-expanded="true"] { background: #2a2360; }

  .panel {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 45; margin: 0 auto; width: 100%; max-width: 760px;
    height: min(80vh, 760px); height: min(80dvh, 760px); max-height: none;
    border-radius: 18px 18px 0 0; border-bottom: none; padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -20px 60px rgba(0, 0, 0, .6);
    transform: translateY(105%); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s;
  }
  body.sheet-open .panel { transform: none; visibility: visible; transition: transform .25s ease; }
  body.sheet-open { overflow: hidden; }
  .sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(4, 3, 14, .6); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
  .sheet-grip { display: block; flex: none; width: 42px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .3); margin: 8px auto 0; }
  .sheet-close { display: block; flex: none; width: 52px; font-size: 26px; }
  .tab { overscroll-behavior: contain; }
  .toast { bottom: calc(78px + env(safe-area-inset-bottom)); }

  .picker { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); }
  .picker .left { border-right: none; }
  .picker .right { display: none; }
  .picker.show-detail .left { display: none; }
  .picker.show-detail .right { display: block; }
  .pk-back { display: inline-flex; margin-bottom: 4px; }
}
@media (max-width: 720px) {
  .topbar { gap: 8px 10px; padding: 10px 16px; }
  .brand { font-size: 20px; }
  .actions { flex: 1 1 100%; }
  .actions button { flex: 1 1 auto; padding: 8px 10px; font-size: 13px; white-space: nowrap; }
  .layout { padding: 10px 8px; gap: 10px; }
  .side { padding: 12px 10px; }
  .side.top .hud { margin-bottom: 14px; }
  .side.bottom .hud { margin-top: 14px; }
  .who { min-width: 0; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; padding: 0 4px; }
  .midbar { padding: 4px 6px; }
  .modal { padding: 8px; }
  .dialog { max-height: calc(100dvh - 16px); border-radius: 14px; }
  .dialog.picker-dialog { height: calc(100dvh - 16px); max-height: none; }
  .dialog header { padding: 10px 12px; }
  .dialog header h2 { font-size: 16px; }
  .dialog .body { padding: 12px; }
  .filters { padding: 10px 12px; }
  .filters input[type=search] { flex-basis: 100%; }
  .cgrid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); padding: 16px 14px 24px; gap: 26px 14px; }
  .bb-col { width: min(360px, calc(100vw - 16px)); }
  .kw-col { display: none; }
  #turnBanner { min-width: 0; width: calc(100vw - 32px); padding: 12px 16px; }
  #turnBanner .tb-title { font-size: 24px; }
}
@media (max-width: 480px) {
  .dock { gap: 6px; }
  .dock-panel { width: 44px; padding: 0; }
  .dock-panel .dp-ico { display: inline; }
  .dock-panel .dp-lbl { display: none; }
  #btnEndTurn { padding: 6px 12px; }
}
/* Écrans tactiles : cibles plus grandes, champs à 16 px (sinon iOS zoome au focus) */
@media (pointer: coarse) {
  input[type=number], input[type=text], input[type=search], select, textarea { font-size: 16px; }
  .field input, .field select { font-size: 16px; }
  button { min-height: 38px; }
  .x { min-width: 40px; }
  .gc-tdot { cursor: pointer; }
}

/* ---------- présentation (contenu indexable sous l'outil) ---------- */
.about { padding: 48px 16px 24px; border-top: 1px solid var(--line); margin-top: 24px; }
.about-in { max-width: 1040px; margin: 0 auto; }
.about h2 { font-family: var(--gfont); font-weight: 400; letter-spacing: .5px; font-size: 26px; margin: 0 0 12px; color: var(--accent); }
.about h2:not(:first-child) { margin-top: 40px; }
.about .lead { font-size: 15.5px; line-height: 1.65; color: #ddd9f5; max-width: 760px; margin: 0 0 10px; }
.about .lead strong { color: var(--text); }
.about .lead[lang="en"] { color: var(--muted); font-size: 14px; }
.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 24px; }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .features { grid-template-columns: 1fr; } .about h2 { font-size: 22px; } }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.feature h3 { font-family: var(--gfont); font-weight: 400; letter-spacing: .4px; font-size: 18px; margin: 0 0 6px; }
.feature p { margin: 0; font-size: 13.5px; line-height: 1.55; color: #ddd9f5; }
.faq { display: grid; gap: 8px; max-width: 820px; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0 16px; }
.faq summary { cursor: pointer; padding: 13px 0; font-size: 15px; font-weight: 600; color: var(--text); margin: 0; }
.faq details p { margin: 0 0 14px; font-size: 14px; line-height: 1.6; color: #ddd9f5; }
.site-footer { text-align: center; padding: 24px 16px 32px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.site-footer p { margin: 4px 0; }
a { color: var(--accent); }
a:hover { color: #ffe58a; }
.noscript { margin: 24px 16px; padding: 16px; border: 2px solid var(--accent); border-radius: var(--radius); text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
button:focus-visible, summary:focus-visible, a:focus-visible, .empty-slot:focus-visible { outline: 2px solid #7b6cff; outline-offset: 2px; }

/* =====================================================================
   Effets de statut (reconstitution des VFX Graph du jeu avec leurs textures)
   ===================================================================== */
.gcard [class^="fx-"], .gcard [class*=" fx-"] { pointer-events: none; }

/* Provocation : écusson irisé (Provocation_Tex1/Tex2), teinte bleu → rose → cyan, braises */
.fx-taunt-tint { position: absolute; inset: 0; background: linear-gradient(160deg, #5e6bff 0%, #ff8cf0 50%, #19e6ff 100%); mix-blend-mode: screen; opacity: .3; animation: tauntTint 4s ease-in-out infinite; }
@keyframes tauntTint { 0%, 100% { opacity: .22; } 50% { opacity: .4; } }
.fx-taunt { position: absolute; left: 50%; top: 50%; width: 141%; aspect-ratio: 475 / 466; transform: translate(-50%, -50%); z-index: 3; }
.fx-taunt-shield {
  position: absolute; inset: 0; background: url("../img/fx/taunt_shield.webp") center / contain no-repeat; opacity: .72;
  filter: drop-shadow(0 0 3cqw rgba(110, 120, 255, .85)); animation: tauntProc 2.8s ease-in-out infinite;
}
.fx-taunt-outline {
  position: absolute; inset: -1.5%; background: linear-gradient(160deg, #5e6bff 0%, #ff8cf0 45%, #19e6ff 100%);
  -webkit-mask: url("../img/fx/taunt_outline.webp") center / contain no-repeat; mask: url("../img/fx/taunt_outline.webp") center / contain no-repeat;
  filter: drop-shadow(0 0 2cqw #9b7bff); animation: tauntPulse 1.8s ease-in-out infinite;
}
@keyframes tauntProc { 0%, 100% { transform: scale(1); opacity: .66; } 50% { transform: scale(1.025); opacity: .8; } }
@keyframes tauntPulse { 0%, 100% { opacity: .55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.03); } }
.fx-ember { position: absolute; left: var(--x); bottom: 0; width: 4cqw; height: 4cqw; border-radius: 50%; background: radial-gradient(circle, #fff 0%, #a98bff 35%, rgba(90, 60, 255, 0) 70%); animation: ember var(--d) linear infinite; animation-delay: var(--dl); opacity: 0; }
.fx-ember.orange { background: radial-gradient(circle, #fff 0%, #ffb14a 35%, rgba(255, 110, 20, 0) 70%); }
@keyframes ember { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-60cqw) translateX(4cqw) scale(1.1); opacity: 0; } }

/* Poison : halo vert autour de toute la carte (Card_mask_glow), vignette verte (Card_Mask_white), nuages animés
   (spritesheet_poison_cloud 4x4, 14 images utiles), crâne tox_poison avec le compteur.
   Les textures VFX du jeu (1024²) partagent un même cadre où la carte occupe x 191→833 et y 55→967 :
   chaque calque est placé dans ce repère pour couvrir exactement la carte. */
.fx-poison-aura {
  position: absolute; left: -10.59%; top: -6.03%; width: 119.31%; height: 110.2%; background: #19ff0c;
  -webkit-mask: url("../img/fx/card_glow.webp") center / 100% 100% no-repeat; mask: url("../img/fx/card_glow.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(0 0 1.5cqw rgba(25, 255, 12, .7)); animation: poisonAura 2s ease-in-out infinite;
}
@keyframes poisonAura { 0%, 100% { opacity: .8; } 50% { opacity: 1; } }
.fx-poison-glow { position: absolute; left: -6.54%; top: -2.96%; width: 111.06%; height: 103.95%; background: linear-gradient(180deg, #40ff63, #0fff05 45%, #005e12); -webkit-mask: url("../img/fx/card_vignette.webp") center / 100% 100% no-repeat; mask: url("../img/fx/card_vignette.webp") center / 100% 100% no-repeat; opacity: .63; animation: poisonGlow 2s ease-in-out infinite; }
.fx-poison-tint { position: absolute; inset: 0; background: rgba(20, 255, 40, .16); mix-blend-mode: screen; }
@keyframes poisonGlow { 0%, 100% { opacity: .5; } 50% { opacity: .8; } }
.fx-poison-clouds { position: absolute; inset: 0; }
.fx-poison-clouds i {
  position: absolute; left: 50%; top: 58%; width: calc(100% + var(--i) * 18%); aspect-ratio: 1; transform: translate(-50%, -50%) rotate(calc(var(--i) * 120deg));
  background: linear-gradient(180deg, #3bff1a, #00a516 60%, #003d0d); opacity: .6; mix-blend-mode: screen;
  -webkit-mask: url("../img/fx/poison_cloud.webp") 0 0 / 400% 400% no-repeat; mask: url("../img/fx/poison_cloud.webp") 0 0 / 400% 400% no-repeat;
  animation: poisonCloud 2.4s steps(1) infinite; animation-delay: calc(var(--i) * -0.8s);
}
@keyframes poisonCloud {
  0.000% { -webkit-mask-position: 0.000% 0.000%; mask-position: 0.000% 0.000%; }
  7.143% { -webkit-mask-position: 33.333% 0.000%; mask-position: 33.333% 0.000%; }
  14.286% { -webkit-mask-position: 66.667% 0.000%; mask-position: 66.667% 0.000%; }
  21.429% { -webkit-mask-position: 100.000% 0.000%; mask-position: 100.000% 0.000%; }
  28.571% { -webkit-mask-position: 0.000% 33.333%; mask-position: 0.000% 33.333%; }
  35.714% { -webkit-mask-position: 33.333% 33.333%; mask-position: 33.333% 33.333%; }
  42.857% { -webkit-mask-position: 66.667% 33.333%; mask-position: 66.667% 33.333%; }
  50.000% { -webkit-mask-position: 100.000% 33.333%; mask-position: 100.000% 33.333%; }
  57.143% { -webkit-mask-position: 0.000% 66.667%; mask-position: 0.000% 66.667%; }
  64.286% { -webkit-mask-position: 33.333% 66.667%; mask-position: 33.333% 66.667%; }
  71.429% { -webkit-mask-position: 66.667% 66.667%; mask-position: 66.667% 66.667%; }
  78.571% { -webkit-mask-position: 100.000% 66.667%; mask-position: 100.000% 66.667%; }
  85.714% { -webkit-mask-position: 0.000% 100.000%; mask-position: 0.000% 100.000%; }
  92.857% { -webkit-mask-position: 33.333% 100.000%; mask-position: 33.333% 100.000%; }
  100% { -webkit-mask-position: 0% 0%; mask-position: 0% 0%; }
}
.fx-poison-skull {
  position: absolute; left: 92.6%; top: 88.3%; width: 22%; aspect-ratio: 256 / 196; transform: translate(-50%, -50%); z-index: 4;
  background: url("../img/fx/poison_skull.webp") center / contain no-repeat; pointer-events: auto !important; cursor: help;
  filter: drop-shadow(0 0 1.2cqw rgba(16, 255, 5, .9)); animation: skullBob 2.2s ease-in-out infinite;
}
.fx-poison-skull b {
  position: absolute; left: 50%; top: -38%; transform: translateX(-50%); white-space: nowrap;
  font-family: var(--gfont); font-weight: 400; color: #fff; font-size: 6cqw; text-shadow: 0 0 .6cqw #000, 0 0 .6cqw #000, 0 0 1.2cqw #0a7a0a;
}
@keyframes skullBob { 0%, 100% { transform: translate(-50%, -50%); } 50% { transform: translate(-50%, -57%); } }

/* Bouclier : hexagone orange (shield_tex2/tex3) étiré à la hauteur et à la largeur de la carte, braises */
.fx-shield { position: absolute; inset: 0; z-index: 3; animation: shieldPulse 2.6s ease-in-out infinite; }
.fx-shield-fill, .fx-shield-hex { position: absolute; left: -6%; top: -4%; width: 112%; height: 108%; }
.fx-shield-fill { background: radial-gradient(closest-side, rgba(255, 120, 25, .05) 40%, rgba(255, 120, 25, .35) 100%); -webkit-mask: url("../img/fx/shield_hexfill.webp") center / 100% 100% no-repeat; mask: url("../img/fx/shield_hexfill.webp") center / 100% 100% no-repeat; }
.fx-shield-hex { background: linear-gradient(160deg, #ff7819, #ff6e5e 40%, #ff8cf0 70%, #ff7819); -webkit-mask: url("../img/fx/shield_hex.webp") center / 100% 100% no-repeat; mask: url("../img/fx/shield_hex.webp") center / 100% 100% no-repeat; filter: drop-shadow(0 0 1.6cqw #ff7a1a); }
.fx-shield-val { position: absolute; left: 50%; top: -9.5%; transform: translateX(-50%); font-family: var(--gfont); font-size: 5.4cqw; color: #ffd2a6; text-shadow: 0 0 .6cqw #000, 0 0 1.2cqw #ff6a00; }
@keyframes shieldPulse { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.02); opacity: 1; } }

/* Fumée : nuage gris-violet animé sur toute la carte */
.fx-smoke { position: absolute; inset: 0; }
.fx-smoke span { position: absolute; inset: -20%; background: linear-gradient(160deg, #75656a, #1a1630); opacity: .82;
  -webkit-mask: url("../img/fx/smoke_noise.webp") 0 0 / 60% repeat; mask: url("../img/fx/smoke_noise.webp") 0 0 / 60% repeat; animation: smokeDrift 14s linear infinite; }
.fx-smoke span + span { opacity: .6; -webkit-mask-size: 90%; mask-size: 90%; animation-duration: 22s; animation-direction: reverse; }
@keyframes smokeDrift { from { -webkit-mask-position: 0 0; mask-position: 0 0; } to { -webkit-mask-position: 100% 60%; mask-position: 100% 60%; } }

/* Étourdissement : calques de BoardCardController.BuildStunPreview (carte 328,6 × 470 ; contour 645² centré en (+18, +5),
   fissures 462² centrées en (+2, 0)), textures recadrées sur leur alpha ; étoiles dorées qui tournent. */
.fx-stun-frame { position: absolute; z-index: 3; left: -20.42%; top: -17%; width: 138.4%; height: 130.5%; background: rgb(5, 5, 4); -webkit-mask: url("../img/fx/stun_frame.webp") center / 100% 100% no-repeat; mask: url("../img/fx/stun_frame.webp") center / 100% 100% no-repeat; }
.fx-stun-cracks { position: absolute; left: -.19%; top: 1.43%; width: 100.2%; height: 97.7%; background: rgba(0, 0, 0, .59); -webkit-mask: url("../img/fx/stun_cracks.webp") center / 100% 100% no-repeat; mask: url("../img/fx/stun_cracks.webp") center / 100% 100% no-repeat; }
.fx-stars { position: absolute; left: 50%; top: 13%; width: 0; height: 0; z-index: 4; }
.fx-stars i { position: absolute; width: 11cqw; height: 11cqw; margin: -5.5cqw; background: linear-gradient(#fff6a0, #ffb31a); -webkit-mask: url("../img/fx/star.webp") center / contain no-repeat; mask: url("../img/fx/star.webp") center / contain no-repeat;
  filter: drop-shadow(0 0 1.4cqw #ffc400); animation: starOrbit 1.8s linear infinite; animation-delay: calc(var(--i) * -0.45s); }
@keyframes starOrbit {
  0% { transform: translate(28cqw, 0) scale(.75); } 25% { transform: translate(0, 6cqw) scale(1.1); } 50% { transform: translate(-28cqw, 0) scale(.75); }
  75% { transform: translate(0, -6cqw) scale(.5); } 100% { transform: translate(28cqw, 0) scale(.75); }
}

/* Gel : givre derrière la carte, bloc de glace par-dessus (T_Frozen_Mask, Voronoi, reflets).
   Textures 1024² dont le cadre de la carte est x 231→784, y 130→900 (trou de T_Frozen_Behind = cœur de T_Frozen_Mask) :
   le bloc de glace couvre toute la carte et ses pointes débordent. */
.fx-frozen-behind { position: absolute; left: -35.44%; top: -16.23%; width: 162.21%; height: 132.34%; background: linear-gradient(180deg, #e9f8ff, #8fd7ff); -webkit-mask: url("../img/fx/frozen_behind.webp") center / 100% 100% no-repeat; mask: url("../img/fx/frozen_behind.webp") center / 100% 100% no-repeat; opacity: .85; filter: drop-shadow(0 0 2cqw #79ccff); }
.fx-frozen-mask { position: absolute; left: -5.79%; top: -6.23%; width: 110.13%; height: 110.39%; background: linear-gradient(180deg, rgba(220, 244, 255, .72), rgba(140, 205, 255, .6)); -webkit-mask: url("../img/fx/frozen_mask.webp") center / 100% 100% no-repeat; mask: url("../img/fx/frozen_mask.webp") center / 100% 100% no-repeat; }
.fx-frozen-crystal { position: absolute; inset: 0; background: url("../img/fx/voronoi.webp") 0 0 / 45% repeat; mix-blend-mode: screen; opacity: .22; }
.fx-frozen-hl { position: absolute; left: -5.79%; top: -6.23%; width: 109.76%; height: 110.39%; background: #fff; -webkit-mask: url("../img/fx/frozen_highlights.webp") center / 100% 100% no-repeat; mask: url("../img/fx/frozen_highlights.webp") center / 100% 100% no-repeat; animation: iceShine 3s ease-in-out infinite; }
@keyframes iceShine { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* bulle "résistances" (Tooltip Resistance Element) */
.bb-res-title { font-family: var(--gfont); font-size: 17px; color: #fff; letter-spacing: .4px; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 2px solid rgba(255, 255, 255, .2); }
.bb-res { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.bb-res-it { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.bb-res-it img { width: 28px; height: 28px; }
.bb-res-it b { font-family: var(--gfont); font-weight: 400; font-size: 15px; }

/* résistances dans l'inspecteur */
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.res-field { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 4px; border-radius: 8px; background: #110f2a; border: 1px solid #28245a; font-size: 12.5px; }
.res-field .el-ico { width: 22px; height: 22px; vertical-align: 0; }
.res-field .res-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-field .res-in { display: flex; align-items: center; gap: 2px; }
.res-field input { width: 52px; text-align: right; }
.res-field i { font-style: normal; color: var(--muted); }
.res-field.up input { color: var(--buff); }
.res-field.down input { color: var(--debuff); }

/* bulle "effets en cours" */
.bb-status { padding: 4px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.bb-status:first-of-type { border-top: none; }
.bb-dur { display: block; color: var(--muted); font-size: 11.5px; }
/* Réglage système "réduire les animations" : effets figés mais toujours visibles (sauf si l'option "Toujours animer" est cochée) */
@media (prefers-reduced-motion: reduce) {
  body:not(.force-anim) .gcard [class^="fx-"], body:not(.force-anim) .gcard [class^="fx-"] * { animation: none !important; }
  body:not(.force-anim) .fx-stars i { transform: translate(calc((var(--i) - 1.5) * 13cqw), calc(-3cqw + (var(--i) - 1.5) * (var(--i) - 1.5) * 1.6cqw)); }
  body:not(.force-anim) .fx-ember { opacity: .8; bottom: calc(20% + var(--i) * 6%); }
  body:not(.force-anim) .fx-poison-clouds i { -webkit-mask-position: calc(var(--i) * 33.333%) 33.333%; mask-position: calc(var(--i) * 33.333%) 33.333%; }
}

/* bandeau de changement de tour */
#turnBanner { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 65; pointer-events: none; opacity: 0;
  background: rgba(8, 0, 41, .92); border: 2px solid rgba(255, 255, 255, .85); border-radius: 14px; padding: 14px 28px; text-align: center; min-width: 320px; }
#turnBanner.show { animation: turnBanner 2.6s ease forwards; }
#turnBanner .tb-title { font-family: var(--gfont); font-size: 30px; color: var(--accent); }
#turnBanner .tb-sub { margin-top: 6px; font-size: 13px; text-align: left; }
#turnBanner .tb-sub .damage { color: var(--dmg); }
#turnBanner .tb-sub .heal { color: #7dff8c; }
#turnBanner .tb-sub .boost { color: #fff59a; }
#turnBanner .tb-sub .passive { color: #9fd0ff; }
#turnBanner .tb-sub .death { color: var(--debuff); }
@keyframes turnBanner { 0% { opacity: 0; transform: translate(-50%, -40%); } 12% { opacity: 1; transform: translate(-50%, -50%); } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- notes de patch ---------- */
.patch-pill {
  font-family: Raleway, sans-serif; font-size: 12px; letter-spacing: 0; padding: 3px 12px; border-width: 1px;
  border-color: rgba(255, 213, 74, .55); color: var(--muted); position: relative;
}
.patch-pill b { color: var(--accent); }
.patch-pill.new::after {
  content: ""; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
}
.dialog.pn-dialog { width: min(860px, 100%); }
.pn-legend { margin-left: 6px; white-space: nowrap; }
.pn .up, .pn-card .up { color: #6dff7a; }
.pn .down, .pn-card .down { color: #ff7a7a; }
.pn-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 16px; }
.pn-chip { font-family: Raleway, sans-serif; font-size: 12px; letter-spacing: 0; padding: 3px 10px; border-width: 1px; border-color: var(--line); }
.pn-chip b { color: var(--accent); margin-left: 2px; }
.pn .section { margin-bottom: 18px; scroll-margin-top: 8px; }
.pn-item img.ico.pn-card-ico { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; }
.pn-changes { margin-top: 6px; display: grid; gap: 3px; }
.pn-change { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; line-height: 1.4; }
.pn-label { color: var(--muted); min-width: 0; }
.pn-label::after { content: " :"; }
.pn-vals { display: inline-flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline; }
.pn-vals s { color: var(--muted); }
.pn-arrow { color: var(--muted); }
.pn-change.up b { color: #6dff7a; }
.pn-change.down b { color: #ff7a7a; }
.pn-dir { font-size: 10px; }
.pn-change.up .pn-dir { color: #6dff7a; }
.pn-change.down .pn-dir { color: #ff7a7a; }
.pn-change.text { display: block; }
.pn-old { color: var(--muted); text-decoration: line-through; font-size: 12px; margin-top: 2px; }
.pn-new { color: #ddd9f5; margin-top: 2px; }
.pn-minor { margin-top: 8px; }
.pn-minor summary { cursor: pointer; }
.pn-card .pn-item { background: #17143a; }
.pk-patch {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%); z-index: 2; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: var(--accent); color: #2a1a00; box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}

/* tactile : élément « armé » par un premier toucher (aperçu affiché, second toucher pour valider) */
.ab-row.armed { transform: scale(1.04); }
.ab-row.armed .gc-row-border { opacity: 1; filter: drop-shadow(0 0 1.6cqw #fff); }
.gcard.targetable.armed { transform: translateY(-4px) scale(1.03); filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 16px rgba(77, 255, 122, .9)); }

/* ---------- pages secondaires (mentions légales, 404) ---------- */
body.page { padding: 32px 16px 48px; }
.page-in { max-width: 760px; margin: 0 auto; font-size: 15px; line-height: 1.65; color: #ddd9f5; }
.page-in h1 { font-family: var(--gfont); font-weight: 400; letter-spacing: .5px; font-size: 32px; color: var(--text); margin: 18px 0 8px; }
.page-in h2 { font-family: var(--gfont); font-weight: 400; letter-spacing: .4px; font-size: 20px; color: var(--accent); margin: 28px 0 6px; }
.page-in p { margin: 0 0 10px; }
.btn-link { display: inline-block; margin-top: 8px; padding: 10px 18px; border-radius: 10px; background: linear-gradient(180deg, #ffd54a, #f0a91c); color: #2a1a00; text-decoration: none; font-family: var(--gfont); letter-spacing: .4px; }
.btn-link:hover { color: #2a1a00; filter: brightness(1.08); }
