/* A cara do site: noite fechada, com o lilás e o rosa escuro do podcast aparecendo como luz ao longe. */
:root {
  --bg: #020104;
  --surface: #09060f;
  --surface-2: #110c1a;
  --line: #20182e;
  --text: #efe9f8;
  --muted: #968aae;
  --accent: #b48cf2;
  --accent-ink: #14091f;
  --rose: #cf3a86;
  --danger: #ff5a6a;
  --ok: #4fd6a0;
  --scrim: rgba(2, 1, 4, 0.84);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Duas luzes distantes e um chiado fino por cima, como uma transmissão mal sintonizada. Ficam paradas atrás de tudo. */
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(60vw 55vh at 8% -10%, rgba(116, 66, 214, 0.13), transparent 70%),
    radial-gradient(55vw 60vh at 108% 108%, rgba(164, 22, 92, 0.11), transparent 70%);
  content: "";
  pointer-events: none;
}

body.in-room {
  overflow: hidden;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h2 {
  font-size: 17px;
  letter-spacing: -0.01em;
}

a {
  color: var(--accent);
}

button,
input,
select {
  font: inherit;
}

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

.ico {
  display: block;
  width: 22px;
  height: 22px;
}

/* ------------------------------------------------------------ peças comuns */

.site-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
}

.site-top nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 20px;
}

.site-top nav a[aria-current="page"] {
  color: var(--text);
}

.site-top nav a,
.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}

.site-top nav a:hover,
.link:hover {
  color: var(--text);
}

/* O topo espera a página saber se há logo, para o nome não piscar antes dela. */
body:not(.known) .brand {
  visibility: hidden;
}

.brand .logo {
  display: block;
  width: auto;
  height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
}

/* A luz do estúdio: lilás em espera, vermelha quando está gravando. */
.tally {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(180, 140, 242, 0.2), 0 0 14px rgba(180, 140, 242, 0.7);
}

.tally.live {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 90, 82, 0.24);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}

.page {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px 72px;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.lead {
  margin-top: 12px;
  color: var(--muted);
  font-size: 17px;
}

.lead.small {
  flex-basis: 100%;
  margin-top: 0;
  font-size: 15px;
}

.card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

label {
  display: block;
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 13px;
}

input:not([type="checkbox"]),
select {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}

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

.field-row input {
  flex: 1 1 200px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover {
  border-color: #3d3058;
}

.btn.primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
}

.btn.primary:hover {
  background: #c9abff;
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
}

.btn.small {
  padding: 7px 12px;
  font-size: 14px;
}

.btn.big {
  width: 100%;
  margin-top: 20px;
  padding: 13px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.error {
  margin-top: 12px;
  color: var(--danger);
  font-size: 14px;
}

.hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13.5px;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.empty {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #3a2d0f;
  color: #ffd98a;
  font-size: 14px;
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.row-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.row-main strong {
  overflow-wrap: anywhere;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.status {
  color: var(--muted);
  font-size: 13px;
}

.status.on {
  color: var(--ok);
}

.status.rec {
  color: var(--danger);
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.badge.rec {
  background: var(--danger);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.badge.warn {
  background: #3a2d0f;
  color: #ffd98a;
}

.session {
  margin-bottom: 32px;
}

.session > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.toasts {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
}

.in-room .toasts {
  bottom: 96px;
}

.toast {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  font-size: 14.5px;
}

.toast-actions {
  display: flex;
  gap: 8px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.66);
}

.overlay .card {
  display: grid;
  justify-items: center;
  gap: 12px;
  max-width: 380px;
  text-align: center;
}

/* --------------------------------------------------------- antes de entrar */

.screen {
  min-height: 100dvh;
}

.screen.center {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
}

.screen.center p {
  max-width: 420px;
  color: var(--muted);
}

.screen.center .field-row {
  justify-content: center;
  margin-top: 8px;
}

.prejoin-body {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 400px);
  align-items: center;
  gap: 28px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 20px 48px;
}

.preview {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background: var(--surface-2);
}

.preview video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Espelhar é só para quem se vê; os outros e a gravação recebem a imagem como ela é. */
.mirrored .preview video,
.mirrored .tile.self video {
  transform: scaleX(-1);
}

.preview-off {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding-bottom: 60px;
  background: #1b1e25;
  color: var(--muted);
  font-size: 14px;
}

.preview-off img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
}

.join .notice {
  margin: 16px 0 0;
}

.photo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.photo-row > img {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.photo-row strong {
  font-size: 14px;
}

.photo-row small {
  display: block;
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

.preview-controls {
  position: absolute;
  bottom: 18px;
  left: 50%;
  display: flex;
  gap: 10px;
  transform: translateX(-50%);
}

.meter {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
}

.meter i {
  display: block;
  height: 100%;
  background: var(--ok);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.12s linear;
}

.devices label:first-child {
  margin-top: 14px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  color: var(--text);
  font-size: 14.5px;
  cursor: pointer;
}

.check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.check small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

/* -------------------------------------------------------------------- sala */

.room {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100dvh;
}

.room-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 4px;
}

.room-top .brand span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 8px 16px;
  container-type: size;
}

/* O quadro 16:9 que vira o vídeo final. Tudo dentro dele é medido em relação à sua largura (cqw),
   para ficar igual em qualquer tamanho de janela e no vídeo de 1920×1080. */
.frame {
  --frame-bg: #020104;
  --frame-accent: var(--accent);
  position: relative;
  overflow: hidden;
  width: min(100cqw, calc(100cqh * 16 / 9));
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: var(--frame-bg);
  box-shadow: 0 0 0 1px var(--line);
  container-type: size;
}

.frame-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

img.frame-layer {
  object-fit: cover;
}

.frame-layer.front {
  z-index: 2;
}

.tiles {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Cada pessoa é uma célula sem fundo: o vídeo (ou a foto redonda com o espectro em volta) e o nome embaixo.
   As posições das partes vêm da mesma conta do vídeo final. */
.tile,
.screen-tile,
.tile > * {
  position: absolute;
}

.tile,
.screen-tile {
  transition: left 0.25s, top 0.25s, width 0.25s, height 0.25s;
}

.media,
.screen-tile {
  overflow: hidden;
  border-radius: 0.94cqw;
  background: #000;
}

.media {
  outline: 0.16cqw solid transparent;
  outline-offset: -0.16cqw;
}

.tile.speaking .media {
  outline-color: var(--frame-accent);
}

.tile.cam-off .media {
  background: none;
  outline: none;
}

.media video,
.screen-tile video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile.cam-off video {
  opacity: 0;
}

.tile .avatar,
.ring {
  display: none;
}

.tile.cam-off .avatar,
.tile.cam-off .ring {
  display: block;
}

.avatar {
  border-radius: 50%;
  object-fit: cover;
}

.avatar.small {
  flex: none;
  width: 34px;
  height: 34px;
}

.tile-status {
  position: absolute;
  top: 0.6cqw;
  right: 0.6cqw;
  left: 0.6cqw;
  color: var(--muted);
  font-size: max(11px, 0.9cqw);
  text-align: center;
}

.tile-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3em;
  overflow: hidden;
  color: #fff;
  font-weight: 600;
  line-height: 1;
  text-shadow: 0 0.1cqw 0.31cqw rgba(0, 0, 0, 0.85);
  white-space: nowrap;
}

.mic-flag {
  display: none;
  flex: none;
  color: var(--danger);
}

.mic-flag .ico {
  width: 0.9em;
  height: 0.9em;
}

.tile.mic-off .mic-flag {
  display: block;
}

.screen-tile video {
  object-fit: contain;
}

.screen-tile.notice {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 20px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface-2);
}

.icon-btn .ico {
  width: 18px;
  height: 18px;
}

.fs-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--scrim);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 16px 16px;
}

.ctl {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.ctl:hover {
  border-color: #454a58;
}

.ctl.wide {
  width: auto;
  padding: 0 18px;
}

.ctl.off {
  border-color: #5c2725;
  background: #3d1a19;
  color: #ff8f88;
}

.ctl.on {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
}

.ctl:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.rec-btn .ico {
  color: var(--danger);
}

.rec-btn.on {
  border-color: transparent;
  background: var(--danger);
  color: #fff;
}

.rec-btn.on .ico {
  color: #fff;
}

.ctl.leave {
  background: transparent;
  color: #ff8f88;
}

.ctl b {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.sep {
  width: 1px;
  height: 28px;
  margin: 0 4px;
  background: var(--line);
}

.panel {
  position: fixed;
  top: 56px;
  right: 16px;
  bottom: 84px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: min(340px, calc(100vw - 32px));
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.people {
  flex: 1;
  margin: 0;
  padding: 0;
  list-style: none;
}

.people li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.who {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.who strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.who small,
.invite small {
  color: var(--muted);
  font-size: 12.5px;
}

.invite {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.invite label {
  margin-top: 0;
}

.invite small {
  display: block;
  margin-top: 8px;
}

/* --------------------------------------------------- moldura e gravações */

.editor {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  align-items: start;
  gap: 24px;
}

.page.wide {
  max-width: 1240px;
}

.editor-preview {
  position: sticky;
  top: 16px;
}

.editor .stage {
  padding: 0;
  aspect-ratio: 16 / 9;
}

.media.sample {
  background: linear-gradient(135deg, #3a3550, #1f1c2c);
}

.screen-tile.sample {
  background: linear-gradient(135deg, #24212f, #14121c);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.swatches label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.templates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.template {
  display: grid;
  gap: 6px;
  padding: 5px 5px 7px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}

.template canvas {
  display: block;
  width: 100%;
  border-radius: 6px;
}

.template.selected {
  border-color: var(--accent);
  color: var(--text);
}

.editor canvas.frame-layer {
  display: block;
}

.editor .card h2 {
  margin-top: 22px;
}

.editor .card h2:first-child {
  margin-top: 0;
}

.editor input[type="color"] {
  width: 56px;
  height: 40px;
  padding: 3px;
  cursor: pointer;
}

.upload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.logo-thumb {
  width: auto;
  height: 44px;
  padding: 4px 8px;
  border-radius: 8px;
  background: repeating-conic-gradient(#3a3348 0 25%, #57506a 0 50%) 0 0 / 12px 12px; /* xadrez, para ver logo clara ou escura */
}

.upload small,
.editor .note {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 12.5px;
}

.sample {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.4cqw;
}

.final {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.progress {
  flex: 1 1 160px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.progress i {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.4s;
}

details.originals > summary {
  padding: 8px 4px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

details.originals .list {
  margin-top: 6px;
}

/* Com um painel aberto, os quadros encolhem para não ficar escondidos atrás dele. */
@media (min-width: 900px) {
  .room.panel-open .stage {
    padding-right: 372px;
  }
}

@media (max-width: 760px) {
  .prejoin-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .ctl,
  .ctl.wide {
    width: 44px;
    height: 44px;
    padding: 0;
  }

  .site-top {
    padding: 14px 16px;
  }

  .stage {
    padding: 8px 10px;
  }

  .editor {
    grid-template-columns: minmax(0, 1fr);
  }

  .controls {
    gap: 6px;
    padding: 4px 10px 12px;
  }

  .ctl.wide span:not([data-icon]) {
    display: none;
  }

  .sep {
    display: none;
  }

  .in-room .toasts {
    bottom: 132px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tally.live,
  .rings,
  .airwaves,
  .spinner {
    animation: none;
  }

  .meter i,
  .tile,
  .screen-tile,
  .progress i {
    transition: none;
  }
}

/* ------------------------------------------- imagens soltas, áudio, atalhos */

/* Imagens soltas da moldura (logo, selo, GIF): uma camada atrás dos vídeos e outra na frente de tudo. */
.elements {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.elements.front {
  z-index: 3;
}

.elements img {
  position: absolute;
}

/* Na página da moldura elas podem ser arrastadas. Os exemplos de pessoas também: arrastar um deles muda a área dos vídeos
   de lugar. O vão entre eles deixa o mouse passar, para alcançar uma imagem que esteja atrás. */
.editor .tiles {
  pointer-events: none;
}

.editor .tile,
.editor .screen-tile {
  cursor: move;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  transition: none;
}

/* A área dos vídeos: uma linha tracejada com bolinhas para puxar, nos cantos e no meio de cada lado. */
#areaBox {
  position: absolute;
  z-index: 4;
  outline: 1px dashed rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

.pull {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  touch-action: none;
}

/* a parte que responde ao toque é maior que a bolinha, para caber um dedo */
.pull::after,
#handle::after {
  position: absolute;
  inset: -12px;
  content: "";
}

.pull[data-pull^="t"] { top: 0; }
.pull[data-pull^="b"] { top: 100%; }
.pull[data-pull$="l"] { left: 0; }
.pull[data-pull$="r"] { left: 100%; }
.pull[data-pull="t"], .pull[data-pull="b"] { left: 50%; cursor: ns-resize; }
.pull[data-pull="l"], .pull[data-pull="r"] { top: 50%; cursor: ew-resize; }
.pull[data-pull="tl"], .pull[data-pull="br"] { cursor: nwse-resize; }
.pull[data-pull="tr"], .pull[data-pull="bl"] { cursor: nesw-resize; }

.editor-preview > .note {
  margin: 10px 0 0;
}

.editor .elements img {
  cursor: move;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}

.editor .elements img.selected {
  outline: 0.16cqw dashed #fff;
  outline-offset: 0.1cqw;
}

#handle {
  position: absolute;
  border: 0.14cqw solid #fff;
  border-radius: 50%;
  background: var(--accent);
  cursor: nwse-resize;
  pointer-events: auto;
  touch-action: none;
}

.list.loose .row {
  flex-wrap: nowrap;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.list.loose .row.selected {
  border-color: var(--accent);
}

.list.loose img {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: var(--surface-2);
  object-fit: contain;
}

.list.loose select {
  flex: 1;
  padding: 7px 8px;
  font-size: 14px;
}

.list.loose + .btn {
  margin-top: 4px;
}

fieldset.audio {
  margin: 18px 0 0;
  padding: 2px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

fieldset.audio legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
}

.test {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.shortcuts h3 {
  margin: 20px 0 8px;
  font-size: 14px;
}

.shortcuts dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  margin: 0;
  font-size: 13.5px;
}

.shortcuts dt {
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  font-family: ui-monospace, Consolas, monospace;
  text-align: center;
}

.shortcuts dd {
  margin: 0;
  color: var(--muted);
}

.stage:fullscreen {
  padding: 0;
  background: #000;
}

/* Microfone e câmera vêm cada um com a sua seta, que abre as configurações de áudio ou de vídeo. */
.split {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}

.split .ctl {
  border-color: transparent;
}

.split .ctl:not(.off) {
  background: transparent;
}

.split .more {
  width: 30px;
  margin-right: 3px;
  color: var(--muted);
}

.split .more:hover {
  color: var(--text);
}

.split .more .ico {
  width: 16px;
  height: 16px;
}

/* Borda animada por cima de um vídeo; passa um pouco para fora do quadro, por causa do brilho. */
.edge {
  position: absolute;
  pointer-events: none;
}

@media (max-width: 760px) {
  .split .more {
    width: 24px;
    margin-right: 2px;
  }
}

/* ------------------------------------------------- página pública e entrada */

/* Rótulo pequeno, em letra de máquina, como a legenda de uma transmissão. */
.signal {
  margin: 0 0 10px;
  color: var(--accent);
  font: 600 11.5px/1 var(--mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.meta {
  color: var(--muted);
  font: 12px/1.5 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.actions .ico {
  width: 16px;
  height: 16px;
}

.count {
  margin-left: 6px;
  color: var(--muted);
  font: 13px var(--mono);
}

/* Ondas saindo de um ponto, como um sinal captado ao longe. */
.rings {
  position: absolute;
  inset: -24%;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 8.6%, rgba(180, 140, 242, 0.26) 8.6% 9%);
  -webkit-mask-image: radial-gradient(circle, #000 28%, transparent 70%);
  mask-image: radial-gradient(circle, #000 28%, transparent 70%);
  animation: scan 7s ease-in-out infinite;
  pointer-events: none;
}

@keyframes scan {
  50% {
    opacity: 0.5;
    transform: scale(1.07);
  }
}

/* Na página inicial as ondas do sinal tomam toda a faixa de cima, de uma beirada à outra, e somem aos poucos para baixo. */
.airwaves {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: -1;
  height: min(780px, 110vh);
  background: repeating-radial-gradient(circle at 27% 44%, transparent 0 44px, rgba(180, 140, 242, 0.25) 44px 45.5px);
  -webkit-mask-image: linear-gradient(#000 45%, transparent);
  mask-image: linear-gradient(#000 45%, transparent);
  animation: breathe 7s ease-in-out infinite;
  pointer-events: none;
}

@keyframes breathe {
  50% {
    opacity: 0.55;
  }
}

.page.listen {
  max-width: 1080px;
  overflow-x: clip; /* as ondas em volta da capa passam da beirada em telas estreitas */
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 56px);
  padding: clamp(12px, 4vw, 40px) 0 clamp(36px, 6vw, 64px);
}

/* A imagem do episódio num quadro 16:9. A capa quadrada do Spotify aparece inteira, com ela mesma desfocada nos lados. */
.art {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: var(--surface-2);
  aspect-ratio: 16 / 9;
}

.art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.art img.fill {
  filter: blur(16px) brightness(0.5);
  transform: scale(1.3);
}

.art img.whole {
  object-fit: contain;
}

.hero-art {
  position: relative;
  display: block;
  width: 100%;
  max-width: 520px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: none;
  cursor: pointer;
  justify-self: center;
}

.hero-art .art {
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(180, 140, 242, 0.25), 0 0 70px rgba(116, 66, 214, 0.3);
}

.hero.quiet {
  grid-template-columns: minmax(0, 1fr);
  min-height: 46vh;
  justify-items: center;
  text-align: center;
}

.hero h1 {
  font-size: clamp(30px, 4.6vw, 50px);
  line-height: 1.08;
}

.hero .meta {
  margin-top: 14px;
}

.hero .excerpt {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 14px;
  font-size: 17px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.hero .actions {
  margin-top: 24px;
}

/* O botão de tocar por cima da capa. */
.play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s;
}

.hero-art .play {
  right: 18px;
  bottom: 18px;
  width: 64px;
  height: 64px;
}

.hero-art .play .ico {
  width: 28px;
  height: 28px;
}

.hero-art:hover .play,
.cover:hover .play {
  transform: scale(1.08);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 24px;
  margin-bottom: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
}

.section-head input {
  width: min(100%, 280px);
}

.episodes {
  margin: 0;
  padding: 0;
  list-style: none;
}

.episode {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  padding: 16px 14px;
  border: 1px solid transparent;
  border-bottom-color: var(--line);
  transition: background 0.15s, border-color 0.15s;
}

.episode:hover {
  border-color: var(--line);
  border-radius: 16px;
  background: rgba(17, 12, 26, 0.7);
}

.episode.on-air,
.hero.on-air .hero-art .art {
  outline: 1px solid var(--accent);
}

.episode.on-air {
  border-color: transparent;
  border-radius: 16px;
  background: rgba(116, 66, 214, 0.12);
}

.episode h3 {
  margin: 4px 0 6px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.episode .excerpt {
  display: -webkit-box;
  overflow: hidden;
  font-size: 14.5px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.episode .actions {
  margin-top: 12px;
}

.cover {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  cursor: pointer;
}

.cover .play {
  right: 8px;
  bottom: 8px;
  width: 38px;
  height: 38px;
}

.cover .play .ico {
  width: 18px;
  height: 18px;
}

.btn.more {
  display: flex;
  margin: 24px auto 0;
}

.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 12px var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-foot nav {
  display: flex;
  gap: 20px;
}

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

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

/* O reprodutor preso embaixo: segue tocando enquanto a pessoa percorre a lista. */
.dock {
  position: fixed;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 20;
  width: min(100% - 24px, 720px);
  margin: 0 auto;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(7, 5, 12, 0.96);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(180, 140, 242, 0.14);
  backdrop-filter: blur(14px);
}

/* o vídeo fica num canto, pequeno, para a lista seguir à vista; o botão de aumentar leva para o meio da tela */
.dock.video:not(.large) {
  width: min(100% - 24px, 440px);
  margin-right: 0;
}

.dock.large {
  width: min(100% - 24px, 1100px);
}

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

.dock-title {
  min-width: 0;
}

.dock-title .signal {
  margin-bottom: 5px;
  font-size: 10px;
}

.dock-title strong {
  display: block;
  overflow: hidden;
  font-size: 14.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
}

.dock-frame iframe {
  display: block;
  width: 100%;
  margin: 0 auto;
  border: 0;
  border-radius: 12px;
  background: #000;
}

.dock-frame iframe.audio {
  height: 152px;
}

/* o vídeo mantém o formato 16:9 e nunca toma mais que uma parte da altura da janela */
.dock-frame iframe.video {
  width: min(100%, 38vh * 16 / 9);
  height: auto;
  aspect-ratio: 16 / 9;
}

.dock.large .dock-frame iframe.video {
  width: min(100%, 70vh * 16 / 9);
}

/* com o reprodutor aberto, o fim da página sobe para não ficar escondido atrás dele */
body.docked .site-foot {
  padding-bottom: 260px;
}

body.docked:has(.dock.video) .site-foot {
  padding-bottom: calc(38vh + 120px);
}

/* Entrada e convite: um cartão no meio, com o sinal pulsando atrás. */
.gate {
  position: relative;
  display: grid;
  place-items: center;
  max-width: none;
  min-height: calc(100vh - 160px);
  overflow-x: clip;
}

.gate .rings {
  inset: 50% auto auto 50%;
  z-index: -1;
  width: min(820px, 150vw);
  height: min(820px, 150vw);
  translate: -50% -50%;
}

.gate .card {
  width: min(100%, 500px);
  padding: 32px 30px;
  background: rgba(7, 5, 12, 0.9);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
}

.gate h1 {
  font-size: clamp(30px, 6vw, 40px);
}

.btn.google .g {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 800;
}

/* Páginas da equipe: convidados e episódios. */
.page-head > div:first-child {
  min-width: 0;
}

.list-title {
  margin: 30px 0 12px;
}

.card + .card {
  margin-top: 14px;
}

.card > h2 + label {
  margin-top: 16px;
}

.field-row.end {
  align-items: center;
  justify-content: flex-end;
  margin-top: 16px;
}

.field-row.end .status {
  margin-right: auto;
}

.hint.first {
  margin-top: 8px;
}

.row.off strong {
  color: var(--muted);
  text-decoration: line-through;
}

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

  .hero-art {
    max-width: 420px;
  }

  .episode {
    grid-template-columns: 124px minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    padding: 14px 4px;
  }

  .episode h3 {
    font-size: 18px;
  }

  .section-head input {
    width: 100%;
  }

  .dock,
  .dock.video:not(.large) {
    right: 6px;
    bottom: 6px;
    left: 6px;
    width: auto;
  }

  .site-top {
    flex-wrap: wrap;
  }

  .brand .logo {
    height: 58px;
  }

  .airwaves {
    background: repeating-radial-gradient(circle at 50% 30%, transparent 0 36px, rgba(180, 140, 242, 0.25) 36px 37.5px);
  }
}
