@font-face {
  font-family: 'Onest';
  src: url('/fonts/onest.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #050506;
  --card: #111016;
  --card-2: #17161d;
  --card-3: #201f27;
  --ink: #f5f5f7;
  --ink-2: #a1a1aa;
  --dim: #76767f;
  --faint: #4e4e56;
  --line: rgb(255 255 255 / 0.08);
  --line-2: rgb(255 255 255 / 0.12);
  --accent: #9e3ef4;
  --accent-hover: #8a2fe0;
  --accent-soft: rgb(158 62 244 / 0.16);
  --accent-text: #c79bff;
  --live: #dc2626;
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
  --stage: #000000;
  --margin: 32px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.in-room { overflow: hidden; }
body[data-page='sala'] #landing { display: none; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
::selection { background: var(--accent); color: #fff; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.visually-hidden { position: fixed; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.noscript { padding: var(--margin); }

/* Home ---------------------------------------------------------------------------------------------------------- */

.site {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  overflow: hidden;
}
/* The room behind everything, then what keeps the text readable over it, then the fine dots in the corner. */
.site::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--bg) url('/img/fundo.jpg') center / cover no-repeat;
}
.site::after {
  content: '';
  position: absolute;
  inset: 0 45% 45% 0;
  z-index: -1;
  background-image: radial-gradient(rgb(255 255 255 / 0.09) 1px, transparent 1.4px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(135deg, #000, transparent 70%);
  mask-image: linear-gradient(135deg, #000, transparent 70%);
}

.site-bar {
  display: flex;
  align-items: center;
  gap: 28px;
  width: min(1200px, 100% - var(--margin) * 2);
  height: 64px;
  margin: 0 auto;
  flex: none;
}
.site-home { display: block; flex: none; line-height: 0; }
.site-home img { display: block; }
.site-nav { display: flex; gap: 2px; flex: 1; min-width: 0; }
.site-nav a {
  padding: 7px 12px;
  border-radius: 9px;
  color: var(--ink-2);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s var(--ease-out);
}
.site-nav a:hover, .site-nav a[aria-current='page'] { color: var(--ink); }
.site-nav a[aria-current='page'] { font-weight: 600; }
.site-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 7px 14px;
  background: rgb(5 5 6 / 0.55);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s var(--ease-out);
}
.site-pill:hover { border-color: rgb(255 255 255 / 0.3); }
.site-pill .icon { width: 13px; height: 13px; color: var(--ink-2); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  align-items: center;
  gap: 48px;
  flex: 1;
  width: min(1200px, 100% - var(--margin) * 2);
  margin: 0 auto;
  padding: 32px 0;
}
.hero-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 12.5px;
  animation: fade-up 0.6s var(--ease-out) both;
}
.hero-brand b { font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.hero-brand span { padding-left: 10px; border-left: 1px solid var(--line-2); color: var(--ink-2); }
.hero-title {
  font-size: clamp(2.5rem, 1.2rem + 3.2vw, 3.75rem);
  font-weight: 750;
  line-height: 1.03;
  letter-spacing: -0.045em;
}
.reveal { display: block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.reveal > span { display: block; animation: rise 0.9s var(--ease-out) both; }
.reveal + .reveal > span { animation-delay: 0.1s; }
.hero-lead {
  max-width: 460px;
  margin-top: 18px;
  color: var(--ink-2);
  font-size: 16.5px;
  line-height: 1.6;
  animation: fade-up 0.6s 0.3s var(--ease-out) both;
}
.hero-facts {
  display: grid;
  gap: 12px;
  margin-top: 28px;
  color: var(--ink-2);
  font-size: 14.5px;
  animation: fade-up 0.6s 0.4s var(--ease-out) both;
}
.hero-facts li { display: flex; align-items: center; gap: 12px; }
.fact-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  background: var(--accent-soft);
  border: 1px solid rgb(158 62 244 / 0.35);
  border-radius: 9px;
  color: var(--accent-text);
}
.fact-icon .icon { width: 15px; height: 15px; }

@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.panel {
  padding: 16px;
  background: rgb(17 16 22 / 0.62);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  backdrop-filter: blur(24px) saturate(1.3);
}
.hero > .panel { animation: fade-up 0.6s 0.2s var(--ease-out) both; }

.site-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  flex: none;
  padding: 22px 16px 28px;
  color: var(--dim);
  font-size: 12.5px;
}
.site-foot a { text-decoration: none; transition: color 0.15s var(--ease-out); }
.site-foot a:hover { color: var(--ink); }

/* Forms --------------------------------------------------------------------------------------------------------- */

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  background: rgb(0 0 0 / 0.35);
  border: 1px solid var(--line);
  border-radius: 15px;
}
.tabs button {
  height: 40px;
  padding: 1px 6px;
  background: none;
  border: 0;
  border-radius: 11px;
  color: var(--dim);
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.15s var(--ease-out), color 0.15s var(--ease-out);
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected='true'] { background: var(--card-3); color: var(--ink); }

.form { display: grid; gap: 14px; padding: 0 8px 8px; }
.invite-panel.form { padding: 28px; }
.field { display: grid; gap: 7px; min-width: 0; flex: 1; }
.field > span {
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.field small { margin-left: 6px; color: var(--dim); font-size: 11.5px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.field input {
  width: 100%;
  height: 48px;
  padding: 0 15px;
  background: rgb(0 0 0 / 0.4);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  font-size: 15px;
  transition: border-color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}
.field input::placeholder { color: var(--dim); opacity: 1; }
.field input:hover { border-color: rgb(255 255 255 / 0.22); }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.code-input { font-size: 17px; font-weight: 600; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.code-input::placeholder { font-weight: 400; letter-spacing: 0.08em; }
.field-row { display: flex; align-items: flex-end; gap: 12px; }
.form-note { color: var(--ink-2); font-size: 14px; }
.form-error { color: var(--danger); font-size: 14px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s var(--ease-out), transform 0.1s var(--ease-out);
}
.button:active { transform: translateY(1px); }
.button:disabled { opacity: 0.6; cursor: progress; }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-hover); }
.form > .button-primary { width: 100%; height: 50px; margin-top: 4px; font-size: 15.5px; border-radius: 13px; }
.button-soft { min-height: 36px; padding: 0 14px; background: rgb(255 255 255 / 0.08); color: var(--ink); border-radius: 10px; font-size: 13.5px; }
.button-soft:hover { background: rgb(255 255 255 / 0.14); }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  overflow: hidden;
  background: var(--card-3);
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar-a { background: #9e3ef4; }
.avatar-b { background: #2563eb; }
.avatar-c { background: #0d9488; }
.avatar-pick {
  flex: none;
  width: 48px;
  height: 48px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  transition: transform 0.15s var(--ease-out);
}
.avatar-pick:hover { transform: scale(1.06); }
.avatar-pick .avatar { width: 100%; height: 100%; font-size: 17px; }

/* Invitation ---------------------------------------------------------------------------------------------------- */

.invite {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 24px;
  min-height: 100svh;
  padding: 32px 16px;
}
.invite::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--bg) url('/img/fundo.jpg') 72% center / cover no-repeat;
  opacity: 0.55;
}
.invite-panel { width: min(440px, 100%); }
.invite-panel h1 {
  font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2rem);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}
.invite-info { color: var(--ink-2); font-size: 14.5px; }
#invite-fields { display: grid; gap: 14px; }
.invite-back { justify-self: center; color: var(--dim); font-size: 13.5px; }
.invite-back:hover { color: var(--ink); }

/* Room ---------------------------------------------------------------------------------------------------------- */

.room {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template: 'bar bar' 52px 'people stage' minmax(0, 1fr) / 260px minmax(0, 1fr);
  background: var(--bg);
  font-size: 14.5px;
}
.room-bar {
  grid-area: bar;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.room-home { display: block; flex: none; line-height: 0; }
.room-home img, .room-bar > img { display: block; flex: none; }
.room-name { overflow: hidden; font-size: 15px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.room-spacer { flex: 1; }
.chip-code {
  flex: none;
  padding: 4px 10px;
  background: none;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
button.chip-code { transition: border-color 0.15s var(--ease-out), color 0.15s var(--ease-out); }
button.chip-code:hover { border-color: rgb(255 255 255 / 0.3); color: var(--ink); }
.chip-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 28px;
  padding: 0 10px;
  background: none;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
button.chip-button { transition: border-color 0.15s var(--ease-out), color 0.15s var(--ease-out), background-color 0.15s var(--ease-out); }
button.chip-button:hover { border-color: rgb(255 255 255 / 0.3); color: var(--ink); }
button.chip-button.is-on { background: var(--accent-soft); border-color: rgb(158 62 244 / 0.5); color: var(--accent-text); }
.chip-button .icon { width: 14px; height: 14px; }
.room-count { color: var(--ink); font-variant-numeric: tabular-nums; }
.room-status { display: inline-flex; align-items: center; gap: 7px; flex: none; font-size: 13px; font-weight: 600; white-space: nowrap; }
.room-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.room-status.is-ok { color: var(--ok); }
.room-status.is-wait { color: var(--warn); }
.room-status.is-wait::before { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.people {
  grid-area: people;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px;
  border-right: 1px solid var(--line);
}
.people-invite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: none;
  padding: 12px;
  background: var(--card);
  border-radius: 12px;
  color: var(--ink-2);
  font-size: 13px;
}
.people-title {
  flex: none;
  padding: 20px 4px 8px;
  color: var(--dim);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.people-list { flex: 1; min-height: 0; overflow-y: auto; }
.person-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px;
  border-radius: 10px;
}
.person-text { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.person-text b { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.person-text small { color: var(--dim); font-size: 12px; }
.tag-live {
  flex: none;
  padding: 2px 6px;
  background: var(--live);
  border-radius: 5px;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.person-row.is-live { cursor: pointer; }
.person-row.is-live:hover { background: var(--card); }
.person-row.is-selected, .person-row.is-selected:hover { background: var(--accent-soft); }
.person-more {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 7px;
  color: var(--dim);
  transition: background-color 0.15s var(--ease-out), color 0.15s var(--ease-out);
}
.person-more:hover { background: var(--card-3); color: var(--ink); }
.audio-card {
  display: grid;
  gap: 2px;
  flex: none;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  font-size: 12.5px;
  transition: border-color 0.15s var(--ease-out);
}
.audio-card strong { font-size: 13px; font-weight: 600; }
.audio-card.is-on { border-color: rgb(74 222 128 / 0.45); border-style: solid; }
.audio-card-status { color: var(--ok); }
.audio-card.is-blocked { border-color: rgb(251 191 36 / 0.45); }
.audio-card.is-blocked .audio-card-status { color: var(--warn); }
.audio-card-links { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.audio-card-links a { color: var(--dim); text-decoration: none; transition: color 0.15s var(--ease-out); }
.audio-card-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.people-me {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  margin-top: 10px;
  padding: 10px 4px 0;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 13px;
}
.people-me > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-me b { color: var(--ink-2); font-weight: 600; }
.people-me .avatar-pick { width: 26px; height: 26px; }
.people-me .avatar-pick .avatar { font-size: 12px; }

.stage {
  grid-area: stage;
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--stage);
}
.stage > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 0 0;
}
.stage.is-zoomed > video { cursor: grab; }
.stage.is-dragging > video { cursor: grabbing; }
.stage:not(.has-stream) > video { visibility: hidden; }
.stage.is-idle { cursor: none; }

.stage-note {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 24px 90px;
  text-align: center;
}
.stage-note h2 { font-size: 20px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.stage-note p { max-width: 360px; color: var(--dim); font-size: 14.5px; }
.stage-note .button { margin-top: 12px; }
#stage-wait { pointer-events: none; }
#stage-wait .button { pointer-events: auto; }

.stage-info {
  position: absolute;
  top: 12px;
  left: 12px;
  max-width: calc(100% - 24px);
  padding: 4px 9px;
  background: rgb(17 16 22 / 0.8);
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.2s var(--ease-out);
}
.stage-zoom {
  position: absolute;
  top: 12px;
  left: 50%;
  translate: -50% 0;
  padding: 4px 10px;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
}

.thumbs {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100% - 96px);
  overflow-y: auto;
  transition: opacity 0.2s var(--ease-out);
}
.thumb {
  position: relative;
  display: block;
  flex: none;
  width: 192px;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  transition: transform 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
}
.thumb:hover { transform: scale(1.03); border-color: var(--accent); }
.thumb video { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb.is-blank video { visibility: hidden; }
.thumb.is-blank::before {
  content: 'No ar';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--dim);
  font-size: 13px;
}
.thumb span {
  position: absolute;
  left: 6px;
  bottom: 6px;
  max-width: calc(100% - 12px);
  padding: 2px 6px;
  overflow: hidden;
  background: rgb(0 0 0 / 0.72);
  border-radius: 5px;
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.controls {
  position: absolute;
  left: 50%;
  bottom: 18px;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 24px);
  padding: 6px;
  background: rgb(17 16 22 / 0.92);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  transition: opacity 0.2s var(--ease-out), translate 0.2s var(--ease-out);
}
.stage.is-idle .controls, .stage.is-idle .stage-info, .stage.is-idle .thumbs { opacity: 0; }
.stage.is-idle .controls { translate: -50% 8px; }
.controls-gap { flex: none; width: 1px; height: 22px; margin: 0 4px; background: var(--line-2); }
.control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: none;
  min-width: 32px;
  height: 32px;
  padding: 0 7px;
  background: rgb(255 255 255 / 0.03);
  border: 1px solid var(--line-2);
  border-radius: 9px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.15s var(--ease-out), color 0.15s var(--ease-out), border-color 0.15s var(--ease-out), transform 0.1s var(--ease-out);
}
.control:hover { background: rgb(255 255 255 / 0.1); }
.control:active { transform: translateY(1px); }
.control.is-on { background: var(--accent-soft); border-color: rgb(158 62 244 / 0.5); color: var(--accent-text); }
.control-primary { height: 40px; padding: 0 14px; background: var(--accent); border: 0; border-radius: 11px; color: #fff; }
.control-primary:hover { background: var(--accent-hover); }
.control-primary.is-live { background: var(--live); }
.control-primary.is-live:hover { background: #b91c1c; }
.control-narrow { min-width: 30px; padding: 0 7px; }
.control-leave { width: 40px; height: 40px; background: none; border: 0; border-radius: 11px; color: var(--ink-2); }
.control-leave:hover { background: rgb(220 38 38 / 0.2); color: var(--danger); }
.tx-group { position: relative; display: flex; gap: 1px; flex: none; }
.tx-group #tx { border-radius: 11px 0 0 11px; }
.tx-group #tx-more { border-radius: 0 11px 11px 0; }
.volume { display: flex; align-items: center; gap: 6px; flex: none; }
.volume input { width: 80px; }

input[type='range'] {
  height: 22px;
  margin: 0;
  background: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
input[type='range']::-webkit-slider-runnable-track { height: 4px; background: var(--card-3); border-radius: 2px; }
input[type='range']::-moz-range-track { height: 4px; background: var(--card-3); border-radius: 2px; }
input[type='range']::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  margin-top: -4.5px;
  background: var(--accent-text);
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
}
input[type='range']::-moz-range-thumb { width: 13px; height: 13px; background: var(--accent-text); border: 0; border-radius: 50%; }

.popup {
  z-index: 5;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgb(0 0 0 / 0.6);
}
.popup-tx {
  position: absolute;
  left: 0;
  bottom: calc(100% + 14px);
  display: grid;
  gap: 2px;
  min-width: 210px;
  padding: 6px;
}
.popup-tx button, .popup-menu button {
  padding: 9px 10px;
  background: none;
  border: 0;
  border-radius: 9px;
  font-size: 13.5px;
  text-align: left;
  transition: background-color 0.15s var(--ease-out);
}
.popup-tx button:hover, .popup-menu button:hover { background: var(--card-3); }
.popup-quality {
  position: absolute;
  left: 50%;
  bottom: 78px;
  translate: -50% 0;
  display: grid;
  gap: 12px;
  width: min(372px, calc(100% - 24px));
  max-height: calc(100% - 92px);
  overflow-y: auto;
  padding: 16px;
}
.popup-quality h3 { font-size: 14px; font-weight: 700; }
.popup-note { color: var(--dim); font-size: 12.5px; line-height: 1.45; }
.option { display: grid; gap: 6px; }
.option > span { color: var(--ink-2); font-size: 12.5px; }
.segments { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; background: rgb(0 0 0 / 0.35); border: 1px solid var(--line); border-radius: 11px; }
.segments > * {
  flex: 1 1 auto;
  padding: 6px 10px;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  transition: background-color 0.15s var(--ease-out), color 0.15s var(--ease-out);
}
.segments button:hover { color: var(--ink); }
.segments .is-on, .segments button.is-on:hover { background: var(--accent); color: #fff; }
.popup-menu {
  position: fixed;
  z-index: 20;
  display: grid;
  gap: 2px;
  min-width: 220px;
  max-width: 280px;
  padding: 6px;
}
.menu-title { padding: 6px 10px; overflow: hidden; color: var(--dim); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.menu-question { color: var(--ink); font-size: 13.5px; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }
.menu-volume { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 6px 10px; font-size: 13.5px; }
.menu-volume b { font-weight: 600; font-variant-numeric: tabular-nums; }
.menu-volume input { grid-column: 1 / -1; width: 100%; }
.popup-menu .is-danger { color: var(--danger); }

.toasts {
  position: fixed;
  z-index: 30;
  left: 50%;
  top: 64px;
  translate: -50% 0;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(460px, calc(100% - 32px));
  pointer-events: none;
}
.toast {
  padding: 9px 14px;
  background: var(--card-3);
  border: 1px solid var(--line-2);
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
  animation: fade-up 0.25s var(--ease-out) both;
}
.toast.is-error { background: #3b1518; border-color: rgb(248 113 113 / 0.5); color: #fecaca; }

/* How it works page --------------------------------------------------------------------------------------------- */

.help { overflow: hidden; }
.help-head { width: min(1200px, 100% - var(--margin) * 2); margin: 48px auto 32px; }
.help-head h1 { font-size: clamp(2.25rem, 1.2rem + 2.6vw, 3.25rem); font-weight: 750; line-height: 1.05; letter-spacing: -0.04em; }
.help-head p { max-width: 560px; margin-top: 12px; color: var(--ink-2); font-size: 16.5px; }

.demo { width: min(1200px, 100% - var(--margin) * 2); margin: 0 auto; }
.demo-room { overflow: hidden; background: var(--bg); border: 1px solid var(--line-2); border-radius: 16px; font-size: 14.5px; }
.demo-room .room-bar { height: 52px; }
.demo-body { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.demo-body .people, .demo-body .stage { grid-area: auto; }
.demo-stage { aspect-ratio: 16 / 9; }
.demo-stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.demo-room .control, .demo-room .button { cursor: default; }
.demo-room .control:hover { background: rgb(255 255 255 / 0.03); }
.demo-room .control-primary:hover { background: var(--accent); }
.demo-room .control-leave:hover { background: none; color: var(--ink-2); }
.demo-room .button-soft:hover { background: rgb(255 255 255 / 0.08); }

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  width: min(1200px, 100% - var(--margin) * 2);
  margin: 56px auto 0;
}
.step h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.015em; }
.step p { margin-top: 8px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }

.faq { width: min(1200px, 100% - var(--margin) * 2); margin: 80px auto 0; scroll-margin-top: 24px; }
.faq h2 { font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem); font-weight: 750; line-height: 1.05; letter-spacing: -0.035em; }
.faq-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  column-gap: clamp(32px, 8vw, 96px);
  margin-top: 24px;
}
.faq-item { display: contents; }
.faq-item button {
  grid-column: 1;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  background: none;
  border: 0;
  color: var(--dim);
  font-size: 16px;
  font-weight: 500;
  text-align: left;
  transition: color 0.15s var(--ease-out);
}
.faq-item button::before {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  background: var(--card-3);
  border-radius: 50%;
  translate: 0 -2px;
  transition: background-color 0.15s var(--ease-out);
}
.faq-item button:hover, .faq-item button[aria-expanded='true'] { color: var(--ink); }
.faq-item button[aria-expanded='true']::before { background: var(--accent); }
.faq-item p {
  grid-column: 2;
  grid-row: 1 / span 8;
  max-width: 44ch;
  font-size: 18px;
  line-height: 1.5;
  animation: fade-up 0.25s var(--ease-out) both;
}
.help .site-foot { margin-top: 72px; }

.rise { opacity: 0; transform: translateY(20px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
.rise.is-in { opacity: 1; transform: none; }
.step.rise:nth-child(2) { transition-delay: 80ms; }
.step.rise:nth-child(3) { transition-delay: 160ms; }

/* Smaller screens ------------------------------------------------------------------------------------------------ */

@media (max-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 24px 0 8px; }
  .hero > .panel { width: 100%; max-width: 520px; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .demo-body { grid-template-columns: minmax(0, 1fr); }
  .demo-people { display: none; }
}

@media (max-width: 760px) {
  :root { --margin: 16px; }
  /* In a tall narrow page the picture would be enlarged right behind the text: dimmer, so the text stays readable. */
  .site::before { background-position: 72% top; opacity: 0.3; }
  .room { position: static; min-height: 100svh; grid-template: 'bar' auto 'stage' auto 'people' minmax(0, 1fr) / minmax(0, 1fr); }
  body.in-room { overflow: auto; }
  .room-bar { flex-wrap: wrap; min-height: 52px; padding: 8px 12px; }
  .room-name { flex: 1 1 30%; }
  .room-spacer { display: none; }
  .room-bar .chip-button span { display: none; }
  .room-bar .chip-button.room-count { display: none; }
  /* Conectado: only the dot, the room's name needs the space. Anything else still says what is happening. */
  .room-status.is-ok { gap: 0; font-size: 0; }
  .people { border-right: 0; }
  .stage { height: 56svh; }
  .stage-note { padding-bottom: 76px; }
  .volume input { display: none; }
  .controls { bottom: 10px; }
  .control { min-width: 38px; height: 38px; border-radius: 10px; }
  .control-primary, .control-leave { height: 42px; }
  .thumbs { top: 44px; right: 8px; left: 8px; flex-direction: row; max-height: none; overflow-x: auto; }
  .thumb { width: 112px; }
  .popup-quality { bottom: 70px; }
  .faq-grid { display: block; }
  .faq-item { display: block; }
  .faq-item button { width: 100%; }
  .faq-item p { max-width: none; padding: 2px 0 14px 19px; font-size: 16px; }
  .demo-room .room-bar { flex-wrap: nowrap; }
  .demo-room .room-status, .demo-room .room-count { display: none; }
  .demo-room .stage { height: auto; }
  .demo-room .control { min-width: 28px; height: 28px; padding: 0 5px; }
  .demo-room .control-leave, .demo-room .control-primary { height: 30px; }
  .demo-room .controls { bottom: 6px; padding: 4px; gap: 3px; border-radius: 12px; }
  .demo-room .controls-gap { margin: 0 2px; }
  .demo-control-label { display: none; }
  .demo-room .stage-info { top: 6px; left: 6px; font-size: 11.5px; }
}

/* The links don't fit beside the logo on the narrowest phones; the same links are in the footer. */
@media (max-width: 360px) {
  .site-pill { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
}
