:root {
  /* Paleta: docs/DIRECAO-DE-ARTE.md, mesma de site/css/lp.css */
  --preto: #07070A;
  --carvao: #0E0F13;
  --carvao-2: #16171C;
  --osso: #EDE6D6;
  --fumaca: #8A8F98;
  --acento: #FF2FD0;
  --bg: #07070A;
  --bg2: #0E0F13;
  --panel: #0E0F13;
  --panel2: #16171C;
  --line: rgba(237, 230, 214, .14);
  --line-forte: rgba(237, 230, 214, .34);
  --txt: #EDE6D6;
  --txt-inv: #07070A;
  --muted: #8A8F98;
  /* moedas: ouro = Prata (grátis), gem = Ouro (premium), po = Pó de Relíquia */
  --gold: #EDE6D6;
  --gem: #FFC21E;
  --po: #A64DFF;
  /* canais de sinal da partida. Estado tem hue; família também. O que os separa é o fio
     preto (--fio) entre a borda da moldura e o anel de estado, e a FORMA do anel. */
  --ok: #9BFF3C;
  --bad: #FF2D4E;
  --sel: #EDE6D6;
  --frio: #7DD3FC;
  --escudo: #FFC21E;
  --imune: #00E5C0;
  --fio: #07070A;
  --mana: #2B5BFF;
  --atk: #FFC21E;
  --hp: #FF2D4E;
  /* raridade: os 4 valores são os de COR_RARIDADE em site/js/moldura.js:16.
     Parecem sem uso no CSS, mas ui.js:1482 os lê por style inline. Não apague. */
  --comum: #c9c9c9;
  --rara: #3d8bff;
  --epica: #b45cff;
  --lendaria: #ffb236;
  --fonte-titulo: Cinzel, "Trajan Pro", Georgia, serif;
  --fonte-texto: Inter, "Segoe UI", Roboto, system-ui, sans-serif;
  /* Aliases do tema antigo. Os nomes ficam vivos de propósito: --ouro2 é citado em 20 regras
     e 17 delas sem fallback — apagar o nome torna o box-shadow inválido e o anel some sem erro. */
  --ouro1: var(--osso);
  --ouro2: var(--sel);
  --ouro3: var(--line);
  --card-w: 120px;
  --radius: 0;
  /* Tokens de motion (docs/PESQUISA-FUNDADOR.md, Tabela 6): entrada → impacto → overshoot → estabilização */
  --dur-tatil: 120ms;
  --dur-estado: 250ms;
  --dur-resolucao: 480ms;
  --ciclo-persistente: 2200ms;
  --dur-climax: 1100ms;
  --ease-overshoot: cubic-bezier(.34, 1.56, .64, 1);
  --ease-entrada: cubic-bezier(.55, 0, .9, .45);
  --ease-saida: cubic-bezier(.2, .8, .3, 1);
  --card-mao: 104px;
  font-family: "Segoe UI", Roboto, system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--txt); min-height: 100%; }
body { background: var(--bg); -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { font: inherit; cursor: pointer; border: 1px solid var(--line-forte); border-radius: 0; padding: 10px 16px; background: var(--panel2); color: var(--txt); transition: transform .08s, filter .15s; }
button:hover { filter: brightness(1.15); }
button:active { transform: scale(.97); }
button:disabled { opacity: .45; cursor: not-allowed; filter: none; }
button.primario { background: var(--osso); color: var(--txt-inv); border: 1px solid var(--osso); font-weight: 700; letter-spacing: .04em; box-shadow: none; }
button.ouro { background: transparent; border: 1px solid var(--gold); color: var(--gold); font-weight: 700; }
button.gema { background: var(--gem); border: 1px solid var(--gem); color: var(--txt-inv); font-weight: 700; }
button.pequeno { padding: 6px 10px; font-size: .85rem; }
button.fantasma { background: transparent; border: 1px solid var(--line-forte); color: var(--txt); }
h1, h2, h3 { margin: 0 0 8px; }
.muted { color: var(--muted); }
.erro { color: var(--bad); }
.regra-causo { margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line); border-left: 2px solid var(--acento); border-radius: 0; background: none; color: var(--txt); font-size: .9rem; }
.faixa-regra { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); z-index: 6; max-width: 78%; padding: 4px 12px; border-radius: 0; border: 1px solid var(--acento); background: rgba(7, 7, 10, .92); color: var(--txt); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
@media (max-width: 720px) { .faixa-regra { font-size: .68rem; max-width: 92%; } }
.hidden { display: none !important; }

/* topo */
.topo { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: rgba(7, 7, 10, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topo .logo { font-weight: 900; letter-spacing: .16em; font-size: 1.1rem; background: none; -webkit-background-clip: initial; background-clip: initial; color: var(--osso); }
.topo nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; min-width: 0; }
/* min-width:0 é o que faz o overflow-x valer: sem ele o item flex nunca encolhe abaixo do conteúdo
   e o nav empurra a página inteira, criando rolagem horizontal no celular. */
.topo nav::-webkit-scrollbar { display: none; }
.topo nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; white-space: nowrap; font-size: .9rem; }
.topo nav a.ativo, .topo nav a:hover { color: var(--txt); background: var(--panel2); }
.moedas { display: flex; gap: 10px; font-size: .9rem; font-weight: 700; }
.moedas .ouro { color: var(--gold); }
.moedas .gemas { color: var(--gem); }
.moedas .po { color: var(--po); }

main { max-width: 1100px; margin: 0 auto; padding: 16px 12px 80px; }
.tela { animation: aparecer .25s ease; }
@keyframes aparecer { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.painel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.grade { display: grid; gap: 12px; }
.grade.c2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grade.c3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.linha { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.espaco { flex: 1; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 0; font-size: .75rem; background: transparent; border: 1px solid var(--line); color: var(--muted); }

/* cartas (LOD "mão": carta completa, moldura SVG do Card Design System) */
.carta { position: relative; width: var(--card-w); aspect-ratio: 480 / 680; border-radius: calc(var(--card-w) * .0458); background: var(--preto); overflow: hidden; user-select: none; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(237, 230, 214, .24), 0 6px 16px rgba(0, 0, 0, .6); transition: transform .12s, box-shadow .12s; font-size: calc(var(--card-w) * .075); }
.carta .moldura { position: absolute; inset: 0; pointer-events: none; }
.carta .moldura svg { display: block; width: 100%; height: 100%; }
.carta .arte { top: 0; }
.carta.jogavel { cursor: pointer; box-shadow: 0 0 0 2px var(--fio), 0 0 0 4px var(--ok), 0 6px 16px rgba(0, 0, 0, .6); }
.carta.jogavel:hover { transform: translateY(-6px) scale(1.04); }
.carta.selecionada { transform: translateY(-10px) scale(1.06); box-shadow: 0 0 0 2px var(--fio), 0 0 0 5px var(--sel), 0 10px 22px rgba(0, 0, 0, .7); z-index: 2; }
.carta .arte { position: absolute; inset: 0; background-size: cover; background-position: center top; }
.carta .arte.sem { background: var(--c1, var(--carvao-2)); }
.carta .arte.sem::after { content: attr(data-ini); position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.6em; font-weight: 900; color: rgba(237, 230, 214, .4); }
.carta.grande { --card-w: 220px; }
.carta.mini { --card-w: 84px; }
.carta .qtd { position: absolute; bottom: 30%; right: 6px; background: rgba(0, 0, 0, .7); padding: 1px 6px; border-radius: 6px; font-size: .8em; }
.carta.faltando { filter: grayscale(1) brightness(.55); }
.carta.verso { background: url("../img/verso.webp") center/cover no-repeat, #07070A; border: 1px solid rgba(237, 230, 214, .3); }
.carta.verso > * { display: none; }

/* ===================== PARTIDA — Physical UI ===================== */
.tabuleiro { display: flex; flex-direction: column; gap: 0; padding: 0; animation: none; }

/* Tabuleiro 2.5D: imagem por família; zonas alinhadas à pintura (cima = inimigo, baixo = aliado, esquerda = heróis, direita = deck/Relíquia) */
.mesa { position: relative; z-index: 1; width: min(100%, calc((100dvh - 290px) * 16 / 9)); min-width: 320px; aspect-ratio: 16 / 9; margin: 0 auto; container-type: inline-size; border-radius: 16px; background: var(--tab, var(--carvao)) center / cover no-repeat, var(--preto); box-shadow: 0 24px 60px rgba(0, 0, 0, .7), inset 0 0 0 1px var(--line); user-select: none; }
.mesa.minha-vez { box-shadow: 0 24px 60px rgba(0, 0, 0, .7), inset 0 0 0 3px var(--osso); }
.mesa.fim { filter: saturate(.6) brightness(.8); transition: filter var(--dur-climax); }
.zona-ini, .zona-eu { display: contents; }

/* heróis (nichos redondos à esquerda) */
.heroi { position: absolute; width: 14cqw; height: 14cqw; border-radius: 50%; --h: 14cqw; font-size: calc(var(--h) * .17); transition: transform var(--dur-estado) var(--ease-saida), box-shadow var(--dur-estado); }
.heroi.ini { left: 10.3cqw; top: 12cqw; }
.heroi.eu { left: 7cqw; top: 26.6cqw; }
.heroi .retrato { position: absolute; inset: 0; border-radius: 50%; background: var(--carvao-2) center 12% / cover no-repeat; border: 3px solid var(--cor, var(--fumaca)); box-shadow: inset 0 0 0 2px var(--fio), 0 8px 20px rgba(0, 0, 0, .7); }
.heroi .retrato img { width: 100%; height: 100%; object-fit: cover; object-position: center 12%; border-radius: 50%; display: block; }
.heroi .vida, .heroi .armadura, .heroi .atkh { position: absolute; display: grid; place-items: center; font-family: var(--fonte-titulo); font-weight: 900; color: var(--txt-inv); border: 2px solid var(--fio); box-shadow: 0 0 0 1px rgba(237, 230, 214, .35); transition: transform var(--dur-estado); }
.heroi .vida { right: -4%; bottom: -2%; width: 36%; height: 36%; border-radius: 50%; background: var(--hp); font-size: 1em; }
.heroi .armadura { right: -2%; top: -2%; width: 30%; height: 30%; border-radius: 30% 30% 45% 45%; background: var(--osso); font-size: .8em; }
.heroi .atkh { left: -4%; bottom: -2%; width: 30%; height: 30%; border-radius: 50%; background: var(--atk); font-size: .8em; }
.heroi .armadura.zero, .heroi .atkh.zero { display: none; }
.heroi .nomeh { position: absolute; left: 50%; top: 102%; transform: translateX(-50%); white-space: nowrap; font-family: var(--fonte-titulo); font-weight: 700; font-size: .55em; color: var(--txt); text-shadow: 0 1px 2px var(--preto); }
.heroi .estados-h { position: absolute; left: 50%; top: -12%; transform: translateX(-50%); display: flex; gap: 2px; }
.heroi.imune .retrato { box-shadow: inset 0 0 0 2px var(--fio), 0 0 0 3px var(--imune), 0 0 16px rgba(0, 229, 192, .45); animation: halo var(--ciclo-persistente) infinite ease-in-out; }
.heroi.congelado .retrato { filter: saturate(.4) brightness(1.15); border-color: var(--frio); }
.heroi.atacavel { cursor: grab; }
.heroi.atacavel .retrato { box-shadow: inset 0 0 0 2px var(--fio), 0 0 0 3px var(--ok); }
.heroi.selecionada { transform: scale(1.06); }
.heroi.selecionada .retrato { box-shadow: inset 0 0 0 2px var(--fio), 0 0 0 5px var(--sel); }

/* campos (faixas de cima e de baixo) */
.campo { position: absolute; display: flex; gap: .5cqw; align-items: center; justify-content: center; padding: .4cqw; border-radius: 1.2cqw; transition: box-shadow var(--dur-estado), background var(--dur-estado); --tk-w: 6.6cqw; --tk-h: 8.3cqw; }
.campo.ini { left: 25cqw; top: 7.6cqw; width: 50cqw; height: 16.2cqw; }
.campo.eu { left: 24cqw; top: 27.9cqw; width: 52cqw; height: 18.4cqw; }
.campo.vazio::before { content: attr(data-rotulo); position: absolute; color: rgba(237, 230, 214, .55); font-family: var(--fonte-titulo); font-size: 1.6cqw; letter-spacing: 1px; pointer-events: none; }
.campo.recebe { box-shadow: inset 0 0 0 2px var(--ok); background: rgba(155, 255, 60, .07); cursor: copy; }
.campo.recebe.sobre { box-shadow: inset 0 0 0 4px var(--ok); background: rgba(155, 255, 60, .14); }
.mesa.recebe-mesa::after { content: ""; position: absolute; inset: 0; border-radius: 16px; box-shadow: inset 0 0 0 3px var(--ok); pointer-events: none; z-index: 3; animation: alvoPulsa var(--ciclo-persistente) infinite; }
.slot { width: 0; min-width: 0; height: 86%; flex-shrink: 0; border-radius: 12%; transition: width var(--dur-estado) var(--ease-saida), min-width var(--dur-estado) var(--ease-saida), background var(--dur-estado), box-shadow var(--dur-estado); }
.campo.recebe .slot { width: 1.4cqw; min-width: 12px; background: rgba(155, 255, 60, .18); border: 1px dashed var(--ok); cursor: copy; }
.campo.recebe .slot.ativo { width: var(--tk-w); min-width: var(--tk-w); background: rgba(155, 255, 60, .38); box-shadow: inset 0 0 0 2px var(--ok); border-style: solid; }
.campo.recebe.vazio .slot { width: 40%; min-width: 44px; height: 86%; }
.campo.recebe.vazio::before { display: none; }

/* token (LOD "campo"): arte em moldura compacta, ataque/vida grandes nos cantos, fileira de ícones, nome curto */
.token { position: relative; width: var(--tk-w); height: var(--tk-h); flex-shrink: 0; border-radius: 14%; font-size: calc(var(--tk-w) * .3); cursor: default; transition: transform var(--dur-estado) var(--ease-saida), filter var(--dur-estado), opacity var(--dur-estado), width var(--dur-estado), margin var(--dur-estado); z-index: 2; }
.token > * { pointer-events: none; }
.tk-arte { position: absolute; inset: 5%; border-radius: 12%; background: var(--carvao) center 18% / cover no-repeat; }
.tk-arte.sem { background: var(--cor, var(--carvao-2)); }
.tk-arte.sem::after { content: attr(data-ini); position: absolute; inset: 0; display: grid; place-items: center; font: 900 2em var(--fonte-titulo); color: rgba(237, 230, 214, .4); }
.tk-moldura { position: absolute; inset: 0; border-radius: 14%; border: 3px solid var(--cor, var(--fumaca)); box-shadow: inset 0 0 0 2px var(--fio), 0 6px 14px rgba(0, 0, 0, .65); background: linear-gradient(180deg, transparent 62%, rgba(7, 7, 10, .85)); }
.tk-nome { position: absolute; left: 6%; right: 6%; bottom: 20%; font: 700 .5em var(--fonte-titulo); text-align: center; color: var(--txt); text-shadow: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(7, 7, 10, .72); border-radius: 0; padding: 1px 3px; line-height: 1.2; }
.tk-atk, .tk-hp { position: absolute; bottom: -7%; width: 1.35em; height: 1.35em; border-radius: 50%; display: grid; place-items: center; font: 900 1em var(--fonte-titulo); color: var(--txt-inv); border: 2px solid var(--fio); box-shadow: 0 0 0 1px rgba(237, 230, 214, .35); transition: transform var(--dur-estado), color var(--dur-estado), background var(--dur-estado); }
.tk-atk { left: -7%; background: var(--atk); }
.tk-hp { right: -7%; background: var(--hp); }
.token.ferida .tk-hp { background: var(--preto); color: var(--hp); box-shadow: 0 0 0 1px var(--hp); }
.token.buff-atk .tk-atk, .token.buff-hp .tk-hp, .token.aura-recebe .tk-atk.aura, .token.aura-recebe .tk-hp.aura { background: var(--preto); color: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.tk-vinculo { position: absolute; left: 50%; bottom: -9%; transform: translateX(-50%); width: .9em; height: .9em; border-radius: 50%; background: var(--preto); border: 1.5px solid var(--ok); display: none; place-items: center; }
.token.aura-recebe .tk-vinculo { display: grid; }
.tk-vinculo svg { width: 70%; height: 70%; }
.tk-estados { position: absolute; top: -9%; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; z-index: 2; }
.tk-estados .ic, .estados-h .ic { width: 1.15em; height: 1.15em; border-radius: 50%; background: var(--carvao-2); border: 1.5px solid var(--osso); display: grid; place-items: center; box-shadow: 0 0 0 1px var(--fio); }
.tk-estados .ic svg, .tk-estados .ic img, .estados-h .ic svg, .estados-h .ic img { width: 78%; height: 78%; display: block; }
.ic.img { background: none; border: 0; box-shadow: none; width: 1.35em; height: 1.35em; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .9)); }
.ic.img img { width: 100%; height: 100%; object-fit: contain; }
.ic.gasto { border-color: var(--fumaca); opacity: .5; filter: grayscale(1) brightness(.7); }
.token.enjoada .tk-arte { filter: grayscale(.9) brightness(.55); }
.token.enjoada .tk-moldura { border-color: var(--fumaca); }
.token.silenciada .tk-nome { text-decoration: line-through; color: var(--fumaca); }
.token.silenciada .tk-moldura { border-color: var(--fumaca); background: linear-gradient(180deg, transparent 62%, rgba(7, 7, 10, .85)); }
.token.transformada .tk-moldura { border-style: double; border-width: 6px; }

/* contratos visuais persistentes (Tabela 2) */
.tk-bloqueio { position: absolute; inset: -9%; border-radius: 18%; display: none; border: 4px solid var(--osso); box-shadow: inset 0 0 0 2px var(--fio), 0 0 0 2px var(--fio); background: repeating-linear-gradient(90deg, var(--osso) 0 14%, transparent 14% 26%) top / 100% 14% no-repeat, repeating-linear-gradient(90deg, var(--osso) 0 14%, transparent 14% 26%) bottom / 100% 14% no-repeat; }
.token.provocar .tk-bloqueio { display: block; }
.token.provocar.alvo .tk-bloqueio { border-color: var(--bad); box-shadow: inset 0 0 0 2px var(--fio), 0 0 0 3px var(--bad); animation: bloqueio var(--ciclo-persistente) infinite; }
@keyframes bloqueio { 50% { box-shadow: inset 0 0 0 2px var(--fio), 0 0 0 5px var(--bad); } }
.tk-casca { position: absolute; inset: -5%; border-radius: 18%; display: none; border: 2px solid var(--escudo); box-shadow: inset 0 0 0 1px var(--fio); background: none; animation: casca var(--ciclo-persistente) infinite ease-in-out; }
.token.escudo .tk-casca { display: block; }
@keyframes casca { 50% { border-color: var(--osso); } }
.token.furtivo .tk-moldura { border-style: dashed; border-color: var(--fumaca); }
.token.furtivo .tk-arte { filter: contrast(.85) saturate(.55) brightness(.9); }
.token.furtivo .tk-arte::before { content: ""; position: absolute; inset: 0; border-radius: 12%; background: repeating-linear-gradient(135deg, rgba(237, 230, 214, .14) 0 6px, transparent 6px 14px); }
.tk-gelo { position: absolute; inset: 2%; border-radius: 14%; display: none; background: linear-gradient(180deg, rgba(125, 211, 252, .25), rgba(125, 211, 252, .75)), repeating-linear-gradient(60deg, rgba(237, 230, 214, .35) 0 2px, transparent 2px 9px), repeating-linear-gradient(-60deg, rgba(237, 230, 214, .3) 0 2px, transparent 2px 11px); border: 2px solid var(--frio); }
.token.congelado .tk-gelo { display: block; }
.token.congelado .tk-arte { filter: saturate(.3) brightness(1.1); }
.token.imune .tk-moldura { box-shadow: inset 0 0 0 2px var(--fio), 0 0 0 3px var(--imune), 0 0 16px rgba(0, 229, 192, .45); animation: halo var(--ciclo-persistente) infinite ease-in-out; }
@keyframes halo { 50% { box-shadow: inset 0 0 0 2px var(--fio), 0 0 0 4px var(--imune), 0 0 24px rgba(0, 229, 192, .7); } }
.token.esquivo .tk-moldura::after { content: ""; position: absolute; inset: -4px; border-radius: 16%; border: 2px solid rgba(237, 230, 214, .75); transform: translate(4px, 3px); pointer-events: none; }
.token.esquivo .tk-moldura::before { content: ""; position: absolute; inset: -4px; border-radius: 16%; border: 2px solid rgba(237, 230, 214, .45); transform: translate(-4px, -3px); pointer-events: none; }
.tk-aura { position: absolute; inset: -12%; border-radius: 50%; display: none; border: 2px solid var(--acento); box-shadow: none; animation: aura var(--ciclo-persistente) infinite ease-in-out; }
.token.aura-fonte .tk-aura { display: block; }
@keyframes aura { 50% { transform: scale(1.08); opacity: .55; } }
.token.podeAtacar { cursor: grab; }
.token.podeAtacar .tk-moldura { box-shadow: inset 0 0 0 2px var(--fio), 0 0 0 2px var(--ok); }
.token.podeAtacar:not(.atacando):not(.selecionada) { animation: pronto var(--ciclo-persistente) infinite ease-in-out; }
@keyframes pronto { 50% { transform: translateY(-3px); } }
.token.selecionada { transform: translateY(-5px) scale(1.06); z-index: 5; }
.token.selecionada .tk-moldura { box-shadow: inset 0 0 0 2px var(--fio), 0 0 0 4px var(--sel); }
.token.atacando { z-index: 8; animation: none; }
.token.morrendo, .token.saindo { pointer-events: none; }
.chegando { visibility: hidden !important; }
.saindo { pointer-events: none; }

/* alvos válidos (contorno + forma + cor) */
.alvo { cursor: crosshair; }
.token.alvo, .heroi.alvo { z-index: 4; }
.token.alvo .tk-moldura, .heroi.alvo .retrato { box-shadow: inset 0 0 0 2px var(--fio), 0 0 0 3px var(--bad), 0 0 16px rgba(255, 45, 78, .55); animation: alvoPulsa var(--ciclo-persistente) infinite; }
.token.alvo.aliado .tk-moldura, .heroi.alvo.aliado .retrato { box-shadow: inset 0 0 0 2px var(--fio), 0 0 0 3px var(--ok), 0 0 16px rgba(155, 255, 60, .55); }
.token.alvo.sobre, .heroi.alvo.sobre { transform: scale(1.1); }
.token.alvo.sobre .tk-moldura, .heroi.alvo.sobre .retrato { box-shadow: inset 0 0 0 2px var(--fio), 0 0 0 5px var(--sel); animation: none; }
@keyframes alvoPulsa { 50% { filter: brightness(1.25); } }

/* laterais (bandejas/pedestais à direita) */
.lateral { display: contents; }
.deck { position: absolute; border-radius: 4px; background: url("../img/verso.webp") center / cover no-repeat, #07070A; border: 1px solid rgba(237, 230, 214, .24); box-shadow: 2px 2px 0 #101116, 4px 4px 0 #0c0d11, 6px 6px 0 #08090c, 8px 10px 18px rgba(0, 0, 0, .7); display: grid; place-items: end center; transition: filter var(--dur-estado); }
.deck.ini { left: 82cqw; top: 13cqw; width: 7.6cqw; height: 10.4cqw; }
.deck.eu { left: 84cqw; top: 28cqw; width: 7.6cqw; height: 10.4cqw; }
.deck .n { background: var(--preto); color: var(--txt); font: 900 1.2cqw var(--fonte-titulo); padding: 1px 6px; border-radius: 0; margin-bottom: -.9cqw; border: 1px solid var(--line-forte); }
.deck.vazio { filter: grayscale(1) brightness(.4); }
.pedestal { position: absolute; border-radius: 50%; background: var(--carvao); border: 2px solid rgba(237, 230, 214, .24); display: grid; place-items: center; text-align: center; padding: 2%; font-size: .95cqw; color: rgba(237, 230, 214, .55); box-shadow: none; transition: box-shadow var(--dur-estado), border-color var(--dur-estado); }
.pedestal.ini { left: 75.3cqw; top: 15cqw; width: 6.2cqw; height: 6.2cqw; }
.pedestal.eu { left: 76.8cqw; top: 29.5cqw; width: 6.2cqw; height: 6.2cqw; }
.pedestal .rel-nome { font: 700 1em var(--fonte-titulo); line-height: 1.05; color: #f6ecd2; }
.pedestal .rel-turnos { font-size: .9em; color: #e9d5ff; }
.pedestal.com { border-color: var(--osso); box-shadow: inset 0 0 0 2px var(--fio), 0 0 0 2px var(--osso); animation: pedestalBrilho var(--ciclo-persistente) infinite ease-in-out; }
@keyframes pedestalBrilho { 50% { box-shadow: inset 0 0 0 2px var(--fio), 0 0 0 4px var(--osso); } }
.pedestal.acende { animation: acender var(--dur-climax) ease-out; }
@keyframes acender { 0% { box-shadow: 0 0 0 0 #fff, 0 0 60px #c98cff; filter: brightness(3); } 100% { filter: none; } }
.pedestal.quebra { animation: quebrar var(--dur-resolucao) ease-in; }
@keyframes quebrar { 0%, 100% { transform: none; } 20% { transform: translate(-3px, 1px) rotate(-3deg); } 40% { transform: translate(3px, -1px) rotate(3deg); } 60% { transform: translate(-2px, 2px); filter: brightness(2); } 80% { transform: translate(2px, -2px); } }
.pedestal.apaga { animation: apagar var(--dur-resolucao) ease-in; }
@keyframes apagar { to { filter: brightness(.2); } }

/* centro: rodada/vez + Encerrar turno */
.centro { position: absolute; left: 25cqw; top: 23.3cqw; width: 50cqw; height: 4.8cqw; display: flex; align-items: center; justify-content: space-between; padding: 0 1cqw; z-index: 3; }
.centro .turno { font-family: var(--fonte-titulo); font-weight: 700; font-size: 1.3cqw; background: rgba(7, 7, 10, .72); border: 1px solid var(--line-forte); border-radius: 0; padding: .2cqw 1cqw; color: var(--muted); }
.centro .turno.minha { background: var(--osso); color: var(--txt-inv); border-color: var(--osso); }
.encerrar { font-family: var(--fonte-titulo); font-size: 1.25cqw; padding: .5cqw 1.4cqw; min-height: 3.6cqw; border-radius: 0; }
.encerrar.pronto { box-shadow: 0 0 0 2px var(--osso); animation: chamar var(--ciclo-persistente) infinite ease-in-out; }
@keyframes chamar { 50% { filter: brightness(1.25); box-shadow: 0 0 0 4px var(--osso); } }

/* clickables decorativos nos cantos (brinquedo do tabuleiro) */
.canto { position: absolute; width: 5.5cqw; height: 5.5cqw; min-width: 36px; min-height: 36px; padding: 0; border: 0; background: transparent; box-shadow: none; font-size: 3.2cqw; line-height: 1; cursor: pointer; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .9)); transform-origin: 50% 20%; z-index: 3; }
.canto:hover { filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .9)) brightness(1.3); }
.canto:active { transform: scale(.92); box-shadow: none; }
.canto.tl { left: 5.5cqw; top: 2.5cqw; }
.canto.tr { left: 82cqw; top: 3cqw; }
.canto.bl { left: 3.5cqw; top: 41cqw; }
.canto.br { left: 88.5cqw; top: 40cqw; }
.canto.balanca { animation: balancar var(--dur-resolucao) ease-in-out; }
@keyframes balancar { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 45% { transform: rotate(11deg); } 70% { transform: rotate(-6deg); } 85% { transform: rotate(3deg); } }

/* mão inimiga: versos em leque pequeno (pendurados no topo) */
.mao.inimiga { position: absolute; left: 50%; top: -1.2cqw; width: 30cqw; height: 5cqw; transform: translateX(-50%); z-index: 2; pointer-events: none; }
.mao.inimiga .carta { --card-w: 3.4cqw; position: absolute; left: 50%; top: 0; margin-left: calc(var(--card-w) / -2); min-width: 22px; transform-origin: 50% -60%; transform: translate(var(--fx, 0), var(--fy, 0)) rotate(var(--fa, 0deg)); transition: transform var(--dur-estado) var(--ease-saida); background: url("../img/verso.webp") center / cover no-repeat, #07070A; border: 1px solid var(--line-forte); box-shadow: 0 3px 8px rgba(0, 0, 0, .7); }
.mao.inimiga .carta > * { display: none; }

/* mão do jogador em leque (fórmula do arco em ui.js; hover: z ↑, scale ↑, y ↑, rotação 0; FLIP por transição) */
.mao.eu { position: relative; z-index: 2; height: calc(var(--card-mao) * 1.32); margin-top: -14px; }
.mao.eu .carta { --card-w: var(--card-mao); position: absolute; left: 50%; bottom: 0; margin-left: calc(var(--card-mao) / -2); transform-origin: 50% 130%; transform: translate(var(--fx, 0), var(--fy, 0)) rotate(var(--fa, 0deg)); z-index: var(--z, 1); transition: transform var(--dur-estado) var(--ease-saida), box-shadow var(--dur-estado), filter var(--dur-estado); will-change: transform; }
.mao.eu .carta:not(.jogavel) { filter: grayscale(.5) brightness(.55); opacity: .78; }
.mao.eu .carta.jogavel { cursor: grab; }
@media (hover: hover) {
  .mao.eu .carta:hover:not(.arrastando) { transform: translate(var(--fx, 0), calc(var(--fy, 0) - 56px)) rotate(0) scale(1.32); z-index: 40; filter: none; }
}
.mao.eu .carta.focada:not(.arrastando) { transform: translate(var(--fx, 0), calc(var(--fy, 0) - 56px)) rotate(0) scale(1.32); z-index: 40; filter: none; }
.mao.eu .carta.selecionada { transform: translate(var(--fx, 0), calc(var(--fy, 0) - 40px)) rotate(0) scale(1.12); z-index: 41; box-shadow: 0 0 0 2px var(--fio), 0 0 0 5px var(--sel); }
.mao.eu .carta.arrastando { transition: none; z-index: 60; transform: translate(var(--dx, 0), var(--dy, 0)) rotate(0) scale(1.02); cursor: grabbing; box-shadow: 0 24px 40px rgba(0, 0, 0, .7), 0 0 0 2px rgba(237, 230, 214, .35); filter: none; pointer-events: none; }
.mao.eu .carta.arrastando.sobre-campo { transform: translate(var(--dx, 0), var(--dy, 0)) rotate(0) scale(.82); }
.mao.eu .carta.recuo { transition: transform var(--dur-resolucao) var(--ease-overshoot), box-shadow var(--dur-estado); }
.mao.eu .carta.pendente { transition: none; visibility: hidden; }
.carta .custo-badge { position: absolute; }
.pulso-custo { animation: pulsoCard var(--dur-estado) var(--ease-overshoot) 2 alternate; }
@keyframes pulsoCard { to { filter: brightness(1.6) drop-shadow(0 0 10px var(--acento)); } }

/* barra inferior */
.barra-eu { display: flex; gap: 10px; align-items: center; padding: 6px 4px; flex-wrap: wrap; }
.manas { display: flex; gap: 3px; }
.manas i { width: 14px; height: 14px; border-radius: 50%; background: transparent; box-shadow: inset 0 0 0 1px var(--line-forte); display: inline-block; transition: transform var(--dur-estado), background var(--dur-estado); }
.manas i.on { background: var(--mana); box-shadow: inset 0 0 0 1px rgba(237, 230, 214, .5); }
.manas.pulso-buff i.on { animation: pulsoNum var(--dur-estado) var(--ease-overshoot) 2 alternate; }
.poder { background: var(--panel2); border: 1px solid var(--line); border-radius: 0; padding: 6px 8px; font-size: .75rem; cursor: pointer; text-align: left; max-width: 220px; min-height: 44px; touch-action: none; }
.poder.on { box-shadow: 0 0 0 2px var(--ok); }
.poder.selecionada { background: var(--osso); color: var(--txt-inv); box-shadow: 0 0 0 3px var(--sel); }
.logjogo { max-height: 110px; overflow-y: auto; font-size: .78rem; color: var(--muted); background: rgba(7, 7, 10, .5); border-radius: 0; padding: 6px; }
.log-gaveta { position: fixed; right: 8px; bottom: 8px; width: min(340px, 90vw); max-height: 45vh; overflow: auto; background: var(--carvao); border: 1px solid var(--line-forte); border-radius: 0; padding: 10px; z-index: 30; font-size: .8rem; color: var(--muted); box-shadow: 0 10px 30px rgba(0, 0, 0, .7); }
.log-gaveta div { padding: 2px 0; border-bottom: 1px dashed rgba(255, 255, 255, .06); }
.btn-som { min-width: 44px; min-height: 44px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--carvao); border: 1px solid var(--line-forte); padding: 10px 16px; border-radius: 0; z-index: 50; animation: aparecer .2s; box-shadow: 0 8px 24px rgba(0, 0, 0, .6); max-width: 90vw; }
.toast.ok { border-color: var(--ok); border-left-width: 4px; }
.toast.bad { border-color: var(--bad); border-left-width: 4px; }
.modal { position: fixed; inset: 0; background: rgba(7, 7, 10, .85); display: grid; place-items: center; z-index: 40; padding: 12px; }
.modal .caixa { background: var(--panel); border: 1px solid var(--line-forte); border-radius: 0; padding: 20px; max-width: 720px; width: 100%; max-height: 92vh; overflow: auto; }
.cartas-linha { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tooltip { position: fixed; z-index: 60; pointer-events: none; }
.tooltip.central { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); }
.modal.descobrir .caixa { background: transparent; border: 0; box-shadow: none; max-width: 900px; text-align: center; }
.modal.descobrir h2 { font-size: 1.6rem; color: var(--txt); text-shadow: 0 1px 2px var(--preto); }
.descobrir-opcoes { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; perspective: 900px; }
.descobrir-opcoes .carta { cursor: pointer; animation: virar .6s var(--ease-overshoot) both; transition: transform var(--dur-estado) var(--ease-saida), box-shadow var(--dur-estado); }
.descobrir-opcoes .carta:nth-child(2) { animation-delay: .12s; }
.descobrir-opcoes .carta:nth-child(3) { animation-delay: .24s; }
.descobrir-opcoes .carta:hover, .descobrir-opcoes .carta:focus-visible { transform: translateY(-12px) scale(1.06); box-shadow: 0 0 0 2px var(--fio), 0 0 0 5px var(--sel); outline: none; }

/* camada de FX (fantasmas, números, partículas, seta) */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 35; overflow: hidden; }
#fx .fantasma { position: fixed; }
#fx .fantasma.conjurando { box-shadow: 0 0 0 3px var(--cor, #fff), 0 0 40px var(--cor, #fff); animation: conjurar var(--dur-resolucao) ease-in-out infinite alternate; }
@keyframes conjurar { to { filter: brightness(1.6); } }
#fx .fx { position: fixed; border-radius: 14%; }
.fx-impacto { background: radial-gradient(circle, #fff 0%, rgba(255, 255, 255, .5) 30%, rgba(255, 255, 255, 0) 70%); border-radius: 50%; animation: impacto var(--dur) ease-out forwards; }
@keyframes impacto { 0% { opacity: 1; transform: scale(.5); } 100% { opacity: 0; transform: scale(2); } }
.fx-corte { background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, .3) 46%, #fff 49%, #fff 51%, rgba(255, 255, 255, .3) 54%, transparent 60%); animation: corte var(--dur) ease-out forwards; }
@keyframes corte { 0% { opacity: 0; transform: scale(.4) rotate(-15deg); } 20% { opacity: 1; transform: scale(1.15) rotate(0); } 100% { opacity: 0; transform: scale(1.35) rotate(8deg); } }
.fx-explosao { border-radius: 50%; background: radial-gradient(circle, #fff 0, var(--cor) 28%, rgba(0, 0, 0, 0) 68%); animation: explosao var(--dur) ease-out forwards; }
@keyframes explosao { 0% { opacity: 1; transform: scale(.3); } 60% { opacity: .9; transform: scale(1.4); } 100% { opacity: 0; transform: scale(1.9); } }
.fx-perfurar { background: linear-gradient(90deg, transparent 44%, var(--cor) 49%, #fff 50%, var(--cor) 51%, transparent 56%), radial-gradient(circle, var(--cor) 0, transparent 45%); animation: perfurar var(--dur) ease-out forwards; }
@keyframes perfurar { 0% { opacity: 0; transform: scaleX(2) scaleY(.2); } 25% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scaleX(.6) scaleY(1.4); } }
.fx-halo { border-radius: 50%; box-shadow: 0 0 0 3px var(--cor), 0 0 26px var(--cor); animation: haloFx var(--dur) ease-out forwards; }
@keyframes haloFx { 0% { opacity: 0; transform: scale(.6); } 30% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0; transform: scale(1.5); } }
.fx-imune { border-radius: 50%; border: 3px solid var(--cor); animation: onda var(--dur) ease-out forwards; }
.fx-imune::after { content: "IMUNE"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 900 .9rem var(--fonte-titulo); color: var(--cor); text-shadow: 0 0 8px #000, 0 2px 4px #000; letter-spacing: 1px; }
@keyframes onda { 0% { opacity: 1; transform: scale(.8); } 100% { opacity: 0; transform: scale(1.6); } }
.fx-casca-quebra { border-radius: 18%; border: 3px solid var(--cor); box-shadow: 0 0 20px var(--cor), inset 0 0 16px rgba(255, 215, 102, .6); background: linear-gradient(35deg, transparent 48%, #fff 49%, #fff 51%, transparent 52%), linear-gradient(-60deg, transparent 38%, #fff 39%, #fff 41%, transparent 42%), linear-gradient(80deg, transparent 63%, #fff 64%, #fff 66%, transparent 67%), radial-gradient(circle, rgba(255, 215, 102, .55), transparent 70%); animation: cascaQuebra var(--dur) ease-out forwards; }
@keyframes cascaQuebra { 0% { opacity: 1; transform: scale(1); filter: brightness(2); } 35% { opacity: 1; transform: scale(1.12) rotate(2deg); } 100% { opacity: 0; transform: scale(1.5) rotate(-6deg); filter: brightness(1); } }
.fx-cura { background: linear-gradient(to top, rgba(74, 222, 128, .7), rgba(74, 222, 128, 0) 70%); animation: cura var(--dur) ease-out forwards; }
@keyframes cura { 0% { opacity: 0; transform: translateY(20%) scaleY(.6); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-40%) scaleY(1.2); } }
.fx-gelo { background: linear-gradient(180deg, rgba(186, 230, 253, .35), rgba(186, 230, 253, .9)); border: 2px solid #bae6fd; box-shadow: 0 0 18px #7dd3fc; animation: gelo var(--dur) ease-out forwards; }
@keyframes gelo { 0% { opacity: 0; clip-path: inset(100% 0 0 0); } 60% { opacity: 1; clip-path: inset(0 0 0 0); } 100% { opacity: 0; clip-path: inset(0); transform: scale(1.15); } }
.fx-silencio { border-radius: 14%; background: rgba(148, 163, 184, .35); border: 2px dashed #cbd5e1; animation: haloFx var(--dur) ease-out forwards; }
.fx-silencio::after { content: "SILÊNCIO"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 800 .7rem var(--fonte-texto); color: #e2e8f0; text-shadow: 0 1px 3px #000; letter-spacing: 1px; }
.fx-marca { background: linear-gradient(45deg, transparent 46%, var(--cor) 48%, var(--cor) 52%, transparent 54%), linear-gradient(-45deg, transparent 46%, var(--cor) 48%, var(--cor) 52%, transparent 54%); animation: pop var(--dur) var(--ease-overshoot) forwards; }
.fx-golpe { background: radial-gradient(circle, rgba(255, 77, 77, .7), transparent 70%); animation: impacto var(--dur) ease-out forwards; }
.fx-brasa { border-radius: 50%; background: radial-gradient(circle at 50% 80%, #ffb648, rgba(255, 122, 42, .6) 30%, transparent 65%); animation: brasa var(--dur) ease-in-out forwards; }
@keyframes brasa { 0% { opacity: 0; transform: scale(.6); } 25% { opacity: 1; transform: scale(1); } 60% { opacity: .9; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.3); } }
.fx-puff { border-radius: 50%; background: radial-gradient(circle, var(--cor), transparent 65%); filter: blur(4px); animation: impacto var(--dur) ease-out forwards; }
.fx-gatilho { border-radius: 50%; box-shadow: 0 0 0 2px var(--cor), 0 0 18px var(--cor); animation: gatilho var(--dur) ease-out forwards; }
@keyframes gatilho { 0% { opacity: 1; transform: scale(.7); } 100% { opacity: 0; transform: scale(1.35); } }
.fx-rachadura { border-radius: 50%; background: linear-gradient(25deg, transparent 48%, #fff 49%, #fff 51%, transparent 52%), linear-gradient(-70deg, transparent 58%, #fff 59%, #fff 61%, transparent 62%); animation: cascaQuebra var(--dur) ease-out forwards; }
@keyframes pop { 0% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1.15); } 100% { opacity: 0; transform: scale(1); } }
#fx .particula { position: fixed; border-radius: 50%; background: var(--cor); box-shadow: 0 0 6px var(--cor); }
#fx .particula.mote { border-radius: 40% 60% 50% 50%; }
.num { position: fixed; transform: translate(-50%, -50%); font: 900 1.7rem var(--fonte-titulo); color: var(--osso); text-shadow: 0 0 3px var(--preto), 0 2px 6px var(--preto), 0 0 14px currentColor; white-space: nowrap; z-index: 2; }
.num.dano { color: var(--bad); }
.num.dano.combate { color: var(--osso); }
.num.dano.verdadeiro { color: var(--po); }
.num.cura { color: var(--ok); }
.num.buff { color: var(--ok); font-size: 1.1rem; }
.num.debuff { color: var(--fumaca); font-size: 1.1rem; }
.num.escudo, .num.imune { color: var(--escudo); }
.num.armadura { color: var(--osso); font-size: 1.2rem; }
.num.aviso { color: var(--acento); font-size: .85rem; letter-spacing: .5px; font-family: var(--fonte-texto); font-weight: 800; }
.faixa { position: fixed; left: 50%; padding: 10px 48px; font: 900 2rem var(--fonte-titulo); color: var(--osso); background: linear-gradient(90deg, transparent, rgba(7, 7, 10, .92) 18%, rgba(7, 7, 10, .92) 82%, transparent); border-top: 1px solid var(--line-forte); border-bottom: 1px solid var(--line-forte); white-space: nowrap; z-index: 3; text-shadow: 0 2px 8px var(--preto); letter-spacing: 2px; }
.faixa.deles { color: var(--bad); border-color: rgba(255, 45, 78, .5); }
.faixa.vitoria { color: var(--ok); font-size: 2.6rem; }
.faixa.derrota { color: var(--bad); font-size: 2.6rem; border-color: rgba(255, 45, 78, .5); }
.seta-linha { fill: none; stroke: var(--seta-cor, var(--bad)); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 16 10; animation: fluir .5s linear infinite; filter: url(#seta-brilho); }
.seta-sombra { fill: none; stroke: rgba(7, 7, 10, .75); stroke-width: 11; stroke-linecap: round; }
.seta-ponta { fill: var(--seta-cor, var(--bad)); stroke: var(--preto); stroke-width: 1.5; }
.seta-origem { fill: var(--seta-cor, var(--bad)); stroke: var(--preto); stroke-width: 1.5; }
@keyframes fluir { to { stroke-dashoffset: -26; } }

/* pulsos de estado (nível 1) */
.entrando { animation: entrar var(--dur-resolucao) var(--ease-overshoot) both; }
@keyframes entrar { 0% { transform: scale(1.3) translateY(-8px); filter: brightness(2.2); } 55% { transform: scale(.93) translateY(3px); filter: brightness(1.15); } 100% { transform: scale(1) translateY(0); filter: none; } }
.renascendo { animation: renascerAnim var(--dur-climax) var(--ease-overshoot) both; }
@keyframes renascerAnim { 0% { transform: translateY(30px) scale(.6); opacity: 0; filter: brightness(3) sepia(1); } 50% { opacity: 1; transform: translateY(-6px) scale(1.08); } 100% { transform: none; filter: none; } }
.atingido { animation: atingido var(--dur-estado) ease-out; }
@keyframes atingido { 0% { filter: brightness(2.5); } 30% { transform: translate(-4px, 2px); } 60% { transform: translate(4px, -2px); } 100% { transform: none; filter: none; } }
.pulso-buff .tk-atk, .pulso-buff .tk-hp, .pulso-buff .vida, .pulso-buff .atkh, .pulso-buff .armadura { animation: pulsoNum var(--dur-estado) var(--ease-overshoot) 2 alternate; }
@keyframes pulsoNum { to { transform: scale(1.45); filter: brightness(1.6); } }
.pulso-debuff .tk-atk, .pulso-debuff .tk-hp { animation: pulsoBaixo var(--dur-estado) ease-in-out 2 alternate; }
@keyframes pulsoBaixo { to { transform: scale(.72); filter: saturate(.4); } }
.pulso-armadura { animation: pulsoNum var(--dur-estado) var(--ease-overshoot) 2 alternate; }
.pop { animation: popIc var(--dur-estado) var(--ease-overshoot) 2 alternate; }
@keyframes popIc { to { transform: scale(1.7); } }
.dano-flutuante { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); font-size: 1.6rem; font-weight: 900; color: var(--bad); text-shadow: 0 2px 6px #000; animation: subir .8s forwards; pointer-events: none; z-index: 5; }
.dano-flutuante.cura { color: var(--ok); }
@keyframes subir { to { transform: translate(-50%, -140%); opacity: 0; } }

/* tutorial por estado: escurece o resto, ilumina o próximo passo */
.mesa.tutorial::after { content: ""; position: absolute; inset: 0; border-radius: 16px; background: rgba(7, 7, 10, .72); z-index: 3; pointer-events: none; }
.mesa.tutorial .destaque, .mesa.tutorial .campo.destaque { z-index: 4; }
.mao.eu.tutorial .carta:not(.destaque):not(.arrastando) { opacity: .35; filter: grayscale(1); }
.destaque { outline: 3px solid var(--acento); outline-offset: 3px; box-shadow: 0 0 24px rgba(255, 47, 208, .5); animation: destaque var(--ciclo-persistente) infinite ease-in-out; }
@keyframes destaque { 50% { outline-color: var(--osso); box-shadow: 0 0 32px rgba(255, 47, 208, .8); } }
.dica { position: fixed; z-index: 36; max-width: 260px; background: var(--carvao); border: 1px solid var(--acento); border-radius: 0; padding: 8px 12px; font-size: .85rem; color: var(--txt); box-shadow: 0 10px 30px rgba(0, 0, 0, .7); pointer-events: auto; animation: aparecer .3s; }
.dica button { margin-top: 6px; }
.dica .passo { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--acento); margin-bottom: 4px; }
.barra-eu.tutorial > *:not(.destaque) { opacity: .35; filter: grayscale(1); }
.barra-eu.tutorial .destaque { position: relative; z-index: 4; }

/* coleção */
.filtros { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.filtros button.on { background: var(--osso); color: var(--txt-inv); border-color: var(--osso); }
.colecao-grade { display: flex; flex-wrap: wrap; gap: 8px; }
.deck-lista { display: flex; flex-direction: column; gap: 3px; }
.deck-item { display: flex; align-items: center; gap: 6px; background: var(--panel2); border-radius: 0; padding: 3px 8px; font-size: .85rem; cursor: pointer; }
.deck-item .c { width: 22px; height: 22px; border-radius: 50%; background: var(--osso); color: var(--txt-inv); display: grid; place-items: center; font-weight: 800; font-size: .75rem; }
.deck-item .n { flex: 1; }
.deck-item .x { color: var(--muted); }
.curva { display: flex; gap: 3px; align-items: flex-end; height: 40px; }
.curva div { flex: 1; background: var(--mana); border-radius: 0; min-height: 2px; position: relative; }
.curva div span { position: absolute; bottom: -16px; left: 0; right: 0; text-align: center; font-size: .65rem; color: var(--muted); }

/* loja */
.pacote { background: var(--panel); border: 1px solid var(--line-forte); border-top: 2px solid var(--acento); border-radius: 0; padding: 14px; display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; }
.pacote h3 { font-size: 1.05rem; }
.pacote .preco { display: flex; gap: 6px; flex-wrap: wrap; }
.abertura { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; perspective: 800px; }
.abertura .carta { animation: virar .6s ease both; }
.abertura .carta:nth-child(2) { animation-delay: .15s; }
.abertura .carta:nth-child(3) { animation-delay: .3s; }
.abertura .carta:nth-child(4) { animation-delay: .45s; }
.abertura .carta:nth-child(5) { animation-delay: .6s; }
@keyframes virar { from { transform: rotateY(90deg) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.nova { position: absolute; top: 30%; left: 50%; transform: translateX(-50%) rotate(-8deg); background: var(--ok); color: var(--txt-inv); font-weight: 900; padding: 2px 8px; border-radius: 0; font-size: .7rem; }

/* territórios */
.mapa { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.territorio { border: 2px solid var(--line-forte); border-radius: 0; padding: 12px; background: var(--panel); position: relative; min-height: 130px; display: flex; flex-direction: column; gap: 4px; }
.territorio.tier1 { border-color: #9BFF3C; }
.territorio.tier2 { border-color: #FFC21E; }
.territorio.tier3 { border-color: #FF2D4E; }
.territorio.meu { background: rgba(237, 230, 214, .07); }
.territorio.ataque { animation: pulsar 1s infinite alternate; }
@keyframes pulsar { from { box-shadow: 0 0 0 0 rgba(255, 45, 78, .6); } to { box-shadow: 0 0 0 6px rgba(255, 45, 78, 0); } }
.territorio .tier { position: absolute; top: 8px; right: 8px; font-size: .7rem; color: var(--muted); }
.rankbox { display: flex; align-items: center; gap: 12px; }
.rankbox .rk { font-size: 1.4rem; font-weight: 900; color: var(--txt); }
.barra-prog { height: 8px; background: var(--panel2); border-radius: 0; overflow: hidden; }
.barra-prog i { display: block; height: 100%; background: var(--acento); }

/* menu */
.menu-modos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.modo { background: var(--panel); border: 1px solid var(--line-forte); border-radius: 0; padding: 16px; cursor: pointer; transition: transform .12s, border-color .12s; }
.modo:hover { transform: translateY(-3px); border-color: var(--osso); }
.modo h3 { font-size: 1.1rem; }
.modo.breve { opacity: .5; cursor: default; }
.modo.breve:hover { transform: none; border-color: var(--line-forte); }
.familia-escolha { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.familia-card { border: 2px solid var(--line-forte); border-radius: 0; padding: 12px; cursor: pointer; background: var(--panel2); }
.familia-card.on { border-color: var(--cor, var(--osso)); box-shadow: inset 0 0 0 1px var(--cor, var(--osso)); }
.familia-card h4 { margin: 0 0 4px; }
.familia-card small { color: var(--muted); }

/* ===== Mobile: redesenho por tela (360–430 px): mesa empilhada, campo em largura total, alvos ≥ 44 px ===== */
@media (max-width: 760px) {
  :root { --card-w: 100px; --card-mao: 78px; }
  main { padding: 8px 6px 60px; }
  .topo nav a { padding: 6px 7px; font-size: .8rem; }
  .moedas { font-size: .8rem; gap: 6px; }
  .mesa { width: 100%; min-width: 0; aspect-ratio: auto; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto auto auto auto; grid-template-areas: "hini lini" "cini cini" "centro centro" "ceu ceu" "heu leu"; gap: 6px; padding: 8px 6px 6px; align-items: center; }
  /* relative (não static): retrato, vida e contadores são absolutos e precisam do próprio pai como referência */
  .heroi, .campo, .deck, .pedestal, .centro { position: relative; left: auto; top: auto; right: auto; bottom: auto; }
  .heroi { width: 56px; height: 56px; --h: 56px; margin: 0 4px 4px 4px; }
  .heroi.ini { grid-area: hini; justify-self: start; }
  .heroi.eu { grid-area: heu; justify-self: start; }
  .heroi .nomeh { display: none; }
  .lateral { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
  .lateral.ini { grid-area: lini; }
  .lateral.eu { grid-area: leu; }
  .deck { width: 34px; height: 46px; }
  .deck .n { font-size: .7rem; margin-bottom: -6px; }
  .pedestal { width: 46px; height: 46px; font-size: .5rem; }
  .campo { width: 100%; --tk-w: min(15cqw, calc((100cqw - 24px) / 7)); --tk-h: calc(var(--tk-w) * 1.25); min-height: calc(var(--tk-h) + 14px); padding: 6px 2px; gap: 2px; }
  .campo.ini { grid-area: cini; }
  .campo.eu { grid-area: ceu; }
  .campo.vazio::before { font-size: .8rem; }
  .campo.recebe .slot { min-width: 10px; }
  .token { font-size: calc(var(--tk-w) * .32); }
  .centro { grid-area: centro; width: 100%; height: auto; padding: 0 4px; }
  .centro .turno { font-size: .75rem; padding: 3px 10px; }
  .encerrar { font-size: .85rem; padding: 8px 14px; min-height: 44px; }
  .canto { width: 34px; height: 34px; font-size: 20px; min-width: 34px; min-height: 34px; }
  .canto.tl { left: 2px; top: 2px; } .canto.tr { right: 2px; left: auto; top: 2px; } .canto.bl { left: 2px; bottom: 2px; top: auto; } .canto.br { right: 2px; left: auto; bottom: 2px; top: auto; }
  .mao.inimiga { top: -6px; width: 120px; height: 24px; }
  .mao.inimiga .carta { --card-w: 18px; min-width: 18px; }
  .mao.eu { height: calc(var(--card-mao) * 1.36); margin-top: 10px; }
  .heroi.eu { margin-bottom: 8px; }
  .mao.eu .carta.focada:not(.arrastando) { transform: translate(var(--fx, 0), calc(var(--fy, 0) - 70px)) rotate(0) scale(1.5); }
  .poder { max-width: 160px; font-size: .7rem; }
  .barra-eu { gap: 6px; }
  .num { font-size: 1.3rem; }
  .faixa { font-size: 1.4rem; padding: 8px 24px; }
  .faixa.vitoria, .faixa.derrota { font-size: 1.9rem; }
}
@media (max-width: 400px) {
  :root { --card-mao: 70px; }
}

/* Movimento reduzido: menos deslocamento e partículas, sem remover informação */
@media (prefers-reduced-motion: reduce) {
  :root { --dur-tatil: 60ms; --dur-estado: 160ms; --dur-resolucao: 300ms; --dur-climax: 700ms; --ease-overshoot: ease-out; }
  .token.podeAtacar:not(.atacando):not(.selecionada), .encerrar.pronto, .tk-casca, .tk-aura, .pedestal.com, .token.imune .tk-moldura, .heroi.imune .retrato, .token.alvo .tk-moldura, .heroi.alvo .retrato, .mesa.recebe-mesa::after { animation: none; }
  .entrando { animation-name: entrarSuave; }
  @keyframes entrarSuave { 0% { opacity: 0; filter: brightness(2); } 100% { opacity: 1; filter: none; } }
  .atingido { animation-name: atingidoSuave; }
  @keyframes atingidoSuave { 0% { filter: brightness(2.5); } 100% { filter: none; } }
  .seta-linha { animation: none; }
  .mao.eu .carta, .mao.inimiga .carta { transition-duration: 120ms; }
  .fx-corte, .fx-explosao, .fx-perfurar { animation-duration: 260ms; }
}

/* ===== Acabamento de estampa (docs/DIRECAO-DE-ARTE.md; mesmo idioma de site/css/lp.css) =====
   Campo preto, osso como único claro, UM acento por família. Borda dura de 1px: sem bisel,
   sem gradiente metálico, sem brilho especular, sem sombra colorida.
   EXCEÇÃO ESCRITA DE PROPÓSITO: a regra de acabamento vale para o MOBILIÁRIO — topo, painel,
   botão, campo, carta parada. A camada #fx (fantasmas, partículas, números, impactos) e os
   anéis de estado do tabuleiro CONTINUAM podendo brilhar: sobre preto, glow é o que lê, e
   apagá-lo apaga o feedback de combate inteiro.
   Este bloco só carrega o que é chrome. Sinal mora na folha de cima, em UM lugar só. */
body { font-family: var(--fonte-texto); background: var(--bg); }
/* Grão de impressão: a única textura que a direção de arte autoriza (igual a body.lp::after). */
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .05; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E"); }
h1, h2, h3, .logo, .modo h3, .familia-card h4, .territorio h3, .pacote h3, .rankbox .rk, .heroi .nomeh { font-family: var(--fonte-titulo); letter-spacing: .3px; }
.topo { background: rgba(7, 7, 10, .92); border-bottom: 1px solid var(--line); box-shadow: none; padding: 10px 16px; }
.topo .logo { font-size: 1.35rem; font-weight: 900; background: none; -webkit-background-clip: initial; background-clip: initial; color: var(--osso); letter-spacing: .16em; filter: none; }
.topo nav a { font-weight: 600; color: var(--muted); border: 0; border-bottom: 2px solid transparent; border-radius: 0; }
.topo nav a.ativo, .topo nav a:hover { background: none; color: var(--osso); border-bottom-color: var(--acento); }
.moedas { background: none; border: 0; padding: 0; }
/* NÃO entram aqui .modo, .territorio e .familia-card: os três têm borda de 2px que é sinal
   (tier, escolha) e esta regra de 1px os apagaria. Eles são resolvidos lá em cima. */
.painel, .modal .caixa { background: var(--panel); border: 1px solid var(--line-forte); box-shadow: none; }
button { font-family: var(--fonte-texto); font-weight: 700; border: 1px solid var(--line-forte); box-shadow: none; }
button:active { box-shadow: none; transform: translateY(1px); }
.campo { background: rgba(7, 7, 10, .35); border: 1px solid rgba(237, 230, 214, .20); box-shadow: none; }
.heroi .vida { font-family: var(--fonte-titulo); }
.logjogo { font-family: var(--fonte-texto); }
.filtros button { background: transparent; border: 1px solid var(--line); color: var(--muted); box-shadow: none; }
input, select, textarea { font-family: var(--fonte-texto); background: var(--panel) !important; border: 1px solid rgba(237, 230, 214, .24) !important; color: var(--txt) !important; border-radius: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--osso) !important; outline: none; }
.modal { background: rgba(7, 7, 10, .85); backdrop-filter: blur(3px); }
/* Borda dura: zera o canto do MOBILIÁRIO. Nada de peça de jogo entra nesta lista —
   .carta, .token, .heroi, orbes, ícones de estado, slot e .mesa mantêm o raio, que ali é forma. */
button, .painel, .pill, .modo, .pacote, .territorio, .familia-card, .modal .caixa, .toast, .poder, .filtros button, .deck-item, .log-gaveta, .dica, .logjogo, .barra-prog, .nova, .encerrar, .centro .turno, .faixa-regra, .regra-causo, .carta .qtd, .deck .n { border-radius: 0; }
.logo-img { height: 44px; display: block; mix-blend-mode: normal; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .8)); }
@media (max-width: 640px) { .logo-img { height: 34px; } }
