:root {
  color-scheme: dark;
  --bg: #0b0711;
  --bg-soft: #120b1d;
  --panel: rgba(26, 16, 40, 0.88);
  --panel-solid: #1a1028;
  --panel-2: #221434;
  --line: rgba(232, 218, 255, 0.12);
  --line-strong: rgba(199, 154, 255, 0.28);
  --text: #f8f5ff;
  --muted: #aaa0b9;
  --muted-2: #746b82;
  --purple: #9f5cff;
  --purple-light: #c89aff;
  --pink: #f351c7;
  --cyan: #53e7d2;
  --green: #6ee7a8;
  --danger: #ff6a83;
  --warning: #f5bf62;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 22px;
  --radius-small: 13px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -10%, rgba(159, 92, 255, 0.18), transparent 35rem),
    radial-gradient(circle at 95% 14%, rgba(243, 81, 199, 0.08), transparent 30rem),
    var(--bg);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.25;
  background-image: linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

button,
input,
select {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(200, 154, 255, 0.55);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 0 4.5vw;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 7, 17, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(159, 92, 255, 0.28));
}

.brand > span {
  display: flex;
  gap: 7px;
  align-items: baseline;
}

.brand strong {
  font-size: 1.16rem;
  letter-spacing: -0.02em;
}

.brand small {
  color: var(--purple-light);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.text-link {
  color: #d9c9ed;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover {
  color: white;
}

.page-shell,
.host-shell,
.viewer-shell {
  width: min(1220px, calc(100% - 40px));
  margin: 0 auto;
}

.host-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 56px;
  align-items: center;
  padding: 68px 0 44px;
}

.eyebrow {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  color: var(--purple-light);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(110, 231, 168, 0.09), 0 0 18px rgba(110, 231, 168, 0.55);
}

.status-dot.is-warning {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(245, 191, 98, 0.08), 0 0 18px rgba(245, 191, 98, 0.35);
}

.host-hero h1,
.watch-header h1,
.join-card h1 {
  margin: 18px 0 14px;
  font-size: clamp(2.45rem, 6vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.host-hero h1 span {
  color: transparent;
  background: linear-gradient(100deg, var(--purple-light), var(--pink));
  background-clip: text;
}

.host-hero p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.7;
}

.architecture-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 0.8fr 1fr;
  gap: 15px;
  align-items: center;
  min-height: 180px;
  padding: 26px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(46, 27, 72, 0.76), rgba(22, 14, 34, 0.88));
  box-shadow: var(--shadow);
}

.architecture-card:has(> img) {
  grid-template-columns: 96px minmax(0, 1fr);
}

.architecture-card > img {
  position: relative;
  z-index: 1;
  width: 88px;
  height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 16px 28px rgba(159, 92, 255, 0.28));
}

.architecture-card::after {
  position: absolute;
  top: -55px;
  left: 30%;
  width: 190px;
  height: 120px;
  border-radius: 50%;
  background: rgba(159, 92, 255, 0.23);
  filter: blur(40px);
  content: "";
}

.architecture-card > div {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
}

.architecture-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 8px;
  place-items: center;
  border: 1px solid rgba(200, 154, 255, 0.3);
  border-radius: 16px;
  color: var(--purple-light);
  background: rgba(159, 92, 255, 0.12);
  font-size: 1.5rem;
}

.architecture-card strong {
  font-size: 0.93rem;
}

.architecture-card small {
  color: var(--muted);
  font-size: 0.68rem;
}

.direct-line {
  position: relative;
  z-index: 1;
  color: var(--cyan);
  font-size: 0.62rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.direct-line::before,
.direct-line::after {
  display: block;
  height: 1px;
  margin: 5px 0;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  content: "";
}

.direct-notice {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 17px 20px;
  border: 1px solid rgba(245, 191, 98, 0.18);
  border-radius: 16px;
  background: rgba(245, 191, 98, 0.055);
}

.direct-notice .notice-icon {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: var(--warning);
  background: rgba(245, 191, 98, 0.1);
  font-size: 1.25rem;
}

.direct-notice > div {
  flex: 1;
}

.direct-notice strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.86rem;
}

.direct-notice p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 800;
  white-space: nowrap;
}

.badge-safe {
  color: var(--green);
  background: rgba(110, 231, 168, 0.08);
}

.host-layout {
  display: grid;
  grid-template-columns: 395px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 24px 0 68px;
}

.control-stack,
.stage-stack {
  display: grid;
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(31, 19, 47, 0.9), rgba(20, 13, 31, 0.93));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
}

.step-panel {
  padding: 22px;
  transition: opacity 180ms ease, border-color 180ms ease;
}

.step-panel.is-locked {
  opacity: 0.52;
}

.step-heading {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  margin-bottom: 19px;
}

.step-number {
  display: grid;
  flex: 0 0 auto;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid rgba(200, 154, 255, 0.28);
  border-radius: 10px;
  color: var(--purple-light);
  background: rgba(159, 92, 255, 0.09);
  font-size: 0.76rem;
  font-weight: 900;
}

.step-heading h2 {
  margin: 0 0 4px;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.step-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.field > span {
  color: #c9c0d3;
  font-size: 0.69rem;
  font-weight: 750;
}

.field select,
.field input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: rgba(9, 6, 14, 0.62);
  transition: border-color 150ms ease, background 150ms ease;
}

.field input::placeholder {
  color: var(--muted-2);
}

.field select:hover,
.field input:hover,
.field select:focus,
.field input:focus {
  border-color: rgba(200, 154, 255, 0.32);
  background: rgba(13, 8, 21, 0.88);
}

.quality-note,
.permission-note,
.inline-warning {
  margin: 11px 0 15px;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.5;
}

.inline-warning {
  color: var(--warning);
}

.stream-health {
  display: flex;
  align-items: center;
  min-height: 34px;
  margin: -5px 0 15px;
  padding: 8px 11px;
  border: 1px solid rgba(128, 245, 191, 0.16);
  border-radius: 10px;
  color: #bfe9d4;
  background: rgba(40, 164, 108, 0.08);
  font-size: 0.69rem;
  line-height: 1.45;
}

.stream-health.is-warning {
  border-color: rgba(255, 194, 102, 0.2);
  color: var(--warning);
  background: rgba(255, 164, 40, 0.08);
}

.stream-health.is-danger {
  border-color: rgba(255, 113, 135, 0.24);
  color: #ff9dad;
  background: rgba(255, 64, 97, 0.08);
}

.button {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  min-height: 45px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: white;
  font-size: 0.77rem;
  font-weight: 820;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, opacity 140ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.button-wide {
  width: 100%;
}

.button-primary {
  background: linear-gradient(110deg, #7d3fe7, #b25df5 55%, #e357c7);
  box-shadow: 0 10px 26px rgba(145, 68, 232, 0.22);
}

.button-secondary {
  border-color: rgba(200, 154, 255, 0.22);
  background: rgba(159, 92, 255, 0.11);
}

.button-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.button-danger {
  border-color: rgba(255, 106, 131, 0.24);
  color: #ff9cad;
  background: rgba(255, 106, 131, 0.08);
}

.button-icon {
  font-size: 1rem;
}

.room-code-wrap {
  position: relative;
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
  padding: 15px;
  border: 1px solid rgba(200, 154, 255, 0.22);
  border-radius: 13px;
  background: rgba(159, 92, 255, 0.07);
}

.room-code-wrap > span {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 750;
  text-transform: uppercase;
}

.room-code-wrap strong {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 1.62rem;
  letter-spacing: 0.16em;
}

.icon-button {
  position: absolute;
  right: 12px;
  bottom: 14px;
  border: 0;
  color: var(--purple-light);
  background: transparent;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
}

.icon-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.preview-panel {
  overflow: hidden;
}

.panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 55px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.panel-bar > div {
  display: flex;
  gap: 10px;
  align-items: center;
}

.panel-bar strong {
  font-size: 0.78rem;
}

.panel-bar > span {
  color: var(--muted);
  font-size: 0.68rem;
}

.live-pill {
  display: inline-flex;
  min-height: 22px;
  padding: 0 8px;
  align-items: center;
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.live-pill.is-live {
  color: white;
  background: #e34768;
  box-shadow: 0 0 20px rgba(227, 71, 104, 0.24);
}

.video-frame {
  position: relative;
  display: grid;
  min-height: 390px;
  overflow: hidden;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(93, 50, 137, 0.12), transparent 50%),
    #07050a;
}

.video-frame video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: #000;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
}

.video-placeholder img {
  margin-bottom: 8px;
  object-fit: contain;
  opacity: 0.72;
  filter: drop-shadow(0 14px 30px rgba(159, 92, 255, 0.2));
}

.video-placeholder strong {
  font-size: 0.9rem;
}

.video-placeholder span {
  max-width: 360px;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.5;
}

.participants-panel {
  overflow: hidden;
}

.viewer-count {
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--purple-light);
  background: rgba(159, 92, 255, 0.09);
  font-size: 0.62rem;
  font-weight: 800;
}

.participants-list {
  min-height: 100px;
  padding: 14px;
}

.empty-state {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 72px;
  justify-content: center;
  color: var(--muted-2);
}

.empty-state p {
  margin: 0;
  font-size: 0.72rem;
}

.participant {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.participant + .participant {
  margin-top: 8px;
}

.participant-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  color: var(--purple-light);
  background: rgba(159, 92, 255, 0.11);
  font-size: 0.75rem;
  font-weight: 900;
}

.participant-copy {
  display: grid;
  flex: 1;
  gap: 2px;
}

.participant strong {
  font-size: 0.75rem;
}

.participant small {
  color: var(--muted);
  font-size: 0.64rem;
}

.participant-state {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 10px rgba(245, 191, 98, 0.35);
}

.participant-state.connected {
  background: var(--green);
  box-shadow: 0 0 10px rgba(110, 231, 168, 0.4);
}

.participant-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.participant-action {
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.62rem;
  font-weight: 800;
  cursor: pointer;
}

.participant-action.approve {
  border-color: rgba(110, 231, 168, 0.22);
  color: var(--green);
  background: rgba(110, 231, 168, 0.07);
}

.participant-action.reject:hover {
  border-color: rgba(255, 106, 131, 0.26);
  color: var(--danger);
}

.technical-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--line);
}

.technical-strip > div {
  display: grid;
  gap: 4px;
  padding: 14px;
  text-align: center;
  background: rgba(20, 13, 31, 0.96);
}

.technical-strip span {
  color: var(--muted-2);
  font-size: 0.58rem;
  font-weight: 750;
  text-transform: uppercase;
}

.technical-strip strong {
  color: #d9cbe9;
  font-size: 0.68rem;
}

.close-room {
  justify-self: end;
  padding: 7px 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.68rem;
  cursor: pointer;
}

.close-room:hover {
  color: var(--danger);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  max-width: min(380px, calc(100vw - 40px));
  padding: 13px 16px;
  border: 1px solid rgba(200, 154, 255, 0.24);
  border-radius: 13px;
  color: var(--text);
  background: rgba(30, 18, 47, 0.96);
  box-shadow: var(--shadow);
  font-size: 0.75rem;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  border-color: rgba(255, 106, 131, 0.32);
}

.footer {
  display: flex;
  justify-content: space-between;
  min-height: 68px;
  padding: 24px 4.5vw;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 0.65rem;
}

/* Viewer */
.viewer-shell {
  display: grid;
  min-height: calc(100vh - 143px);
  padding: 62px 0;
  place-items: center;
}

.join-card {
  width: min(460px, 100%);
  padding: 34px;
  text-align: center;
}

.join-mascot {
  display: block;
  margin: 20px auto 0;
  object-fit: contain;
  filter: drop-shadow(0 18px 32px rgba(159, 92, 255, 0.22));
}

.join-card h1 {
  margin: 12px auto;
  font-size: clamp(2rem, 6vw, 3.1rem);
}

.join-card > p {
  max-width: 340px;
  margin: 0 auto 24px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.join-card form {
  display: grid;
  gap: 15px;
  text-align: left;
}

.join-card .field input {
  height: 50px;
}

#code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.mini-direct-note {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--warning);
  text-align: left;
}

.mini-direct-note > span {
  font-size: 1.1rem;
}

.mini-direct-note p {
  display: grid;
  gap: 2px;
  margin: 0;
  color: var(--muted);
  font-size: 0.66rem;
}

.mini-direct-note strong {
  color: #e7d9f5;
  font-size: 0.7rem;
}

.watch-area {
  width: 100%;
}

.watch-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 20px;
}

.watch-header h1 {
  margin: 9px 0 0;
  font-size: clamp(2rem, 5vw, 3.6rem);
}

.watch-header h1 span {
  color: var(--purple-light);
  font-family: "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.07em;
}

.watch-panel {
  overflow: hidden;
}

.share-from-viewer {
  margin-top: 15px;
  padding: 22px;
}

.share-from-viewer .field-grid {
  margin-top: 18px;
}

.preview-controls {
  border-top: 1px solid var(--line);
}

.capture-tip {
  margin: 0;
  padding: 11px 18px 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.018);
  font-size: 0.64rem;
  line-height: 1.55;
  text-align: center;
}

.capture-tip strong {
  color: #eadcff;
}

.viewer-frame {
  min-height: min(65vh, 690px);
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 67px;
  padding: 10px 15px 10px 20px;
  border-top: 1px solid var(--line);
}

.connection-kind {
  display: grid;
  grid-template-columns: 10px auto;
  column-gap: 9px;
  align-items: center;
}

.connection-kind .status-dot {
  grid-row: 1 / 3;
}

.connection-kind strong {
  font-size: 0.72rem;
}

.connection-kind small {
  color: var(--muted);
  font-size: 0.61rem;
}

.player-actions {
  display: flex;
  gap: 9px;
}

.direct-notice.compact {
  margin-top: 15px;
}

/* Concord 0.5 · salas públicas e múltiplas telas */
.form-stack {
  display: grid;
  gap: 15px;
}

.access-choice {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.access-choice legend {
  margin-bottom: 7px;
  color: #c9c0d3;
  font-size: 0.69rem;
  font-weight: 750;
}

.access-choice label {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(9, 6, 14, 0.45);
  cursor: pointer;
}

.access-choice label:has(input:checked) {
  border-color: rgba(200, 154, 255, 0.35);
  background: rgba(159, 92, 255, 0.09);
}

.access-choice input {
  accent-color: var(--purple);
}

.access-choice label > span {
  display: grid;
  gap: 2px;
}

.access-choice strong {
  font-size: 0.72rem;
}

.access-choice small,
.field small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 500;
}

.invite-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.4;
}

.workspace-stack {
  min-width: 0;
}

.streams-panel {
  min-width: 0;
  overflow: hidden;
}

.streams-empty {
  display: flex;
  min-height: 330px;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 30px;
  color: var(--muted);
  text-align: center;
  background: radial-gradient(circle at center, rgba(93, 50, 137, 0.13), transparent 48%), #07050a;
}

.streams-empty img {
  margin-bottom: 8px;
  object-fit: contain;
  opacity: 0.72;
  filter: drop-shadow(0 15px 32px rgba(159, 92, 255, 0.2));
}

.streams-empty strong {
  color: var(--text);
  font-size: 0.95rem;
}

.streams-empty span {
  font-size: 0.72rem;
}

.streams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 14px;
  padding: 14px;
  background: rgba(4, 3, 7, 0.55);
}

.streams-grid:empty {
  display: none;
}

.stream-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #09070d;
}

.stream-card.is-connecting {
  border-color: rgba(245, 191, 98, 0.22);
}

.stream-card-heading,
.stream-card-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 8px 11px;
}

.stream-card-heading {
  border-bottom: 1px solid var(--line);
}

.stream-card-heading > div {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.stream-card-heading strong {
  overflow: hidden;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-card-heading > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.62rem;
}

.stream-media {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  place-items: center;
  background: #000;
}

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

.stream-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--muted);
  background: radial-gradient(circle, rgba(78, 42, 116, 0.2), rgba(3, 2, 5, 0.84));
  font-size: 0.68rem;
  text-align: center;
}

.stream-placeholder img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  opacity: 0.65;
}

.stream-card-footer {
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
}

.stream-status {
  flex: 1 1 150px;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.35;
}

.stream-actions {
  display: flex;
  gap: 7px;
}

.button-small {
  min-height: 33px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 0.62rem;
}

.room-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 15px;
  align-items: start;
}

.room-columns .share-from-viewer {
  margin-top: 15px;
}

.room-columns .participants-panel {
  margin-top: 15px;
}

.watch-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

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

.technical-strip {
  grid-template-columns: repeat(4, 1fr);
}

#join-password-wrap.is-required input {
  border-color: rgba(245, 191, 98, 0.42);
}

@media (max-width: 900px) {
  .host-hero {
    grid-template-columns: 1fr;
    gap: 30px;
    padding-top: 48px;
  }

  .architecture-card {
    max-width: 600px;
  }

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

  .control-stack {
    grid-template-columns: repeat(2, 1fr);
  }

  .control-stack .step-panel:last-child {
    grid-column: 1 / -1;
  }

  .stage-stack {
    grid-row: 1;
  }

  .workspace-stack {
    grid-row: auto;
  }

  .room-columns {
    grid-template-columns: 1fr;
  }

  .room-columns .participants-panel {
    margin-top: 0;
  }
}

@media (max-width: 640px) {
  .topbar {
    min-height: 66px;
    padding: 0 18px;
  }

  .brand img {
    width: 36px;
    height: 36px;
  }

  .brand > span {
    gap: 5px;
  }

  .brand small {
    font-size: 0.57rem;
  }

  .text-link {
    font-size: 0.7rem;
  }

  .page-shell,
  .host-shell,
  .viewer-shell {
    width: min(100% - 24px, 1220px);
  }

  .host-hero {
    padding: 40px 2px 30px;
  }

  .host-hero h1 {
    font-size: clamp(2.5rem, 13vw, 4rem);
  }

  .architecture-card {
    grid-template-columns: 1fr;
  }

  .architecture-card:has(> img) {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .direct-line {
    width: 70%;
    margin: 0 auto;
  }

  .direct-notice {
    align-items: flex-start;
  }

  .direct-notice .badge {
    display: none;
  }

  .control-stack {
    grid-template-columns: 1fr;
  }

  .control-stack .step-panel:last-child {
    grid-column: auto;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .streams-grid {
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .streams-empty {
    min-height: 260px;
  }

  .stream-card-heading,
  .stream-card-footer {
    align-items: flex-start;
  }

  .stream-actions,
  .stream-actions .button {
    width: 100%;
  }

  .invite-meta,
  .watch-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .video-frame {
    min-height: 240px;
  }

  .technical-strip {
    grid-template-columns: 1fr;
  }

  .footer {
    display: grid;
    gap: 6px;
    padding: 22px 18px;
  }

  .join-card {
    padding: 28px 20px;
  }

  .viewer-shell {
    padding: 34px 0;
  }

  .watch-header {
    align-items: center;
  }

  .watch-header h1 {
    font-size: 1.8rem;
  }

  .player-controls {
    display: grid;
    gap: 12px;
  }

  .player-actions,
  .player-actions .button {
    width: 100%;
  }

  .toast {
    right: 12px;
    bottom: 12px;
  }
}

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