/* Layout: tabloide gótico-punk. Faixa preta com sangue escorrendo no topo; mesas como cartazes lambe-lambe rasgados;
   a sala é uma mesa de bar sob luz baixa; a ficha é sempre papel xerocado; impressão "fora de registro" nos títulos. */
/* Fonte do Mural de Recados: Fixedsys Excelsior (domínio público), embutida no servidor. */
@font-face { font-family: 'Fixedsys Excelsior'; src: url('fonts/fixedsys-excelsior.woff') format('woff'); font-display: swap; }
:root {
  /* Marca */
  --night: #0B0A0B;
  --bone: #ECE5D6;
  --blood: #B3121F;
  --ash: #A69C8E;

  /* Papéis: tema Noite (padrão) */
  --bg: #0B0A0B;
  --surface: #151214;
  --surface-2: #1B1719;
  --surface-3: #282124;
  --ink: #ECE5D6;
  --muted: #A69C8E;
  --line: #2F282B;
  --line-strong: #4F4347;
  --chrome: #050405;
  --chrome-2: #1A1416;
  --on-chrome: #ECE5D6;
  --on-chrome-muted: #9C9284;
  --hl: #F0505C;              /* texto de destaque legível sobre a superfície */
  --dot: #ECE5D6;
  --focus: #ECE5D6;
  --accent: #B3121F;          /* preenchimento de ação */
  --accent-ink: #F6EFE2;
  --accent-deep: #5E0910;     /* sombra de impressão fora de registro */
  --fill: #B3121F;
  --on-fill: #F6EFE2;
  --switch-on: #B3121F;
  --tape: #E4DBC6;
  --tape-ink: #17110F;
  --table: #0F0D0E;
  --table-grid: rgba(236, 229, 214, .085);
  --table-ink: #ECE5D6;
  --danger: #FF6B70;
  --danger-bg: #3A0E12;
  --ok: #8FD694;
  --ok-bg: #11271A;
  --warn: #F2C14E;
  --warn-bg: #30250A;
  --shadow: 4px 4px 0 #000;
  --shadow-lg: 8px 8px 0 #000;
  --sys-vampiro: #F0505C;
  --sys-lobisomem: #E8A15A;
  --sys-mago: #B9A4FF;
  --sys-mortal: #7FC4B8;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .93 0 0 0 0 .89 0 0 0 0 .83 0 0 0 .11 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");

  --f-display: 'Pirata One', 'UnifrakturMaguntia', 'Old English Text MT', Georgia, serif;
  --f-type: 'Special Elite', 'Courier New', ui-monospace, monospace;
  --f-body: 'Barlow', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --f-num: 'Barlow Condensed', 'Arial Narrow', 'Barlow', sans-serif;

  --r-sm: 2px;
  --r: 3px;
  --header-h: 58px;
  color-scheme: dark;
}
/* Tema Xerox (claro): papel fotocopiado, tinta preta e vermelha. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #E2DACA; --surface: #EFE9DC; --surface-2: #E7E0D1; --surface-3: #D9CFBD;
    --ink: #17110F; --muted: #5C5249; --line: #CDC2AF; --line-strong: #8E8272;
    --hl: #9E0F1B; --dot: #17110F; --focus: #17110F; --accent: #A3111D; --accent-deep: #C9B9A3;
    --fill: #A3111D; --switch-on: #A3111D; --table: #121011;
    --danger: #A3121D; --danger-bg: #F3D9D4; --ok: #2F6B35; --ok-bg: #DCEAD3; --warn: #7A5300; --warn-bg: #F2E3B8;
    --shadow: 4px 4px 0 #17110F; --shadow-lg: 8px 8px 0 #17110F;
    --sys-vampiro: #9E0F1B; --sys-lobisomem: #8A4A10; --sys-mago: #5B3FB8; --sys-mortal: #24675E;
    --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .09 0 0 0 0 .07 0 0 0 0 .06 0 0 0 .16 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #E2DACA; --surface: #EFE9DC; --surface-2: #E7E0D1; --surface-3: #D9CFBD;
  --ink: #17110F; --muted: #5C5249; --line: #CDC2AF; --line-strong: #8E8272;
  --hl: #9E0F1B; --dot: #17110F; --focus: #17110F; --accent: #A3111D; --accent-deep: #C9B9A3;
  --fill: #A3111D; --switch-on: #A3111D; --table: #121011;
  --danger: #A3121D; --danger-bg: #F3D9D4; --ok: #2F6B35; --ok-bg: #DCEAD3; --warn: #7A5300; --warn-bg: #F2E3B8;
  --shadow: 4px 4px 0 #17110F; --shadow-lg: 8px 8px 0 #17110F;
  --sys-vampiro: #9E0F1B; --sys-lobisomem: #8A4A10; --sys-mago: #5B3FB8; --sys-mortal: #24675E;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .09 0 0 0 0 .07 0 0 0 0 .06 0 0 0 .16 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  color-scheme: light;
}
/* A ficha é sempre papel, em qualquer tema. */
.paper {
  --bg: #E6DFCF; --surface: #EFE9DC; --surface-2: #E6DED0; --surface-3: #D9D0BE;
  --ink: #17110F; --muted: #5E544A; --line: #C6BBA8; --line-strong: #8F8373;
  --hl: #8E0E19; --dot: #17110F; --focus: #8E0E19; --accent: #A3111D; --accent-ink: #F6EFE2; --accent-deep: #CDBEA8;
  --fill: #8E0E19; --on-fill: #F6EFE2; --switch-on: #8E0E19;
  --danger: #A3121D; --danger-bg: #F2D8D2; --ok: #2F6B35; --ok-bg: #DCEAD3; --warn: #7A5300; --warn-bg: #F1E2B6;
  --shadow: 3px 3px 0 #17110F;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .09 0 0 0 0 .07 0 0 0 0 .06 0 0 0 .14 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  color-scheme: light;
  background: var(--surface) var(--grain);
  color: var(--ink);
}

html, body { height: 100%; }
[hidden] { display: none !important; }
body {
  margin: 0; /* 1.3.1: sem a margem padrão de 8 px do navegador, que cortava o fim da tela */
  background: var(--bg) var(--grain); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 50; background: var(--chrome); }
* { box-sizing: border-box; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px dashed var(--focus); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; text-wrap: balance; font-weight: 400; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.label { font-family: var(--f-type); font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.misprint { text-shadow: 2px 2px 0 var(--accent-deep); }

#app { height: 100%; height: 100dvh; display: flex; flex-direction: column; }   /* dvh: a barra do navegador do celular não corta a tela (1.8.0) */

/* ---------- Cabeçalho com sangue escorrendo ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; flex: none;
  height: var(--header-h); background: var(--chrome); color: var(--on-chrome);
  display: flex; align-items: center; gap: 22px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  border-bottom: 3px solid var(--blood);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 16px; pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='16'><g fill='%23B3121F'><path d='M20 0h4c0 4 .4 6 0 8a2 2 0 0 1-4 0c-.4-2 0-4 0-8z'/><circle cx='22' cy='9.5' r='2.2'/><path d='M61 0h3c0 2 .3 3 0 4a1.5 1.5 0 0 1-3 0c-.3-1 0-2 0-4z'/><path d='M104 0h5c0 5 .5 8 0 11a2.5 2.5 0 0 1-5 0c-.5-3 0-6 0-11z'/><circle cx='106.5' cy='12.6' r='2.6'/><path d='M150 0h3c0 3 .3 4 0 6a1.5 1.5 0 0 1-3 0c-.3-2 0-3 0-6z'/><path d='M193 0h4c0 4 .4 7 0 9a2 2 0 0 1-4 0c-.4-2 0-5 0-9z'/><circle cx='195' cy='10.5' r='2.1'/><path d='M236 0h3c0 1 .3 2 0 3a1.5 1.5 0 0 1-3 0c-.3-1 0-2 0-3z'/></g></svg>") repeat-x 0 0 / 260px 16px;
}
.brand { display: flex; align-items: center; gap: 9px; background: none; border: 0; padding: 0; color: var(--on-chrome); }
.brand-mark { width: 26px; height: 30px; }
.brand-name { font-family: var(--f-display); font-size: 31px; line-height: 1; color: var(--bone); text-shadow: 2px 2px 0 var(--blood); letter-spacing: .01em; }
.nav { display: flex; gap: 4px; align-self: stretch; }
.nav button { background: none; border: 0; color: var(--on-chrome-muted); padding: 0 12px; font-family: var(--f-type); font-size: 15px; display: inline-flex; align-items: center; gap: 7px; position: relative; }
.nav button:hover { color: var(--on-chrome); }
.nav button[aria-current="page"] { color: var(--bone); }
.nav button[aria-current="page"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 12px; height: 3px; background: var(--blood); transform: skewX(-18deg) rotate(-1deg); }
.topbar .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 8px; }
.who select { background: var(--chrome-2); color: var(--on-chrome); border: 1px solid #3A2F32; border-radius: var(--r-sm); padding: 6px 8px; max-width: 180px; font-family: var(--f-type); }
.who .avatar { border-color: #3A2F32; }
.who-name { font-family: var(--f-type); font-size: 14px; color: var(--on-chrome); }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid transparent; background: none; color: inherit; }
.icon-btn:hover { background: var(--surface-3); }
.topbar .icon-btn { color: var(--on-chrome-muted); }
.topbar .icon-btn:hover { background: var(--chrome-2); color: var(--on-chrome); }

/* ---------- Botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center; white-space: nowrap;
  border-radius: var(--r-sm); padding: 8px 14px; font-weight: 700; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; line-height: 1.2;
  border: 1.5px solid var(--line-strong); background: transparent; color: var(--ink); transition: transform .08s, box-shadow .08s, border-color .1s;
}
.btn:hover { border-color: var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: #000; box-shadow: 3px 3px 0 #000; }
.btn.primary:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 #000; }
.btn.primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }
.btn.navy { background: var(--ink); color: var(--bg); border-color: var(--ink); box-shadow: 3px 3px 0 var(--accent); }
.btn.navy:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--accent); }
.btn.ghost { background: none; border-color: transparent; color: var(--hl); }
.btn.ghost:hover { border-color: var(--line-strong); }
.btn.danger { color: var(--danger); border-color: var(--danger); background: none; }
.btn.sm { padding: 5px 10px; font-size: 11.5px; }
.btn.block { width: 100%; }
.field { display: grid; gap: 4px; min-width: 0; }
.field > span, .field > .flabel { font-family: var(--f-type); font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-width: 0; padding: 7px 10px; border-radius: var(--r-sm); border: 1.5px solid var(--line-strong);
  background: var(--surface-2); color: var(--ink);
}
textarea.input { resize: vertical; min-height: 70px; }
.input:focus { border-color: var(--ink); outline: none; box-shadow: 3px 3px 0 var(--accent); }
.input:disabled { opacity: .75; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.switch span { position: absolute; inset: 0; border-radius: 2px; background: var(--surface-3); border: 1.5px solid var(--line-strong); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; background: var(--muted); transition: transform .15s; }
.switch input:checked + span { background: var(--switch-on); border-color: #000; }
.switch input:checked + span::after { transform: translateX(18px); background: var(--accent-ink); }
.switch input:focus-visible + span { outline: 2px dashed var(--focus); outline-offset: 2px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: grid; gap: 12px; }
.grow { flex: 1; min-width: 0; }

.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: var(--r-sm); padding: 2px 8px; font-family: var(--f-type); font-size: 12px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.chip.sys { color: var(--ink); border-color: currentColor; }
.chip[data-sys="vampiro"] { color: var(--sys-vampiro); }
.chip[data-sys="lobisomem"] { color: var(--sys-lobisomem); }
.chip[data-sys="mago"] { color: var(--sys-mago); }
.chip[data-sys="mortal"] { color: var(--sys-mortal); }
.chip.ok, .chip.warn, .chip.bad { border: 1.5px solid currentColor; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; transform: rotate(-1.5deg); background: none; }
.chip.ok { color: var(--ok); }
.chip.warn { color: var(--warn); }
.chip.vault { color: var(--hl); border: 1.5px dashed currentColor; }
.chip.bad { color: var(--danger); }
.chip.lamp { background: var(--tape); color: var(--tape-ink); border-color: transparent; transform: rotate(-2deg); box-shadow: 1px 1px 0 rgba(0,0,0,.4); }
.chip.live { color: var(--hl); border-color: currentColor; }
.chip.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
/* 1.9: sessão iniciada, mas a mesa ainda não está reunida na sala (sem o "Ao vivo"). */
.chip.waiting { color: var(--warn); border-color: currentColor; border-style: dashed; }
@keyframes pulse { 50% { opacity: .25; } }
.avatar { width: 30px; height: 30px; border-radius: var(--r-sm); display: inline-grid; place-items: center; font-family: var(--f-type); font-size: 12px; background: var(--surface-3); color: var(--ink); flex: none; border: 1px solid var(--line-strong); }
.avatar.lg { width: 48px; height: 48px; font-size: 17px; }

/* ---------- Páginas ---------- */
.page { flex: 1; min-height: 0; overflow: auto; }
.page-inner {
  max-width: 1260px; margin: 0 auto; padding-block: 34px 72px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-title { font-family: var(--f-display); font-size: 58px; line-height: .95; color: var(--ink); text-shadow: 3px 3px 0 var(--accent-deep); }
.page-sub { font-family: var(--f-type); color: var(--muted); max-width: 62ch; margin-top: 8px; font-size: 14px; }
.filters { display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 20px; align-items: baseline; }
.filters button { border: 0; background: none; font-family: var(--f-type); font-size: 15px; color: var(--muted); padding: 4px 6px; }
.filters button + button::before { content: "/"; color: var(--line-strong); margin-right: 10px; }
.filters button:hover { color: var(--ink); }
.filters button[aria-pressed="true"] { color: var(--ink); background: linear-gradient(transparent 58%, var(--accent) 58%, var(--accent) 86%, transparent 86%); }
.filters button[aria-pressed="true"]::before { color: var(--line-strong); }

/* Próxima sessão */
.next-up {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: end;
  background: #000; color: #ECE5D6; border: 1px solid #2F282B; box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 26px; min-height: 150px;
}
.next-up .nu-art { position: absolute; inset: 0 0 0 38%; opacity: .75; }
.next-up .nu-art svg { width: 100%; height: 100%; display: block; }
.next-up::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #000 30%, rgba(0,0,0,.6) 60%, rgba(0,0,0,.1)); z-index: 1; }
.next-up > div { position: relative; z-index: 2; min-width: 0; }
.nu-label { font-family: var(--f-type); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #F0505C; }
.nu-name { font-family: var(--f-display); font-size: 44px; line-height: 1; margin-top: 6px; text-shadow: 3px 3px 0 #5E0910; }
.nu-when { font-family: var(--f-type); font-size: 14px; color: #CFC6B6; margin-top: 8px; }
.nu-when b { color: #ECE5D6; font-weight: 400; background: #B3121F; padding: 0 6px; }

/* ---------- Cartazes de mesa ---------- */
.mesas { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 24px 22px; }
.mesa-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: visible; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.cover {
  position: relative; aspect-ratio: 16 / 9; max-width: 100%; background: #000; overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 93%, 97% 97%, 92% 92.5%, 86% 98%, 80% 93.5%, 73% 97.5%, 66% 92.5%, 59% 98.5%, 52% 93%, 45% 97%, 38% 92%, 31% 98%, 24% 93.5%, 17% 97.5%, 10% 92.5%, 4% 98%, 0 94%);
}
.cover img, .cover svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 38%, rgba(0,0,0,.88) 92%); }
.cover .sys-tag { position: absolute; z-index: 2; top: 12px; left: 10px; background: var(--tape); color: var(--tape-ink); border: 0; transform: rotate(-3deg); box-shadow: 1px 1px 0 rgba(0,0,0,.5); }
.cover .role-tag { position: absolute; z-index: 2; top: 12px; right: 10px; background: #B3121F; color: #F6EFE2; transform: rotate(2.5deg); }
.cover-title { position: absolute; z-index: 2; left: 16px; right: 16px; bottom: 18px; font-family: var(--f-display); font-size: 34px; line-height: 1; color: #ECE5D6; text-shadow: 2px 2px 0 #5E0910, 0 0 18px #000; }
.mesa-body { padding: 10px 16px 16px; display: grid; gap: 12px; flex: 1; align-content: start; }
.mesa-name { font-family: var(--f-display); font-size: 30px; color: var(--ink); }
.mesa-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.meta .label { display: block; margin-bottom: 2px; }
.meta b { font-weight: 600; font-size: 14.5px; }
.seats { display: flex; gap: 3px; margin-top: 5px; align-items: flex-end; }
.seat { width: 5px; height: 15px; border: 1px solid var(--line-strong); transform: skewX(-8deg); }
.seat.on { background: var(--hl); border-color: var(--hl); }
.mesa-actions { display: flex; gap: 8px; align-items: center; margin-top: auto; padding-top: 4px; }
.mesa-actions .btn { flex: 1; }

/* ---------- Sala de jogo ---------- */
.room {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: minmax(0, 1fr) 392px;
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas: "head head" "av side" "map side";
}
.room-head {
  grid-area: head; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-block: 12px 8px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.room-title { font-family: var(--f-display); font-size: 32px; color: var(--ink); line-height: 1; text-shadow: 2px 2px 0 var(--accent-deep); }
.av { grid-area: av; min-height: 132px; display: flex; gap: 14px; overflow-x: auto; padding: 14px 14px 16px max(16px, env(safe-area-inset-left, 0px)); background: var(--bg) var(--grain); border-bottom: 1px solid var(--line); align-items: flex-start; }
/* Polaroides */
.tile {
  position: relative; flex: none; width: 128px; padding: 6px 6px 24px; background: #EDE6D7; color: #17110F;
  box-shadow: 3px 3px 0 #000; transform: rotate(var(--tilt, 0deg));
}
.tile.me { outline: 2px solid #B3121F; outline-offset: 2px; }
.tile .screen { position: relative; height: 72px; background: #120F10; display: grid; place-items: center; overflow: hidden; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile video.mirror { transform: scaleX(-1); }
.tile .tname { position: absolute; left: 7px; bottom: 4px; right: 7px; font-family: var(--f-type); font-size: 12.5px; display: flex; gap: 5px; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .tname .dot { width: 7px; height: 7px; border-radius: 50%; background: #9C9284; flex: none; }
.tile .tname .dot.on { background: #2F8A3A; }
.tile .crown { position: absolute; z-index: 2; top: 4px; left: 5px; font-family: var(--f-type); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #F6EFE2; background: #B3121F; padding: 0 4px; }
.tile .tctl { position: absolute; z-index: 2; bottom: 4px; right: 4px; display: flex; gap: 3px; }
.tile .tctl button { width: 24px; height: 24px; border-radius: 2px; border: 0; background: rgba(0, 0, 0, .6); color: #ECE5D6; display: grid; place-items: center; }
.tile .tctl button.on { background: #B3121F; color: #F6EFE2; }
.tile .tctl svg.i { width: 14px; height: 14px; }
.tile .avatar { width: 40px; height: 40px; font-size: 15px; background: #2A2326; color: #ECE5D6; border-color: #3A3033; }
.tile .media-flags { position: absolute; z-index: 2; top: 4px; right: 5px; display: flex; gap: 3px; color: #ECE5D6; }
.tile .media-flags svg.i { width: 13px; height: 13px; }
/* Travas de áudio/vídeo do Mestre */
.tile .tctl button.locked { background: #3A0E12; color: #FF6B70; box-shadow: inset 0 0 0 1.5px #FF6B70; }
.tile .tctl button:disabled { cursor: not-allowed; opacity: 1; }
.tile .mctl { left: 4px; right: auto; bottom: 22px; }
.tile .av-locks { position: absolute; z-index: 2; top: 22px; right: 5px; display: flex; gap: 3px; color: #FF6B70; }
.tile .av-locks svg.i { width: 13px; height: 13px; }

.map-zone { grid-area: map; position: relative; min-height: 0; display: flex; flex-direction: column; background: var(--table); }
.map-tools {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 7px 12px 7px max(16px, env(safe-area-inset-left, 0px));
  background: var(--chrome); color: var(--on-chrome); border-bottom: 1px solid #2A2124;
}
.map-tools .btn { background: transparent; color: var(--on-chrome); border-color: #4A3E42; box-shadow: none; }
.map-tools .btn:hover { border-color: var(--bone); }
.map-tools .btn.on { background: #B3121F; color: #F6EFE2; border-color: #000; }
.map-tools .zoom { font-family: var(--f-type); font-variant-numeric: tabular-nums; font-size: 13px; min-width: 44px; text-align: center; color: var(--on-chrome-muted); }
.map-scroll { flex: 1; min-height: 0; overflow: auto; position: relative; overscroll-behavior: contain; background: #0F0D0E var(--grain); }
.board { position: relative; margin: 26px; transform-origin: 0 0; box-shadow: 0 0 0 1px #2E2629, 10px 10px 0 #000; background: #161314; }
.board .map-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; }
.board .grid { position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--table-grid) 1px, transparent 1px), linear-gradient(90deg, var(--table-grid) 1px, transparent 1px); }
.token {
  position: absolute; display: grid; place-items: center; border-radius: 50%; touch-action: none; user-select: none;
  background: #1F191B; color: #ECE5D6; font-family: var(--f-type); border: 3px solid #B3121F; box-shadow: 3px 3px 0 #000;
  transition: box-shadow .15s; overflow: visible;
}
.token img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; pointer-events: none; filter: contrast(1.08) saturate(.85); }
.token.npc { background: #ECE5D6; color: #17110F; border-color: #ECE5D6; }
.token.movable { cursor: grab; }
.token.dragging { cursor: grabbing; z-index: 5; box-shadow: 0 0 0 4px rgba(179, 18, 31, .45), 8px 8px 0 #000; }
.token.sel { box-shadow: 0 0 0 3px #000, 0 0 0 6px #ECE5D6; }
.token .tlabel { position: absolute; top: 100%; margin-top: 4px; left: 50%; transform: translateX(-50%) rotate(-1.5deg); white-space: nowrap; font-family: var(--f-type); font-size: 11px; background: #ECE5D6; color: #17110F; padding: 0 5px; pointer-events: none; box-shadow: 1px 1px 0 #000; }
.map-hint { position: absolute; right: 12px; bottom: 10px; font-family: var(--f-type); font-size: 12px; color: var(--table-ink); opacity: .55; pointer-events: none; }

.side { grid-area: side; min-height: 0; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); }
.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; overflow-x: auto; background: var(--surface-2); }
.tabs button { flex: 1; background: none; border: 0; padding: 12px 8px 10px; font-family: var(--f-type); font-size: 13.5px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; justify-content: center; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); background: var(--surface); }
.tabs .badge { background: var(--accent); color: var(--accent-ink); font-family: var(--f-num); font-size: 12px; padding: 0 6px; font-weight: 700; }
.panel { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px; }
.panel.chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; }

/* Chat */
.msgs { flex: 1; min-height: 0; overflow: auto; padding: 12px 16px; display: grid; gap: 12px; align-content: start; }
.msg { display: grid; grid-template-columns: 30px 1fr; gap: 9px; }
.msg .who-l { font-weight: 700; font-size: 13.5px; }
.msg .when { font-family: var(--f-type); font-size: 11.5px; color: var(--muted); margin-left: 6px; font-weight: 400; }
.msg .txt { font-size: 14.5px; overflow-wrap: anywhere; }
.msg.system { grid-template-columns: 1fr; text-align: center; font-family: var(--f-type); font-size: 12.5px; color: var(--muted); }
.msg.system::before, .msg.system::after { content: " — "; color: var(--line-strong); }
.roll { margin-top: 4px; border: 1px solid var(--line-strong); border-left: 4px solid var(--accent); border-radius: var(--r-sm); padding: 8px 10px; background: var(--surface-2); }
.roll .rlabel { font-family: var(--f-type); font-size: 12px; color: var(--muted); }
.roll .res { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
.roll .big { font-family: var(--f-num); font-size: 26px; font-weight: 700; text-transform: uppercase; color: var(--ink); letter-spacing: .02em; line-height: 1.1; }
.roll.fail { border-left-color: var(--line-strong); }
.roll.fail .big { color: var(--muted); }
.roll.botch { border-color: var(--danger); border-left-color: var(--danger); background: var(--danger-bg); }
.roll.botch .big { font-family: var(--f-display); font-weight: 400; font-size: 30px; text-transform: none; color: var(--danger); }
.dice { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.die { width: 27px; height: 27px; display: grid; place-items: center; font-family: var(--f-num); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums;
  clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%); background: var(--surface-3); color: var(--muted); padding-top: 3px; }
.die.hit { background: var(--fill); color: var(--on-fill); }
.die.one { background: var(--ink); color: var(--bg); }
.roller { border-top: 1px solid var(--line); padding: 12px 16px; display: grid; gap: 10px; background: var(--surface-2); flex: none; }
.roller-top { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
/* Ações Rápidas */
.qa-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qa-bar .label { margin-right: 2px; }
.qa-bar .btn.qa { border-style: dashed; }
.qa-bar .btn.qa .num { color: var(--hl); font-weight: 700; }
.qa-bar select.input.sm { height: 30px; padding: 2px 8px; font-size: 13px; max-width: 180px; }
.qa-hint { font-size: 12.5px; margin: 0; }
/* Mapa oculto */
.map-hidden { flex: 1; min-height: 240px; display: grid; place-items: center; background: #0F0D0E var(--grain); color: var(--table-ink); text-align: center; }
.map-hidden > div { display: grid; gap: 8px; justify-items: center; max-width: 320px; padding: 24px; border: 1.5px dashed var(--line-strong); }
.map-hidden svg.i { width: 34px; height: 34px; color: var(--hl); }
.map-hidden b { font-family: var(--f-display); font-size: 28px; font-weight: 400; }
.map-hidden span { color: var(--on-chrome-muted); font-size: 13.5px; }
.map-banner { display: flex; gap: 8px; align-items: center; padding: 6px 12px; background: #3A0E12; color: #FFD9DB; font-family: var(--f-type); font-size: 12.5px; border-bottom: 1px solid #5E0910; }
.map-banner svg.i { width: 15px; height: 15px; }
/* Biblioteca de tokens */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.lib-tok { display: grid; justify-items: center; gap: 6px; padding: 10px 8px; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r-sm); text-align: center; color: var(--ink); font: inherit; min-width: 0; }
button.lib-tok { cursor: pointer; }
button.lib-tok:hover { border-color: var(--line-strong); }
.lib-tok b { font-size: 13.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tok-face { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--surface-3); border: 2px solid var(--line-strong); font-family: var(--f-num); font-weight: 700; font-size: 18px; flex: none; }
.tok-face img { width: 100%; height: 100%; object-fit: cover; }
.stepper { display: flex; align-items: center; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); }
.stepper button { width: 30px; height: 34px; border: 0; background: none; font-size: 18px; color: var(--hl); }
.stepper output { min-width: 30px; text-align: center; font-family: var(--f-num); font-weight: 700; font-size: 19px; font-variant-numeric: tabular-nums; }
.chat-in { display: flex; gap: 8px; padding: 10px 16px 12px; border-top: 1px solid var(--line); flex: none; }

/* Listas */
.list { display: grid; gap: 8px; }
.item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); min-width: 0; }
.item .grow { overflow: hidden; }
.item .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .s { font-size: 12.5px; color: var(--muted); }
.sec { display: grid; gap: 10px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px dashed var(--line-strong); }
.sec:last-child { border-bottom: 0; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sec-h h3 { font-family: var(--f-type); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); display: inline-flex; gap: 6px; align-items: center; }
.empty { padding: 18px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line-strong); border-radius: var(--r-sm); font-family: var(--f-type); font-size: 14px; }
.empty.big { padding: 42px 18px; display: grid; gap: 12px; justify-items: center; }
.empty.big h3 { font-family: var(--f-display); font-size: 34px; color: var(--ink); }
.callout { padding: 10px 12px; border-radius: var(--r-sm); background: var(--warn-bg); color: var(--warn); font-size: 13.5px; display: flex; gap: 8px; align-items: flex-start; border-left: 4px solid currentColor; }
.callout.info { background: var(--surface-3); color: var(--ink); border-left-color: var(--accent); }
.perm-grid { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; font-size: 13.5px; }
.perm-grid select { padding: 4px 6px; }
.code-box { font-family: var(--f-type); font-size: 18px; letter-spacing: .12em; padding: 8px 12px; background: var(--surface-3); border: 1.5px dashed var(--line-strong); user-select: all; }
.code-box.sm { font-size: 13px; padding: 2px 6px; letter-spacing: .08em; }

/* ---------- Comunidade no dashboard: Mural de Recados + números ---------- */
.community { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; margin-bottom: 22px; align-items: start; }
/* Mural: retangular, bordas suaves, fundo transparente, fonte Fixedsys (pedido do dono do projeto). */
.mural { --mural-font: 'Fixedsys Excelsior', Fixedsys, 'Lucida Console', 'Courier New', monospace;
  font-family: var(--mural-font); font-size: 16px; line-height: 1.25; background: transparent; color: var(--ink);
  border: 1.5px solid var(--line-strong); border-radius: 10px; padding: 14px 16px; max-height: 340px; overflow: auto;
  -webkit-font-smoothing: none; font-smooth: never; }
.mural-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; color: var(--hl); margin-bottom: 10px; letter-spacing: .04em; }
.mural-edit { font: inherit; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 0; }
.mural-edit:hover { color: var(--ink); }
.post + .post { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.post-h { color: var(--ink); }
.post-when { color: var(--warn); }
.post-t { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); margin: 4px 0 0; }
.post-f { color: var(--muted); margin-top: 4px; }
.stats { display: grid; gap: 12px; }
.stats .stat-big, .stats .stat-sys { border: 1px solid var(--line); background: var(--surface); padding: 12px 14px; border-radius: var(--r); display: grid; gap: 6px; }
.stats .stat-big { grid-template-columns: auto auto 1fr; align-items: center; column-gap: 8px; }
.stats .stat-big b { font-size: 34px; line-height: 1; }
.stats .stat-big .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.stats .stat-sys .row b { font-size: 18px; }
/* Painel "Jogadores online" (1.9): mesma moldura do Mural, com fichas de cada jogador. */
.online-panel { border: 1.5px solid var(--line-strong); border-radius: 10px; padding: 12px 14px 14px; margin: -8px 0 22px; }
.op-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; font-family: 'Fixedsys Excelsior', Fixedsys, 'Lucida Console', 'Courier New', monospace; color: var(--hl); letter-spacing: .04em; font-size: 16px; }
.op-sub { color: var(--muted); font-size: 14px; letter-spacing: 0; }
.op-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.op-tile { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; row-gap: 6px; align-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 8px 10px; }
.op-tile.on { border-color: var(--line-strong); }
.op-tile .avatar { grid-row: span 1; }
.op-who { display: grid; min-width: 0; }
.op-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.op-st { color: var(--muted); font-size: 12.5px; }
.op-act { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.op-act:empty { display: none; }
.online-panel .fdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #6F665C; margin-right: 6px; }
.online-panel .fdot.on { background: var(--ok); box-shadow: 0 0 0 2px var(--ok-bg); }
.op-empty { color: var(--muted); font-size: 13.5px; margin: 0; }
.op-more { margin-top: 10px; font-family: 'Fixedsys Excelsior', Fixedsys, 'Lucida Console', 'Courier New', monospace; }

/* ---------- Administração ---------- */
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.admin-grid .card { display: grid; gap: 12px; }
.ltable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ltable th { text-align: left; font-family: var(--f-type); font-weight: 400; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line-strong); padding: 4px 6px; }
.ltable td { padding: 6px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
textarea.input.mono { font-family: 'Fixedsys Excelsior', Fixedsys, 'Courier New', monospace; font-size: 16px; min-height: 110px; }
.meterbar { height: 8px; background: var(--surface-3); border: 1px solid var(--line-strong); }
.meterbar i { display: block; height: 100%; background: var(--fill); }

/* Trilha sonora */
#yt-dock {
  position: fixed; z-index: 30; left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(var(--foot-h, 24px) + 12px); /* acima do rodapé (1.3.1) */
  width: 300px; max-width: calc(100vw - 32px); background: #050405; color: #ECE5D6; border-radius: var(--r-sm);
  border: 1px solid #3A2F32; border-top: 3px solid #B3121F; box-shadow: 6px 6px 0 #000; overflow: hidden;
}
#yt-dock .dock-h { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
#yt-dock .dock-h .t { font-family: var(--f-type); letter-spacing: .1em; text-transform: uppercase; font-size: 12px; color: #F0505C; }
#yt-dock .dock-b { padding: 0 10px 10px; display: grid; gap: 8px; }
#yt-dock .yt-frame { position: relative; aspect-ratio: 16 / 9; max-width: 100%; background: #120F10; overflow: hidden; }
#yt-dock .yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
#yt-dock .yt-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 10px; font-family: var(--f-type); font-size: 12.5px; color: #9C9284; }
#yt-dock .input { background: #1A1416; color: #ECE5D6; border-color: #3A2F32; font-size: 13px; padding: 6px 8px; }
#yt-dock .btn { background: transparent; color: #ECE5D6; border-color: #4A3E42; box-shadow: none; }
#yt-dock .btn.primary { background: #B3121F; color: #F6EFE2; border-color: #000; }
#yt-dock input[type=range] { width: 100%; accent-color: #B3121F; }
#yt-dock a { color: #F0505C; font-size: 12.5px; }
#yt-dock .icon-btn { color: #9C9284; }
#yt-dock .icon-btn:hover { background: #1A1416; color: #ECE5D6; }
#yt-dock.min .dock-b { display: none; }
#yt-dock .np { font-family: var(--f-type); font-size: 12px; color: #9C9284; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .78); display: flex; align-items: flex-start; justify-content: center; overflow: auto;
  padding-block: max(24px, env(safe-area-inset-top, 0px)) 24px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.modal { width: min(560px, 100%); background: var(--surface); border-radius: var(--r-sm); box-shadow: var(--shadow-lg); border: 1px solid var(--line-strong); border-top: 4px solid var(--accent); }
.modal.wide { width: min(1200px, 100%); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-h h2 { font-family: var(--f-display); font-size: 32px; color: var(--ink); flex: 1; min-width: 0; text-shadow: 2px 2px 0 var(--accent-deep); }
.modal-b { padding: 18px; display: grid; gap: 14px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }

/* ---------- Ficha (papel) ---------- */
.sheet-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0; }
.sheet-main { padding: 22px 24px 28px; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-content: start; }
.sheet-title { text-align: center; display: grid; gap: 2px; padding-bottom: 4px; }
.sheet-title .st-sys { font-family: var(--f-display); font-size: 48px; line-height: .95; color: var(--ink); }
.sheet-title .st-sub { font-family: var(--f-type); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.assist { border-left: 1px solid var(--line); background: var(--surface-2); padding: 16px; min-width: 0; }
.assist-in { position: sticky; top: 12px; display: grid; gap: 14px; }
.sys-tabs { display: inline-flex; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; }
.sys-tabs button { border: 0; background: transparent; padding: 6px 13px; font-family: var(--f-type); font-size: 13.5px; color: var(--muted); }
.sys-tabs button + button { border-left: 1.5px solid var(--line-strong); }
.sys-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.sys-tabs button:disabled { cursor: not-allowed; }
.sheet-head { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 18px; align-items: start; }
.portrait { width: 108px; aspect-ratio: 3 / 4; max-width: 100%; background: var(--surface-3); border: 1.5px dashed var(--line-strong); display: grid; place-items: center; overflow: hidden; position: relative; color: var(--muted); font-family: var(--f-type); font-size: 12px; text-align: center; transform: rotate(-1.5deg); box-shadow: var(--shadow); }
.portrait img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.35) contrast(1.1); }
.portrait label { position: absolute; inset: 0; cursor: pointer; }
.portrait-wrap { display: grid; justify-items: center; gap: 8px; align-content: start; }
.portrait-hint { font-family: var(--f-type); font-size: 10.5px; color: var(--muted); text-align: center; max-width: 108px; line-height: 1.25; }
.hdr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 10px 14px; }
.paper .input, .paper select.input, .paper textarea.input { background: transparent; border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0; padding: 4px 2px; }
.paper .input:focus { box-shadow: none; border-bottom-color: var(--hl); background: rgba(142, 14, 25, .05); }
.blk-title { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.blk-title::before, .blk-title::after { content: ""; flex: 1; border-top: 2px solid var(--ink); }
.blk-title h3 { font-family: var(--f-display); font-size: 32px; color: var(--ink); line-height: 1; }
.blk-sub { text-align: center; font-family: var(--f-type); font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.col-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; margin-bottom: 6px; min-height: 30px; }
.col-h h4 { font-family: var(--f-type); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; }
.col-h select { padding: 3px 4px; font-size: 12.5px; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); font-family: var(--f-type); }
.meter { font-family: var(--f-num); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; padding: 0 7px; border: 1.5px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.meter.full { border-color: var(--ok); color: var(--ok); }
.meter.over { border-color: var(--warn); color: var(--warn); background: var(--warn-bg); }
.trait { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px dotted var(--line-strong); min-width: 0; }
.trait .tl { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: none; border: 0; padding: 0; text-align: left; color: inherit; }
.trait .tl.pick { cursor: pointer; }
.trait .tl.pick:hover { color: var(--hl); text-decoration: underline; text-decoration-style: wavy; }
.trait .tl.picked { color: var(--hl); font-weight: 700; }
.trait .tl small { color: var(--muted); font-family: var(--f-type); font-size: 11px; }
.dots { display: inline-flex; gap: 3px; flex: none; }
.dots button { width: 15px; height: 15px; border-radius: 50%; border: 1.6px solid var(--dot); background: transparent; padding: 0; }
.dots button.on { background: var(--dot); }
.dots button.base { background: var(--dot); opacity: .38; }
.dots button:disabled { cursor: default; }
.dots.ro button { cursor: default; }
.dots.ten button { width: 13px; height: 13px; }
/* 1.9: Itens Adicionais da ficha personalizada */
.it-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px 22px; }
.it-group { display: grid; gap: 6px; align-content: start; }
.it-gh { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.it-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 28px; grid-template-areas: "n v x" "o o o"; gap: 4px 8px; align-items: center; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.it-row > input:first-child { grid-area: n; }
.it-row .it-val { grid-area: v; display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.it-row .it-note { grid-area: o; font-size: 13px; }
.it-row > .icon-btn, .it-row > span:last-child { grid-area: x; }
.it-pts { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.it-pts input { width: 58px; }
.it-row .tl.pick { padding: 2px 4px; }
.empty.sm { padding: 6px 0; font-size: 13px; }
.dots.many { flex-wrap: wrap; justify-content: flex-end; max-width: 160px; row-gap: 3px; }   /* 1.9: ficha personalizada acima de 10 */
.trait.fixed .tl { color: var(--muted); }
.derived { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 12px; align-items: start; }
.stat { border: 1.5px solid var(--ink); border-radius: 0; padding: 10px 12px; display: grid; gap: 6px; background: transparent; }
.stat .sv { font-family: var(--f-num); font-size: 32px; font-weight: 700; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat .sn { font-family: var(--f-type); font-size: 11.5px; color: var(--muted); }
.boxes { display: flex; flex-wrap: wrap; gap: 3px; }
.boxes button { width: 17px; height: 17px; border: 1.6px solid var(--ink); background: transparent; padding: 0; border-radius: 0; }
.boxes button.on { background: var(--ink); }
.health { display: grid; gap: 3px; }
.health .hl { display: grid; grid-template-columns: 1fr 34px 22px; gap: 6px; align-items: center; font-size: 13.5px; }
.health .hl .pen { color: var(--muted); font-family: var(--f-num); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.health button { width: 20px; height: 20px; border: 1.6px solid var(--ink); background: transparent; border-radius: 0; padding: 0; font-weight: 700; font-size: 14px; line-height: 1; color: var(--hl); }
.forms { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.forms th, .forms td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.forms th:first-child, .forms td:first-child { text-align: left; }
.forms thead th { font-family: var(--f-type); font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-size: 11.5px; }
.forms tr.cur td { background: var(--surface-3); font-weight: 700; }
.forms tbody tr { cursor: pointer; }
.forms .up { color: var(--ok); } .forms .down { color: var(--danger); }
.scroll-x { overflow-x: auto; }
.subtabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.subtabs button { border: 1.5px solid var(--line-strong); background: transparent; border-radius: var(--r-sm); padding: 4px 10px; font-family: var(--f-type); font-size: 13px; color: var(--muted); }
.subtabs button[aria-selected="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.lrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.wheel-wrap { display: grid; grid-template-columns: 170px 1fr; gap: 16px; align-items: center; }
.wheel text { font-family: var(--f-num); }
.budget { display: grid; gap: 6px; }
.budget .bn { font-family: var(--f-num); font-size: 46px; font-weight: 700; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.bar { height: 10px; background: var(--surface-3); border: 1px solid var(--line-strong); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; background: var(--fill); }
.bar i.over { background: var(--danger) !important; }
.costs { width: 100%; font-size: 13px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.costs td { padding: 4px 0; border-bottom: 1px dotted var(--line-strong); }
.costs td:last-child { text-align: right; font-family: var(--f-num); font-weight: 700; font-size: 14px; }
.msglist { display: grid; gap: 6px; font-size: 13px; margin: 0; padding: 0; list-style: none; }
.msglist li { display: flex; gap: 6px; align-items: flex-start; }
.msglist .e { color: var(--danger); } .msglist .w { color: var(--warn); } .msglist .ok { color: var(--ok); }
.pickbar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 18px; background: #050405; color: #ECE5D6; border-top: 3px solid #B3121F; font-family: var(--f-type); }
.pickbar .btn { color: #ECE5D6; border-color: #4A3E42; }
.pickbar .btn.primary { color: #F6EFE2; border-color: #000; }

/* ---------- Perfil e fichas ---------- */
.prof-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 18px; box-shadow: var(--shadow); display: grid; gap: 14px; align-content: start; }
.card h2 { font-family: var(--f-display); font-size: 32px; color: var(--ink); text-shadow: 2px 2px 0 var(--accent-deep); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 12px; }
.kpi { border-left: 4px solid var(--accent); padding: 2px 0 2px 10px; }
.kpi .v { font-family: var(--f-num); font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.05; }
.sheets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 18px; }
.sheet-card { display: grid; grid-template-columns: 62px 1fr; gap: 14px; align-items: center; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; box-shadow: var(--shadow); color: var(--ink); transition: transform .08s; }
.sheet-card:hover { transform: translate(-1px, -1px) rotate(-.4deg); border-color: var(--line-strong); }
.sheet-card .ph { width: 62px; height: 76px; overflow: hidden; background: #EDE6D7; color: #17110F; display: grid; place-items: center; font-family: var(--f-display); font-size: 28px; padding: 4px 4px 10px; box-shadow: 2px 2px 0 #000; transform: rotate(-2deg); }
.sheet-card .ph img { width: 100%; height: 100%; object-fit: cover; }

/* Toast */
#toast { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); bottom: calc(var(--foot-h, 24px) + 10px); background: #050405; color: #ECE5D6; padding: 10px 16px; border-radius: var(--r-sm); border: 1px solid #3A2F32; border-left: 5px solid #B3121F; box-shadow: 5px 5px 0 #000; font-family: var(--f-type); font-size: 14px; max-width: calc(100vw - 32px); }

/* ---------- Boas-vindas e login ---------- */
.welcome { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.wl-hero {
  position: relative; overflow: hidden; background: #000; color: #ECE5D6; min-height: 100%;
  display: flex; align-items: flex-start;
  padding-block: clamp(32px, 9vh, 96px) 240px; padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: 32px;
}
.wl-art { position: absolute; inset: 0; }
.wl-art svg { width: 100%; height: 100%; display: block; }
.wl-copy { position: relative; max-width: 38rem; display: grid; gap: 20px; }
.wl-brand { display: flex; align-items: center; gap: 10px; }
.wl-brand .brand-mark { width: 30px; height: 36px; }
.wl-brand .brand-name { font-size: 38px; }
.wl-title { font-family: var(--f-display); font-size: clamp(50px, 6vw, 88px); line-height: .92; color: #ECE5D6; text-shadow: 4px 4px 0 #8A0D17; }
.wl-lead { font-family: var(--f-type); font-size: 16.5px; color: #CFC6B6; max-width: 46ch; line-height: 1.55; }
.wl-lead b { color: #ECE5D6; font-weight: 400; background: #B3121F; padding: 0 4px; }
.wl-points { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; }
.wl-points li { display: flex; align-items: center; gap: 10px; color: #CFC6B6; font-size: 15.5px; }
.wl-points svg.i { color: #F0505C; }
.wl-panel { position: relative; display: grid; place-items: center; padding-block: 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wl-theme { position: absolute; top: 14px; right: max(14px, env(safe-area-inset-right, 0px)); color: var(--muted); }
.auth-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line-strong); border-top: 4px solid var(--accent); border-radius: var(--r-sm); box-shadow: var(--shadow-lg); padding: 22px; display: grid; gap: 16px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 9px; font-family: var(--f-type); font-size: 14px; color: var(--muted); }
.seg button + button { border-left: 1.5px solid var(--line-strong); }
.seg button[aria-selected="true"] { background: var(--ink); color: var(--surface); }
.auth-h { font-family: var(--f-display); font-size: 36px; color: var(--ink); text-shadow: 2px 2px 0 var(--accent-deep); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-eye { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 36px; height: 34px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; border-radius: var(--r-sm); }
.pw-eye:hover { color: var(--hl); }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.pw-meter i { height: 6px; background: var(--surface-3); transform: skewX(-20deg); }
.pw-meter i.low { background: var(--danger); }
.pw-meter i.mid { background: var(--warn); }
.pw-meter i.ok { background: var(--ok); }
.pw-label { font-family: var(--f-type); font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.pw-rules { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; font-size: 13px; color: var(--muted); }
.pw-rules li { display: flex; align-items: center; gap: 6px; }
.pw-rules li svg.i { width: 14px; height: 14px; }
.pw-rules li.ok { color: var(--ok); }
.pw-match { font-family: var(--f-type); font-size: 12.5px; min-height: 1em; }
.pw-match.ok { color: var(--ok); }
.pw-match.bad { color: var(--danger); }
.auth-err { background: var(--danger-bg); color: var(--danger); padding: 8px 10px; border-left: 4px solid currentColor; font-size: 13.5px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-family: var(--f-type); font-size: 12.5px; }
.or::before, .or::after { content: ""; flex: 1; height: 0; border-top: 1px dashed var(--line-strong); }
.fine { display: flex; gap: 8px; font-size: 12.5px; color: var(--muted); }
.fine svg.i { width: 15px; height: 15px; margin-top: 2px; }
.small { font-size: 13.5px; }
.linkish { background: none; border: 0; padding: 0; color: var(--hl); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) { .community, .admin-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1080px) {
  .room { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(380px, 58vh) minmax(480px, auto); grid-template-rows: auto auto minmax(380px, 58dvh) minmax(480px, auto); grid-template-areas: "head" "av" "map" "side"; overflow: auto; }
  .side { border-left: 0; border-top: 1px solid var(--line); }
  .sheet-wrap { grid-template-columns: minmax(0, 1fr); }
  .assist { border-left: 0; border-bottom: 1px solid var(--line); order: -1; }
  .assist-in { position: static; }
}
@media (max-width: 900px) {
  .welcome { grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; align-content: start; }
  .wl-hero { min-height: 0; padding-block: 28px 150px; padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); }
  .wl-title { font-size: 50px; }
  .wl-panel { place-items: start center; padding-block: 18px 48px; gap: 6px; }
  .wl-theme { position: static; justify-self: end; order: -1; }
  .next-up { grid-template-columns: 1fr; }
  .next-up .nu-art { inset: 0; opacity: .35; }
}
@media (max-width: 760px) {
  .nav button span { display: none; }
  .nav button[aria-current="page"]::after { bottom: 10px; }
  .brand-name { font-size: 26px; }
  .cols3, .cols2 { grid-template-columns: minmax(0, 1fr); }
  .page-title { font-size: 44px; }
  .nu-name { font-size: 34px; }
  .wheel-wrap { grid-template-columns: 1fr; justify-items: center; }
  .sheet-head { grid-template-columns: 1fr; }
  .sheet-main { padding: 18px 14px 24px; }
  .who select { max-width: 120px; }
  #yt-dock { width: auto; right: max(16px, env(safe-area-inset-right, 0px)); }
}
@media (max-width: 600px) { .wl-points { display: none; } .wl-hero { padding-block: 24px 96px; } .wl-title { font-size: 44px; } }
@media (max-width: 480px) {
  .nav button { padding: 0 8px; }
  .topbar .brand-name { display: none; }
  .topbar { gap: 8px; }
  .who .avatar, .who .chip, .who-name { display: none; }
  .who select { max-width: 120px; }
  .topbar .icon-btn { width: 32px; }
  .mesa-meta { grid-template-columns: 1fr; }
  .cover-title { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.boot { flex: 1; display: grid; place-items: center; font-family: var(--f-display); font-size: 40px; color: var(--muted); }
#conn-banner { position: fixed; z-index: 90; top: calc(env(safe-area-inset-top, 0px) + var(--header-h) + 18px); left: 50%; transform: translateX(-50%); background: var(--warn-bg); color: var(--warn); border: 1.5px solid currentColor; padding: 8px 14px; font-family: var(--f-type); font-size: 13.5px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.sheet-title .st-sub { margin-top: 6px; }

/* ---------- Administração 1.2: usuários e mesas ---------- */
.item.adm-user { flex-wrap: wrap; }
.item.adm-user .grow { min-width: 220px; }
.adm-actions { gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.adm-user .chip { margin-left: 4px; }

/* ---------- Explorador de arquivos do Mestre (dashboard) ---------- */
.explorer { margin-top: 28px; border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow); }
.ex-head { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: baseline; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.ex-head h2 { font-family: var(--f-display); font-weight: 400; font-size: 26px; display: flex; gap: 8px; align-items: center; margin: 0; }
.ex-crumb { font-family: var(--f-type); font-size: 13px; }
.ex-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 260px; }
.ex-tree { border-right: 1px solid var(--line); padding: 8px 6px; max-height: 460px; overflow: auto; background: var(--surface); }
.ex-tree ul { list-style: none; margin: 0; padding: 0; }
.ex-tree ul ul { padding-left: 18px; border-left: 1px dotted var(--line-strong); margin-left: 11px; }
.ex-row { display: flex; align-items: center; gap: 2px; border-radius: var(--r-sm); }
.ex-row.sel { background: var(--surface-3); box-shadow: inset 2px 0 0 var(--hl); }
.ex-tw { width: 20px; flex: none; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0; }
.ex-node { flex: 1; min-width: 0; display: flex; gap: 6px; align-items: center; background: none; border: 0; color: var(--ink); padding: 5px 6px; text-align: left; cursor: pointer; font: inherit; font-size: 14px; }
.ex-node span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-node small { margin-left: auto; color: var(--muted); font-family: var(--f-num); }
.ex-node svg.i { width: 15px; height: 15px; flex: none; color: var(--hl); }
.ex-node:hover { color: var(--hl); }
.ex-none { font-size: 12.5px; padding: 4px 8px; }
.ex-main { padding: 14px 16px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.ex-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ex-tile { display: grid; justify-items: start; gap: 4px; padding: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); text-align: left; cursor: pointer; font: inherit; border-radius: var(--r-sm); }
.ex-tile:hover { border-color: var(--line-strong); }
.ex-tile svg.i { width: 26px; height: 26px; color: var(--hl); }
.ex-tile span { font-size: 12.5px; }
.ex-files td svg.i { width: 14px; height: 14px; vertical-align: -2px; color: var(--muted); }
.ex-files .ex-act { white-space: nowrap; text-align: right; }
@media (max-width: 760px) { .ex-body { grid-template-columns: minmax(0, 1fr); } .ex-tree { border-right: 0; border-bottom: 1px solid var(--line); max-height: 220px; } }

/* ---------- Mural 1.2: até 4 mensagens, estáticas ou deslizantes, com emojis ---------- */
.mural { --mural-font: 'Fixedsys Excelsior', Fixedsys, 'Lucida Console', 'Courier New', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', monospace; max-height: 380px; }
.mural .post { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px; align-items: baseline; }
.mural .post-tag { color: var(--hl); white-space: nowrap; }
.mural .post + .post { margin-top: 10px; padding-top: 10px; }
.ticker { overflow: hidden; white-space: nowrap; min-width: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.ticker > span { display: inline-block; padding-left: 100%; animation-name: mural-ticker; animation-timing-function: linear; animation-iteration-count: infinite; will-change: transform; }
.ticker:hover > span { animation-play-state: paused; }
.ticker .post-by, .post-f { color: var(--muted); font-style: normal; }
@keyframes mural-ticker { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .ticker { white-space: normal; -webkit-mask-image: none; mask-image: none; } .ticker > span { padding-left: 0; display: inline; } }
#pf-count.over { color: var(--danger); font-weight: 700; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; padding: 8px; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r-sm); max-height: 180px; overflow: auto; }
.emoji-grid button { font-size: 20px; line-height: 1; padding: 6px 0; background: none; border: 1px solid transparent; border-radius: var(--r-sm); cursor: pointer; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; }
.emoji-grid button:hover { border-color: var(--line-strong); background: var(--surface-3); }
.post-preview { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; font-family: 'Fixedsys Excelsior', Fixedsys, 'Courier New', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', monospace; font-size: 16px; }
.post-preview .post { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px; }
.post-preview .post-tag { color: var(--hl); }
.post-preview .label { font-family: var(--f-type); }

/* ---------- Foto de perfil (1.3) ---------- */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.xl { width: 96px; height: 96px; font-size: 30px; box-shadow: var(--shadow); }
.av-hint { font-size: 12.5px; max-width: 360px; }
.tile .avatar img { border-radius: inherit; }

/* ---------- Painel de Gestão da Mesa (1.3) ---------- */
.mp-head { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: 18px; align-items: center; margin-bottom: 14px; }
.mp-cover { aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line-strong); box-shadow: var(--shadow); background: var(--surface-3); }
.mp-cover img, .mp-cover svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-title { display: grid; gap: 6px; min-width: 0; }
.mp-title .page-title { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn.lg { padding: 12px 18px; font-size: 14px; }
.mp-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 2px solid var(--line-strong); margin-bottom: 18px; scrollbar-width: thin; }
.mp-tabs button { flex: none; display: flex; gap: 6px; align-items: center; background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; padding: 10px 12px; color: var(--muted); font-family: var(--f-type); font-size: 13.5px; cursor: pointer; }
.mp-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.mp-tabs button:hover { color: var(--ink); }
.mp-tabs svg.i { width: 15px; height: 15px; }
.mp-body { display: grid; gap: 16px; }
.mp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.mp-grid.wide { grid-template-columns: minmax(0, 1fr); }
.pcard { border: 1px solid var(--line); background: var(--surface); padding: 16px; display: grid; gap: 12px; align-content: start; box-shadow: var(--shadow); min-width: 0; }
.pcard > h2 { font-family: var(--f-display); font-weight: 400; font-size: 26px; margin: 0; }
.pcard .sec { border: 0; padding: 0; margin: 0; }
.pcard.danger-zone { border-color: var(--danger); }
.mp-pend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mp-pend li { display: flex; gap: 8px; align-items: center; }
.mp-person { display: inline-flex; gap: 6px; align-items: center; padding: 3px 8px 3px 3px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 13px; }
.mp-person .avatar { width: 24px; height: 24px; font-size: 10px; }
.item.attn { box-shadow: inset 3px 0 0 var(--warn); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.input.sm { height: 32px; padding: 4px 8px; font-size: 13px; }
.ltable.xpt .input.sm { width: 72px; display: inline-block; }
.ltable.psheets td { vertical-align: middle; }
.ltable.psheets .xa .input.sm[type=number] { width: 66px; }
.ltable.psheets .xa .input.sm:not([type=number]) { width: 150px; }
.ltable tr.xlog td { background: var(--surface-2); }
@media (max-width: 900px) { .mp-head { grid-template-columns: 1fr; } .mp-cover { max-width: 260px; } .mp-actions { justify-content: flex-start; } .mp-grid { grid-template-columns: minmax(0, 1fr); } .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Desenho no mapa (1.3) ---------- */
.draw-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: visible; }
.draw-layer path { fill: none; stroke-width: .09; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 .02px rgba(0,0,0,.6)); }
.board .token { z-index: 2; }
.board.drawing .draw-layer { pointer-events: all; touch-action: none; }
.board.drawing .token { pointer-events: none; opacity: .9; }
.board.draw-pen .draw-layer { cursor: crosshair; }
.board.draw-eraser .draw-layer { cursor: cell; }
.draw-tools { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; padding-left: 8px; margin-left: 4px; border-left: 1px solid #4A3E42; }
.draw-tools .btn svg.i { width: 15px; height: 15px; }
.swatches { display: inline-flex; gap: 4px; padding: 0 4px; }
.swatches .sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #4A3E42; background: var(--c); cursor: pointer; padding: 0; }
.swatches .sw.sel { border-color: #F6EFE2; box-shadow: 0 0 0 2px #B3121F; }

/* ---------- Amigos (1.3) ---------- */
.badge { display: inline-block; min-width: 18px; text-align: center; background: var(--accent); color: var(--accent-ink); font-family: var(--f-num); font-size: 12px; font-weight: 700; line-height: 18px; padding: 0 5px; border-radius: 2px; }
.nav .nav-badge { margin-left: 2px; }
.friends .fr-hint { font-size: 12.5px; margin: -2px 0 0; }
.friends .fr-results { border: 1px dashed var(--line-strong); padding: 8px; }
.friends .fr-act { gap: 6px; flex-wrap: nowrap; }
.friends .fdot, .fm-head .fdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #6F665C; margin-right: 6px; vertical-align: 0; }
.friends .fdot.on, .fm-head .fdot.on { background: var(--ok); box-shadow: 0 0 0 2px var(--ok-bg); }
.chip.ok-chip { color: var(--ok); border-color: var(--ok); }
@media (max-width: 760px) {
  .nav .nav-badge { position: absolute; top: 6px; right: 2px; margin: 0; font-size: 10px; line-height: 15px; min-width: 15px; padding: 0 3px; }
  .friends .item { flex-wrap: wrap; }
}

/* ---------- Rodapé com a versão (1.3.1) ---------- */
.app-foot {
  flex: none; display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 4px 14px;
  padding: 3px max(16px, env(safe-area-inset-right, 0px)) max(3px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: var(--chrome); color: var(--on-chrome-muted); border-top: 1px solid #2A2124;
  font-family: var(--f-type); font-size: 11.5px; letter-spacing: .03em; line-height: 17px;
}
.app-foot b { color: var(--on-chrome); font-weight: 400; }
.app-foot .stale { color: var(--warn); }
.app-foot .stale .linkish { color: var(--warn); font: inherit; text-decoration: underline; }
@media print { .app-foot { display: none; } }
@media (max-width: 480px) { .app-foot { font-size: 10.5px; letter-spacing: .01em; justify-content: center; } .app-foot .foot-brand { display: none; } }

/* ---------- Mortais (1.4) ---------- */
.trait.bgdyn { gap: 6px; }
.trait.bgdyn .input { flex: 1; min-width: 0; padding: 3px 6px; font-size: 13.5px; border-color: transparent; border-bottom: 1px solid var(--line-strong); background: transparent; border-radius: 0; }
.trait.bgdyn .input:focus { border-color: var(--line-strong); background: var(--surface); }
.boxes button.off { opacity: .28; border-style: dashed; }
.hum-ctl { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.hum-ctl .input { flex: 1 1 140px; min-width: 0; font-size: 12.5px; padding: 4px 6px; }
.xpc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; text-align: center; }
.xpc b { display: block; font-family: var(--f-num); font-size: 26px; font-weight: 700; line-height: 1; }
.xpc span { font-family: var(--f-type); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.numina .blk-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.nm-card { border: 1.5px dashed var(--line-strong); padding: 10px 12px; display: grid; gap: 6px; align-content: start; }
.nm-card.has { border-style: solid; border-color: var(--ink); }
.nm-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nm-h b { font-family: var(--f-type); font-weight: 400; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }
.nm-v { font-family: var(--f-num); font-size: 26px; font-weight: 700; line-height: 1; }
.nm-d { font-size: 12.5px; color: var(--muted); margin: 0; }
.nm-calc { display: grid; gap: 4px; font-size: 12.5px; }
.nm-calc small { color: var(--muted); font-family: var(--f-type); }
.nm-calc .btn { justify-self: start; }
.nm-params { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; }
.nm-params .field.sm { flex: 1 1 96px; min-width: 0; }
.nm-params .nm-note { flex: 1 1 100%; }
.field.sm > span { font-size: 10.5px; }
.input.sm { padding: 4px 6px; font-size: 13px; }
.check.sm { font-size: 12.5px; }
.nm-roll { align-items: flex-end; gap: 8px; }
.nm-roll .field.sm { max-width: 130px; }
table.combat { width: 100%; border-collapse: collapse; }
table.combat th { font-family: var(--f-type); font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-size: 11px; text-align: left; padding: 4px 6px; border-bottom: 1.5px solid var(--ink); }
table.combat td { padding: 4px 4px; border-bottom: 1px dotted var(--line-strong); vertical-align: middle; }
table.combat td:first-child .input { min-width: 140px; }
.derange-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.derange-list li { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-left: 4px solid var(--hl); background: var(--surface-2); font-size: 13.5px; }
.derange-list li.muted { border-left-color: var(--line-strong); background: none; }
.derange-list .dl-meta { font-family: var(--f-type); font-size: 11px; color: var(--muted); margin-top: 2px; }
.derange .blk-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.derange-form { padding: 10px; border: 1.5px solid var(--ink); margin-top: 8px; }
.overlay.top { z-index: 75; align-items: center; }
.derange-modal { border-top: 4px solid var(--blood, #B3121F); max-width: 520px; }
.derange-modal .modal-h h2 { display: flex; align-items: center; gap: 8px; }
.msg.system.private { color: var(--hl); }
.msg.system.private b { display: inline-flex; align-items: center; gap: 4px; }
.msg.system.private svg.i { width: 13px; height: 13px; }
@media (max-width: 760px) { .xpc b { font-size: 22px; } table.combat td:first-child .input { min-width: 110px; } }

/* ---------- Termo de Confidencialidade (1.5) ---------- */
a.btn { text-decoration: none; }
.nda-page { flex: 1; min-height: 0; overflow: auto; display: grid; place-items: start center; padding: 22px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); }
.nda-card { width: min(780px, 100%); background: var(--surface); border: 1px solid var(--line-strong); border-top: 4px solid var(--accent); border-radius: var(--r-sm); box-shadow: var(--shadow-lg); padding: 22px clamp(16px, 4vw, 30px) 24px; display: grid; gap: 14px; }
.nda-h { font-family: var(--f-display); font-size: clamp(34px, 6vw, 46px); line-height: 1; color: var(--ink); text-shadow: 2px 2px 0 var(--accent-deep); margin: 4px 0 0; }
.nda-lead { margin: 0; font-size: 15.5px; color: var(--muted); max-width: 62ch; }
.nda-doc { max-height: max(260px, min(600px, calc(100dvh - 430px))); overflow: auto; border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 22px clamp(16px, 4vw, 34px) 18px; font-family: var(--f-body); font-size: 15.5px; line-height: 1.62; box-shadow: inset 0 -12px 14px -12px rgba(23, 17, 15, .35); }
.nda-doc:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.nda-doc p { margin: 0 0 .7em; max-width: 68ch; }
.nda-doc h3 { font-family: var(--f-num); font-size: 15px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hl); margin: 1.25em 0 .4em; }
.nda-doc .nda-item { padding-left: 1.4em; text-indent: -1.4em; margin-bottom: .4em; }
.nda-title { font-family: var(--f-type); font-size: 20px; letter-spacing: .06em; text-align: center; margin: 0; color: var(--ink); }
.nda-sub { text-align: center; color: var(--muted); font-size: 14px; margin: 2px auto 1.2em !important; }
.nda-end { text-align: center; color: var(--muted); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; margin: 1.4em auto .2em !important; }
.nda-accept { display: grid; gap: 12px; }
.nda-hint { margin: 0; display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--warn); }
.nda-hint svg { width: 18px; height: 18px; flex: none; }
.nda-check { font-size: 15px; font-weight: 600; align-items: flex-start; line-height: 1.35; }
.nda-check input { margin-top: 2px; width: 18px; height: 18px; flex: none; }
.nda-check input:disabled + span { opacity: .55; }
.nda-actions { flex-wrap: wrap; gap: 10px; }
.nda-accept .fine { margin: 0; }
@media (max-width: 560px) { .nda-actions .btn { flex: 1 1 100%; justify-content: center; } .nda-doc { max-height: 52vh; font-size: 15px; } }

/* ---------- Armazenamento por conta (1.6) ---------- */
.storage { display: grid; gap: 12px; align-content: start; }
.st-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.st-used { font-family: var(--f-num); font-size: 34px; font-weight: 700; line-height: 1; color: var(--ink); }
.st-of { color: var(--muted); font-size: 14px; }
.st-pct { margin-left: auto; font-family: var(--f-num); font-size: 20px; font-weight: 700; color: var(--ink); }
.st-bar { position: relative; height: 14px; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 2px; overflow: hidden; }
.st-bar i { display: block; height: 100%; background: var(--ink); opacity: .78; border-radius: 0 4px 4px 0; transition: width .4s ease; }
.st-bar .st-mark { position: absolute; top: -1px; bottom: -1px; width: 2px; margin-left: -1px; background: var(--danger); opacity: .7; }
.storage.warn .st-bar i, .storage.full .st-bar i { background: var(--danger); opacity: 1; }
.storage.full .st-bar i { background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(0, 0, 0, .28) 5px 8px); }
.storage.warn .st-pct, .storage.full .st-pct { color: var(--danger); }
.st-alert { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-sm); background: var(--danger-bg); color: var(--danger); border-left: 4px solid currentColor; font-size: 13.5px; }
.st-alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.st-kinds td, .st-kinds th { font-size: 13px; }
.st-hot { color: var(--danger); font-weight: 600; }

/* ---------- Vista 2.5D: mesa inclinada e tokens de pé (1.6) ----------
   .stage leva a perspectiva; .board.v25 gira em X a partir da borda de baixo; cada .tok-fig gira ao contrário
   (rotateX negativo) e fica de pé. A perspectiva diminui sozinha os tokens do fundo; com preserve-3d, o
   navegador ordena por profundidade (e o z-index por linha cobre os navegadores que achatam a cena). */
.map-scroll.v25 { background: radial-gradient(ellipse at 50% 85%, #1F1A1C 0%, #0B0A0B 70%) #0B0A0B; }
.stage { position: relative; transform-style: flat; }
.board.v25 { position: absolute; left: 26px; top: 26px; margin: 0; transform-origin: 50% 100%; transform: rotateX(var(--tilt)); transform-style: preserve-3d;
  box-shadow: 0 0 0 1px #2E2629, 0 18px 0 #000, 0 30px 40px rgba(0, 0, 0, .65); }
.board.v25 .token.standee { display: block; background: none; border: 0; border-radius: 0; box-shadow: none; transform-style: preserve-3d; overflow: visible; transition: none; }
.token.standee .tok-base { position: absolute; inset: 10%; border-radius: 50%; transform: translateZ(1px);
  background: radial-gradient(circle at 50% 38%, #3A3134 0%, #151112 62%, #0B0A0B 100%); border: 2px solid #B3121F; box-shadow: 0 3px 0 #000; }
.token.standee.npc .tok-base { border-color: #ECE5D6; }
/* Sombra no chão: cai para o fundo da mesa, como se a luz viesse de quem olha. */
.token.standee .tok-base::before { content: ''; position: absolute; left: 4%; right: 4%; bottom: 46%; height: 120%; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 100%, rgba(0, 0, 0, .62) 0%, rgba(0, 0, 0, .28) 45%, transparent 72%); filter: blur(1.5px); pointer-events: none; }
.token.standee .tok-fig { position: absolute; display: block; box-sizing: border-box; transform-origin: 50% 100%; transform: rotateX(calc(-1 * var(--tilt))) translateZ(2px); transform-style: preserve-3d; }
.token.standee .tok-fig img { display: block; }
.token.standee .tok-ini { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
/* Foto comum (JPEG ou PNG sem transparência): placa estilo carta de baralho. */
.tok-fig.card { background: #ECE5D6; padding: 3px; border-radius: 4px; box-shadow: 0 0 0 1px #000, 3px 2px 0 rgba(0, 0, 0, .55); }
.tok-fig.card img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; border-radius: 2px; pointer-events: none; filter: contrast(1.06) saturate(.9); }
.token.standee:not(.npc) .tok-fig.card:not(.blank) { background: linear-gradient(#ECE5D6, #D9CFBC); box-shadow: 0 0 0 1px #000, inset 0 -3px 0 #B3121F, 3px 2px 0 rgba(0, 0, 0, .55); }
.tok-fig.card.blank { background: #1F191B; color: #ECE5D6; font-family: var(--f-type); border: 2px solid #B3121F; padding: 0; }
.token.standee.npc .tok-fig.card.blank { background: #ECE5D6; color: #17110F; border-color: #ECE5D6; }
/* PNG transparente: recorte exato da silhueta, com borda de papel. */
.tok-fig.cut img { width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; pointer-events: none;
  filter: drop-shadow(1.5px 0 0 #ECE5D6) drop-shadow(-1.5px 0 0 #ECE5D6) drop-shadow(0 1.5px 0 #ECE5D6) drop-shadow(0 -1.5px 0 #ECE5D6) drop-shadow(2px 2px 0 rgba(0, 0, 0, .55)); }
.token.standee .tlabel { top: auto; bottom: 100%; margin: 0 0 4px; transform: translateX(-50%) translateZ(1px) rotate(-1.5deg); }
.token.standee.movable .tok-fig, .token.standee.movable .tok-base { cursor: grab; }
.token.standee.sel .tok-base { box-shadow: 0 0 0 3px #000, 0 0 0 6px #ECE5D6; }
.token.standee.sel .tok-fig.card { outline: 3px solid #ECE5D6; outline-offset: 1px; }
.token.standee.sel .tok-fig.cut img { filter: drop-shadow(2px 0 0 #F0505C) drop-shadow(-2px 0 0 #F0505C) drop-shadow(0 2px 0 #F0505C) drop-shadow(0 -2px 0 #F0505C) drop-shadow(2px 2px 0 rgba(0, 0, 0, .55)); }
.token.standee.dragging { z-index: 999 !important; }
.token.standee.dragging .tok-base { box-shadow: 0 0 0 4px rgba(179, 18, 31, .55); }
.token.standee:focus-visible { outline: none; }
.token.standee:focus-visible .tok-base { box-shadow: 0 0 0 3px var(--focus); }
/* Desenhando: o token não pode ficar translúcido (opacidade achata a cena 3D); só a figura esmaece. */
.board.v25.drawing .token.standee { opacity: 1; }
.board.v25.drawing .token.standee .tok-fig { opacity: .75; }
@media (prefers-reduced-motion: reduce) { .st-bar i { transition: none; } }
/* Aviso de como a imagem aparece na vista 2.5D (envio de retrato e de token). */
.tip25 { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--muted); line-height: 1.35; }
.tip25 svg { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--hl); }
.portrait-hint.tip25 { font-size: 10.5px; max-width: 108px; text-align: left; }
.st-what { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.st-what b { color: var(--ink); font-weight: 600; }
/* ---------- Suporte (1.7) ---------- */
.sup-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.sup-grid .card { display: grid; gap: 12px; }
.support textarea.input { resize: vertical; min-height: 150px; line-height: 1.5; }
.support .callout svg.i { flex: none; margin-top: 2px; }
#sup-count.over { color: var(--danger); }
.sup-item { display: block; padding: 0; }
.sup-item > summary { display: flex; align-items: center; gap: 10px; padding: 9px 11px; cursor: pointer; list-style: none; }
.sup-item > summary::-webkit-details-marker { display: none; }
.sup-item > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.sup-item[open] > summary { border-bottom: 1px dashed var(--line-strong); }
.sup-item.done { opacity: .72; }
.sup-body { display: grid; gap: 10px; padding: 10px 11px 12px; }
.sup-msg { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.sup-tech { margin: 0; padding: 8px 10px; font-family: var(--f-type); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-3); border-left: 3px solid var(--line-strong); color: var(--muted); }
.wl-support a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
/* Mesas de um amigo (1.7) */
.fm-head { display: flex; align-items: center; gap: 12px; }
.fm-name { font-family: var(--f-display); font-size: 26px; line-height: 1; color: var(--ink); }
.fm-item .t { white-space: normal; }
.fm-item .chip.sys { flex: none; }
@media (max-width: 900px) { .sup-grid { grid-template-columns: minmax(0, 1fr); } }
/* ---------- Estado da voz por pessoa (1.7.1) ---------- */
.tile .rtc-st { position: absolute; z-index: 2; left: 5px; bottom: 4px; max-width: calc(100% - 10px); font-family: var(--f-type); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #ECE5D6; background: rgba(10, 8, 8, .78); padding: 1px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .rtc-st.bad { background: #B3121F; color: #F6EFE2; }
.tile .rtc-st.relay { background: rgba(10, 8, 8, .6); color: #F5C518; }

/* =====================================================================
   Versão para celular (1.8.0) — html.m-mode
   ===================================================================== */
/* iPhone: campos com menos de 16 px fazem o Safari dar zoom ao tocar. */
@supports (-webkit-touch-callout: none) { input, select, textarea { font-size: max(16px, 1em); } }
.m-mode input.input, .m-mode select, .m-mode textarea { font-size: 16px; }
.m-mode .btn { min-height: 38px; }

/* Cabeçalho compacto e menu ☰ */
.m-top { gap: 10px; }
.m-top-t { font-family: var(--f-display); font-size: 26px; line-height: 1; color: var(--bone); text-shadow: 2px 2px 0 var(--blood); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.m-burger { position: relative; width: 44px; height: 44px; }
.m-burger svg.i { width: 24px; height: 24px; }
.m-burger .nav-badge { position: absolute; top: 2px; right: 0; margin: 0; font-size: 10px; line-height: 15px; min-width: 15px; padding: 0 3px; background: var(--blood); color: #F6EFE2; }
.overlay.m-drawer-ov { padding: 0; justify-content: flex-end; align-items: stretch; z-index: 65; }
.m-drawer {
  width: min(330px, 88vw); background: var(--chrome) var(--grain); color: var(--on-chrome); border-left: 3px solid var(--blood); box-shadow: -8px 0 0 #000;
  overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column;
  padding: max(10px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) 12px;
}
.m-drawer-h { display: flex; align-items: center; gap: 10px; padding: 4px 2px 10px; border-bottom: 1px solid #2A2124; font-family: var(--f-type); font-size: 16px; }
.m-drawer-h .icon-btn { color: var(--on-chrome); width: 44px; height: 44px; }
.m-sec { display: grid; gap: 2px; padding: 8px 0; border-bottom: 1px solid #2A2124; }
.m-sec:last-child { border-bottom: 0; }
.m-sec .label { color: var(--on-chrome-muted); padding: 2px 10px; }
.m-sec button { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 10px; background: none; border: 0; color: var(--on-chrome); font-family: var(--f-type); font-size: 16px; text-align: left; border-radius: var(--r-sm); }
.m-sec button:hover, .m-sec button:active { background: var(--chrome-2); }
.m-sec button[aria-current="page"] { color: var(--bone); box-shadow: inset 4px 0 0 var(--blood); }
.m-sec button b { font-weight: 400; color: var(--bone); }
.m-sec button small { color: var(--on-chrome-muted); font-size: 12px; }
.m-sec button .badge { background: var(--blood); color: #F6EFE2; padding: 0 6px; font-size: 12px; }
.m-sec button.danger { color: #FF6B70; }
.m-sec select { margin: 4px 10px; background: var(--chrome-2); color: var(--on-chrome); border: 1px solid #3A2F32; }
.m-steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.m-steps svg.i { width: 16px; height: 16px; vertical-align: -3px; }

/* Início e páginas */
.m-mode .community { grid-template-columns: minmax(0, 1fr); }
.m-mode .mural { max-height: 260px; }
.m-mode .op-grid { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.m-mode .op-tile { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto; padding: 6px 8px; }
.m-mode .op-act { grid-column: auto; }
.mural-more { margin-top: 10px; }
.m-mode .page-title { font-size: 40px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg .btn.on { background: var(--accent); color: var(--accent-ink); border-color: #000; }
.device-card .field { display: grid; gap: 6px; }
.device-card .field > span:first-child { font-family: var(--f-type); font-size: 13px; color: var(--muted); }

/* Sala: só a barra, os rostos e o mapa */
.m-room { display: grid; position: relative; overflow: hidden; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "bar" "av" "map"; }
html.m-in-room .app-foot { display: none; }
.m-bar {
  grid-area: bar; display: flex; align-items: center; gap: 6px; min-height: 48px; position: relative; z-index: 12;
  background: var(--chrome); color: var(--on-chrome); border-bottom: 3px solid var(--blood);
  padding: max(2px, env(safe-area-inset-top, 0px)) max(6px, env(safe-area-inset-right, 0px)) 2px max(6px, env(safe-area-inset-left, 0px));
}
.m-bar .icon-btn { color: var(--on-chrome); width: 44px; height: 44px; flex: none; }
.m-bar .icon-btn svg.i { width: 22px; height: 22px; }
.m-bar-t { flex: 1; min-width: 0; font-family: var(--f-display); font-size: 22px; line-height: 1.1; color: var(--bone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 2px 2px 0 var(--blood); }
.m-bar .chip.live, .m-bar .chip.waiting { font-size: 11px; flex: none; padding: 1px 6px; }
/* Retrato: rostos numa faixa fina em cima, rolando para o lado */
.m-room .av { min-height: 0; gap: 9px; padding: 8px 10px 10px max(10px, env(safe-area-inset-left, 0px)); align-items: flex-start; overscroll-behavior: contain; }
.m-room .tile { width: 86px; padding: 4px 4px 18px; box-shadow: 2px 2px 0 #000; }
.m-room .tile .screen { height: 54px; }
.m-room .tile .avatar { width: 32px; height: 32px; font-size: 12px; }
.m-room .tile .tname { font-size: 11px; bottom: 2px; left: 5px; right: 4px; }
.m-room .tile .tctl { bottom: 2px; right: 2px; }
.m-room .tile .tctl button { width: 26px; height: 26px; }
.m-room .tile .mctl { left: 2px; bottom: 30px; }
.m-room .tile .crown { font-size: 9px; letter-spacing: .06em; }
.m-room .tile .rtc-st { font-size: 8.5px; bottom: 2px; }
.m-room .map-hint { display: none; }
.m-room .board { margin: 16px; }
.m-mode .map-scroll { touch-action: none; -webkit-user-select: none; user-select: none; }
.m-tools { padding: 4px 8px; gap: 6px; }
.m-room .map-banner { font-size: 12.5px; padding: 6px 10px; }
/* Botões flutuantes sobre o mapa */
.m-fabs { grid-area: map; align-self: end; justify-self: end; z-index: 15; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none;
  padding: 0 max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) 0; }
.fab {
  pointer-events: auto; position: relative; width: 58px; height: 58px; border-radius: 50%; border: 2px solid #000; box-shadow: 3px 3px 0 #000;
  background: #B3121F; color: #F6EFE2; display: grid; place-items: center; align-content: center; gap: 1px; padding: 0;
  font-family: var(--f-type); font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase; -webkit-tap-highlight-color: transparent;
}
.fab svg.i { width: 22px; height: 22px; }
.fab.alt { background: #17110F; color: #ECE5D6; border-color: #ECE5D6; }
.fab.on { background: #ECE5D6; color: #17110F; border-color: #000; }
.fab.sm { width: 44px; height: 44px; }
.fab:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }
.fab .badge { position: absolute; top: -5px; right: -5px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; border: 2px solid #000; background: #F2C14E; color: #17110F; font-family: var(--f-num); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
/* Menu do Mestre (opção A: o básico) */
.m-pop { grid-area: map; align-self: end; justify-self: end; z-index: 16; margin: 0 calc(max(12px, env(safe-area-inset-right, 0px)) + 70px) 12px 0;
  width: min(250px, 70vw); background: #050405; color: #ECE5D6; border: 1px solid #3A2F32; border-top: 4px solid #B3121F; box-shadow: 5px 5px 0 #000; display: grid; padding: 4px; }
.m-pop button { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 10px; background: none; border: 0; color: inherit; font-family: var(--f-type); font-size: 15px; text-align: left; }
.m-pop button:active { background: #1A1416; }
.m-pop-note { font-size: 11.5px; color: #9C9284; padding: 6px 10px 4px; border-top: 1px solid #2A2124; margin-top: 2px; }
/* Painel (Chat, Fichas, Arquivos): no retrato, gaveta de baixo até a metade da tela */
.m-side { grid-area: auto; position: absolute; left: 0; right: 0; bottom: 0; height: 50%; z-index: 20; border-left: 0; border-top: 3px solid var(--blood); box-shadow: 0 -6px 0 rgba(0, 0, 0, .55);
  padding-bottom: env(safe-area-inset-bottom, 0px); }
.m-side .tabs button { padding: 10px 6px 8px; font-size: 13px; }
.m-side .tabs .m-side-x { flex: 0 0 46px; color: var(--ink); }
.m-room.panel-open .m-fabs, .m-room.panel-open .m-pop { display: none; }
.m-mode .panel.chat .msgs { padding: 10px 12px; gap: 10px; }
.m-roll { border-top: 1px solid var(--line); background: var(--surface-2); flex: none; }
.m-roll > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-family: var(--f-type); font-size: 14px; }
.m-roll > summary::-webkit-details-marker { display: none; }
.m-roll > summary::after { content: "▾"; margin-left: auto; color: var(--muted); }
.m-roll[open] > summary::after { content: "▴"; }
.m-roll .roller { border-top: 0; padding: 4px 12px 10px; gap: 8px; }
.m-mode .chat-in { padding: 8px 10px max(8px, env(safe-area-inset-bottom, 0px)); }
#yt-dock { transition: opacity .15s; }
html.m-panel-open #yt-dock { opacity: 0; pointer-events: none; }
html.m-mode #yt-dock.m-nomusic { display: none; }
html.m-in-room #yt-dock .dock-b { max-height: 48dvh; overflow: auto; }
html.m-in-room #yt-dock { left: max(10px, env(safe-area-inset-left, 0px)); right: auto; bottom: max(10px, env(safe-area-inset-bottom, 0px)); width: min(300px, calc(100vw - 110px)); }
/* Paisagem: rostos numa coluna à esquerda (1/5) e o mapa no resto; o chat aberto ocupa ~40% à direita */
@media (orientation: landscape) {
  .m-room { grid-template-columns: 20% minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "bar bar" "av map"; }
  .m-room.panel-open { grid-template-columns: 20% minmax(0, 1fr) 40%; grid-template-areas: "bar bar bar" "av map side"; }
  .m-room.panel-open .m-fabs, .m-room.panel-open .m-pop { display: flex; }
  .m-room.panel-open .m-pop { display: grid; }
  .m-room .av { flex-direction: column; align-items: stretch; overflow-x: hidden; overflow-y: auto; border-bottom: 0; border-right: 1px solid var(--line); padding: 10px 10px max(10px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px)); }
  .m-room .tile { width: auto; flex: none; }
  .m-room .tile .screen { height: auto; aspect-ratio: 4 / 3; }
  .m-room .tile .avatar { width: 38px; height: 38px; font-size: 14px; }
  .m-side { position: relative; grid-area: side; height: auto; border-top: 0; border-left: 3px solid var(--blood); box-shadow: none; min-height: 0; padding-right: env(safe-area-inset-right, 0px); }
  html.m-panel-open #yt-dock { opacity: 1; pointer-events: auto; }
}

/* Ficha em tela cheia com zoom */
.m-mode .overlay.m-fs { padding: 0; }
.m-mode .overlay.m-fs > .modal { width: 100%; min-height: 100%; border: 0; border-radius: 0; border-top: 4px solid var(--accent); padding-bottom: env(safe-area-inset-bottom, 0px); }
.m-fs .modal-h { position: sticky; top: 0; z-index: 5; background: var(--surface); flex-wrap: wrap; gap: 6px;
  padding: max(8px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) 8px max(10px, env(safe-area-inset-left, 0px)); }
.m-fs .modal-h h2 { font-size: 24px; flex-basis: 100%; order: -1; }
.m-fs .modal-h .pdf-l { display: none; }
.m-fs .sheet-wrap { zoom: var(--sz, 1); }
.m-fs .assist { order: 2; border-bottom: 0; border-top: 1px solid var(--line); }
.m-fs .pickbar { padding-bottom: max(10px, env(safe-area-inset-bottom, 0px)); z-index: 5; }
.sz-ctl { display: inline-flex; align-items: center; gap: 2px; margin-right: auto; border: 1px solid var(--line-strong); border-radius: var(--r-sm); }
.sz-ctl .icon-btn { width: 40px; height: 38px; }
.sz-ctl output { min-width: 46px; text-align: center; font-family: var(--f-type); font-size: 13.5px; }
.m-mode .overlay { padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px)); padding-top: max(10px, env(safe-area-inset-top, 0px)); }

/* Som bloqueado (iPhone): um toque libera */
#audio-pill { position: fixed; z-index: 85; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 58px);
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; background: #B3121F; color: #F6EFE2; border: 2px solid #000; box-shadow: 4px 4px 0 #000;
  font-family: var(--f-type); font-size: 15px; border-radius: var(--r-sm); }

/* Quem está falando: borda acesa no rosto (computador e celular) */
.tile { transition: box-shadow .12s; }
.tile.speaking { box-shadow: 0 0 0 3px #3FD06A, 0 0 16px 4px rgba(63, 208, 106, .6), 3px 3px 0 #000; }
.tile.me.speaking { outline-color: #3FD06A; }

/* =====================================================================
   Animação das rolagens (1.8.0): d10 cor de osso, números vermelho-sangue
   ===================================================================== */
#dice-fx { position: fixed; z-index: 72; pointer-events: none; display: grid; place-items: center; overflow: hidden; }
#dice-fx:empty { display: none; }
.dfx { display: grid; justify-items: center; gap: 14px; padding: 12px; transition: opacity .45s; max-width: 100%; }
.dfx.out { opacity: 0; }
.dfx-dice { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; max-width: min(100%, 600px); }
.d10 { width: 64px; height: 64px; display: block; filter: drop-shadow(4px 5px 0 rgba(0, 0, 0, .85)); transition: opacity .25s; position: relative; }
.dfx.sm .d10 { width: 42px; height: 42px; }
.dfx.sm .dfx-dice { gap: 7px; max-width: min(100%, 330px); }
.d10 svg { width: 100%; height: 100%; overflow: visible; }
.d10-body { fill: #D9CFBC; stroke: #17110F; stroke-width: 2.5; stroke-linejoin: round; }
.d10-face { fill: #ECE5D6; stroke: #17110F; stroke-width: 2; stroke-linejoin: round; }
.d10-edge { stroke: #17110F; stroke-width: 2; fill: none; }
.d10-n { font-family: 'Pirata One', 'Barlow Condensed', serif; fill: #B3121F; }
.d10.rolling { animation: d10-tumble 1s cubic-bezier(.18, .72, .28, 1) both; animation-delay: calc(var(--i) * 25ms); }
@keyframes d10-tumble {
  0% { transform: translate(var(--rx), var(--ry)) rotate(var(--rot)) scale(.35); opacity: 0; }
  12% { opacity: 1; }
  65% { transform: translate(calc(var(--rx) * -.06), 10px) rotate(calc(var(--rot) * -.08)) scale(1.08); }
  82% { transform: translate(0, -6px) rotate(calc(var(--rot) * .02)) scale(.98); }
  100% { transform: none; }
}
.d10.miss { opacity: .4; }
.d10.hit { filter: drop-shadow(0 0 7px rgba(179, 18, 31, .8)) drop-shadow(4px 5px 0 rgba(0, 0, 0, .85)); }
.d10.hit .d10-face { fill: #FFF8EC; }
.d10.one .d10-body { fill: #8E0E18; }
.d10.one .d10-face { fill: #B3121F; }
.d10.one .d10-n { fill: #F6EFE2; }
.d10.ten2::after { content: "×2"; position: absolute; right: -8px; top: -8px; background: #F2C14E; color: #17110F; font: 700 12px/1 var(--f-num); padding: 3px 4px; transform: rotate(8deg); box-shadow: 1px 1px 0 #000; }
.dfx-more { font-family: var(--f-display); font-size: 30px; color: #ECE5D6; text-shadow: 2px 2px 0 #000; }
.dfx-banner { background: #050405; color: #ECE5D6; border: 1px solid #3A2F32; border-left: 6px solid #B3121F; box-shadow: 6px 6px 0 #000; padding: 10px 18px; text-align: center;
  max-width: min(92vw, 520px); transform: rotate(-1deg); opacity: 0; transition: opacity .2s; }
.dfx.landed .dfx-banner { opacity: 1; }
.dfx-who { font-family: var(--f-type); font-size: 13.5px; color: #CFC6B6; overflow-wrap: anywhere; }
.dfx-who b { color: #F2C14E; font-weight: 400; }
.dfx-res { font-family: var(--f-display); font-size: 42px; line-height: 1.05; color: #F6EFE2; text-shadow: 2px 2px 0 #5E0910; }
.dfx-banner.fail { border-left-color: #6F665C; }
.dfx-banner.fail .dfx-res { color: #A39A8C; text-shadow: none; }
.dfx-banner.botch { border-left-color: #FF3B47; }
.dfx-banner.botch .dfx-res { color: #FF4652; letter-spacing: .02em; text-shadow: 2px 2px 0 #000; }
.dfx.landed .dfx-banner.botch { animation: dfx-shake .5s 1; }
@keyframes dfx-shake { 0%, 100% { transform: rotate(-1deg) translateX(0); } 20% { transform: rotate(-1deg) translateX(-9px); } 40% { transform: rotate(-1deg) translateX(8px); } 60% { transform: rotate(-1deg) translateX(-5px); } 80% { transform: rotate(-1deg) translateX(4px); } }
.dfx-wp { font-family: var(--f-type); font-size: 12.5px; color: #F2C14E; letter-spacing: .06em; text-transform: uppercase; margin-top: 3px; }
.dfx.sm .dfx-res { font-size: 30px; }
.dfx.sm .dfx-who { font-size: 12px; }
.dfx.sm .dfx-banner { padding: 8px 12px; }

/* =====================================================================
   Tutoriais em vídeo no Suporte (1.8.1) — vieram da antiga aba Ajuda do site
   ===================================================================== */
.tut-card { display: grid; gap: 14px; margin-bottom: 16px; }
.tut-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.tut-head .small svg.i { width: 13px; height: 13px; vertical-align: -2px; }
.help-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 340px); gap: 20px; align-items: start; }
.player { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-lg); overflow: hidden; }
.player-frame { position: relative; aspect-ratio: 16 / 9; background: #000; border-bottom: 3px solid var(--blood); }
.player-frame video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; display: block; }
.player-msg { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; text-align: center; padding: 24px; color: #CFC6B6; font-family: var(--f-type); font-size: 14px; background: #000; }
.player-msg[hidden] { display: none; }
.player-body { padding: 14px 18px 18px; display: grid; gap: 8px; }
.player-body h3 { font-family: var(--f-display); font-size: clamp(26px, 3vw, 34px); line-height: 1.05; text-shadow: 2px 2px 0 var(--accent-deep); margin: 0; }
.player-body p { color: var(--muted); font-size: 15px; max-width: 70ch; margin: 0; }
.player-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.help-aside { display: grid; gap: 10px; }
.tut-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: t; }
.tut { counter-increment: t; }
.tut button { width: 100%; text-align: left; display: grid; grid-template-columns: 40px 1fr; gap: 2px 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--r-sm); color: var(--ink); cursor: pointer; }
.tut button::before { content: counter(t, decimal-leading-zero); grid-row: span 2; font-family: var(--f-num); font-weight: 700; font-size: 24px; line-height: 1; color: var(--muted); padding-top: 2px; }
.tut button:hover { border-left-color: var(--accent); }
.tut button[aria-current="true"] { border-color: var(--line-strong); border-left-color: var(--accent); background: var(--surface-2); box-shadow: var(--shadow); }
.tut button[aria-current="true"]::before { color: var(--hl); }
.tut-t { font-family: var(--f-type); font-size: 14px; letter-spacing: .03em; line-height: 1.35; }
.tut-d .playing { color: var(--hl); font-family: var(--f-type); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 900px) { .help-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Fichas personalizadas (1.8.1) ---------- */
.chip.custom { background: #2A1D3A; color: #E6D9FF; border-color: #6B4FA0; }
.custom-box { align-items: flex-start; gap: 10px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: var(--r-sm); background: var(--surface); }
.custom-box input { margin-top: 3px; }
.budget .bar i.free { background: #7A5BC0; }
.m-edits .msglist { margin-top: 8px; }
.req-sheet svg.i { width: 15px; height: 15px; }
