/* tabletold — direção "Luz de vela".
   Fantasia noturna: fundo de tinta com brilho de vela, ouro de tesouro, brasa para o perigo e
   violeta arcano para a mecânica. Cinzel nos títulos, Crimson Pro na narração, Manrope na
   interface. Cantos macios, profundidade com sombras e vidro fosco nas barras.
   Mobile first; o tema segue o sistema e pode ser fixado em Ajustes (data-theme):
   "Noite" (padrão escuro) e "Pergaminho" (claro). */

:root {
  --bg: #F3ECDD;
  --bg-deep: #E9DFCB;
  --surface: #FFFBF3;
  --surface-2: #F8F0E1;
  --surface-3: #EEE3CD;
  --glass: rgb(251 246 236 / 0.78);
  --line: rgb(120 84 30 / 0.2);
  --line-soft: rgb(60 40 20 / 0.09);
  --text: #271E15;
  --text-2: #66584A;
  --gold: #9A6A18;
  --gold-hi: #F0CB82;
  --gold-lo: #D19E47;
  --on-gold: #23170A;
  --gold-glow: rgb(209 158 71 / 0.35);
  --gold-soft: rgb(209 158 71 / 0.14);
  --ember: #B5432A;
  --ember-soft: rgb(181 67 42 / 0.1);
  --arcane: #5847C4;
  --arcane-soft: rgb(88 71 196 / 0.08);
  --arcane-line: rgb(88 71 196 / 0.28);
  --ok: #2F7D5B;
  --scrim: rgb(28 20 12 / 0.45);
  --shadow-1: 0 1px 2px rgb(80 55 20 / 0.08), 0 4px 14px rgb(80 55 20 / 0.08);
  --shadow-2: 0 2px 6px rgb(80 55 20 / 0.1), 0 18px 40px rgb(80 55 20 / 0.14);
  --page-glow-1: rgb(233 180 90 / 0.28);
  --page-glow-2: rgb(120 96 220 / 0.1);
  --grain-opacity: 0.35;

  --r-s: 10px;
  --r-m: 14px;
  --r-l: 20px;
  --r-xl: 28px;
  --f-titulo: "Cinzel", "Trajan Pro", Georgia, serif;
  --f-prosa: "Crimson Pro", "Iowan Old Style", Georgia, serif;
  --f-ui: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D0B12;
    --bg-deep: #08070C;
    --surface: #17141F;
    --surface-2: #1F1B29;
    --surface-3: #2A2537;
    --glass: rgb(16 14 22 / 0.72);
    --line: rgb(227 181 99 / 0.18);
    --line-soft: rgb(238 231 216 / 0.08);
    --text: #EEE7D8;
    --text-2: #ABA293;
    --gold: #E6B866;
    --gold-hi: #F2CD85;
    --gold-lo: #C8913C;
    --on-gold: #1C1307;
    --gold-glow: rgb(227 181 99 / 0.28);
    --gold-soft: rgb(227 181 99 / 0.1);
    --ember: #F07B54;
    --ember-soft: rgb(240 123 84 / 0.12);
    --arcane: #A898FF;
    --arcane-soft: rgb(168 152 255 / 0.1);
    --arcane-line: rgb(168 152 255 / 0.3);
    --ok: #6BD3A4;
    --scrim: rgb(0 0 0 / 0.6);
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4), 0 6px 18px rgb(0 0 0 / 0.3);
    --shadow-2: 0 2px 8px rgb(0 0 0 / 0.5), 0 24px 50px rgb(0 0 0 / 0.5);
    --page-glow-1: rgb(227 160 80 / 0.13);
    --page-glow-2: rgb(120 96 240 / 0.1);
    --grain-opacity: 0.5;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0D0B12;
  --bg-deep: #08070C;
  --surface: #17141F;
  --surface-2: #1F1B29;
  --surface-3: #2A2537;
  --glass: rgb(16 14 22 / 0.72);
  --line: rgb(227 181 99 / 0.18);
  --line-soft: rgb(238 231 216 / 0.08);
  --text: #EEE7D8;
  --text-2: #ABA293;
  --gold: #E6B866;
  --gold-hi: #F2CD85;
  --gold-lo: #C8913C;
  --on-gold: #1C1307;
  --gold-glow: rgb(227 181 99 / 0.28);
  --gold-soft: rgb(227 181 99 / 0.1);
  --ember: #F07B54;
  --ember-soft: rgb(240 123 84 / 0.12);
  --arcane: #A898FF;
  --arcane-soft: rgb(168 152 255 / 0.1);
  --arcane-line: rgb(168 152 255 / 0.3);
  --ok: #6BD3A4;
  --scrim: rgb(0 0 0 / 0.6);
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4), 0 6px 18px rgb(0 0 0 / 0.3);
  --shadow-2: 0 2px 8px rgb(0 0 0 / 0.5), 0 24px 50px rgb(0 0 0 / 0.5);
  --page-glow-1: rgb(227 160 80 / 0.13);
  --page-glow-2: rgb(120 96 240 / 0.1);
  --grain-opacity: 0.5;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }
html { background: var(--bg); }

body {
  position: relative;
  background:
    radial-gradient(900px 520px at 50% -140px, var(--page-glow-1), transparent 70%),
    radial-gradient(700px 480px at 110% 110%, var(--page-glow-2), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 400 16px/1.5 var(--f-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* grão de papel/poeira estelar bem leve sobre o fundo */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cg fill='%23c9a76a' fill-opacity='.18'%3E%3Ccircle cx='12' cy='20' r='.7'/%3E%3Ccircle cx='80' cy='44' r='.5'/%3E%3Ccircle cx='140' cy='14' r='.8'/%3E%3Ccircle cx='40' cy='110' r='.6'/%3E%3Ccircle cx='120' cy='96' r='.5'/%3E%3Ccircle cx='170' cy='150' r='.7'/%3E%3Ccircle cx='66' cy='164' r='.5'/%3E%3Ccircle cx='100' cy='140' r='.4'/%3E%3Ccircle cx='24' cy='70' r='.4'/%3E%3C/g%3E%3C/svg%3E");
}

a { color: var(--gold); text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--gold-glow); }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0.3; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes flick { 0%, 100% { transform: scaleY(1) skewX(0); } 33% { transform: scaleY(1.06) skewX(-2deg); } 66% { transform: scaleY(0.95) skewX(2deg); } }
@keyframes bob { 0%, 80%, 100% { transform: translateY(0); opacity: 0.35; } 40% { transform: translateY(-4px); opacity: 1; } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 var(--gold-glow); } 100% { box-shadow: 0 0 0 14px transparent; } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(4deg); } }

.scene-art .tw { animation: twinkle 3.2s ease-in-out infinite; }
.scene-art .tw2 { animation-delay: 1.1s; }
.scene-art .tw3 { animation-delay: 2.2s; }
.scene-art .flick { transform-box: fill-box; transform-origin: 50% 100%; animation: flick 0.9s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- casca ---------- */

#app { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.boot { flex: 1; display: grid; place-items: center; align-content: center; gap: 14px; }
.boot-mark { margin: 0; font: 600 26px var(--f-titulo); letter-spacing: 0.08em; color: var(--gold); animation: fade 1.2s var(--ease) infinite alternate; }

.page {
  width: 100%; max-width: 720px; margin: 0 auto;
  padding: 18px var(--gutter) calc(40px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 22px;
  animation: fade-up 0.35s var(--ease);
}
.page.narrow { max-width: 520px; }

.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; min-height: 60px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--line-soft);
}
.topbar h1 { margin: 0; flex: 1; min-width: 0; padding-left: 4px; font: 600 19px/1.2 var(--f-titulo); letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .sub { display: block; font: 500 12.5px var(--f-ui); letter-spacing: 0; color: var(--text-2); }
.topbar .brand-lockup { flex: 1; }

.brand-lockup { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: inherit; }
.brand-lockup .emblem { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 3px 8px var(--gold-glow)); }
.brand { font: 700 19px var(--f-titulo); letter-spacing: 0.06em; }

.emblem { display: block; }

/* ---------- botões e campos ---------- */

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 20px;
  border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--surface-2); color: var(--text);
  font: 600 15px var(--f-ui); letter-spacing: 0.01em; text-decoration: none; cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s, border-color 0.2s;
}
.btn svg { width: 20px; height: 20px; flex: none; }
@media (hover: hover) {
  .btn:hover:not([disabled]) { transform: translateY(-1px); border-color: var(--gold-lo); }
  .btn-primary:hover:not([disabled]) { box-shadow: 0 8px 26px var(--gold-glow), inset 0 1px 0 rgb(255 255 255 / 0.45); }
}
.btn:active:not([disabled]) { transform: translateY(1px) scale(0.99); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn-primary {
  border-color: transparent;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo));
  color: var(--on-gold);
  box-shadow: 0 6px 20px var(--gold-glow), inset 0 1px 0 rgb(255 255 255 / 0.45), inset 0 -2px 0 rgb(0 0 0 / 0.12);
}
.btn-block { width: 100%; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); }
.btn-small { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: var(--r-s); }
.btn-danger { color: var(--ember); }
.btn .chev { margin-left: auto; opacity: 0.6; }

.icon-btn {
  width: 44px; height: 44px; flex: none; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--text); cursor: pointer;
  transition: background-color 0.2s;
}
.icon-btn:hover { background: var(--line-soft); }
.icon-btn.boxed { border-color: var(--line); background: var(--surface); }
.icon-btn svg { width: 22px; height: 22px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label, .field .label { font-weight: 600; font-size: 14px; }
.field .hint { font-size: 13px; color: var(--text-2); }
.input, .textarea, .select {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--surface); font-size: 16px;
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.06);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-2); opacity: 0.75; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--gold-lo); box-shadow: 0 0 0 4px var(--gold-soft); }
.select {
  appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8893a' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.code-input { font: 600 30px var(--f-titulo); letter-spacing: 0.4em; text-align: center; padding-left: 0.4em; }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--gold-lo); }

.error-text { color: var(--ember); font-weight: 600; font-size: 14px; margin: 0; }
.error-text:empty { display: none; }

/* cartões de escolha (ritmo da mesa) */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.choice-card {
  position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card svg { width: 22px; height: 22px; color: var(--gold); margin-bottom: 4px; }
.choice-card strong { font-size: 15px; }
.choice-card small { font-size: 12.5px; color: var(--text-2); line-height: 1.35; }
.choice-card:has(input:checked) { border-color: var(--gold-lo); background: var(--gold-soft); box-shadow: 0 0 0 3px var(--gold-soft); }
.choice-card:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }

.seat-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stepper { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.stepper button {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); cursor: pointer; display: grid; place-items: center;
}
.stepper button svg { width: 18px; height: 18px; }
.stepper output { min-width: 42px; text-align: center; font: 600 22px var(--f-titulo); }

/* ---------- blocos ---------- */

.card {
  position: relative;
  border: 1px solid var(--line-soft); border-radius: var(--r-l);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-1);
  padding: 20px;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06);
}
.card h2, .section-title { margin: 0 0 4px; font: 600 19px/1.25 var(--f-titulo); letter-spacing: 0.02em; }
.card h2 + p { margin-top: 0; }
.card.glow { border-color: var(--line); box-shadow: var(--shadow-2), 0 0 0 1px var(--gold-soft); }

.section-head { display: flex; align-items: center; gap: 10px; }
.section-head .section-title { margin: 0; }
.section-head .rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.section-head .count { font-size: 13px; color: var(--text-2); }

.card-head { display: flex; align-items: center; gap: 12px; }
.card-head .ico {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px;
  background: var(--gold-soft); color: var(--gold);
}
.card-head .ico svg { width: 22px; height: 22px; }
.card-head h2 { margin: 0; }

.muted { color: var(--text-2); }
.small { font-size: 13px; }
.prose { font: 19px/1.55 var(--f-prosa); }
.m0 { margin: 0; }

.eyebrow { margin: 0; font: 700 11.5px var(--f-ui); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 2px 10px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2);
  font: 600 12px var(--f-ui); color: var(--text-2); white-space: nowrap;
}
.chip svg { width: 14px; height: 14px; }
.chip.gold { color: var(--gold); background: var(--gold-soft); border-color: var(--line); }
.chip.ember { color: var(--ember); background: var(--ember-soft); border-color: transparent; }
.chip.arcane { color: var(--arcane); background: var(--arcane-soft); border-color: var(--arcane-line); }

/* ---------- entrar ---------- */

.auth { width: 100%; max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; }
.auth-hero { position: relative; overflow: hidden; background: #07061A; }
.auth-hero .hero-art { display: block; width: 100%; height: clamp(250px, 42vh, 360px); }
.auth-hero::after {
  content: ""; position: absolute; inset: auto 0 0; height: 45%;
  background: linear-gradient(180deg, transparent, var(--bg));
}
.auth-brand {
  position: relative; z-index: 2; margin-top: -86px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 0 var(--gutter);
}
.auth-brand .emblem { width: 76px; height: 76px; filter: drop-shadow(0 8px 24px rgb(227 181 99 / 0.45)); animation: float 6s ease-in-out infinite; }
.auth-brand h1 { margin: 6px 0 0; font: 700 38px/1 var(--f-titulo); letter-spacing: 0.06em; }
.auth-brand .tagline { margin: 4px 0 0; font: italic 19px/1.4 var(--f-prosa); color: var(--text-2); max-width: 30ch; }
.auth-body { width: 100%; max-width: 480px; margin: 0 auto; padding: 22px var(--gutter) calc(32px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 18px; }

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.feature {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; text-align: center;
  border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line-soft);
}
.feature .ico { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--gold-soft); color: var(--gold); }
.feature .ico svg { width: 19px; height: 19px; }
.feature strong { font-size: 13px; line-height: 1.2; }
.feature span { font-size: 11.5px; color: var(--text-2); line-height: 1.3; }

.divider { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--text-2); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

.legal { margin: 0; text-align: center; font-size: 12.5px; color: var(--text-2); }

.dev-note {
  display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: var(--r-s);
  background: var(--arcane-soft); border: 1px dashed var(--arcane-line); color: var(--arcane); font-size: 13.5px;
}
.dev-note b { font-family: var(--f-titulo); letter-spacing: 0.2em; }

@media (min-width: 900px) {
  .auth { flex-direction: row; min-height: 100dvh; padding: 32px; gap: 40px; align-items: stretch; }
  .auth { align-items: center; }
  .auth-hero { flex: 1.3; border-radius: var(--r-xl); box-shadow: var(--shadow-2); }
  .auth-hero .hero-art { height: auto; aspect-ratio: 400 / 290; }
  .auth-hero::after { display: none; }
  .auth-side { flex: 1; display: flex; flex-direction: column; justify-content: center; }
  .auth-brand { margin-top: 0; }
}

/* ---------- início ---------- */

.greeting { display: flex; flex-direction: column; gap: 4px; }
.greeting h2 { margin: 0; font: 600 27px/1.15 var(--f-titulo); letter-spacing: 0.01em; }
.greeting p { margin: 0; font: italic 18px/1.4 var(--f-prosa); color: var(--text-2); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; min-height: 132px; padding: 16px;
  border-radius: var(--r-l); border: 1px solid var(--line-soft); background: var(--surface);
  color: var(--text); text-decoration: none; box-shadow: var(--shadow-1);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.tile .ico { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--gold-soft); color: var(--gold); }
.tile .ico svg { width: 22px; height: 22px; }
.tile strong { font: 600 16px/1.2 var(--f-titulo); letter-spacing: 0.02em; }
.tile span { font-size: 13px; color: var(--text-2); line-height: 1.35; }
.tile.primary { background: linear-gradient(150deg, var(--gold-hi), var(--gold-lo)); color: var(--on-gold); border-color: transparent; box-shadow: 0 10px 30px var(--gold-glow); }
.tile.primary .ico { background: rgb(0 0 0 / 0.12); color: var(--on-gold); }
.tile.primary span { color: rgb(35 23 10 / 0.75); }
.tile::after {
  content: ""; position: absolute; right: -30px; bottom: -30px; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, rgb(255 255 255 / 0.18), transparent 70%);
}

/* listas de mesas e jogadores */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 14px;
  border-radius: var(--r-l); border: 1px solid var(--line-soft);
  background: var(--surface); color: var(--text); text-decoration: none; box-shadow: var(--shadow-1);
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}
a.list-item:hover { transform: translateY(-1px); border-color: var(--line); box-shadow: var(--shadow-2); }
.list-item .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.list-item strong { display: block; font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item small { color: var(--text-2); font-size: 13px; }
.list-item .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.list-item > svg, .table-card .body > svg { width: 20px; height: 20px; color: var(--text-2); flex: none; }
.list-item.table-card { padding: 0; overflow: hidden; flex-direction: column; align-items: stretch; gap: 0; }
.table-card .banner { position: relative; height: 92px; overflow: hidden; }
.table-card .banner .scene-art { display: block; width: 100%; height: 100%; }
.table-card .banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgb(0 0 0 / 0.35)); }
.table-card .body { display: flex; align-items: center; gap: 12px; padding: 12px 14px 14px; }
.table-card .crest { margin-top: -34px; z-index: 1; }

.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--ember); color: #fff; font: 700 11.5px var(--f-ui);
}

/* brasão e avatar gerados */
.crest { position: relative; width: 46px; height: 52px; flex: none; display: grid; place-items: center; filter: drop-shadow(0 4px 10px rgb(0 0 0 / 0.25)); }
.crest svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.crest svg path { fill: var(--b); stroke: var(--a); stroke-width: 2.5; }
.crest b { position: relative; margin-top: -4px; font: 700 20px var(--f-titulo); color: #FFF7E6; text-shadow: 0 1px 2px rgb(0 0 0 / 0.4); }

.avatar {
  width: 36px; height: 36px; flex: none; display: inline-grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, var(--a), var(--b));
  color: #FFF7E6; font: 700 15px var(--f-titulo); text-shadow: 0 1px 2px rgb(0 0 0 / 0.35);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--a);
}
.avatar.sm { width: 28px; height: 28px; font-size: 12.5px; }
.avatar.lg { width: 48px; height: 48px; font-size: 20px; }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  padding: 28px 20px; border-radius: var(--r-l); border: 1px dashed var(--line); background: var(--surface);
}
.empty .emblem { width: 52px; height: 52px; opacity: 0.9; }
.empty p { margin: 0; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .btn { flex: 1 1 160px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.tight { gap: 8px; }

/* capa de mesa (entrar, preparação) */
.banner-card { position: relative; overflow: hidden; border-radius: var(--r-l); box-shadow: var(--shadow-2); }
.banner-card .scene-art { display: block; width: 100%; height: 170px; }
.banner-card .cap {
  position: absolute; inset: auto 0 0; padding: 40px 18px 16px; color: #FFF6E3;
  background: linear-gradient(180deg, transparent, rgb(8 6 14 / 0.85));
}
.banner-card .cap small { font: 700 11px var(--f-ui); letter-spacing: 0.16em; text-transform: uppercase; color: #F2CD85; }
.banner-card .cap strong { display: block; font: 600 24px/1.15 var(--f-titulo); }
.banner-card .cap span { display: block; margin-top: 2px; font-size: 13.5px; opacity: 0.85; }

/* ---------- mesa: cabeçalho, painel, abas ---------- */

.table-view { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }

.table-head {
  flex: none; position: relative; z-index: 4;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid var(--line-soft);
  padding: 6px 10px 10px; display: flex; flex-direction: column; gap: 8px;
}
.table-head > * { width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; }
.table-head .line { display: flex; align-items: center; gap: 6px; }
.table-head h1 { margin: 0; font: 600 17.5px/1.2 var(--f-titulo); letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-head .titles { flex: 1; min-width: 0; padding-left: 2px; }
.table-head .titles span { display: block; font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.me-btn {
  position: relative; width: 44px; height: 44px; flex: none; padding: 0; border: 0; border-radius: 50%;
  background: none; cursor: pointer; display: grid; place-items: center;
}
.me-btn .avatar { width: 38px; height: 38px; font-size: 16px; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--gold-lo); }

.panel-strip {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 6px 4px 4px; width: 100%;
  border: 1px solid var(--line-soft); border-radius: 999px; background: var(--surface);
  cursor: pointer; text-align: left; font-size: 12.5px; color: var(--text-2);
}
.panel-strip > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.panel-strip > span:first-child {
  padding: 5px 11px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-weight: 700;
}
.panel-strip > span.grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: block; }
.panel-strip > span:last-child { color: var(--text-2); }
.panel-strip svg { width: 18px; height: 18px; }
.panel-strip.low > span:first-child { background: var(--ember-soft); color: var(--ember); }

.tabs { position: relative; display: flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--surface-3); }
.tab {
  flex: 1; min-height: 36px; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
  font: 600 14px var(--f-ui); color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.tab svg { width: 16px; height: 16px; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.tab .badge { margin-left: 2px; }

.initiative {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none;
}
.initiative::-webkit-scrollbar { display: none; }
.initiative .ini {
  flex: none; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 12px 4px 4px;
  border-radius: 999px; border: 1px solid var(--line-soft); background: var(--surface); font-size: 13px;
}
.initiative .ini .n {
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%;
  background: var(--surface-3); font: 600 13px var(--f-titulo);
}
.initiative .ini .name { font-weight: 700; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.initiative .ini .hp { color: var(--text-2); font-size: 12px; }
.initiative .ini.current { border-color: var(--gold-lo); background: var(--gold-soft); animation: pulse-ring 1.8s ease-out infinite; }
.initiative .ini.current .n { background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); color: var(--on-gold); }

/* ---------- mesa: fio ---------- */

.thread {
  flex: 1; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: auto;
  padding: 18px var(--gutter) 16px; display: flex; flex-direction: column; gap: 16px;
}
.thread > * { width: 100%; max-width: 720px; margin-left: auto; margin-right: auto; animation: fade-up 0.3s var(--ease); }
.thread > .p-speech { margin-left: 0; margin-right: 0; }
.thread-more { align-self: center; width: auto !important; }

.gm-tag {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px;
  font: 700 11px var(--f-ui); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold);
}
.gm-tag svg { width: 14px; height: 14px; }

.p-narration { font: 18.5px/1.5 var(--f-prosa); overflow-wrap: anywhere; color: var(--text); }
.p-narration b, .p-narration strong { font-weight: 600; color: var(--gold); }
.p-narration blockquote, .p-mech blockquote, .p-private blockquote {
  margin: 8px 0; padding: 6px 14px; border-left: 3px solid var(--gold-lo); background: var(--gold-soft); border-radius: 0 10px 10px 0;
}
.narr {
  position: relative; padding: 14px 16px 16px 18px; border-radius: var(--r-l);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line-soft); box-shadow: var(--shadow-1);
}
.narr::before {
  content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo));
}
.narr .actions { margin-top: 12px; }

.p-scene-wrap { display: flex; flex-direction: column; gap: 0; }
.p-scene { position: relative; margin: 0; overflow: hidden; border-radius: var(--r-l) var(--r-l) 0 0; background: #07061A; }
.p-scene .scene-art { display: block; width: 100%; height: 150px; }
.p-scene .cap {
  position: absolute; inset: auto 0 0; display: flex; flex-direction: column; gap: 2px; padding: 36px 18px 14px;
  background: linear-gradient(180deg, transparent, rgb(8 6 14 / 0.88)); color: #FFF6E3;
}
.p-scene .cap small { font: 700 10.5px var(--f-ui); letter-spacing: 0.2em; text-transform: uppercase; color: #F2CD85; }
.p-scene .cap strong { font: 600 22px/1.15 var(--f-titulo); letter-spacing: 0.02em; }
.p-scene-wrap .narr { border-radius: 0 0 var(--r-l) var(--r-l); border-top: 0; }
.p-scene-wrap .narr::before { display: none; }
.p-scene-wrap .p-narration::first-letter {
  float: left; margin: 6px 8px 0 0; font: 600 46px/0.8 var(--f-titulo); color: var(--gold);
}

.p-speech { max-width: 86%; display: flex; gap: 8px; align-items: flex-end; align-self: flex-start; }
.p-speech .col { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.p-speech .who { padding: 0 4px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.p-speech .bubble {
  padding: 10px 14px; border-radius: 18px 18px 18px 6px; border: 1px solid var(--line-soft);
  background: var(--surface); font-size: 15.5px; line-height: 1.45; overflow-wrap: anywhere; box-shadow: var(--shadow-1);
}
.p-speech.mine { align-self: flex-end; flex-direction: row-reverse; }
.p-speech.mine .col { align-items: flex-end; }
.who-private { font-weight: 500; color: var(--arcane); }
.p-speech.mine .bubble {
  border-radius: 18px 18px 6px 18px; border-color: transparent;
  background: linear-gradient(160deg, var(--gold-hi), var(--gold-lo)); color: var(--on-gold);
}
.p-speech.pending .bubble { opacity: 0.6; }
.p-speech.failed .bubble { background: var(--ember-soft); color: var(--ember); border: 1px dashed var(--ember); }
.p-speech .state { padding: 0 4px; font-size: 11.5px; color: var(--text-2); }

.p-mech { align-self: flex-start; max-width: 100%; display: flex; flex-direction: column; gap: 8px; }
.p-mech details, .p-mech .mech-line {
  border-radius: var(--r-m); border: 1px solid var(--arcane-line); background: var(--arcane-soft);
  overflow: hidden;
}
.p-mech summary, .p-mech .mech-line {
  list-style: none; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 14px 8px 8px; font-size: 14.5px;
}
.p-mech summary { cursor: pointer; }
.p-mech summary::-webkit-details-marker { display: none; }
.p-mech .die {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px;
  background: var(--arcane); color: var(--surface);
}
.p-mech .die svg { width: 20px; height: 20px; }
.p-mech summary::after {
  content: ""; width: 18px; height: 18px; margin-left: auto; flex: none; opacity: 0.7;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
  transition: transform 0.2s var(--ease);
}
.p-mech details[open] summary::after { transform: rotate(180deg); }
.p-mech summary b, .p-mech .mech-line b { color: var(--arcane); font-size: 1.1em; }
.p-mech .big { font: 600 20px var(--f-titulo); }
.p-mech .body { padding: 10px 14px 14px 54px; border-top: 1px solid var(--arcane-line); font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }

/* ---------- Fase 123: a figurinha do dado ----------
   A ficha redonda da pele equipada, colada torta com contorno branco como as figurinhas, e o
   natural grande por cima. 20 natural: aro de ouro e um raio de luz; 1 natural: brasa e rachadura. */
.p-mech.has-roll summary, .p-mech.has-roll .mech-line { gap: 14px; padding: 10px 12px 10px 10px; align-items: center; }
.p-mech.has-roll .body { padding-left: 14px; }
.rf-sticker { position: relative; flex: none; display: inline-flex; align-items: center; transform: rotate(-7deg); }
.rf-sticker.pair { padding-right: 4px; }
.rf-die {
  --rf-size: 52px;
  position: relative; flex: none; width: var(--rf-size); height: var(--rf-size); border-radius: 50%;
  display: grid; place-items: center; background: #D5BB99;
  box-shadow: 0 0 0 2.5px #FFFDF8, 0 0 0 3.5px rgb(120 86 40 / 0.35), 0 4px 10px rgb(0 0 0 / 0.32);
}
.rf-die > .rf-art, .rf-die > .rf-house { grid-area: 1 / 1; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-view-box: inset(9%); }
.rf-die.house { background: radial-gradient(circle at 35% 30%, var(--surface-3), var(--surface-2)); color: var(--text-2); }
.rf-house { display: grid; place-items: center; }
.rf-house svg { width: 70%; height: 70%; opacity: 0.55; }
.rf-n {
  grid-area: 1 / 1; z-index: 1; display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
  font: 700 calc(var(--rf-size) * 0.46) / 1 var(--f-titulo); color: #FFF8EA; letter-spacing: -0.02em;
  background: radial-gradient(circle, rgb(24 14 6 / 0.58) 0 34%, rgb(24 14 6 / 0) 66%);
  text-shadow: 0 1px 0 rgb(0 0 0 / 0.9), 0 0 6px rgb(0 0 0 / 0.75);
}
.rf-die.house .rf-n { color: var(--text); background: none; text-shadow: 0 1px 0 var(--surface); }
.rf-die.dropped { margin-left: -4px; transform: rotate(16deg) translateY(6px); opacity: 0.72; filter: grayscale(0.75); z-index: 0; }
.rf-die.dropped:first-child { margin-left: 0; margin-right: -4px; transform: rotate(-12deg) translateY(6px); }
.rf-die.dropped .rf-n { text-decoration: line-through 2px; }
.rf-sticker.pair .rf-die:not(.dropped) { z-index: 1; }
.rf-adv {
  position: absolute; left: 50%; bottom: -9px; translate: -50% 0; z-index: 2; padding: 1px 6px; border-radius: 99px;
  font: 800 9.5px/1.4 var(--f-ui); font-style: normal; letter-spacing: 0.08em; transform: rotate(7deg);
  background: var(--ok); color: #fff;
}
.rf-adv.disadvantage { background: var(--ember); }

.rf-die.crit { box-shadow: 0 0 0 2.5px var(--gold-hi), 0 0 0 4px var(--gold-lo), 0 0 18px 4px var(--gold-glow), 0 4px 10px rgb(0 0 0 / 0.3); }
.rf-die.crit .rf-n { color: #FFE7A8; text-shadow: 0 1px 0 #3A2400, 0 0 10px rgb(255 200 90 / 0.9); }
.rf-die.crit::before {
  content: ""; position: absolute; inset: -40%; z-index: -1; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgb(240 203 130 / 0.55) 0 7deg, transparent 7deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); mask: radial-gradient(circle, #000 30%, transparent 70%);
  opacity: 0.7;
}
.rf-die.fumble { box-shadow: 0 0 0 2.5px #FFFDF8, 0 0 0 4px var(--ember), 0 4px 10px rgb(0 0 0 / 0.3); }
.rf-die.fumble > .rf-art { filter: sepia(0.5) saturate(1.6) hue-rotate(-28deg) brightness(0.72); }
.rf-die.fumble .rf-n { color: #FFB49E; background: radial-gradient(circle, rgb(70 8 0 / 0.66) 0 36%, rgb(70 8 0 / 0) 68%); }
.rf-crack { grid-area: 1 / 1; z-index: 1; width: 100%; height: 100%; stroke: #1A0400; opacity: 0.92; filter: drop-shadow(0.5px 0.5px 0 rgb(255 180 160 / 0.6)); }

.fresh .rf-die.crit { animation: rf-pop 0.75s var(--ease) both; }
.fresh .rf-die.crit::before { animation: rf-rays 1.4s ease-out both; }
.fresh .rf-die.fumble { animation: rf-thud 0.5s ease-out both; }
.fresh .rf-sticker:not(:has(.crit, .fumble)) .rf-die:not(.dropped) { animation: rf-land 0.4s var(--ease) both; }
@keyframes rf-pop { 0% { transform: scale(0.5) rotate(-40deg); } 60% { transform: scale(1.18) rotate(6deg); } 100% { transform: none; } }
@keyframes rf-rays { 0% { opacity: 0; transform: rotate(-30deg) scale(0.6); } 40% { opacity: 1; } 100% { opacity: 0.7; transform: rotate(20deg) scale(1); } }
@keyframes rf-thud { 0% { transform: translateY(-10px); } 40% { transform: translateY(2px) rotate(-4deg); } 60% { transform: translateX(-2px) rotate(3deg); } 80% { transform: translateX(2px); } 100% { transform: none; } }
@keyframes rf-land { 0% { transform: scale(0.7) rotate(-25deg); opacity: 0.4; } 100% { transform: none; opacity: 1; } }

.rf-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.rf-head { font-size: 13.5px; line-height: 1.35; color: var(--text-2); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rf-result { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; color: var(--text-2); }
.rf-total { font: 700 22px/1 var(--f-titulo); color: var(--text); }
.rf-vs, .rf-mod { white-space: nowrap; }
.rf-why { flex-basis: 100%; font-size: 12px; font-weight: 600; color: var(--text-2); }
.rf-mod { margin-right: -4px; font-variant-numeric: tabular-nums; }
.rf-mark { font-weight: 800; white-space: nowrap; }
.rf-mark.ok { color: var(--ok); }
.rf-mark.bad { color: var(--ember); }
.rf-dmg { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; padding-left: 10px; border-left: 1px solid var(--arcane-line); }
.rf-dmg .rf-die { box-shadow: 0 0 0 1.5px #FFFDF8, 0 2px 4px rgb(0 0 0 / 0.3); }
.rf-dmg small { font-size: 12px; }
/* Fase 131: o dado menor mostra o natural; a conta e o total do dano vêm ao lado ("5 +3 = 8 dano") */
.rf-dmg .rf-n:empty { display: none; }
.rf-dmg-mod { margin-right: -2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rf-dmg-n { font: 700 17px/1 var(--f-titulo); color: var(--text); }
@media (min-width: 600px) {
  .rf-sticker > .rf-die:not(.dropped) { --rf-size: 60px !important; }
}

.p-private {
  position: relative; padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px;
  border-radius: var(--r-l); border: 1px dashed var(--arcane-line);
  background: linear-gradient(180deg, var(--arcane-soft), transparent), var(--surface);
}
.p-private .tag {
  display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: var(--arcane-soft); color: var(--arcane); font: 700 11.5px var(--f-ui); letter-spacing: 0.04em;
}
.p-private .tag svg { width: 13px; height: 13px; }
.p-private .txt { font: italic 17.5px/1.55 var(--f-prosa); overflow-wrap: anywhere; }
.p-private .txt.plain { font: 15px/1.5 var(--f-ui); }

.p-system {
  align-self: center; max-width: 92%; padding: 6px 14px; border-radius: 999px; text-align: center;
  background: var(--surface-3); font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere;
}
.sys-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.p-table { font-size: 15px; overflow-wrap: anywhere; padding: 12px 14px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line-soft); }

.p-turn {
  position: relative; padding: 16px; display: flex; flex-direction: column; gap: 12px;
  border-radius: var(--r-l); border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow-1);
}
.p-turn.active {
  border-color: var(--gold-lo);
  background: radial-gradient(120% 90% at 0% 0%, var(--gold-soft), transparent 60%), var(--surface);
  box-shadow: 0 0 0 3px var(--gold-soft), 0 12px 34px var(--gold-glow);
}
.p-turn .turn-tag { display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; }
.p-turn .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.p-turn h2 { margin: 0; font: 600 21px var(--f-titulo); color: var(--gold); }
.p-turn .txt { font: 17px/1.55 var(--f-prosa); overflow-wrap: anywhere; }
.p-turn:not(.active) { opacity: 0.72; }

.actions { display: flex; flex-direction: column; gap: 8px; }
.actions .arow { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 auto; justify-content: flex-start; text-align: left; min-height: 46px; }

.typing {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; width: auto !important; margin-left: 0 !important;
  padding: 10px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-soft);
  font: italic 15px var(--f-prosa); color: var(--text-2);
}
.typing .dots { display: flex; gap: 4px; }
.typing .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); animation: bob 1.2s infinite; }
.typing .dots i:nth-child(2) { animation-delay: 0.15s; }
.typing .dots i:nth-child(3) { animation-delay: 0.3s; }

.day-sep { align-self: center; font-size: 12px; color: var(--text-2); }

.lobby { display: flex; flex-direction: column; gap: 16px; }

/* ---------- composer ---------- */

.composer {
  flex: none; position: relative; z-index: 3;
  padding: 10px 12px calc(12px + var(--safe-bottom));
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  border-top: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 8px;
}
.composer > * { width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; }
.composer form {
  display: flex; align-items: flex-end; gap: 6px; padding: 5px;
  border-radius: 26px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.composer form:focus-within { border-color: var(--gold-lo); box-shadow: 0 0 0 4px var(--gold-soft); }
.composer .input {
  min-height: 42px; flex: 1; min-width: 0; resize: none; line-height: 1.4; max-height: 140px;
  padding: 10px 6px; border: 0; background: transparent; box-shadow: none; border-radius: 0;
}
.composer .input:focus { box-shadow: none; }
.composer .input::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer .send, .composer .dice {
  width: 42px; height: 42px; flex: none; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; transition: transform 0.15s var(--ease);
}
.composer .send:active, .composer .dice:active { transform: scale(0.92); }
.composer .send { background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); color: var(--on-gold); box-shadow: 0 4px 14px var(--gold-glow); }
.composer .dice { background: var(--arcane-soft); color: var(--arcane); }
.composer .send svg, .composer .dice svg { width: 21px; height: 21px; }
.composer .usage { margin: 0; font-size: 13.5px; color: var(--ember); font-weight: 600; }
.composer .suggest { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.composer .suggest button {
  flex: none; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font: 600 13px var(--f-ui); color: var(--gold);
}

/* ---------- folhas (painel, ficha, dados) ---------- */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center;
  background: var(--scrim);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: fade 0.2s ease-out;
}
.sheet {
  position: relative; width: 100%; max-width: 640px; max-height: 88dvh; overflow-y: auto;
  background: var(--bg); border-radius: var(--r-xl) var(--r-xl) 0 0;
  border: 1px solid var(--line-soft); border-bottom: 0; box-shadow: var(--shadow-2);
  padding: 22px var(--gutter) calc(24px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 16px;
  animation: rise 0.28s var(--ease);
}
.sheet::before {
  content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px;
  border-radius: 4px; background: var(--line);
}
@media (min-width: 720px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: var(--r-xl); border-bottom: 1px solid var(--line-soft); }
  .sheet::before { display: none; }
}
.sheet-head { display: flex; align-items: center; gap: 10px; }
.sheet-head h2 { flex: 1; margin: 0; font: 600 21px var(--f-titulo); letter-spacing: 0.02em; }
.sheet .kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; font-size: 15px; align-items: center; }
.sheet .bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.sheet .bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #D8553A, #F0A35A); }
.sheet .bar.good > i { background: linear-gradient(90deg, #3E9E72, #7CD9A8); }
.sheet .section-title { font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); margin-top: 4px; }
.sheet-part { font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; padding: 14px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line-soft); }
.sheet-part b:first-child { font-family: var(--f-titulo); font-weight: 600; color: var(--gold); }

.party-member { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line-soft); }
.party-member > .ico { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--gold-soft); color: var(--gold); }
.party-member > .ico svg { width: 22px; height: 22px; }
.party-member .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.party-member .top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.party-member .top strong { font-size: 15px; }

.clock-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.clock-row .segs { display: flex; gap: 3px; margin-left: auto; }
.clock-row .segs i { width: 12px; height: 12px; border-radius: 3px; background: var(--surface-3); }
.clock-row .segs i.on { background: var(--ember); }

.dice-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dice-grid button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 84px;
  border-radius: var(--r-m); border: 1px solid var(--line-soft); background: var(--surface); cursor: pointer;
  font: 600 15px var(--f-titulo); color: var(--text); box-shadow: var(--shadow-1);
  transition: transform 0.15s var(--ease), border-color 0.2s, color 0.2s;
}
.dice-grid button svg { width: 34px; height: 34px; color: var(--arcane); transition: transform 0.4s var(--ease); }
.dice-grid button:hover { border-color: var(--arcane-line); }
.dice-grid button:hover svg { transform: rotate(18deg); }
.dice-grid button:active { transform: scale(0.95); }
.dice-grid button.d20 { grid-column: span 2; grid-row: span 2; min-height: 178px; font-size: 20px; border-color: var(--arcane-line); background: radial-gradient(circle at 50% 40%, var(--arcane-soft), transparent 70%), var(--surface); }
.dice-grid button.d20 svg { width: 72px; height: 72px; }
.dice-grid button.d100 { grid-column: span 2; }

.seg { display: flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--surface-3); }
.seg button {
  flex: 1; min-height: 40px; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
  font: 600 14px var(--f-ui); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.seg button svg { width: 16px; height: 16px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
/* Fase 129: círculos e Metamagia — várias opções quebram a linha no celular */
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { flex: 1 1 96px; padding: 0 8px; }
.seg button[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.tp-move .tp-opt { flex: 1 1 140px; }

/* Fase 115: menu de ataque (bottom sheet) */
.atk-group { display: flex; flex-direction: column; gap: 8px; }
.atk-head { margin: 4px 0 0; font: 600 13px var(--f-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.atk-sub { margin: 4px 0 0; font: 600 14px var(--f-ui); color: var(--text); }
.atk-opt, .atk-target {
  display: flex; flex-direction: column; align-items: stretch; gap: 3px; width: 100%; min-height: 48px;
  padding: 10px 12px; border-radius: var(--r-m); border: 1px solid var(--line-soft); background: var(--surface);
  color: var(--text); font: 500 15px var(--f-ui); text-align: left; cursor: pointer; box-shadow: var(--shadow-1);
}
.atk-opt:hover, .atk-target:hover { border-color: var(--line); }
.atk-opt:focus-visible, .atk-target:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.atk-opt.off, .atk-target.off { cursor: not-allowed; opacity: 0.62; box-shadow: none; }
.atk-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; }
.atk-name { flex: 1 1 auto; min-width: 40%; font-weight: 700; overflow-wrap: anywhere; }
.atk-tag { margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: var(--arcane-soft); color: var(--arcane); font-size: 11.5px; font-weight: 600; }
.atk-cost { flex: 0 1 auto; text-align: right; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.atk-line { font-size: 13.5px; color: var(--text-2); overflow-wrap: anywhere; }
.atk-why { font-size: 13px; font-weight: 600; color: var(--ember); }
.atk-notes { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; }
.atk-back { align-self: flex-start; }
.atk-chosen { display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: var(--r-m); background: var(--gold-soft); border: 1px solid var(--line); }
.atk-chosen strong { font: 600 18px var(--f-titulo); }
.atk-targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.atk-target strong { font-size: 15px; }

/* Fase 126: painel do turno — blocos Ação e Ação bônus, movimento e Encerrar turno */
.turn-panel { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.turn-panel.sent { opacity: 0.6; }
.tp-blocks { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 560px) { .tp-blocks { display: grid; grid-template-columns: 1fr 1fr; align-items: start; } }
.tp-block { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface-2); }
.tp-block.usada, .tp-block.nenhuma { border-style: dashed; }
.tp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tp-head h3 { margin: 0; font: 700 13px var(--f-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.tp-state { font: 600 12px var(--f-ui); color: var(--text-2); }
.tp-state.livre { color: var(--gold); }
.tp-main { display: flex; flex-wrap: wrap; gap: 6px; }
.tp-main .btn { flex: 1 1 140px; min-height: 44px; }
.tp-main .btn.off { opacity: 0.55; cursor: not-allowed; }
.tp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.tp-opt {
  display: flex; flex-direction: column; align-items: stretch; gap: 1px; min-height: 44px; padding: 6px 8px;
  border-radius: 10px; border: 1px solid var(--line-soft); background: var(--surface); color: var(--text);
  font: 500 13px var(--f-ui); text-align: left; cursor: pointer;
}
.tp-opt:hover { border-color: var(--line); }
.tp-opt:focus-visible, .tp-main .btn:focus-visible, .tp-end:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tp-opt.off { cursor: not-allowed; opacity: 0.6; }
.tp-name { font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.tp-line { font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.tp-why { font-size: 12px; font-weight: 600; color: var(--ember); }
.tp-empty { margin: 0; font-size: 13px; color: var(--text-2); }
.tp-stand { margin-bottom: 8px; }
.tp-stand-note { margin: 0; font-size: 13px; line-height: 1.35; color: var(--text-2); }
.tp-move { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tp-move-label { display: inline-flex; gap: 6px; align-items: baseline; font: 700 13px var(--f-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.tp-move-label strong { letter-spacing: 0; text-transform: none; font-size: 14px; color: var(--text); }
.arena-dock .turn-panel { margin-top: 0; }
.arena-dock .tp-block { background: #231915; border-color: rgb(240 163 90 / 0.25); }
.arena-dock .tp-opt { background: #2A1E1A; border-color: rgb(240 163 90 / 0.3); color: var(--arena-ink, #F6ECD8); }
.arena-dock .tp-line, .arena-dock .tp-state, .arena-dock .tp-empty { color: rgb(246 236 216 / 0.72); }
.arena-dock .tp-head h3, .arena-dock .tp-move-label, .arena-dock .tp-state.livre { color: var(--arena-fire, #F0A35A); }
.arena-dock .tp-move-label strong { color: var(--arena-ink, #F6ECD8); }
.arena-dock .tp-why { color: #FF9A7A; }

/* Fase 133: o turno no celular — faixa de estado, uma opção por linha, detalhe na folha e
   "Encerrar turno" sempre à vista. Na arena o painel é uma doca: a faixa e o rodapé ficam
   parados e só o meio rola. */
.tp-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tp-you { font: 600 16px var(--f-titulo); color: var(--gold); margin-right: 2px; }
.tp-pill { display: inline-flex; align-items: center; min-height: 26px; padding: 2px 10px; border-radius: 999px; font: 700 12.5px var(--f-ui); border: 1px solid var(--line-soft); color: var(--text-2); }
.tp-pill.free { border-color: var(--gold); background: var(--gold-soft); color: var(--text); }
.tp-pill.used { color: var(--text-2); opacity: 0.75; }
.tp-pill.none { border-style: dashed; opacity: 0.7; }
.tp-body { display: flex; flex-direction: column; gap: 8px; }
.tp-rows { display: flex; flex-direction: column; gap: 6px; }
.tp-row {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 10px 8px 12px;
  border-radius: 12px; border: 1px solid var(--line-soft); background: var(--surface); color: var(--text);
  font: 500 14px var(--f-ui); text-align: left; cursor: pointer;
}
.tp-row:hover { border-color: var(--line); }
.tp-row:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tp-row.off { opacity: 0.62; }
.tp-row-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tp-row .tp-line { font-size: 13px; line-height: 1.35; }
.tp-row .tp-why { font-size: 12.5px; }
.tp-chev { flex: 0 0 auto; font: 400 22px/1 var(--f-ui); color: var(--text-2); }
.tp-row.primary { border-color: transparent; background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); color: var(--on-gold); }
.tp-row.primary .tp-line, .tp-row.primary .tp-chev { color: var(--on-gold); opacity: 0.85; }
.tp-block.lead { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 18px var(--gold-glow); animation: tp-lead 0.5s var(--ease) 1; }
@keyframes tp-lead { from { transform: translateY(6px); opacity: 0.4; } to { transform: none; opacity: 1; } }
/* Fase 140: Ação e Ação bônus são dois botões que abrem o menu (nada abre sozinho) */
.tp-launchers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tp-launch {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 56px; padding: 8px 12px;
  border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface-2); color: var(--text); text-align: left; cursor: pointer;
}
.tp-launch:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tp-launch.lead { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 18px var(--gold-glow); }
.tp-launch.usada, .tp-launch.nenhuma, .tp-launch.off { border-style: dashed; opacity: 0.62; box-shadow: none; }
.arena-dock .tp-launch { background: #2A1E1A; border-color: rgb(240 163 90 / 0.3); color: var(--arena-ink, #F6ECD8); }
.arena-dock .tp-launch.lead { border-color: var(--arena-fire, #F0A35A); box-shadow: 0 0 0 1px var(--arena-fire, #F0A35A), 0 0 22px rgb(240 163 90 / 0.28); }
.arena-dock .tp-launch .tp-line { color: rgb(246 236 216 / 0.72); }
.tp-foot { display: flex; flex-direction: column; gap: 6px; }
.tp-end { min-height: 52px; font: 700 16px var(--f-ui); }
.tp-end.armed { border-color: var(--ember); color: var(--ember); }
.tp-confirm { margin: 0; font-size: 13px; text-align: center; color: var(--text-2); }
.atk-chosen .atk-cost { text-align: left; }
.tp-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 6px 0 0; font-size: 14px; }
.tp-facts dt { font: 700 11.5px var(--f-ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); padding-top: 2px; }
.tp-facts dd { margin: 0; overflow-wrap: anywhere; }
.arena-dock .tp-you { color: var(--arena-fire, #F0A35A); }
.arena-dock .tp-pill { border-color: rgb(240 163 90 / 0.25); color: rgb(246 236 216 / 0.7); }
.arena-dock .tp-pill.free { border-color: var(--arena-fire, #F0A35A); background: rgb(240 163 90 / 0.16); color: var(--arena-ink, #F6ECD8); }
.arena-dock .tp-row { background: #2A1E1A; border-color: rgb(240 163 90 / 0.3); color: var(--arena-ink, #F6ECD8); }
.arena-dock .tp-row.primary { border-color: transparent; color: #FFF4E0; background: linear-gradient(180deg, #F07B54, var(--arena-blood, #D8553A) 60%, #A8321D); }
.arena-dock .tp-row.primary .tp-line, .arena-dock .tp-row.primary .tp-chev { color: #FFF4E0; }
.arena-dock .tp-chev { color: rgb(240 163 90 / 0.8); }
.arena-dock .tp-block.lead { border-color: var(--arena-fire, #F0A35A); box-shadow: 0 0 0 1px var(--arena-fire, #F0A35A), 0 0 22px rgb(240 163 90 / 0.28); }
.arena-dock .tp-end { background: #2A1E1A; border-color: rgb(240 163 90 / 0.45); color: var(--arena-ink, #F6ECD8); }
.arena-dock .tp-end.armed { border-color: #FF9A7A; color: #FFB59E; }
.arena-dock .tp-confirm { color: #FFB59E; }

.rich { white-space: pre-line; }
.rich pre { white-space: pre-wrap; }
.rich code { font-size: 0.9em; padding: 1px 5px; border-radius: 6px; background: var(--surface-3); }

/* ---------- wizard ---------- */

.wiz-progress { display: flex; flex-direction: column; gap: 8px; }
.wiz-progress .meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.steps { position: relative; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.steps > b { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); box-shadow: 0 0 12px var(--gold-glow); transition: width 0.4s var(--ease); }

.wiz-title { margin: 0; font: 600 21px/1.25 var(--f-titulo); letter-spacing: 0.02em; }
.wiz-text { font-size: 17px; overflow-wrap: anywhere; }
.wiz-text b { color: var(--gold); font-weight: 600; }
.wiz-choices { display: flex; flex-direction: column; gap: 8px; }
.wiz-choices .arow { display: flex; gap: 8px; }
.wiz-choices .btn { flex: 1 1 0; min-width: 0; justify-content: flex-start; text-align: left; min-height: 52px; }
.wiz-choices .btn.selected { border-color: var(--gold-lo); background: var(--gold-soft); box-shadow: 0 0 0 3px var(--gold-soft); }
.wiz-choices .btn .tick {
  width: 22px; height: 22px; flex: none; margin-left: auto; display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); color: var(--on-gold);
}
.wiz-choices .btn .tick svg { width: 13px; height: 13px; }
.wiz-choices .arow.dense { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wiz-choices .arow.dense .btn { justify-content: center; text-align: center; min-height: 44px; padding: 0 6px; font-size: 13.5px; }
.wiz-nav { display: flex; gap: 8px; margin-top: 6px; }
.wiz-nav .btn { flex: 1; justify-content: center; }
.wiz-nav .btn-ghost { flex: 0 0 auto; }

.ability-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px;
  border-radius: var(--r-m); border: 1px solid var(--line-soft); background: var(--surface);
}
.ability-row .abbr { font: 700 15px var(--f-titulo); letter-spacing: 0.08em; width: 48px; color: var(--gold); }
.ability-row .mod { flex: 1; font-size: 13px; color: var(--text-2); }

/* atribuição do array rolado: habilidades em coluna, uma lista suspensa em cada */
.assign-list { display: flex; flex-direction: column; gap: 8px; }
.assign-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr); align-items: center; gap: 10px;
  padding: 8px 12px 8px 14px; border-radius: var(--r-m); border: 1px solid var(--line-soft); background: var(--surface);
}
.assign-name { display: flex; flex-direction: column; line-height: 1.2; cursor: pointer; }
.assign-name b { font: 700 15px var(--f-titulo); letter-spacing: 0.08em; color: var(--gold); }
.assign-name small { font-size: 12.5px; color: var(--text-2); }
.assign-row .select { min-height: 44px; padding: 8px 30px 8px 12px; font-weight: 700; background-position: right 8px center; }
.assign-result { text-align: right; font-size: 13.5px; white-space: nowrap; }
.assign-result b { font: 600 19px var(--f-titulo); }

/* equipamento e loja */
.eq-card .chip { align-self: flex-start; margin-top: 4px; }
.cart-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; font-size: 14.5px; }
.cart-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.shop-status {
  position: sticky; top: -22px; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  padding: 10px 12px; border-radius: var(--r-m); background: var(--surface-3); font-size: 14px; box-shadow: var(--shadow-1);
}
.shop-status span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.shop-status svg { width: 16px; height: 16px; color: var(--gold); }
.shop-status b { margin-left: auto; color: var(--gold); }
.shop-status b.over { color: var(--ember); }
.shop-tabs { overflow-x: auto; scrollbar-width: none; }
.shop-tabs::-webkit-scrollbar { display: none; }
.shop-tabs .tab { flex: 1 0 auto; padding: 0 12px; }
.shop-list { display: flex; flex-direction: column; gap: 8px; }
.shop-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px;
  border-radius: var(--r-m); border: 1px solid var(--line-soft); background: var(--surface);
}
.shop-item.in-cart { border-color: var(--gold-lo); background: var(--gold-soft); }
.shop-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.shop-info strong { font-size: 15px; }
.shop-info small { font-size: 12.5px; color: var(--text-2); line-height: 1.35; }
.shop-info .price { font: 600 13.5px var(--f-ui); color: var(--gold); }
.shop .stepper button { width: 40px; height: 40px; }
.shop .stepper output { min-width: 26px; font-size: 18px; }
.stepper button[disabled] { opacity: 0.4; cursor: not-allowed; }
.shop-done { position: sticky; bottom: 0; }
.sheet.shop > * { flex-shrink: 0; }

/* magias */
.spell-list { display: flex; flex-direction: column; gap: 8px; }
.spell-card {
  display: flex; flex-direction: column; gap: 6px; padding: 10px 12px;
  border-radius: var(--r-m); border: 1px solid var(--line-soft); background: var(--surface);
  transition: border-color 0.2s, background-color 0.2s;
}
.spell-card.on { border-color: var(--arcane-line); background: var(--arcane-soft); }
.spell-head { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.spell-head input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--arcane); }
.spell-head:has(input:disabled:not(:checked)) { opacity: 0.55; cursor: not-allowed; }
.spell-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.spell-title strong { font-size: 15px; }
.spell-title small { font-size: 12.5px; color: var(--text-2); }
.spell-head .chip { flex: none; }
.spell-desc > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--arcane); padding-left: 34px; }
.spell-desc > p { padding: 6px 0 2px 34px; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.spell-picked { color: var(--text-2); }

/* detalhes: alinhamento, idiomas e personalidade */
.align-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.lang-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.check.lang { align-items: center; padding: 10px 12px; border-radius: var(--r-s); border: 1px solid var(--line-soft); background: var(--surface); }
.check.lang input { margin: 0; }
.check.lang:has(input:checked) { border-color: var(--gold-lo); background: var(--gold-soft); }
.check.lang:has(input:disabled:not(:checked)) { opacity: 0.5; cursor: not-allowed; }
details.more > summary { cursor: pointer; font-weight: 600; padding: 6px 0; color: var(--gold); }
details.more[open] > summary { margin-bottom: 8px; }
.small-ta { min-height: 68px; }

/* ---------- toasts ---------- */

.toasts { position: fixed; left: 0; right: 0; bottom: calc(100px + var(--safe-bottom)); z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 var(--gutter); }
.toast {
  max-width: 520px; width: 100%; padding: 12px 16px; border-radius: var(--r-m);
  background: var(--surface-3); color: var(--text); border: 1px solid var(--line);
  box-shadow: var(--shadow-2); font-size: 14.5px; pointer-events: auto; overflow-wrap: anywhere;
  animation: fade-up 0.25s var(--ease);
}

.install-card {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r-l);
  border: 1px solid var(--line); background: linear-gradient(135deg, var(--gold-soft), transparent), var(--surface);
  font-size: 14px; box-shadow: var(--shadow-1);
}
.install-card .grow { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.install-card .stack { gap: 6px; }

@media (min-width: 720px) {
  .thread { padding-left: 24px; padding-right: 24px; }
  .tiles { gap: 16px; }
}

.boot-emblem { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 10px 40px var(--gold-glow); animation: float 5s ease-in-out infinite; }

/* ---------- arte pintada (Fase 109, img.js) ---------- */
/* As ilustrações de equipamentos, monstros, itens mágicos e ui/ têm fundo de pergaminho bege: em
   vez de recortar, viram uma placa de pergaminho com aro fino — no tema Noite parecem cartas sobre
   a mesa, no Pergaminho somem no papel. */
img.art { display: block; max-width: 100%; user-select: none; -webkit-user-drag: none; }
.art-tile {
  border-radius: 12px; background: #EFE3C8; object-fit: cover; flex: none;
  box-shadow: 0 0 0 1px rgb(120 86 40 / 0.35), 0 2px 6px rgb(0 0 0 / 0.18);
}
:root[data-theme="dark"] .art-tile { box-shadow: 0 0 0 1px rgb(242 205 133 / 0.28), 0 3px 10px rgb(0 0 0 / 0.45); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .art-tile { box-shadow: 0 0 0 1px rgb(242 205 133 / 0.28), 0 3px 10px rgb(0 0 0 / 0.45); }
}
.empty .empty-art { width: 96px; height: 96px; border-radius: 22px; }

/* combate: retrato do monstro na fila de iniciativa */
.initiative .ini .art-portrait { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px var(--ember-soft); }
.initiative .ini.has-portrait .n { width: 22px; height: 22px; font-size: 11.5px; }
.initiative .ini.down .art-portrait { filter: grayscale(1) brightness(0.7); }

/* dados pintados: no compositor, na bandeja e nas rolagens do fio */
.composer .dice .art-die { width: 32px; height: 32px; }
.composer .dice:has(.art-die), .composer .sticker-btn:has(.art) { background: transparent; }
.composer .sticker-btn .art { width: 34px; height: 34px; filter: drop-shadow(0 2px 3px rgb(0 0 0 / 0.3)); }
.dice-grid button .art-die { width: 40px; height: 40px; transition: transform 0.4s var(--ease); }
.dice-grid button.d20 .art-die { width: 80px; height: 80px; }
.dice-grid button:hover .art-die { transform: rotate(18deg); }
.p-mech .die:has(.art-die) { background: transparent; }
.p-mech .die .art-die { width: 34px; height: 34px; }

/* loja do personagem e carrinho (a .shop-item da loja de cosméticos, em rewards.css, é em coluna:
   aqui a linha fica explícita) */
.shop-list .shop-item { flex-direction: row; align-items: center; padding: 10px 10px 10px 10px; border-radius: var(--r-m); box-shadow: none; }
.shop-list .shop-item .shop-info { gap: 2px; }
.shop-item .gear-thumb { width: 52px; height: 52px; border-radius: 10px; }
.cart-list li { align-items: center; }
.cart-list li .grow { flex: 1; min-width: 0; }
.cart-list .gear-thumb { width: 28px; height: 28px; border-radius: 7px; }

/* ficha: a mochila com a arte de cada item */
.gear-part { display: flex; flex-direction: column; gap: 10px; }
.gear-gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.gear-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.gear-cell .art-tile { width: 64px; height: 64px; }
.gear-cell.magic .art-tile { box-shadow: 0 0 0 2px var(--arcane-line), 0 0 14px var(--arcane-soft); }
.gear-name { font-size: 12.5px; line-height: 1.25; overflow-wrap: anywhere; }
.gear-qty { position: absolute; top: -4px; right: calc(50% - 40px); min-width: 22px; padding: 1px 6px; border-radius: 999px; background: var(--gold); color: var(--on-gold); font: 800 11px/1.4 var(--f-ui); }
.gear-blank { width: 64px; height: 64px; display: grid; place-items: center; font-size: 30px; border-radius: 12px; background: var(--surface-2); }

/* Fase 141: Bênção do Herói Solitário — a faixa acima do campo de texto e a folha de pontos */
.boon-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--gold); background: var(--gold-soft); }
.boon-bar[hidden] { display: none; }
.boon-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.boon-text strong { font: 700 14px var(--f-ui); color: var(--text); }
.boon-text small { font-size: 12.5px; color: var(--text-2); }
.boon-left { font: 700 14px var(--f-ui); color: var(--gold); }
.boon-rows { display: flex; flex-direction: column; gap: 6px; }
.boon-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 6px 10px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface); }
.boon-name { display: flex; flex-direction: column; }
.boon-name small { font-size: 12px; color: var(--text-2); }
.boon-value { font: 700 18px var(--f-ui); min-width: 3.5ch; text-align: right; }
.boon-value em { font-style: normal; font-size: 13px; color: var(--gold); }
.boon-step { display: inline-flex; gap: 6px; }
.boon-step .btn { min-width: 44px; min-height: 44px; }

/* Fase 142: seletor do idioma da interface (PT | EN), no topo das telas */
.lang-switch { flex: 0 0 auto; display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface-3); }
.lang-switch button { min-width: 40px; min-height: 32px; padding: 0 8px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font: 700 12.5px var(--f-ui); letter-spacing: 0.04em; cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.lang-switch button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.auth-lang { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 2; }

/* Fase 144: seletor do idioma do jogador numa mesa multilíngue */
.lang-pick { width: auto; min-width: 0; max-width: 9.5rem; flex: 0 0 auto; padding: 4px 8px; font-size: 0.85rem; }

/* Fase 144 (fase D): "ver original" em fala de jogador traduzida */
.p-speech .see-original { background: none; border: 0; padding: 2px 4px; font-size: 11px; color: var(--muted, #888); cursor: pointer; text-decoration: underline; }

/* Fase 148: introdução ao mundo da campanha (nova mesa e assistente de personagem) */
details.campaign-intro { margin-top: 8px; border: 1px solid var(--line, #d9cdb6); border-radius: 10px; padding: 8px 12px; }
details.campaign-intro > summary { cursor: pointer; font-weight: 600; color: var(--gold); }
details.campaign-intro[open] > summary { margin-bottom: 8px; }
details.campaign-intro .campaign-intro-text { display: grid; gap: 8px; font-size: 0.95em; line-height: 1.45; }
