/* =========================================================================
   Mesa TCG — sistema visual "Mesa do Planeswalker"
   Linguagem do próprio Magic: as 5 cores de mana como acentos semânticos,
   molduras de latão/bronze biseladas como as das cartas, pergaminho (W) nas
   barras de título e o azul-noite/ardósia da interface do Arena.
   Fontes livres: Alegreya SC (títulos, no espírito das molduras/Beleren),
   Crimson Pro (texto de regras, estilo Plantin) e Inter (interface).
   ========================================================================= */
:root {
  /* superfícies: azul-noite e ardósia */
  --night-0: #090d15;
  --night-1: #0e1420;
  --slate: #161d2b;
  --slate-hi: #1f2838;
  --slate-lo: #111725;
  --panel: rgba(18, 24, 36, 0.9);
  --panel-solid: #151c2a;
  --panel-hi: #202a3c;
  /* latão / bronze das molduras */
  --brass: #c9a45c;
  --brass-hi: #efd79c;
  --brass-lo: #8c6a33;
  --bronze: #a9783c;
  --line: rgba(201, 164, 92, 0.24);
  --line-strong: rgba(201, 164, 92, 0.6);
  /* pergaminho (mana branca) e texto */
  --parch: #f8f6d8;
  --parch-2: #e9e2c2;
  --parch-3: #d6cba3;
  --ink: #1c140a;
  --text: #ece6d2;
  --muted: #aeb5c4;
  /* as cinco cores de mana (oficiais) e versões para texto sobre o escuro */
  --mana-w: #f8f6d8;
  --mana-u: #0e68ab;
  --mana-b: #2b2420;
  --mana-b-ink: #150b00;
  --mana-r: #d3202a;
  --mana-g: #00733e;
  --mana-c: #b9b3aa;
  --w-text: #f3ecc4;
  --u-text: #7dbdf0;
  --b-text: #c9b9cf;
  --r-text: #ff8f86;
  --g-text: #6fd59c;
  /* acento da seção corrente (cada aba/modo redefine) */
  --accent: var(--brass);
  --accent-text: var(--brass-hi);
  --radius: 10px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  --glow-brass: 0 0 0 1px rgba(201, 164, 92, 0.45), 0 0 26px rgba(201, 164, 92, 0.18);
  /* moldura biselada: brilho em cima, sombra embaixo, filete escuro por fora */
  --bevel: inset 0 1px 0 rgba(255, 240, 205, 0.18), inset 0 -1px 0 rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.55);
  --tex: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 5px),
         repeating-linear-gradient(25deg, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 4px);
  --font-display: "Alegreya SC", "Cinzel", Georgia, serif;
  --font-serif: "Crimson Pro", "EB Garamond", Georgia, "Times New Roman", serif;
  --font-ui: "Inter", "Segoe UI", system-ui, sans-serif;
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--night-0);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--night-0); overflow: hidden; }
body { font-size: 15px; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
h1, h2, h3, h4 { margin: 0 0 8px; font-weight: 700; }
h1 { font-family: var(--font-display); letter-spacing: 0.04em; }
h2 { font-family: var(--font-display); letter-spacing: 0.03em; font-size: 22px; }
h3 { font-size: 12px; margin-top: 18px; font-family: var(--font-ui); text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent-text); }
h4 { font-size: 11px; color: var(--muted); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: 0.14em; }
.eyebrow { font-size: 11px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--brass-hi); font-weight: 600; }

.screen { position: fixed; inset: 0; overflow: auto;
  background: radial-gradient(1100px 700px at 50% -10%, rgba(14, 104, 171, 0.22) 0%, transparent 60%), var(--tex), var(--night-1); }

/* ---------- botões (latão biselado, como a moldura de uma carta) ---------- */
.btn {
  border: 1px solid var(--line-strong); background: linear-gradient(180deg, #253047, #182033); padding: 9px 16px; border-radius: 6px;
  cursor: pointer; transition: background 0.15s, transform 0.1s, border-color 0.15s, box-shadow 0.15s; white-space: nowrap;
  font-weight: 600; letter-spacing: 0.03em; min-height: 36px; box-shadow: var(--bevel);
}
.btn:hover:not(:disabled) { border-color: var(--brass-hi); background: linear-gradient(180deg, #2c3953, #1c2539); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, #f1dba0 0%, #cfa75c 45%, #a9783c 100%); color: var(--ink); border-color: #5a3f17;
  box-shadow: inset 0 1px 0 rgba(255, 250, 225, 0.75), inset 0 -2px 0 rgba(80, 50, 15, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.6), 0 6px 16px rgba(0, 0, 0, 0.45);
  text-transform: uppercase; letter-spacing: 0.1em; font-family: var(--font-display); font-weight: 800;
}
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #f8e6b6 0%, #dbb46a 45%, #b8864a 100%); border-color: #5a3f17; box-shadow: inset 0 1px 0 rgba(255, 250, 225, 0.8), inset 0 -2px 0 rgba(80, 50, 15, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 22px rgba(239, 215, 156, 0.35); }
.btn.accent { background: linear-gradient(180deg, #2a86cc, var(--mana-u)); border-color: #9fd0f5; color: #fff; font-weight: 800; }
.btn.accent:hover:not(:disabled) { background: linear-gradient(180deg, #3796dc, #1272b8); border-color: #cfe8fb; }
.btn.accent-outline { border-color: #a688c9; color: #e6d9f3; }
.btn.danger { border-color: rgba(255, 110, 100, 0.65); color: #ffc2bb; }
.btn.big { padding: 13px 26px; font-size: 15px; border-radius: 8px; min-height: 48px; }
.btn.small { padding: 6px 11px; font-size: 13px; min-height: 32px; }
.btn.tiny { padding: 4px 9px; font-size: 12px; border-radius: 5px; min-width: 32px; min-height: 32px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--panel);
  cursor: pointer; display: inline-grid; place-items: center; font-size: 17px; backdrop-filter: blur(6px); box-shadow: var(--bevel);
}
.icon-btn:hover:not(:disabled) { border-color: var(--brass-hi); }
.icon-btn:disabled { opacity: 0.4; }
.icon-btn.small { width: 32px; height: 32px; font-size: 14px; }

input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  background: #0b111c; border: 1px solid #7d6538; color: var(--text); border-radius: 6px; padding: 9px 11px; font: inherit;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}
input:focus, select:focus, textarea:focus { border-color: var(--brass-hi); outline: none; box-shadow: 0 0 0 3px rgba(239, 215, 156, 0.25); }
::placeholder { color: #98a0b0; opacity: 1; }
.num-input { width: 78px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; border: 0; padding: 0; }
.field > span, .field > legend { color: var(--muted); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.check { display: flex; align-items: center; gap: 8px; margin: 6px 0; cursor: pointer; }
.check input { accent-color: var(--brass); }
.row { display: flex; gap: 10px; align-items: center; margin: 10px 0; }
.row.wrap { flex-wrap: wrap; }
.pill { padding: 3px 11px; border-radius: 99px; font-weight: 700; font-size: 12px; letter-spacing: 0.04em; }
.pill.ok { background: rgba(0, 115, 62, 0.28); color: var(--g-text); }
.pill.warn { background: rgba(211, 32, 42, 0.2); color: #ffc2a0; }
.pill.gold { background: rgba(201, 164, 92, 0.18); color: var(--brass-hi); }
.callout { border-radius: 8px; padding: 12px 16px; margin: 10px 0; }
.callout.warn { background: rgba(211, 32, 42, 0.1); border: 1px solid rgba(255, 143, 134, 0.45); }
.callout ul { margin: 6px 0 0 18px; padding: 0; }
.panel { background: var(--tex), linear-gradient(180deg, var(--slate-hi), var(--slate-lo)); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--bevel), var(--shadow); }

/* ---------- acentos de mana por seção ---------- */
.mana-w { --accent: var(--mana-w); --accent-text: var(--w-text); }
.mana-u { --accent: var(--mana-u); --accent-text: var(--u-text); }
.mana-b { --accent: #8a7690; --accent-text: var(--b-text); }
.mana-r { --accent: var(--mana-r); --accent-text: var(--r-text); }
.mana-g { --accent: var(--mana-g); --accent-text: var(--g-text); }
.mana-c { --accent: var(--mana-c); --accent-text: #dcd6cc; }

/* ---------- menu ---------- */
.menu-screen { overflow-y: auto; background: var(--night-0); }
.menu-bg { position: fixed; inset: 0; z-index: 0; }
.menu-canvas { display: block; width: 100%; height: 100%; }
.menu-bg::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(9, 13, 21, 0.95) 0%, rgba(9, 13, 21, 0.62) 45%, rgba(9, 13, 21, 0.2) 70%, rgba(9, 13, 21, 0.72) 100%), linear-gradient(0deg, rgba(9, 13, 21, 0.96) 0%, transparent 40%); }
.menu-shell { position: relative; z-index: 1; min-height: 100%; display: flex; flex-direction: column; }
.menu-nav { display: flex; align-items: center; gap: 28px; padding: 14px 36px; border-bottom: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(22, 29, 43, 0.92), rgba(14, 20, 32, 0.85)); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.6), 0 6px 20px rgba(0, 0, 0, 0.35); }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 800; letter-spacing: 0.12em; font-size: 19px; color: var(--parch); }
.brand-mark { display: inline-flex; gap: 3px; }
.brand-mark i { width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.6); }
.brand-mark i:nth-child(1) { background: var(--mana-w); }
.brand-mark i:nth-child(2) { background: var(--mana-u); }
.brand-mark i:nth-child(3) { background: var(--mana-b); box-shadow: 0 0 0 1px #8a7d72; }
.brand-mark i:nth-child(4) { background: var(--mana-r); }
.brand-mark i:nth-child(5) { background: var(--mana-g); }
.menu-nav nav { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.nav-link { background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 10px 5px; cursor: pointer; color: var(--muted); font-size: 14px; letter-spacing: 0.06em; font-family: var(--font-display); font-weight: 700; display: inline-flex; align-items: center; gap: 7px; }
.nav-link::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6); opacity: 0.6; }
.nav-link.install::before, .nav-link.plain::before { display: none; }
.nav-link:hover, .nav-link.on { color: var(--parch); border-bottom-color: var(--accent); }
.nav-link:hover::before, .nav-link.on::before { opacity: 1; }
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr); gap: 40px; padding: 52px 36px 24px; align-items: center; max-width: 1400px; width: 100%; margin: 0 auto; }
.hero-title { font-family: var(--font-display); font-size: clamp(44px, 6vw, 88px); font-weight: 800; letter-spacing: 0.05em; line-height: 1; margin: 14px 0 10px;
  color: var(--parch); text-shadow: 0 2px 0 #000, 0 0 30px rgba(14, 104, 171, 0.45); }
.hero-sub { font-family: var(--font-serif); font-style: italic; font-size: clamp(21px, 2.1vw, 29px); color: var(--parch-2); margin: 0 0 8px; }
.hero-text { font-family: var(--font-serif); font-size: 18px; line-height: 1.55; color: #ddd6c0; max-width: 620px; }
.hero-cta { display: flex; gap: 12px; margin: 26px 0 0; flex-wrap: wrap; }
.stats-strip { display: flex; flex-wrap: wrap; margin-top: 34px; border-top: 1px solid var(--line-strong); max-width: 720px; }
.stat { padding: 14px 22px 0 0; margin-right: 22px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-family: var(--font-display); font-size: 25px; color: var(--parch); font-weight: 700; }
.stat span { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.feature-card { position: relative; border-radius: 14px; overflow: hidden; padding: 7px; border: 1px solid #000;
  background: linear-gradient(160deg, #e9cf8f, #a9783c 40%, #6e4c22 70%, #c9a45c); box-shadow: var(--shadow), 0 0 0 1px rgba(201, 164, 92, 0.25); }
.feature-card > * { background: var(--panel-solid); }
.feature-art { width: 100%; aspect-ratio: 626 / 457; object-fit: cover; display: block; background: #121a28; border-radius: 8px 8px 0 0; }
.feature-body { padding: 14px 16px 16px; border-radius: 0 0 8px 8px; }
.feature-body h2 { margin: 6px 0 2px; font-size: 23px; }
.feature-body .type { color: var(--muted); font-size: 13px; }
.feature-body .oracle { color: #e3dcc6; font-size: 15.5px; max-height: 120px; overflow: hidden; }
.feature-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.menu-section { max-width: 1400px; width: 100%; margin: 0 auto; padding: 18px 36px; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.quick-card { position: relative; text-align: left; border: 1px solid var(--line-strong); border-top: 3px solid var(--accent); border-radius: 8px; padding: 18px; min-height: 136px; cursor: pointer; overflow: hidden;
  background: var(--tex), linear-gradient(170deg, var(--slate-hi), var(--slate-lo)); box-shadow: var(--bevel); transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; }
.quick-card:hover, .quick-card:focus-visible { transform: translateY(-3px); border-color: var(--brass-hi); border-top-color: var(--accent); box-shadow: var(--bevel), 0 10px 26px rgba(0, 0, 0, 0.5); }
.quick-card .qc-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; font-size: 21px; color: var(--ink);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.55), transparent 55%), var(--accent); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.3), 0 0 0 2px #0a0d14, 0 0 0 3px var(--brass-lo); }
.quick-card.mana-u .qc-icon, .quick-card.mana-r .qc-icon, .quick-card.mana-g .qc-icon, .quick-card.mana-b .qc-icon { color: #fff; }
.quick-card strong { display: block; font-family: var(--font-display); letter-spacing: 0.03em; font-size: 19px; margin: 10px 0 4px; color: var(--parch); }
.quick-card span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.quick-card .qc-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.2; }
.quick-card > *:not(.qc-bg) { position: relative; }
.menu-footer { margin: auto auto 0; padding: 24px 36px 30px; color: #a9afbd; font-size: 12px; line-height: 1.6; max-width: 1400px; width: 100%; border-top: 1px solid var(--line); }
.menu-footer p { margin: 0 0 6px; }
.menu-footer .fcp { font-family: var(--font-serif); font-style: italic; font-size: 13.5px; color: #c5c0b0; }

/* ---------- tiles de deck ---------- */
.deck-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.deck-tile { position: relative; text-align: left; border-radius: 9px; overflow: hidden; border: 1px solid var(--line-strong); background: var(--panel-solid); cursor: pointer; padding: 0; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; min-height: 150px; display: flex; flex-direction: column; box-shadow: var(--bevel); }
.deck-tile:hover, .deck-tile:focus-visible { transform: translateY(-3px); border-color: var(--brass-hi); box-shadow: var(--bevel), var(--glow-brass); }
.deck-tile.on { border-color: var(--brass-hi); box-shadow: var(--glow-brass); outline: 2px solid var(--brass-hi); outline-offset: 2px; }
.dt-art { height: 104px; background: #121a28 center / cover no-repeat; position: relative; }
.dt-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(21, 28, 42, 1) 0%, transparent 60%); }
.dt-art.noart { background: radial-gradient(circle at 50% 40%, #24365a, #0d1320); }
.dt-body { padding: 4px 12px 12px; margin-top: -26px; position: relative; }
.dt-body strong { display: block; font-family: var(--font-display); letter-spacing: 0.02em; font-size: 16px; color: var(--parch); line-height: 1.25; }
.dt-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; font-size: 11px; color: var(--muted); align-items: center; }

/* ---------- cabeçalho das telas ---------- */
.screen-head { display: flex; align-items: center; gap: 16px; padding: 12px 26px; border-bottom: 1px solid var(--line-strong);
  position: sticky; top: 0; background: linear-gradient(180deg, rgba(24, 32, 48, 0.96), rgba(14, 20, 32, 0.94)); backdrop-filter: blur(10px); z-index: 5;
  box-shadow: inset 0 -3px 0 -2px var(--accent), 0 6px 18px rgba(0, 0, 0, 0.35); }
.screen-head h1 { flex: 1; margin: 0; font-size: 24px; letter-spacing: 0.06em; color: var(--parch); }

/* ---------- preparação ---------- */
.setup-wrap { max-width: 1300px; margin: 0 auto; padding: 22px 26px 60px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.setup-col { padding: 20px; }
.setup-bottom { grid-column: 1 / -1; padding: 20px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end; }
.chosen { display: flex; gap: 14px; align-items: center; padding: 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(0, 0, 0, 0.28); min-height: 84px; margin-bottom: 12px; box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5); }
.chosen .dt-art { width: 120px; height: 66px; border-radius: 5px; flex: none; box-shadow: 0 0 0 2px #0a0d14, 0 0 0 3px var(--brass-lo); }
.chosen .dt-art::after { display: none; }
.chosen strong { font-family: var(--font-display); font-size: 18px; letter-spacing: 0.02em; display: block; color: var(--parch); }
.mode-toggle { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 8px; width: fit-content; margin-bottom: 14px; background: rgba(0, 0, 0, 0.3); }
.mode-toggle button { border: 0; background: transparent; padding: 8px 14px; border-radius: 5px; cursor: pointer; color: var(--muted); font-weight: 600; letter-spacing: 0.03em; min-height: 36px; }
.mode-toggle button.on, .ranked-toggle button.on { background: linear-gradient(180deg, #f1dba0, #cfa75c 50%, #a9783c); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 250, 225, 0.7), inset 0 -1px 0 rgba(80, 50, 15, 0.5); }
.theme-grid { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 10px; }
.theme-card { border: 1px solid var(--line-strong); border-radius: 8px; padding: 0; overflow: hidden; cursor: pointer; text-align: left; background: var(--panel-solid); box-shadow: var(--bevel); }
.theme-card .tc-sw { height: 58px; }
.theme-card .tc-txt { padding: 8px 10px; font-size: 12px; color: var(--muted); }
.theme-card .tc-txt strong { display: block; font-size: 14px; color: var(--parch); font-family: var(--font-display); }
.theme-card.on { border-color: var(--brass-hi); box-shadow: var(--glow-brass); }

/* ---------- seletor de decks (abas) ---------- */
.picker-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line-strong); margin-bottom: 14px; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 9px 12px; cursor: pointer; color: var(--muted); font-size: 14px; letter-spacing: 0.04em; font-family: var(--font-display); font-weight: 700; min-height: 36px; }
.tab:nth-child(5n + 1) { --accent: var(--mana-w); }
.tab:nth-child(5n + 2) { --accent: var(--mana-u); }
.tab:nth-child(5n + 3) { --accent: #8a7690; }
.tab:nth-child(5n + 4) { --accent: var(--mana-r); }
.tab:nth-child(5n + 5) { --accent: var(--mana-g); }
.tab.on, .tab:hover { color: var(--parch); border-bottom-color: var(--accent); }
.picker-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.picker-tools input[type="search"] { flex: 1; min-width: 180px; }
.picker-grid { max-height: 52vh; overflow: auto; padding: 6px; }
.picker-more { display: flex; justify-content: center; margin-top: 12px; }

/* ---------- carregando ---------- */
.loading-screen { display: grid; place-items: center; }
.loading-card { text-align: center; width: min(460px, 90vw); }
.loading-card p { font-family: var(--font-serif); font-style: italic; font-size: 19px; }
.spinner { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; border: 4px solid transparent;
  background: conic-gradient(var(--mana-w) 0 20%, var(--mana-u) 0 40%, #5c4d58 0 60%, var(--mana-r) 0 80%, var(--mana-g) 0) border-box;
  -webkit-mask: radial-gradient(circle, transparent 25px, #000 26px); mask: radial-gradient(circle, transparent 25px, #000 26px);
  animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 6px; background: rgba(255, 255, 255, 0.08); border-radius: 3px; overflow: hidden; margin: 12px 0; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6); }
.progress .bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--bronze), var(--brass-hi)); transition: width 0.2s; }

/* ---------- decks ---------- */
.deck-layout { display: grid; grid-template-columns: 300px 1fr; min-height: calc(100% - 66px); }
.deck-side { border-right: 1px solid var(--line-strong); padding: 18px; overflow: auto; background: rgba(0, 0, 0, 0.22); }
.side-head { display: flex; justify-content: space-between; align-items: center; }
.deck-list { display: flex; flex-direction: column; gap: 6px; }
.deck-item { text-align: left; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--bevel); }
.deck-item:hover { border-color: var(--line-strong); }
.deck-item.active { border-color: var(--brass); border-left: 4px solid var(--brass-hi); background: var(--panel-hi); }
.deck-item strong { font-family: var(--font-display); letter-spacing: 0.02em; font-weight: 700; font-size: 16px; color: var(--parch); }
.deck-item .muted { font-size: 12px; }
.deck-editor { padding: 18px 24px 60px; min-width: 0; }
.deck-name { width: 100%; font-size: 22px; font-weight: 700; font-family: var(--font-display); letter-spacing: 0.03em; }
.deck-text { width: 100%; min-height: 200px; resize: vertical; font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; line-height: 1.5; }
.deck-summary { display: flex; gap: 12px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
.cmd-pick { border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 14px; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.cmd-pick legend { color: var(--brass-hi); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; padding: 0 6px; }
.deck-editor .row .filter-input { flex: 1; margin: 0; }
.curve { display: flex; align-items: flex-end; gap: 6px; height: 74px; padding: 18px 0 20px; max-width: 420px; }
.curve div { flex: 1; background: linear-gradient(180deg, var(--brass-hi), var(--bronze)); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.curve div span { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }
.curve div b { position: absolute; top: -17px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--parch); font-weight: 600; }

/* ---------- explorador de cartas ---------- */
.browser { display: grid; grid-template-columns: 270px 1fr; min-height: calc(100% - 66px); }
.browser.embedded { min-height: 0; grid-template-columns: 230px 1fr; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; margin-top: 12px; }
.filters { padding: 16px; border-right: 1px solid var(--line-strong); background: rgba(0, 0, 0, 0.24); display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.filters .field { margin: 0; }
.filters select, .filters input { width: 100%; }
.color-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.color-btn { width: 36px; height: 36px; border-radius: 50%; border: 2px solid #0a0d14; cursor: pointer; font-weight: 800; color: #111; font-size: 13px; filter: grayscale(.55) brightness(.7); transition: filter 0.12s, transform 0.12s; box-shadow: 0 0 0 1px var(--brass-lo); }
.color-btn.on { filter: none; transform: scale(1.06); box-shadow: 0 0 0 2px var(--brass-hi), 0 0 12px rgba(239, 215, 156, 0.45); }
.results { padding: 16px; min-width: 0; overflow: auto; }
.results-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.browser.embedded .results-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); max-height: 62vh; overflow: auto; padding: 4px; }
.rcard { position: relative; border-radius: 11px; overflow: visible; background: transparent; border: 0; padding: 0; cursor: pointer; aspect-ratio: 63 / 88; transition: transform 0.14s; }
.rcard img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 11px; transition: box-shadow 0.14s; }
.rcard:hover, .rcard:focus-within { transform: translateY(-4px) scale(1.02); z-index: 2; }
.rcard:hover img, .rcard:focus-within img { box-shadow: 0 14px 28px rgba(0, 0, 0, 0.6), var(--glow-brass); }
.rcard .open { position: absolute; inset: 0; border: 0; background: transparent; cursor: pointer; border-radius: 11px; }
.rcard .add-btn { position: absolute; right: 8px; bottom: 8px; opacity: 0; transition: opacity 0.12s; }
.rcard:hover .add-btn, .rcard:focus-within .add-btn { opacity: 1; }
.rcard .in-deck { position: absolute; left: 8px; top: 8px; background: rgba(9, 13, 21, 0.9); color: var(--brass-hi); padding: 2px 8px; border-radius: 5px; font-size: 12px; font-weight: 700; pointer-events: none; border: 1px solid var(--line-strong); }
.card-detail { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 22px; }
.card-detail img { width: 100%; border-radius: 16px; box-shadow: var(--shadow); }
.card-detail .faces { display: flex; gap: 8px; margin-top: 8px; }
.legal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 4px 12px; font-size: 12px; margin-top: 8px; }
.legal-grid .ok { color: var(--g-text); }
.legal-grid .no { color: #98a0b0; }

/* ---------- miniaturas ---------- */
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.thumb-grid.small { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.thumb-grid.hand-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.thumb { position: relative; padding: 0; border: 2px solid transparent; border-radius: 11px; background: #0b111c; cursor: pointer; overflow: hidden; aspect-ratio: 63 / 88; transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s; }
.thumb.static { cursor: default; }
.thumb:hover:not(.static) { transform: translateY(-3px); border-color: var(--line-strong); }
.thumb.selected { border-color: var(--brass-hi); box-shadow: 0 0 0 3px rgba(201, 164, 92, 0.4); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-fallback { padding: 10px; font-size: 13px; text-align: center; display: grid; place-items: center; height: 100%; font-family: var(--font-display); background: linear-gradient(180deg, var(--parch-2), var(--parch-3)); color: var(--ink); }
.thumb-label { position: absolute; left: 6px; bottom: 6px; background: rgba(9, 13, 21, 0.88); color: var(--brass-hi); padding: 2px 8px; border-radius: 5px; font-size: 12px; font-weight: 700; }
.thumb-label.qty { left: auto; right: 6px; top: 6px; bottom: auto; color: #fff; }
.thumb-tools { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.12s; }
.thumb:hover .thumb-tools, .thumb:focus-within .thumb-tools { opacity: 1; }

/* =========================================================================
   PARTIDA
   ========================================================================= */
.game-screen { overflow: hidden; background: #000; }
.table-wrap { position: absolute; inset: 0; }
.table-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.label-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.tlabel { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform; }
/* caixa de P/R no estilo da moldura da carta */
.card-badge { background: linear-gradient(180deg, var(--parch), var(--parch-3)); border: 1px solid #000; color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 14px; padding: 0 8px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--brass), 0 2px 8px rgba(0, 0, 0, 0.7); }
.card-badge.damaged { background: linear-gradient(180deg, #ffd7d2, #f0a9a1); color: #5a0a0a; box-shadow: inset 0 0 0 1px var(--mana-r), 0 2px 8px rgba(0, 0, 0, 0.7); }
.card-badge.modified { background: linear-gradient(180deg, #d8f5e3, #a9dcbd); color: #053a1f; box-shadow: inset 0 0 0 1px var(--mana-g), 0 2px 8px rgba(0, 0, 0, 0.7); }
.card-badge.damaged.modified { background: linear-gradient(180deg, #ffd7d2, #f0a9a1); color: #5a0a0a; box-shadow: inset 0 0 0 2px var(--mana-r), 0 0 10px rgba(220, 50, 50, 0.5); }
.card-badge.flying-badge { box-shadow: inset 0 0 0 1px #66d9ff, 0 0 12px rgba(102, 217, 255, 0.65), 0 4px 10px rgba(0, 0, 0, 0.75); }
.pile-count { min-width: 26px; text-align: center; background: linear-gradient(180deg, #f1dba0, #a9783c); color: var(--ink); font-weight: 800; font-size: 12px; padding: 2px 7px; border-radius: 99px; box-shadow: 0 0 0 1px #000, 0 0 10px rgba(201, 164, 92, 0.45); }
.gesture-chip { pointer-events: none; padding: 6px 14px; border-radius: 99px; font-weight: 800; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; background: rgba(40, 14, 10, 0.78); border: 2px solid rgba(255, 106, 74, 0.55); box-shadow: 0 0 14px rgba(255, 74, 61, 0.35); transition: transform 0.12s, background 0.12s; }
.gesture-chip.over { background: #d8352a; border-color: #ffe08a; box-shadow: 0 0 22px rgba(255, 210, 120, 0.8); scale: 1.15; }
@media (prefers-reduced-motion: reduce) { .gesture-chip { transition: none; } }
.pile-count.empty { background: rgba(14, 20, 32, 0.9); color: var(--muted); box-shadow: none; border: 1px solid var(--line); }
.float-text { position: absolute; transform: translate(-50%, -50%); font-size: 36px; font-weight: 800; color: #ff5b4f; text-shadow: 0 2px 10px #000, 0 0 2px #000; animation: floatUp 1.35s cubic-bezier(.2, .8, .3, 1) forwards; pointer-events: none; font-family: var(--font-display); }
.float-text.heal { color: #7bffad; }
.float-text.kw { font-size: 22px; letter-spacing: 0.08em; animation-name: kwPop; animation-duration: 1.5s; }
.float-text.trample { color: #ffb24a; font-size: 28px; }
.float-text.flying { color: #8be9fd; font-size: 24px; }
.float-text.haste { color: #ff6a3a; font-size: 24px; }
.float-text.first { color: #fff5d6; }
.float-text.deathtouch { color: #6dff8a; font-size: 44px; }
.float-text.poison { color: #a6ff4a; font-size: 30px; }
.float-text.plus { color: #ffd36a; }
.float-text.minus { color: #c79bff; }
.float-text.loyalty { color: #9cc8ff; }
.float-text.shield { color: #ffe08a; }
@keyframes floatUp { 0% { opacity: 0; margin-top: 12px; transform: translate(-50%, -50%) scale(0.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 30% { transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; margin-top: -80px; } }
@keyframes kwPop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2.2); filter: blur(4px); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: blur(0); } 75% { opacity: 1; } 100% { opacity: 0; margin-top: -40px; } }

.hud { position: absolute; inset: 0; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; pointer-events: none; z-index: 5; }
.hud-top > * { pointer-events: auto; }
.hud-left { display: flex; gap: 6px; }
.turn-info { background: var(--panel); border: 1px solid var(--line-strong); padding: 8px 14px; border-radius: 7px; font-weight: 700; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; backdrop-filter: blur(6px); box-shadow: var(--bevel); margin-left: auto; flex: none; }
.turn-info.mine { border-color: var(--brass-hi); color: var(--brass-hi); box-shadow: var(--bevel), var(--glow-brass); }

/* Avatares estilo Arena: anel de latão e gema de vida em pergaminho */
.player-panel { display: flex; align-items: center; gap: 14px; background: var(--tex), linear-gradient(90deg, rgba(22, 29, 43, 0.95), rgba(14, 20, 32, 0.78)); border: 1px solid var(--line-strong); border-radius: 60px 10px 10px 60px; padding: 6px 16px 10px 6px; box-shadow: var(--bevel), var(--shadow); backdrop-filter: blur(8px); }
.player-panel.opp { position: relative; left: auto; top: auto; transform: none; padding: 5px 14px 10px 6px; z-index: 5; }
.player-panel.active { border-color: var(--brass-hi); box-shadow: var(--bevel), var(--shadow), 0 0 0 1px rgba(239, 215, 156, 0.5), 0 0 30px rgba(201, 164, 92, 0.3); }
.player-panel.lost { opacity: 0.5; filter: grayscale(1); }
.player-panel.hit { animation: hit 0.5s; }
.player-panel.opp.hit { animation: hitc 0.5s; }
.player-panel.targetable { animation: targetPulse 1.1s infinite; cursor: crosshair; }
.player-panel.opp.targetable { animation: targetPulse 1.1s infinite; }
@keyframes targetPulse { 0%, 100% { box-shadow: 0 0 0 2px rgba(211, 32, 42, 0.45), 0 0 18px rgba(211, 32, 42, 0.3); } 50% { box-shadow: 0 0 0 3px rgba(255, 110, 100, 0.95), 0 0 34px rgba(211, 32, 42, 0.6); } }
@keyframes hit { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); background: rgba(140, 20, 20, 0.92); } 40% { transform: translateX(8px); } 60% { transform: translateX(-4px); } }
@keyframes hitc { 0%, 100% { transform: translateX(-50%); } 20% { transform: translateX(calc(-50% - 9px)); background: rgba(140, 20, 20, 0.92); } 40% { transform: translateX(calc(-50% + 8px)); } }
.pp-avatar { position: relative; width: 68px; height: 68px; flex: none; }
.pp-avatar .ring { position: absolute; inset: 0; border-radius: 50%; padding: 3px; background: conic-gradient(from 210deg, #efd79c, #8c6a33, #efd79c, #5e421c, #efd79c); box-shadow: 0 0 0 1px #000, 0 0 14px rgba(201, 164, 92, 0.35); }
.pp-avatar .ring > .portrait { width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #24365a, #0d1320) center / cover no-repeat; }
.pp-avatar .life-gem { position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%); min-width: 52px; padding: 0 8px; border-radius: 6px; background: linear-gradient(180deg, var(--parch), var(--parch-3)); border: 1px solid #000; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 21px; color: var(--ink); box-shadow: inset 0 0 0 1px var(--brass), 0 4px 10px rgba(0, 0, 0, 0.75); z-index: 4; }
.player-panel.low .life-gem { color: #fff; background: linear-gradient(180deg, #e2413f, #9e1218); box-shadow: inset 0 0 0 1px #ffb1a8, 0 0 14px rgba(211, 32, 42, 0.55); }
.pp-info { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.pp-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pp-name { font-weight: 700; display: flex; gap: 6px; align-items: center; font-family: var(--font-display); letter-spacing: 0.03em; font-size: 16px; color: var(--parch); }
.tag { font-size: 10px; background: rgba(14, 104, 171, 0.35); color: #cfe6fb; padding: 1px 7px; border-radius: 4px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; font-family: var(--font-ui); }
.pp-life { display: flex; align-items: center; gap: 4px; }
.life-btn { width: 32px; height: 28px; border-radius: 5px; border: 1px solid var(--line-strong); background: linear-gradient(180deg, #253047, #182033); cursor: pointer; font-weight: 800; box-shadow: var(--bevel); }
.life-btn:hover { border-color: var(--brass-hi); }
.pp-stats { display: flex; gap: 8px; font-size: 12px; color: var(--muted); align-items: center; }
.pp-stats .stat-badge, .pp-stats span { display: inline-flex; align-items: center; gap: 4px; background: rgba(9, 13, 21, 0.92); border: 1px solid var(--line-strong); padding: 2px 7px; border-radius: 6px; font-weight: 700; color: #f1f5f9; letter-spacing: 0.02em; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
.poison { background: none; border: 1px solid transparent; border-radius: 5px; cursor: pointer; color: var(--muted); padding: 3px 6px; min-height: 28px; }
.poison.has { color: #b9ff7a; border-color: rgba(185, 255, 122, 0.45); text-shadow: 0 0 10px rgba(166, 255, 74, 0.7); }
.pp-cmd { display: flex; flex-direction: column; font-size: 11px; color: var(--brass-hi); }
.pp-cmd .danger { color: var(--r-text); font-weight: 700; }
.pp-pool { display: flex; gap: 4px; }

.hud-bottom { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: flex-end; gap: 10px; pointer-events: none; }
.hud-bottom > * { pointer-events: auto; }
.left-col { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; margin-right: auto; width: 290px; }
.toolbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px; width: 100%; backdrop-filter: blur(6px); box-shadow: var(--bevel); }
.tool-btn { background: transparent; border: 1px solid transparent; border-radius: 5px; padding: 6px 4px; min-height: 32px; cursor: pointer; text-align: center; font-size: 11.5px; letter-spacing: 0.03em; color: #e2dccb; }
.tool-btn:hover { background: rgba(201, 164, 92, 0.12); border-color: var(--line); color: var(--parch); }
.action-stack { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 220px; }
.main-action { min-height: 58px; font-size: 16px; border-radius: 8px !important; }
.action-stack .btn.big:not(.primary) { border-radius: 8px; }
.target-btns { display: flex; flex-direction: column; gap: 6px; }

.phase-track { position: absolute; right: 12px; top: 52px; left: auto; transform: none; list-style: none; margin: 0; padding: 4px; display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px; backdrop-filter: blur(6px); box-shadow: var(--bevel); z-index: 3; }
.phase-track li { font-size: 10.5px; padding: 4px 8px; border-radius: 5px; color: #a3aab8; white-space: nowrap; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.phase-track li.active.mine { background: linear-gradient(180deg, #f1dba0, #cfa75c 50%, #a9783c); color: var(--ink); box-shadow: 0 0 12px rgba(201, 164, 92, 0.5); }
.phase-track li.active.theirs { background: linear-gradient(180deg, #2a86cc, var(--mana-u)); color: #fff; box-shadow: 0 0 12px rgba(14, 104, 171, 0.6); }

.prompt-banner { position: absolute; top: 154px; left: 50%; transform: translateX(-50%) translateY(-6px); background: linear-gradient(180deg, var(--parch), var(--parch-2)); color: var(--ink); border: 1px solid #000; border-radius: 6px; padding: 9px 20px; max-width: min(760px, 88vw); text-align: center; opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none; font-family: var(--font-serif); font-size: 17px; font-weight: 600; box-shadow: inset 0 0 0 2px var(--brass), var(--shadow); z-index: 4; }
.prompt-banner.show { opacity: 1; transform: translateX(-50%); }

.card-preview { position: absolute; left: 12px; top: 106px; width: 300px; max-height: calc(100% - 275px); overflow: auto; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px; opacity: 0; transform: translateX(-14px); transition: opacity 0.15s, transform 0.15s; pointer-events: none; box-shadow: var(--bevel), var(--shadow); backdrop-filter: blur(8px); }
.card-preview.show { opacity: 1; transform: none; }
.preview-img { width: 100%; border-radius: 13px; display: block; }
.preview-fallback { aspect-ratio: 63 / 88; display: grid; place-items: center; background: linear-gradient(180deg, var(--parch-2), var(--parch-3)); color: var(--ink); border-radius: 13px; font-size: 18px; font-weight: 700; font-family: var(--font-display); }
.preview-info { padding: 8px 4px 2px; font-size: 13.5px; }
.pv-title { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-family: var(--font-display); letter-spacing: 0.02em; font-size: 16px; color: var(--parch); }
.pv-type { color: var(--muted); margin: 3px 0 6px; }
.oracle p { margin: 4px 0; line-height: 1.4; font-family: var(--font-serif); font-size: 1.08em; }
.pv-status { margin: 8px 0 0; padding-left: 18px; color: #cfe0ff; }
.pv-cmd { color: var(--brass-hi); }
.credit { color: #a3aab8; font-size: 11px; margin: 8px 0 0; }

.log-panel { position: absolute; top: 60px; right: 0; bottom: 150px; width: 350px; background: var(--tex), rgba(14, 20, 32, 0.97); border-left: 1px solid var(--line-strong); border-radius: 10px 0 0 10px; transform: translateX(105%); transition: transform 0.2s; display: flex; flex-direction: column; z-index: 4; }
.log-panel.open { transform: none; }
.log-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line-strong); }
.log-head strong { font-size: 14px; color: var(--parch); font-family: var(--font-display); letter-spacing: 0.03em; }
.log-btn { font-size: 12px; font-weight: 600; padding: 4px 10px; width: auto; min-width: 66px; }
.log-tabs { display: flex; border-bottom: 1px solid var(--line-strong); background: rgba(0, 0, 0, 0.25); }
.log-tab { flex: 1; padding: 7px 10px; background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.log-tab:hover { color: var(--parch); background: rgba(255, 255, 255, 0.04); }
.log-tab.active { color: var(--brass-hi); border-bottom-color: var(--brass-hi); background: rgba(201, 164, 92, 0.08); }
.log-list { list-style: none; margin: 0; padding: 8px 12px; overflow-y: auto; font-size: 13.5px; line-height: 1.45; font-family: var(--font-serif); flex: 1; }
.log-list li { padding: 4px 6px; border-bottom: 1px dashed rgba(201, 164, 92, 0.12); border-radius: 4px; }
.log-entry.death { background: rgba(239, 68, 68, 0.16); border-left: 3px solid #ef4444; color: #fca5a5; font-weight: 500; margin: 2px 0; }
.log-entry.combat { background: rgba(245, 158, 11, 0.12); border-left: 3px solid #f59e0b; color: #fde68a; margin: 2px 0; }
.log-entry.cast { border-left: 2px solid #60a5fa; padding-left: 6px; }
.log-entry.log-turn { font-family: var(--font-display); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--brass); text-align: center; margin: 8px 0 4px; padding: 2px 0; opacity: 0.85; border-bottom: none; background: transparent; }

.turn-banner { position: absolute; left: 0; right: 0; top: 40%; transform: translateY(-50%); text-align: center; font-family: var(--font-display); font-size: 58px; font-weight: 800; letter-spacing: 0.16em; opacity: 0; pointer-events: none; padding: 18px 0;
  background: linear-gradient(90deg, transparent, rgba(9, 13, 21, 0.88) 25%, rgba(9, 13, 21, 0.88) 75%, transparent); transition: opacity 0.25s; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.9); }
.turn-banner::before, .turn-banner::after { content: ""; position: absolute; left: 15%; right: 15%; height: 2px; background: linear-gradient(90deg, transparent, var(--brass), transparent); }
.turn-banner::before { top: 0; }
.turn-banner::after { bottom: 0; }
.turn-banner.show { opacity: 1; animation: bannerIn 1.4s cubic-bezier(.2, .8, .2, 1); }
@keyframes bannerIn { 0% { letter-spacing: 0.6em; opacity: 0; } 25% { letter-spacing: 0.16em; opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
.turn-banner.mine { color: var(--parch); }
.turn-banner.theirs { color: var(--u-text); }

.ctx-menu { position: fixed; z-index: 50; min-width: 240px; max-width: 350px; background: var(--tex), linear-gradient(180deg, var(--slate-hi), var(--slate-lo)); border: 1px solid var(--line-strong); border-radius: 9px; padding: 6px; box-shadow: var(--bevel), var(--shadow); }
.ctx-title { padding: 6px 10px 7px; margin: -6px -6px 4px; border-radius: 8px 8px 0 0; font-weight: 700; color: var(--ink); background: linear-gradient(180deg, var(--parch), var(--parch-2)); border-bottom: 1px solid var(--brass-lo); font-family: var(--font-display); letter-spacing: 0.02em; font-size: 16px; }
.ctx-item { display: flex; justify-content: space-between; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 5px; cursor: pointer; min-height: 34px; }
.ctx-item:hover:not(:disabled), .ctx-item:focus-visible { background: rgba(201, 164, 92, 0.15); }
.ctx-item.danger { color: #ffc2bb; }
.ctx-item kbd { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
.ctx-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 5px 10px; }
.ctx-label { width: 100%; font-size: 10.5px; color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; }
.ctx-sep { border-top: 1px solid var(--line); margin: 4px 0; }

/* ---------- mana (símbolos nas cores oficiais dos pips) ---------- */
.mana-cost { display: inline-flex; gap: 2px; vertical-align: middle; }
.ms { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 50%; font-size: 11px; font-weight: 800; color: #111; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 0, 0, 0.55), inset 0 -2px 0 rgba(0, 0, 0, 0.15); font-family: var(--font-ui); }
.ms-w { background: #f8f6d8; }
.ms-u { background: #c1d7e9; }
.ms-b { background: #bab1ab; }
.ms-r { background: #e49977; }
.ms-g { background: #a3c095; }
.ms-c { background: #ccc2c0; }
.ms-n { background: #cac5c0; border-radius: 10px; }
.pp-pool .ms { min-width: 24px; height: 24px; font-size: 12px; box-shadow: 0 0 10px rgba(255, 255, 255, 0.25), 0 0 0 1px #000; }

/* ---------- modais: barra de título de pergaminho, moldura de latão ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(5, 8, 14, 0.74); display: grid; place-items: center; z-index: 40; backdrop-filter: blur(4px); animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--tex), linear-gradient(180deg, var(--slate-hi), var(--slate-lo)); border: 1px solid #000; border-radius: 12px; width: min(480px, 94vw); max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 0 0 3px var(--brass-lo), 0 0 0 4px #000, var(--shadow); animation: pop 0.18s cubic-bezier(.2, .8, .3, 1.2); }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } }
.modal.wide { width: min(1040px, 95vw); }
.modal:focus { outline: none; }
.modal:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 5px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; margin: 8px 8px 0; border-radius: 7px; border: 1px solid #000;
  background: linear-gradient(180deg, var(--parch), var(--parch-2) 60%, var(--parch-3)); color: var(--ink); box-shadow: inset 0 0 0 1px var(--brass), inset 0 2px 0 rgba(255, 255, 255, 0.6); }
.modal-head h2 { margin: 0; font-size: 21px; color: var(--ink); }
.modal-head .icon-btn { background: rgba(28, 20, 10, 0.08); border-color: rgba(28, 20, 10, 0.55); color: var(--ink); box-shadow: none; }
.modal-head .icon-btn:hover:not(:disabled) { background: rgba(28, 20, 10, 0.16); border-color: var(--ink); }
.modal-head :focus-visible { outline-color: var(--mana-u); }
.modal-head .muted, .modal-head .eyebrow { color: #4d4230; }
.modal-body { padding: 16px 20px; overflow: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); }
.modal-actions:empty { display: none; }
.modal.victory .modal-head h2 { color: #6b4a12; font-size: 34px; letter-spacing: 0.12em; }
.modal.defeat .modal-head { background: linear-gradient(180deg, #3a2426, #241517); }
.modal.defeat .modal-head h2 { color: var(--r-text); font-size: 34px; letter-spacing: 0.12em; }
.modal.defeat .modal-head .icon-btn { color: var(--text); border-color: var(--line-strong); }
.filter-input { width: 100%; margin-bottom: 10px; }
.zone-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 34px; margin-bottom: 10px; }
.scry-list { display: flex; flex-direction: column; gap: 8px; }
.scry-row { display: grid; grid-template-columns: 70px 1fr auto auto; gap: 12px; align-items: center; background: #0b111c; border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; }
.scry-row .thumb { width: 70px; }
.seg { display: flex; gap: 4px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #1a2232; border: 1px solid var(--line-strong); border-radius: 99px; padding: 6px 13px; cursor: pointer; min-height: 32px; }
.chip:hover { border-color: var(--brass-hi); }
.token-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.token-preset { display: flex; align-items: center; gap: 8px; text-align: left; background: #172031; border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; cursor: pointer; min-height: 46px; box-shadow: var(--bevel); }
.token-preset:hover { border-color: var(--brass-hi); }
.token-preset .tp-ico { font-size: 20px; }
.token-preset small { display: block; color: var(--muted); font-size: 11px; }
.help-table { border-collapse: collapse; width: 100%; }
.help-table th, .help-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.help-table th { color: var(--brass-hi); white-space: nowrap; font-weight: 600; }
.gameover p { font-size: 19px; font-family: var(--font-serif); }
.cards-panel h3 { margin-top: 14px; }
.cp-list { display: flex; flex-direction: column; gap: 4px; }
.cp-row { display: flex; gap: 6px; }
.cp-card { flex: 1; text-align: left; background: #172031; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; cursor: pointer; min-height: 36px; }
.cp-card:hover, .cp-card:focus-visible { border-color: var(--brass-hi); background: #1f2a3e; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 160px; transform: translateX(-50%) translateY(20px); background: linear-gradient(180deg, var(--slate-hi), var(--slate-lo)); border: 1px solid var(--line-strong); border-left: 4px solid var(--brass); border-radius: 8px; padding: 10px 16px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 60; display: flex; gap: 12px; align-items: center; max-width: 90vw; box-shadow: var(--bevel), var(--shadow); }
.toast.show { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
.toast.warn { border-color: rgba(255, 143, 134, 0.7); border-left-color: var(--mana-r); }
.toast.ok { border-color: rgba(111, 213, 156, 0.7); border-left-color: var(--mana-g); }

/* ---------- telas menores ---------- */
@media (max-width: 1150px) {
  .card-preview { width: 240px; }
  .phase-track li { padding: 3px 5px; font-size: 9.5px; }
  .hero { grid-template-columns: 1fr; }
  .setup-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .deck-layout, .browser { grid-template-columns: 1fr; }
  .deck-side, .filters { border-right: 0; border-bottom: 1px solid var(--line); max-height: 300px; }
  .card-preview:not(.pinned) { display: none; }
  .card-preview.pinned {
    display: flex; flex-direction: column; width: min(250px, 44vw); max-height: calc(100vh - 76px);
    left: 10px; top: 50px; z-index: 25; pointer-events: auto;
  }
  .left-col { width: 210px; }
  .pp-avatar { width: 50px; height: 50px; }
  .pp-info { min-width: 0; }
  .action-stack { min-width: 160px; }
  .phase-track { display: none; }
  .menu-nav { padding: 14px 18px; gap: 14px; flex-wrap: wrap; }
  .menu-nav nav { gap: 12px; flex-wrap: wrap; }
  .hero, .menu-section, .menu-footer { padding-left: 18px; padding-right: 18px; }
  .theme-grid { grid-template-columns: repeat(2, 1fr); }
  .card-detail { grid-template-columns: 1fr; }
  .setup-bottom { grid-template-columns: 1fr; }
}
@media (pointer: coarse) {
  .btn, .tool-btn, .life-btn, .icon-btn, .btn.tiny, .ctx-item { min-height: 44px; min-width: 44px; }
  .player-panel.opp .life-btn { min-height: 26px !important; min-width: 28px !important; width: 28px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- pilha (mágica ampliada) e confirmação ---------- */
.stack-panel { position: absolute; top: 70px; width: 270px; padding: 12px; border-radius: 12px; background: var(--tex), linear-gradient(180deg, var(--slate-hi), var(--slate-lo)); border: 1px solid var(--line-strong); box-shadow: var(--shadow), 0 0 40px rgba(201, 164, 92, 0.25); opacity: 0; pointer-events: none; transform: translateY(-10px) scale(0.96); transition: opacity 0.2s, transform 0.25s cubic-bezier(.2, .8, .3, 1.2); z-index: 6; }
.stack-panel.show { opacity: 1; pointer-events: auto; transform: none; }
.stack-panel.mine { left: 12px; }
.stack-panel.theirs { right: 12px; border-color: rgba(14, 104, 171, 0.6); box-shadow: var(--shadow), 0 0 40px rgba(14, 104, 171, 0.25); }
.sp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sp-img { width: 100%; border-radius: 13px; display: block; animation: spIn 0.45s cubic-bezier(.2, .8, .3, 1.2); }
@keyframes spIn { from { transform: scale(0.6) rotate(-4deg); opacity: 0; filter: brightness(2); } }
.sp-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 10px 2px 4px; font-family: var(--font-display); }
.sp-fx { font-family: var(--font-serif); font-size: 14px; color: #e2d6bb; margin: 4px 2px 8px; }
.sp-actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; }
.confirm-cast { display: grid; grid-template-columns: 170px 1fr; gap: 16px; align-items: start; }
.cc-img { width: 100%; border-radius: 12px; box-shadow: var(--shadow); }
.cc-list { margin: 4px 0 10px; padding-left: 18px; }
@media (max-width: 820px) { .stack-panel { width: 200px; } .confirm-cast { grid-template-columns: 1fr; } }

/* ---------- oponentes (1 ou vários) ---------- */
.opp-row { position: relative; left: auto; top: auto; transform: none; display: flex; gap: 10px; pointer-events: none; margin-right: auto; }
.opp-row > * { pointer-events: auto; }
.opp-row .player-panel.opp { position: static; transform: none; }
.opp-row .player-panel.opp.hit { animation: hit 0.5s; }
.opp-row.multi { left: auto; right: auto; transform: none; justify-content: flex-start; flex-wrap: wrap; }
.opp-row.multi .player-panel { padding: 4px 10px 8px 4px; gap: 8px; }
.opp-row.multi .pp-avatar { width: 50px; height: 50px; }
.opp-row.multi .pp-avatar .life-gem { font-size: 16px; min-width: 40px; bottom: -10px; }
.opp-row.multi .pp-info { min-width: 0; }
.opp-row.multi .pp-life { display: none; }
.player-panel.ally { border-color: rgba(95, 211, 142, 0.6); }
.player-panel.ally .pp-name::after { content: "parceiro"; font-family: var(--font-ui); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: #9ff0c0; margin-left: 4px; }
.deck-tile .dt-bracket { position: absolute; top: 8px; right: 8px; z-index: 2; background: linear-gradient(180deg, #f1dba0, #a9783c); color: var(--ink); border: 1px solid #000; font-weight: 800; font-size: 11px; padding: 2px 7px; border-radius: 4px; letter-spacing: 0.06em; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
.chip.on { border-color: var(--brass-hi); background: rgba(201, 164, 92, 0.18); color: var(--parch); }
.bracket-box { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.bracket-box summary { cursor: pointer; }
.bracket-box ul { margin: 8px 0 4px 18px; padding: 0; }

/* ---------- conta e ranking ---------- */
.login-form { display: flex; flex-direction: column; }
.login-form input { width: 100%; }
.form-error { color: #ffb1a8; min-height: 1.2em; margin: 4px 0; }
.profile-chip { display: flex; align-items: center; gap: 8px; background: rgba(201, 164, 92, 0.12); border: 1px solid var(--line-strong); border-radius: 99px; padding: 6px 14px; cursor: pointer; color: var(--parch); font-weight: 600; min-height: 36px; }
.profile-chip:hover { box-shadow: var(--glow-brass); }
.ranking-wrap { max-width: 900px; margin: 22px auto; padding: 20px; }
.rank-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.rank-table th, .rank-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.rank-table thead th { color: var(--muted); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.rank-table tbody th { font-family: var(--font-display); letter-spacing: 0.04em; }
.rank-table td.pts { font-weight: 800; color: var(--brass-hi); font-size: 17px; }
.rank-table tr.me { background: rgba(201, 164, 92, 0.1); }
.ranked-toggle { display: flex; gap: 6px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(0, 0, 0, 0.3); width: fit-content; margin: 6px 0 12px; }
.ranked-toggle button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 600; min-height: 36px; }
.ranked-toggle button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- rastreador de probabilidades ---------- */
.tracker-panel { position: absolute; top: 60px; right: 0; bottom: 150px; width: 360px; background: var(--tex), rgba(14, 20, 32, 0.97); border-left: 1px solid var(--line-strong); border-radius: 10px 0 0 10px; transform: translateX(105%); transition: transform 0.2s; display: flex; flex-direction: column; z-index: 5; }
.tracker-panel.open { transform: none; }
.tk-body { overflow: auto; padding: 10px 14px 16px; }
.tk-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.tk-summary div { background: #172031; border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; }
.tk-summary b { display: block; font-size: 20px; color: var(--brass-hi); font-family: "Cascadia Mono", Consolas, monospace; }
.tk-summary span { font-size: 10.5px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.tk-colors { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; margin: 6px 0; }
.tk-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tk-table th, .tk-table td { padding: 4px 6px; border-bottom: 1px solid rgba(201, 164, 92, 0.08); text-align: left; }
.tk-table thead th { color: var(--muted); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }
.tk-table tbody th { font-weight: 500; }
.tk-table td { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- preparação v3 ---------- */
.setup-screen .menu-shell, .online-screen .menu-shell { min-height: 0; }
.setup-col .row .field { flex: 1; margin-bottom: 6px; }
.setup-col .row select { width: 100%; }
.opp-slot { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.theme-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.theme-card { position: relative; padding: 0; }
.theme-card .tc-pick { display: block; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; color: inherit; }
.theme-card .tc-sw { height: 92px; display: grid; place-items: center; font-size: 30px; background: #0b111c; overflow: hidden; }
.theme-card .tc-canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.theme-card .tc-3d { position: absolute; top: 6px; right: 6px; }
.preview3d { width: 100%; height: min(62vh, 560px); border-radius: 12px; overflow: hidden; background: #000; }
.preview3d canvas { display: block; }
.menu-nav .brand { background: none; border: 0; color: inherit; cursor: pointer; }

/* Celular em pé durante a partida: pede para girar (iPhone não deixa travar a orientação). */
.rotate-hint { display: none; }
@media (orientation: portrait) and (pointer: coarse) and (max-width: 820px) {
  body.in-game:not(.rotate-dismissed) .rotate-hint,
  body.chx-playing:not(.rotate-dismissed) .rotate-hint,
  body.op-playing:not(.rotate-dismissed) .rotate-hint,
  body.lor-playing:not(.rotate-dismissed) .rotate-hint,
  body.swu-playing:not(.rotate-dismissed) .rotate-hint {
    display: flex; position: fixed; inset: 0; z-index: 9999; flex-direction: column; align-items: center; justify-content: center;
    gap: 16px; background: rgba(9, 13, 21, 0.95); backdrop-filter: blur(12px); color: var(--parch, #f8fafc); text-align: center; padding: 24px; font-size: 18px;
  }
  body.in-game .rotate-hint .rh-icon,
  body.chx-playing .rotate-hint .rh-icon,
  body.op-playing .rotate-hint .rh-icon,
  body.lor-playing .rotate-hint .rh-icon,
  body.swu-playing .rotate-hint .rh-icon { font-size: 56px; animation: rh-turn 1.6s ease-in-out infinite; }
}
@keyframes rh-turn { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
@media (prefers-reduced-motion: reduce) { .rotate-hint .rh-icon { animation: none; } }

/* Floating Combat & Sensory Popups (TRIBE v2) */
.floating-combat-pop {
  position: absolute;
  transform: translate(-50%, -50%) scale(1);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid #facc15;
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75);
  animation: fcp-rise 0.85s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}
.floating-combat-pop.fade-out {
  opacity: 0;
  transform: translate(-50%, -85px) scale(0.85);
  transition: opacity 0.35s ease-out, transform 0.35s ease-out;
}
@keyframes fcp-rise {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.6); }
  25% { opacity: 1; transform: translate(-50%, -20px) scale(1.15); }
  100% { opacity: 1; transform: translate(-50%, -45px) scale(1); }
}

/* ---------- celular deitado (paisagem baixa): partida e menus compactos ---------- */
.me-row { display: flex; align-items: flex-end; gap: 6px; }
.tools-toggle { display: none; }
.card-preview .pv-close { display: none; position: absolute; top: 6px; right: 6px; z-index: 10; width: 34px; height: 34px; min-width: 34px; min-height: 34px; border-radius: 50%; background: rgba(9, 13, 21, 0.9); }
.card-preview.pinned { pointer-events: auto; z-index: 25; }
.card-preview.pinned .pv-close { display: inline-grid; place-items: center; }
.pv-action-btn { width: 100%; margin: 8px 0 4px; min-height: 42px; font-weight: 700; }
@media (max-height: 600px) and (orientation: landscape) {
  /* topo */
  .hud-top { top: 6px; left: 8px; right: 8px; }
  .hud-left { gap: 4px; }
  .icon-btn { width: 40px; height: 40px; min-width: 40px; min-height: 40px; font-size: 16px; }
  .turn-info { padding: 6px 10px; font-size: 10.5px; letter-spacing: 0.1em; }
  .player-panel { gap: 8px; padding: 3px 10px 5px 3px; }
  .pp-avatar { width: 44px; height: 44px; }
  .pp-avatar .life-gem { font-size: 15px; min-width: 38px; bottom: -9px; padding: 0 6px; }
  .pp-info { min-width: 0; gap: 2px; }
  .pp-name { font-size: 12px; }
  .pp-stats { font-size: 11px; gap: 6px; }
  .player-panel.opp .pp-life, .opp-row .pp-life { display: none; }
  .opp-row.multi { left: auto; right: auto; }
  .phase-track { display: none; }
  .prompt-banner { top: 74px; font-size: 13px; padding: 6px 12px; max-width: 60vw; }
  .turn-banner { font-size: 30px; padding: 8px 0; letter-spacing: 0.2em; }
  /* base: avatar + ações nos cantos, o meio fica livre para a mão */
  .hud-bottom { left: 8px; right: 8px; bottom: 6px; gap: 6px; }
  .left-col { width: auto; gap: 6px; }
  .tools-toggle { display: inline-grid; place-items: center; }
  .toolbar { display: none; position: absolute; left: 0; bottom: 56px; width: 300px; grid-template-columns: repeat(3, 1fr); z-index: 8; background: rgba(18, 24, 36, 0.97); }
  .toolbar.open { display: grid; }
  .tool-btn { min-height: 40px; font-size: 12px; }
  .player-panel.me .pp-life { gap: 2px; }
  .player-panel.me .pp-name { display: none; }
  .life-btn { width: 40px; height: 40px; }
  .pp-stats .poison { min-width: 40px; min-height: 40px; }
  .action-stack { min-width: 0; width: 150px; gap: 6px; }
  .main-action { min-height: 46px; font-size: 12.5px; padding: 8px 8px; letter-spacing: 0.06em; white-space: nowrap; }
  .action-stack .btn.big { min-height: 40px; padding: 6px 10px; font-size: 13px; }
  .target-btns .btn { min-height: 40px; }
  /* painéis laterais não descem sobre a base */
  .stack-panel { top: 52px; width: 170px; padding: 8px; max-height: calc(100vh - 60px); overflow: auto; }
  .sp-fx { font-size: 12px; }
  .log-panel, .tracker-panel { top: 52px; bottom: 104px; width: min(320px, 45vw); } /* acima de "Próxima fase" */
  .card-preview:not(.pinned) { display: none; }
  .card-preview.pinned {
    display: flex; flex-direction: column; left: max(10px, env(safe-area-inset-left, 10px)); top: 50px;
    width: min(245px, 38vw); max-height: calc(100vh - 60px); padding: 8px;
    pointer-events: auto; z-index: 25;
  }
  .card-preview.pinned .card-stage { max-width: 165px; margin: 0 auto; }
  .toast { bottom: 64px; }
  /* modais: mão inicial e afins cabem sem rolar demais */
  .modal { max-height: 94vh; }
  .modal-head { padding: 8px 14px; }
  .modal-head h2 { font-size: 16px; }
  .modal-body { padding: 10px 14px; }
  .modal-actions { padding: 8px 14px; }
  .thumb-grid.hand-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(76px, 1fr); overflow-x: auto; }
  /* menu */
  .menu-nav nav button, .menu-nav nav a, .menu-nav .brand { min-height: 40px; }
  .ranked-toggle button, .profile-chip { min-height: 40px; }
}

/* ---------- login na nuvem e perfil (account.js) ---------- */
.google-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 44px; background: linear-gradient(180deg, var(--parch), var(--parch-2)); color: var(--ink); border-color: #000; box-shadow: inset 0 0 0 1px var(--brass), 0 2px 6px rgba(0, 0, 0, 0.4); font-weight: 700; }
.google-btn:hover:not(:disabled) { background: linear-gradient(180deg, #fffdea, var(--parch)); border-color: #000; }
.google-btn .g-mark { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: #1a73e8; font-weight: 800; font-family: var(--font-ui); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); }
.or-sep { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }
.link-btn { background: none; border: 0; padding: 4px 2px; min-height: 32px; color: var(--u-text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; }
.link-btn:hover { color: #b4dbf8; }
.avatar-pick { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px 0 14px; }
.avatar-lg { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex: none; border: 3px solid var(--brass); box-shadow: 0 0 0 1px #000, 0 0 14px rgba(201, 164, 92, 0.35); background: #121a28; }
.avatar-lg.empty { display: grid; place-items: center; font-size: 30px; color: var(--brass-hi); background: radial-gradient(circle at 50% 40%, #24365a, #0d1320); }
.avatar-sm { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 8px; border: 1px solid var(--brass); }
.profile-dash { display: flex; flex-direction: column; gap: 6px; }
.pd-head { display: flex; align-items: center; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.pd-name { display: block; font-family: var(--font-display); font-size: 25px; color: var(--parch); letter-spacing: 0.02em; }
.pd-bio { font-family: var(--font-serif); font-style: italic; font-size: 16px; color: #ddd6c0; margin: 6px 0 0; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 12px 0 4px; }
.stat-cards .stat { margin: 0; padding: 10px; border: 1px solid var(--line-strong); border-top: 3px solid var(--brass); border-radius: 7px; background: var(--tex), linear-gradient(180deg, var(--slate-hi), var(--slate-lo)); box-shadow: var(--bevel); text-align: center; min-width: 0; }
.stat-cards .stat:last-child { border-right: 1px solid var(--line-strong); }
.stat-cards .stat:nth-child(5n + 1) { border-top-color: var(--mana-w); }
.stat-cards .stat:nth-child(5n + 2) { border-top-color: var(--mana-g); }
.stat-cards .stat:nth-child(5n + 3) { border-top-color: var(--mana-r); }
.stat-cards .stat:nth-child(5n + 4) { border-top-color: var(--mana-u); }
.stat-cards .stat:nth-child(5n + 5) { border-top-color: #8a7690; }
.stat-cards .stat strong { display: block; font-family: var(--font-display); font-size: 24px; color: var(--parch); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-cards .stat span { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.fav-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; align-items: start; }
.fav-card { position: relative; border: 1px solid #000; border-radius: 8px; overflow: hidden; background: var(--panel-solid); box-shadow: 0 0 0 2px var(--brass-lo), var(--bevel); }
.fav-card img { width: 100%; aspect-ratio: 626 / 457; object-fit: cover; display: block; }
.fav-card span { display: block; padding: 6px 36px 6px 8px; font-family: var(--font-display); font-size: 14px; color: var(--ink); background: linear-gradient(180deg, var(--parch), var(--parch-2)); }
.fav-card .icon-btn { position: absolute; top: 4px; right: 4px; }
.card-pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; max-height: 50vh; overflow: auto; margin-top: 10px; padding: 2px; }
.card-pick-list > * { min-width: 0; }
.card-pick-list img { width: 100%; border-radius: 6px; display: block; }
.rank-table tbody th { white-space: nowrap; }

/* ---------- Aprender a jogar ---------- */
.learn-wrap { max-width: 1100px; margin: 0 auto; padding: 8px 16px 40px; display: flex; flex-direction: column; gap: 28px; }
.learn-wrap h2 { font-family: var(--font-display); color: var(--brass-hi); margin: 0 0 12px; }
.learn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.learn-card { text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; min-height: 110px; cursor: pointer;
  background: var(--slate); color: var(--text); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); box-shadow: var(--bevel); font: inherit; }
.learn-card strong { font-family: var(--font-display); font-size: 17px; color: var(--accent-text); }
.learn-card span { color: var(--muted); font-size: 14px; line-height: 1.4; }
.learn-card:hover, .learn-item:hover { border-color: var(--line-strong); }
.mana-w { --accent: var(--mana-w); --accent-text: var(--w-text); }
.mana-u { --accent: var(--mana-u); --accent-text: var(--u-text); }
.mana-b { --accent: #6b5a6e; --accent-text: var(--b-text); }
.mana-r { --accent: var(--mana-r); --accent-text: var(--r-text); }
.mana-g { --accent: var(--mana-g); --accent-text: var(--g-text); }
.mana-c { --accent: var(--mana-c); --accent-text: var(--text); }
.learn-layout { display: grid; grid-template-columns: 220px 1fr; gap: 16px; }
.learn-list { display: flex; flex-direction: column; gap: 6px; }
.learn-item { text-align: left; padding: 10px 12px; min-height: 40px; cursor: pointer; background: var(--slate-lo); color: var(--text);
  border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; font: inherit; }
.learn-detail { padding: 16px 20px; }
.learn-detail p { font-family: var(--font-serif); font-size: 18px; line-height: 1.5; color: var(--text); }
@media (max-width: 700px) { .learn-layout { grid-template-columns: 1fr; } }

/* ---------- treinador da partida guiada ---------- */
.coach { position: absolute; top: 76px; left: 16px; z-index: 40; width: min(340px, calc(100vw - 32px)); padding: 12px 14px;
  background: linear-gradient(180deg, var(--parch), var(--parch-2)); color: var(--ink); border: 2px solid var(--brass-lo);
  border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; line-height: 1.45; }
.coach-head { display: flex; justify-content: space-between; align-items: center; }
.coach-step { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #5a4520; font-weight: 700; }
.coach-title { display: block; font-family: var(--font-display); font-size: 18px; margin: 4px 0; color: var(--ink); }
.coach p { margin: 6px 0; }
.coach-wait { font-style: italic; color: #5a4520; }
.coach .icon-btn { color: var(--ink); }
.coach.min p, .coach.min .btn, .coach.min .coach-title { display: none; }
@media (max-height: 500px) and (orientation: landscape) {
  .coach { top: 48px; width: min(280px, 40vw); font-size: 12.5px; padding: 8px 10px; }
  .coach-title { font-size: 15px; }
}

/* ---------- Online (lobby, amigos, fila) ---------- */
.online-wrap { max-width: 1300px; margin: 0 auto; padding: 22px 26px 60px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.online-wrap .panel { padding: 18px 20px; }
.online-wrap h3 { margin: 18px 0 8px; font-size: 15px; color: var(--brass-hi); }
.online-login { grid-column: 1 / -1; max-width: 640px; margin: 40px auto; text-align: center; }
.ol-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ol-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; min-height: 48px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0, 0, 0, 0.22); }
.ol-row.on { border-color: rgba(0, 115, 62, 0.55); }
.ol-row .btn { min-height: 40px; min-width: 40px; }
.ol-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ol-who strong, .ol-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; border: 1px solid var(--line-strong); }
.ol-initial { display: grid; place-items: center; background: var(--panel-hi); color: var(--brass-hi); font-weight: 700; }
.ol-queue { display: grid; gap: 10px; }
.ol-queue .row { align-items: center; gap: 10px; }
.spinner.small { width: 22px; height: 22px; margin: 0; border-width: 3px; }
.ol-invite { display: flex; gap: 12px; align-items: center; }
.online-wrap input[type="search"] { width: 100%; min-height: 40px; }
@media (max-width: 1000px) { .online-wrap { grid-template-columns: 1fr; padding: 16px; } }
@media (max-height: 500px) and (orientation: landscape) {
  .online-wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px 14px 30px; gap: 12px; }
  .online-wrap .panel { padding: 12px; }
}

/* =========================================================================
   Cartas especiais: foil / etched / impressão especial + inclinação 3D no hover
   (js/ui/holo.js). --mx/--my = posição do ponteiro; --rx/--ry = inclinação.
   ========================================================================= */
:root {
  --holo-rainbow: linear-gradient(115deg, transparent 18%, rgba(255, 70, 120, 0.55) 30%, rgba(255, 210, 70, 0.55) 38%,
    rgba(90, 255, 160, 0.55) 46%, rgba(70, 190, 255, 0.55) 54%, rgba(190, 110, 255, 0.55) 62%, transparent 76%);
  --holo-metal: linear-gradient(115deg, transparent 25%, rgba(239, 215, 156, 0.5) 45%, rgba(255, 255, 255, 0.55) 50%, rgba(201, 164, 92, 0.45) 56%, transparent 75%);
}
.holo-tilt { touch-action: pan-y; transform-style: preserve-3d; will-change: auto; }
.holo-tilt.tilting {
  transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-4px) scale(1.06);
  z-index: 3; box-shadow: 0 18px 34px rgba(0, 0, 0, 0.65), var(--glow-brass);
  transition: transform 0.08s linear, box-shadow 0.15s;
}
.rcard.holo-tilt { transition: transform 0.25s ease-out; }
.thumb.holo-tilt { transition: transform 0.25s ease-out, border-color 0.12s, box-shadow 0.15s; }
.holo-tilt:focus-visible, .holo-tilt:focus-within { box-shadow: 0 0 0 3px var(--brass-hi), 0 14px 28px rgba(0, 0, 0, 0.6); }
.rcard.foil, .rcard.special, .sp-wrap { overflow: hidden; border-radius: 11px; }
.sp-wrap { position: relative; display: block; }

.foil::after, .special::after, .cs-card.foil .cs-shine, .cs-card.special .cs-shine {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 1;
  background: var(--holo-rainbow);
  background-size: 260% 260%;
  background-position: var(--mx, 50%) var(--my, 50%);
  mix-blend-mode: color-dodge; opacity: 0.75;
  animation: holoShift 6s linear infinite;
}
.foil.etched::after, .cs-card.etched .cs-shine { background-image: var(--holo-metal); mix-blend-mode: overlay; opacity: 0.8; }
.special:not(.foil)::after, .cs-card.special:not(.foil) .cs-shine { mix-blend-mode: overlay; opacity: 0.35; animation-duration: 10s; }
.tilting.foil::after, .tilting.special::after { animation: none; }
@keyframes holoShift { 0% { background-position: 0% 30%; } 50% { background-position: 100% 70%; } 100% { background-position: 0% 30%; } }

.print-badge {
  position: absolute; right: 8px; top: 8px; z-index: 2; pointer-events: none;
  background: linear-gradient(135deg, var(--brass-hi), var(--brass)); color: var(--ink);
  font-size: 10px; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.print-badge.inline { position: static; display: inline-block; margin-right: 6px; }
.print-tags { margin: 4px 0; }
.foil-toggle.on { color: var(--ink); background: linear-gradient(135deg, #ff9ad5, #ffe27a, #8dffc8, #8ad3ff); }

/* ---- carta expandida (estilo Marvel Snap): camadas com parallax ---- */
.card-stage { position: relative; perspective: 900px; touch-action: none; outline: none; padding: 6px; }
.card-stage .cs-bg {
  position: absolute; inset: 8% -4%; border-radius: 22px; background-size: cover; background-position: center;
  filter: blur(18px) saturate(1.3); opacity: 0.55; z-index: 0;
  transform: translate(var(--px, 0), var(--py, 0)) scale(1.15); transition: transform 0.12s ease-out;
}
.card-stage .cs-card {
  position: relative; z-index: 1; border-radius: 4.6% / 3.4%; overflow: hidden; transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.12s ease-out; box-shadow: 0 22px 40px rgba(0, 0, 0, 0.6);
}
.card-stage .cs-img { width: 100%; display: block; }
.card-stage .cs-pop {
  /* janela da arte destacada (full art/sem borda/showcase): sai da carta e anda com o ponteiro */
  position: absolute; left: 6%; right: 6%; top: 9%; height: 46%; background-size: cover; background-position: center;
  transform: translate3d(calc(var(--px, 0) * -0.6), calc(var(--py, 0) * -0.6), 30px);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 55%, transparent 78%); mask-image: radial-gradient(ellipse at center, #000 55%, transparent 78%);
  opacity: 0; transition: opacity 0.2s, transform 0.12s ease-out; pointer-events: none;
}
.card-stage.deep.active .cs-pop { opacity: 0.9; }
.card-stage .cs-shine { position: absolute; inset: 0; pointer-events: none; transform: translateZ(1px); }
.card-stage:focus-visible .cs-card { box-shadow: 0 0 0 3px var(--brass-hi), 0 22px 40px rgba(0, 0, 0, 0.6); }
.card-preview .card-stage { padding: 0; }

@media (prefers-reduced-motion: reduce) {
  .foil::after, .special::after, .cs-shine { animation: none !important; }
  .holo-tilt.tilting { transform: translateY(-3px); }
  .card-stage .cs-card, .card-stage .cs-bg, .card-stage .cs-pop { transform: none !important; }
}
.holo-tilt .thumb-tools, .holo-tilt .thumb-label, .holo-tilt .in-deck, .holo-tilt .add-btn, .holo-tilt .open { z-index: 2; }

/* =========================================================================
   Celular em pé = cara de APLICATIVO (js/ui/mobileShell.js)
   Barra superior compacta, abas inferiores, gaveta e folhas inferiores.
   Tudo vale só com body.m-app (posto pelo JS até 760 px e fora da partida),
   então o desktop e a mesa de jogo ficam exatamente como estavam.
   ========================================================================= */
.m-topbar, .m-tabbar, .m-browse-tools { display: none; }
.m-ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }
.m-icon-btn { width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center; background: none; border: 0; border-radius: 10px; color: var(--parch); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.m-icon-btn:active, .m-icon-btn.on { background: rgba(255, 255, 255, 0.07); }

/* folhas inferiores e gaveta lateral (abrem só no celular) */
.m-sheet-root { position: fixed; inset: 0; z-index: 55; }
.m-scrim { position: absolute; inset: 0; background: rgba(5, 8, 14, 0.62); opacity: 0; transition: opacity 0.2s; }
.m-sheet-root.open .m-scrim { opacity: 1; }
.m-sheet { position: absolute; display: flex; flex-direction: column; background: var(--tex), linear-gradient(180deg, var(--slate-hi), var(--slate-lo)); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.3, 1); outline: none; }
.m-sheet.bottom { left: 0; right: 0; bottom: 0; max-height: 86vh; max-height: 86dvh; border-radius: 16px 16px 0 0; border-bottom: 0; transform: translateY(100%); padding-bottom: env(safe-area-inset-bottom, 0px); }
.m-sheet.left { top: 0; bottom: 0; left: 0; width: min(320px, 86vw); border-radius: 0 16px 16px 0; border-left: 0; transform: translateX(-100%);
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
.m-sheet-root.open .m-sheet { transform: none; }
.m-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 8px auto 0; flex: none; }
.m-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 6px 16px; border-bottom: 1px solid var(--line); flex: none; }
.m-sheet-head h2 { margin: 0; font-size: 19px; color: var(--parch); }
.m-sheet-body { overflow: auto; padding: 12px 16px 16px; flex: 1; overscroll-behavior: contain; }
.m-sheet-foot { padding: 10px 16px; border-top: 1px solid var(--line); flex: none; }
.m-sheet-foot .btn { width: 100%; min-height: 48px; }
.m-sheet .filters { display: flex; border: 0; background: none; padding: 0; max-height: none; overflow: visible; }
.m-sheet .filters select, .m-sheet .filters input { min-height: 44px; }
.m-sheet .color-btn { width: 44px; height: 44px; }
.m-sheet .filters > label.field:first-child { display: none; } /* o nome já fica à vista acima da grade */
.m-sheet:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: -2px; }

/* gaveta (☰) */
.m-drawer-profile { display: flex; gap: 12px; align-items: center; padding: 2px 0 14px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.m-drawer-profile strong { display: block; font-family: var(--font-display); font-size: 17px; color: var(--parch); }
.m-drawer-profile small, .m-di-txt small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.m-drawer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.m-drawer-item { width: 100%; display: flex; align-items: center; gap: 14px; padding: 8px 10px; min-height: 56px; background: none; border: 0; border-radius: 10px; text-align: left; cursor: pointer; color: var(--text); -webkit-tap-highlight-color: transparent; }
.m-drawer-item:active, .m-drawer-item[aria-current] { background: rgba(255, 255, 255, 0.06); }
.m-drawer-item[aria-current] { box-shadow: inset 3px 0 0 var(--accent); }
.m-di-ico { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; color: var(--accent-text); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.m-di-txt strong { display: block; font-weight: 600; font-size: 15px; color: var(--parch); }
.m-avatar.big { width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--brass); color: var(--brass-hi);
  font-family: var(--font-display); font-size: 22px; background: radial-gradient(circle at 50% 40%, #24365a, #0d1320); }

@media (max-width: 760px) {
  body.m-app { --m-top: calc(52px + env(safe-area-inset-top, 0px)); --m-bot: calc(62px + env(safe-area-inset-bottom, 0px)); }
  body.m-app .screen { top: var(--m-top); bottom: var(--m-bot); }
  body.m-app .menu-nav { display: none; }

  /* barra superior */
  body.m-app .m-topbar { display: flex; align-items: center; gap: 2px; position: fixed; top: 0; left: 0; right: 0; z-index: 30; height: var(--m-top);
    padding: env(safe-area-inset-top, 0px) max(6px, env(safe-area-inset-right, 0px)) 0 max(6px, env(safe-area-inset-left, 0px));
    background: linear-gradient(180deg, rgba(22, 29, 43, 0.97), rgba(14, 20, 32, 0.96)); border-bottom: 1px solid var(--line-strong); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35); }
  .m-brand { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 6px; background: none; border: 0; cursor: pointer; font-size: 17px; letter-spacing: 0.1em; min-width: 0; white-space: nowrap; }
  .m-brand .brand-mark i { width: 7px; height: 7px; }
  .m-top-end { margin-left: auto; display: flex; align-items: center; }
  .m-top-end .m-avatar { width: 44px; height: 44px; padding: 4px; background: none; border: 0; cursor: pointer; display: grid; place-items: center; }
  .m-top-end .m-avatar > img, .m-top-end .m-avatar > span { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: grid; place-items: center;
    border: 2px solid var(--brass); color: var(--brass-hi); font-weight: 700; background: radial-gradient(circle at 50% 40%, #24365a, #0d1320); }
  .m-top-end .m-login { margin-right: 4px; }

  /* barra inferior de abas */
  body.m-app .m-tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: var(--m-bot);
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    background: linear-gradient(180deg, rgba(18, 24, 36, 0.98), rgba(9, 13, 21, 0.99)); border-top: 1px solid var(--line-strong); box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.35); }
  .m-tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; min-width: 0; padding: 6px 2px 4px;
    background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; -webkit-tap-highlight-color: transparent; }
  .m-tab-ico { display: grid; place-items: center; width: 54px; height: 28px; border-radius: 14px; transition: background 0.15s; }
  .m-tab-label { white-space: nowrap; }
  .m-tab.on { color: var(--accent-text); }
  .m-tab.on .m-tab-ico { background: rgba(255, 255, 255, 0.08); background: color-mix(in srgb, var(--accent) 30%, transparent); }
  .m-tab.on .m-ico { stroke-width: 2.2; }
  .m-tab.on::before { content: ""; position: absolute; top: 0; left: 26%; right: 26%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
  .m-tab.mana-c.on::before { background: var(--brass); }
  .m-tab:focus-visible { outline-offset: -4px; }
  body.m-app .toast { bottom: calc(var(--m-bot) + 16px); }

  /* cabeçalho das telas: sem "⟵ Menu" (as abas fazem isso), compacto */
  body.m-app .screen-head { padding: 6px 16px; gap: 10px; min-height: 52px; }
  body.m-app .screen-head > .btn:first-child { display: none; }
  body.m-app .screen-head h1 { font-size: 20px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.m-app .screen-head .btn { padding: 6px 12px; font-size: 13px; flex: none; }
  body.m-app .screen-head .profile-chip { max-width: 45vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

  /* início */
  body.m-app .hero { padding: 16px 16px 4px; gap: 16px; }
  body.m-app .hero > div > .eyebrow { display: none; }
  body.m-app .hero-title { display: none; } /* a marca já está na barra superior */
  body.m-app .hero-sub { font-family: var(--font-display); font-style: normal; color: var(--parch); }
  body.m-app .feature-art { aspect-ratio: 16 / 9; }
  body.m-app .hero-sub { font-size: 18px; margin: 0 0 4px; }
  body.m-app .hero-text { font-size: 15px; line-height: 1.45; margin: 4px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  body.m-app .hero-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
  body.m-app .hero-cta .btn { width: 100%; padding: 10px 12px; font-size: 14px; }
  body.m-app .hero-cta .btn:nth-child(3) { grid-column: 1 / -1; }
  body.m-app .stats-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; }
  body.m-app .stats-strip .stat { padding: 10px 6px 0 0; margin: 0; border-right: 0; min-width: 0; }
  body.m-app .stats-strip .stat b { font-size: 20px; }
  body.m-app .stats-strip .stat span { font-size: 11px; letter-spacing: 0.08em; }
  body.m-app .btn.small, body.m-app .btn.tiny { min-height: 40px; }
  body.m-app select, body.m-app input[type="text"], body.m-app input[type="search"], body.m-app input[type="number"], body.m-app input[type="email"], body.m-app input[type="password"] { min-height: 44px; font-size: 16px; } /* 16px: o iPhone não dá zoom ao focar */
  body.m-app input[type="email"], body.m-app input[type="password"] { background: #0b111c; border: 1px solid #7d6538; color: var(--text); border-radius: 6px; padding: 9px 11px; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6); }
  body.m-app .link-btn { min-height: 44px; }
  body.m-app .feature-body .oracle { max-height: 72px; font-size: 14px; }
  body.m-app .menu-section { padding: 12px 16px; }
  body.m-app .section-head { margin-bottom: 10px; }
  body.m-app .section-head h2 { font-size: 19px; }
  body.m-app .quick-grid, body.m-app .deck-tiles, body.m-app .learn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.m-app .quick-card { padding: 12px; min-height: 0; }
  body.m-app .quick-card .qc-icon { width: 34px; height: 34px; font-size: 17px; }
  body.m-app .quick-card strong { font-size: 15px; margin: 8px 0 2px; line-height: 1.2; }
  body.m-app .quick-card span { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  body.m-app .deck-tile { min-height: 0; }
  body.m-app .dt-art { height: 84px; }
  body.m-app .dt-body { padding: 4px 10px 10px; }
  body.m-app .dt-body strong { font-size: 14px; overflow-wrap: anywhere; }
  body.m-app .menu-footer { padding: 16px; }

  /* preparação (Jogar) */
  body.m-app .setup-wrap { padding: 12px 16px 24px; gap: 12px; }
  body.m-app .setup-col, body.m-app .setup-bottom { padding: 14px; }
  body.m-app .setup-wrap h2 { font-size: 19px; }
  body.m-app .setup-col > .row.wrap { flex-direction: column; align-items: stretch; gap: 0; }
  body.m-app .chosen { gap: 10px; min-height: 0; padding: 8px; }
  body.m-app .chosen .dt-art { width: 84px; height: 52px; }
  body.m-app .chosen strong { font-size: 15px; overflow-wrap: anywhere; }
  body.m-app .ranked-toggle { width: 100%; }
  body.m-app .ranked-toggle button { flex: 1; min-height: 44px; }
  body.m-app .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  body.m-app .theme-card .tc-sw { height: 72px; }
  body.m-app .setup-bottom > .btn.primary { width: 100%; }

  /* abas internas → faixa de chips rolável; bracket idem */
  body.m-app .picker-tabs { flex-wrap: nowrap; overflow-x: auto; gap: 8px; border-bottom: 0; padding: 2px 2px 8px; margin-bottom: 8px; scroll-snap-type: x proximity; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  body.m-app .picker-tabs::-webkit-scrollbar, body.m-app .chip-list::-webkit-scrollbar { display: none; }
  body.m-app .picker-tabs .tab { flex: none; scroll-snap-align: start; white-space: nowrap; min-height: 44px; padding: 8px 14px; font-size: 13.5px;
    border: 1px solid var(--line-strong); border-radius: 99px; background: rgba(0, 0, 0, 0.25); }
  body.m-app .picker-tabs .tab.on { color: var(--parch); border-color: var(--accent); background: rgba(201, 164, 92, 0.16); background: color-mix(in srgb, var(--accent) 24%, transparent); }
  body.m-app .picker-tabs .tab:last-child { margin-right: 24px; }
  body.m-app .chip-list { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; padding-bottom: 2px; }
  body.m-app .chip { flex: none; white-space: nowrap; min-height: 44px; }
  body.m-app .picker-tools { gap: 8px; }
  body.m-app .picker-tools input[type="search"] { flex: 1 1 100%; min-width: 0; min-height: 44px; }
  body.m-app .picker-tools select { flex: 1 1 auto; min-height: 44px; }
  body.m-app .picker-grid { max-height: none; overflow: visible; padding: 2px; }

  /* modais viram folha inferior */
  body.m-app .modal-backdrop { place-items: end stretch; grid-template-columns: minmax(0, 1fr); }
  body.m-app .modal, body.m-app .modal.wide { width: 100%; max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px - env(safe-area-inset-top, 0px));
    border-radius: 16px 16px 0 0; animation: m-up 0.22s ease-out; }
  body.m-app .modal-head { padding: 8px 8px 8px 14px; gap: 8px; }
  body.m-app .modal-head h2 { font-size: 18px; min-width: 0; overflow-wrap: anywhere; }
  body.m-app .modal-body { padding: 12px 16px; }
  body.m-app .modal-actions { flex-wrap: wrap; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); }
  body.m-app .modal-actions .btn { flex: 1 1 auto; }
  body.m-app .card-detail { gap: 14px; }
  body.m-app .help-table tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); }
  body.m-app .help-table th, body.m-app .help-table td { display: block; padding: 2px 0; border: 0; white-space: normal; }
  body.m-app .card-detail > div:first-child { width: 100%; max-width: 240px; margin: 0 auto; }

  /* cartas: busca à vista + botão Filtros (folha) */
  body.m-app .browser, body.m-app .browser.embedded { display: block; min-height: 0; }
  body.m-app .browser.embedded { border: 0; border-radius: 0; margin-top: 8px; overflow: visible; }
  body.m-app .browser > .filters { display: none; }
  body.m-app .results { padding: 12px 16px 20px; overflow: visible; }
  body.m-app .browser.embedded .results { padding: 0; }
  body.m-app .results-head { gap: 4px 10px; margin-bottom: 10px; }
  body.m-app .results-head h2 { font-size: 18px; }
  body.m-app .m-browse-tools { display: flex; gap: 8px; margin: 0 0 12px; }
  body.m-app .m-search { flex: 1; min-width: 0; min-height: 44px; }
  body.m-app .m-filters-btn { flex: none; min-height: 44px; }
  body.m-app .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.m-app .rcard .add-btn { opacity: 1; }

  /* decks */
  body.m-app .deck-layout { min-height: 0; }
  body.m-app .deck-side { padding: 12px 16px; max-height: 260px; }
  body.m-app .deck-editor { padding: 12px 16px 24px; }
  body.m-app .deck-editor > .row:first-child { flex-wrap: wrap; }
  body.m-app .deck-name { flex: 1 1 100%; min-width: 0; font-size: 19px; }
  body.m-app .deck-editor .row.wrap > .spacer { display: none; }
  body.m-app .deck-text { min-height: 160px; }
  body.m-app .curve { max-width: 100%; }

  /* ranking: tabela enxuta (esconde Derrotas e Partidas) */
  body.m-app .ranking-wrap { margin: 12px 16px; padding: 14px; }
  body.m-app .rank-table th, body.m-app .rank-table td { padding: 8px 6px; }
  body.m-app .rank-table th:nth-child(n + 5), body.m-app .rank-table td:nth-child(n + 5) { display: none; }
  body.m-app .rank-table tbody th { white-space: normal; overflow-wrap: anywhere; }

  /* aprender e online */
  body.m-app .learn-wrap { padding: 12px 16px 24px; gap: 20px; }
  body.m-app .learn-card { padding: 12px; min-height: 0; }
  body.m-app .learn-card strong { font-size: 15px; }
  body.m-app .learn-card span { font-size: 13px; }
  body.m-app .online-wrap { padding: 12px 16px 24px; gap: 12px; }
  body.m-app .online-wrap .panel { padding: 14px; }
  body.m-app .online-login { margin: 12px 0; }
}
/* celular pequeno deitado (fora da partida): barras mais baixas */
@media (max-width: 760px) and (max-height: 500px) {
  body.m-app { --m-top: calc(44px + env(safe-area-inset-top, 0px)); --m-bot: calc(48px + env(safe-area-inset-bottom, 0px)); }
  .m-tab { flex-direction: row; gap: 6px; min-height: 44px; }
  .m-tab-ico { width: auto; height: auto; background: none !important; }
}
@keyframes m-up { from { transform: translateY(32px); opacity: 0.6; } }

/* =========================================================================
   Módulo privado de pirâmide (js/games/chaotic) — visual neutro, sem marca
   ========================================================================= */
.chaotic-screen { --accent: var(--b-text); --accent-text: var(--b-text); }
.chaotic-screen .menu-shell { min-height: 0; }
.chx-wrap { padding: 16px 26px 32px; max-width: 1400px; margin: 0 auto; }
.chx-loading { display: grid; place-items: center; gap: 12px; padding: 60px 0; }
.chx-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.chx-head h1 { margin: 0; font-size: 26px; color: var(--parch); }
.chx-badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.chx-badge.warn { color: #ffd28a; border-color: #b8862c; }
.chx-content { margin-top: 14px; }
.chx-setup { max-width: 820px; }
.chx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.chx-grid select, .chx-filters select, .chx-filters input, .chx-hand select, .chx-editor input, .chx-editor select {
  min-height: 40px; background: var(--slate-lo); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font: inherit; }
.chx-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chx-filters input { flex: 1 1 220px; min-width: 0; }
.chx-results { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.chx-card { display: flex; gap: 6px; align-items: stretch; background: var(--panel-solid); border: 1px solid var(--line); border-left: 4px solid var(--brass-lo); border-radius: 8px; }
.chx-card.t-creature { border-left-color: #6d8fd6; } .chx-card.t-attack { border-left-color: #c2564a; }
.chx-card.t-mugic { border-left-color: #a77bd1; } .chx-card.t-location { border-left-color: #5aa37a; }
.chx-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; background: none; border: 0; padding: 8px 10px; cursor: pointer; }
.chx-card-main span { font-size: 12.5px; overflow-wrap: anywhere; }
.chx-card > .btn { align-self: center; margin-right: 8px; min-width: 40px; min-height: 40px; }
.chx-type { color: var(--accent-text); }
.chx-ability { font-family: var(--font-serif); font-size: 17px; white-space: pre-wrap; }
.chx-builder { display: grid; grid-template-columns: 220px minmax(280px, 1fr) minmax(320px, 1.3fr); gap: 16px; align-items: start; }
.chx-decklist { display: flex; flex-direction: column; gap: 6px; }
.chx-deck-btn { text-align: left; display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--slate-lo); cursor: pointer; }
.chx-deck-btn.on { border-color: var(--brass); box-shadow: var(--glow-brass); }
.chx-editor .deck-name { flex: 1 1 200px; }
.chx-valid { margin: 10px 0; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); }
.chx-valid.ok { border-color: #3fa66b; } .chx-valid.bad { border-color: #b3402f; }
.chx-valid ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.chx-sec ul { list-style: none; margin: 0; padding: 0; }
.chx-sec li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 14px; }
.chx-pool .chx-results { grid-template-columns: 1fr; max-height: 70vh; overflow: auto; }
/* partida */
.chx-match { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; height: calc(100vh - 150px); min-height: 420px; }
.chx-stage { position: relative; min-height: 300px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #0b0f18; }
.chx-canvas { display: block; width: 100%; height: 100%; touch-action: manipulation; }
.chx-side { overflow: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.chx-status { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; background: var(--panel-solid); border: 1px solid var(--line); }
.chx-status strong { font-size: 17px; color: var(--parch); }
.chx-combat { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; border: 1px solid #7a4a2a; background: rgba(122, 74, 42, 0.18); }
.chx-hand { display: flex; flex-direction: column; gap: 6px; }
.chx-hand h3 { margin: 4px 0 0; }
.chx-atk { display: flex; flex-direction: column; align-items: flex-start; text-transform: none; letter-spacing: 0; font-family: var(--font-ui); text-align: left; }
.chx-atk small { font-weight: 400; font-size: 12px; color: var(--muted); }
.chx-mini { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.chx-mini-row { display: flex; gap: 4px; }
.chx-cell { width: 64px; min-height: 44px; border-radius: 8px; border: 1px solid var(--line); background: var(--slate-lo); font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 2px; }
.chx-cell span { display: flex; flex-direction: column; line-height: 1.1; }
.chx-cell.mine { background: #1d2d4a; } .chx-cell.foe { background: #3a2230; }
.chx-cell.target { outline: 2px solid #3fa66b; } .chx-cell.foe.target { outline-color: #e0563f; }
.chx-cell.sel { box-shadow: 0 0 0 2px var(--brass); }
.chx-log ol { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--muted); max-height: 220px; overflow: auto; }
.chx-learn { max-width: 820px; } .chx-learn li { margin: 6px 0; }
@media (max-width: 1100px) { .chx-builder { grid-template-columns: 1fr 1fr; } .chx-decklist { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; } }
@media (max-width: 760px) {
  .chx-wrap { padding: 12px 16px 24px; }
  .chx-builder { grid-template-columns: 1fr; }
  .chx-match { grid-template-columns: 1fr; height: auto; }
  .chx-stage { height: 52vh; }
}
/* celular deitado: mesa à esquerda, painel à direita, tudo na altura da tela */
@media (max-height: 500px) and (orientation: landscape) {
  .chx-wrap { padding: 6px 10px; }
  body.chx-playing .chaotic-screen .menu-shell, body.chx-playing .chx-head { display: none; }
  .chx-match { grid-template-columns: minmax(0, 1fr) 280px; height: calc(100vh - 16px); min-height: 0; }
  .chx-stage { height: auto; }
  .chx-cell { width: 52px; min-height: 36px; }
}

/* Chaotic: imagens reais das cartas (imgur) + carta desenhada de reserva com selo "sem imagem" */
.chx-thumb { display: block; flex: none; border-radius: 6px; object-fit: cover; background: #10151f; }
.chx-thumb-sm { width: 50px; height: 70px; }
.chx-thumb-md { width: 125px; height: 175px; }
.chx-thumb-lg { width: 250px; height: 350px; }
.chx-drawn { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 4px; border: 2px solid var(--brass-lo); overflow: hidden; }
.chx-drawn.t-creature { border-color: #6d8fd6; } .chx-drawn.t-attack { border-color: #c2564a; }
.chx-drawn.t-mugic { border-color: #a77bd1; } .chx-drawn.t-location { border-color: #5aa37a; }
.chx-drawn-name { font-size: 11px; line-height: 1.15; color: var(--parch); overflow-wrap: anywhere; }
.chx-thumb-sm .chx-drawn-name { font-size: 8px; }
.chx-thumb-lg .chx-drawn-name { font-size: 20px; }
.chx-noimg { align-self: flex-start; font-size: 9px; padding: 1px 4px; border-radius: 4px; background: rgba(0, 0, 0, 0.6); color: #ffd28a; }
.chx-back { display: grid; place-items: center; font-weight: 700; color: var(--brass); background: #1d2740; border: 2px solid var(--brass-lo); }
.chx-card-main { flex-direction: row; align-items: flex-start; gap: 10px; }
.chx-card-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chx-results { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.chx-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.chx-detail-img { display: flex; justify-content: center; margin-bottom: 10px; }
.chx-detail-img .card-stage { width: min(300px, 80vw); }
.chx-atk { flex-direction: row; align-items: center; gap: 8px; min-width: 0; white-space: normal; }
.chx-atk .chx-card-txt, .chx-fighter > span { min-width: 0; overflow-wrap: anywhere; }
.chx-sec-card { display: inline-flex; align-items: center; gap: 8px; }
.chx-sec-card .chx-thumb-sm { width: 30px; height: 42px; }
.chx-loc, .chx-gear { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; color: inherit; text-align: left; cursor: pointer; }
.chx-fighter { display: flex; align-items: center; gap: 8px; }
.chx-mugic-row { display: flex; align-items: center; gap: 8px; }
.chx-mugic-row select { flex: 1; min-width: 0; }

/* ===== One Piece (privado): js/games/onepiece ===== */
.onepiece-screen { --accent: var(--r-text, #e7826f); --accent-text: var(--r-text, #e7826f); }
.onepiece-screen .menu-shell { min-height: 0; }
.op-wrap { padding: 16px 26px 32px; max-width: 1400px; margin: 0 auto; }
.op-loading { display: grid; place-items: center; gap: 12px; padding: 60px 0; }
.op-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.op-head h1 { margin: 0; font-size: 26px; color: var(--parch); }
.op-badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.op-badge.warn { color: #ffd28a; border-color: #b8862c; }
.op-notice { font-size: 12px; color: var(--muted); margin: 6px 0 10px; }
.op-content { margin-top: 14px; }
.op-setup, .op-learn { max-width: 820px; } .op-learn li { margin: 6px 0; }
.op-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.op-grid select, .op-filters select, .op-filters input, .op-editor input, .op-wrap textarea {
  min-height: 40px; background: var(--slate-lo); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font: inherit; }
.op-wrap textarea, .modal textarea { width: 100%; }
.op-urls { font-size: 12px; overflow-wrap: anywhere; }
.op-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.op-filters input { flex: 1 1 180px; min-width: 0; }
.op-results { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.op-card { display: flex; align-items: center; gap: 6px; background: var(--panel-solid); border: 1px solid var(--line); border-left: 4px solid var(--brass-lo); border-radius: 8px; }
.op-card.c-Red { border-left-color: #c8402f; } .op-card.c-Green { border-left-color: #2f8f5a; } .op-card.c-Blue { border-left-color: #2f6fc8; }
.op-card.c-Purple { border-left-color: #7d4bb8; } .op-card.c-Black { border-left-color: #6b6b78; } .op-card.c-Yellow { border-left-color: #d4b22c; }
.op-card > .btn { margin-right: 8px; min-width: 40px; min-height: 40px; }
.op-card-main { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 10px; text-align: left; background: none; border: 0; padding: 8px; color: inherit; cursor: pointer; }
.op-card-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.op-thumb { display: block; flex: none; border-radius: 6px; object-fit: cover; background: #10151f; }
.op-thumb-xs { width: 30px; height: 42px; } .op-thumb-sm { width: 50px; height: 70px; } .op-thumb-md { width: 110px; height: 154px; }
.op-thumb-hand { width: 84px; height: 117px; }
.op-noimg { display: grid; place-items: center; font-size: 10px; padding: 4px; text-align: center; color: var(--muted); border: 1px solid var(--line); }
.op-detail-img { display: flex; justify-content: center; margin-bottom: 10px; }
.op-detail-img .card-stage { width: min(300px, 80vw); }
.op-text { font-family: var(--font-serif); font-size: 16px; white-space: pre-wrap; }
.op-variants { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.op-builder { display: grid; grid-template-columns: 220px minmax(280px, 1fr) minmax(320px, 1.3fr); gap: 16px; align-items: start; }
.op-decklist { display: flex; flex-direction: column; gap: 6px; }
.op-deck-btn { text-align: left; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--slate-lo); color: inherit; cursor: pointer; }
.op-deck-btn.on { border-color: var(--brass); box-shadow: var(--glow-brass); }
.op-editor .deck-name { flex: 1 1 200px; }
.op-valid { margin: 10px 0; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); }
.op-valid.ok { border-color: #3fa66b; } .op-valid.bad { border-color: #b3402f; }
.op-valid ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.op-deckcards { list-style: none; margin: 0; padding: 0; }
.op-deckcards li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 14px; }
.op-sec-card { display: inline-flex; align-items: center; gap: 8px; }
.op-pool .op-results { grid-template-columns: 1fr; max-height: 70vh; overflow: auto; }
/* partida */
.op-match { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; height: calc(100vh - 150px); min-height: 460px; }
.op-left { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
.op-stage { position: relative; flex: 1; min-height: 280px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #0b0f18; }
.op-canvas { display: block; width: 100%; height: 100%; touch-action: manipulation; }
.op-hand { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; min-height: 120px; }
.op-hcard { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; opacity: 0.75; }
.op-hcard.can { opacity: 1; } .op-hcard.can .op-thumb { box-shadow: 0 0 0 2px #3fa66b; }
.op-hcard-img { background: none; border: 0; padding: 0; cursor: zoom-in; }
.op-side { overflow: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.op-status, .op-battle, .op-actions { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 8px; background: var(--panel-solid); border: 1px solid var(--line); }
.op-status strong { font-size: 17px; color: var(--parch); }
.op-battle { border-color: #7a4a2a; background: rgba(122, 74, 42, 0.18); }
.op-trig { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.op-mine { display: flex; flex-wrap: wrap; gap: 4px; } .op-mine .btn.on { border-color: var(--brass); box-shadow: var(--glow-brass); }
.btn.danger { border-color: #b3402f; }
.op-log ol, .op-log ul { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--muted); max-height: 220px; overflow: auto; }
@media (max-width: 1100px) { .op-builder { grid-template-columns: 1fr 1fr; } .op-decklist { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; } }
@media (max-width: 760px) {
  .op-wrap { padding: 12px 16px 24px; }
  .op-builder { grid-template-columns: 1fr; }
  .op-match { grid-template-columns: 1fr; height: auto; }
  .op-stage { height: 50vh; flex: none; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .op-wrap { padding: 6px 10px; }
  body.op-playing .onepiece-screen .menu-shell, body.op-playing .op-head, body.op-playing .op-notice { display: none; }
  .op-match { grid-template-columns: minmax(0, 1fr) 280px; height: calc(100vh - 16px); min-height: 0; }
  .op-hand { min-height: 0; } .op-thumb-hand { width: 52px; height: 72px; }
}/* One Piece: seletor de decks e aulas */
.op-playbar { margin-bottom: 10px; } .op-playbar select { min-height: 40px; background: var(--slate-lo); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.op-deckgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; margin-top: 10px; }
.op-deckcard { display: flex; gap: 12px; padding: 10px; border-radius: 10px; background: var(--panel-solid); border: 1px solid var(--line); }
.op-deckcard.off { opacity: 0.7; }
.op-deckcover { background: none; border: 0; padding: 0; cursor: zoom-in; flex: none; }
.op-deckinfo { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 13.5px; }
.op-deckinfo p { margin: 2px 0; }
.op-src { overflow-wrap: anywhere; font-size: 11px; }
.op-warn { color: #ffd28a; }
.op-lessons { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.op-lesson { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-solid); }
.op-lesson summary { cursor: pointer; font-weight: 600; }
.op-match { position: relative; }
@media (max-width: 760px) { .op-deckgrid { grid-template-columns: 1fr; } }
/* Chaotic: seletor de decks em abas, aviso "nunca jogou" e treinador da partida guiada */
.chx-learn-cta { margin-left: auto; }
.chx-newbie { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; padding: 10px 14px; }
.chx-picker { margin-top: 14px; }
.chx-deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 10px; }
.chx-span { grid-column: 1 / -1; margin: 0; }
.chx-deck-card { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-solid); min-width: 0; }
.chx-dc-art { flex: 0 0 90px; }
.chx-dc-art .chx-thumb { width: 90px; height: auto; border-radius: 6px; }
.chx-dc-art.noart { display: none; }
.chx-dc-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.chx-dc-body p { margin: 0; font-size: 13px; }
.chx-dc-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.chx-badge.diff-easy { color: #9be29b; border-color: #3f8a3f; }
.chx-badge.diff-mid { color: #ffd28a; border-color: #b8862c; }
.chx-badge.diff-hard { color: #ff9f9f; border-color: #a94444; }
.chx-subs summary { cursor: pointer; font-size: 12.5px; color: #ffd28a; }
.chx-subs ul { margin: 4px 0; padding-left: 18px; font-size: 12px; max-height: 160px; overflow: auto; }
.chx-warnbox { padding: 6px 10px; border-radius: 8px; border: 1px solid #b8862c; color: #ffd28a; font-size: 13px; }
.chx-src { overflow-wrap: anywhere; }
.chx-match { position: relative; }
.chx-coach { top: 12px; left: 12px; }
@media (max-width: 760px) { .chx-deck-grid { grid-template-columns: 1fr; } .chx-dc-art { flex-basis: 64px; } .chx-dc-art .chx-thumb { width: 64px; } }

/* Chaotic: quadro de atributos no detalhe da carta */
.chx-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; margin: 10px 0; }
.chx-stat { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; background: var(--slate-lo); border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.chx-stat span { color: var(--muted); }
.chx-stat strong { color: var(--brass-hi); }

/* ===== Hub de jogos (js/hub/*): barra de cima em uma linha, seletor, cartões, shell por jogo, administração ===== */
.hub-nav { gap: 16px; flex-wrap: nowrap; padding: 10px 24px; }
.hub-nav nav { flex-wrap: nowrap; margin-left: 0; flex: 1 1 auto; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; gap: 2px; }
.hub-nav nav::-webkit-scrollbar { display: none; }
.hub-nav .nav-link { white-space: nowrap; flex: none; }
.hub-nav .nav-link.soon { opacity: 0.6; }
.hub-nav .brand { flex: none; white-space: nowrap; }
.hub-more { flex: none; white-space: nowrap; }
.hub-selector { --game: var(--brass); display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 38px; padding: 6px 12px; cursor: pointer;
  border: 1px solid var(--line-strong); border-left: 3px solid var(--game); border-radius: 8px; background: rgba(255, 255, 255, 0.04);
  color: var(--parch); font-family: var(--font-display); font-weight: 700; letter-spacing: 0.04em; font-size: 15px; white-space: nowrap; }
.hub-selector:hover, .hub-selector[aria-expanded="true"] { box-shadow: var(--glow-brass); }
.hub-selector.small { font-size: 13px; min-height: 32px; padding: 4px 10px; }
.hub-sel-ico { color: var(--game); }
.hub-sel-caret { color: var(--muted); font-size: 12px; }
.hub-chip { flex: none; max-width: 190px; padding: 4px 12px 4px 4px; }
.hub-chip .pc-av { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden; background: var(--brass-lo); color: var(--parch); font-weight: 700; }
.hub-chip .pc-av img { width: 100%; height: 100%; object-fit: cover; }
.hub-chip .pc-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 1180px) { .hub-nav .brand-txt { display: none; } .hub-nav { padding: 10px 16px; gap: 10px; } }

.hub-pop { position: fixed; z-index: 80; max-width: calc(100vw - 16px); padding: 6px; border-radius: 10px; background: var(--panel-solid); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.hub-pop-item { --game: var(--brass); display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); cursor: pointer; text-align: left; }
.hub-pop-item:hover, .hub-pop-item:focus-visible { background: var(--panel-hi); outline: none; box-shadow: inset 0 0 0 1px var(--line-strong); }
.hub-pop-item.on { background: rgba(201, 164, 92, 0.14); }
.hub-pop-item[disabled] { opacity: 0.5; cursor: default; }
.hub-pop-ico { width: 26px; text-align: center; color: var(--game); font-size: 17px; }
.hub-pop-txt { display: flex; flex-direction: column; min-width: 0; }
.hub-pop-txt small { color: var(--muted); font-size: 12px; }
.hub-pop-sep { height: 1px; margin: 4px 6px; background: var(--line); }

.hub-shell { min-height: 100%; }
.hub-hero { padding: 32px 36px 8px; }
.hub-title { font-family: var(--font-display); font-size: clamp(26px, 4vw, 40px); color: var(--parch); margin: 6px 0; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent-text); text-decoration: underline; cursor: pointer; font: inherit; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; padding: 18px 36px 36px; }
.hub-card { --game: var(--brass); display: flex; flex-direction: column; overflow: hidden; border-radius: 12px; border: 1px solid var(--line-strong); border-top: 4px solid var(--game); background: var(--panel); box-shadow: var(--bevel); }
.hub-card.last { box-shadow: var(--bevel), 0 0 0 2px var(--game); }
.hub-card.locked .hub-card-art { filter: grayscale(0.7); opacity: 0.7; }
.hub-card-art { height: 120px; display: grid; place-items: center; font-size: 56px; color: var(--game);
  background: radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--game) 45%, transparent), transparent 70%), var(--slate-lo); }
.hub-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.hub-card h2 { margin: 0; font-family: var(--font-display); color: var(--parch); font-size: 22px; }
.hub-card p { margin: 0; color: var(--muted); }
.hub-card-tags { display: flex; gap: 6px; flex-wrap: wrap; min-height: 22px; }
.hub-tag { font-size: 11.5px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--game); color: var(--text); }
.hub-card-actions { margin-top: auto; padding-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.hub-card.admin { --game: var(--mana-c); }

.game-shell-screen .gs-head { min-height: 0; }
.gs-module[hidden], .gs-panel[hidden] { display: none; }
.gs-home, .gs-soon { --game: var(--brass); padding: 28px 36px; }
.gs-home-hero { display: flex; gap: 18px; align-items: center; margin-bottom: 20px; }
.gs-home-ico { font-size: 54px; color: var(--game); width: 80px; text-align: center; }
.gs-home h1, .gs-soon h1 { font-family: var(--font-display); color: var(--parch); margin: 4px 0; }
.gs-quick { border-top-color: var(--game); min-height: 92px; }
.gs-quick.soon { opacity: 0.6; }

.admin-screen .adm-head { min-height: 0; }
.adm-wrap { padding: 20px 36px 40px; }
.adm-title { font-family: var(--font-display); color: var(--parch); margin: 0 0 12px; }
.adm-filters { gap: 10px; margin-bottom: 14px; }
.adm-filters input, .adm-filters select { min-height: 40px; }
.adm-table { width: 100%; border-collapse: collapse; }
.adm-table th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line-strong); }
.adm-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.adm-user { display: flex; align-items: center; gap: 10px; }
.adm-user > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.adm-av { width: 36px; height: 36px; border-radius: 50%; flex: none; overflow: hidden; display: grid; place-items: center; background: var(--brass-lo); color: var(--parch); font-weight: 700; }
.adm-av img { width: 100%; height: 100%; object-fit: cover; }
.adm-games { display: flex; gap: 4px; flex-wrap: wrap; }
.adm-chip { --game: var(--brass); font-size: 12px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--game); }
.adm-acc { position: relative; }
.adm-acc-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 180px; padding: 6px; border-radius: 8px; background: var(--panel-solid); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.adm-acc-pop[hidden] { display: none; }
.adm-acc-item { --game: var(--brass); display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 8px; border-radius: 6px; cursor: pointer; border-left: 3px solid var(--game); }
.adm-acc-item:hover { background: var(--panel-hi); }
.adm-pager { justify-content: space-between; align-items: center; margin-top: 12px; gap: 10px; }
.adm-log { list-style: none; padding: 0; margin: 0; }
.adm-log li { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.adm-act { font-size: 12px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line-strong); }
.adm-act.grant { color: var(--g-text); }
.adm-act.revoke { color: var(--r-text); }
.adm-when { margin-left: auto; }

@media (max-width: 760px) {
  .hub-hero { padding: 18px 16px 4px; }
  .hub-grid { padding: 12px 16px 24px; grid-template-columns: 1fr; gap: 12px; }
  .hub-card-art { height: 84px; font-size: 40px; }
  .gs-home, .gs-soon, .adm-wrap { padding: 16px; }
  body.m-app.m-notabs { --m-bot: 0px; }
  body.m-app.m-notabs .m-tabbar { display: none; }
  .m-sel { margin-left: 2px; min-width: 0; }
  .hub-selector.m-selector { font-size: 13px; min-height: 40px; padding: 4px 8px; max-width: 42vw; }
  .hub-selector.m-selector .hub-sel-name { overflow: hidden; text-overflow: ellipsis; }
  .m-brand > span:last-child { display: none; }
  .m-tab-ico { width: 40px; }
  .m-tab-label { font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .adm-table thead { display: none; }
  .adm-table, .adm-table tbody, .adm-table tr, .adm-table td { display: block; width: 100%; }
  .adm-table tr { border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; background: var(--panel); }
  .adm-table td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
  .adm-table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; }
  .adm-table td:first-child::before { content: none; }
  .adm-filters > * { flex: 1 1 100%; }
}

/* ---- pacote dos jogos do hub (Início, ranking, holo, HUD do Chaotic) ---- */
.gx-home { --game: var(--brass); }
.gx-hero { gap: 28px; }
.gx-title { color: var(--game); outline: none; }
.gx-feature { max-width: 340px; }
.gx-feature-stage { background: transparent !important; display: grid; place-items: center; padding: 10px 6px 0; }
.gx-feature-stage .card-stage { width: min(240px, 70vw); }
.gx-feature-text { font-size: 13px; color: var(--muted); line-height: 1.45; }
.gx-newbie, .gx-continue { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; padding: 10px 12px; border: 1px solid var(--line-strong); border-left: 4px solid var(--game); border-radius: 8px; background: var(--panel); }
.gx-holo { position: relative; display: block; flex: none; border-radius: 6px; overflow: hidden; }
.gx-holo img { display: block; }
.gx-rar { position: absolute; right: 4px; top: 2px; z-index: 2; color: #ffe27a; text-shadow: 0 0 6px #000; font-size: 13px; pointer-events: none; }
.gx-alt { color: #ffe27a; }
.op-var-btn { background: none; border: 0; padding: 2px; cursor: pointer; }
.gx-ranking h1 { font-family: var(--font-display); color: var(--parch); margin: 0 0 6px; outline: none; }
.gx-ranked { margin-top: 8px; }
.gx-start { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 22px; border-radius: 10px; background: rgba(9, 13, 21, 0.94); border: 1px solid var(--brass-hi); box-shadow: var(--shadow); cursor: pointer; text-align: center; transition: opacity 0.35s; }
.gx-start strong { font-family: var(--font-display); font-size: 20px; color: var(--brass-hi); }
.gx-start.out { opacity: 0; pointer-events: none; }
.gx-ai-last { font-size: 13px; color: #9fd0f5; }
.gx-ai-line { color: #9fd0f5; }
.chx-hud-loc { position: absolute; left: 10px; top: 10px; z-index: 5; display: flex; gap: 10px; max-width: min(420px, 70%); padding: 8px; border-radius: 10px; background: rgba(9, 13, 21, 0.85); border: 1px solid var(--line-strong); }
.chx-hud-loc .chx-loc-card { padding: 0; border: 0; background: none; cursor: zoom-in; flex: none; }
.chx-hud-loc .chx-thumb-md { width: 92px; height: 129px; }
.chx-loc-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.chx-loc-card.flip { animation: chxFlip 0.7s ease-out; }
@keyframes chxFlip { 0% { transform: perspective(500px) rotateY(180deg); opacity: 0.3; } 100% { transform: perspective(500px) rotateY(0); opacity: 1; } }
.chx-hud-fan { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chx-fan-cards { display: flex; gap: 6px; }
.chx-fan-card { position: relative; padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; cursor: zoom-in; transform: rotate(calc(var(--i, 0) * 6deg)) translateY(calc(var(--i, 0) * var(--i, 0) * 4px)); transition: transform 0.15s; }
.chx-fan-card .chx-thumb-md { width: 78px; height: 109px; }
.chx-fan-card.can { cursor: pointer; border-color: #3fa66b; box-shadow: 0 0 14px rgba(63, 166, 107, 0.6); }
.chx-fan-card:hover, .chx-fan-card:focus-visible { transform: translateY(-12px) scale(1.08); z-index: 2; }
.chx-fan-dmg { position: absolute; right: -6px; top: -6px; background: #c2564a; color: #fff; font-weight: 800; border-radius: 99px; padding: 1px 7px; font-size: 13px; }
.chx-fan-piles { display: flex; gap: 10px; font-size: 12px; background: rgba(9, 13, 21, 0.85); padding: 3px 10px; border-radius: 99px; }
.chx-vs-hud { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 6; display: none; align-items: center; gap: 14px; background: rgba(9, 13, 21, 0.92); border: 1px solid var(--line-strong); padding: 8px 16px; border-radius: 12px; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); }
.chx-vs-hud.live { display: flex; }
.chx-vs-fighter { display: flex; align-items: center; gap: 10px; }
.chx-vs-fighter.striking { filter: drop-shadow(0 0 10px rgba(255, 161, 58, 0.8)); }
.chx-vs-info { display: flex; flex-direction: column; gap: 3px; min-width: 130px; }
.chx-vs-name { font-weight: 700; font-size: 13px; color: #f1f5f9; }
.chx-vs-bar-wrap { position: relative; width: 100%; height: 14px; background: rgba(0, 0, 0, 0.6); border-radius: 99px; overflow: hidden; border: 1px solid var(--line-strong); }
.chx-vs-bar { height: 100%; background: linear-gradient(90deg, #3fa66b, #5cd48d); transition: width 0.3s ease; }
.chx-vs-bar.opp { background: linear-gradient(90deg, #c2564a, #e67a6d); }
.chx-vs-hp { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000; }
.chx-vs-turn-tag { font-size: 10px; font-weight: 800; color: #ffa13a; letter-spacing: 0.08em; text-transform: uppercase; }
.chx-vs-badge { font-weight: 900; font-size: 16px; color: #ffa13a; font-family: var(--font-display, sans-serif); text-shadow: 0 0 10px rgba(255, 161, 58, 0.7); }
.chx-stage.drop { outline: 3px dashed #3fa66b; outline-offset: -6px; }
.chx-rcard img, .chx-rcard .chx-thumb { width: 100%; height: 100%; }
.chx-counters { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chx-counter { font-size: 13px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line-strong); }
.chx-counter.ok { border-color: #3fa66b; } .chx-counter.bad { border-color: #c2564a; }
.chx-editor { padding: 16px; min-width: 0; }
.chx-deck-text { width: 100%; font-family: ui-monospace, monospace; }
.chx-builder .thumb .chx-thumb { width: 100%; height: 100%; }
@media (max-width: 760px) {
  .gx-feature { max-width: none; }
  .chx-hud-loc { max-width: calc(100% - 20px); }
  .chx-hud-loc .chx-thumb-md { width: 56px; height: 78px; }
  .chx-loc-info small { display: none; }
  .chx-fan-card .chx-thumb-md { width: 58px; height: 81px; }
  .chx-vs-hud { padding: 4px 8px; gap: 6px; top: 6px; }
  .chx-vs-info { min-width: 75px; }
  .chx-vs-name { font-size: 11px; }
  .chx-vs-fighter .chx-thumb-sm { width: 34px; height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .chx-loc-card.flip { animation: none; }
  .chx-fan-card, .gx-start { transition: none; }
}

/* =========================================================================
   Limitado (Sealed / Draft) — js/ui/limitedScreen.js
   ========================================================================= */
.limited-screen .menu-shell { min-height: 0; }
.lim-wrap { max-width: 1280px; margin: 0 auto; padding: 12px 16px 40px; display: grid; gap: 14px; }
.lim-panel { padding: 16px; }
.lim-panel h2 { margin: 0; }
.lim-modes { display: grid; gap: 12px; margin: 12px 0; }
.lim-draft-opts { display: grid; gap: 12px; }
.lim-pack { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.lim-card { position: relative; aspect-ratio: 488 / 680; padding: 0; border: 0; background: none; perspective: 900px; cursor: default; border-radius: 10px; }
button.lim-card { cursor: pointer; }
button.lim-card:hover .lim-inner, button.lim-card:focus-visible .lim-inner { transform: translateY(-4px); }
button.lim-card:focus-visible { outline: 3px solid var(--brass-hi); outline-offset: 3px; }
.lim-inner { position: absolute; inset: 0; transition: transform 0.55s cubic-bezier(.2,.8,.2,1); transform-style: preserve-3d; }
.lim-flip .lim-inner { transform: rotateY(180deg); }
.lim-back, .lim-front { position: absolute; inset: 0; border-radius: 10px; backface-visibility: hidden; overflow: hidden; }
.lim-back { transform: rotateY(180deg); background: radial-gradient(circle at 50% 45%, #c58a3a 0 18%, #5b3a1c 19% 30%, #2a1c10 31%), #2a1c10; border: 6px solid #1a120a; box-shadow: inset 0 0 0 2px var(--brass-lo); }
.lim-front img { width: 100%; height: 100%; display: block; object-fit: cover; }
.lim-open.r-rare .lim-front { box-shadow: 0 0 0 2px #e5c158, 0 0 22px rgba(239, 215, 156, 0.75); }
.lim-open.r-mythic .lim-front { box-shadow: 0 0 0 2px #ff7a2f, 0 0 28px rgba(255, 122, 47, 0.85); animation: limGlow 2.4s ease-in-out infinite alternate; }
@keyframes limGlow { from { filter: brightness(1); } to { filter: brightness(1.12); } }
.lim-booster { aspect-ratio: 488 / 680; border-radius: 12px; display: grid; place-items: center; text-align: center; padding: 12px;
  background: linear-gradient(135deg, #2b3a5c, #6b2b4a 55%, #c9a45c); color: var(--parch); font-family: 'Alegreya SC', serif; font-size: 1.1rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), inset 0 0 0 3px rgba(255, 255, 255, 0.15); }
.lim-clock { font-variant-numeric: tabular-nums; font-weight: 700; }
.lim-clock.warn { color: #ff8a80; }
.lim-picks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.lim-mini { width: 54px; border-radius: 4px; }
.lim-count { font-size: 1.3rem; color: #8dffc8; }
.lim-count.bad { color: #ff8a80; }
.lim-curve { display: flex; gap: 6px; align-items: flex-end; height: 90px; margin: 8px 0; }
.lim-bar { flex: 1; max-width: 46px; height: 100%; display: grid; grid-template-rows: 1fr auto auto; text-align: center; font-size: 0.8rem; }
.lim-bar i { align-self: end; background: linear-gradient(var(--brass-hi), var(--brass-lo)); border-radius: 4px 4px 0 0; min-height: 2px; }
.lim-bar span { color: var(--muted); }
.lim-lands { display: flex; flex-wrap: wrap; gap: 10px; }
.lim-land { display: grid; justify-items: center; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; min-width: 96px; }
.lim-land img { width: 64px; border-radius: 4px; }
.lim-land output { min-width: 2ch; text-align: center; font-weight: 700; }
.lim-filters { margin: 8px 0; }
.lim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-top: 8px; }
.lim-grid.deck { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.lim-thumb { position: relative; padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; cursor: pointer; aspect-ratio: 488 / 680; }
.lim-thumb img { width: 100%; height: 100%; border-radius: 6px; display: block; }
.lim-thumb:focus-visible { border-color: var(--brass-hi); outline: none; }
.lim-thumb.r-mythic { border-color: rgba(255, 122, 47, 0.7); }
.lim-thumb.r-rare { border-color: rgba(229, 193, 88, 0.6); }
.lim-score { font-size: 1.4rem; margin: 10px 0; }
.lim-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.lim-table th, .lim-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.lim-table tr.me td { color: var(--brass-hi); font-weight: 700; }
@media (max-width: 600px) {
  .lim-wrap { padding: 8px 12px 32px; }
  .lim-pack { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .lim-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .lim-inner { transition: none; }
  .lim-open.r-mythic .lim-front { animation: none; }
}

/* ---------- Coleção, scanner e estatísticas do deck (js/ui/collectionScreen.js, scanner.js, deckInsights.js) ---------- */
.collection-screen { overflow-y: auto; }
.col-wrap { padding: 14px 26px 40px; max-width: 1400px; margin: 0 auto; }
.col-sync { margin: 0 0 10px; font-size: 12.5px; }
.col-filters { gap: 8px; margin-bottom: 12px; }
.col-filters input, .col-filters select { min-height: 40px; }
.col-h2 { font-size: 18px; margin: 18px 0 8px; }
.col-sets { display: grid; gap: 6px; }
.col-set { display: grid; grid-template-columns: 28px 1fr minmax(140px, 260px); align-items: center; gap: 12px; text-align: left; padding: 9px 12px; min-height: 48px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel-solid); color: var(--text); cursor: pointer; font: inherit; }
.col-set:hover, .col-set:focus-visible { border-color: var(--line-strong); }
.col-set-ico { width: 22px; height: 22px; filter: invert(0.85); }
.col-set-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-set-prog { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.col-set-prog.big { max-width: 520px; margin: 8px 0 14px; font-size: 14px; color: var(--text); }
.col-bar { display: block; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.col-bar i { display: block; height: 100%; background: linear-gradient(90deg, #6cc08d, #e0c27a); }
.col-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.col-card { display: flex; flex-direction: column; gap: 5px; }
.col-card-img { position: relative; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 7px; overflow: hidden; aspect-ratio: 63 / 88; }
.col-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.col-card.missing .col-card-img img { filter: grayscale(1) brightness(0.55); opacity: 0.55; }
.col-badge { position: absolute; top: 6px; right: 6px; background: rgba(0, 0, 0, 0.78); color: #fff; font-weight: 700; font-size: 12px; padding: 2px 7px; border-radius: 99px; }
.col-card-meta { display: flex; gap: 6px; font-size: 12px; min-width: 0; }
.col-num { color: var(--muted); }
.col-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-fins { display: grid; gap: 3px; }
.col-fin { display: grid; grid-template-columns: 18px 32px 1fr 32px; align-items: center; gap: 4px; font-size: 12px; }
.col-fin .btn.tiny { min-width: 32px; min-height: 30px; padding: 0; }
.col-fin-l { color: var(--muted); font-weight: 700; text-align: center; }
.col-fin-q { text-align: center; font-variant-numeric: tabular-nums; }
.col-more { grid-column: 1 / -1; justify-self: center; }
.col-value { margin-bottom: 12px; }
.col-kpis { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0; }
.col-kpis > div { padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-solid); min-width: 140px; }
.col-kpis b { display: block; font-size: 20px; }
.col-kpis span { font-size: 11.5px; color: var(--muted); }
.muted.small, p.small { font-size: 12px; }
.scan-wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; }
.scan-stage { position: relative; max-width: 640px; margin-top: 10px; border-radius: 10px; overflow: hidden; background: #000; }
.scan-video { display: block; width: 100%; height: auto; }
.scan-frame { position: absolute; left: 50%; top: 50%; height: 86%; max-width: 90%; aspect-ratio: 63 / 88; transform: translate(-50%, -50%);
  border: 2px solid #e0c27a; border-radius: 12px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35); pointer-events: none; }
.scan-band { position: absolute; left: 3%; right: 3%; border: 1px dashed rgba(108, 192, 141, 0.9); border-radius: 4px; }
.scan-band.top { top: 3.5%; height: 7.5%; right: 25%; left: 5%; }
.scan-band.bottom { bottom: 1%; height: 10%; right: 47%; }
.scan-card { display: grid; grid-template-columns: 180px 1fr; gap: 14px; align-items: start; padding: 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel-solid); }
.scan-img { width: 100%; border-radius: 8px; }
.scan-qty { width: 80px; }
.scan-manual { margin-top: 18px; }
.scan-manual input { min-height: 40px; }
.deck-insights { margin: 12px 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: rgba(0, 0, 0, 0.18); }
.deck-insights > summary { cursor: pointer; font-weight: 700; min-height: 32px; display: flex; align-items: center; }
.di-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 8px; }
.di-chart { width: 100%; max-width: 340px; height: auto; }
.di-chart .di-v { font-size: 10px; fill: var(--text); }
.di-chart .di-l { font-size: 10px; fill: var(--muted); }
.di-types, .di-colors, .di-legal { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 13px; }
.di-types li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 2px 0; }
.di-colors li { display: grid; grid-template-columns: 110px 1fr; gap: 2px 8px; align-items: center; }
.di-colors li > .muted { grid-column: 2; font-size: 11.5px; }
.di-bars { display: grid; gap: 2px; }
.di-bars i { display: block; height: 6px; border-radius: 3px; min-width: 2px; }
.di-bars i.src { opacity: 0.55; }
.di-legal li.ok { color: var(--g-text, #9fe0b4); }
.di-legal li.no { color: #ffc2a0; }
.di-data summary { font-size: 11.5px; color: var(--muted); cursor: pointer; }
.di-own { margin-top: 14px; }
.own-badge { position: absolute; left: 4px; bottom: 4px; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 99px; background: rgba(0, 0, 0, 0.8); pointer-events: none; }
.own-badge.ok { color: #9fe0b4; }
.own-badge.miss { color: #ffc2a0; }
@media (max-width: 760px) {
  .col-wrap { padding: 10px 12px 90px; }
  .col-set { grid-template-columns: 24px 1fr; }
  .col-set-prog { grid-column: 1 / -1; }
  .col-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
  .scan-wrap { grid-template-columns: 1fr; }
  .scan-card { grid-template-columns: 110px 1fr; }
}

/* Aviso de atualização (topo, navegador e app instalado) */
.update-banner { position: fixed; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 10000;
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px; max-width: calc(100vw - 24px);
  background: linear-gradient(180deg, var(--parch), var(--parch-2)); color: var(--ink); border: 2px solid var(--brass-lo);
  border-radius: 999px; box-shadow: var(--shadow); font-size: 14px; font-weight: 600; }
.update-banner .icon-btn { color: var(--ink); }
@media (prefers-reduced-motion: no-preference) { .update-banner { animation: upd-in .35s ease-out; } }
@keyframes upd-in { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.update-cta-btn { border-color: var(--mana-u) !important; box-shadow: 0 0 14px rgba(14, 104, 171, 0.55); font-weight: 700; }
@media (prefers-reduced-motion: no-preference) { .update-cta-btn { animation: pulseAccent 2.5s infinite; } }
@keyframes pulseAccent { 0%, 100% { box-shadow: 0 0 10px rgba(14, 104, 171, 0.4); } 50% { box-shadow: 0 0 20px rgba(14, 104, 171, 0.85); } }

/* ---------- relógio da partida (HUD) ---------- */
.clock-badge { position: absolute; top: 88px; right: 12px; left: auto; transform: none; z-index: 6; pointer-events: none;
  background: rgba(10, 14, 24, .82); border: 1px solid rgba(255, 255, 255, .15); border-radius: 10px; padding: 4px 10px; font-size: 13px; color: #e8ecf4; }
.clock-badge .cb-row { display: flex; gap: 10px; align-items: baseline; padding: 2px 0; }
.clock-badge .cb-row.me .cb-who { color: #9fd3ff; }
.clock-badge .cb-time { font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.clock-badge .cb-bank { opacity: .8; font-variant-numeric: tabular-nums; }
.clock-badge .cb-strikes { color: #ffb4a8; font-weight: 700; }
.clock-badge .cb-row.warn .cb-time { color: #ff6b5b; animation: cb-pulse 1s infinite; }
@keyframes cb-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .clock-badge .cb-row.warn .cb-time { animation: none; text-decoration: underline; } }

/* ---------- replays ---------- */
.replay-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; padding: 16px; max-width: 1200px; margin: 0 auto; }
.replay-bar { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 20; display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  background: rgba(10, 14, 24, .9); border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; padding: 6px 10px; color: #e8ecf4; max-width: calc(100vw - 32px); }
.replay-bar input[type=range] { width: min(320px, 40vw); }
.replay-bar .rp-pos { font-variant-numeric: tabular-nums; font-size: 12px; opacity: .85; }
.replay-bar .rp-turns { display: flex; gap: 3px; flex-wrap: wrap; max-width: 100%; max-height: 64px; overflow: auto; }

/* ---- Palavras-chave, parte manual e escolhas (motor de habilidades) ---- */
.pv-kws { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.kw-chip { font-size: 11.5px; padding: 2px 7px; border-radius: 99px; border: 1px solid var(--line-strong); background: rgba(201, 164, 92, 0.16); }
.kw-chip.parcial { background: rgba(255, 196, 64, 0.18); border-color: #c9a45c; }
.kw-chip.manual { background: rgba(255, 106, 74, 0.16); border-color: #ff6a4a; }
.pv-manual, .sp-manual { margin-top: 8px; padding: 6px 8px; border-radius: 8px; border: 1px dashed #ffb347; background: rgba(255, 179, 71, 0.08); font-size: 12.5px; }
.pv-manual ul { margin: 4px 0 0 16px; padding: 0; }
.pv-chosen, .pv-pending, .pv-ability { font-size: 12.5px; margin: 4px 0; }
.pv-pending { color: #ffb347; }
.sp-tools { display: flex; gap: 6px; margin-top: 6px; }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.sp-text { font-size: 12.5px; margin: 4px 0; }
.sp-ability { outline: 2px dashed rgba(201, 164, 92, 0.7); outline-offset: 2px; border-radius: 12px; }
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice-list .btn.choice { text-align: left; white-space: normal; }
.order-list { margin: 8px 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.order-list li { display: flex; align-items: center; gap: 8px; }
.order-list li span { flex: 1; }
.text-input { width: 100%; padding: 8px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--panel); color: inherit; }
@media (max-width: 600px) { .choice-list .btn.choice { min-height: 44px; } }


/* =========================================================================
   REFINAMENTO DE UX/UI MOBILE (iPhone 7 / Telas menores e Touch)
   Ajustes ergonômicos e preventivos para TCG em telas de celular.
   ========================================================================= */
@media (max-width: 820px), (max-height: 500px) and (orientation: landscape) {
  /* Alvos de toque (Touch Targets) mínimos de 44px (Heurística Apple/Android) */
  .btn, .tool-btn, .life-btn, .icon-btn, .btn.tiny, .ctx-item, select, input { 
    min-height: 44px !important; min-width: 44px; font-size: 14px; 
  }
  
  /* Mão do jogador: rolagem suave (touch) sem amontoar as cartas e com snap */
  .thumb-grid.hand-grid, .op-hand {
    grid-auto-columns: minmax(68px, 80px); 
    padding-bottom: 12px; /* espaço extra para o dedo repousar ao rolar */
    -webkit-overflow-scrolling: touch; 
    scroll-snap-type: x proximity;
  }
  .thumb-grid.hand-grid > *, .op-hand > * { scroll-snap-align: start; }
  
  /* Campo de Batalha: evitar estouro de div e rolagem lateral quebrando o layout */
  .zone-battlefield {
    display: flex; flex-wrap: wrap; gap: 4px; justify-content: center;
  }
  .zone-battlefield .thumb {
    width: 62px; /* reduz levemente pra caber pelo menos 5~6 na mesma linha do iPhone */
  }

  /* Modais: botões mais largos e espaçados no celular */
  .modal { width: 95vw; max-height: 85vh; padding: 10px; }
  .modal-actions { flex-wrap: wrap; gap: 10px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .modal-actions .btn { flex: 1 1 100%; min-height: 48px; } /* Estica os botões de ação final (Mulligan, Keep) */

  /* Tornar os contadores numéricos mais visíveis sem precisar de hover */
  .pile-count, .kw-chip { font-size: 13px; padding: 4px 8px; }
  .turn-info { font-size: 12px; letter-spacing: 0; }
  .pp-name, .pp-stats { font-size: 13px; }

  /* Pilha de ações: garantir que não sobreponha a mão/campo limitando altura e adicionando fundo forte */
  .action-stack { 
    max-height: 35vh; overflow-y: auto; background: rgba(10, 14, 24, 0.95); padding: 8px; border-radius: 8px; 
  }
}


/* ---------- Trilha de Fases e Paradas (MTG Arena Phase Ladder) ---------- */
.arena-phase-ladder { position: absolute; right: 12px; top: 52px; display: flex; align-items: center; gap: 5px; background: rgba(15, 23, 42, 0.88); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 10px; padding: 3px 6px; backdrop-filter: blur(8px); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45); z-index: 5; user-select: none; }
.arena-ladder-ctrl { background: rgba(30, 41, 59, 0.8); color: #94a3b8; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 6px; font-size: 10px; font-weight: 800; letter-spacing: 0.05em; padding: 4px 6px; cursor: pointer; transition: all 0.15s ease; }
.arena-ladder-ctrl:hover { background: rgba(51, 65, 85, 0.9); color: #f8fafc; }
.arena-ladder-ctrl.active { background: linear-gradient(180deg, #f59e0b, #d97706); color: #1e293b; border-color: #fbbf24; box-shadow: 0 0 10px rgba(245, 158, 11, 0.6); }
.arena-ladder-track { list-style: none; margin: 0; padding: 0; display: flex; gap: 3px; }
.arena-ladder-step { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px 7px; border-radius: 6px; font-size: 10.5px; color: #cbd5e1; cursor: pointer; border: 1px solid transparent; transition: all 0.15s ease; }
.arena-ladder-step:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.2); }
.arena-step-icon { font-size: 13px; line-height: 1.1; }
.arena-step-label { font-size: 9px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.arena-stop-pip { position: absolute; top: -6px; font-size: 9px; color: #f59e0b; text-shadow: 0 0 6px rgba(245, 158, 11, 0.9); opacity: 0; transform: scale(0.6); transition: all 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.arena-stop-pip.visible { opacity: 1; transform: scale(1); }
.arena-ladder-step.has-stop { border-color: rgba(245, 158, 11, 0.6); background: rgba(245, 158, 11, 0.12); }
.arena-ladder-step.active.mine { background: linear-gradient(180deg, #fef08a, #eab308 60%, #ca8a04); color: #1e293b; border-color: #fde047; box-shadow: 0 0 12px rgba(234, 179, 8, 0.65); }
.arena-ladder-step.active.theirs { background: linear-gradient(180deg, #38bdf8, #0284c7 60%, #0369a1); color: #ffffff; border-color: #7dd3fc; box-shadow: 0 0 12px rgba(2, 132, 199, 0.65); }


/* ---------- Fix Chaotic Stage Height & Full-Screen Match Viewport ---------- */
.chx-stage { height: 100%; min-height: 480px; }

/* 3D Rotating Card Ring Background in Non-Magic Hubs */
.gx-home { position: relative; isolation: isolate; }
.gx-menu-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.45; overflow: hidden; }
.gx-menu-bg canvas { width: 100% !important; height: 100% !important; display: block; }
.gx-home > :not(.gx-menu-bg) { position: relative; z-index: 1; }
.gx-deck-card.active { border-color: var(--gx-accent, #facc15); box-shadow: 0 0 18px rgba(250, 204, 21, 0.35); }

/* Full-Viewport Match Mode for Chaotic, One Piece, Lorcana & Star Wars */
body.chx-playing .gs-head,
body.chx-playing .chx-head,
body.op-playing .gs-head,
body.op-playing .op-head,
body.op-playing .op-notice,
body.lor-playing .gs-head,
body.swu-playing .gs-head { display: none !important; }

body.chx-playing .chx-wrap,
body.op-playing .op-wrap,
body.lor-playing .lor-screen-wrap,
body.swu-playing .swu-screen-wrap {
  max-width: 100vw !important;
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  margin: 0 !important;
  padding: 8px 12px !important;
  box-sizing: border-box !important;
}

body.chx-playing .chx-match {
  height: calc(100dvh - 16px) !important;
  min-height: 0 !important;
  grid-template-columns: minmax(0, 1fr) 290px !important;
  gap: 10px !important;
}

body.op-playing .op-match {
  height: calc(100dvh - 16px) !important;
  min-height: 0 !important;
  grid-template-columns: minmax(0, 1fr) 290px !important;
  gap: 10px !important;
}

body.lor-playing .lor-match-wrap,
body.swu-playing .swu-match-wrap {
  height: calc(100dvh - 16px) !important;
  min-height: 0 !important;
}

@media (max-width: 980px) {
  body.chx-playing .chx-match,
  body.op-playing .op-match {
    grid-template-columns: 1fr !important;
    height: auto !important;
  }
}

/* ---------- Chaotic 3D FX Layer, Upgraded Combat HUD & Attack Cards ---------- */
.chx-fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
.chx-pop {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  animation: chxPopFloat 1.15s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  white-space: nowrap;
}
.chx-pop-damage { background: linear-gradient(135deg, #ef4444, #991b1b); color: #fff; border: 2px solid #fca5a5; box-shadow: 0 6px 20px rgba(239, 68, 68, 0.65); }
.chx-pop-heal { background: linear-gradient(135deg, #22c55e, #15803d); color: #fff; border: 2px solid #86efac; box-shadow: 0 6px 20px rgba(34, 197, 94, 0.6); }
.chx-pop-ko { background: linear-gradient(135deg, #f59e0b, #b91c1c); color: #fff; border: 2px solid #fde047; font-size: 18px; box-shadow: 0 8px 26px rgba(245, 158, 11, 0.8); }
@keyframes chxPopFloat {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(0.7); }
  20% { opacity: 1; transform: translate(-50%, -60%) scale(1.12); }
  80% { opacity: 1; transform: translate(-50%, -110%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -140%) scale(0.92); }
}

.chx-action-banner {
  position: absolute;
  top: 96px;
  left: 50%;
  transform: translateX(-50%) scale(0.92);
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(9, 13, 24, 0.92);
  border: 1.5px solid rgba(56, 189, 248, 0.65);
  color: #f8fafc;
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65);
  white-space: nowrap;
}
.chx-action-banner.on { opacity: 1; transform: translateX(-50%) scale(1); }
.chx-action-banner.tone-attack { border-color: #f97316; background: linear-gradient(90deg, rgba(124, 45, 18, 0.92), rgba(15, 23, 42, 0.95)); color: #ffedd5; }
.chx-action-banner.tone-ko { border-color: #ef4444; background: linear-gradient(90deg, rgba(153, 27, 27, 0.95), rgba(15, 23, 42, 0.95)); color: #fee2e2; }
.chx-action-banner.tone-combat { border-color: #facc15; color: #fef08a; }

.chx-vs-hud.always-on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  padding: 8px 14px;
  background: linear-gradient(180deg, rgba(6, 10, 20, 0.92) 0%, rgba(10, 16, 30, 0.78) 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  backdrop-filter: blur(8px);
}
.chx-move-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  flex-wrap: wrap;
}
.chx-move-side {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
}
.chx-move-side.me { background: rgba(6, 182, 212, 0.18); border: 1px solid rgba(34, 211, 238, 0.5); color: #cffafe; }
.chx-move-side.ai { background: rgba(239, 68, 68, 0.18); border: 1px solid rgba(248, 113, 113, 0.5); color: #fee2e2; }
.chx-move-center { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; flex: 1; min-width: 220px; }
.chx-move-turn { font-size: 13px; font-weight: 900; color: #facc15; letter-spacing: 0.04em; text-transform: uppercase; }
.chx-move-hint { font-size: 11.5px; color: #cbd5e1; }
.chx-move-QuickBtns { display: flex; align-items: center; gap: 6px; }
.chx-QuickBtn {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #f1f5f9;
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.chx-QuickBtn:hover:not(:disabled) { transform: translateY(-1px); border-color: #38bdf8; background: rgba(15, 23, 42, 0.95); }
.chx-QuickBtn.primary { background: linear-gradient(135deg, #f59e0b, #d97706); border-color: #fde047; color: #0f172a; }
.chx-QuickBtn.danger { background: rgba(127, 29, 29, 0.8); border-color: rgba(248, 113, 113, 0.55); color: #fecaca; }

.chx-vs-center { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 170px; text-align: center; }
.chx-vs-stats-line { font-size: 10.5px; color: #cbd5e1; letter-spacing: 0.02em; margin-top: 2px; }
.chx-vs-Stats-pill { font-size: 10px; padding: 1px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); color: #e2e8f0; margin-left: 6px; }
.chx-vs-el-line { font-size: 10px; color: #fde047; font-weight: 700; }
.chx-vs-last {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(250, 204, 21, 0.45);
  color: #fef08a;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chx-vs-last.me { border-color: #38bdf8; color: #bae6fd; }
.chx-vs-last.ai { border-color: #f87171; color: #fecaca; }

.chx-hud-fan {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 14px;
  background: linear-gradient(0deg, rgba(4, 7, 15, 0.96) 0%, rgba(9, 14, 28, 0.85) 80%, transparent 100%);
}
.chx-fan-header {
  font-size: 12.5px;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.45);
  padding: 5px 14px;
  border-radius: 999px;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.chx-fan-cards-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  pointer-events: auto;
}
.chx-fan-card {
  width: 195px;
  height: auto;
  min-height: 230px;
  padding: 8px;
  border-radius: 12px;
  background: linear-gradient(180deg, #161f33 0%, #0b101d 100%);
  border: 2px solid rgba(249, 115, 22, 0.65);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  transform: none !important;
  margin: 0 !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.7);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.chx-fan-card:hover:not(:disabled) {
  transform: translateY(-8px) scale(1.03) !important;
  border-color: #fde047;
  box-shadow: 0 16px 32px rgba(249, 115, 22, 0.45);
}
.chx-atk-card-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; width: 100%; }
.chx-atk-cost-pill { background: #1e293b; border: 1px solid #475569; color: #cbd5e1; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px; }
.chx-atk-dmg-pill { background: linear-gradient(135deg, #ef4444, #b91c1c); color: #fff; font-size: 11px; font-weight: 900; padding: 2px 8px; border-radius: 999px; box-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
.chx-atk-art-wrap { width: 100%; height: 96px; border-radius: 8px; overflow: hidden; background: #090d16; border: 1px solid rgba(255, 255, 255, 0.1); }
.chx-atk-art-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chx-atk-meta { display: flex; flex-direction: column; gap: 3px; text-align: left; width: 100%; }
.chx-atk-title { font-size: 12.5px; font-weight: 900; color: #f8fafc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chx-atk-formula { font-size: 10.5px; color: #fde047; font-weight: 700; line-height: 1.25; }
.chx-atk-strike-cta {
  width: 100%;
  text-align: center;
  padding: 5px 0;
  border-radius: 7px;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

/* ---------- Disney Lorcana Battlefield & UI ---------- */
.lor-screen-wrap { padding: 16px 26px 32px; max-width: 1400px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.lor-tab-content { flex: 1; display: flex; flex-direction: column; }
.lor-match-wrap { display: grid; grid-template-rows: 1fr auto; gap: 10px; height: calc(100vh - 140px); min-height: 520px; }
.lor-table-slot { position: relative; background: radial-gradient(circle at center, #1e1b4b 0%, #09090b 100%); border: 1px solid rgba(139, 92, 246, 0.35); border-radius: 12px; overflow: hidden; padding: 12px; display: flex; flex-direction: column; justify-content: space-between; }
.lor-battlefield { display: flex; flex-direction: column; justify-content: space-between; height: 100%; gap: 8px; }
.lor-player-zone { display: flex; flex-direction: column; gap: 6px; }
.lor-zone-header { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #e2e8f0; flex-wrap: wrap; }
.lor-lore-badge { background: linear-gradient(135deg, #fbbf24, #d97706); color: #1e1b4b; font-weight: 800; padding: 4px 10px; border-radius: 99px; box-shadow: 0 0 10px rgba(251, 191, 36, 0.5); }
.lor-ink-badge { background: rgba(56, 189, 248, 0.2); border: 1px solid rgba(56, 189, 248, 0.5); color: #7dd3fc; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.lor-characters-row { display: flex; flex-wrap: wrap; gap: 10px; min-height: 135px; padding: 8px; background: rgba(0, 0, 0, 0.28); border-radius: 10px; align-items: center; }
.lor-empty-field { color: #94a3b8; font-size: 13px; font-style: italic; margin: 0; }
.lor-char-card { width: 128px; height: 178px; background: #18181b; border: 2px solid #4c1d95; border-radius: 10px; display: flex; flex-direction: column; justify-content: space-between; padding: 5px; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; position: relative; user-select: none; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5); }
.lor-char-card:hover { transform: translateY(-5px) scale(1.03); box-shadow: 0 10px 22px rgba(139, 92, 246, 0.45); border-color: #c084fc; }
.lor-char-card.selected { border-color: #facc15; box-shadow: 0 0 16px rgba(250, 204, 21, 0.8); }
.lor-char-card.exerted { transform: rotate(14deg) scale(0.94); opacity: 0.82; }
.lor-char-card.drying { filter: saturate(0.65); border-style: dashed; }
.lor-char-head { display: flex; align-items: center; gap: 4px; font-size: 10px; }
.lor-ink-cost { background: #7c3aed; color: #fff; font-weight: 800; border-radius: 50%; width: 19px; height: 19px; display: grid; place-items: center; flex-shrink: 0; }
.lor-char-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; color: #f8fafc; }
.lor-char-art { flex: 1; overflow: hidden; border-radius: 6px; margin: 3px 0; background: #27272a; display: grid; place-items: center; }
.lor-char-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lor-char-stats { display: flex; justify-content: space-between; font-size: 10px; font-weight: 800; background: rgba(0, 0, 0, 0.65); padding: 3px 5px; border-radius: 5px; color: #f8fafc; }
.lor-badge { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,0.6); }
.lor-badge.drying { background: rgba(245, 158, 11, 0.92); color: #fff; }
.lor-badge.ready { background: rgba(34, 197, 94, 0.92); color: #fff; }
.lor-badge.exerted { background: rgba(148, 163, 184, 0.92); color: #0f172a; }
.lor-lore-track { display: flex; flex-direction: column; gap: 4px; background: rgba(15, 23, 42, 0.8); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 8px; padding: 6px 12px; }
.lor-track-bar { display: flex; height: 8px; background: #09090b; border-radius: 4px; overflow: hidden; }
.lor-track-progress.me { background: linear-gradient(90deg, #a855f7, #ec4899); }
.lor-track-progress.opp { background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.lor-track-goal { font-size: 11px; font-weight: 800; color: #facc15; text-align: center; letter-spacing: 0.05em; }
.lor-hand-slot { display: flex; gap: 10px; align-items: center; overflow-x: auto; padding: 8px 10px; background: rgba(9, 9, 11, 0.9); border-radius: 12px; border: 1px solid rgba(168, 85, 247, 0.28); }
.lor-hand-row { display: flex; gap: 10px; flex: 1; overflow-x: auto; padding-bottom: 2px; }
.lor-hand-card { min-width: 148px; max-width: 156px; background: linear-gradient(180deg, #1e1b4b 0%, #0f172a 100%); border: 1.5px solid rgba(168, 85, 247, 0.45); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; justify-content: space-between; gap: 5px; font-size: 11px; transition: transform 0.15s, border-color 0.15s; }
.lor-hand-card:hover { transform: translateY(-4px); border-color: #facc15; }
.lor-hc-head { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.lor-hc-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #f8fafc; }
.lor-hc-cost { background: #7c3aed; color: #fff; font-weight: 800; border-radius: 50%; width: 20px; height: 20px; display: grid; place-items: center; flex-shrink: 0; }
.lor-hand-art-wrap { width: 100%; height: 112px; border-radius: 6px; overflow: hidden; background: #09090b; border: 1px solid rgba(255, 255, 255, 0.1); cursor: zoom-in; }
.lor-hand-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.lor-hc-stats { font-size: 10px; color: #cbd5e1; font-weight: 700; display: flex; justify-content: space-between; }
.lor-hc-actions { display: flex; gap: 4px; }
.lor-hc-actions .btn { flex: 1; padding: 4px 6px; font-size: 10.5px; }
.lor-pass-btn { min-width: 145px; font-weight: 800; }

/* Lorcana & Star Wars Shared Card Catalog & Deck Grids */
.lor-catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 14px; padding: 8px 0 24px; }
.lor-catalog-card { background: rgba(15, 23, 42, 0.85); border: 1px solid rgba(148, 163, 184, 0.25); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s; }
.lor-catalog-card:hover { transform: translateY(-5px); border-color: #facc15; box-shadow: 0 12px 24px rgba(0, 0, 0, 0.6); }
.lor-catalog-art { width: 100%; aspect-ratio: 63 / 88; border-radius: 8px; overflow: hidden; background: #09090b; }
.lor-catalog-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.lor-catalog-info { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.lor-catalog-info strong { color: #f8fafc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lor-catalog-info span { color: #94a3b8; font-size: 11px; }
.lor-catalog-stats { color: #fde047 !important; font-weight: 700; }

.lor-deck-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 10px 0; }
.lor-deck-mini-card { position: relative; border-radius: 7px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.15); cursor: pointer; background: #09090b; transition: transform 0.15s; }
.lor-deck-mini-card:hover { transform: scale(1.06); z-index: 2; border-color: #facc15; }
.lor-deck-mini-photo { width: 100%; aspect-ratio: 63 / 88; object-fit: cover; display: block; }
.lor-deck-mini-qty { position: absolute; top: 4px; right: 4px; background: rgba(0, 0, 0, 0.82); color: #facc15; font-size: 10px; font-weight: 900; padding: 1px 5px; border-radius: 999px; border: 1px solid rgba(250, 204, 21, 0.5); }
.lor-deck-mini-name { display: block; font-size: 9.5px; padding: 3px 4px; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.lor-deck-cover-img, .swu-deck-cover-img { width: 64px; height: 88px; object-fit: cover; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.2); flex-shrink: 0; }

/* ---------- Star Wars: Unlimited Dual Arenas & UI ---------- */
.swu-screen-wrap { padding: 16px 26px 32px; max-width: 1400px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.swu-tab-content { flex: 1; display: flex; flex-direction: column; }
.swu-match-wrap { display: grid; grid-template-rows: 1fr auto; gap: 10px; height: calc(100vh - 140px); min-height: 520px; }
.swu-table-slot { position: relative; background: radial-gradient(circle at center, #0b1329 0%, #030712 100%); border: 1px solid rgba(59, 130, 246, 0.35); border-radius: 12px; overflow: hidden; padding: 12px; display: flex; flex-direction: column; justify-content: space-between; }
.swu-battlefield { display: flex; flex-direction: column; justify-content: space-between; height: 100%; gap: 8px; }
.swu-base-strip { display: flex; justify-content: space-between; align-items: center; background: rgba(15, 23, 42, 0.78); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 8px; padding: 6px 12px; font-size: 12px; color: #cbd5e1; flex-wrap: wrap; gap: 8px; }
.swu-base-box, .swu-leader-box { display: flex; align-items: center; gap: 8px; }
.swu-leader-mini-img { width: 32px; height: 42px; object-fit: cover; border-radius: 4px; border: 1px solid rgba(56, 189, 248, 0.5); cursor: zoom-in; }
.swu-base-hp { color: #38bdf8; font-size: 14px; font-weight: 800; }
.swu-res-badge { background: rgba(59, 130, 246, 0.2); border: 1px solid rgba(59, 130, 246, 0.5); color: #93c5fd; padding: 3px 8px; border-radius: 6px; font-weight: 700; }
.swu-dual-arenas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1; min-height: 260px; }
.swu-arena-sector { background: rgba(0, 0, 0, 0.38); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; justify-content: space-between; }
.swu-sector-header { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; color: #93c5fd; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, 0.08); padding-bottom: 4px; }
.swu-sector-units { display: flex; flex-wrap: wrap; gap: 8px; min-height: 110px; align-items: center; padding: 4px; }
.swu-sector-divider { height: 1px; background: rgba(255, 255, 255, 0.08); margin: 4px 0; }
.swu-unit-card { width: 122px; height: 168px; background: #0f172a; border: 2px solid #334155; border-radius: 8px; padding: 4px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; position: relative; font-size: 10.5px; box-shadow: 0 6px 14px rgba(0,0,0,0.5); }
.swu-unit-card:hover { transform: translateY(-4px) scale(1.03); border-color: #60a5fa; box-shadow: 0 10px 20px rgba(59, 130, 246, 0.4); }
.swu-unit-card.selected { border-color: #f59e0b; box-shadow: 0 0 14px rgba(245, 158, 11, 0.75); }
.swu-unit-card.exhausted { transform: rotate(13deg) scale(0.93); opacity: 0.78; }
.swu-unit-head { display: flex; align-items: center; gap: 4px; }
.swu-unit-cost { background: #2563eb; color: #fff; font-weight: 800; border-radius: 4px; padding: 1px 5px; flex-shrink: 0; }
.swu-unit-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #f8fafc; font-size: 10px; }
.swu-unit-art { flex: 1; overflow: hidden; border-radius: 5px; margin: 3px 0; background: #090d16; display: grid; place-items: center; }
.swu-unit-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.swu-unit-stats { display: flex; justify-content: space-between; font-weight: 800; background: rgba(0, 0, 0, 0.65); padding: 2px 5px; border-radius: 4px; color: #f8fafc; }
.swu-badge { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); font-size: 9px; font-weight: 800; padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.swu-badge.sentinel { background: #dc2626; color: #fff; }
.swu-badge.ready { background: #16a34a; color: #fff; }
.swu-badge.exhausted { background: #64748b; color: #fff; }
.swu-action-slot { display: flex; gap: 10px; align-items: center; overflow-x: auto; padding: 8px 10px; background: rgba(3, 7, 18, 0.9); border-radius: 12px; border: 1px solid rgba(59, 130, 246, 0.28); }
.swu-hand-row { display: flex; gap: 10px; flex: 1; overflow-x: auto; padding-bottom: 2px; }
.swu-hand-card { min-width: 145px; max-width: 155px; background: linear-gradient(180deg, #0f172a 0%, #090d16 100%); border: 1.5px solid rgba(59, 130, 246, 0.45); border-radius: 9px; padding: 6px; display: flex; flex-direction: column; justify-content: space-between; gap: 5px; font-size: 11px; transition: transform 0.15s, border-color 0.15s; }
.swu-hand-card:hover { transform: translateY(-4px); border-color: #38bdf8; }
.swu-hc-head { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.swu-hc-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #f8fafc; }
.swu-hand-art-wrap { width: 100%; height: 112px; border-radius: 6px; overflow: hidden; background: #030712; border: 1px solid rgba(255, 255, 255, 0.1); cursor: zoom-in; }
.swu-hand-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.swu-hc-stats { font-size: 10px; color: #cbd5e1; font-weight: 700; display: flex; justify-content: space-between; }
.swu-hc-actions { display: flex; gap: 4px; }
.swu-hc-actions .btn { flex: 1; padding: 4px 6px; font-size: 10.5px; }
.swu-actions-bar { display: flex; flex-direction: column; gap: 6px; min-width: 145px; }
