:root {
  --bg: #0b0a12;
  --surface: #14121f;
  --surface-2: #1c1930;
  --surface-3: #272342;
  --line: #2f2a4c;
  --text: #f1eefb;
  --muted: #a39cc0;
  --accent: #a855f7;
  --accent-2: #22d3ee;
  --accent-ink: #0b0a12;
  --danger: #ff4d6d;
  --warn: #facc15;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, .45);
  color-scheme: dark;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); overflow: hidden; font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.overlay { position: fixed; inset: 0; display: grid; place-items: center; z-index: 50; background: rgba(8, 9, 18, .72); padding: 16px; }
.sub { color: var(--muted); margin: 4px 0 0; line-height: 1.45; }
.note { color: var(--warn); min-height: 1em; margin: 0; font-size: 13px; line-height: 1.4; }
.error { color: var(--danger); min-height: 1.2em; margin: 0; }

.primary { background: var(--accent); color: #fff; border: 0; border-radius: 12px; padding: 10px 16px; font-weight: 700; }
.primary:hover { filter: brightness(1.08); }
.primary:disabled { opacity: .6; cursor: progress; }
.primary.big { padding: 13px 18px; font-size: 15px; width: 100%; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-3); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip.danger:hover { border-color: var(--danger); color: var(--danger); }
.chip svg { width: 16px; height: 16px; }
.close { background: none; border: 0; color: var(--muted); font-size: 26px; line-height: 1; width: 36px; height: 36px; border-radius: 10px; }
.close:hover { background: var(--surface-3); color: var(--text); }

.field { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.field input, .field select, select#tb-status {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text); width: 100%;
}
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; }

/* ---------- entrada ---------- */
.setup { background: radial-gradient(1000px 560px at 15% 5%, #261a3d 0%, transparent 60%), radial-gradient(900px 600px at 95% 95%, #142a33 0%, transparent 55%), var(--bg); overflow: auto; }
.setup-card { box-shadow: var(--shadow); }
.setup.editing { background: rgba(8, 9, 18, .78); }
.setup-card { width: min(920px, 100%); padding: 28px; margin: auto; }
.setup-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.logo { margin: 0; display: flex; align-items: center; }
.logo img { display: block; max-width: 100%; height: auto; }
#space-hint { color: var(--accent-2); }
.setup-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; }
.setup-media, .setup-profile { display: grid; gap: 14px; align-content: start; }
.preview { position: relative; aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden; background: #0c0d17; border: 1px solid var(--line); }
.preview video { width: 100%; height: 100%; object-fit: cover; }
.preview video.mirror { transform: scaleX(-1); }
.novideo { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.preview-controls { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 12px; }
.round { width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); display: grid; place-items: center; backdrop-filter: blur(6px); }
.round:hover { background: rgba(255, 255, 255, .26); }
.round.off { background: var(--danger); color: #fff; }
.avatar-stage { display: grid; place-items: center; background: linear-gradient(180deg, #2a1f4a, #15112a); border: 1px solid var(--line); border-radius: 16px; padding: 6px; }
#avatar-preview { image-rendering: pixelated; }
#avatar-options { display: grid; gap: 8px; }
.opt-row { display: grid; grid-template-columns: 56px 1fr; align-items: center; gap: 8px; }
.opt-label { color: var(--muted); font-size: 12px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opts .chip { padding: 4px 10px; font-size: 12px; text-transform: capitalize; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; background: var(--c); padding: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.swatch.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.dice { justify-self: start; }
.left-card { padding: 32px; max-width: 420px; text-align: center; display: grid; gap: 14px; }
.left-card h2 { margin: 0; }

/* ---------- mundo ---------- */
#world { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; cursor: pointer; outline: none; }
#world.arrastando { cursor: grabbing; }

#topbar { position: fixed; top: 12px; left: 12px; z-index: 10; pointer-events: none; }
#zone-label { display: inline-block; background: rgba(27, 29, 46, .88); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; backdrop-filter: blur(8px); }
#zone-label.private { border-color: var(--accent); color: var(--accent); }
#versao-goplay { display: inline-block; margin-left: 6px; background: rgba(27, 29, 46, .88); border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 600; color: var(--muted); backdrop-filter: blur(8px); }

#videos-pessoas { position: fixed; top: 12px; left: 220px; right: 12px; display: grid; justify-items: center; gap: 6px; z-index: 10; pointer-events: none; }
#videobar-toggle { pointer-events: auto; padding: 6px 12px; min-height: 34px; max-width: 100%; border-radius: 999px; background: rgba(27, 29, 46, .96); box-shadow: 0 3px 12px #0005; font-size: 12px; }
#videobar { display: flex; gap: 8px; max-width: 100%; overflow-x: auto; padding: 2px; scrollbar-width: thin; pointer-events: auto; }
body.channels-open #videos-pessoas { left: calc(var(--largura-salas) + 24px); }
body.panel-open #videos-pessoas { right: 354px; }
body.editing #videos-pessoas { left: 324px; }
.tile { position: relative; flex: none; width: 176px; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 2px solid var(--line); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); cursor: zoom-in; transition: border-color .12s; }
.tile.speaking { border-color: var(--accent); }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile video.mirror { transform: scaleX(-1); }
.tile.screen { width: 230px; }
.tile.screen video { object-fit: contain; background: #000; }
.tile .previa-tela { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.28); pointer-events: none; }
.tile.screen .ph { padding-top: 20px; align-items: start; }
.tile.screen .assistir-tela { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -35%); background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.tile.screen.assistindo .assistir-tela { top: 6px; right: 6px; left: auto; transform: none; font-size: 11px; padding: 4px 8px; background: var(--surface-3); border-color: var(--line); }
.tile.screen.assistindo .waiting { top: 40px; }
.tile .ph { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(180deg, #2a1f4a, #15112a); }
.tile .ph canvas { width: 66px; height: 66px; border-radius: 50%; background: #3b2a5a; image-rendering: pixelated; }
.tile .label { position: absolute; left: 6px; bottom: 6px; right: 6px; display: flex; align-items: center; gap: 4px; }
.tile .name { background: rgba(10, 11, 22, .72); padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mic-off { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--danger); color: #fff; flex: none; }
.mic-off svg { width: 13px; height: 13px; }
.tile .waiting { position: absolute; top: 6px; left: 6px; font-size: 11px; background: rgba(10, 11, 22, .72); padding: 2px 8px; border-radius: 999px; color: var(--warn); }
/* Mudo rápido do som da transmissão no cartão da tela assistida (o volume fica no destaque). */
.tile-som { position: absolute; top: 6px; left: 6px; z-index: 1; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: rgba(10, 11, 22, .82); color: var(--text); }
.tile-som:hover { border-color: var(--accent); }
.tile-som[aria-pressed="true"] { color: var(--danger); border-color: rgba(255, 77, 109, .5); }
.tile-som[hidden] { display: none; }
/* Selo da transmissão ativa (cartões de tela): canto de baixo, longe do Assistir e do mudo rápido. */
.tile .ao-vivo { position: absolute; right: 6px; bottom: 6px; z-index: 1; padding: 2px 6px; border-radius: 4px; background: #dc2626; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .06em; line-height: 1.4; box-shadow: 0 0 10px rgba(220, 38, 38, .45); pointer-events: none; }
/* O nome termina antes do selo (60px + folga): nomes longos ganham reticências em vez de ficar por baixo dele. */
.tile.screen .label { right: 72px; }
.tile-som svg { width: 15px; height: 15px; }

/* ---------- controle de volume (som da transmissão e música do Barzinho; ui.js ControleVolume) ---------- */
.controle-volume { flex: none; display: flex; align-items: center; gap: 6px; min-width: 0; }
.controle-volume[hidden] { display: none; }
.controle-volume .cv-mudo { flex: none; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text); }
.controle-volume .cv-mudo:hover { background: var(--surface-3); }
.controle-volume .cv-mudo svg { width: 18px; height: 18px; }
.controle-volume.mudo .cv-mudo { color: var(--danger); }
.controle-volume .cv-barra {
  --valor: 50%; flex: none; width: 88px; height: 6px; margin: 0; padding: 0; appearance: none; border-radius: 999px; cursor: pointer;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)) 0 / var(--valor) 100% no-repeat, var(--surface-3);
}
.controle-volume .cv-barra::-webkit-slider-thumb { appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(168, 85, 247, .45); }
.controle-volume .cv-barra::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(168, 85, 247, .45); }
.controle-volume .cv-barra:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 5px; }
/* No mudo a barra guarda o nível (desmutar volta a ele), só esmaecida. */
.controle-volume.mudo .cv-barra { filter: grayscale(1); opacity: .5; }
.controle-volume .cv-numero { flex: none; min-width: 3.4em; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }

#hint { position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%); background: rgba(27, 29, 46, .92); border: 1px solid var(--accent); border-radius: 999px; padding: 8px 16px; z-index: 10; font-size: 13px; }
kbd { background: var(--surface-3); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; font-family: inherit; font-weight: 700; }

/* ---------- barra de ferramentas ---------- */
#toolbar { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 7px; background: rgba(27, 29, 46, .94); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); backdrop-filter: blur(10px); z-index: 20; max-width: calc(100vw - 16px); overflow-x: auto; }
.login-card .baixar-app { margin-top: 14px; color: var(--text); text-decoration: none; }
a.tool { color: var(--text); }
.tool { position: relative; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; display: grid; place-items: center; color: var(--text); flex: none; }
.tool:hover { background: var(--surface-3); }
.tool.active { background: rgba(168, 85, 247, .16); color: var(--accent); }
.tool.off { background: rgba(255, 77, 109, .16); color: var(--danger); }
.tool.danger:hover { color: var(--danger); }
.sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; flex: none; }
.profile-btn { display: flex; align-items: center; gap: 8px; background: transparent; border: 0; border-radius: 12px; padding: 4px 10px 4px 4px; max-width: 170px; flex: none; }
.profile-btn:hover { background: var(--surface-3); }
.profile-btn canvas { width: 30px; height: 30px; border-radius: 50%; background: #3b2a5a; image-rendering: pixelated; flex: none; }
#tb-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
select#tb-status { width: auto; padding: 8px 10px; border-radius: 10px; flex: none; }
select#tb-status option[value="available"] { color: var(--accent); }
.badge { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.count-badge { position: absolute; bottom: 2px; right: 2px; font-size: 10px; font-weight: 700; color: var(--muted); }

/* ---------- botão flutuante do chat (chat-flutuante.js) ---------- */
/* Posição padrão até o script aplicar a guardada: canto inferior direito, acima da barra. Acima da barra e do painel, abaixo de popovers, janelas e avisos. */
#chat-flutuante { position: fixed; right: 16px; bottom: 88px; z-index: 22; width: 52px; height: 52px; padding: 0; border: 2px solid rgba(255, 255, 255, .14); border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow), 0 0 18px rgba(168, 85, 247, .45); touch-action: none; user-select: none; -webkit-user-select: none; transition: left .18s ease-out, top .18s ease-out, background-color .12s, box-shadow .12s, transform .12s; }
#chat-flutuante:hover { box-shadow: var(--shadow), 0 0 24px rgba(168, 85, 247, .7); }
#chat-flutuante:active:not(.arrastando) { transform: scale(.95); }
#chat-flutuante:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; }
#chat-flutuante.aberto { background: var(--surface-3); color: var(--accent); border-color: var(--accent); box-shadow: var(--shadow); }
#chat-flutuante.arrastando { cursor: grabbing; transition: none; box-shadow: var(--shadow), 0 0 0 4px rgba(34, 211, 238, .35); }
#chat-flutuante.sob-painel, body.editing #chat-flutuante { display: none; }
.chat-flutuante-icone { display: grid; place-items: center; pointer-events: none; }
.chat-flutuante-icone svg { width: 24px; height: 24px; }
#chat-flutuante .badge { top: -4px; right: -4px; min-width: 20px; height: 20px; font-size: 11px; border: 2px solid var(--bg); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { #chat-flutuante { transition: none; } }

.popover { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); z-index: 30; }
.emotes { display: grid; grid-template-columns: repeat(8, 44px); gap: 4px; padding: 8px; }
.emotes button { width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; font-size: 24px; }
.emotes button:hover { background: var(--surface-3); transform: scale(1.1); }
.help { width: min(380px, calc(100vw - 24px)); padding: 16px 18px; }
.help h3 { margin: 0 0 10px; }
.help dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 12px; }
.help dt { font-weight: 700; color: var(--accent); }
.help dd { margin: 0; color: var(--muted); }
.help p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 13px; }
.help strong { color: var(--text); }

/* ---------- painel lateral ---------- */
#panel { position: fixed; top: 12px; right: 12px; bottom: 80px; width: 330px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); z-index: 15; display: flex; flex-direction: column; overflow: hidden; }
.tabs { display: flex; align-items: center; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); }
.tabs [data-tab] { background: transparent; border: 0; border-radius: 10px; padding: 8px 12px; font-weight: 600; color: var(--muted); }
.tabs [data-tab].active { background: var(--surface-3); color: var(--text); }
.tabs .close { margin-left: auto; }
.count { color: var(--muted); font-weight: 500; }
.tab-body { flex: 1; overflow: auto; }
#people { list-style: none; margin: 0; padding: 6px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.person:hover { background: var(--surface-2); }
.portrait { border-radius: 50%; background: #3b2a5a; image-rendering: pixelated; flex: none; }
.who { flex: 1; min-width: 0; }
.pname { font-weight: 600; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psub { color: var(--muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.pactions { display: flex; gap: 2px; opacity: .55; }
.person:hover .pactions, .pactions:focus-within { opacity: 1; }
.mini { width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; display: grid; place-items: center; font-size: 15px; color: var(--text); }
.mini:hover { background: var(--surface-3); }
.mini svg { width: 16px; height: 16px; }


/* ---------- avisos ---------- */
#toasts { position: fixed; bottom: 86px; right: 14px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(360px, calc(100vw - 28px)); }
body.panel-open #toasts { right: 356px; }
.toast { display: flex; align-items: center; gap: 10px; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow); animation: pop .2s ease-out; transition: opacity .35s, transform .35s; }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
#banner { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); background: #4a2330; border: 1px solid var(--danger); border-radius: 12px; padding: 8px 14px; z-index: 70; display: flex; gap: 12px; align-items: center; }

/* ---------- quadro ---------- */
/* O destaque da transmissão fica em tela-transmissao.css. */

.board-card { width: min(1280px, 96vw); padding: 12px; display: grid; gap: 10px; }
.board-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.board-bar strong { margin-right: auto; }
.tool-group { display: flex; gap: 6px; align-items: center; }
.size { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-3); display: grid; place-items: center; padding: 0; }
.size span { background: var(--text); border-radius: 50%; display: block; }
.size.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
#board-canvas { width: 100%; aspect-ratio: 16 / 9; height: auto; background: #fff; border-radius: 10px; cursor: crosshair; touch-action: none; max-height: calc(100vh - 140px); object-fit: contain; }

.help p + p, .help button { margin-top: 10px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 0; }
.spacer { flex: 1; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chip:disabled { opacity: .45; cursor: default; }
.chip:disabled:hover { border-color: var(--line); }

/* ---------- diálogos ---------- */
.dialog-overlay { z-index: 80; }
.dialog { width: min(440px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; }
.dialog.wide { width: min(560px, 100%); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 8px; }
.dialog-head h2 { margin: 0; font-size: 18px; }
.dialog-body { padding: 8px 18px 4px; display: grid; gap: 14px; overflow: auto; }
.dialog-body textarea, .dialog-body .field input { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text); width: 100%; resize: vertical; }
.dialog-body textarea:focus { border-color: var(--accent); outline: none; }
.dialog-actions { display: flex; gap: 8px; align-items: center; padding: 14px 18px 18px; }

/* ---------- boas-vindas ---------- */
.dialog.boas-vindas-dialog { position: relative; width: min(960px, 100%); }
.boas-vindas-dialog .dialog-head { position: absolute; top: 8px; right: 8px; padding: 0; z-index: 1; }
.boas-vindas-dialog .dialog-head h2 { display: none; }
.boas-vindas-dialog .close { background: var(--surface); color: var(--text); }
.boas-vindas-dialog .dialog-body { padding: 0; }
.boas-vindas-banner { display: block; width: 100%; height: auto; }
.boas-vindas-dialog .dialog-actions { flex-shrink: 0; }

/* ---------- placa da estátua (estatua.js) ---------- */
/* A própria pedra é o visual: sem cartão, título nem moldura, só o botão de fechar discreto no canto. */
.placa-overlay { background: rgba(8, 9, 18, .55); animation: placa-fundo .18s ease-out; }
.dialog.placa-dialog { position: relative; width: min(92vw, 720px, 100%, calc((100vh - 32px) * 2)); max-height: none; overflow: visible; background: none; border: 0; border-radius: 0; box-shadow: none; animation: placa-entra .24s cubic-bezier(.2, .9, .3, 1.15); }
.placa-dialog .dialog-head { position: absolute; top: 0; right: 0; padding: 0; z-index: 1; }
.placa-dialog .dialog-head h2 { display: none; }
.placa-dialog .close { width: 30px; height: 30px; font-size: 20px; border: 1px solid var(--line); border-radius: 999px; background: rgba(20, 18, 31, .78); color: var(--muted); }
.placa-dialog .close:hover { background: var(--surface-3); color: var(--text); }
.placa-dialog .dialog-body { padding: 0; overflow: visible; }
.placa-imagem { display: block; width: 100%; height: auto; filter: drop-shadow(0 14px 28px rgba(0, 0, 0, .55)); user-select: none; }
@keyframes placa-fundo { from { opacity: 0; } }
@keyframes placa-entra { from { opacity: 0; transform: translateY(12px) scale(.92); } }
@media (prefers-reduced-motion: reduce) { .placa-overlay, .dialog.placa-dialog { animation: none; } }
.novidades { display: grid; gap: 12px; padding: 16px 18px 0; }
.novidades h3 { margin: 0; font-size: 16px; }
.novidades-lista { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.novidades-lista li { display: grid; gap: 4px; align-content: start; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.novidades-lista strong { color: var(--text); font-size: 14px; }
/* ---------- foto de perfil ---------- */
.foto-perfil-editor { display: flex; align-items: center; gap: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.foto-perfil-previa { width: 96px; height: 96px; flex: none; border-radius: 50%; }
.foto-perfil-acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.foto-perfil-controles { min-width: 0; }
.foto-perfil-controles .hint { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 6px 0; }
.foto-perfil-estado { min-height: 1.2em; font-size: 12px; margin: 6px 0 0; }
.audio-pessoa-mudo { display: flex; align-items: center; gap: 8px; }
.audio-pessoa-mudo input { width: 18px; height: 18px; accent-color: var(--accent); }
.pactions { flex-wrap: wrap; max-width: 112px; }
.notes { display: grid; gap: 8px; max-height: 220px; overflow: auto; color: var(--text); }
.note-item { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.note-item .meta { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--muted); }
.note-item .meta strong { color: var(--text); }
.note-item .text { margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.desk-note { margin: 0; padding: 10px 12px; background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: 8px; color: var(--text); }

/* ---------- editor do escritório ---------- */
#editor { position: fixed; top: 12px; left: 12px; bottom: 80px; width: 300px; z-index: 25; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
body.editing #topbar, body.editing #hint { display: none; }
body.editing #world { cursor: crosshair; }
.editor-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 4px 16px; }
.editor-head h2 { margin: 0; font-size: 16px; }
.editor-tabs { display: flex; gap: 4px; padding: 6px 10px 10px; border-bottom: 1px solid var(--line); }
.editor-tabs button { flex: 1; background: transparent; border: 0; border-radius: 10px; padding: 7px 4px; color: var(--muted); font-weight: 600; font-size: 13px; }
.editor-tabs button.active { background: var(--surface-3); color: var(--text); }
.editor-body { flex: 1; overflow: auto; padding: 12px; display: grid; gap: 12px; align-content: start; }
.editor-foot { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.editor-foot .muted { width: 100%; font-size: 12px; }
.palette { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tile-btn { display: grid; justify-items: center; gap: 4px; padding: 6px 4px; background: var(--surface-2); border: 2px solid transparent; border-radius: 10px; font-size: 11px; color: var(--muted); }
.tile-btn canvas { width: 40px; height: 40px; image-rendering: pixelated; border-radius: 4px; }
.tile-btn:hover { border-color: var(--line); color: var(--text); }
.tile-btn.active { border-color: var(--accent); color: var(--text); }
.zone-list { display: grid; gap: 8px; }
.zone-item { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: grid; gap: 6px; }
.zone-item.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.zone-row { display: flex; gap: 6px; align-items: center; }
.zone-row input:not([type]), .zone-row select { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; color: var(--text); }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.check input { accent-color: var(--accent); }
.size-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#editor hr { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 4px 0; }
.primary.pulse { box-shadow: 0 0 0 0 rgba(168, 85, 247, .6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(168, 85, 247, 0); } 100% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); } }

/* ---------- login ---------- */
.login-card { width: min(420px, 100%); padding: 32px 28px; display: grid; gap: 16px; justify-items: center; text-align: center; }
.login-card .logo { justify-content: center; }
#gsi-button { min-height: 44px; }
#dev-login { display: grid; gap: 10px; width: 100%; }
#dev-login input { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text); }
button.link { background: none; border: 0; padding: 0; color: var(--accent-2); text-decoration: underline; cursor: pointer; font-size: inherit; }
.mini.danger:hover { color: var(--danger); }
.people-admin { list-style: none; padding: 8px; }

/* ---------- lista de salas (estilo Discord) ---------- */
/* --altura-painel-voz vem do card "Voz conectada", fixo abaixo da barra e com a mesma largura. */
:root { --largura-salas: 244px; }
#channels { position: fixed; top: 52px; left: 12px; bottom: calc(12px + var(--altura-painel-voz, 0px)); width: var(--largura-salas); z-index: 12; background: rgba(20, 18, 31, .95); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; backdrop-filter: blur(8px); transition: opacity .16s ease-out, transform .16s ease-out; }
:where(body.painel-voz-acima) #channels { bottom: calc(80px + var(--altura-painel-voz, 0px)); }
#channels.saindo { opacity: 0; transform: translateX(-12px); pointer-events: none; }
@starting-style { #channels { opacity: 0; transform: translateX(-12px); } }
.server-head { padding: 12px 10px 10px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; row-gap: 2px; align-items: center; }
.server-head > span, .server-logo { grid-column: 1; }
.server-ocultar { grid-column: 2; grid-row: 1 / span 2; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: grid; place-items: center; }
.server-ocultar:hover { background: var(--surface-3); color: var(--accent-2); }
.server-ocultar svg { width: 16px; height: 16px; }
/* Aba presa na borda esquerda enquanto a barra está oculta. */
#salas-alca { position: fixed; top: 52px; left: 0; z-index: 12; width: 20px; height: 56px; padding: 0; border: 1px solid var(--line); border-left: 0; border-radius: 0 10px 10px 0; background: rgba(20, 18, 31, .95); color: var(--muted); display: grid; place-items: center; box-shadow: var(--shadow); backdrop-filter: blur(8px); transition: opacity .16s ease-out, transform .16s ease-out; }
#salas-alca:hover { color: var(--accent-2); border-color: var(--accent); }
#salas-alca svg { width: 14px; height: 14px; transform: scaleX(-1); }
@starting-style { #salas-alca { opacity: 0; transform: translateX(-100%); } }
body.editing #salas-alca { display: none; }
/* Logo GoPlay para fundo escuro ("Go" branco); as margens negativas descontam o respiro interno do SVG
   para o símbolo alinhar com o texto de baixo sem aumentar o cabeçalho. */
.server-logo { display: block; width: 124px; max-width: 100%; height: auto; margin: -3px 0 -3px -4px; }
.server-sub { color: var(--muted); font-size: 12px; }
#channel-list { flex: 1; overflow: auto; padding: 4px 6px 12px; }
.ch-title { text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: .07em; color: var(--muted); padding: 12px 8px 4px; }
/* Linha da sala: o botão .ch-name cobre a linha inteira pelo ::after; porta e "Bater" (portas.css) ficam por cima. */
.ch-linha { position: relative; display: flex; align-items: center; gap: 6px; border-radius: 8px; padding: 6px 8px; color: var(--muted); }
.ch-linha:hover { background: var(--surface-3); color: var(--text); }
.channel.current > .ch-linha { background: rgba(168, 85, 247, .2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.ch-name { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; background: transparent; border: 0; padding: 0; color: inherit; font-weight: 600; text-align: left; }
.ch-name::after { content: ""; position: absolute; inset: 0; border-radius: 8px; }
.ch-name:focus-visible { outline: none; }
.ch-name:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; }
.ch-icon { display: grid; place-items: center; }
.ch-icon svg { width: 16px; height: 16px; }
.ch-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-count { margin-left: auto; flex: none; font-size: 11px; background: var(--surface-3); color: var(--text); border-radius: 999px; padding: 0 7px; }
.ch-members { list-style: none; margin: 2px 0 6px; padding: 0 0 0 20px; display: grid; gap: 1px; }
.ch-group > .ch-members { padding-left: 4px; }
.member { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 6px; color: var(--muted); font-size: 13px; }
.member:hover { background: var(--surface-2); color: var(--text); }
.member .avatar-ring { position: relative; width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; display: grid; place-items: center; flex: none; transition: border-color .1s, box-shadow .1s; }
.member.speaking .avatar-ring { border-color: #4ade80; box-shadow: 0 0 8px rgba(74, 222, 128, .7); }
.member .portrait { width: 22px; height: 22px; }
.member .dot { position: absolute; right: -3px; bottom: -3px; width: 9px; height: 9px; border: 2px solid var(--surface); }
/* Arrastar pessoas entre salas (quem pode usar "Mover para"). */
.member[draggable="true"] { cursor: grab; }
.member[draggable="true"]:active { cursor: grabbing; }
#channels.arrastando .channel.alvo-invalido { opacity: .4; }
#channels.arrastando .channel.alvo-arraste > .ch-linha { box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .45); border-radius: 8px; }
#channels.arrastando .channel.alvo-arraste.sobre > .ch-linha { background: rgba(34, 211, 238, .18); box-shadow: inset 0 0 0 2px var(--accent-2); }
.ch-chegada-alvo { margin: 2px 0 6px; padding: 8px 10px; border: 1px dashed rgba(34, 211, 238, .6); border-radius: 8px; color: var(--accent-2); font-size: 13px; font-weight: 600; text-align: center; }
.ch-chegada-alvo.sobre { background: rgba(34, 211, 238, .18); border-style: solid; }
.m-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-media { display: inline-flex; flex: none; align-items: center; gap: 3px; }
.m-media:empty { display: none; }
.m-signal { display: grid; place-items: center; width: 14px; height: 14px; flex: none; }
.m-signal svg { width: 14px; height: 14px; }
.m-screen { color: var(--accent-2); }
.m-camera { color: var(--text); }
.m-watching { color: var(--accent); }
.m-muted { color: var(--danger); display: grid; place-items: center; }
.m-muted svg { width: 14px; height: 14px; }
body.editing #channels { display: none; }
.tile.speaking { border-color: #4ade80; box-shadow: 0 0 14px rgba(74, 222, 128, .45); }
#zone-label.private { border-color: var(--accent); color: #e9d5ff; }

/* ---------- configurações pessoais ---------- */
.dialog.settings-dialog { width: min(700px, 100%); }
.settings-dialog .dialog-body { gap: 12px; padding-bottom: 12px; }
.settings-dialog .note { color: var(--muted); }
.settings-intro { margin: 0; }
.settings-tabs { display: flex; gap: 4px; padding: 5px; border-radius: 12px; background: var(--surface-2); position: sticky; top: -8px; z-index: 2; }
.settings-tabs button { flex: 1; border: 0; border-radius: 8px; padding: 10px 6px; background: transparent; color: var(--muted); }
.settings-tabs button[aria-selected="true"] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 -2px var(--accent-2); }
.settings-page { display: grid; gap: 16px; }
.settings-section { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.settings-section h3 { margin: 0 0 2px; font-size: 14px; color: var(--accent-2); }
.settings-section .note { margin: 0; line-height: 1.5; }
.settings-field { margin: 0; min-width: 0; }
.settings-field select { width: 100%; }
.settings-field small, .settings-toggle small { display: block; color: var(--muted); font-size: 12px; font-weight: normal; line-height: 1.5; margin-top: 4px; }
.settings-toggle { display: flex; justify-content: space-between; align-items: center; gap: 20px; cursor: pointer; padding: 6px 0; }
.settings-toggle strong, .settings-field strong { font-size: 13px; font-weight: 600; }
.settings-toggle input { width: 20px; height: 20px; flex: 0 0 20px; accent-color: var(--accent); }
.settings-field input[type="range"] { width: 100%; accent-color: var(--accent-2); padding: 0; }
.settings-field output { color: var(--accent-2); font-variant-numeric: tabular-nums; }
.settings-meter { display: grid; gap: 6px; }
.settings-meter meter { width: 100%; height: 14px; accent-color: #4ade80; }
.limiar-medidor { position: relative; height: 14px; border-radius: 7px; background: #1f2335; overflow: hidden; }
.limiar-medidor.desligado { opacity: .45; }
.limiar-nivel { height: 100%; width: 0; background: #64748b; transition: width .08s linear; }
.limiar-nivel.passa { background: #4ade80; }
.limiar-marca { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1px; background: #fbbf24; }
.settings-preview { max-width: 420px; width: 100%; justify-self: center; aspect-ratio: 16 / 9; }
.settings-section audio { width: 100%; }
.settings-section > button { justify-self: start; }
.settings-status { min-height: 20px; margin: 0; }
.settings-dialog :focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* ---------- telas pequenas ---------- */
@media (max-width: 820px) {
  .settings-dialog .dialog-body { padding-left: 12px; padding-right: 12px; }
  .settings-tabs { flex-wrap: wrap; }
  .settings-tabs button { flex-basis: 40%; }
  .setup-grid { grid-template-columns: 1fr; }
  .setup-card { padding: 18px; }
  #videos-pessoas, body.channels-open #videos-pessoas, body.panel-open #videos-pessoas, body.editing #videos-pessoas { left: 12px; right: 12px; top: 52px; }
  .tile { width: 132px; }
  #panel { left: 8px; right: 8px; width: auto; top: 96px; }
  body.panel-open #toasts { right: 14px; }
  .emotes { grid-template-columns: repeat(4, 44px); }
  #channels, #editor { left: 8px; right: 8px; width: auto; top: 96px; bottom: auto; max-height: 55vh; }
  #salas-alca { top: 96px; }
}

.aviso-puxao { position: fixed; z-index: 30; left: 50%; bottom: 78px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 24px); padding: 10px 14px; border: 1px solid var(--accent); border-radius: 12px; background: var(--surface); box-shadow: 0 8px 30px #0008; font-size: 13px; }
.pactions { flex-wrap: wrap; max-width: 112px; }
.dialog-actions { flex-wrap: wrap; }

/* ---------- ranking de tempo online (outdoor do fliperama) ---------- */
.ranking-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ranking-item { display: grid; grid-template-columns: 28px 32px 1fr auto; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; background: var(--surface-2); }
.ranking-item.eu { box-shadow: inset 0 0 0 1px #4ade80; }
.ranking-pos { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--c, var(--surface-3)); color: var(--c, var(--text)); }
.ranking-pos[style] { color: #14101f; }
.ranking-nome { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-tempo { color: #c4b5fd; font-weight: 700; font-variant-numeric: tabular-nums; }

#atualizar-app h2 { margin: 4px 0 0; font-size: 1.15rem; }
#atualizar-app .botao-atualizar { display: inline-block; padding: 10px 18px; border-radius: 10px; text-decoration: none; text-align: center; }

/* Miniaturas do catálogo no editor de mapa e de sala. */
.tile-btn img { width: 64px; height: 48px; object-fit: contain; image-rendering: pixelated; }
.editor-tabs { flex-wrap: wrap; }
