:root {
  --bg: #07060b;
  --panel: #0e0c15;
  --raised: #15121f;
  --raised-2: #1c1828;
  --line: rgba(196, 181, 253, 0.1);
  --line-strong: rgba(196, 181, 253, 0.22);
  --text: #efeaf8;
  --muted: #9790ad;
  --dim: #645d79;
  --accent: #a855f7;
  --accent-deep: #7e22ce;
  --accent-soft: #e9c8ff;
  --grad: linear-gradient(135deg, #f3d4ff 0%, #c98af7 40%, #9333ea 75%, #7e22ce 100%);
  --grad-btn: linear-gradient(135deg, #b46cf8 0%, #8b2fe0 100%);
  --live: #f43f5e;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg,
video {
  display: block;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(168, 85, 247, 0.45);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 78% -8%, rgba(147, 51, 234, 0.22), transparent 60%),
    radial-gradient(700px 480px at -10% 30%, rgba(126, 34, 206, 0.12), transparent 60%),
    radial-gradient(600px 400px at 50% 120%, rgba(168, 85, 247, 0.1), transparent 60%);
}

.glow::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(196, 181, 253, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196, 181, 253, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}

/* ------------------------------------------------------------ marca e barra */

.bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 26px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand img {
  height: 34px;
  width: auto;
}

.brand.mini img {
  height: 22px;
}

.tag {
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--accent-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  background: rgba(168, 85, 247, 0.08);
}

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

.primary,
.secondary,
.ghost,
.danger,
.danger-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease, opacity 0.15s;
}

.primary svg,
.secondary svg,
.danger svg {
  width: 19px;
  height: 19px;
  flex: none;
}

.primary {
  background: var(--grad-btn);
  color: #fff;
  box-shadow: 0 10px 30px -10px rgba(147, 51, 234, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 36px -10px rgba(168, 85, 247, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.primary:active {
  transform: translateY(0);
}

.primary.done {
  background: linear-gradient(135deg, #34d399, #059669);
  box-shadow: none;
}

.secondary {
  background: var(--raised);
  border-color: var(--line-strong);
}

.secondary:hover {
  background: var(--raised-2);
  border-color: rgba(196, 181, 253, 0.36);
}

.secondary.on {
  border-color: var(--warn);
  color: var(--warn);
}

.ghost {
  border-color: var(--line-strong);
  background: transparent;
}

.ghost:hover {
  background: rgba(168, 85, 247, 0.08);
}

.danger {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fda4af;
}

.danger:hover {
  background: rgba(244, 63, 94, 0.2);
}

.danger-ghost {
  background: transparent;
  border-color: rgba(244, 63, 94, 0.3);
  color: #fda4af;
}

.danger-ghost:hover {
  background: rgba(244, 63, 94, 0.1);
}

.small {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.big {
  min-height: 54px;
  padding: 0 28px;
  font-size: 15.5px;
}

.wide {
  width: 100%;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

.busy {
  position: relative;
  color: transparent !important;
}

.busy::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.busy svg {
  opacity: 0;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.field em {
  color: var(--dim);
  font-style: normal;
}

input:not([type]),
input[type="text"],
input[readonly] {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(14, 12, 21, 0.85);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:not([type]):focus,
input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.16);
}

input::placeholder {
  color: var(--dim);
}

.error {
  margin: 12px 0 0;
  color: var(--bad);
  font-size: 13.5px;
}

.hint {
  margin: 12px 0 0;
  padding: 10px 14px;
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--radius);
  background: rgba(251, 191, 36, 0.06);
  color: #fcd78a;
  font-size: 13px;
}

.muted {
  color: var(--muted);
}

.tiny {
  font-size: 12.5px;
}

.mono {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  letter-spacing: 0.06em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  color: var(--accent-soft);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow.center {
  justify-content: center;
}

.pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.6);
  animation: pulse 2s ease-out infinite;
}

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ------------------------------------------------------------ home */

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
  align-items: center;
  gap: 56px;
}

.hero {
  padding: 96px 0 40px;
  max-width: 720px;
  animation: rise 0.6s ease both;
}

/* Ilustração da transmissão ao lado do título */
.hero-art {
  position: relative;
  margin-top: 40px;
  animation: rise 0.7s 0.12s ease both;
}

.mock {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background:
    radial-gradient(120% 90% at 85% 10%, rgba(168, 85, 247, 0.55), transparent 55%),
    radial-gradient(90% 80% at 10% 100%, rgba(126, 34, 206, 0.5), transparent 60%),
    linear-gradient(160deg, #1d1230, #0b0912);
  box-shadow: 0 40px 90px -30px rgba(126, 34, 206, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.5);
  transform: perspective(1200px) rotateY(-9deg) rotateX(3deg);
}

.mock::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/logo.png") center 46% / 58% auto no-repeat;
  opacity: 0.9;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
}

.mock::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px);
}

.mock-top,
.mock-bottom {
  position: absolute;
  left: 14px;
  right: 14px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mock-top {
  top: 14px;
}

.mock-bottom {
  bottom: 14px;
}

.mock .chip {
  height: 26px;
  font-size: 10.5px;
}

.mock-faces {
  display: flex;
}

.mock-faces span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: -8px;
  border: 2px solid #120d1c;
  border-radius: 50%;
  background: var(--grad-btn);
  font-size: 11px;
  font-weight: 700;
}

.mock-faces span:nth-child(2) {
  background: linear-gradient(135deg, #f0abfc, #a21caf);
}

.mock-faces span:nth-child(3) {
  background: linear-gradient(135deg, #c4b5fd, #6d28d9);
}

.mock-wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
  padding: 0 10px;
}

.mock-wave i {
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: var(--accent-soft);
  transform-origin: bottom;
  animation: wave 1.1s ease-in-out infinite;
}

.mock-wave i:nth-child(2) { animation-delay: -0.9s; }
.mock-wave i:nth-child(3) { animation-delay: -0.7s; }
.mock-wave i:nth-child(4) { animation-delay: -0.5s; }
.mock-wave i:nth-child(5) { animation-delay: -0.3s; }
.mock-wave i:nth-child(6) { animation-delay: -0.15s; }
.mock-wave i:nth-child(7) { animation-delay: -0.6s; }

.mock-spec {
  position: absolute;
  right: -14px;
  bottom: -22px;
  z-index: 2;
  display: grid;
  gap: 2px;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(14, 12, 21, 0.92);
  box-shadow: var(--shadow);
  font-size: 12px;
  backdrop-filter: blur(8px);
}

.mock-spec b {
  font-size: 15px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mock-spec span {
  color: var(--muted);
}

.hero h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.lead {
  margin: 22px 0 0;
  max-width: 560px;
  color: var(--muted);
  font-size: 17px;
}

.create {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-top: 40px;
  max-width: 600px;
}

.create .field {
  flex: 1;
}

.join {
  position: relative;
  z-index: 1;
  padding: 8px 0 72px;
  max-width: 600px;
  animation: rise 0.6s 0.08s ease both;
}

.join-form {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(14, 12, 21, 0.6);
  backdrop-filter: blur(6px);
}

.join-row {
  display: flex;
  gap: 10px;
}

.join-row input {
  flex: 1;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--line);
  animation: rise 0.6s 0.16s ease both;
}

.features article {
  padding: 34px 28px 34px 0;
  background: var(--bg);
}

.features article + article {
  padding-left: 28px;
}

.ico {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(168, 85, 247, 0.08);
  color: var(--accent-soft);
}

.ico svg {
  width: 22px;
  height: 22px;
}

.features h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.features p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.steps {
  padding: 72px 0 88px;
}

.section-title {
  margin: 0 0 28px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.steps ol {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 26px 24px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(28, 24, 40, 0.55), rgba(14, 12, 21, 0.55));
  counter-increment: step;
}

.steps li::before {
  content: "0" counter(step);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.steps b {
  font-size: 16px;
  font-weight: 600;
}

.steps span {
  color: var(--muted);
  font-size: 14px;
}

.steps i {
  color: var(--accent-soft);
  font-style: normal;
}

.foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 24px 40px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 13px;
}

.foot p {
  margin: 0;
  max-width: 560px;
}

.foot nav {
  display: flex;
  gap: 22px;
}

.foot a {
  color: var(--muted);
  text-decoration: none;
}

.foot a:hover {
  color: var(--text);
}

/* ------------------------------------------------------------ páginas de texto */

.doc {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.doc h1 {
  margin: 0 0 8px;
  font-size: 36px;
  letter-spacing: -0.02em;
}

.doc h2 {
  margin: 34px 0 8px;
  font-size: 17px;
}

.doc p,
.doc li {
  color: #cdc6dd;
}

.doc ul {
  padding-left: 20px;
}

/* ------------------------------------------------------------ cartões centrais */

.room {
  min-height: 100vh;
  min-height: 100dvh;
}

.room > section {
  display: none;
  position: relative;
  z-index: 1;
}

body[data-view="host"] [data-show="host"],
body[data-view="viewer"] [data-show="viewer"] {
  display: block;
}

body[data-view="loading"] [data-show="loading"],
body[data-view="join"] [data-show="join"],
body[data-view="ended"] [data-show="ended"] {
  display: grid;
}

.center-view {
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 16px;
}

.card {
  width: min(440px, 100%);
  padding: 36px 32px 32px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(28, 24, 40, 0.92), rgba(14, 12, 21, 0.92));
  box-shadow: var(--shadow), 0 0 0 1px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  text-align: center;
  animation: rise 0.5s ease both;
}

.card-logo {
  height: 40px;
  width: auto;
  margin: 0 auto 26px;
}

.card h1 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card .mono {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.card .muted {
  margin: 0 0 24px;
  font-size: 14px;
}

.card .field {
  margin-bottom: 16px;
  text-align: left;
}

.card .again {
  margin-top: 10px;
}

.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(196, 181, 253, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ------------------------------------------------------------ chips de status */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(14, 12, 21, 0.75);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dim);
}

.chip svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.chip[data-state="live"] {
  border-color: rgba(244, 63, 94, 0.5);
  background: rgba(244, 63, 94, 0.14);
  color: #fecdd3;
}

.chip[data-state="live"] i {
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.6);
  animation: pulse-live 1.6s ease-out infinite;
}

.chip[data-state="paused"] {
  border-color: rgba(251, 191, 36, 0.45);
  color: #fde68a;
}

.chip[data-state="paused"] i {
  background: var(--warn);
}

.chip[data-state="connecting"] i {
  background: var(--accent);
  animation: blink 1s ease-in-out infinite;
}

.ghost-chip {
  color: var(--muted);
}

#signalChip i {
  background: var(--warn);
  animation: blink 1s ease-in-out infinite;
}

/* ------------------------------------------------------------ transmissor */

.room-bar {
  max-width: none;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 6, 11, 0.7);
  backdrop-filter: blur(8px);
}

.room-bar .brand img {
  height: 28px;
}

.bar-mid {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  margin-left: 18px;
}

.host-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  padding: 24px 28px 32px;
  max-width: 1680px;
  margin: 0 auto;
}

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

.stage {
  position: relative;
  overflow: hidden;
  background: #000;
}

.host-stage {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(147, 51, 234, 0.16), transparent 70%),
    #08070d;
  box-shadow: var(--shadow);
}

.is-live .host-stage {
  border-color: rgba(244, 63, 94, 0.35);
  box-shadow: var(--shadow), 0 0 0 4px rgba(244, 63, 94, 0.06);
}

.stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.host-stage video {
  background: transparent;
}

.stage-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
}

.stage-empty h2 {
  margin: 10px 0 0;
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stage-empty p {
  margin: 0;
  max-width: 520px;
  font-size: 14px;
}

.stage-empty b {
  color: var(--accent-soft);
  font-weight: 600;
}

.share-row {
  margin-top: 22px;
}

.stage-flag {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 999px;
  background: rgba(20, 16, 6, 0.85);
  color: #fde68a;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

.stage-flag svg {
  width: 16px;
  height: 16px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(14, 12, 21, 0.75);
}

.ctrl-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.select {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 6px 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--raised);
}

.select > span {
  color: var(--muted);
  font-size: 12.5px;
}

.select select {
  appearance: none;
  min-height: 42px;
  padding: 0 30px 0 4px;
  border: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5' fill='none' stroke='%23c4b5fd' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 4px center / 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.select select option {
  background: var(--raised);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.toggle.compact {
  min-height: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle .track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--raised-2);
  border: 1px solid var(--line-strong);
  transition: background 0.2s, border-color 0.2s;
}

.toggle .track span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s ease, background 0.2s;
}

.toggle input:checked + .track {
  background: var(--accent-deep);
  border-color: var(--accent);
}

.toggle input:checked + .track span {
  transform: translateX(16px);
  background: #fff;
}

.toggle input:focus-visible + .track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.host-side {
  display: grid;
  gap: 14px;
  align-content: start;
}

.panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(14, 12, 21, 0.75);
}

.panel h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel p {
  margin: 10px 0 0;
}

.code-pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid var(--line-strong);
  color: var(--accent-soft);
  font-size: 13px;
  font-weight: 700;
}

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

.copy-row input {
  min-height: 44px;
  font-size: 13px;
  color: var(--accent-soft);
  text-overflow: ellipsis;
}

.copy-row .primary {
  min-width: 96px;
  min-height: 44px;
}

.count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.16);
  color: var(--accent-soft);
  font-size: 12px;
}

.viewers {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.viewers li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 8px 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raised);
  animation: rise 0.3s ease both;
}

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad-btn);
  font-size: 13px;
  font-weight: 700;
}

.v-main {
  display: grid;
  min-width: 0;
  flex: 1;
}

.v-main b {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v-main small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v-main small[data-tone="ok"] {
  color: #86efac;
}

.v-main small[data-tone="warn"] {
  color: #fcd34d;
}

.v-main small[data-tone="bad"] {
  color: #fca5a5;
}

.empty-note {
  margin: 0 !important;
}

.meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--raised-2);
}

.meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #e9c8ff);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.08s linear;
}

.tips ul {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.tips li {
  position: relative;
  padding-left: 16px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.tips li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(45deg);
}

.tips b {
  color: var(--text);
  font-weight: 600;
}

/* ------------------------------------------------------------ espectador */

.viewer-stage {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

.viewer-stage .stage-empty {
  background:
    radial-gradient(700px 360px at 50% 30%, rgba(147, 51, 234, 0.16), transparent 70%),
    var(--bg);
}

.viewer-stage .stage-empty h2 {
  margin-top: 18px;
}

.overlay-top,
.overlay-bottom {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.overlay-top {
  top: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent);
}

.overlay-bottom {
  bottom: 0;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.78), transparent);
}

.who {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-right: auto;
  margin-left: 16px;
}

.who-name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.viewer-stage.idle {
  cursor: none;
}

.viewer-stage.idle .overlay-top,
.viewer-stage.idle .overlay-bottom {
  opacity: 0;
  pointer-events: none;
}

.viewer-stage.idle .overlay-top {
  transform: translateY(-8px);
}

.viewer-stage.idle .overlay-bottom {
  transform: translateY(8px);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(196, 181, 253, 0.12);
  border-radius: var(--radius);
  background: rgba(14, 12, 21, 0.72);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: rgba(168, 85, 247, 0.22);
  border-color: rgba(196, 181, 253, 0.3);
}

.icon-btn.on {
  color: var(--accent-soft);
  border-color: var(--accent);
  background: rgba(168, 85, 247, 0.2);
}

.icon-btn svg {
  width: 21px;
  height: 21px;
}

.icon-btn.small {
  width: 30px;
  height: 30px;
  background: transparent;
  color: var(--dim);
}

.icon-btn.small svg {
  width: 16px;
  height: 16px;
}

.icon-btn.small:hover {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.12);
  border-color: transparent;
}

#muteBtn .off,
#muteBtn.muted .on {
  display: none;
}

#muteBtn.muted .off {
  display: block;
}

.volume {
  width: 120px;
  height: 4px;
  appearance: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  outline: none;
  cursor: pointer;
}

.volume::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.35);
}

.volume::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.35);
}

.unmute {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border: 1px solid rgba(196, 181, 253, 0.4);
  border-radius: 999px;
  background: rgba(14, 12, 21, 0.85);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8), 0 0 0 6px rgba(168, 85, 247, 0.12);
  animation: rise 0.3s ease both;
}

.unmute svg {
  width: 22px;
  height: 22px;
  color: var(--accent-soft);
}

.unmute:hover {
  background: rgba(40, 24, 64, 0.92);
}

.stats {
  position: absolute;
  top: 70px;
  right: 20px;
  display: grid;
  gap: 4px;
  min-width: 230px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(10, 8, 16, 0.86);
  backdrop-filter: blur(8px);
  font-size: 12.5px;
}

.stats p {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 0;
}

.stats b {
  color: var(--muted);
  font-weight: 500;
}

.stats span {
  font-variant-numeric: tabular-nums;
}

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

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: grid;
  gap: 8px;
  justify-items: end;
  pointer-events: none;
}

.toast {
  max-width: 340px;
  padding: 11px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(21, 18, 31, 0.96);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.in {
  opacity: 1;
  transform: translateY(0);
}

.toast.ok {
  border-color: rgba(52, 211, 153, 0.35);
}

.toast.bad {
  border-color: rgba(248, 113, 113, 0.45);
}

/* ------------------------------------------------------------ animações */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@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);
  }
}

@keyframes pulse-live {
  70% {
    box-shadow: 0 0 0 8px rgba(244, 63, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(244, 63, 94, 0);
  }
}

@keyframes wave {
  0%,
  100% {
    transform: scaleY(0.25);
  }
  50% {
    transform: scaleY(1);
  }
}

@keyframes blink {
  50% {
    opacity: 0.3;
  }
}

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

/* ------------------------------------------------------------ telas menores */

@media (max-width: 1020px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .hero-art {
    display: none;
  }
}

@media (max-width: 1080px) {
  .host-grid {
    grid-template-columns: 1fr;
  }

  .host-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .bar {
    padding: 18px 16px;
  }

  .brand img {
    height: 28px;
  }

  .wrap {
    padding: 0 16px;
  }

  .hero {
    padding-top: 48px;
  }

  .lead {
    font-size: 15.5px;
  }

  .create {
    flex-direction: column;
    align-items: stretch;
  }

  .features,
  .steps ol {
    grid-template-columns: 1fr;
  }

  .features article,
  .features article + article {
    padding: 26px 0;
  }

  .foot {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 16px 32px;
  }

  .room-bar {
    padding: 12px 16px;
  }

  .room-bar .tag {
    display: none;
  }

  .bar-mid {
    margin-left: 8px;
  }

  .host-grid {
    padding: 16px;
  }

  .host-side {
    grid-template-columns: 1fr;
  }

  .host-stage {
    aspect-ratio: auto;
    min-height: 340px;
  }

  .controls,
  .controls .ctrl-group {
    width: 100%;
  }

  .controls .ctrl-group > * {
    flex: 1;
  }

  .overlay-top {
    padding: 12px;
  }

  .brand.mini {
    display: none;
  }

  .who {
    margin-left: 0;
  }

  .volume {
    width: 84px;
  }

  .overlay-bottom {
    padding: 12px;
  }

  .stats {
    top: 58px;
    right: 12px;
    left: 12px;
  }

  .toasts {
    left: 16px;
    right: 16px;
    justify-items: stretch;
  }
}
