:root {
  color-scheme: dark;
  --ink: #f5f1e9;
  --muted: #9b9d96;
  --dim: #6e716c;
  --line: #2e322d;
  --line-soft: rgba(255, 255, 255, .07);
  --lime: #c9f35b;
  --lime-dark: #a8cd46;
  --danger: #ff6d67;
  --warn: #ffd07a;
  --radius: 14px;
  --radius-sm: 9px;
  --shell: min(1420px, calc(100% - 44px));
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background:
    radial-gradient(circle at 13% 0%, rgba(201, 243, 91, .07), transparent 30rem),
    linear-gradient(135deg, #0b0d0c 0%, #111412 58%, #0c0e0d 100%);
  background-attachment: fixed;
  font-family: "Segoe UI", Arial, sans-serif;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3 { letter-spacing: -.035em; }
.hidden { display: none !important; }

/* ---------- Barra superior ---------- */

.topbar {
  width: var(--shell);
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  flex: none;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -.02em;
}

.brand-name { font-size: 15px; }
.brand-name em { color: var(--lime); font-style: normal; }

.brand-mark {
  position: relative;
  width: 28px;
  height: 20px;
  flex: none;
  border: 1.5px solid var(--lime);
  border-radius: 5px;
}

.brand-mark::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 1px;
  left: 9px;
  bottom: -5px;
  background: var(--lime);
}

.brand-mark span {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--lime);
  left: 11px;
  top: 7px;
  box-shadow: 0 0 13px rgba(201, 243, 91, .8);
}

.secure-label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font: 11px Consolas, monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.secure-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px rgba(201, 243, 91, .65);
}

.topbar-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }

.meta-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, .2);
}

.meta-chip b { color: var(--dim); font: 400 8px Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; }
.meta-chip strong { color: var(--ink); font: 600 11px Consolas, monospace; }

.status-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(0, 0, 0, .2);
  font: 10px Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.status-pill span { width: 6px; height: 6px; flex: none; border-radius: 50%; background: #d3a955; }
.status-pill.online span { background: var(--lime); box-shadow: 0 0 8px rgba(201, 243, 91, .5); }
.status-pill.error span { background: var(--danger); }

/* ---------- Botões ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .42; }
.button.primary { color: #151713; background: var(--lime); }
.button.primary:hover:not(:disabled) { background: #d7ff6d; }
.button.secondary { color: var(--ink); background: #292c29; border-color: #3c403b; }
.button.secondary:hover:not(:disabled) { background: #323632; border-color: #4d5349; }
.button.danger { color: #ffd9d7; background: rgba(255, 109, 103, .12); border-color: rgba(255, 109, 103, .42); }
.button.danger:hover:not(:disabled) { background: rgba(255, 109, 103, .2); }

.control-button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #343833;
  border-radius: 8px;
  color: #b7b9b3;
  background: #171a17;
  font-size: 10px;
  white-space: nowrap;
  transition: color .14s ease, border-color .14s ease, background .14s ease;
}

.control-button:hover:not(:disabled) { color: var(--lime); border-color: #50584a; }
.control-button:disabled { cursor: not-allowed; opacity: .45; }
.control-button.requested { color: var(--lime); border-color: rgba(201, 243, 91, .45); }
.control-button.active { color: #151713; border-color: var(--lime); background: var(--lime); }

.mini-action {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #393d38;
  border-radius: 6px;
  color: #b8bbb3;
  background: #151815;
  font-size: 9px;
  white-space: nowrap;
}

.mini-action:hover:not(:disabled) { color: var(--lime); border-color: #56604d; }
.mini-action:disabled { cursor: not-allowed; opacity: .4; }

.text-button { border: 0; color: #aaa9a4; background: transparent; font-size: 11px; }
.text-button:hover { color: var(--lime); }

.shutdown-button {
  padding: 4px;
  border: 0;
  color: #70736e;
  background: transparent;
  font-size: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.shutdown-button:hover { color: var(--danger); }

.play-icon {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
}

/* ---------- Campos ---------- */

input, select {
  min-width: 0;
  height: 44px;
  border: 1px solid #3a3d39;
  border-radius: 8px;
  color: var(--ink);
  background: #111311;
  outline: none;
}

input { padding: 0 13px; }
select { padding: 0 32px 0 12px; }
input:focus-visible, select:focus-visible, button:focus-visible, summary:focus-visible, a:focus-visible {
  border-color: var(--lime-dark);
  outline: 2px solid rgba(201, 243, 91, .55);
  outline-offset: 2px;
}

label { color: #d4d3ce; font-size: 13px; font-weight: 600; }
.form-label { display: block; margin-bottom: 10px; color: #d4d3ce; font-size: 13px; font-weight: 600; }
.field-help { margin: 9px 0 0; color: var(--dim); font-size: 11px; line-height: 1.5; }
.eyebrow, .step-label { margin: 0 0 16px; color: var(--lime); font: 500 11px Consolas, monospace; letter-spacing: .17em; }

.notice {
  margin-top: 18px;
  padding: 13px 15px;
  border: 1px solid rgba(201, 243, 91, .16);
  border-radius: 8px;
  color: #92948e;
  background: rgba(201, 243, 91, .035);
  font-size: 11px;
  line-height: 1.55;
}

.notice strong { display: block; margin-bottom: 3px; color: #c6c8c1; }
.notice.error { border-color: rgba(255, 109, 103, .35); color: #ffaaa6; background: rgba(255, 109, 103, .06); }
.notice.success { border-color: rgba(201, 243, 91, .32); color: #cde47f; }

/* ---------- Página inicial ---------- */

.lobby-main {
  width: var(--shell);
  max-width: 1180px;
  flex: 1;
  margin: 0 auto;
  padding: 56px 0;
  display: grid;
  grid-template-columns: minmax(300px, .95fr) minmax(420px, 1.05fr);
  align-items: center;
  gap: clamp(44px, 7vw, 96px);
}

.lobby-intro h1 {
  margin: 0;
  font-size: clamp(50px, 6vw, 78px);
  line-height: .98;
  letter-spacing: -.065em;
  font-weight: 600;
}

.lobby-intro h1 em { color: var(--lime); font-family: Georgia, serif; font-weight: 600; }
.lede { max-width: 480px; margin: 26px 0 34px; color: var(--muted); line-height: 1.75; font-size: 15px; }

.how-steps { display: grid; gap: 12px; margin: 0 0 30px; padding: 0; list-style: none; }
.how-steps li { display: flex; align-items: flex-start; gap: 14px; }
.how-steps strong { display: block; margin-bottom: 3px; font-size: 13px; }
.how-steps small { color: var(--muted); font-size: 12px; line-height: 1.5; }

.how-number {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border: 1px solid rgba(201, 243, 91, .4);
  border-radius: 50%;
  color: var(--lime);
  background: rgba(201, 243, 91, .07);
  font: 600 11px Consolas, monospace;
}

.trust-row { display: flex; flex-wrap: wrap; gap: 8px; }

.trust-row span {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #b7b7b2;
  background: rgba(0, 0, 0, .18);
  font: 10px Consolas, monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.control-card {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(30, 33, 31, .98), rgba(19, 21, 20, .98));
  box-shadow: 0 30px 80px rgba(0, 0, 0, .38);
}

.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.card-heading .step-label { margin-bottom: 7px; }
.card-heading h2 { margin: 0; font-size: 24px; }

.mode-switch { display: grid; gap: 10px; margin-bottom: 20px; }

.mode-button {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 13px;
  row-gap: 4px;
  padding: 16px;
  border: 1px solid #373a36;
  border-radius: var(--radius);
  color: #b8bab4;
  background: #121412;
  text-align: left;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.mode-button:hover { border-color: #4c5247; }
.mode-icon { grid-row: 1 / span 2; width: 26px; height: 26px; align-self: center; color: var(--dim); }
.mode-button strong { font-size: 13px; color: #dcded6; }
.mode-button small { color: #83867e; font-size: 11px; line-height: 1.5; }
.mode-button.active { border-color: rgba(201, 243, 91, .6); color: var(--lime); background: rgba(201, 243, 91, .06); }
.mode-button.active strong { color: var(--lime); }
.mode-button.active small { color: #a8ab9f; }
.mode-button.active .mode-icon { color: var(--lime); }

.video-source-group { margin-bottom: 20px; }
.video-source-group label { display: block; margin-bottom: 9px; }
.video-source-group input { width: 100%; font: 12px Consolas, monospace; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.setting-block label { display: block; margin-bottom: 9px; }
.viewer-limit-row { display: flex; align-items: center; gap: 11px; }
.viewer-limit-row input { width: 78px; }
.viewer-limit-row span { color: var(--dim); font-size: 10px; line-height: 1.35; }
.duration-row { display: grid; grid-template-columns: 78px 1fr; gap: 8px; }
.lobby-create-button { width: 100%; margin-top: 22px; min-height: 52px; font-size: 13px; }

/* ---------- Estúdio: painel e sala ---------- */

.studio {
  width: var(--shell);
  flex: 1;
  margin: 0 auto;
  padding: 24px 0 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 384px;
  align-items: start;
  gap: 24px;
}

.stage { --stage-reserve: 330px; min-width: 0; }
.viewer-studio .stage { --stage-reserve: 250px; }
.stage-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 10px; }
.stage-head h1 { margin: 0; font-size: 17px; }
.stage-head p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.studio-side { display: grid; align-content: start; gap: 14px; min-width: 0; }

.side-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(29, 32, 30, .96), rgba(19, 21, 20, .96));
}

.side-head { display: flex; align-items: flex-start; gap: 13px; }
.side-head h2 { margin: 0 0 4px; font-size: 15px; }
.side-head p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.side-step {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border: 1px solid rgba(201, 243, 91, .4);
  border-radius: 9px;
  color: var(--lime);
  background: rgba(201, 243, 91, .08);
  font: 600 12px Consolas, monospace;
}

.side-step svg { width: 16px; height: 16px; }
.side-hint { margin: 12px 0 0; color: var(--dim); font-size: 10px; line-height: 1.5; }

.advanced { padding: 0; }
.advanced summary { padding: 15px 20px; color: #c2c4bd; font-size: 12px; font-weight: 600; cursor: pointer; list-style: none; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::after { content: "+"; float: right; color: var(--lime); font-family: Consolas, monospace; }
.advanced[open] summary { border-bottom: 1px solid var(--line); }
.advanced[open] summary::after { content: "\2013"; }
.advanced-body { display: grid; gap: 14px; padding: 16px 20px 20px; }

.advanced-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
.advanced-row > span { display: grid; gap: 3px; }
.advanced-row strong { color: #d4d6ce; font-size: 11px; }
.advanced-row small { color: var(--dim); font-size: 10px; line-height: 1.45; font-weight: 400; }
.advanced-row select { flex: none; height: 34px; min-width: 108px; font-size: 10px; }
.advanced-row input[type="checkbox"] { width: 17px; height: 17px; min-width: 17px; flex: none; padding: 0; accent-color: var(--lime); }
.advanced-row .mini-action { flex: none; }

.link-section { margin-top: 16px; }
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.copy-row input { color: #b6b7b1; font: 11px Consolas, monospace; }
.copy-row .button { min-width: 92px; }

.host-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 4px; }

/* ---------- Palco do vídeo ---------- */

.screen-shell {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: min(100%, max(560px, calc((100vh - var(--stage-reserve)) * 16 / 9)));
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  border: 1px solid #292c29;
  border-radius: var(--radius);
  background: #020302;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
}

.screen-shell video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }

.screen-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: radial-gradient(circle at center, #171b17 0%, #080a08 56%, #030403 100%);
}

.screen-placeholder h1, .screen-placeholder h2 { margin: 24px 0 8px; font-size: clamp(20px, 2.6vw, 32px); letter-spacing: -.04em; }
.screen-placeholder p { margin: 0; max-width: 420px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.screen-placeholder b { color: #c8cbc2; }

.waiting-orbit { position: relative; width: 52px; height: 52px; border: 1px solid #3b4136; border-radius: 50%; animation: orbit 3s linear infinite; }
.waiting-orbit::before { content: ""; position: absolute; inset: 8px; border: 1px solid #242a21; border-radius: 50%; }
.waiting-orbit span { position: absolute; width: 8px; height: 8px; top: -4px; left: 21px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 14px rgba(201, 243, 91, .75); }
@keyframes orbit { to { transform: rotate(360deg); } }

.play-overlay { position: absolute; left: 50%; bottom: 78px; transform: translateX(-50%); z-index: 4; min-height: 50px; padding: 0 26px; font-size: 13px; }
.play-overlay:hover { transform: translateX(-50%) translateY(-1px) !important; }

.stage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.stage-status { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; color: var(--muted); font: 10px Consolas, monospace; }
.stage-status > span { display: inline-flex; align-items: center; gap: 7px; }
.stage-status i { width: 6px; height: 6px; border-radius: 50%; background: #575a56; }
.stage-status i.live { background: var(--danger); box-shadow: 0 0 8px rgba(255, 109, 103, .65); }
.stage-status i.connected { background: var(--lime); }
.stage-tip { font-family: "Segoe UI", Arial, sans-serif; font-size: 11px; }
.stage-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.stage-actions .button { min-height: 38px; font-size: 11px; }
.host-film-controls { display: flex; align-items: center; gap: 9px; }
.volume-control { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; font-weight: 400; }
.volume-control input { width: 104px; height: 4px; padding: 0; border: 0; background: transparent; accent-color: var(--lime); }

/* ---------- Controles sobre o player ---------- */

.player-hud {
  position: absolute;
  z-index: 6;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  background: rgba(9, 11, 10, .84);
  backdrop-filter: blur(9px);
  max-height: calc(100% - 24px);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  pointer-events: none;
}

.player-hud-top { top: 12px; bottom: auto; transform: translateY(-6px); }
.host-screen-shell.hud-shifted .player-hud-top { top: 94px; }
/* O painel so aparece por clique no botao redondo. Antes ele surgia no hover e
   cobria um pedaco grande da imagem sem ninguem pedir. */
.screen-shell.hud-open .player-hud {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

.hud-toggle {
  position: absolute;
  z-index: 8;
  left: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  background: rgba(9, 11, 10, .84);
  backdrop-filter: blur(9px);
  opacity: .55;
  transition: opacity .18s ease, border-color .18s ease, background .18s ease;
}

.hud-toggle-topo { top: 12px; bottom: auto; }
.host-screen-shell.hud-shifted .hud-toggle-topo { top: 94px; }
.screen-shell:hover .hud-toggle,
.hud-toggle:focus-visible,
.screen-shell.hud-open .hud-toggle { opacity: 1; }
.hud-toggle:hover { border-color: rgba(201, 243, 91, .55); }
.screen-shell.hud-open .hud-toggle { border-color: var(--lime); background: rgba(201, 243, 91, .16); }

/* O "+" e feito de duas barras; ao abrir, gira e vira um "x". */
.hud-toggle-icone,
.hud-toggle-icone::before {
  content: "";
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--lime);
  transition: transform .22s ease;
}

.hud-toggle-icone::before { transform: rotate(90deg); }
.screen-shell.hud-open .hud-toggle-icone { transform: rotate(135deg); }

/* A faixa comeca depois do botao para nao passar por cima dele. */
.player-hud { left: 68px; }
.player-hud-top { left: 68px; }
.hud-cluster { display: flex; align-items: center; gap: 8px; }
.hud-end { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }

.hud-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 7px;
  color: #d3d5cf;
  background: rgba(255, 255, 255, .06);
  font-size: 10px;
  white-space: nowrap;
}

.hud-button:hover:not(:disabled) { color: var(--lime); border-color: rgba(201, 243, 91, .5); }
.hud-button:disabled { cursor: not-allowed; opacity: .45; }
.hud-button.active { color: #151713; border-color: var(--lime); background: var(--lime); }
.hud-button.ducking { color: #151713; border-color: var(--warn); background: var(--warn); }
.hud-button.requested { color: var(--lime); border-color: rgba(201, 243, 91, .5); }
/* Segundo nivel do menu: fica dobrado ate alguem pedir, para o menu continuar
   pequeno e as acoes de sala nao exigirem sair da tela cheia. */
.hud-people {
  display: none;
  flex: 1 1 100%;
  max-height: 168px;
  overflow-y: auto;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}

.player-hud.pessoas-abertas .hud-people { display: grid; gap: 7px; }
.hud-person { display: flex; align-items: center; gap: 9px; }
.hud-person-sinal { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #4a4f47; }
.hud-person.falando .hud-person-sinal { background: var(--lime); box-shadow: 0 0 8px rgba(201, 243, 91, .6); }
.hud-person-nome { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #d3d5cf; font-size: 10px; }
.hud-person input[type="range"] { width: 84px; height: 4px; min-width: 0; padding: 0; border: 0; background: transparent; accent-color: var(--lime); }
.hud-person .hud-button { min-height: 26px; padding: 0 8px; font-size: 9px; }
.hud-people-vazio { color: var(--muted); font-size: 10px; }
.hud-range { width: 92px; height: 4px; min-width: 0; padding: 0; border: 0; background: transparent; accent-color: var(--lime); }

.speaking-overlay {
  position: absolute;
  z-index: 7;
  left: 12px;
  top: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(340px, calc(100% - 24px));
  padding: 7px 12px 7px 10px;
  border: 1px solid rgba(201, 243, 91, .5);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(9, 11, 10, .82);
  backdrop-filter: blur(9px);
  font-size: 11px;
  pointer-events: none;
}

.speaking-overlay span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.host-screen-shell .speaking-overlay { top: auto; bottom: 56px; }
.speaking-wave { display: inline-flex; align-items: center; gap: 2px; height: 13px; flex: none; }
.speaking-wave i { width: 3px; height: 4px; border-radius: 2px; background: var(--lime); animation: speaking-bounce .62s ease-in-out infinite alternate; }
.speaking-wave i:nth-child(2) { animation-delay: .15s; }
.speaking-wave i:nth-child(3) { animation-delay: .31s; }
@keyframes speaking-bounce { to { height: 13px; } }

.fullscreen-pause-alert {
  position: absolute;
  z-index: 9;
  top: 18px;
  left: 50%;
  width: min(580px, calc(100% - 32px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(201, 243, 91, .7);
  border-radius: 10px;
  background: rgba(13, 15, 14, .96);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 0 30px rgba(201, 243, 91, .12);
  animation: pause-alert-pulse 1.25s ease-in-out infinite alternate;
}

.fullscreen-pause-alert strong, .fullscreen-pause-alert span { display: block; }
.fullscreen-pause-alert strong { color: var(--lime); font-size: 12px; }
.fullscreen-pause-alert span { margin-top: 3px; color: #bec0b9; font-size: 10px; }
.fullscreen-pause-alert .button { min-height: 34px; padding: 0 11px; font-size: 9px; }
@keyframes pause-alert-pulse { to { border-color: var(--lime); box-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 0 38px rgba(201, 243, 91, .24); } }

/* ---------- Avisos do palco ---------- */

.screen-share-guide { display: grid; gap: 5px; margin-top: 14px; padding: 13px; border: 1px solid #343833; border-radius: 8px; background: rgba(201, 243, 91, .035); }
.screen-share-guide strong { color: var(--lime); font-size: 11px; }
.screen-share-guide span { color: #c4c7bf; font-size: 11px; line-height: 1.55; }
.screen-share-guide b { color: var(--ink); }
.screen-share-guide small { color: var(--dim); font-size: 10px; line-height: 1.45; }

.buffer-panel { margin-top: 14px; padding: 14px; border: 1px solid rgba(201, 243, 91, .18); border-radius: 9px; background: rgba(201, 243, 91, .035); }
.toggle-row { display: flex; align-items: flex-start; gap: 10px; color: #c8cac3; font-size: 11px; font-weight: 400; cursor: pointer; }
.toggle-row input { width: 16px; height: 16px; min-width: 16px; padding: 0; accent-color: var(--lime); }
.toggle-row span, .toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { font-size: 12px; }
.toggle-row small { margin-top: 3px; color: var(--dim); line-height: 1.45; }
.buffer-status { color: var(--lime); font: 10px Consolas, monospace; }
.buffer-status.buffering { color: var(--warn); }

.pause-request {
  margin-top: 14px;
  padding: 15px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(201, 243, 91, .35);
  border-radius: 9px;
  background: rgba(201, 243, 91, .065);
}

.pause-request strong, .pause-request span { display: block; }
.pause-request strong { margin-bottom: 3px; color: var(--lime); font-size: 11px; }
.pause-request span { color: #afb1aa; font-size: 11px; }
.pause-request-actions { display: flex; gap: 7px; flex: none; }
.pause-request-actions .button { min-height: 36px; padding: 0 12px; font-size: 10px; }

/* ---------- Chamada de voz ---------- */

.voice-status {
  display: block;
  margin-top: 14px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(0, 0, 0, .18);
  font: 10px/1.5 Consolas, monospace;
}

.voice-status.online { color: var(--lime); border-color: rgba(201, 243, 91, .3); }
.voice-status.error { color: var(--danger); border-color: rgba(255, 109, 103, .35); }

.voice-name-field { display: grid; gap: 6px; margin-top: 14px; color: #c7cac2; font-size: 11px; }
.voice-name-field input { width: 100%; min-height: 42px; border-color: #3d423b; background: #101210; font-weight: 400; }
.voice-name-field small { color: var(--dim); font-size: 10px; line-height: 1.45; font-weight: 400; }

.voice-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.voice-controls #voiceJoinButton { grid-column: 1 / -1; min-height: 46px; color: #151713; background: var(--lime); border-color: transparent; }
.voice-controls #voiceJoinButton:hover:not(:disabled) { background: #d7ff6d; }
.voice-controls .control-button { min-height: 38px; }

.voice-volume {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid #343833;
  border-radius: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.voice-volume input, .participant-volume input { height: 4px; min-width: 60px; padding: 0; border: 0; background: transparent; accent-color: var(--lime); }
.voice-volume input { flex: 1; }

.ptt-settings { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ptt-settings label { display: inline-flex; align-items: center; gap: 8px; color: #b6b8b1; font-size: 11px; font-weight: 400; cursor: pointer; }
.ptt-settings input { width: 17px; height: 17px; min-width: 17px; padding: 0; accent-color: var(--lime); }

.voice-participants { display: grid; gap: 7px; margin-top: 14px; }
.voice-empty { margin: 0; padding: 14px; color: var(--dim); border: 1px dashed #343733; border-radius: 8px; font-size: 10px; text-align: center; }

.voice-participant {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px;
  border: 1px solid #30332f;
  border-radius: 8px;
  background: rgba(0, 0, 0, .14);
  transition: border-color .18s ease, background .18s ease;
}

.voice-participant.talking { border-color: rgba(201, 243, 91, .45); background: rgba(201, 243, 91, .05); }
.voice-participant-identity { min-width: 0; }
.voice-participant-identity strong { display: block; color: #d6d8d1; font-size: 11px; }
.voice-participant-identity span { display: block; margin-top: 3px; color: var(--dim); font: 9px Consolas, monospace; }
.voice-participant-identity span.mic-open { color: var(--lime); }
.voice-participant-identity span.mic-talking { color: var(--lime); }
.voice-participant-identity span.mic-link { color: var(--warn); }

.voice-meter { display: block; overflow: hidden; width: 74px; height: 3px; margin-top: 5px; border-radius: 2px; background: #2b2f2a; }
.voice-meter i { display: block; width: 100%; height: 100%; border-radius: 2px; background: var(--lime); transform: scaleX(0); transform-origin: left center; transition: transform .1s linear; }

.voice-participant-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.participant-volume { display: flex; align-items: center; justify-content: flex-end; gap: 7px; width: 100%; color: var(--dim); font-size: 9px; font-weight: 400; }
.participant-volume input { flex: 1; max-width: 120px; }
.voice-audio-bin, .voice-remote-audio { display: none; }

/* ---------- Rodapé, páginas legais e consentimento ---------- */

footer {
  width: var(--shell);
  margin: 0 auto;
  padding: 18px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line-soft);
  color: #656763;
  font: 9px Consolas, monospace;
  letter-spacing: .035em;
}

.legal-links { display: flex; flex-wrap: wrap; gap: 16px; }
.legal-links a, .consent-links a, .legal-document a { color: #8fb8ff; text-decoration: underline; text-underline-offset: 3px; }
.legal-links a:hover, .consent-links a:hover, .legal-document a:hover { color: #b9d2ff; }

.server-announcement {
  position: fixed;
  z-index: 40;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 208, 122, .6);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(21, 19, 14, .97);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
  font-size: 12px;
  line-height: 1.5;
}

.announcement-badge {
  flex: none;
  padding: 4px 9px;
  border-radius: 999px;
  color: #151713;
  background: var(--warn);
  font: 700 9px Consolas, monospace;
  letter-spacing: .08em;
}

#serverAnnouncementText { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.server-announcement .mini-action { flex: none; }

.consent-gate {
  position: fixed;
  z-index: 30;
  right: 22px;
  bottom: 22px;
  width: min(620px, calc(100% - 44px));
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 24px;
  padding: 22px;
  border: 1px solid rgba(143, 184, 255, .6);
  border-radius: 13px;
  background: rgba(16, 19, 18, .98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .65);
}

.consent-gate h2 { margin: 3px 0 8px; font-size: 21px; }
.consent-gate p { margin: 0; color: #a9aca5; font-size: 11px; line-height: 1.55; }
.consent-links { display: flex; gap: 14px; margin-top: 11px; font-size: 10px; }
.consent-actions { display: grid; gap: 7px; min-width: 205px; }
.consent-actions .button { min-height: 40px; padding: 0 13px; font-size: 9px; }

.legal-page { background: #0c0f0d; }
.legal-document { width: min(860px, calc(100% - 44px)); flex: 1; margin: 0 auto; padding: 60px 0 76px; }
.legal-document > h1 { margin: 0; font-size: clamp(40px, 7vw, 68px); letter-spacing: -.06em; }
.legal-intro { max-width: 740px; margin: 22px 0 44px; color: #b8bbb4; font-size: 16px; line-height: 1.7; }
.legal-document section { padding: 26px 0; border-top: 1px solid var(--line); }
.legal-document section h2 { margin: 0 0 10px; color: var(--lime); font-size: 17px; }
.legal-document section p { margin: 0; color: #a8aaa4; font-size: 13px; line-height: 1.8; }
.legal-table { display: grid; gap: 9px; }
.legal-table > div { display: grid; grid-template-columns: minmax(150px, .35fr) 1fr; gap: 20px; padding: 13px; border: 1px solid #2e332e; border-radius: 8px; }
.legal-table strong { color: #d6d9d1; font-size: 11px; }
.legal-table span { color: #969a92; font-size: 11px; line-height: 1.55; }
.legal-revoke { margin-top: 18px; min-height: 40px; }

.closed-page { flex: 1; display: grid; place-content: center; padding: 32px; text-align: center; }
.closed-page h1 { margin: 0 0 10px; font-size: clamp(34px, 6vw, 60px); letter-spacing: -.055em; }
.closed-page p { margin: 0; color: var(--muted); }
.closed-action { margin-top: 24px; text-decoration: none; }

/* ---------- Responsivo ---------- */

@media (max-width: 1180px) {
  .studio { grid-template-columns: minmax(0, 1fr) 340px; }
}

@media (max-width: 1024px) {
  :root { --shell: calc(100% - 32px); }
  .studio { grid-template-columns: 1fr; gap: 20px; }
  .stage { --stage-reserve: 210px; }
  .viewer-studio .stage { --stage-reserve: 200px; }
  .lobby-main { grid-template-columns: 1fr; gap: 40px; padding: 40px 0; }
  .lobby-intro { max-width: 620px; }
  .stage-head p { max-width: none; text-align: left; }
}

@media (max-width: 720px) {
  :root { --shell: calc(100% - 24px); }
  .topbar { flex-wrap: wrap; min-height: 0; gap: 12px; }
  .topbar-meta { justify-content: flex-start; width: 100%; }
  .secure-label { display: none; }
  .control-card, .side-card { padding: 18px; border-radius: 12px; }
  .advanced summary { padding: 14px 18px; }
  .advanced-body { padding: 14px 18px 18px; }
  .settings-grid { grid-template-columns: 1fr; }
  .stage { --stage-reserve: 0px; }
  .screen-shell { max-width: 100%; border-radius: 10px; }
  .stage-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .stage-head h1 { font-size: 21px; }
  .stage-bar { flex-direction: column; align-items: stretch; }
  .stage-actions { flex-direction: column; align-items: stretch; }
  .stage-actions .control-button, .stage-actions .button { width: 100%; }
  .host-film-controls { flex-direction: column; align-items: stretch; gap: 8px; }
  .volume-control { justify-content: space-between; }
  .volume-control input { flex: 1; width: auto; }
  /* Com o painel fechado por padrao, ele nao atrapalha mais no celular: quem
     quiser abre pelo botao, e ele mesmo se fecha depois. */
  .player-hud { left: 8px; right: 8px; bottom: 62px; gap: 6px 10px; padding: 8px; }
  .player-hud-top { top: 62px; bottom: auto; }
  .player-hud { max-height: calc(100% - 70px); }
  .hud-people { max-height: none; }
  .hud-toggle { left: 8px; bottom: 8px; }
  .hud-toggle-topo { top: 8px; bottom: auto; }
  .hud-cluster { flex: 1 1 150px; }
  .hud-end { flex: 1 1 100%; margin-left: 0; justify-content: flex-start; }
  .hud-range { flex: 1; width: auto; min-width: 54px; }
  .play-overlay { bottom: auto; top: 44%; }
  .speaking-overlay { left: 8px; top: 8px; max-width: calc(100% - 16px); }
  .host-screen-shell .speaking-overlay { bottom: 48px; }
  .advanced-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .advanced-row select, .advanced-row .mini-action { width: 100%; }
  .advanced-row input[type="checkbox"] { align-self: flex-start; }
  .voice-controls { grid-template-columns: 1fr; }
  .voice-participant, .pause-request, .fullscreen-pause-alert { flex-direction: column; align-items: stretch; }
  .voice-participant-actions { justify-content: flex-start; }
  .pause-request-actions { width: 100%; }
  .pause-request-actions .button { flex: 1; }
  .fullscreen-pause-alert { top: 10px; }
  .host-actions { flex-direction: column; align-items: stretch; gap: 10px; text-align: center; }
  .server-announcement { flex-wrap: wrap; top: 8px; width: calc(100% - 16px); }
  .consent-gate { right: 12px; bottom: 12px; width: calc(100% - 24px); grid-template-columns: 1fr; gap: 16px; }
  .consent-actions { min-width: 0; }
  .legal-table > div { grid-template-columns: 1fr; gap: 7px; }
  footer { flex-direction: column; align-items: flex-start; }
}

@media (min-width: 1025px) {
  .studio-side { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; padding-right: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
