:root {
  --bg: #0f0d0b;
  --bg-2: #16130f;
  --panel: #1c1813;
  --panel-2: #241f18;
  --line: #3a3127;
  --line-soft: #2a241d;
  --text: #ece3d3;
  --muted: #a99b85;
  --dim: #6f6454;
  --gold: #d3ad6a;
  --gold-2: #f0cf8e;
  --hp: #d1584a;
  --hope: #e9c46a;
  --stress: #5aa2c9;
  --armor: #9aa7b3;
  --moss: #7fa36b;
  --radius: 14px;
  --display: 'Cinzel', Georgia, serif;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.5; }
#app { height: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: .02em; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); font-weight: 600; font-size: 14px; transition: .15s; text-decoration: none; color: var(--text); }
.btn:hover { border-color: var(--gold); color: var(--gold-2); }
.btn.primary { background: var(--gold); color: #1a140c; border-color: var(--gold); }
.btn.primary:hover { background: var(--gold-2); color: #1a140c; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.danger:hover { border-color: var(--hp); color: var(--hp); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.block { width: 100%; }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.input, textarea.input, select.input { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); }
.input:focus { border-color: var(--gold); outline: none; }
textarea.input { resize: vertical; min-height: 84px; }
.olho { position: relative; display: block; margin: 0 !important; }
.olho .input { padding-right: 86px; }
.olho button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); font-size: 12px; color: var(--muted); }
.erro { color: #f09a8e; font-size: 13px; min-height: 18px; margin: 4px 0 10px; }

/* ---------- entrada e lista de mesas ---------- */
.porta { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); }
.porta-arte { position: relative; overflow: hidden; }
.porta-arte img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.porta-arte::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15,13,11,.1) 40%, var(--bg) 100%), linear-gradient(0deg, rgba(15,13,11,.85) 0%, transparent 45%); }
.porta-arte div { position: absolute; left: 40px; bottom: 40px; z-index: 1; max-width: 440px; }
.porta-arte h1 { font-size: 44px; line-height: 1.05; }
.porta-arte p { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--gold-2); margin: 10px 0 0; }
.porta-form { display: flex; align-items: center; justify-content: center; padding: 32px 24px; }
.caixa { width: 100%; max-width: 380px; }
.caixa h2 { font-size: 24px; color: var(--gold-2); margin-bottom: 6px; }
.caixa > p { margin: 0 0 20px; color: var(--muted); }
.troca { margin-top: 16px; font-size: 14px; color: var(--muted); }
.troca button { background: none; border: 0; padding: 0; color: var(--gold-2); text-decoration: underline; }

.saguao { max-width: 880px; margin: 0 auto; padding: 28px 24px 60px; }
.saguao-topo { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 26px; }
.saguao-topo h1 { font-size: 22px; }
.saguao h2 { font-size: 18px; color: var(--gold-2); margin: 26px 0 12px; }
.card { background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 18px; }
.mesas { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.mesa-card { display: block; text-align: left; width: 100%; transition: border-color .15s; font-weight: 400; }
.mesa-card:hover { border-color: var(--gold); }
.mesa-card b { display: block; font-family: var(--display); font-size: 17px; margin-bottom: 4px; }
.duas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- mesa ---------- */
.mesa { height: 100%; display: grid; grid-template-rows: auto 1fr; grid-template-columns: 64px minmax(0, 1fr) 330px; grid-template-areas: 'topo topo topo' 'trilho mapa lado'; }
.topo { grid-area: topo; display: flex; align-items: center; gap: 14px; padding: 8px 16px; border-bottom: 1px solid var(--line-soft); background: var(--bg-2); min-width: 0; }
.topo .marca { font-family: var(--display); font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo .cena-nome { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo .espaco { flex: 1; }
.aviso { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 12px; border-radius: 10px; background: rgba(211,173,106,.12); border: 1px solid rgba(211,173,106,.4); font-size: 13px; white-space: nowrap; }
.conexao { width: 9px; height: 9px; border-radius: 50%; background: var(--moss); flex: 0 0 9px; }
.conexao.off { background: var(--hp); }

.trilho { grid-area: trilho; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; border-right: 1px solid var(--line-soft); background: var(--bg-2); z-index: 6; }
.trilho button { width: 46px; height: 46px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--muted); display: grid; place-items: center; position: relative; }
.trilho button:hover { color: var(--text); background: var(--panel); }
.trilho button.on { color: #1a140c; background: var(--gold); }
.trilho button:disabled { opacity: .35; cursor: default; background: transparent; color: var(--muted); }
.trilho svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.trilho hr { width: 28px; border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.trilho button::after { content: attr(data-nome); position: absolute; left: 56px; top: 50%; transform: translateY(-50%); padding: 5px 10px; border-radius: 8px; background: #000; color: var(--text); font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 30; }
.trilho button:not(.on):hover::after { opacity: 1; }

.centro { grid-area: mapa; position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.mapa { position: absolute; inset: 0; overflow: hidden; background: #0a0908; touch-action: none; cursor: grab; }
.mapa.arrastando { cursor: grabbing; }
.palco { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; box-shadow: 0 0 0 1px var(--line-soft), 0 20px 60px rgba(0,0,0,.6); }
.palco > img.fundo { width: 100%; height: 100%; object-fit: fill; pointer-events: none; user-select: none; }
.palco.vazio { background: linear-gradient(rgba(58,49,39,.5) 1px, transparent 1px) 0 0 / 5% 8%, linear-gradient(90deg, rgba(58,49,39,.5) 1px, transparent 1px) 0 0 / 5% 8%, radial-gradient(circle at 50% 40%, #2a2218, #15120e); }
.vazio-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 20px; pointer-events: none; }
.tk { position: absolute; width: calc(var(--tk) * var(--tam, 1)); height: calc(var(--tk) * var(--tam, 1)); transform: translate(-50%, -50%); border-radius: 50%; border: calc(var(--tk) * .07) solid var(--cor); background: var(--panel) center / cover; box-shadow: 0 2px 8px rgba(0,0,0,.7); display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: calc(var(--tk) * var(--tam, 1) * .4); color: var(--cor); user-select: none; touch-action: none; }
.tk.meu, .tk.movel { cursor: grab; }
.tk.meu { box-shadow: 0 0 0 calc(var(--tk) * .05) rgba(255,255,255,.85), 0 2px 10px rgba(0,0,0,.7); }
.tk.oculto { opacity: .45; border-style: dashed; }
.tk.sel { box-shadow: 0 0 0 calc(var(--tk) * .06) var(--gold-2), 0 0 calc(var(--tk) * .6) var(--gold); }
.tk.solto { transition: left .12s linear, top .12s linear; }
.tk span { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: calc(var(--tk) * .1); padding: 0 calc(var(--tk) * .12); border-radius: 4px; background: rgba(0,0,0,.72); color: var(--text); font-family: var(--sans); font-weight: 600; font-size: calc(var(--tk) * .26); line-height: 1.5; white-space: nowrap; pointer-events: none; }
.zoom { position: absolute; right: 12px; top: 12px; display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(22,19,15,.9); border: 1px solid var(--line); z-index: 4; }
.zoom button { width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; font-size: 18px; color: var(--muted); }
.zoom button:hover { background: var(--panel-2); color: var(--text); }
.zoom button.txt { width: auto; padding: 0 10px; font-size: 13px; font-weight: 600; }
.vez { position: absolute; left: 50%; transform: translateX(-50%); top: 12px; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; border-radius: 12px; background: rgba(22,19,15,.94); border: 1px solid var(--gold); font-size: 14px; z-index: 4; width: max-content; max-width: calc(100% - 190px); }
.vez .bola { width: 24px; height: 24px; flex-basis: 24px; font-size: 11px; }
.vez[hidden] { display: none; }

.lado { grid-area: lado; border-left: 1px solid var(--line-soft); background: var(--bg-2); display: flex; flex-direction: column; min-height: 0; }
.lado-topo { overflow-y: auto; flex: 0 1 auto; max-height: 62%; }
.reg { flex: 1 1 0; min-height: 120px; overflow-y: auto; border-top: 1px solid var(--line-soft); padding-bottom: 8px; }
.fala { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line-soft); }
.fala .input { font-size: 14px; }
.foto { aspect-ratio: 16 / 10; background: var(--panel); position: relative; }
.foto img { width: 100%; height: 100%; object-fit: cover; }
.foto .sem { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-size: 13px; text-align: center; padding: 20px; }
.lado-corpo { padding: 16px; }
.lado h2 { font-size: 20px; color: var(--gold-2); margin-bottom: 6px; }
.lado .desc { font-family: var(--serif); font-size: 18px; line-height: 1.4; color: #d8cdb9; white-space: pre-wrap; margin: 0; }
.lado h3 { font-size: 14px; margin: 22px 0 8px; color: var(--muted); font-family: var(--sans); font-weight: 600; }
.gente { list-style: none; margin: 0; padding: 0; }
.gente li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line-soft); }
.gente li:first-child { border-top: 0; }
.bola { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; border: 2px solid var(--cor); background: var(--panel) center / cover; display: grid; place-items: center; font-family: var(--display); font-size: 12px; color: var(--cor); }
.gente b { display: block; font-size: 14px; line-height: 1.2; }
.gente small { color: var(--muted); font-size: 12px; }
.gente .on { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.gente .on.sim { background: var(--moss); }

/* ---------- gaveta dos painéis ---------- */
.gaveta { position: absolute; left: 0; top: 0; bottom: 0; width: 390px; max-width: 100%; background: var(--bg-2); border-right: 1px solid var(--line); z-index: 5; overflow-y: auto; padding: 16px; box-shadow: 20px 0 40px rgba(0,0,0,.45); }
.gaveta-topo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.gaveta-topo h2 { font-size: 18px; color: var(--gold-2); }
.x { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); }
.x:hover { color: var(--text); border-color: var(--gold); }
.item { border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--panel); }
.item.atual { border-color: var(--gold); }
.item-topo { display: flex; align-items: center; gap: 8px; }
.item-topo b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-topo button.nome { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selo { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--gold); color: #1a140c; font-weight: 600; white-space: nowrap; }
.selo.cinza { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.item-corpo { margin-top: 12px; }
.linha { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cores { display: flex; gap: 6px; flex-wrap: wrap; }
.cores button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; background: var(--c); }
.cores button.on { border-color: #fff; }
.envio { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.envio .mini { width: 64px; height: 48px; flex: 0 0 64px; border-radius: 8px; background: var(--bg) center / cover; border: 1px solid var(--line); }
.envio .mini.redonda { width: 48px; flex-basis: 48px; border-radius: 50%; }
.envio > div:last-child { flex: 1; min-width: 0; }
.envio small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.convite { display: flex; gap: 6px; }
.convite .input { font-size: 13px; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0; font-size: 14px; }
.check input { margin-top: 3px; accent-color: var(--gold); }

.toast { position: fixed; left: 50%; top: 60px; transform: translate(-50%, -20px); padding: 10px 16px; border-radius: 10px; background: #000; border: 1px solid var(--line); font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- ficha e HUD ---------- */
.sec { font-size: 15px; color: var(--gold-2); margin: 22px 0 10px; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 10px; }
.g3 .field > span, .g2 .field > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.fila .input { flex: 1; min-width: 0; }
.input[data-curto] { flex: 0 0 64px; width: 64px; text-align: center; }
.fila .x { flex: 0 0 38px; height: 38px; }
.input.nota { margin-top: 6px; font-size: 13px; }
.hab p { margin: 6px 0 0; }
.hab .texto { font-size: 14px; color: #d8cdb9; white-space: pre-wrap; }
.abas { display: flex; gap: 4px; margin-bottom: 14px; padding: 4px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-soft); }
.abas button { flex: 1; padding: 6px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; }
.abas button.on { background: var(--gold); color: #1a140c; }
.boxes { display: flex; gap: 4px; flex-wrap: wrap; }
.box { width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--line); background: transparent; padding: 0; transition: .12s; }
.box:hover { border-color: var(--gold); }
.box.on.hp { background: var(--hp); border-color: var(--hp); }
.box.on.st { background: var(--stress); border-color: var(--stress); }
.box.on.ar { background: var(--armor); border-color: var(--armor); }
.box.dia { transform: rotate(45deg) scale(.82); border-radius: 3px; }
.box.on.hope { background: var(--hope); border-color: var(--hope); }
.hud { position: absolute; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 4; display: flex; align-items: stretch; gap: 2px; max-width: calc(100% - 24px); overflow-x: auto; scrollbar-width: none; padding: 6px; background: rgba(22, 19, 15, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.hud::-webkit-scrollbar { display: none; }
.hud-g { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 6px 14px; white-space: nowrap; flex: 0 0 auto; }
.hud-g + .hud-g { border-left: 1px solid var(--line-soft); }
.hud-l { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 12px; color: var(--muted); font-weight: 600; }
.hud-l b { color: var(--text); }
.hud .boxes { flex-wrap: nowrap; }
.estado { display: flex; flex-wrap: wrap; gap: 4px 0; padding: 6px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); }
.estado .hud-g { padding: 6px 10px; }
.estado .hud-g + .hud-g { border-left: 0; }
.gente .res { display: block; color: var(--dim); }
.gente li.clica { cursor: pointer; }
.gente li.clica:hover b { color: var(--gold-2); }

/* ---------- mapa de blocos ---------- */
.palco canvas.fundo { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.palco.blocos { box-shadow: 0 0 0 2px #000, 0 20px 60px rgba(0,0,0,.6); background: #0d0c0b; }
.linhas { position: absolute; inset: 0; pointer-events: none; display: none; background-image: linear-gradient(rgba(0,0,0,.28) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,.28) 1px, transparent 1px); background-size: 48px 48px; }
.palco.editando .linhas { display: block; }
.palco.editando .tk { pointer-events: none; opacity: .55; }
.mapa.pintando, .palco.editando { cursor: crosshair; }
.tk.spr { border: 0; border-radius: 0; background: none; box-shadow: none; transition: left .12s linear, top .12s linear; font-size: 0; }
.tk.spr .s { position: absolute; inset: 0; image-rendering: pixelated; filter: drop-shadow(0 calc(var(--tk) * .04) 0 rgba(0,0,0,.45)); }
.tk.spr::before { content: ''; position: absolute; left: 12%; right: 12%; bottom: -2%; height: 20%; border-radius: 50%; background: var(--cor); opacity: .6; }
.tk.spr.meu::before { opacity: 1; box-shadow: 0 0 0 calc(var(--tk) * .04) #fff; }
.tk.spr.sel .s { filter: drop-shadow(0 0 calc(var(--tk) * .12) var(--gold-2)) drop-shadow(0 0 calc(var(--tk) * .12) var(--gold-2)); }
.tk.spr.vez .s { filter: drop-shadow(0 0 calc(var(--tk) * .14) var(--gold-2)) drop-shadow(0 0 calc(var(--tk) * .2) var(--gold)); }
.tk.spr span { font-size: calc(var(--tk) * .24); margin-top: calc(var(--tk) * .12); }
.paleta { display: flex; flex-wrap: wrap; gap: 4px; }
.tl { width: 40px; height: 40px; padding: 0; border-radius: 6px; border: 2px solid transparent; background-color: #2b2832; image-rendering: pixelated; }
.tl.sol { box-shadow: inset 0 0 0 3px rgba(209,88,74,.95); }
.folha-rolo { overflow: auto; max-height: 440px; border: 1px solid var(--line); border-radius: 8px; background: #2b2832; margin-bottom: 8px; }
#folha { display: block; image-rendering: pixelated; cursor: pointer; }
.mais { margin: 14px 0; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 12px; }
.mais summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.mais form { margin-top: 10px; }
.tl:hover { border-color: var(--line); }
.tl.on { border-color: var(--gold-2); box-shadow: 0 0 0 2px rgba(240,207,142,.35); }

.tk.poi { border: 0; border-radius: 0; background: none; box-shadow: none; cursor: pointer; }
.tk.poi svg { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 calc(var(--tk) * .05) calc(var(--tk) * .05) rgba(0,0,0,.6)); }
.tk.poi path { fill: var(--cor); stroke: #1a140c; stroke-width: 1.4; }
.tk.poi circle { fill: #1a140c; }
.tk.poi.sel svg { filter: drop-shadow(0 0 calc(var(--tk) * .15) #fff); }
.cartao { position: absolute; left: 12px; top: 12px; width: min(320px, calc(100% - 24px)); padding: 12px 14px; border-radius: 14px; background: rgba(22,19,15,.96); border: 1px solid var(--gold); box-shadow: 0 16px 40px rgba(0,0,0,.6); z-index: 6; }
.cartao[hidden] { display: none; }
.cartao b { font-family: var(--display); font-size: 16px; color: var(--gold-2); }
.cartao p { margin: 8px 0 0; white-space: pre-wrap; font-family: var(--serif); font-size: 17px; line-height: 1.35; }

.nevoa { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; z-index: 5; }
.nevoa[hidden] { display: none; }
.palco.editando .nevoa { opacity: .5; }
.tk.spr.anda .s { animation: passo .26s steps(2, end) infinite; }
@keyframes passo { 0% { transform: translateY(0) scaleX(var(--vira, 1)); } 50% { transform: translateY(calc(var(--tk) * -.07)) scaleX(var(--vira, 1)); } 100% { transform: translateY(0) scaleX(var(--vira, 1)); } }
.tk.spr .s { transform: scaleX(var(--vira, 1)); }
.tk.spr.esq { --vira: -1; }
.tk.ataca { animation: golpe .34s ease; }
@keyframes golpe { 0% { transform: translate(-50%, -50%); } 35% { transform: translate(calc(-50% + var(--tk) * .3 * var(--vira, 1)), calc(-50% - var(--tk) * .08)); } 100% { transform: translate(-50%, -50%); } }
.tk.bateu { animation: levou .5s ease; }
@keyframes levou { 0%, 100% { transform: translate(-50%, -50%); filter: none; } 15% { transform: translate(calc(-50% - var(--tk) * .12), -50%); filter: brightness(2.4) sepia(1) hue-rotate(-40deg) saturate(4); } 45% { transform: translate(calc(-50% + var(--tk) * .1), -50%); filter: brightness(1.6) sepia(1) hue-rotate(-40deg) saturate(3); } }
.tk.caido .s { transform: rotate(-78deg) scaleX(var(--vira, 1)); filter: grayscale(.75) brightness(.72); }
.tk.caido::before { opacity: .25; }
.dano-voa { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); font: 700 calc(var(--tk) * .3) / 1 var(--sans); color: #ff9d8e; text-shadow: 0 1px 2px #000, 0 0 6px #000; white-space: nowrap; pointer-events: none; animation: sobe 1.2s ease-out forwards; }
@keyframes sobe { 0% { opacity: 0; transform: translate(-50%, 6px); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, calc(var(--tk) * -.9)); } }
@media (prefers-reduced-motion: reduce) { .tk.spr.anda .s, .tk.ataca, .tk.bateu, .dano-voa { animation: none; } }

/* ---------- vez, alcance, registro ---------- */
.tk.vez { box-shadow: 0 0 0 calc(var(--tk) * .07) var(--gold-2), 0 0 calc(var(--tk) * .9) var(--gold); }
.anel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 50%; border: calc(var(--tk) * .03) dashed rgba(240, 207, 142, .75); pointer-events: none; }
.anel.a1 { width: calc(var(--tk) * 4); height: calc(var(--tk) * 4); }
.anel.a2 { width: calc(var(--tk) * 12); height: calc(var(--tk) * 12); border-color: rgba(240, 207, 142, .45); }
.anel u { position: absolute; left: 50%; top: 0; transform: translate(-50%, -55%); padding: 0 calc(var(--tk) * .12); border-radius: 4px; background: rgba(0,0,0,.75); color: var(--gold-2); font: 600 calc(var(--tk) * .22) / 1.5 var(--sans); text-decoration: none; white-space: nowrap; }
.medo { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; font-size: 13px; color: var(--muted); }
.medo b { color: var(--text); }
.medo .pontos { display: flex; gap: 3px; flex-wrap: wrap; flex: 1; }
.medo .pontos i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--line); }
.medo .pontos i.on { background: #8c6bd6; border-color: #8c6bd6; }
.medo .x { width: 26px; height: 26px; }
.gente .quem { flex: 1; min-width: 0; }
.gente .on { margin-left: 0; }
.reg-topo { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px 4px; position: sticky; top: 0; background: var(--bg-2); z-index: 1; }
.reg-topo h3 { font-family: var(--sans); font-size: 14px; color: var(--muted); font-weight: 600; }
.r { padding: 8px 16px; font-size: 14px; }
.r + .r { border-top: 1px solid var(--line-soft); }
.r p { margin: 2px 0 0; }
.r .hora { float: right; color: var(--dim); font-size: 12px; }
.r.sis { color: var(--muted); font-size: 13px; }
.r.sis p { margin: 0; }
.r small { display: block; color: var(--dim); font-size: 12px; margin-top: 2px; }
.r .tot { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.r .tot strong { font-family: var(--display); font-size: 26px; line-height: 1.1; color: var(--text); }
.r .tot span { color: var(--muted); font-size: 13px; }
.r .tot .tag { padding: 1px 8px; border-radius: 999px; font-weight: 600; font-size: 12px; }
.r.res-esperanca .tag { background: rgba(233,196,106,.16); color: var(--hope); }
.r.res-medo .tag { background: rgba(140,107,214,.2); color: #b9a2ee; }
.r.res-critico .tag { background: var(--gold); color: #1a140c; }
.r.t-dano .tot strong { color: #f09a8e; }

@media (min-width: 861px) {
  .com-gaveta .hud { left: calc(390px + (100% - 390px) / 2); max-width: calc(100% - 414px); }
  .com-gaveta .vez { left: calc(390px + (100% - 390px) / 2); max-width: calc(100% - 600px); }
}
@media (max-width: 860px) {
  .hud { bottom: 8px; padding: 4px; border-radius: 14px; }
  .hud-g { padding: 4px 10px; }
  .hud .box { width: 14px; height: 14px; }
  .porta { grid-template-columns: 1fr; }
  .porta-arte { display: none; }
  .duas { grid-template-columns: 1fr; }
  .mesa { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) auto auto; grid-template-areas: 'topo' 'mapa' 'lado' 'trilho'; }
  .trilho { flex-direction: row; justify-content: center; padding: 6px; border-right: 0; border-top: 1px solid var(--line-soft); }
  .trilho hr { width: 0; height: 28px; border-top: 0; border-left: 1px solid var(--line); margin: 0 6px; }
  .trilho button::after { display: none; }
  .lado { border-left: 0; border-top: 1px solid var(--line-soft); max-height: 38vh; display: block; overflow-y: auto; }
  .lado-topo { max-height: none; overflow: visible; }
  .foto { aspect-ratio: 3 / 1; }
  .reg { overflow: visible; min-height: 0; }
  .fala { position: sticky; bottom: 0; background: var(--bg-2); }
  .vez { left: 8px; right: 8px; transform: none; width: auto; max-width: none; top: 56px; font-size: 13px; }
  .vez > span:nth-child(2) { flex: 1; }
  .gaveta { position: fixed; left: 0; top: auto; bottom: 59px; width: 100%; max-width: none; max-height: 70vh; border-right: 0; border-top: 1px solid var(--line); box-shadow: 0 -20px 40px rgba(0,0,0,.5); }
  .topo .cena-nome, .topo .usuario { display: none; }
}
