:root {
  --bg: #0e1013;
  --panel: #171a1f;
  --panel2: #1e2228;
  --line: #2a2f37;
  --txt: #e7e9ee;
  --muted: #9aa3b2;
  --red: #e11d1d;
  --green: #1f9d55;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font:
    15px/1.45 system-ui,
    Segoe UI,
    Roboto,
    sans-serif;
  background: var(--bg);
  color: var(--txt);
}
/* Tema Locknix — céu estrelado noturno: nebulosa fixa (body) + 2 camadas de estrelas com brilho suave */
:root.theme-locknix body {
  background-image:
    radial-gradient(1200px 720px at 80% -15%, rgba(109, 40, 217, 0.16), transparent 60%),
    radial-gradient(1000px 640px at 5% 112%, rgba(76, 29, 149, 0.13), transparent 60%);
  background-repeat: no-repeat, no-repeat;
  background-size:
    100% 100%,
    100% 100%;
  background-attachment: fixed;
}
/* As partículas (estrelas, etc.) agora são desenhadas pela tsParticles em #bgfx */
/* ===== Atmosferas dos outros temas ===== */
@keyframes ncDrift {
  0% {
    transform: translate3d(-3%, -2%, 0) scale(1.08);
  }
  100% {
    transform: translate3d(4%, 3%, 0) scale(1.16);
  }
}
@keyframes ncGlow {
  0%,
  100% {
    opacity: 0.68;
  }
  50% {
    opacity: 1;
  }
}
@keyframes ncRays {
  to {
    transform: translateX(140px);
  }
}
@keyframes ncGrid {
  to {
    background-position:
      0 46px,
      46px 0;
  }
}
/* Aurora — véus verdes que flutuam */
:root.theme-aurora body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  filter: blur(24px);
  background:
    radial-gradient(38% 30% at 28% 22%, rgba(16, 185, 129, 0.22), transparent 70%),
    radial-gradient(44% 34% at 72% 32%, rgba(45, 212, 191, 0.17), transparent 70%),
    radial-gradient(48% 38% at 52% 82%, rgba(52, 211, 153, 0.15), transparent 70%);
  animation: ncDrift 20s ease-in-out infinite alternate;
}
/* Abismo — oceano profundo + raios de luz */
:root.theme-abismo body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 45% at 50% -12%, rgba(56, 189, 248, 0.16), transparent 70%),
    linear-gradient(180deg, rgba(59, 130, 246, 0.08), transparent 45%);
}
:root.theme-abismo body::after {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(102deg, transparent 0 70px, rgba(125, 185, 255, 0.05) 70px 73px);
  animation: ncRays 24s linear infinite;
}
/* Neon — grade cyber que rola */
:root.theme-neon body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(34, 211, 238, 0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(34, 211, 238, 0.07) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(115% 85% at 50% 0%, #000 42%, transparent 85%);
  mask-image: radial-gradient(115% 85% at 50% 0%, #000 42%, transparent 85%);
  animation: ncGrid 7s linear infinite;
}
:root.theme-neon body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(60% 40% at 50% -8%, rgba(34, 211, 238, 0.14), transparent 70%);
}
/* Brasa — calor que sobe do rodapé */
:root.theme-brasa body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(80% 50% at 50% 122%, rgba(249, 115, 22, 0.22), transparent 70%),
    radial-gradient(50% 42% at 18% 112%, rgba(239, 68, 68, 0.16), transparent 70%),
    radial-gradient(50% 42% at 82% 116%, rgba(234, 88, 12, 0.15), transparent 70%);
  animation: ncGlow 7s ease-in-out infinite;
}
/* Sakura — floração rosa suave */
:root.theme-sakura body::before {
  content: "";
  position: fixed;
  inset: -16%;
  z-index: -1;
  pointer-events: none;
  filter: blur(16px);
  background:
    radial-gradient(38% 30% at 24% 20%, rgba(236, 72, 153, 0.18), transparent 70%),
    radial-gradient(42% 34% at 76% 30%, rgba(244, 114, 182, 0.15), transparent 70%),
    radial-gradient(40% 32% at 55% 86%, rgba(251, 113, 133, 0.13), transparent 70%);
  animation: ncDrift 22s ease-in-out infinite alternate;
}
/* Crepúsculo — pôr do sol dourado no horizonte */
:root.theme-dourado body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(72% 46% at 50% 118%, rgba(245, 158, 11, 0.24), transparent 70%),
    linear-gradient(180deg, rgba(180, 83, 9, 0.06), transparent 32%);
  animation: ncGlow 12s ease-in-out infinite;
}
/* Névoa — bruma cinzenta que desliza */
:root.theme-nevoa body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  filter: blur(34px);
  background:
    radial-gradient(48% 40% at 30% 40%, rgba(148, 163, 184, 0.09), transparent 70%),
    radial-gradient(54% 44% at 72% 62%, rgba(100, 116, 139, 0.08), transparent 70%);
  animation: ncDrift 28s ease-in-out infinite alternate;
}
@media (prefers-reduced-motion: reduce) {
  :root.theme-aurora body::before,
  :root.theme-abismo body::after,
  :root.theme-neon body::before,
  :root.theme-brasa body::before,
  :root.theme-sakura body::before,
  :root.theme-dourado body::before,
  :root.theme-nevoa body::before {
    animation: none;
  }
}
.hidden {
  display: none !important;
}
a {
  color: #8ab4ff;
  cursor: pointer;
}
input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--txt);
  font: inherit;
  outline: none;
  transition:
    border-color 0.14s ease,
    box-shadow 0.14s ease,
    background 0.14s ease;
}
input:not([type="range"]):not([type="checkbox"]):hover,
select:hover,
textarea:hover,
.cs-trigger:hover {
  border-color: #3a414c;
}
input:not([type="range"]):not([type="checkbox"]):focus,
select:focus,
textarea:focus,
.cs-trigger:focus-visible {
  border-color: var(--red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 22%, transparent);
  background: var(--panel);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.65;
}
select {
  cursor: pointer;
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  padding: 0;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 0;
}
label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0 4px;
}
button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 9px;
  padding: 10px 15px;
  color: #fff;
  background: var(--red);
}
button:hover {
  filter: brightness(1.08);
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
/* ===== Pacote de animações / transições ===== */
@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes viewFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes backdropIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 16px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
/* entradas de tela */
#login,
#register,
#forgot,
#reset,
#hub {
  animation: viewIn 0.34s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
#room {
  animation: viewFade 0.3s ease both;
}
/* modais e popovers */
.modal:not(.hidden) {
  animation: backdropIn 0.18s ease;
}
.modalcard {
  animation: modalIn 0.24s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.popover:not(.hidden) {
  animation: popIn 0.16s ease;
}
.toast {
  animation: toastIn 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.msg {
  animation: msgIn 0.22s ease both;
}
/* micro-interações de botões */
button {
  transition:
    transform 0.12s ease,
    filter 0.12s ease,
    background 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}
button:active {
  transform: translateY(1px) scale(0.985);
}
.dock button:hover,
.viewctrls button:hover,
.ghost.icon:hover,
#hubLogout:hover,
.gbtn:hover {
  transform: translateY(-1px);
}
/* cards de sala e painéis */
.roomcard {
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}
.roomcard:hover {
  border-color: var(--red);
  background: color-mix(in srgb, var(--panel2) 90%, var(--red));
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}
.swatch {
  transition:
    transform 0.12s ease,
    border-color 0.14s ease;
}
.swatch:hover {
  transform: translateY(-2px);
}
.pfbtn,
.updbtn,
#settingsBtn,
#hubSettingsBtn,
#peopleBtn {
  transition:
    transform 0.12s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}
@media (prefers-reduced-motion: reduce) {
  #login,
  #register,
  #forgot,
  #reset,
  #hub,
  #room,
  .modal:not(.hidden),
  .modalcard,
  .popover:not(.hidden),
  .toast,
  .msg {
    animation: none !important;
  }
  button:active,
  .roomcard:hover,
  .swatch:hover,
  .dock button:hover,
  .viewctrls button:hover {
    transform: none !important;
  }
}
button.gray {
  background: #333a45;
}
button.green {
  background: var(--green);
}
button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--txt);
}
.svgic {
  width: 1.15em;
  height: 1.15em;
  display: inline-block;
  vertical-align: -0.16em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ich {
  display: inline-flex;
  align-items: center;
}
.dock button,
.viewctrls button,
#leaveBtn,
#copyIdBtn,
#endBtn,
#unmuteBtn,
#settingsBtn,
#joinBtn,
.chathead > span,
.sendbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.sendbtn {
  align-self: stretch;
  padding: 0 16px;
}
.thumblbl .svgic,
.speaking .svgic,
.thumbmute .svgic {
  width: 13px;
  height: 13px;
}
.logo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #e11d1d, #6b0000);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 27px;
}
.center {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 20px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  width: 100%;
  max-width: 400px;
}
.card .logo {
  margin: 0 auto 12px;
}
h1 {
  font-size: 20px;
  margin: 0 0 4px;
  text-align: center;
}
.sub {
  color: var(--muted);
  text-align: center;
  margin: 0 0 14px;
  font-size: 13px;
}
.err {
  color: #ff9a9a;
  font-size: 13px;
  min-height: 18px;
  margin-top: 8px;
}
.ok {
  color: #7ee0a0;
  font-size: 13px;
  margin-top: 8px;
  background: rgba(31, 157, 85, 0.12);
  border: 1px solid rgba(31, 157, 85, 0.35);
  border-radius: 8px;
  padding: 8px 10px;
}
.ordiv {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  margin: 14px 0;
}
.ordiv::before,
.ordiv::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.gbtn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  color: #1f2328;
  border: 1px solid var(--line);
  font-weight: 600;
}
.gbtn:hover {
  filter: brightness(0.96);
}
.glogo {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.rowbtn {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.rowbtn button {
  flex: 1;
}
header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.updbtn {
  position: relative;
}
.updbtn.busy .svgic {
  animation: ncspin 1s linear infinite;
}
@keyframes ncspin {
  to {
    transform: rotate(-360deg);
  }
}
.upddot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--panel);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}
#updMenu {
  width: 300px;
}
#updMenu .updline {
  font-size: 13px;
  color: var(--txt);
  font-weight: 600;
}
#updMenu .updver {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 8px;
}
#updMenu .updact {
  width: 100%;
  justify-content: flex-start;
  gap: 9px;
  margin-top: 7px;
}
header .logo {
  width: 30px;
  height: 30px;
  font-size: 16px;
}
header h2 {
  font-size: 15px;
  margin: 0;
  flex: 1;
}
header .who {
  color: var(--muted);
  font-size: 13px;
}
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px;
}
.hero {
  margin-bottom: 22px;
}
.hero-hi {
  font-size: 24px;
  font-weight: 700;
}
.hero-sub {
  color: var(--muted);
  font-size: 14.5px;
  margin-top: 5px;
}
.dash {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}
.dash-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.dash-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.sec-title {
  font-size: 15px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.count {
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
}
.roomfilter {
  margin-left: auto;
  flex: 0 1 220px;
  min-width: 110px;
  padding: 8px 12px;
  font-size: 13px;
}
#refreshRooms {
  flex-shrink: 0;
  min-width: 38px;
}
.roomgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 3px 6px 8px 3px;
  align-content: start;
}
.roomgrid > p {
  grid-column: 1 / -1;
  margin: 0;
  text-align: center;
  padding: 34px 12px;
  color: var(--muted);
}
#tipsModal .modalcard {
  max-width: 780px;
}
#mainVideo {
  will-change: transform;
  backface-visibility: hidden;
}
.roomcard {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.12s;
}
.roomcard:hover {
  border-color: #465063;
}
.roomcard .rc-top {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ff6b6b;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}
.roomcard .rc-top .grow {
  flex: 1;
}
.roomcard .rc-name {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.roomcard .rc-host {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.roomcard button {
  margin-top: 12px;
}
.notesbox .pn-v {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 14px;
}
.pn-h {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 2px;
}
.pnotes ul,
.notesbox ul,
#updateNotes ul {
  margin: 0;
  padding-left: 18px;
}
.pnotes li,
.notesbox li,
#updateNotes li {
  font-size: 13px;
  margin: 3px 0;
}
#updateNotes .pn-v {
  display: none;
}
@media (max-width: 860px) {
  .dash {
    grid-template-columns: 1fr;
  }
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
.box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.box h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.roomitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
}
.roomitem .grow {
  flex: 1;
  min-width: 0;
}
.roomitem .nm {
  font-weight: 600;
}
.roomitem .mt {
  color: var(--muted);
  font-size: 12px;
}
.muted {
  color: var(--muted);
}
.mono {
  font-family: ui-monospace, Consolas, monospace;
}
.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
  cursor: pointer;
}
.switch > span {
  order: 0;
}
.switch input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  order: 2;
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  margin: 0;
  padding: 0;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.switch input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  transition:
    left 0.16s cubic-bezier(0.34, 0.1, 0.2, 1.5),
    background 0.15s;
}
.switch input[type="checkbox"]:checked {
  background: var(--red);
  border-color: var(--red);
}
.switch input[type="checkbox"]:checked::after {
  left: 21px;
  background: #fff;
}
.switch input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* ---- ROOM ---- */
#room {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}
.roombar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.roombar .rinfo {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.roombar b {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}
.roombar .grow {
  flex: 1;
  min-width: 0;
}
.live {
  color: #ff6b6b;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3b3b;
  margin-right: 4px;
}
button.icon {
  padding: 8px 11px;
  min-width: 42px;
}
button.sm {
  padding: 6px 11px;
  font-size: 13px;
}
.popover {
  position: absolute;
  top: 52px;
  right: 12px;
  z-index: 40;
  width: 290px;
  max-width: calc(100vw - 24px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55);
}
.popover .prow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}
.popover .prow .mono {
  color: var(--txt);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.popover label {
  margin-top: 12px;
}
.popover select {
  margin-top: 2px;
}
.voxhead {
  font-weight: 600;
  font-size: 13px;
  margin: 14px 0 6px;
}
.micmeter {
  position: relative;
  height: 10px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin: 4px 0 2px;
}
.micmeter-fill {
  height: 100%;
  width: 0;
  background: #64748b;
  transition: width 0.06s linear;
}
.micmeter-fill.open {
  background: #4ade80;
}
.micmeter-thr {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--red);
}
.cselect {
  position: relative;
  margin-top: 2px;
}
.cs-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--txt);
  padding: 9px 12px;
  border-radius: 9px;
}
.cs-trigger .caret {
  margin-left: auto;
  display: inline-flex;
  color: var(--muted);
}
.cs-name {
  font-weight: 600;
}
.cs-desc {
  color: var(--muted);
  font-size: 12px;
}
.cs-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 5px);
  z-index: 50;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}
.cs-menu.hidden {
  display: none;
}
.cs-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.cs-opt:hover {
  background: #262b33;
}
.cs-opt.sel {
  background: rgba(225, 29, 29, 0.16);
}
.cs-trigger .svgic,
.cs-opt .svgic {
  color: var(--muted);
}

.roommain {
  flex: 1;
  display: flex;
  min-height: 0;
}
.stage {
  flex: 1;
  background: #000;
  position: relative;
  min-width: 0;
}
.stage video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
  transform: none;
}
.stagemsg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 20px;
  pointer-events: none;
}

.viewctrls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  background: rgba(10, 12, 15, 0.72);
  backdrop-filter: blur(6px);
  border-radius: 11px;
  transition: opacity 0.25s;
}
.viewctrls button {
  padding: 7px 9px;
  min-width: 0;
  background: transparent;
  border: 0;
  color: #fff;
}
.viewctrls button:hover {
  background: rgba(255, 255, 255, 0.12);
}
.viewctrls .vol {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  padding: 0 4px;
}
.viewctrls input[type="range"] {
  width: 88px;
  accent-color: var(--red);
}
.stage.idle-hide .viewctrls,
.stage.idle-hide .speaking,
.stage.idle-hide .thumbs:not(.grid) {
  opacity: 0;
}
.speaking {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 7;
  font-size: 13px;
  color: #4ade80;
  background: rgba(10, 12, 15, 0.72);
  padding: 5px 11px;
  border-radius: 999px;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 0.25s;
}
.speaking:empty {
  display: none;
}
.nowplaying {
  position: absolute;
  top: 44px;
  left: 12px;
  z-index: 7;
  font-size: 12px;
  color: #cbd5e1;
  background: rgba(10, 12, 15, 0.72);
  padding: 4px 10px;
  border-radius: 999px;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 0.25s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nowplaying:empty {
  display: none;
}
.nowplaying .svgic {
  color: #1db954;
}
.stage.idle-hide .nowplaying {
  opacity: 0;
}
.stage.fill #mainVideo {
  object-fit: cover;
}
.phead {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
}
.prow2 {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 9px;
  transition: background 0.12s;
}
.prow2:hover {
  background: rgba(255, 255, 255, 0.045);
}
.prow2:hover .pnm {
  color: var(--txt);
}
.prow2 .pnm {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
}
.prow2 input[type="range"] {
  width: 76px;
  accent-color: var(--red);
}
#peopleList:empty::after {
  content: "Só você por aqui.";
  color: var(--muted);
  font-size: 13px;
}
.appinfo {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.appinfo a {
  cursor: pointer;
  color: #8ab4ff;
}
.appinfo .up {
  color: #4ade80;
}

.thumbs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  gap: 8px;
  padding: 0 10px;
  overflow-x: auto;
  z-index: 5;
  transition: opacity 0.25s;
}
.thumbs.hidden {
  display: none;
}
.thumb {
  position: relative;
  flex: 0 0 auto;
  width: 148px;
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: #000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
.thumb.active {
  border-color: var(--red);
}
.thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: none;
}
.thumblbl {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 11px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thumbmute {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  border: 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 13px;
  padding: 3px 7px;
  min-width: 0;
}
.thumbs.grid {
  top: 8px;
  bottom: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-auto-rows: minmax(150px, 1fr);
  align-content: start;
  overflow-y: auto;
}
.thumbs.grid .thumb {
  width: auto;
  aspect-ratio: auto;
}
.thumbs.grid .thumb video {
  object-fit: contain;
}
.stage:fullscreen video {
  object-fit: contain;
}

.dock {
  position: relative;
  z-index: 31;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  flex-wrap: wrap;
}
.dock button {
  padding: 10px 16px;
}
.dock button.on,
.viewctrls button.on {
  background: var(--red);
  color: #fff;
  border-color: transparent;
}

.chat {
  position: relative;
  width: 300px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: var(--panel);
}
.chatgrip {
  position: absolute;
  left: -3px;
  top: 0;
  bottom: 0;
  width: 7px;
  cursor: ew-resize;
  z-index: 25;
}
.chatgrip:hover {
  background: var(--red);
  opacity: 0.5;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal.hidden {
  display: none;
}
.modalcard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  width: 100%;
  max-width: 440px;
}
.modalhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 16px;
}
/* diálogo (alerta/confirmação) */
#dlg {
  z-index: 300;
}
.dlgcard {
  max-width: 400px;
}
.dlgmsg {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--txt);
  white-space: pre-wrap;
  word-break: break-word;
}
.dlgbtns {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.dlgbtns button {
  min-width: 92px;
}
.setcard {
  max-width: 480px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  animation: setpop 0.16s ease;
}
@keyframes setpop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.setcard .modalhead {
  padding: 16px 20px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.setbody {
  padding: 4px 20px 20px;
  max-height: min(72vh, 720px);
  overflow-y: auto;
}
.setsec {
  margin-top: 20px;
}
.setsec-t {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}
.setbody .prow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.setbody .prow .mono {
  color: var(--txt);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.setbody label {
  margin-top: 13px;
}
.setbody .switch {
  margin: 11px 0 0;
  font-size: 13px;
}
.setbtn {
  width: 100%;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--txt);
}
.setbtn:hover {
  border-color: var(--muted);
}
.setbtn.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.setrange {
  margin-top: 4px;
}
/* ---- Perfil ---- */
.pfbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid transparent;
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  color: var(--txt);
}
.pfbtn:hover {
  background: var(--panel2);
  border-color: var(--line);
}
.pfav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  flex: 0 0 auto;
  overflow: hidden;
  user-select: none;
}
.pfav-sm {
  width: 26px;
  height: 26px;
  font-size: 11px;
}
.pfav-lg {
  width: 88px;
  height: 88px;
  font-size: 30px;
  border: 4px solid var(--panel);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
}
.pfcard,
.pfview {
  max-width: 440px;
  padding: 0;
  overflow: hidden;
}
.pfcard .modalhead {
  padding: 16px 20px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.pfedit {
  padding: 0 20px 20px;
}
.pfbanner {
  position: relative;
  height: 130px;
  border-radius: 0;
  background: linear-gradient(135deg, var(--panel2), var(--line));
  background-size: cover;
  background-position: center;
  margin: 0 -20px 0;
}
.pfbannerctrls {
  position: absolute;
  top: 10px;
  right: 12px;
  display: flex;
  gap: 6px;
}
.pfmini {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.pfmini:hover {
  background: rgba(0, 0, 0, 0.7);
}
.pfavwrap {
  position: absolute;
  left: 20px;
  bottom: -34px;
}
.pfavbtn {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  border: 3px solid var(--panel);
}
.pfedit > label:first-of-type {
  margin-top: 48px;
}
.pfaccents {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.pfacc {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  padding: 0;
  border: 2px solid transparent;
  cursor: pointer;
}
.pfacc.sel {
  border-color: var(--txt);
  box-shadow:
    0 0 0 2px var(--panel),
    0 0 0 4px currentColor;
}
#pfBio {
  resize: none;
}
.pfactions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
/* card de visualização */
.pfview {
  position: relative;
}
.pcclose {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  background: rgba(0, 0, 0, 0.4);
}
.pcbanner {
  height: 120px;
  margin: 0;
}
.pcbody {
  padding: 44px 20px 22px;
}
.pcname {
  font-size: 18px;
  font-weight: 700;
}
.pcbio {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}
.pcbio:empty {
  display: none;
}
/* avatar na lista de participantes */
.prow2 .pfav-sm {
  width: 30px;
  height: 30px;
  font-size: 12px;
  cursor: pointer;
  transition:
    box-shadow 0.12s ease,
    transform 0.1s ease;
}
.prow2 .pfav-sm:hover,
.msgav:hover {
  box-shadow: 0 0 0 2px var(--red);
  cursor: pointer;
}
.prow2 .pfav-sm:active,
.msgav:active {
  transform: scale(0.88);
}
.msgav {
  transition:
    box-shadow 0.12s ease,
    transform 0.1s ease;
}
/* cropper */
.cropcard {
  max-width: 460px;
  padding: 0;
  overflow: hidden;
}
.cropcard .modalhead {
  padding: 16px 20px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.cropwrap {
  padding: 18px 20px 6px;
}
.cropframe {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  touch-action: none;
  cursor: grab;
  user-select: none;
  box-shadow: 0 0 0 1px var(--line) inset;
}
.cropframe.grabbing {
  cursor: grabbing;
}
.cropframe.circle {
  border-radius: 50%;
}
#cropImg {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  pointer-events: none;
  max-width: none;
}
.cropzoomrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.cropzoomrow .svgic {
  color: var(--muted);
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.crophint {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 10px;
}
.themes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 6px;
}
.swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  color: var(--txt);
}
.swatch.sel {
  border-color: var(--red);
}
.swatch .sw {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}
.swatch .nm {
  font-size: 11px;
  color: var(--muted);
}
.tipsgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.tip {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tip b {
  font-size: 13.5px;
}
.tip span {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}
@media (max-width: 640px) {
  .tipsgrid {
    grid-template-columns: 1fr;
  }
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 6px 6px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  font-size: 14px;
}
.toast.hidden {
  display: none;
}
.toast a {
  color: var(--red);
  font-weight: 600;
  cursor: pointer;
}
.toast button {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 6px 8px;
  display: inline-flex;
}
.bindrow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}
.bindrow .bindlbl {
  flex: 1;
  font-size: 13px;
}
.bindrow .bindkey {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  color: var(--txt);
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 8px;
  min-width: 96px;
  text-align: center;
}
.bindrow button {
  padding: 4px 9px;
  font-size: 12px;
}
@media (max-width: 720px) {
  .chatgrip {
    display: none;
  }
  .themes {
    grid-template-columns: repeat(3, 1fr);
  }
}
.chat.hidden-col {
  display: none;
}
.chathead {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 14px;
}
.chatlog {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 14px;
  word-break: break-word;
}
.msg b {
  color: #d0d5df;
}
.msg.me b {
  color: #ff8a8a;
}
.msgav {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  font-size: 12px;
}
.msgbody {
  flex: 1;
  min-width: 0;
  padding-top: 6px;
}
.msgauthor {
  margin-right: 6px;
}
.msgauthor.clk {
  cursor: pointer;
}
.msgauthor.clk:hover {
  text-decoration: underline;
}
.msg a {
  color: #8ab4ff;
}
.msg code {
  background: var(--panel2);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
}
.msg i {
  color: inherit;
}
.msg s {
  opacity: 0.8;
}
.chatin {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid var(--line);
}
.chatin input {
  flex: 1;
}
.emojibtn {
  background: transparent;
  border: 0;
  font-size: 19px;
  padding: 4px 6px;
  cursor: pointer;
  line-height: 1;
}
.emojipanel {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 8px;
  right: 8px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  z-index: 40;
  box-shadow: 0 -6px 26px rgba(0, 0, 0, 0.5);
}
.emojipanel.hidden {
  display: none;
}
.emojipanel .emo {
  background: transparent;
  border: 0;
  font-size: 20px;
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
}
.emojipanel .emo:hover {
  background: rgba(255, 255, 255, 0.12);
}
.gifbtn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 7px;
  border-radius: 6px;
  cursor: pointer;
}
.gifpanel {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 8px;
  right: 8px;
  height: min(420px, 60vh);
  display: flex;
  flex-direction: column;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  z-index: 41;
  box-shadow: 0 -6px 26px rgba(0, 0, 0, 0.5);
}
.gifpanel.hidden {
  display: none;
}
.gifpanel input {
  flex: 0 0 auto;
  margin-bottom: 6px;
  padding: 6px 10px;
  font-size: 13px;
}
.gifgrid {
  flex: 1;
  overflow-y: auto;
  column-count: 2;
  column-gap: 6px;
}
.gifgrid img {
  width: 100%;
  margin-bottom: 6px;
  border-radius: 6px;
  cursor: pointer;
  display: block;
}
.msg .chatgif {
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  margin-top: 3px;
  display: block;
}

@media (max-width: 720px) {
  .roombar b {
    max-width: 32vw;
  }
  .chat {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    max-width: 340px;
    z-index: 30;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.5);
  }
  .chathead {
    display: flex;
  }
  .dock {
    gap: 6px;
    padding: 8px;
  }
  .dock button {
    flex: 1 1 auto;
    min-width: 0;
    padding: 12px 8px;
  }
  .viewctrls input[type="range"] {
    width: 60px;
  }
  .thumb {
    width: 116px;
  }
  .speaking {
    max-width: 40%;
    font-size: 12px;
  }
}

/* Migrado de style="" inline (CSP style-src sem 'unsafe-inline') */
.btn-submit {
  width: 100%;
  margin-top: 6px;
}
#forgotWrap {
  margin-top: 10px;
  text-align: center;
}
.sub-mt {
  margin-top: 14px;
}
#pfBioCount,
#axGainVal {
  opacity: 0.6;
  font-weight: 400;
}
#cropModal .pfactions {
  padding: 0 20px 18px;
}
#bindsSection {
  margin-top: 14px;
}
#bindsSection .muted {
  font-size: 12px;
  margin-top: 6px;
}
#updateModal p.muted {
  margin: 4px 0 12px;
}
#createBtn,
#joinBtn {
  width: 100%;
  margin-top: 12px;
}
.roombar .logo {
  width: 28px;
  height: 28px;
  font-size: 15px;
}
#unmuteBtn {
  padding: 7px 11px;
}
.chat-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fx-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.gif-msg {
  color: var(--muted);
  padding: 8px;
}
.fatal-error {
  padding: 20px;
}
