/* Velha de Ferro — Estética Aço Escovado & Vapor (Submundo / Steampunk sem dourado amarelado) */
:root {
  --bg: #0b1012;
  --steel-dk: #12191c;
  --steel: #1c262b;
  --steel-hi: #32434b;
  --panel: rgba(19, 26, 30, .92);
  --ink: #dde7eb;
  --mut: #8699a1;
  --line: rgba(130, 165, 180, .24);
  --chem: #5ec28f;      /* Verde Ácido */
  --chem-dk: #286144;
  --x: #e06d3b;         /* Peça X: Brasa de Forja */
  --o: #4bb3b8;         /* Peça O: Vapor / Verdete */
  --win: #5ec28f;
  --warn: #e0a63b;
  --danger: #d9534f;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
button, input { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* ---------- fundo Aço Escovado & Vapor ---------- */
#bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 105%, rgba(94, 194, 143, .13) 0%, transparent 60%),
    radial-gradient(ellipse at 18% 0%, rgba(75, 179, 184, .1) 0%, transparent 55%),
    linear-gradient(180deg, #090d0f 0%, #131b1f 52%, #0b1012 100%);
  transition: filter .5s;
}
body.in-game #bg { filter: brightness(.85); }
.haze {
  position: absolute; inset: -10%;
  background:
    repeating-linear-gradient(90deg, rgba(140, 175, 190, .025) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(0deg, rgba(140, 175, 190, .02) 0 1px, transparent 1px 48px);
}
.gear { position: absolute; color: rgba(140, 175, 190, .055); pointer-events: none; }
.gear.g1 { width: min(76vmin, 410px); height: min(76vmin, 410px); right: -16vmin; top: -12vmin; animation: spin 95s linear infinite; }
.gear.g2 { width: min(64vmin, 330px); height: min(64vmin, 330px); left: -18vmin; bottom: -14vmin; color: rgba(94, 194, 143, .05); animation: spinR 78s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spinR { to { transform: rotate(-360deg); } }
.vignette {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 45%, rgba(4, 7, 8, .85) 100%);
}
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 95; }

/* ---------- telas ---------- */
.screen {
  position: fixed; inset: 0; z-index: 2; display: none; flex-direction: column; align-items: center;
  padding: calc(var(--sat) + 10px) 14px calc(var(--sab) + 10px);
}
.screen.active { display: flex; animation: scr .32s ease; }
@keyframes scr { from { opacity: 0; transform: translateY(4px); } }

/* ---------- menu ---------- */
.menu-wrap {
  width: 100%; max-width: 440px; height: 100%; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding-bottom: 10px; scrollbar-width: none;
}
.menu-wrap::-webkit-scrollbar { display: none; }

.logo { position: relative; display: flex; flex-direction: column; align-items: center; margin-top: 1vh; line-height: .92; flex: none; }
.l1 {
  font-size: 12px; font-weight: 800; letter-spacing: .48em; margin-right: -.48em;
  color: var(--chem); text-transform: uppercase;
}
.l2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(46px, 15vw, 66px); font-weight: 900; letter-spacing: .06em; padding: 2px .08em;
  background: linear-gradient(180deg, #eef5f7 0%, #9cb0b8 58%, #52656e 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #090d0f) drop-shadow(0 6px 14px rgba(0, 0, 0, .75));
}
.l3 {
  font-family: Georgia, "Times New Roman", serif;
  position: absolute; right: -22px; bottom: -14px;
  font-size: clamp(40px, 13vw, 58px); font-weight: 900;
  color: var(--x); text-shadow: 0 2px 0 #1e0d06, 0 4px 10px rgba(0, 0, 0, .75);
  transform: rotate(-8deg);
}
.tag {
  margin: 8px 0 0; color: var(--mut); font-size: 11.5px; letter-spacing: .15em; text-transform: uppercase; flex: none;
}

.play-row { display: flex; gap: 8px; width: 100%; max-width: 340px; flex: none; margin-top: 2px; }
.btn-play {
  flex: 1; padding: 13px 0; cursor: pointer;
  border-radius: 10px; border: 2px solid var(--chem);
  font-size: 20px; font-weight: 900; letter-spacing: .2em; color: #e6fff2;
  background: linear-gradient(180deg, #32464f 0%, #202d33 60%, #151e22 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 4px 0 #0c1214, 0 0 16px rgba(94, 194, 143, .22);
  transition: transform .1s, box-shadow .1s, filter .15s;
}
.btn-play:hover { filter: brightness(1.08); }
.btn-play:active { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 #0c1214; }

.btn-deck {
  padding: 0 16px; border-radius: 10px; border: 1.5px solid var(--steel-hi); cursor: pointer;
  background: linear-gradient(180deg, #253238, #161f24);
  color: var(--ink); font-size: 13px; font-weight: 800; letter-spacing: .06em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 4px 0 #0c1214;
}
.btn-deck:active { transform: translateY(3px); box-shadow: 0 1px 0 #0c1214; }
.sub-info { font-size: 12px; color: var(--chem); font-weight: 600; text-align: center; flex: none; min-height: 16px; }

.section-t {
  align-self: flex-start; font-size: 11px; font-weight: 800; letter-spacing: .18em;
  color: var(--chem); text-transform: uppercase; margin: 2px 0 -4px 4px; flex: none;
}

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; width: 100%; flex: none; }
.mode {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 10px; cursor: pointer; text-align: left;
  border: 1.5px solid var(--line);
  background: linear-gradient(180deg, #1a2429, #12191c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 2px 6px rgba(0, 0, 0, .4);
  font-size: 13px; font-weight: 700; transition: border-color .15s, background .15s;
}
.mode.span2 { grid-column: span 2; }
.mode small { display: block; font-weight: 400; color: var(--mut); font-size: 11px; margin-top: 2px; }
.mi { width: 28px; height: 28px; flex: none; display: flex; color: var(--ink); }
.mi.x { color: var(--x); } .mi.o { color: var(--o); } .mi.q { color: var(--chem); }
.mi svg { width: 100%; height: 100%; }
.mode.on {
  border-color: var(--chem);
  background: linear-gradient(180deg, #1d2e29, #131f1c);
  box-shadow: inset 0 0 0 1px rgba(94, 194, 143, .3), 0 3px 10px rgba(0, 0, 0, .5);
}

.opts {
  width: 100%; flex: none; display: flex; flex-direction: column; gap: 8px; padding: 11px;
  border-radius: 10px; border: 1.5px solid var(--line);
  background: linear-gradient(180deg, #172024, #101619);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 4px 12px rgba(0, 0, 0, .45);
}
.opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.opt > span { color: var(--ink); font-weight: 600; }
.seg { display: flex; gap: 2px; padding: 3px; border-radius: 8px; background: #0a0e10; border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 5px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; color: var(--mut); cursor: pointer; }
.seg button.on {
  color: #ecfff5;
  background: linear-gradient(180deg, #43966b, #2b6647);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

/* Sliders de volume (aço + ácido) */
.vol-wrap { display: flex; align-items: center; gap: 8px; width: 54%; max-width: 190px; }
input.vol {
  -webkit-appearance: none; appearance: none; flex: 1; height: 8px; border-radius: 99px;
  background: linear-gradient(90deg, #2b6647 0%, var(--chem) var(--p, 60%), #090d0f var(--p, 60%));
  border: 1px solid var(--line); outline: none; cursor: pointer; margin: 0;
}
input.vol::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #eef5f7, #7c929c 65%, #32424a);
  border: 2px solid #0d1316; box-shadow: 0 2px 5px rgba(0, 0, 0, .65);
}
input.vol::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #eef5f7, #7c929c 65%, #32424a);
  border: 2px solid #0d1316; box-shadow: 0 2px 5px rgba(0, 0, 0, .65);
}
.vval { font-size: 12px; font-weight: 700; color: var(--chem); min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }

.link-btn {
  flex: none; padding: 8px 20px; border-radius: 8px; border: 1.5px solid var(--line);
  background: #141c20; color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: .1em; cursor: pointer;
}
.ver { margin: 0; font-size: 11px; color: var(--mut); opacity: .65; flex: none; }

/* ---------- tela de jogo ---------- */
#game { gap: 5px; }
.topbar { width: 100%; max-width: 480px; display: flex; align-items: center; gap: 8px; flex: none; }
.icon-btn {
  width: 40px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1.5px solid var(--line);
  background: linear-gradient(180deg, #212c32, #141b1f); color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 3px 6px rgba(0, 0, 0, .45);
  font-size: 17px; font-weight: 900; cursor: pointer;
}
.icon-btn svg { width: 19px; height: 19px; }

.scoreboard {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; padding: 4px;
  border-radius: 10px; border: 1.5px solid var(--line);
  background: linear-gradient(180deg, #182126, #101619);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, .6);
}
.pl { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 3px 7px; border-radius: 7px; border: 1px solid transparent; transition: background .25s, border-color .25s; }
.pl.O { flex-direction: row-reverse; text-align: right; }
.pl .pic { width: 19px; height: 19px; flex: none; display: flex; }
.pl .pic svg { width: 100%; height: 100%; }
.pl.X .pic { color: var(--x); } .pl.O .pic { color: var(--o); }
.pl-info { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.pl.O .pl-info { align-items: flex-end; }
.pl .nm { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl b { font-size: 20px; font-weight: 900; margin-left: auto; color: var(--ink); }
.pl.O b { margin-left: 0; margin-right: auto; }
.pl.X.active { background: rgba(224, 109, 59, .15); border-color: rgba(224, 109, 59, .55); }
.pl.O.active { background: rgba(75, 179, 184, .15); border-color: rgba(75, 179, 184, .55); }
.vs { font-size: 10px; font-weight: 900; color: var(--mut); padding: 0 2px; }

/* Medidor de Pressão de Vapor (💨) */
.vap { display: flex; align-items: center; gap: 2.5px; }
.vap .pip {
  width: 7px; height: 7px; border-radius: 50%;
  background: #0b1012; border: 1px solid rgba(140, 175, 190, .35);
}
.vap .pip.on {
  background: var(--chem); border-color: #a8f0c8;
  box-shadow: 0 0 4px rgba(94, 194, 143, .6);
}
.vap small { font-size: 10px; font-weight: 800; color: var(--chem); margin-left: 3px; }

.stage-banner {
  font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--chem); background: rgba(94, 194, 143, .1); border: 1px solid rgba(94, 194, 143, .3);
  padding: 2px 12px; border-radius: 99px; flex: none;
}

/* Barra do Relógio de Pressão (Blitz) */
.blitz-wrap {
  width: 100%; max-width: 360px; display: flex; align-items: center; gap: 8px; flex: none;
}
.blitz-bar {
  flex: 1; height: 7px; border-radius: 99px; background: #0a0e10;
  border: 1px solid var(--line); overflow: hidden;
}
.blitz-fill {
  height: 100%; width: 100%; background: linear-gradient(90deg, var(--o), var(--chem));
  transition: background .2s;
}
.blitz-fill.warn { background: linear-gradient(90deg, var(--danger), var(--warn)); }
.blitz-txt { font-size: 11.5px; font-weight: 800; color: var(--ink); min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }

.status {
  flex: none; min-height: 38px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; font-size: 15px; font-weight: 800; letter-spacing: .02em; transition: color .25s;
}
.status small { margin-top: 2px; font-size: 11.5px; font-weight: 600; color: var(--mut); }
.status[data-t="X"] { color: #f08556; }
.status[data-t="O"] { color: #6bd0d4; }
.status[data-t="W"] { color: var(--win); }

/* Barra rápida quando uma carta está selecionada */
.sel-bar {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 4px 12px; border-radius: 99px;
  background: rgba(94, 194, 143, .14); border: 1px solid var(--chem);
  font-size: 12px; font-weight: 800; color: var(--ink);
}
.sel-cancel {
  border: 0; border-radius: 99px; padding: 3px 10px; cursor: pointer;
  background: rgba(217, 83, 79, .22); border: 1px solid rgba(217, 83, 79, .6);
  color: #ffb8b5; font-size: 11px; font-weight: 800;
}

/* Modal de Inspeção / Zoom da Carta */
#cardModal { background: rgba(5, 8, 10, .92); z-index: 60; }
.card-zoom-panel {
  max-width: 340px; align-items: center; padding: 18px;
  background: #141c20; border: 2px solid var(--steel-hi);
}
.cz-card {
  --cc: var(--chem);
  width: 100%; border-radius: 16px; padding: 18px 16px;
  border: 2.5px solid var(--cc);
  background: #10171a;
  box-shadow: inset 0 0 28px color-mix(in srgb, var(--cc) 18%, transparent), 0 10px 28px rgba(0, 0, 0, .85);
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
}
.cz-top { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.cz-badge {
  padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 900;
  background: rgba(0, 0, 0, .45); border: 1px solid rgba(255, 255, 255, .15); color: var(--ink);
}
.cz-kind {
  font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--cc);
}
.cz-art {
  width: 88px; height: 88px; color: var(--cc); margin: 4px 0;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .7)) drop-shadow(0 0 12px color-mix(in srgb, var(--cc) 45%, transparent));
}
.cz-art svg { width: 100%; height: 100%; display: block; }
.cz-name {
  font-family: Georgia, serif; margin: 0; font-size: 24px; font-weight: 900;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink);
}
.cz-desc {
  margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink); font-weight: 500;
}
.cz-hint {
  width: 100%; padding: 8px 10px; border-radius: 9px; font-size: 12.5px; font-weight: 700;
  background: rgba(0, 0, 0, .38); border: 1px solid var(--line); color: var(--mut);
}
.cz-hint.ok { color: var(--chem); border-color: rgba(94, 194, 143, .4); background: rgba(94, 194, 143, .1); }
.cz-hint.warn { color: #f2a97e; border-color: rgba(224, 109, 59, .45); background: rgba(224, 109, 59, .1); }
#czConfirm:disabled { opacity: .42; cursor: default; filter: grayscale(.8); }

.board-wrap { position: relative; flex: 1; min-height: 0; width: 100%; max-width: 460px; display: flex; align-items: center; justify-content: center; container-type: size; }

/* Banner/Showcase quando o adversário usa uma carta */
.card-cast-toast {
  --cc: var(--chem);
  position: absolute; top: 6%; left: 50%; transform: translateX(-50%);
  z-index: 38; width: min(92%, 340px);
  padding: 10px 14px; border-radius: 14px;
  border: 2.5px solid var(--cc);
  background: radial-gradient(circle at 20% 50%, color-mix(in srgb, var(--cc) 28%, #141e23) 0%, rgba(12, 18, 21, .96) 80%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .9), 0 0 22px color-mix(in srgb, var(--cc) 55%, transparent);
  display: flex; align-items: center; gap: 12px;
  pointer-events: none;
  animation: cctPop .32s cubic-bezier(.2, 1.4, .35, 1);
}
@keyframes cctPop {
  from { opacity: 0; transform: translate(-50%, -18px) scale(.82); }
  to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
.cct-art {
  width: 46px; height: 46px; flex: none; color: var(--cc);
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--cc) 65%, transparent));
  animation: charCast .6s ease;
}
.cct-art svg { width: 100%; height: 100%; display: block; }
.cct-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: left; }
.cct-who {
  font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase;
  color: #f5b971;
}
.cct-name {
  font-size: 15px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink);
}
.cct-desc {
  font-size: 11.5px; font-weight: 700; color: var(--chem); line-height: 1.25;
}

.cell.ai-fx {
  border-color: var(--fx-col, #f0b44c) !important;
  box-shadow: 0 0 22px var(--fx-col, #f0b44c), inset 0 0 16px var(--fx-col, #f0b44c) !important;
  animation: aiFxPulse .38s ease-in-out infinite alternate;
  z-index: 5;
}
@keyframes aiFxPulse {
  from { transform: scale(.97); }
  to   { transform: scale(1.05); }
}
#board {
  position: relative;
  width: min(86vw, 40vh); width: min(100cqw, 100cqh); aspect-ratio: 1;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 3.2%; padding: 3.8%;
  border-radius: 16px;
  border: 3px solid var(--steel-hi);
  background: radial-gradient(circle at 50% 50%, #1d272c 0%, #11171a 100%);
  box-shadow: inset 0 0 0 2px #0b1012, inset 0 4px 16px rgba(0, 0, 0, .75), 0 10px 28px rgba(0, 0, 0, .75);
  transition: border-color .3s, filter .3s;
}
#board[data-turn="X"] { border-color: #9e5230; }
#board[data-turn="O"] { border-color: #387f82; }
#board.foggy { box-shadow: inset 0 0 28px rgba(127, 166, 153, .35), 0 10px 28px rgba(0, 0, 0, .75); }
#board.shake { animation: shk .45s; }
#board.gear-spin { animation: gspin .55s ease; }
@keyframes shk { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
@keyframes gspin { 50% { transform: rotate(6deg) scale(.97); } }

.cell {
  position: relative; padding: 0; cursor: pointer; border-radius: 10%;
  border: 1.5px solid var(--line);
  background: radial-gradient(circle at 50% 35%, #222e33 0%, #151c20 75%);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .65), 0 1px 0 rgba(255, 255, 255, .05);
  transition: background .15s, border-color .15s, transform .08s;
}
.cell.X { color: var(--x); border-color: rgba(224, 109, 59, .45); }
.cell.O { color: var(--o); border-color: rgba(75, 179, 184, .45); }
.cell:disabled { cursor: default; }
@media (hover: hover) {
  .cell:not(:disabled):hover {
    border-color: var(--chem);
    background: radial-gradient(circle at 50% 35%, #28373d 0%, #182126 75%);
  }
}
.cell:not(:disabled):active { transform: scale(.95); }
.coord {
  position: absolute; left: 7%; top: 6%;
  font: 800 10px/1 ui-monospace, Consolas, monospace;
  color: rgba(160, 184, 194, .36);
  letter-spacing: .04em; pointer-events: none;
}

.pc { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.pc svg {
  width: 66%; height: 66%;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .7)) drop-shadow(0 0 6px color-mix(in srgb, currentColor 35%, transparent));
  animation: pop .32s cubic-bezier(.3, 1.6, .5, 1);
}
.pc.flip svg { animation: flip .55s ease; }
@keyframes pop { from { transform: scale(0) rotate(-90deg); opacity: 0; } }
@keyframes flip { from { transform: rotateY(180deg) scale(.4); } }

.cell.old { border-style: dashed; border-width: 2px; border-color: currentColor; }
.cell.old .pc svg { animation: pulse .95s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .32; transform: scale(.86); } }

/* Trava, Mina e Casa Superaquecida */
.cell.locked {
  border-color: var(--chem);
  background: repeating-linear-gradient(-45deg, #192621 0 8px, #111815 8px 16px);
}
.lkb, .mnb, .htb, .kpb {
  display: none; position: absolute; right: 6%; top: 6%; width: 24%; height: 24%;
  pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .8));
}
.lkb { color: var(--chem); }
.mnb { color: var(--danger); left: 6%; right: auto; }
.htb { color: var(--x); left: 6%; bottom: 6%; top: auto; right: auto; }
.kpb { color: var(--chem); right: 6%; bottom: 6%; top: auto; }
.lkb svg, .mnb svg, .htb svg, .kpb svg { width: 100%; height: 100%; }
.cell.locked .lkb { display: block; }
.cell.kept .kpb { display: block; }
.cell.kept { border-color: var(--chem); }
.cell.locked.empty .lkb {
  right: auto; top: 50%; left: 50%; width: 44%; height: 44%;
  transform: translate(-50%, -50%); animation: lkin .35s cubic-bezier(.3, 1.6, .5, 1);
}
.cell.mined .mnb { display: block; }
.cell.heat {
  border-color: rgba(224, 109, 59, .85);
  background: radial-gradient(circle at 50% 50%, rgba(224, 109, 59, .28), #1b1310 80%);
  box-shadow: inset 0 0 14px rgba(224, 109, 59, .35), 0 0 8px rgba(224, 109, 59, .25);
}
.cell.heat .htb { display: block; }
.cell.heat.empty .htb {
  left: 50%; bottom: auto; top: 50%; width: 46%; height: 46%;
  transform: translate(-50%, -50%);
  animation: heatPulse .9s ease-in-out infinite alternate;
}
@keyframes heatPulse {
  from { transform: translate(-50%, -50%) scale(.92); opacity: .75; }
  to   { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}
@keyframes lkin { from { transform: translate(-50%, -50%) scale(0); } }

/* Engrenagem Central e Setas de Rotação (Chefe 2) */
.grb { display: none; position: absolute; pointer-events: none; }
.grb svg { width: 100%; height: 100%; display: block; }
#board.gear-mode .grb.center {
  display: block; left: 50%; top: 50%; width: 62%; height: 62%;
  color: #6b8590; opacity: .28;
  animation: gearSpinIdle 14s linear infinite;
}
#board.gear-mode .grb.arrow {
  display: block; left: 6%; bottom: 6%; width: 22%; height: 22%;
  color: #8aa3ad; opacity: .48;
  transform: rotate(var(--rot, 0deg));
  transition: color .25s, opacity .25s, transform .25s;
}
#board.gear-mode.gear-soon .grb.center {
  color: var(--chem); opacity: .55;
  animation: gearSpinIdle 3.2s linear infinite;
  filter: drop-shadow(0 0 6px rgba(94, 194, 143, .6));
}
#board.gear-mode.gear-soon .grb.arrow {
  color: var(--chem); opacity: .95;
  animation: arrowWarn .55s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 5px rgba(94, 194, 143, .75));
}
@keyframes gearSpinIdle {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes arrowWarn {
  from { transform: rotate(var(--rot, 0deg)) scale(.9); }
  to   { transform: rotate(var(--rot, 0deg)) scale(1.18); }
}

.cell.target { border: 2px solid var(--chem); animation: tgt .85s ease-in-out infinite alternate; }
@keyframes tgt {
  from { box-shadow: inset 0 0 12px rgba(94, 194, 143, .35), 0 0 8px rgba(94, 194, 143, .4); }
  to   { box-shadow: inset 0 0 4px rgba(94, 194, 143, .15), 0 0 2px rgba(94, 194, 143, .15); }
}
.cell.w {
  border: 2.5px solid var(--win);
  background: radial-gradient(circle at 50% 50%, rgba(94, 194, 143, .26), #14221b 80%);
}
.cell.w .pc svg { animation: wn .55s ease-in-out infinite alternate; }
@keyframes wn { to { transform: scale(1.13); } }

.ghost { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; animation: gone .55s forwards; }
.ghost.X { color: var(--x); } .ghost.O { color: var(--o); }
.ghost svg { width: 66%; height: 66%; }
@keyframes gone { to { transform: scale(1.6) rotate(45deg); opacity: 0; } }

/* ---------- Zona de Duelo (Personagens Topo vs Base + Cartas) ---------- */
.duel-zone {
  flex: none; width: 100%; max-width: 480px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  position: relative;
}
.duel-zone.top { min-height: 58px; }
.duel-zone.bot { min-height: 76px; }

.char-box {
  position: relative; flex: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 0; border: 0; background: none; color: var(--ink);
  transition: transform .2s, filter .2s;
}
.char-box.hero { cursor: pointer; }
.char-box.hero:active { transform: scale(.94); }

.char-frame {
  width: 54px; height: 54px; border-radius: 13px;
  border: 2px solid var(--steel-hi);
  background: radial-gradient(circle at 50% 35%, #233138 0%, #10171a 80%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 4px 10px rgba(0, 0, 0, .7);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
  animation: charBreath 3.2s ease-in-out infinite alternate;
}
.duel-zone.bot .char-frame { width: 60px; height: 60px; border-color: var(--x); }
.duel-zone.top .char-frame { width: 52px; height: 52px; border-color: var(--o); }
.char-box.boss .char-frame {
  border-color: #f0b44c;
  box-shadow: 0 0 12px rgba(240, 180, 76, .45), inset 0 0 10px rgba(224, 109, 59, .35);
}
.char-box.turn .char-frame {
  box-shadow: 0 0 14px color-mix(in srgb, var(--cc, var(--chem)) 65%, transparent), 0 4px 10px rgba(0, 0, 0, .75);
  transform: translateY(-2px);
}
.char-frame svg { width: 92%; height: 92%; display: block; }

@keyframes charBreath {
  from { transform: translateY(0) scale(1); }
  to   { transform: translateY(-2px) scale(1.025); }
}
.char-box.hit { animation: charHit .42s ease; }
@keyframes charHit {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px) rotate(-4deg); filter: brightness(1.5) sepia(.6) hue-rotate(-30deg); }
  40%, 80% { transform: translateX(6px) rotate(4deg); }
}
.char-box.cast .char-frame {
  animation: charCast .5s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes charCast {
  40% { transform: scale(1.16); filter: brightness(1.35); }
}

.char-tag {
  max-width: 72px; padding: 1px 6px; border-radius: 99px;
  background: #10171a; border: 1px solid var(--line);
  font-size: 9.5px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.char-box.boss .char-tag { border-color: #f0b44c; color: #f7cf86; }

/* Balão de fala dos personagens (provocações / reações) */
.char-bub {
  position: absolute; left: calc(100% + 8px); z-index: 30;
  min-width: 120px; max-width: 210px; padding: 6px 10px; border-radius: 10px;
  background: #141f24; border: 1.5px solid var(--chem);
  color: var(--ink); font-size: 11px; font-weight: 800; line-height: 1.25; text-align: left;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .85);
  pointer-events: none;
  animation: bubPop .22s cubic-bezier(.2, 1.4, .4, 1);
}
.duel-zone.top .char-bub { top: 4px; border-color: var(--o); }
.duel-zone.bot .char-bub { bottom: 14px; border-color: var(--x); }
.char-bub::before {
  content: ""; position: absolute; left: -6px; top: 14px;
  width: 9px; height: 9px; background: #141f24;
  border-left: 1.5px solid inherit; border-bottom: 1.5px solid inherit;
  transform: rotate(45deg);
}
@keyframes bubPop {
  from { opacity: 0; transform: translateX(-8px) scale(.85); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* Avatar do Inimigo no Cartão de Fase do Mapa */
.msc-avatar {
  width: 52px; height: 52px; flex: none; border-radius: 12px;
  border: 2px solid var(--steel-hi);
  background: radial-gradient(circle at 50% 35%, #233138 0%, #10171a 80%);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .6);
}
.msc-avatar.boss { border-color: #e06d3b; box-shadow: 0 0 10px rgba(224, 109, 59, .45); }
.msc-avatar svg { width: 92%; height: 92%; display: block; }

/* ---------- cartas na partida ---------- */
.hand {
  flex: 1; min-width: 0;
  display: flex; justify-content: center; align-items: flex-end; gap: 8px;
  --cw: min(19.5vw, 78px); padding-top: 6px; min-height: 64px;
}
.hand.top { --cw: min(13.5vw, 54px); gap: 7px; padding-top: 2px; min-height: 46px; align-items: flex-start; }
.hand.top .cdesc { display: none; }
.no-cards {
  font-size: 12px; color: var(--mut); background: rgba(18, 25, 28, .8);
  border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; text-align: center;
}

.card {
  --cc: var(--chem);
  position: relative; width: var(--cw); aspect-ratio: 5 / 7; padding: 0; border: 0; background: none;
  perspective: 700px; cursor: default;
  transition: transform .2s cubic-bezier(.3, 1.4, .5, 1), filter .25s;
}
.ci { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.4, 1.4, .5, 1); }
.face {
  position: absolute; inset: 0; overflow: hidden;
  border-radius: calc(var(--cw) * .09);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.front {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3%; padding: 16% 6% 10%;
  color: var(--cc);
  border: 2px solid var(--cc);
  background: radial-gradient(circle at 50% 32%, color-mix(in srgb, var(--cc) 20%, #182126) 0%, #11171a 75%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 4px 10px rgba(0, 0, 0, .65);
}
.cn { position: absolute; font-size: calc(var(--cw) * .115); font-weight: 900; color: var(--ink); line-height: 1; }
.tl { left: 7%; top: 6%; }
.tr { right: 7%; top: 6%; color: #c7d6dd; opacity: .9; }
.art { width: 44%; aspect-ratio: 1; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .7)); }
.art svg { width: 100%; height: 100%; display: block; }
.cname { font-size: calc(var(--cw) * .115); font-weight: 900; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); text-align: center; }
.cdesc { display: none; }

/* Cortina de Contagem Regressiva (Cooldown) sobre a carta */
.cd-veil {
  display: none; position: absolute; inset: 0; z-index: 4;
  background: rgba(8, 12, 15, .74);
  backdrop-filter: grayscale(.85) blur(1px);
  flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.card.used .cd-veil { display: flex; }
.cd-fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: 100%;
  background: linear-gradient(180deg, rgba(224, 109, 59, .28) 0%, rgba(12, 18, 22, .65) 100%);
  border-top: 1.5px solid rgba(240, 180, 76, .65);
  transition: height .35s ease;
  pointer-events: none;
}
.bk-cd {
  position: relative; z-index: 2;
  padding: 2px 7px; border-radius: 99px;
  background: rgba(12, 18, 22, .92); border: 1.5px solid #f0b44c;
  font-size: calc(var(--cw) * .165); font-weight: 900; color: #ffe09e;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .85);
}
.bk-act {
  display: none; position: relative; z-index: 2;
  font-size: calc(var(--cw) * .095); font-weight: 900; letter-spacing: .08em; color: var(--chem);
  text-shadow: 0 1px 4px #000;
}
.card.pend .front { border-color: var(--chem); box-shadow: 0 0 12px rgba(94, 194, 143, .45); }
.card.pend .bk-act { display: block; }
.hand.idle .card:not(.used) { filter: brightness(.72) saturate(.75); }
.card.na { filter: grayscale(.75) brightness(.55); }
.card.playable { cursor: pointer; }
@media (hover: hover) { .card.playable:hover { transform: translateY(-7px); } }
.card.sel { transform: translateY(-15px) scale(1.05); z-index: 2; }
.card.sel .front { box-shadow: 0 8px 18px rgba(0, 0, 0, .8), 0 0 12px color-mix(in srgb, var(--cc) 55%, transparent); }
.card.played { animation: played .85s ease; z-index: 3; }
@keyframes played { 35% { transform: translateY(var(--pd, -34px)) scale(1.22); } }
.hand.top .card.played { --pd: 34px; }
.card.deal { animation: dealB .48s cubic-bezier(.2, 1.2, .4, 1) backwards; animation-delay: var(--d); }
.hand.top .card.deal { animation-name: dealT; }
@keyframes dealB { from { transform: translateY(45vh) rotate(15deg) scale(.5); opacity: 0; } }
@keyframes dealT { from { transform: translateY(-30vh) rotate(-15deg) scale(.5); opacity: 0; } }

/* ---------- Histórico de Lances (Estilo Xadrez) ---------- */
.series {
  flex: none; width: 100%; max-width: 480px; padding: 6px 10px;
  border-radius: 10px; background: var(--panel); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
}
.log-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10.5px; font-weight: 800; color: var(--chem); letter-spacing: .08em;
}
#gc { font-size: 10.5px; font-weight: 800; color: var(--mut); }
.chess-log {
  max-height: 54px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 3px;
  font: 11.5px/1.35 ui-monospace, Consolas, monospace; color: var(--ink);
}
.res-log-box {
  background: #10171a; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; display: flex; flex-direction: column; gap: 5px;
}
.res-log { max-height: 140px; }
.log-row {
  display: flex; align-items: baseline; gap: 6px; padding: 2px 4px;
  border-radius: 4px; background: rgba(255, 255, 255, .025);
}
.log-row.win-row {
  background: rgba(94, 194, 143, .14); border: 1px solid rgba(94, 194, 143, .35);
}
.log-row.ev-row {
  background: rgba(224, 109, 59, .1); color: #f2bfa0;
}
.lg-num { color: var(--mut); font-weight: 700; min-width: 24px; }
.lg-p {
  font-weight: 900; padding: 0 5px; border-radius: 4px; font-size: 10.5px;
}
.lg-p.X { color: var(--x); background: rgba(224, 109, 59, .16); }
.lg-p.O { color: var(--o); background: rgba(75, 179, 184, .16); }
.lg-p.EV { color: var(--chem); background: rgba(94, 194, 143, .15); }
.lg-txt { flex: 1; color: var(--ink); }
.lg-txt b { color: var(--chem); }
.lg-txt em { font-style: normal; color: var(--mut); }
.res-reason {
  padding: 8px 10px; border-radius: 9px; text-align: center;
  font-size: 12.5px; font-weight: 700; line-height: 1.35;
  background: rgba(94, 194, 143, .1); border: 1px solid rgba(94, 194, 143, .35); color: var(--ink);
}
.res-bar { border-color: var(--chem); background: rgba(20, 34, 28, .95); gap: 8px; }
.rep-nav { display: flex; align-items: center; gap: 8px; flex: 1; }
.rep-btn {
  width: 34px; height: 28px; border-radius: 7px; border: 1.5px solid var(--chem);
  background: #14241c; color: var(--chem); font-size: 13px; font-weight: 900;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform .1s, opacity .15s, background .15s;
}
.rep-btn:hover:not(:disabled) { background: rgba(94, 194, 143, .24); }
.rep-btn:active:not(:disabled) { transform: scale(.93); }
.rep-btn:disabled { opacity: .3; cursor: default; border-color: var(--line); color: var(--mut); }
.rep-txt {
  font-size: 12px; font-weight: 800; color: var(--ink); letter-spacing: .04em;
  min-width: 110px; text-align: center;
}
.log-row.rep-active {
  background: rgba(94, 194, 143, .22);
  outline: 1.5px solid var(--chem);
}
.cell.rep-last {
  box-shadow: inset 0 0 0 2px var(--chem), 0 0 12px rgba(94, 194, 143, .45);
}

/* ---------- modais / Submundo / Oficina de Deck ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center; padding: 14px;
  background: rgba(5, 8, 9, .82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade .2s;
}
@keyframes fade { from { opacity: 0; } }
.panel {
  width: 100%; max-width: 400px; max-height: 90vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px; padding: 18px;
  border-radius: 14px; border: 2px solid var(--steel-hi);
  background: linear-gradient(180deg, #1b252a, #101619);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 14px 36px rgba(0, 0, 0, .85);
  animation: pin .28s cubic-bezier(.3, 1.4, .5, 1);
}
.panel.wide { max-width: 450px; }
@keyframes pin { from { transform: scale(.9); opacity: 0; } }
.panel h2 {
  font-family: Georgia, serif;
  margin: 0; text-align: center; font-size: 20px; font-weight: 900; letter-spacing: .12em;
  color: var(--chem);
}

/* Mapa do Submundo (estilo Super Mario World / Donkey Kong) */
.map-panel {
  max-width: 440px; padding: 14px; gap: 10px;
}
.map-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.map-top h2 { font-size: 17px; letter-spacing: .1em; flex: 1; }
.btn-deck-sm {
  padding: 8px 12px; border-radius: 9px; border: 1.5px solid var(--chem);
  background: rgba(94, 194, 143, .14); color: var(--ink);
  font-size: 12px; font-weight: 800; cursor: pointer;
}
.btn-deck-sm b { color: var(--chem); margin-left: 2px; }

.world-map {
  position: relative; width: 100%; aspect-ratio: 360 / 410; max-height: 54vh;
  border-radius: 14px; border: 2px solid var(--steel-hi); overflow: hidden;
  background: #0d1518;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, .85), 0 6px 18px rgba(0, 0, 0, .6);
}
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mpath-bg { fill: none; stroke: #080d0f; stroke-width: 10; stroke-linecap: round; }
.mpath-lock { fill: none; stroke: #2c3d45; stroke-width: 4.5; stroke-dasharray: 7 7; stroke-linecap: round; }
.mpath-open { fill: none; stroke: var(--chem); stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 0 5px rgba(94, 194, 143, .5)); }

.map-nodes { position: absolute; inset: 0; }
.mnode {
  position: absolute; transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 3px solid var(--steel-hi);
  background: radial-gradient(circle at 35% 30%, #2a3940, #141c20);
  box-shadow: 0 5px 0 #090e10, 0 8px 14px rgba(0, 0, 0, .75);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: transform .18s, border-color .2s, box-shadow .2s;
  z-index: 2;
}
.mnode.boss {
  width: 58px; height: 58px; border-radius: 16px;
  border-color: var(--x);
  background: radial-gradient(circle at 35% 30%, #3d2219, #1c100c);
  box-shadow: 0 5px 0 #120805, 0 0 16px rgba(224, 109, 59, .35);
}
.mnode.unlocked {
  border-color: #7fa6b5;
}
.mnode.done {
  border-color: var(--chem);
  background: radial-gradient(circle at 35% 30%, #244736, #11241b);
}
.mnode.boss.done {
  border-color: var(--chem);
  background: radial-gradient(circle at 35% 30%, #2c4a34, #16241a);
}
.mnode.sel {
  transform: translate(-50%, -54%) scale(1.12);
  border-color: #fff;
  box-shadow: 0 6px 0 #090e10, 0 0 18px var(--chem), 0 0 0 3px rgba(94, 194, 143, .35);
  z-index: 3;
}
.mnode.boss.sel {
  box-shadow: 0 6px 0 #120805, 0 0 22px var(--x), 0 0 0 3px rgba(224, 109, 59, .45);
}
.mnode:disabled {
  opacity: .5; filter: grayscale(.7); cursor: default;
}
.mn-num { font-size: 13px; font-weight: 900; color: var(--ink); line-height: 1; }
.mnode.boss .mn-num { font-size: 16px; color: #ff9d73; }
.mn-star {
  position: absolute; right: -4px; bottom: -4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--chem); color: #091710; font-size: 11px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #0d1518;
}
.mn-lbl {
  position: absolute; top: calc(100% + 5px); white-space: nowrap;
  padding: 2px 6px; border-radius: 6px;
  background: rgba(9, 14, 16, .88); border: 1px solid rgba(140, 175, 190, .25);
  font-size: 10px; font-weight: 800; color: var(--ink); pointer-events: none;
}
.mnode.boss .mn-lbl { color: #ffab85; border-color: rgba(224, 109, 59, .45); }

/* Peão / Avatar do jogador saltando sobre a fase selecionada */
.map-pawn {
  position: absolute; width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff9366, var(--x));
  border: 2px solid #fff; color: #1a0904;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .85), 0 0 12px var(--x);
  display: flex; align-items: center; justify-content: center;
  transform: translate(-50%, -145%);
  transition: left .42s cubic-bezier(.3, 1.3, .4, 1), top .42s cubic-bezier(.3, 1.3, .4, 1);
  pointer-events: none; z-index: 5;
  animation: pawnBounce 1.1s ease-in-out infinite alternate;
}
.map-pawn svg { width: 18px; height: 18px; }
@keyframes pawnBounce {
  from { margin-top: 0; }
  to   { margin-top: -7px; }
}

/* Rodapé da fase selecionada no Mapa */
.map-stage-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  background: #11181c; border: 1.5px solid var(--line);
}
.msc-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.msc-title { font-size: 14px; font-weight: 900; color: var(--chem); }
.msc-desc { font-size: 11.5px; color: var(--ink); line-height: 1.25; }
.msc-rw { font-size: 11px; color: var(--mut); margin-top: 2px; }
.msc-rw b { color: var(--warn); }
.msc-play { padding: 12px 16px; white-space: nowrap; flex: none; }
.sub-desc {
  font-size: 12px; color: var(--ink); background: rgba(94, 194, 143, .08);
  border: 1px solid rgba(94, 194, 143, .28); border-radius: 8px; padding: 8px 10px; margin: 0;
}

/* Grid da Oficina de Deck (8 cartas) */
.dk-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 800; letter-spacing: .1em; color: var(--mut); }
.dk-head b { color: var(--chem); font-size: 13px; }
.dk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dk-card {
  --cc: var(--chem);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 5px; border-radius: 9px; border: 1.5px solid var(--line);
  background: #141c20; cursor: pointer; text-align: center; transition: transform .12s, border-color .15s;
}
.dk-card.on {
  border-color: var(--cc);
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--cc) 22%, #162024), #12181b);
  box-shadow: inset 0 0 0 1px var(--cc);
}
.dk-card.locked { opacity: .45; cursor: default; background: #0e1316; }
.dk-top { width: 100%; display: flex; justify-content: space-between; font-size: 10px; font-weight: 800; color: var(--ink); }
.dk-cd { color: var(--mut); }
.dk-art { width: 28px; height: 28px; color: var(--cc); }
.dk-art svg { width: 100%; height: 100%; }
.dk-lock { font-size: 20px; margin: 4px 0; }
.dk-nm { font-size: 10.5px; font-weight: 800; color: var(--ink); }
.dk-ds { font-size: 9.5px; line-height: 1.15; color: var(--mut); }

.dev-row { display: flex; gap: 6px; justify-content: space-between; }
.btn-mini {
  flex: 1; padding: 6px 8px; border-radius: 7px; border: 1px solid var(--line);
  background: #12181c; color: var(--mut); font-size: 11px; font-weight: 700; cursor: pointer;
}
.btn-mini:hover { color: var(--ink); border-color: var(--steel-hi); }
.modal-actions { display: flex; gap: 8px; }
.modal-actions .btn { flex: 1; }

.btn {
  padding: 12px; border-radius: 10px; border: 1.5px solid var(--line);
  background: #182126; color: var(--ink);
  font-size: 13.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
  transition: transform .1s, filter .15s;
}
.btn:active { transform: scale(.98); }
.btn.pri {
  border-color: var(--chem); color: #eafff3;
  background: linear-gradient(180deg, #3b855f 0%, #26593f 100%);
  box-shadow: 0 3px 0 #133022;
}

.res-t {
  font-family: Georgia, serif;
  font-size: clamp(38px, 12vw, 54px); font-weight: 900; text-align: center; line-height: 1.05;
  letter-spacing: .04em; animation: rt .45s cubic-bezier(.3, 1.6, .5, 1);
}
.res-t.win { color: var(--chem); text-shadow: 0 3px 0 #0e2419; }
.res-t.lose { color: var(--mut); }
@keyframes rt { from { transform: scale(1.7); opacity: 0; } }
.res-s { text-align: center; color: var(--mut); font-size: 14px; }
.res-score { display: flex; align-items: center; justify-content: center; gap: 18px; font-size: 34px; font-weight: 900; margin: 2px 0; }
.res-score small { font-size: 18px; color: var(--mut); }
.res-score .x { color: var(--x); } .res-score .o { color: var(--o); }

.res-reward {
  background: #121a1d; border: 1.5px solid var(--chem); border-radius: 10px; padding: 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.rw-tag { font-size: 11px; font-weight: 900; color: var(--chem); letter-spacing: .12em; text-align: center; }
.rw-card { display: flex; align-items: center; gap: 10px; }
.rw-ic { width: 36px; height: 36px; flex: none; color: var(--cc); }
.rw-ic svg { width: 100%; height: 100%; }
.rw-card b { display: block; font-size: 13px; color: var(--ink); }
.rw-card small { font-size: 11.5px; color: var(--mut); }

.rules ul { margin: 0; padding-left: 18px; }
.rules li, .rules p { font-size: 13px; line-height: 1.45; color: var(--ink); margin: 0 0 5px; }
.rules b { color: var(--chem); }
.rules-sub { color: var(--chem) !important; font-weight: 800; margin-top: 4px !important; }
.rules-cards { display: flex; flex-direction: column; gap: 6px; }
.rule-card {
  display: flex; gap: 10px; align-items: center; padding: 8px 10px;
  border-radius: 9px; border: 1px solid var(--cc);
  background: color-mix(in srgb, var(--cc) 8%, #12181b);
}
.rule-card .mini { width: 30px; height: 30px; flex: none; color: var(--cc); }
.rule-card .mini svg { width: 100%; height: 100%; }
.rule-card p { margin: 0 !important; font-size: 12px; }

/* ---------- Carteira de Sucata, Loja, Impulsos e Temas ---------- */
.wallet-bar {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.scrap-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 99px;
  background: #141d21; border: 1.5px solid var(--steel-hi);
  font-size: 13px; color: var(--ink);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, .6);
}
.scrap-pill.sm { padding: 4px 9px; font-size: 12px; }
.scrap-pill b { color: var(--chem); font-weight: 900; }
.scrap-pill small { color: var(--mut); font-size: 11px; }
.vip-pill {
  padding: 5px 10px; border-radius: 99px;
  background: linear-gradient(135deg, rgba(224, 109, 59, .22), rgba(94, 194, 143, .22));
  border: 1px solid var(--chem); color: #eafff3;
  font-size: 10px; font-weight: 900; letter-spacing: .08em;
}
.btn-shop {
  padding: 7px 12px; border-radius: 99px; cursor: pointer;
  border: 1.5px solid var(--chem);
  background: linear-gradient(180deg, #2b5e44, #1b3d2b);
  color: #eafff3; font-size: 11.5px; font-weight: 900; letter-spacing: .06em;
  box-shadow: 0 2px 0 #0e2419; transition: transform .1s, filter .15s;
}
.btn-shop:hover { filter: brightness(1.08); }
.btn-shop:active { transform: scale(.96); }

/* Abas de Mundo e Impulsos Pré-Partida no Mapa */
.map-tabs {
  display: flex; gap: 6px; width: 100%;
}
.map-tab {
  flex: 1; padding: 7px 8px; border-radius: 8px; cursor: pointer;
  border: 1.5px solid var(--line); background: #12191d; color: var(--mut);
  font-size: 11.5px; font-weight: 800; transition: .15s;
}
.map-tab.on {
  border-color: var(--chem); color: var(--ink);
  background: rgba(94, 194, 143, .16);
}
.boost-row {
  display: flex; gap: 8px; width: 100%;
}
.boost-btn {
  flex: 1; padding: 7px 9px; border-radius: 9px; cursor: pointer;
  border: 1.5px solid var(--line); background: #131c20; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-size: 11.5px; font-weight: 800; transition: .15s;
}
.boost-btn small {
  padding: 2px 6px; border-radius: 6px; background: rgba(255, 255, 255, .06);
  color: var(--chem); font-size: 10px; font-weight: 800;
}
.boost-btn.on {
  border-color: var(--chem);
  background: radial-gradient(circle at 50% 50%, rgba(94, 194, 143, .22), #13211b);
  box-shadow: 0 0 10px rgba(94, 194, 143, .28);
}
.boost-btn.on small { background: var(--chem); color: #09150f; }

/* Loja da Oficina */
.shop-panel { max-width: 460px; gap: 9px; }
.vip-card {
  padding: 12px; border-radius: 12px;
  border: 2px solid #d48a46;
  background: linear-gradient(135deg, #281b14 0%, #16241f 100%);
  box-shadow: inset 0 0 18px rgba(224, 109, 59, .2), 0 6px 16px rgba(0, 0, 0, .6);
  display: flex; flex-direction: column; gap: 8px;
}
.vip-card.owned { border-color: var(--chem); background: linear-gradient(135deg, #152920 0%, #10191c 100%); }
.vip-title { font-size: 13.5px; font-weight: 900; color: #f5b971; letter-spacing: .08em; }
.vip-card.owned .vip-title { color: var(--chem); }
.vip-info p { margin: 4px 0 0; font-size: 11.5px; line-height: 1.35; color: var(--ink); }
.vip-buy { padding: 9px 12px; font-size: 12.5px; }

.w3-shop-box {
  padding: 9px 11px; border-radius: 10px;
  border: 1.5px solid #4bb3b8; background: rgba(75, 179, 184, .1);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.w3-shop-box b { display: block; font-size: 12px; color: #7ce2e8; }
.w3-shop-box small { font-size: 10.5px; color: var(--mut); }

.shop-sec {
  font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase;
  color: var(--mut); margin-top: 2px;
}
.shop-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px;
}
.shop-item {
  padding: 9px; border-radius: 10px; border: 1.5px solid var(--line);
  background: #131b1f; color: var(--ink); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center;
  transition: transform .12s, border-color .15s;
}
.shop-item.eq {
  border-color: var(--chem);
  background: radial-gradient(circle at 50% 30%, rgba(94, 194, 143, .2), #121a1d);
  box-shadow: inset 0 0 0 1px var(--chem);
}
.shop-prev {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 30px;
}
.shop-prev svg { width: 26px; height: 26px; }
.shop-nm { font-size: 11.5px; font-weight: 800; color: var(--ink); }
.shop-ds { font-size: 10px; color: var(--mut); line-height: 1.2; }
.shop-tag {
  margin-top: 2px; padding: 3px 8px; border-radius: 99px;
  font-size: 10px; font-weight: 900; background: rgba(255, 255, 255, .06); color: var(--chem);
}
.shop-item.eq .shop-tag { background: var(--chem); color: #09150f; }

/* Resultado: Sucata e Rebobinar Derrota */
.res-scrap-box {
  padding: 8px 12px; border-radius: 10px;
  background: rgba(94, 194, 143, .1); border: 1px solid rgba(94, 194, 143, .35);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12.5px;
}
.res-scrap-box b { color: var(--chem); }
.btn-double {
  padding: 6px 10px; border-radius: 8px; cursor: pointer;
  border: 1.5px solid var(--chem); background: #193829; color: #eafff3;
  font-size: 11.5px; font-weight: 800;
}
.btn-double:disabled { opacity: .45; cursor: default; }
.btn-rewind {
  border-color: #e06d3b; color: #ffdecb;
  background: linear-gradient(180deg, #6e351d 0%, #472010 100%);
  box-shadow: 0 3px 0 #261007;
}

/* Simulador de Anúncio */
.ad-panel { text-align: center; align-items: center; max-width: 360px; }
.ad-tag {
  font-size: 10px; font-weight: 900; letter-spacing: .16em; color: var(--chem);
  padding: 3px 9px; border-radius: 99px; background: rgba(94, 194, 143, .12);
}
.ad-visual {
  width: 68px; height: 68px; color: var(--chem); margin: 6px 0;
  animation: gearSpinIdle 6s linear infinite;
}
.ad-visual svg { width: 100%; height: 100%; }
.ad-panel h3 { margin: 0; font-size: 18px; color: var(--ink); }
.ad-panel p { margin: 0; font-size: 12.5px; color: var(--mut); }

/* Cristal Prisma (Mundo 3) e Temas de Tabuleiro */
.cell.crystal {
  border-color: #4bb3b8;
  background: radial-gradient(circle at 50% 50%, rgba(75, 179, 184, .32), #101e24 80%);
  box-shadow: inset 0 0 14px rgba(75, 179, 184, .45), 0 0 10px rgba(75, 179, 184, .3);
}
.cell.crystal .htb { display: block; color: #67e8f9; }
.cell.crystal.empty .htb {
  left: 50%; bottom: auto; top: 50%; width: 46%; height: 46%;
  transform: translate(-50%, -50%);
  animation: heatPulse .85s ease-in-out infinite alternate;
}

#board[data-board="piltover"] {
  background: radial-gradient(circle at 50% 50%, #1c2c3b 0%, #0f1822 100%);
  border-color: #6b8ca8;
}
#board[data-board="piltover"] .cell:not(.heat):not(.crystal):not(.w):not(.locked) {
  background: radial-gradient(circle at 50% 35%, #24384a 0%, #14202b 75%);
}
#board[data-board="toxina"] {
  background: radial-gradient(circle at 50% 50%, #132b22 0%, #091712 100%);
  border-color: #3b7d5e;
}
#board[data-board="toxina"] .cell:not(.heat):not(.crystal):not(.w):not(.locked) {
  background: radial-gradient(circle at 50% 35%, #1b3b2e 0%, #0f211a 75%);
}
#board[data-board="forja"] {
  background: radial-gradient(circle at 50% 50%, #2e1b16 0%, #170d0a 100%);
  border-color: #9e5230;
}
#board[data-board="forja"] .cell:not(.heat):not(.crystal):not(.w):not(.locked) {
  background: radial-gradient(circle at 50% 35%, #3b231c 0%, #1f120e 75%);
}

/* ---------- Finalizadores de Vitória no Tabuleiro ---------- */
#board.fin-chem {
  box-shadow: 0 0 38px rgba(118, 224, 90, .85), inset 0 0 28px rgba(168, 85, 247, .55);
  border-color: #76e05a;
}
#board.fin-chem .cell.w {
  background: radial-gradient(circle at 50% 50%, rgba(118, 224, 90, .48), #132e1e 80%) !important;
  border-color: #76e05a !important;
  box-shadow: 0 0 20px rgba(118, 224, 90, .8), inset 0 0 14px rgba(168, 85, 247, .55) !important;
}
#board.fin-chem .cell:not(.w) .pc {
  animation: meltPiece 1.1s ease-in forwards;
}
@keyframes meltPiece {
  30% { filter: sepia(1) hue-rotate(65deg) saturate(4) brightness(1.3); transform: scale(1.08); }
  100% { filter: sepia(1) hue-rotate(85deg) blur(4px); transform: translateY(28px) scaleY(.35); opacity: 0; }
}

#board.fin-hex {
  box-shadow: 0 0 42px rgba(56, 189, 248, .95), inset 0 0 32px rgba(250, 204, 21, .6);
  border-color: #38bdf8;
}
#board.fin-hex .cell.w {
  background: radial-gradient(circle at 50% 50%, rgba(56, 189, 248, .52), #0f2537 80%) !important;
  border-color: #facc15 !important;
  box-shadow: 0 0 24px rgba(56, 189, 248, .9), inset 0 0 14px rgba(250, 204, 21, .75) !important;
}
#board.fin-hex .cell:not(.w) .pc {
  animation: shatterPiece .95s cubic-bezier(.2, .9, .3, 1) forwards;
}
@keyframes shatterPiece {
  25% { filter: brightness(2.5) drop-shadow(0 0 12px #38bdf8); transform: scale(1.22) rotate(-8deg); }
  100% { filter: brightness(2) blur(3px); transform: scale(1.65) rotate(22deg); opacity: 0; }
}

/* ---------- Cerimônia de Desbloqueio de Nova Carta (#unlockModal) ---------- */
#unlockModal {
  background: radial-gradient(circle at 50% 45%, rgba(18, 34, 38, .94) 0%, rgba(4, 7, 9, .97) 100%);
  z-index: 80;
}
.unlock-stage {
  position: relative; width: min(92vw, 350px);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center;
}
.unlock-rays {
  position: absolute; top: 50%; left: 50%; width: 390px; height: 390px;
  margin-left: -195px; margin-top: -215px; pointer-events: none; z-index: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    color-mix(in srgb, var(--cc, #5ec28f) 26%, transparent) 0deg 12deg,
    transparent 12deg 24deg
  );
  mask-image: radial-gradient(circle, #000 15%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle, #000 15%, transparent 70%);
  animation: spin 16s linear infinite;
}
.unlock-badge {
  position: relative; z-index: 2;
  padding: 6px 16px; border-radius: 99px;
  background: linear-gradient(90deg, #281b14, #1b3629, #281b14);
  border: 2px solid #f0b44c; color: #ffe09e;
  font-size: 13px; font-weight: 900; letter-spacing: .12em;
  box-shadow: 0 0 20px rgba(240, 180, 76, .55);
  animation: ulBadgePop .45s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes ulBadgePop {
  from { transform: translateY(-20px) scale(.6); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.unlock-card-wrap {
  position: relative; z-index: 2;
  width: 240px; height: 310px;
  perspective: 1100px;
}
.unlock-card-3d {
  width: 100%; height: 100%; position: relative;
  transform-style: preserve-3d;
  transform: rotateY(180deg) scale(.65);
  transition: transform .85s cubic-bezier(.22, 1.35, .36, 1);
}
.unlock-card-3d.shaking {
  animation: ulShake .55s ease-in-out infinite;
}
@keyframes ulShake {
  0%, 100% { transform: rotateY(180deg) scale(.86) rotateZ(0deg); }
  25% { transform: rotateY(180deg) scale(.9) rotateZ(-4deg); }
  75% { transform: rotateY(180deg) scale(.9) rotateZ(4deg); }
}
.unlock-card-3d.revealed {
  transform: rotateY(0deg) scale(1);
}
.ul-face {
  position: absolute; inset: 0; border-radius: 18px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 18px 16px;
}
.ul-back {
  transform: rotateY(180deg);
  border: 3px solid #f0b44c;
  background:
    radial-gradient(circle at 50% 50%, rgba(240, 180, 76, .25), transparent 65%),
    repeating-linear-gradient(45deg, #141d21 0 8px, #1c282e 8px 16px);
  box-shadow: 0 0 30px rgba(240, 180, 76, .55), inset 0 0 24px rgba(0, 0, 0, .85);
  gap: 12px; color: #f5c26b; font-weight: 900; letter-spacing: .14em; font-size: 13px;
}
.ul-seal {
  font-size: 58px; filter: drop-shadow(0 0 14px rgba(240, 180, 76, .7));
  animation: spin 6s linear infinite;
}
.ul-front {
  --cc: var(--chem);
  border: 3px solid var(--cc);
  background: radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--cc) 28%, #162025) 0%, #0d1316 80%);
  box-shadow: 0 0 36px color-mix(in srgb, var(--cc) 65%, transparent), inset 0 0 24px color-mix(in srgb, var(--cc) 22%, transparent);
  gap: 8px;
}
.unlock-btn {
  position: relative; z-index: 2; width: 100%; max-width: 260px;
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .3s, transform .3s;
}
.unlock-btn.ready {
  opacity: 1; transform: translateY(0); pointer-events: auto;
}

@media (max-height: 640px) {
  .hand { --cw: min(21vw, 76px); padding-top: 6px; }
  .hand.top { --cw: min(12vw, 44px); }
  .hand .cdesc { display: none; }
  .status { min-height: 32px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .gear { animation: none; }
}

/* ==========================================================================
   v14 · Sprites animados dos personagens (js/sprites.js)
   ========================================================================== */
.sp-eye { transform-box: fill-box; transform-origin: center; animation: spBlink 5.2s infinite; }
.sp-glow { animation: spGlow 1.7s ease-in-out infinite alternate; }
.sp-flicker { animation: spFlicker 1.1s steps(1, end) infinite; }
.sp-float { animation: spFloat 2.6s ease-in-out infinite alternate; }
.sp-smoke { animation: spSmoke 2.4s ease-out infinite; }
.sp-spin, .sp-spin-slow { transform-box: view-box; animation: spSpin 4s linear infinite; }
.sp-spin-slow { animation-duration: 24s; }
.msc-avatar .sp-eye, .mnode .sp-eye { animation-delay: 1.3s; }
@keyframes spBlink { 0%, 93%, 100% { transform: scaleY(1); } 95.5% { transform: scaleY(.12); } }
@keyframes spGlow { from { opacity: .55; } to { opacity: 1; } }
@keyframes spFlicker { 0% { opacity: 1; } 30% { opacity: .55; } 45% { opacity: .95; } 70% { opacity: .7; } }
@keyframes spFloat { from { transform: translateY(0); } to { transform: translateY(-1.6px); } }
@keyframes spSmoke { from { transform: translate(0, 2px); opacity: .9; } to { transform: translate(3px, -6px); opacity: 0; } }
@keyframes spSpin { to { transform: rotate(360deg); } }

/* Retratos maiores na zona de duelo */
.duel-zone.top { min-height: 66px; }
.duel-zone.bot { min-height: 80px; }
.duel-zone.bot .char-frame { width: 66px; height: 66px; }
.duel-zone.top .char-frame { width: 58px; height: 58px; }
.char-frame { background: radial-gradient(circle at 50% 30%, #2b3b43 0%, #141d21 60%, #0b1114 100%); }
.char-frame::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .1), inset 0 -10px 14px rgba(0, 0, 0, .45);
}
.char-frame svg { width: 100%; height: 100%; margin-top: 6%; }
.msc-avatar svg { width: 100%; height: 100%; margin-top: 8%; }
@media (max-height: 640px) {
  .duel-zone.bot .char-frame { width: 56px; height: 56px; }
  .duel-zone.top .char-frame { width: 48px; height: 48px; }
  .duel-zone.top { min-height: 54px; }
  .duel-zone.bot { min-height: 66px; }
}
@media (prefers-reduced-motion: reduce) {
  .sp-eye, .sp-glow, .sp-flicker, .sp-float, .sp-smoke, .sp-spin, .sp-spin-slow { animation: none; }
}

/* ==========================================================================
   v14 · Tabuleiro com moldura rebitada + temas por Mundo da campanha
   ========================================================================== */
#board {
  --bd-frame: #3a4a52; --bd-plate-a: #232f35; --bd-plate-b: #11181b;
  --bd-bg-a: #1d272c; --bd-bg-b: #0d1316; --bd-glow: transparent; --bd-rivet: #c9d4da;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .02) 0 2px, transparent 2px 7px),
    radial-gradient(circle at 50% 40%, var(--bd-bg-a) 0%, var(--bd-bg-b) 100%);
  box-shadow:
    0 0 0 4px var(--bd-frame), 0 0 0 5.5px #060a0b,
    inset 0 0 0 2px #0b1012, inset 0 4px 16px rgba(0, 0, 0, .75),
    0 14px 30px rgba(0, 0, 0, .8), 0 0 46px var(--bd-glow);
}
#board::before {
  content: ""; position: absolute; inset: 2px; border-radius: 13px; pointer-events: none; z-index: 1;
  --rv: radial-gradient(circle at 42% 40%, var(--bd-rivet) 0 1.1px, color-mix(in srgb, var(--bd-rivet) 45%, #000) 1.9px 2.8px, rgba(0,0,0,.6) 3.1px, transparent 3.6px);
  background: var(--rv) left 1px top 1px / 8px 8px no-repeat, var(--rv) right 1px top 1px / 8px 8px no-repeat,
              var(--rv) left 1px bottom 1px / 8px 8px no-repeat, var(--rv) right 1px bottom 1px / 8px 8px no-repeat;
}
#board::after {
  content: attr(data-arena); position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%);
  z-index: 2; pointer-events: none; white-space: nowrap;
  padding: 3px 11px 2px; border-radius: 5px; border: 1.5px solid #060a0b;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bd-frame) 100%, #fff 18%), color-mix(in srgb, var(--bd-frame) 70%, #000));
  color: var(--bd-rivet); font: 900 8.5px/1.2 "Segoe UI", system-ui, sans-serif; letter-spacing: .22em;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .2);
}
#board:not([data-arena])::after { display: none; }
.cell {
  background: radial-gradient(circle at 50% 28%, var(--bd-plate-a) 0%, var(--bd-plate-b) 80%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), inset 0 -3px 0 rgba(0, 0, 0, .35),
              inset 0 3px 8px rgba(0, 0, 0, .5), 0 1px 0 rgba(255, 255, 255, .04);
}

/* Mundo 1 · Oficina de Vapor — cobre, latão e brasas */
body[data-world="1"] #board[data-board="default"] {
  --bd-frame: #7a4a2a; --bd-plate-a: #30261f; --bd-plate-b: #17100c;
  --bd-bg-a: #2b1e16; --bd-bg-b: #100a07; --bd-glow: rgba(224, 109, 59, .2); --bd-rivet: #e8b766;
}
/* Mundo 2 · Laboratório Ácido — vidro esverdeado e reagentes */
body[data-world="2"] #board[data-board="default"] {
  --bd-frame: #2f6b52; --bd-plate-a: #1a2f27; --bd-plate-b: #0b1612;
  --bd-bg-a: #12281e; --bd-bg-b: #06100b; --bd-glow: rgba(94, 194, 143, .22); --bd-rivet: #a7ecc4;
}
/* Mundo 3 · Torre Prisma — cristal, anil e violeta */
body[data-world="3"] #board[data-board="default"] {
  --bd-frame: #4b55a0; --bd-plate-a: #1f2346; --bd-plate-b: #0d1024;
  --bd-bg-a: #1b1e40; --bd-bg-b: #080a1a; --bd-glow: rgba(103, 232, 249, .2); --bd-rivet: #c4b5fd;
}

/* Cenário atrás do tabuleiro */
.board-wrap::before {
  content: ""; position: absolute; inset: -2% -6%; z-index: -1; pointer-events: none;
  opacity: 0; transition: opacity .6s;
}
body[data-world="1"] .board-wrap::before {
  opacity: 1;
  background:
    radial-gradient(circle, rgba(255, 170, 90, .75) 0 1.2px, transparent 2px) 0 0 / 46px 58px,
    radial-gradient(circle, rgba(255, 120, 60, .55) 0 1px, transparent 1.8px) 23px 30px / 38px 50px,
    radial-gradient(ellipse at 50% 100%, rgba(224, 109, 59, .28) 0%, transparent 62%);
  animation: embersUp 7s linear infinite;
}
body[data-world="2"] .board-wrap::before {
  opacity: 1;
  background:
    radial-gradient(circle, transparent 0 2.2px, rgba(140, 240, 180, .45) 2.6px 3.3px, transparent 3.8px) 0 0 / 54px 64px,
    radial-gradient(circle, rgba(140, 240, 180, .35) 0 1.4px, transparent 2px) 27px 32px / 42px 52px,
    radial-gradient(ellipse at 50% 100%, rgba(94, 194, 143, .26) 0%, transparent 62%);
  animation: bubblesUp 9s linear infinite;
}
body[data-world="3"] .board-wrap::before {
  opacity: 1;
  background:
    radial-gradient(circle, rgba(230, 240, 255, .8) 0 .9px, transparent 1.5px) 0 0 / 37px 41px,
    radial-gradient(circle, rgba(196, 181, 253, .6) 0 1.1px, transparent 1.7px) 18px 22px / 53px 47px,
    radial-gradient(ellipse at 30% 20%, rgba(167, 139, 250, .22) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 85%, rgba(103, 232, 249, .2) 0%, transparent 55%);
  animation: starsTwinkle 3.5s ease-in-out infinite alternate;
}
@keyframes embersUp {
  from { background-position: 0 0, 23px 30px, 0 0; }
  to   { background-position: 8px -232px, 15px -170px, 0 0; }
}
@keyframes bubblesUp {
  from { background-position: 0 0, 27px 32px, 0 0; }
  to   { background-position: 0 -256px, 27px -176px, 0 0; }
}
@keyframes starsTwinkle { from { opacity: .65; } to { opacity: 1; } }

/* Fundo da tela tingido pelo Mundo durante a partida */
body.in-game[data-world="1"] #bg {
  background: radial-gradient(ellipse at 50% 108%, rgba(224, 109, 59, .2) 0%, transparent 60%),
              linear-gradient(180deg, #0f0b09 0%, #1d1511 52%, #0d0907 100%);
}
body.in-game[data-world="2"] #bg {
  background: radial-gradient(ellipse at 50% 108%, rgba(94, 194, 143, .2) 0%, transparent 60%),
              linear-gradient(180deg, #07100c 0%, #10201a 52%, #060d0a 100%);
}
body.in-game[data-world="3"] #bg {
  background: radial-gradient(ellipse at 20% 0%, rgba(167, 139, 250, .18) 0%, transparent 55%),
              radial-gradient(ellipse at 50% 108%, rgba(103, 232, 249, .16) 0%, transparent 60%),
              linear-gradient(180deg, #080a18 0%, #12142c 52%, #070814 100%);
}
@media (prefers-reduced-motion: reduce) {
  .board-wrap::before { animation: none !important; }
}
.board-wrap { padding: 7px 7px 15px; }
body[data-world="1"] .board-wrap::before, body[data-world="2"] .board-wrap::before {
  -webkit-mask-image: linear-gradient(to top, #000 15%, transparent 80%);
  mask-image: linear-gradient(to top, #000 15%, transparent 80%);
}

/* ==========================================================================
   v14 · Mapa do Submundo ilustrado com rolagem (js/mapscene.js)
   ========================================================================== */
.world-map {
  flex: none; aspect-ratio: auto; height: min(46vh, 440px); min-height: 260px; max-height: none;
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: #3c4f59 transparent;
  background: #0b1012;
}
.map-canvas { position: relative; width: 100%; aspect-ratio: 360 / 640; }
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.world-map::after {
  content: "▼ role o mapa ▼"; position: sticky; display: block; bottom: 0; margin-top: -22px; height: 22px;
  text-align: center; font: 800 9px/22px "Segoe UI", system-ui, sans-serif; letter-spacing: .2em; color: rgba(221, 231, 235, .55);
  background: linear-gradient(transparent, rgba(5, 8, 9, .85)); pointer-events: none; z-index: 6;
}

/* Trilhas */
.mpath-bg { fill: none; stroke: #050809; stroke-width: 13; stroke-linecap: round; opacity: .85; }
.mpath-lock { fill: none; stroke: #4a5a62; stroke-width: 4; stroke-dasharray: 2 9; stroke-linecap: round; }
.mpath-open { fill: none; stroke: #f0c57a; stroke-width: 5.5; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(240, 197, 122, .55)); }
.mpath-flow { fill: none; stroke: #fff8e1; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 3 14; animation: msFlow 1.2s linear infinite; }

/* Nós das fases com retrato do inimigo */
.mnode {
  width: 52px; height: 52px; border-width: 3px; overflow: visible;
  background: radial-gradient(circle at 50% 30%, #2b3b43, #10171a);
}
.mnode.boss { width: 64px; height: 64px; border-radius: 18px; }
.mn-art {
  position: absolute; inset: 2px; border-radius: 50%; overflow: hidden; pointer-events: none;
  background: radial-gradient(circle at 50% 30%, #34474f 0%, #141d21 70%);
}
.mnode.boss .mn-art { border-radius: 14px; background: radial-gradient(circle at 50% 30%, #4a2a1d 0%, #1c100c 75%); }
.mnode.w3.boss .mn-art { background: radial-gradient(circle at 50% 30%, #2f2a66 0%, #0f0f26 75%); }
.mn-art svg { width: 100%; height: 100%; display: block; margin-top: 10%; }
.mnode.unlocked:not(.done):not(.sel) .mn-art { animation: nodeCall 1.4s ease-in-out infinite alternate; }
.mn-lock { width: 20px; height: 20px; color: #6f8590; display: block; }
.mn-lock svg { width: 100%; height: 100%; display: block; }
.mn-crown {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  font-size: 15px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .9)); pointer-events: none;
}
.mnode.locked, .mnode:disabled { opacity: 1; filter: grayscale(.5) brightness(.75); background: radial-gradient(circle at 50% 30%, #26333a, #0e1417); }
.mnode.sel { animation: nodeSel 1.2s ease-in-out infinite alternate; }
.mn-lbl { top: calc(100% + 4px); z-index: 1; }
.mnode.sel .mn-lbl { background: var(--chem); color: #08140e; border-color: #08140e; }
.mnode.boss.sel .mn-lbl { background: var(--x); color: #1a0904; }

/* Peão do jogador com o retrato do herói */
.map-pawn {
  width: 38px; height: 38px; overflow: hidden; padding: 0;
  background: radial-gradient(circle at 50% 30%, #3b2a20, #160f0b);
  border: 2.5px solid #fff;
  transform: translate(-50%, calc(-50% - 50px));
}
.map-pawn svg { width: 100%; height: 100%; margin-top: 12%; }
.map-pawn .mp-glow { display: none; }

@keyframes msFlow { to { stroke-dashoffset: -34; } }
@keyframes nodeCall { from { filter: brightness(.85); } to { filter: brightness(1.2); } }
@keyframes nodeSel {
  from { box-shadow: 0 6px 0 #090e10, 0 0 10px var(--chem), 0 0 0 3px rgba(94, 194, 143, .3); }
  to   { box-shadow: 0 6px 0 #090e10, 0 0 22px var(--chem), 0 0 0 6px rgba(94, 194, 143, .15); }
}

/* Animações do cenário */
.ms-rot, .ms-rot-r { transform-box: view-box; animation: spSpin 30s linear infinite; }
.ms-rot-r { animation-direction: reverse; animation-duration: 22s; }
.ms-smoke { transform-box: fill-box; transform-origin: center; animation: msSmoke 3.3s ease-out infinite; }
.ms-flow { animation: msFlow 1.8s linear infinite; }
.ms-bub { animation: msBub 2.6s ease-in infinite; }
.ms-bub-tall { animation-name: msBubTall; animation-duration: 3.4s; }
.ms-win { animation: msWin 3s steps(1, end) infinite; }
.ms-twinkle { animation: msTwinkle 2.4s ease-in-out infinite alternate; }
.ms-float { animation: msFloat 3.2s ease-in-out infinite alternate; }
.ms-pulse { animation: msPulse 2.2s ease-in-out infinite alternate; }
.ms-bolt { opacity: 0; animation: msBolt 4.4s linear infinite; }
@keyframes msSmoke {
  0% { transform: translate(0, 0) scale(.5); opacity: 0; }
  15% { opacity: .5; }
  100% { transform: translate(14px, -46px) scale(1.8); opacity: 0; }
}
@keyframes msBub { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: .9; } 100% { transform: translateY(-22px); opacity: 0; } }
@keyframes msBubTall { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: .9; } 100% { transform: translateY(-62px); opacity: 0; } }
@keyframes msWin { 0%, 100% { opacity: .8; } 40% { opacity: .2; } 55% { opacity: .75; } }
@keyframes msTwinkle { from { opacity: .2; } to { opacity: 1; } }
@keyframes msFloat { from { transform: translateY(0); } to { transform: translateY(-4px); } }
@keyframes msPulse { from { opacity: .6; } to { opacity: 1; } }
@keyframes msBolt { 0%, 88%, 100% { opacity: 0; } 89%, 92% { opacity: 1; } 90.5% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) {
  .ms-rot, .ms-rot-r, .ms-smoke, .ms-flow, .ms-bub, .ms-win, .ms-twinkle, .ms-float, .ms-pulse, .mpath-flow,
  .mnode.sel, .mn-art { animation: none !important; }
  .ms-bolt { display: none; }
}
.world-map::after { transition: opacity .25s; }
.world-map.at-end::after { opacity: 0; }

/* v14.5 · Logo "Velha de Ferro": placa de ferro forjado sob o título */
.logo .l3 {
  position: relative; right: auto; bottom: auto; transform: rotate(-2deg);
  margin-top: 6px; padding: 5px 16px 4px;
  font-family: Georgia, "Times New Roman", serif; font-size: clamp(17px, 5.6vw, 24px); font-weight: 900;
  letter-spacing: .32em; text-indent: .32em; color: #ffd2b8;
  text-shadow: 0 1px 0 #1e0d06, 0 0 10px rgba(224, 109, 59, .55);
  border-radius: 5px; border: 2px solid #1e0d06;
  background:
    radial-gradient(circle at 8px 50%, #f0b48a 0 1.5px, #5a2a14 2.3px 3px, transparent 3.4px),
    radial-gradient(circle at calc(100% - 8px) 50%, #f0b48a 0 1.5px, #5a2a14 2.3px 3px, transparent 3.4px),
    linear-gradient(180deg, #a2512a 0%, #7a3518 55%, #4f1f0c 100%);
  box-shadow: inset 0 1px 0 rgba(255, 220, 190, .35), 0 4px 0 #1a0a04, 0 8px 16px rgba(0, 0, 0, .6);
}
