/* ============================================================
   Identidade visual: pedra escura + bronze + dourado + pergaminho + gema azul
   (as mesmas cores das molduras das cartas)
   ============================================================ */
:root {
  --stone: #26272c; --stone2: #34353b; --stone3: #17181c;
  --bronze: #b08a3e; --bronze-d: #6b4f20; --bronze-l: #e2c27a;
  --gold: #f0b400; --parch: #dcc89a; --parch-d: #b39a67;
  --ink: #f4ecd8; --dim: #aaa18c; --gem: #3b82c4;
  --atk: #ff9466; --def: #78bcff; --ok: #7bd68f; --bad: #ff5d6c;
  --serif: "Cinzel", "Trajan Pro", Georgia, "Times New Roman", serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #101114; color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none; overflow: hidden; }
#app { position: fixed; inset: 0; overflow: hidden;
  background: #0c1a14 url(/forest.svg) center bottom / cover no-repeat; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; }
h1, h2, h3 { font-family: var(--serif); margin: 0; letter-spacing: .5px; }

/* ---------- botões (faixas de pergaminho / pedra) ---------- */
.btn { padding: 8px 14px; min-height: 42px; border-radius: 8px; font-family: var(--serif); font-weight: 700; font-size: 15px; letter-spacing: .5px;
  background: linear-gradient(#3d3e45, #2a2b31); border: 2px solid var(--bronze); color: var(--ink);
  box-shadow: inset 0 1px 0 #ffffff22, 0 2px 5px #000a; text-transform: uppercase; }
.btn.primary { background: linear-gradient(#f0dca4, #c7a560); color: #2c1e07; border-color: #8a6a2c; box-shadow: inset 0 1px 0 #fff8, 0 2px 6px #000a; }
.btn.danger { background: linear-gradient(#6a2530, #45171f); border-color: #b04a58; }
.btn:disabled { opacity: .4; }
.btn.small { min-height: 34px; padding: 5px 10px; font-size: 13px; }
.menu .row2 { display: flex; gap: 8px; } .menu .row2 .btn { flex: 1; }

/* ---------- menu ---------- */
.menu { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6vw; padding: 16px calc(16px + var(--safe-l)); }
.menu .brand { text-align: center; padding: 16px 26px; border-radius: 14px; background: #0009; border: 2px solid var(--bronze-d); box-shadow: 0 8px 24px #000a; }
.menu h1 { font-size: clamp(34px, 8vh, 58px); color: var(--gold); text-shadow: 0 2px 0 #5b3f08, 0 0 24px #f0b40055; line-height: 1.05; }
.menu .sub { color: var(--parch); margin-top: 8px; font-size: 14px; font-family: var(--serif); letter-spacing: 2px; text-transform: uppercase; }
.menu .form { width: min(360px, 44vw); display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 14px;
  background: linear-gradient(#2f3036, #202126); border: 3px solid var(--bronze); box-shadow: 0 0 0 2px #000a, 0 10px 30px #000c, inset 0 0 20px #0008; }
.menu label { font-size: 13px; color: var(--parch); display: block; margin-bottom: 6px; font-family: var(--serif); text-transform: uppercase; letter-spacing: 1px; }
.menu input, .home input { width: 100%; padding: 11px; border-radius: 8px; border: 2px solid var(--bronze-d); background: #121317; color: var(--ink); font-size: 16px; }
.chips { display: flex; gap: 6px; }
.chips button { flex: 1; padding: 10px 0; border-radius: 8px; background: #121317; border: 2px solid var(--bronze-d); font-size: 16px; font-family: var(--serif); }
.chips button.on { background: linear-gradient(#f0dca4, #c7a560); color: #2c1e07; border-color: #8a6a2c; font-weight: 700; }

/* ---------- jogo: estrutura ---------- */
.game { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto;
  padding: var(--safe-t) var(--safe-r) 0 var(--safe-l);
  --t-opp: clamp(50px, 15vh, 92px); --t-me: clamp(70px, 22vh, 124px); --t-watch: clamp(50px, 15vh, 92px); --cw: clamp(58px, 17vh, 100px); }
.hud { display: flex; align-items: center; gap: 8px; padding: 3px 8px; min-height: 36px;
  background: linear-gradient(#34353bf2, #202126f2); border-bottom: 2px solid var(--bronze); box-shadow: 0 2px 8px #000a; z-index: 5; }
.hud .who { flex: 1; font-family: var(--serif); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--parch); }
.hud .who b { color: var(--gold); }
.phases { display: flex; gap: 4px; }
.phases span { font-family: var(--serif); font-size: 12px; padding: 3px 8px; border-radius: 4px; background: #121317; color: var(--dim); border: 1px solid var(--bronze-d); text-transform: uppercase; }
.phases span.on { background: linear-gradient(#f0dca4, #c7a560); color: #2c1e07; border-color: #8a6a2c; font-weight: 700; }
.iconbtn { width: 34px; height: 30px; border-radius: 6px; background: #121317; border: 1px solid var(--bronze-d); font-size: 16px; line-height: 1; }

/* ---------- mesa redonda ---------- */
/* campo de batalha: arena de ruínas vista de cima (public/arena.svg, gerado por script) */
.table { position: relative; min-height: 0; overflow: hidden; background: #4f4630 url(/arena.svg) center / cover no-repeat; }
.arena { position: absolute; left: 50%; top: 50%; width: 72%; height: 82%; transform: translate(-50%, -50%); pointer-events: none; }
.arena::after { content: "↻"; position: absolute; inset: 0; display: grid; place-items: center; font-size: min(22vh, 150px); color: #3b2a1428; }
.center { position: absolute; left: 77%; top: 78%; transform: translate(-50%, -50%); width: 25%; max-height: 46%; z-index: 2;
  display: flex; flex-direction: column; gap: 4px; align-items: stretch; justify-content: center; }
.decks { display: flex; gap: 4px; font-size: 12px; color: var(--parch); }
.decks span { background: #121317; border: 1px solid var(--bronze-d); border-radius: 99px; padding: 2px 7px; white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; max-height: 30vh; }
.stack h3 { font-size: 12px; color: var(--gold); text-transform: uppercase; text-align: center; letter-spacing: 1px; text-shadow: 0 1px 3px #000; }
.sitem { display: flex; gap: 6px; align-items: center; padding: 4px 6px; border-radius: 6px; background: #0b0d12f2; border: 1px solid var(--bronze-d); font-size: 13px; line-height: 1.2; }
.sitem.top { border-color: var(--gold); }
.sitem.cancelled { text-decoration: line-through; opacity: .5; }
.mini { width: 28px; border-radius: 3px; flex: 0 0 auto; aspect-ratio: 440 / 617; object-fit: cover; }
.banner { padding: 5px 8px; border-radius: 6px; background: #0b0d12f2; border: 1px solid var(--gem); font-size: 13px; text-align: center; font-family: var(--serif); }
.banner.you { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 12px #f0b40066; }
/* "o que está acontecendo": últimas jogadas, a mais nova em destaque */
.pill { position: absolute; left: 8px; bottom: 6px; z-index: 6; width: min(32%, 300px); padding: 6px 10px; border-radius: 10px; font-size: 14px; line-height: 1.25;
  background: #0b0d12f2; border: 1px solid var(--bronze); color: var(--parch); pointer-events: none; display: flex; flex-direction: column; gap: 3px; }
.pill .old { font-size: 12px; color: var(--dim); }
.pill .new { color: var(--ink); font-weight: 700; }
.pill .ins { color: var(--gold); font-weight: 700; }
.pill.hint { color: var(--gold); border-color: var(--gold); font-weight: 700; }

/* assentos (posição e deslocamento vêm inline: ver SLOTS no main.js) */
.seat { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 2px; z-index: 3; }
.plate { position: relative; z-index: 4; font-family: var(--serif); font-size: 13px; font-weight: 700; padding: 1px 10px; border-radius: 99px; background: linear-gradient(#3d3e45, #25262b); border: 1px solid var(--bronze); color: var(--ink); white-space: nowrap; display: flex; gap: 5px; align-items: center; }
.plate small { color: var(--parch); font-size: 12px; }
.seat.turn .plate { background: linear-gradient(#f0dca4, #c7a560); color: #2c1e07; border-color: #8a6a2c; box-shadow: 0 0 12px #f0b400aa; }
.seat.prio .plate { box-shadow: 0 0 0 2px var(--gem), 0 0 10px var(--gem); }
.seat.out { opacity: .35; filter: grayscale(1); }
.seat .row { display: flex; gap: 4px; align-items: flex-end; }
.owatch { display: flex; gap: 3px; min-height: 24px; }
.pip { width: 26px; height: 26px; border-radius: 6px; background: var(--stone2); display: grid; place-items: center; font-size: 16px; border: 1px solid var(--bronze-d); cursor: pointer; }
.empty { width: var(--t-me); height: calc(var(--t-me) * 1.35); display: grid; place-items: center; text-align: center; font-size: 12px; color: var(--parch); background: #0008;
  border: 2px dashed var(--bronze-d); border-radius: 8px; padding: 2px; }
.empty.side { width: calc(var(--t-opp) * 2.6); height: calc(var(--t-opp) * 1.0); font-size: 12px; }

/* ---------- heróis (inspirado nas cartas dos heróis) ---------- */
.hero { --tw: var(--t-opp); width: var(--tw); container-type: inline-size; position: relative; border-radius: 8px; padding: 3px;
  background: linear-gradient(#3b3c43, #222328); border: 2px solid var(--bronze); text-align: center;
  box-shadow: inset 0 0 0 1px #000b, 0 3px 8px #000c; }
.hero.me { --tw: var(--t-me); }
.hero .rib { font-family: var(--serif); font-weight: 700; font-size: 14cqw; text-transform: uppercase; letter-spacing: .3px; margin: -1px -1px 3px; padding: 1px 2px;
  background: linear-gradient(#ecdcb2, #c0a066); color: #2c1e07; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero .hstats { display: flex; justify-content: space-around; font-size: 18cqw; font-weight: 700; margin-top: 2px; text-shadow: 0 1px 2px #000; }
.hero .hstats.evolved span { color: var(--gold); }
.hero .a { color: var(--atk); } .hero .d { color: var(--def); } .hero .d.hurt { color: var(--bad); }
.hero .eq { font-size: 12cqw; margin-top: 1px; line-height: 1; }
.hero .evo { position: absolute; top: 14cqw; right: 3px; font-size: 14cqw; z-index: 1; filter: drop-shadow(0 0 3px #000); }
.hero .flags { position: absolute; top: 14cqw; left: 3px; font-size: 13cqw; z-index: 1; filter: drop-shadow(0 0 3px #000); }
.portrait { width: 100%; aspect-ratio: 580 / 680; border-radius: 5px; background-size: 246% auto; background-position: 47% 23.5%; background-repeat: no-repeat; border: 1px solid #000a; }
.portrait.noimg { background: linear-gradient(160deg, var(--c), #0d0e12); display: grid; place-items: center; font-size: 34cqw; background-size: auto; }
.hero.dead { opacity: .4; }
/* oponentes: ficha compacta — retrato à esquerda, nome e números à direita */
.hero.side, .hero.watch { --tw: calc(var(--t-opp) * 2.6); display: grid; grid-template-columns: 38% 1fr; gap: 4px; align-items: center; text-align: left; padding: 3px; }
.hero.side .icol, .hero.watch .icol { min-width: 0; }
.hero.side .rib, .hero.watch .rib { font-size: 10.5cqw; margin: 0 0 2px; white-space: normal; line-height: 1.05; }
.hero.side .hstats, .hero.watch .hstats { flex-direction: column; justify-content: flex-start; align-items: flex-start; font-size: 14cqw; line-height: 1.1; margin: 0; gap: 0; }
.hero.side .eq, .hero.watch .eq { font-size: 11cqw; margin: 0; }
.hero.side .evo, .hero.side .flags, .hero.watch .evo, .hero.watch .flags { top: 1px; font-size: 11cqw; }
.hero.side .evo, .hero.watch .evo { right: 2px; } .hero.side .flags, .hero.watch .flags { left: auto; right: 14cqw; }
/* minha observação: cartas deitadas, empilhadas ao lado do herói do campo */
.wcol { display: flex; flex-direction: column; gap: 4px; justify-content: flex-end; }
.wcol .hero.watch { --tw: calc(var(--t-opp) * 2.3); }
.wcol .hero.watch .hstats { font-size: 12.5cqw; }

/* herói evoluído: dourado, como se pegasse fogo */
.hero.evolved { border-color: #ffd34d; animation: fireGlow 1.1s ease-in-out infinite alternate; }
@keyframes fireGlow {
  from { box-shadow: 0 0 9px 2px #ff9a1fcc, 0 0 20px 5px #f0b40077, 0 -5px 16px 2px #ff5a0077, inset 0 0 7px #f0b40099; }
  to   { box-shadow: 0 0 15px 5px #ffd34de0, 0 0 32px 11px #ff7a1a99, 0 -11px 24px 6px #ff4500bb, inset 0 0 13px #ffd34dbb; }
}
.hero.evolved::before { content: ""; position: absolute; left: -6%; right: -6%; bottom: calc(100% - 6px); height: 55%; pointer-events: none; z-index: 2;
  background:
    radial-gradient(ellipse 13% 70% at 10% 100%, #fff3b0 0%, #ffb02e 35%, #ff5a0000 72%),
    radial-gradient(ellipse 15% 95% at 28% 100%, #ffe27a 0%, #ff8a1f 38%, #ff3c0000 72%),
    radial-gradient(ellipse 14% 80% at 46% 100%, #fff3b0 0%, #ffa21f 36%, #ff4a0000 72%),
    radial-gradient(ellipse 15% 100% at 64% 100%, #ffe27a 0%, #ff8a1f 38%, #ff3c0000 72%),
    radial-gradient(ellipse 13% 72% at 82% 100%, #fff3b0 0%, #ffb02e 35%, #ff5a0000 72%),
    radial-gradient(ellipse 12% 60% at 96% 100%, #ffe27a 0%, #ff8a1f 38%, #ff3c0000 72%);
  transform-origin: 50% 100%; mix-blend-mode: screen; animation: flames .55s ease-in-out infinite alternate; }
.hero.evolved::after { content: ""; position: absolute; left: 0; right: 0; bottom: calc(100% - 4px); height: 120%; pointer-events: none; z-index: 2;
  background:
    radial-gradient(circle, #ffe27a 0 1.5px, transparent 2.5px) 15% 90% / 26% 40%,
    radial-gradient(circle, #ffb02e 0 1.5px, transparent 2.5px) 60% 70% / 31% 36%,
    radial-gradient(circle, #fff3b0 0 1px, transparent 2px) 85% 80% / 23% 44%;
  animation: embers 1.5s linear infinite; }
@keyframes flames { 0% { transform: scale(1, .82) skewX(-3deg); opacity: .85; } 50% { transform: scale(1.04, 1) skewX(2deg); opacity: 1; } 100% { transform: scale(.97, 1.14) skewX(-1deg); opacity: .9; } }
@keyframes embers { 0% { transform: translateY(18%); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(-40%); opacity: 0; } }
.hero.evolved .rib { background: linear-gradient(#fff0b8, #f0b400); }
.evolvedpic { animation: fireGlow 1.1s ease-in-out infinite alternate; border-color: #ffd34d; }
.evolvedtxt { color: var(--gold); border-color: var(--gold) !important; }

/* alvos */
.tgt { outline: 3px solid var(--ok); outline-offset: 1px; animation: pulse 1s infinite; cursor: pointer; }
@keyframes pulse { 50% { outline-color: transparent; } }
.dim { opacity: .4; }

/* ---------- rodapé: mão + ações ---------- */
.bottom { display: flex; align-items: stretch; gap: 6px; padding: 0 calc(6px + var(--safe-r)) var(--safe-b) 0;
  background: linear-gradient(#202126, #131418); border-top: 2px solid var(--bronze); box-shadow: 0 -4px 12px #000a; z-index: 5; }
.hand { flex: 1; min-width: 0; display: flex; align-items: flex-end; justify-content: safe center; overflow-x: auto; padding: 10px 10px 4px; scrollbar-width: none; min-height: calc(var(--cw) * 1.17 + 16px); }
.hand .none { margin: auto; color: var(--parch); font-size: 14px; }
/* carta da mão: só a arte (o texto aparece ao tocar na carta) */
.card { flex: 0 0 auto; width: var(--cw); border-radius: 8px; border: 2px solid #4a4a52; background: #1b1c20; opacity: .65; overflow: hidden; position: relative;
  transition: transform .12s; box-shadow: 0 3px 8px #000c; cursor: pointer; }
.card + .card { margin-left: -8px; }
.art { display: block; width: 100%; aspect-ratio: 310 / 362; background-size: 142.3% auto; background-position: 50.4% 39.2%; background-repeat: no-repeat; background-color: #14110d; }
.card .tp { position: absolute; right: 2px; bottom: 2px; font-size: 14px; line-height: 1; padding: 2px 3px; border-radius: 6px; background: #000b; }
.card.nexus { border-color: #5c7fa8; } .card.special { border-color: #a8795c; }
.card.ok { opacity: 1; border-color: var(--gold); box-shadow: 0 0 12px #f0b40088, 0 3px 8px #000c; transform: translateY(-8px); z-index: 1; }
.actions { width: clamp(130px, 22vw, 210px); display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 6px 0; }
.actions .btn { width: 100%; min-height: 38px; padding: 5px 6px; font-size: 13px; }
.actions .hint { font-size: 12px; color: var(--parch); text-align: center; line-height: 1.25; }

/* ---------- janelas ---------- */
.overlay { position: absolute; inset: 0; background: #000b; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 8px calc(8px + var(--safe-r)) 8px calc(8px + var(--safe-l)); }
.sheet { width: min(94%, 640px); max-height: 96%; overflow-y: auto; padding: 14px; border-radius: 12px; display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(#34353b, #202126); border: 3px solid var(--bronze); box-shadow: 0 0 0 2px #000, 0 16px 50px #000e, inset 0 0 24px #0008; }
.sheet h2 { color: var(--gold); font-size: 20px; }
.sheet h2 .owner { font-size: 14px; color: var(--dim); }
.sheet p { margin: 0; line-height: 1.4; font-size: 16px; }
.sheet p.why { color: var(--dim); font-size: 14px; }
.sheet p.tip { color: var(--parch); font-size: 14px; }
.sheet .kind { color: var(--parch); font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; font-family: var(--serif); }
.sheet .row { display: flex; gap: 8px; }
.sheet .row .btn { flex: 1; }
.split { display: flex; gap: 14px; align-items: flex-start; }
.split .pic { flex: 0 0 auto; }
.split .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.fullcard { height: min(72vh, 360px); width: auto; border-radius: 10px; border: 2px solid var(--bronze); box-shadow: 0 6px 20px #000c; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 14px; }
.kv div { background: #121317; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--bronze-d); }
.kv .now { grid-column: 1 / -1; }
.picklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; max-height: 58vh; overflow-y: auto; }
.prow { display: flex; gap: 8px; align-items: center; text-align: left; padding: 6px 8px; border-radius: 8px; background: #121317; border: 1px solid var(--bronze); font-size: 15px; min-height: 44px; }
.prow .ic { font-size: 24px; width: 30px; text-align: center; }
.prow small { color: var(--dim); font-size: 13px; }
.prow .mini { width: 30px; }
/* equipamentos de um herói (com imagem) */
.eqlist { display: flex; gap: 8px; flex-wrap: wrap; }
.eqcard { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 88px; padding: 4px; border-radius: 8px; background: #121317; border: 1px solid var(--bronze); font-size: 12px; line-height: 1.15; text-align: center; }
.eqcard .eqimg { width: 100%; aspect-ratio: 440 / 617; object-fit: cover; border-radius: 5px; }
.noeq { color: var(--dim); font-size: 14px; }
/* busca no monte / cemitério: grade de cartas para tocar e ver */
.pickgrid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; max-height: 56vh; overflow-y: auto; padding: 2px; }
.ptile { display: flex; flex-direction: column; gap: 3px; align-items: center; padding: 4px; border-radius: 8px; background: #121317; border: 1px solid var(--bronze); text-align: center; font-size: 13px; line-height: 1.15; }
.ptile .art { border-radius: 5px; }
.ptile.hero-t .portrait { border-radius: 5px; }
.ptile small { color: var(--dim); font-size: 12px; }
.bigemoji { font-size: 90px; }
.reveal { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.rcard { height: min(40vh, 190px); border-radius: 6px; aspect-ratio: 440 / 617; object-fit: cover; border: 1px solid var(--bronze); }
.logbox { max-height: 62vh; overflow-y: auto; font-size: 15px; display: flex; flex-direction: column; gap: 3px; }
.logbox div { padding: 4px 8px; background: #121317; border-radius: 5px; }

.full { position: absolute; inset: 0; z-index: 21; display: flex; flex-direction: column; gap: 8px; overflow-y: auto;
  padding: calc(8px + var(--safe-t)) calc(14px + var(--safe-r)) 10px calc(14px + var(--safe-l));
  background: radial-gradient(ellipse at 50% 30%, #3b3e47 0%, #1b1c20 70%); }
.full .head { display: flex; align-items: center; gap: 12px; }
.full .head h2 { flex: 1; color: var(--gold); font-size: 18px; }
.full .note { font-size: 14px; color: var(--parch); }
.pickgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-content: start; }
.pickgrid .hero { --tw: 100%; cursor: pointer; }
.pickgrid .hero.sel { outline: 3px solid var(--gold); transform: translateY(-2px); box-shadow: 0 0 18px #f0b40088; }
.center-col { align-items: center; justify-content: center; text-align: center; }
.big-result { font-size: 56px; }

/* ---------- aviso de celular na vertical ---------- */
#rotate { display: none; position: fixed; inset: 0; z-index: 100; background: #14151a; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.rot-box { max-width: 320px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.rot-ico { font-size: 64px; animation: rot 2.4s ease-in-out infinite; }
@keyframes rot { 0%, 20% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
.rot-box h2 { color: var(--gold); }
.rot-box p { margin: 0; color: var(--parch); font-size: 14px; line-height: 1.4; }
@media (orientation: portrait) { body:not(.noRot) #rotate { display: flex; } }

/* mesa cheia (5 e 6 jogadores): meus heróis e minha mão ficam um pouco menores para sobrar espaço no centro */
.game.n5 .pill, .game.n6 .pill { width: 25%; font-size: 12px; padding: 4px 8px; }
.game.n5 .pill .old, .game.n6 .pill .old { display: none; }
.game.n5, .game.n6 { --t-me: clamp(64px, 19vh, 112px); --t-opp: clamp(46px, 13.5vh, 84px); --cw: clamp(54px, 16vh, 92px); }

/* telas bem baixas (celular na horizontal) */
@media (max-height: 420px) {
  .hud { min-height: 26px; padding: 2px 8px; }
  .sheet { padding: 10px; gap: 8px; }
}

/* ============================================================
   Barra de baixo: observação (esquerda) · mão (centro) · ações (direita)
   ============================================================ */
.bwatch { flex: 0 0 auto; max-width: 48%; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 4px 0 4px 8px; }
.bw-label { font-family: var(--serif); font-size: 11px; color: var(--parch); text-transform: uppercase; letter-spacing: 1px; }
.bw-row { display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.bw-row .none { color: var(--dim); font-size: 13px; padding: 0 10px; }
.bwatch .hero.watch { --tw: calc(var(--cw) * 2.05); flex: 0 0 auto; }

/* ---------- verso das cartas (use assets/cardback.jpg; sem o arquivo aparece o desenho padrão) ---------- */
.cback { display: block; width: var(--bw, 30px); aspect-ratio: 2 / 3; border-radius: 4px; border: 2px solid var(--bronze); box-shadow: 0 2px 5px #000a, inset 0 0 0 1px #000a;
  background: url(/assets/cardback.jpg) center / cover no-repeat, url(/assets/cardback.svg) center / cover no-repeat, #3a2210; }
/* cartas de costas ao lado do herói do oponente: uma por carta na mão */
.backs { --bw: calc(var(--t-opp) * .42); display: grid; grid-auto-flow: column; align-self: center; margin-left: 4px; padding-right: calc(var(--bw) * .5);
  grid-auto-columns: min(calc(var(--bw) * .55), calc(var(--t-opp) * 1.9 / var(--n, 1))); }
.backs .cback { width: var(--bw); justify-self: start; }
.backs.none { display: none; }
/* baralho no centro da arena */
.deckpile { position: absolute; left: 57.5%; top: 54%; transform: translate(-50%, -50%); z-index: 2; width: calc(var(--t-opp) * .6); aspect-ratio: 2 / 3; }
.deckpile .cback { position: absolute; inset: 0; width: 100%; }
.deckpile .cback:nth-child(2) { transform: translate(2px, -2px); } .deckpile .cback:nth-child(3) { transform: translate(4px, -4px); }
.deckpile b { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); z-index: 3; background: #000d; color: var(--gold); border: 1px solid var(--bronze); border-radius: 99px; padding: 0 8px; font-size: 14px; }
.cback.fly { position: fixed; z-index: 60; pointer-events: none; aspect-ratio: auto; }

/* ---------- carta jogada: foto grande + o que ela faz ---------- */
.spot { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 9; display: flex; gap: 16px; align-items: center; max-width: 92%; max-height: 96%; padding: 12px 18px;
  border-radius: 14px; background: linear-gradient(#34353bf8, #202126f8); border: 3px solid var(--gold); box-shadow: 0 0 0 2px #000, 0 16px 50px #000e, 0 0 34px #f0b40055; cursor: pointer; animation: spotin .28s ease-out; }
.spot.mine { border-color: var(--gem); box-shadow: 0 0 0 2px #000, 0 16px 50px #000e, 0 0 34px #3b82c466; }
.spot .fullcard { height: min(56vh, 400px); }
.spot .stext { max-width: 340px; display: flex; flex-direction: column; gap: 6px; }
.spot .who { color: var(--parch); font-size: 14px; font-family: var(--serif); text-transform: uppercase; letter-spacing: 1px; }
.spot h3 { color: var(--gold); font-size: 22px; }
.spot .kind { color: var(--parch); font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; font-family: var(--serif); }
.spot p { margin: 0; font-size: 17px; line-height: 1.35; }
.spot p.to { color: var(--parch); font-size: 15px; }
.spot small { color: var(--dim); }
@keyframes spotin { from { opacity: 0; transform: translate(-50%, -46%) scale(.94); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

/* ============================================================
   Conta, perfil e sala
   ============================================================ */
.tabs { display: flex; gap: 6px; }
.tabs button { flex: 1; padding: 10px 0; border-radius: 8px; background: #121317; border: 2px solid var(--bronze-d); font-family: var(--serif); font-size: 14px; color: var(--parch); }
.tabs button.on { background: linear-gradient(#f0dca4, #c7a560); color: #2c1e07; border-color: #8a6a2c; font-weight: 700; }
.menu .err { color: var(--bad); font-size: 14px; min-height: 18px; }
.menu .form.wide { width: min(560px, 92vw); }
.menu.lobby h2 { color: var(--gold); font-size: 22px; } .code { letter-spacing: 4px; }
.linkbox { display: flex; gap: 6px; } .linkbox input { flex: 1; min-width: 0; }
.note { color: var(--dim); font-size: 12px; display: block; margin-top: 4px; line-height: 1.3; }
.members { display: flex; flex-direction: column; gap: 4px; }
.mem { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; background: #121317; border: 1px solid var(--bronze-d); border-radius: 8px; font-size: 15px; }
.mem small { color: var(--dim); } .mem.host { border-color: var(--gold); } .mem.empty { opacity: .5; border-style: dashed; }
.wait { text-align: center; color: var(--parch); padding: 8px; font-size: 15px; }
.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 200; max-width: 90vw; text-align: center; background: #0b0d12f8; border: 2px solid var(--gold); color: var(--ink); padding: 10px 16px; border-radius: 10px; font-size: 15px; box-shadow: 0 8px 24px #000c; }
.home { position: absolute; inset: 0; padding: calc(10px + var(--safe-t)) calc(16px + var(--safe-r)) 14px calc(16px + var(--safe-l)); display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.hhead { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 12px; background: #000a; border: 2px solid var(--bronze-d); }
.hhead h1 { color: var(--gold); font-size: 24px; text-shadow: 0 2px 0 #5b3f08; } .grow { flex: 1; }
.hgrid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 14px; align-items: start; }
.panel { padding: 16px; border-radius: 14px; display: flex; flex-direction: column; gap: 12px; background: linear-gradient(#2f3036f4, #202126f4); border: 3px solid var(--bronze); box-shadow: 0 0 0 2px #000a, 0 10px 30px #000c, inset 0 0 20px #0008; }
.panel h2 { color: var(--gold); font-size: 20px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stats div { background: #121317; border: 1px solid var(--bronze-d); border-radius: 8px; padding: 10px 6px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.stats b { font-size: 28px; font-family: var(--serif); } .stats .win { color: var(--ok); } .stats .loss { color: var(--bad); }
.stats span { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; }
.soon { padding: 12px; text-align: center; border: 2px dashed var(--bronze-d); border-radius: 10px; color: var(--parch); font-size: 14px; }
.opt { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid #ffffff14; }
.opt:last-child { border-bottom: 0; padding-bottom: 0; }
.opt h3 { font-size: 15px; color: var(--parch); } .opt small { color: var(--dim); font-size: 12px; }
@media (max-width: 700px) { .hgrid { grid-template-columns: 1fr; } }


/* ============================================================
   Tela inicial: cenário de pôr do sol, logo dourado, painel ornamentado
   ============================================================ */
.menu, .home { background: #1a110d url(/title.svg) center / cover no-repeat; }
.menu.title { justify-content: space-evenly; gap: 2vw; }
.tbrand { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0; background: none; border: 0; box-shadow: none; }
.tbrand .emblem { height: clamp(46px, 17vh, 140px); margin-bottom: -2.2vh; filter: drop-shadow(0 4px 6px #000a) drop-shadow(0 0 16px #ff9a2a77); }
.tbrand h1 { display: flex; flex-direction: column; line-height: .92; font-weight: 900; font-size: clamp(44px, 17vh, 132px); letter-spacing: 2px; text-transform: uppercase;
  filter: drop-shadow(0 4px 0 #3a2208) drop-shadow(0 6px 10px #000c) drop-shadow(0 0 26px #ff9a2a66); text-shadow: none; }
.tbrand h1 span { background: linear-gradient(#fff6da 0%, #f7d98c 26%, #c58a2c 50%, #f1c565 66%, #8a5412 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.tsub { display: flex; align-items: center; gap: 12px; margin-top: 1.4vh; color: #f1d9a4; font-family: var(--serif); font-size: clamp(11px, 3vh, 22px); letter-spacing: .32em; text-transform: uppercase; text-shadow: 0 2px 4px #000; }
.tsub i { width: clamp(24px, 5vw, 70px); height: 2px; background: linear-gradient(90deg, transparent, #e6b655); position: relative; } .tsub i:last-child { transform: scaleX(-1); }
.tsub i::after { content: ""; position: absolute; right: -3px; top: -3px; width: 7px; height: 7px; background: #f6d27a; transform: rotate(45deg); }

.menu.title .tform { position: relative; width: min(400px, 42vw); max-height: 97vh; overflow-y: auto; gap: clamp(7px, 1.8vh, 14px); padding: clamp(14px, 3.4vh, 26px) clamp(14px, 2.4vw, 26px); border-radius: 6px; scrollbar-width: none;
  background: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2044%2044'%3E%3Cg%20transform%3D'translate(0%200)'%20fill%3D'none'%20stroke%3D'%23e6b655'%20stroke-linecap%3D'round'%3E%3Cpath%20d%3D'M3%2041V14Q3%203%2014%203H41'%20stroke-width%3D'3'%2F%3E%3Cpath%20d%3D'M9%2030V16Q9%209%2016%209H30'%20stroke-width%3D'1.5'%20opacity%3D'.8'%2F%3E%3Cpath%20d%3D'M3%2024Q10%2024%2010%2017'%20stroke-width%3D'2'%2F%3E%3C%2Fg%3E%3Cpath%20d%3D'M15%2015l5%205-5%205-5-5z'%20transform%3D'translate(0%200)'%20fill%3D'%23f6d27a'%20stroke%3D'%236b4410'%20stroke-width%3D'1'%2F%3E%3C%2Fsvg%3E") top left / 44px no-repeat, url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2044%2044'%3E%3Cg%20transform%3D'translate(44%200)%20scale(-1%201)'%20fill%3D'none'%20stroke%3D'%23e6b655'%20stroke-linecap%3D'round'%3E%3Cpath%20d%3D'M3%2041V14Q3%203%2014%203H41'%20stroke-width%3D'3'%2F%3E%3Cpath%20d%3D'M9%2030V16Q9%209%2016%209H30'%20stroke-width%3D'1.5'%20opacity%3D'.8'%2F%3E%3Cpath%20d%3D'M3%2024Q10%2024%2010%2017'%20stroke-width%3D'2'%2F%3E%3C%2Fg%3E%3Cpath%20d%3D'M15%2015l5%205-5%205-5-5z'%20transform%3D'translate(44%200)%20scale(-1%201)'%20fill%3D'%23f6d27a'%20stroke%3D'%236b4410'%20stroke-width%3D'1'%2F%3E%3C%2Fsvg%3E") top right / 44px no-repeat, url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2044%2044'%3E%3Cg%20transform%3D'translate(0%2044)%20scale(1%20-1)'%20fill%3D'none'%20stroke%3D'%23e6b655'%20stroke-linecap%3D'round'%3E%3Cpath%20d%3D'M3%2041V14Q3%203%2014%203H41'%20stroke-width%3D'3'%2F%3E%3Cpath%20d%3D'M9%2030V16Q9%209%2016%209H30'%20stroke-width%3D'1.5'%20opacity%3D'.8'%2F%3E%3Cpath%20d%3D'M3%2024Q10%2024%2010%2017'%20stroke-width%3D'2'%2F%3E%3C%2Fg%3E%3Cpath%20d%3D'M15%2015l5%205-5%205-5-5z'%20transform%3D'translate(0%2044)%20scale(1%20-1)'%20fill%3D'%23f6d27a'%20stroke%3D'%236b4410'%20stroke-width%3D'1'%2F%3E%3C%2Fsvg%3E") bottom left / 44px no-repeat, url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2044%2044'%3E%3Cg%20transform%3D'translate(44%2044)%20scale(-1%20-1)'%20fill%3D'none'%20stroke%3D'%23e6b655'%20stroke-linecap%3D'round'%3E%3Cpath%20d%3D'M3%2041V14Q3%203%2014%203H41'%20stroke-width%3D'3'%2F%3E%3Cpath%20d%3D'M9%2030V16Q9%209%2016%209H30'%20stroke-width%3D'1.5'%20opacity%3D'.8'%2F%3E%3Cpath%20d%3D'M3%2024Q10%2024%2010%2017'%20stroke-width%3D'2'%2F%3E%3C%2Fg%3E%3Cpath%20d%3D'M15%2015l5%205-5%205-5-5z'%20transform%3D'translate(44%2044)%20scale(-1%20-1)'%20fill%3D'%23f6d27a'%20stroke%3D'%236b4410'%20stroke-width%3D'1'%2F%3E%3C%2Fsvg%3E") bottom right / 44px no-repeat,
    linear-gradient(#2a1c12ee, #120b07f0);
  border: 2px solid #8a6424; box-shadow: 0 0 0 1px #000, 0 0 0 4px #4a3210, 0 0 0 5px #c9993f88, 0 22px 60px #000e, 0 0 40px #ff9a2a22, inset 0 0 36px #000b; }
.menu.title .tform::-webkit-scrollbar { display: none; }
.menu.title label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.menu.title .tabs { gap: 0; border: 1px solid #5b3f14; background: #0a0705; padding: 3px; border-radius: 4px; }
.menu.title .tabs button { padding: clamp(7px, 1.8vh, 12px) 0; border-radius: 3px; background: transparent; border: 0; color: #e8cf98; font-size: clamp(13px, 2.6vh, 17px); font-weight: 600; }
.menu.title .tabs button.on { background: linear-gradient(#ffd77a, #d38e22 60%, #a6670f); color: #2a1503; box-shadow: inset 0 1px 0 #fff9, 0 0 12px #ff9d1c55; text-shadow: 0 1px 0 #ffe9a8; }
.menu.title .fld input { padding: clamp(9px, 2vh, 13px) 12px clamp(9px, 2vh, 13px) 50px; border: 1px solid #5b3f14; border-radius: 4px; color: #f6ead0; font-size: clamp(14px, 2.8vh, 18px);
  background: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%3E%3Ccircle%20cx%3D'12'%20cy%3D'8'%20r%3D'4.2'%20fill%3D'%23c9a45a'%2F%3E%3Cpath%20d%3D'M3.5%2021c0-5%203.8-7.2%208.5-7.2s8.5%202.2%208.5%207.2z'%20fill%3D'%23c9a45a'%2F%3E%3C%2Fsvg%3E") 13px center / 24px no-repeat, linear-gradient(#0a0705, #1a110a); box-shadow: inset 0 2px 8px #000d, 0 1px 0 #c9993f44; }
.menu.title .fld.lock input { background: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%3E%3Cpath%20d%3D'M7%2010V7a5%205%200%200110%200v3'%20fill%3D'none'%20stroke%3D'%23c9a45a'%20stroke-width%3D'2.2'%2F%3E%3Crect%20x%3D'4.5'%20y%3D'10'%20width%3D'15'%20height%3D'11'%20rx%3D'2'%20fill%3D'%23c9a45a'%2F%3E%3Ccircle%20cx%3D'12'%20cy%3D'15.5'%20r%3D'1.7'%20fill%3D'%232a1a0a'%2F%3E%3C%2Fsvg%3E") 13px center / 24px no-repeat, linear-gradient(#0a0705, #1a110a); }
.menu.title .fld input::placeholder { color: #a8946a; }
.menu.title .fld input:focus { outline: 0; border-color: #f0c468; box-shadow: inset 0 2px 8px #000d, 0 0 12px #ff9d1c66; }
.menu.title .err { min-height: 0; font-size: 13px; color: #ff8a8a; text-align: center; } .menu.title .err:empty { display: none; }
.menu.title .btn.go { position: relative; min-height: clamp(42px, 8.5vh, 60px); border: 0; border-radius: 0; font-size: clamp(17px, 3.6vh, 24px); letter-spacing: 1px; color: #2a1503;
  background: linear-gradient(#ffe08a, #e9a22b 55%, #a6670f); text-shadow: 0 1px 0 #ffeeb5;
  clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 16px 100%, 0 50%); box-shadow: inset 0 2px 0 #fffa, inset 0 -3px 0 #7a4a0e; }
.menu.title .btn.go:active { filter: brightness(.92); }
.menu.title .row2 .btn { min-height: clamp(34px, 6.4vh, 44px); font-size: clamp(11px, 2.2vh, 14px); background: linear-gradient(#2b1d12, #120b07); border: 1px solid #8a6424; color: #f1d9a4; box-shadow: inset 0 1px 0 #c9993f44; }
@media (max-width: 640px) { .menu.title { flex-direction: column; } .menu.title .tform { width: min(420px, 92vw); } }

/* ============================================================
   Miniaturas dos equipamentos embaixo do herói + setas de alvo
   ============================================================ */
.fcol { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.eqrow { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; max-width: calc(var(--t-opp) * 2.6); }
.seat.me .eqrow { max-width: calc(var(--t-me) * 1.6); }
.eqt { --w: calc(var(--t-opp) * .44); width: var(--w); aspect-ratio: 440 / 617; border-radius: 3px; border: 1.5px solid var(--gold); background: #1b1c20 center / cover no-repeat; box-shadow: 0 1px 4px #000c; cursor: pointer; flex: 0 0 auto; }
.seat.me .eqt { --w: calc(var(--t-me) * .36); }
.eqt.dim { opacity: .45; }
.eqt.tgt { outline: 3px solid var(--ok); outline-offset: 1px; animation: pulse 1s infinite; opacity: 1; z-index: 5; }
.arrows { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 8; overflow: visible; }
.ar-out { fill: none; stroke: #000; stroke-width: 7; stroke-linecap: round; opacity: .75; }
.ar-in { fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 9 5; animation: marchants .9s linear infinite; filter: drop-shadow(0 0 4px currentColor); }
@keyframes marchants { to { stroke-dashoffset: -28; } }
.targeted { outline: 3px solid #ffd36b; outline-offset: 2px; box-shadow: 0 0 16px #ffd36bcc; animation: tpulse 1.1s ease-in-out infinite; }
.srcd { box-shadow: 0 0 14px #f0b400aa; }
@keyframes tpulse { 50% { outline-color: #fff2b8; box-shadow: 0 0 26px #ffd36b; } }
.spot { z-index: 9; }
/* 1×1 em tela baixa (celular deitado): o oponente sai do eixo central para não ficar em cima do meu herói e das miniaturas */
@media (max-height: 520px) { .game.n2 .seat.opp { left: 33% !important; } .game.n2 .deckpile { left: 62%; top: 50%; } }

/* ---------- carta da pilha: painel fixo no canto esquerdo (não tapa as setas) ---------- */
.dock { position: absolute; left: 4px; top: 4px; z-index: 6; width: clamp(84px, 10.8vw, 150px); max-height: calc(100% - 8px); overflow: hidden; display: flex; flex-direction: column; gap: 3px; padding: 4px; border-radius: 8px; cursor: pointer;
  background: linear-gradient(#26272cf5, #17181cf5); border: 2px solid var(--gold); box-shadow: 0 6px 18px #000c, 0 0 14px #f0b40044; }
.dock.mine { border-color: var(--gem); box-shadow: 0 6px 18px #000c, 0 0 14px #3b82c444; }
.dock .dimg { width: 100%; display: block; border-radius: 4px; flex: 0 0 auto; }
.dock .dtxt { min-height: 0; overflow: hidden; }
.dock .who { font-family: var(--serif); font-size: clamp(8px, 1.05vw, 11px); color: var(--parch); text-transform: uppercase; letter-spacing: .5px; }
.dock h4 { margin: 1px 0 2px; font-family: var(--serif); font-size: clamp(10px, 1.3vw, 14px); color: var(--gold); line-height: 1.1; }
.dock p { margin: 0 0 2px; font-size: clamp(9px, 1.2vw, 13px); line-height: 1.25; color: var(--ink); }
.dock p.to { color: var(--parch); }
.table.hasdock .pill.feed { display: none; }

/* ============================================================
   Fotos redondas dos jogadores
   ============================================================ */
.av { display: inline-block; flex: 0 0 auto; width: var(--avs, 24px); height: var(--avs, 24px); border-radius: 50%; background: #1b1c20 center / 345% auto no-repeat; border: 2px solid var(--bronze); box-shadow: 0 1px 4px #000a; vertical-align: middle; }
.av.img { background-size: cover !important; background-position: center !important; }
.av.big { --avs: 52px; border-width: 3px; } .av.huge { --avs: 76px; border-color: var(--gold); border-width: 3px; } .av.opt { --avs: 100%; width: 100%; height: auto; aspect-ratio: 1; }
.plate .av { --avs: 28px; margin: -5px 0 -5px -8px; }
.plate { padding-left: 8px; }
.me-id { display: flex; align-items: center; gap: 14px; } .me-id h2 { margin-bottom: 6px; }
.avgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.avopt { padding: 0; border-radius: 50%; background: none; border: 3px solid transparent; } .avopt.sel { border-color: var(--gold); box-shadow: 0 0 12px #f0b400aa; }
.avfile { display: flex; align-items: center; justify-content: center; text-align: center; cursor: pointer; }
.mem .av { --avs: 26px; margin-right: 4px; }

/* ============================================================
   De quem é o turno: tudo do jogador da vez fica verde e brilhante
   ============================================================ */
:root { --turn: #5dff8a; }
.tgt, .eqt.tgt { outline-color: #4fc3ff; } /* alvo escolhível = azul (verde agora é só "turno") */
.seat.turn .plate { background: linear-gradient(#b9f7c8, #3fae62); color: #06260f; border-color: #e0ffe9; box-shadow: 0 0 14px var(--turn), 0 0 30px #5dff8a77; }
.seat.turn .plate small { color: #0b3a1a; }
.seat.turn .plate .av { border-color: var(--turn); box-shadow: 0 0 12px var(--turn); }
.seat.turn .hero, .seat.turn .empty { outline: 3px solid var(--turn); outline-offset: 2px; box-shadow: 0 0 22px #5dff8aaa; animation: turnglow 1.5s ease-in-out infinite; }
.seat.turn .eqt, .seat.turn .cback, .seat.turn .pip { border-color: var(--turn); box-shadow: 0 0 8px #5dff8a99; }
@keyframes turnglow { 50% { box-shadow: 0 0 36px #5dff8add; outline-color: #d4ffe0; } }
.hud .who b { color: var(--turn); text-shadow: 0 0 10px #5dff8a88; }
.game.myturn .bottom { box-shadow: inset 0 3px 0 var(--turn), inset 0 10px 26px #5dff8a22; }
.game.myturn .bw-label { color: var(--turn); }

/* aviso grande quando começa um turno */
#tbanner { position: fixed; left: 50%; top: 18%; z-index: 400; pointer-events: none; transform: translateX(-50%); display: none; }
#tbanner.show { display: block; animation: tbin 2.1s ease forwards; }
.tb { display: flex; align-items: center; gap: 12px; padding: 8px 22px 8px 10px; border-radius: 999px; background: linear-gradient(#0f2a17f2, #07140af2); border: 3px solid var(--turn); box-shadow: 0 0 30px #5dff8acc, 0 10px 30px #000c; }
.tb small { display: block; color: #b9f7c8; font-family: var(--serif); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; }
.tb b { font-family: var(--serif); font-size: clamp(18px, 3.4vh, 26px); color: #fff; text-shadow: 0 0 12px #5dff8a; }
.tb.mine b { color: var(--turn); }
@keyframes tbin { 0% { opacity: 0; transform: translateX(-50%) translateY(-18px) scale(.9); } 12% { opacity: 1; transform: translateX(-50%) scale(1); } 78% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-6px); } }

/* ============================================================
   Histórico lateral (direita), aviso de morte e observação dos oponentes
   ============================================================ */
.mid { display: flex; min-height: 0; }
.mid .table { flex: 1; min-width: 0; }
.sidelog { flex: 0 0 clamp(124px, 16vw, 240px); display: flex; flex-direction: column; min-height: 0; background: linear-gradient(#1d1e23f2, #121317f2); border-left: 2px solid var(--bronze-d); z-index: 2; }
.sl-head { padding: 4px 6px 5px; border-bottom: 1px solid #ffffff1c; flex: 0 0 auto; }
.sl-title { font-family: var(--serif); font-size: clamp(11px, 1.45vw, 14px); color: var(--parch); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .sl-title b { color: var(--turn); }
.sl-phases { display: flex; gap: 3px; margin-top: 3px; }
.sl-phases span { flex: 1; text-align: center; font-size: clamp(8.5px, 1.1vw, 11px); padding: 2px 0; border-radius: 4px; background: #0007; color: var(--dim); font-family: var(--serif); }
.sl-phases span.on { background: linear-gradient(#f0dca4, #c7a560); color: #2c1e07; font-weight: 700; }
.sl-now { margin-top: 3px; font-size: clamp(10px, 1.3vw, 12.5px); color: var(--gold); font-weight: 700; line-height: 1.2; }
.sl-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 6px; font-size: clamp(10px, 1.3vw, 12.5px); line-height: 1.3; scrollbar-width: thin; scrollbar-color: #5a4a2a transparent; }
.sl-list > div { margin-bottom: 4px; color: #a9a9b4; word-break: break-word; }
.sl-list > div.new { color: var(--ink); font-weight: 600; }
.sl-list .atk { color: #ffb08a; } .sl-list .dead { color: #ff8793; font-weight: 700; }
.sl-list .turnsep { margin-top: 7px; padding-top: 3px; border-top: 1px solid #5dff8a55; color: var(--turn); font-family: var(--serif); font-size: clamp(10px, 1.3vw, 12.5px); }

.pill.feed { width: min(36%, 320px); }

#kbanner { position: fixed; left: 50%; top: 38%; z-index: 410; pointer-events: none; transform: translateX(-50%); display: none; flex-direction: column; gap: 6px; align-items: center; }
#kbanner.show { display: flex; animation: kbin 2.8s ease forwards; }
.kb { display: flex; align-items: center; gap: 12px; padding: 8px 22px 8px 14px; border-radius: 14px; background: linear-gradient(#3a0f14f4, #1a0609f4); border: 3px solid #ff5d6c; box-shadow: 0 0 34px #ff5d6ccc, 0 10px 30px #000d; }
.kb > span { font-size: clamp(28px, 6vh, 44px); }
.kb b { display: block; font-family: var(--serif); font-size: clamp(17px, 3.6vh, 26px); color: #fff; text-shadow: 0 0 12px #ff5d6c; }
.kb small { color: #ffb3bb; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; font-family: var(--serif); }
@keyframes kbin { 0% { opacity: 0; transform: translateX(-50%) scale(.7); } 10% { opacity: 1; transform: translateX(-50%) scale(1.06); } 18% { transform: translateX(-50%) scale(1); } 82% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(10px); } }

/* observação dos oponentes: contagem visível + lista ao tocar */
.owatch { align-items: center; cursor: pointer; padding: 1px 6px 1px 4px; border-radius: 99px; background: #000a; border: 1px solid var(--bronze-d); }
.owatch.zero { opacity: .65; }
.ow-n { font-size: 13px; color: var(--parch); margin-right: 2px; white-space: nowrap; }
.owgrid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.owcell { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.owcell .eqrow { max-width: none; } .owcell .eqt { --w: 34px; }
.owcell .noeq { color: var(--dim); font-size: 12px; }

/* ============================================================
   Animação de ataque + botões de avançar que piscam
   ============================================================ */
.dmgnum { position: fixed; z-index: 520; pointer-events: none; transform: translate(-50%, 0); font-family: var(--serif); font-weight: 900; font-size: clamp(22px, 6vh, 38px);
  color: #ff5d6c; text-shadow: 0 0 6px #000, 0 2px 0 #000, 0 0 16px #ff1f3a; animation: dmgup 1.4s ease-out forwards; white-space: nowrap; }
.dmgnum.block { color: #9fd3ff; text-shadow: 0 0 6px #000, 0 0 16px #4aa8ff; font-size: clamp(16px, 4.4vh, 26px); }
.dmgnum.kill { color: #fff; font-size: clamp(26px, 7vh, 44px); text-shadow: 0 0 6px #000, 0 0 22px #ff1f3a, 0 0 40px #ff1f3a; }
@keyframes dmgup { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.5); } 15% { opacity: 1; transform: translate(-50%, -4px) scale(1.3); } 30% { transform: translate(-50%, -10px) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -46px) scale(1); } }
.impact { position: fixed; z-index: 510; width: 10px; height: 10px; pointer-events: none; transform: translate(-50%, -50%); border-radius: 50%; }
.impact::before, .impact::after { content: ''; position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%, -50%); }
.impact.blade::before { width: 20px; height: 20px; background: radial-gradient(#fff, #ffd37a 40%, transparent 70%); animation: burst .5s ease-out forwards; }
.impact.blade::after { width: 120px; height: 5px; border-radius: 3px; background: linear-gradient(90deg, transparent, #fff, transparent); transform: translate(-50%, -50%) rotate(-35deg); animation: slashfx .45s ease-out forwards; }
.impact.magic::before { width: 20px; height: 20px; background: radial-gradient(#fff, #c79bff 35%, #7a3dff55 60%, transparent 72%); animation: burst .6s ease-out forwards; }
.impact.magic::after { width: 30px; height: 30px; border: 3px solid #c79bff; animation: ring .6s ease-out forwards; }
.impact.kill::before { background: radial-gradient(#fff, #ff6a6a 40%, transparent 70%); animation-duration: .7s; }
.impact.block::before { background: radial-gradient(#fff, #9fd3ff 40%, transparent 70%); }
@keyframes burst { from { transform: translate(-50%, -50%) scale(.4); opacity: 1; } to { transform: translate(-50%, -50%) scale(6); opacity: 0; } }
@keyframes ring { from { transform: translate(-50%, -50%) scale(.3); opacity: 1; } to { transform: translate(-50%, -50%) scale(4); opacity: 0; } }
@keyframes slashfx { from { transform: translate(-50%, -50%) rotate(-35deg) scaleX(.2); opacity: 1; } to { transform: translate(-50%, -50%) rotate(-35deg) scaleX(1.2); opacity: 0; } }

/* botões da lateral (resolver / avançar fase / encerrar turno): maiores e piscando para ninguém esquecer */
.actions .btn.blink { min-height: clamp(48px, 13vh, 62px); font-size: clamp(14px, 2.2vw, 18px); border-width: 2px; animation: blinkbtn 1s ease-in-out infinite; }
.actions .btn.blink:not(.primary) { background: linear-gradient(#f0dca4, #c7a560); color: #2c1e07; border-color: #8a6a2c; }
.actions .btn.blink:disabled { animation: none; filter: grayscale(.7); }
@keyframes blinkbtn { 0%, 100% { transform: scale(1); filter: brightness(1); box-shadow: 0 0 0 0 #ffd36a00, 0 2px 6px #000a; } 50% { transform: scale(1.045); filter: brightness(1.25); box-shadow: 0 0 0 4px #ffd36acc, 0 0 22px 6px #ffd36a99, 0 2px 6px #000a; } }

/* equipamentos do MEU herói: em pé, na lateral esquerda da carta (dos oponentes continuam embaixo) */
.seat.me .fcol { position: relative; }
.seat.me .eqrow.left { position: absolute; right: calc(100% + 4px); top: 0; flex-direction: column; flex-wrap: wrap-reverse; align-content: flex-start; justify-content: flex-start;
  max-width: none; max-height: calc(var(--t-me) * 1.5); gap: 3px; z-index: 4; }
.seat.me .eqrow.left .eqt { --w: calc(var(--t-me) * .4); }
.hero .hstats span { white-space: nowrap; }
.hero.me .hstats { font-size: 16cqw; }

/* ajuda "instalar na Tela de Início" (iPhone) */
#installhelp .sheet { max-height: 92vh; overflow-y: auto; }
#installhelp .steps { margin: 6px 0 8px 22px; padding: 0; line-height: 1.45; font-size: 15px; }
#installhelp .steps li { margin-bottom: 4px; }
#installhelp { position: fixed; z-index: 600; }

/* ============================================================
   Celular deitado (tela baixa): tudo menor para sobrar espaço para o campo de batalha
   ============================================================ */
@media (max-height: 440px) {
  .game, .game.n5, .game.n6 { --t-me: clamp(46px, 18vh, 110px); --t-opp: clamp(36px, 11.5vh, 84px); --cw: clamp(38px, 12.5vh, 92px); }
  .hud { min-height: 28px; padding: 2px 8px; gap: 6px; }
  .hud .who { font-size: clamp(11px, 3.6vh, 16px); }
  .phases span { font-size: clamp(9px, 2.9vh, 12px); padding: 2px 6px; }
  .decks { font-size: clamp(9px, 2.9vh, 12px); } .decks span { padding: 1px 5px; }
  .iconbtn { width: clamp(26px, 8vh, 34px); height: clamp(24px, 7.4vh, 30px); font-size: clamp(12px, 3.9vh, 16px); }
  .plate { font-size: clamp(10px, 3.3vh, 13px); } .plate small { font-size: clamp(9px, 3vh, 12px); }
  .plate .av { --avs: clamp(20px, 6.6vh, 28px); }
  .hand { padding: 8px 8px 3px; min-height: calc(var(--cw) * 1.17 + 12px); }
  .card.ok { transform: translateY(-5px); }
  .bw-label { font-size: 10px; }
  .bwatch .hero.watch { --tw: calc(var(--cw) * 1.9); }
  .actions { width: clamp(108px, 20vw, 190px); gap: 3px; padding: 4px 0; }
  .actions .btn { min-height: clamp(28px, 8.4vh, 38px); font-size: clamp(10.5px, 3.4vh, 13px); }
  .actions .btn.blink { min-height: clamp(34px, 11vh, 52px); font-size: clamp(11.5px, 3.9vh, 16px); letter-spacing: 0; padding: 3px 4px; white-space: normal; line-height: 1.05; }
  .actions .hint { font-size: clamp(9px, 2.9vh, 12px); }
  .pill { font-size: clamp(10px, 3.2vh, 14px); padding: 3px 8px; }
  .sidelog { flex-basis: clamp(108px, 15vw, 220px); }
  .eqt { --w: calc(var(--t-opp) * .4); }
  .seat.me .eqt, .seat.me .eqrow.left .eqt { --w: calc(var(--t-me) * .38); }
  .empty { font-size: clamp(9px, 3vh, 12px); }
  .dock { font-size: clamp(9px, 2.9vh, 12px); }
}
