:root {
  --bg-canvas: #050507;
  --bg-surface: rgba(12, 12, 16, 0.96);
  --bg-surface-elevated: rgba(17, 17, 22, 0.98);
  --bg-surface-sheen: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.045) 0%,
    rgba(255, 255, 255, 0.01) 46%,
    rgba(229, 9, 20, 0.04) 100%
  );
  --bg-chat-glass: rgba(11, 11, 15, 0.62);
  --bg-chat-sheen: linear-gradient(
    160deg,
    rgba(229, 9, 20, 0.1) 0%,
    rgba(255, 255, 255, 0.025) 45%,
    rgba(185, 28, 28, 0.075) 100%
  );
  --bg-input: rgba(6, 6, 9, 0.86);

  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-hover: rgba(229, 9, 20, 0.42);
  --border-focus: rgba(239, 68, 68, 0.82);
  --inner-highlight: inset 0 1px 0 0 rgba(255, 255, 255, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);

  --accent-primary: #e50914;
  --accent-primary-hover: #ff2430;
  --accent-bright: #ff4d5a;
  --accent-foreground: #ffffff;
  --status-live: #10b981;
  --status-warn: #f59e0b;
  --status-danger: #f43f5e;

  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #8b8b96;

  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-sm: 10px;
  --radius-md: 15px;
  --radius-lg: 20px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/* Zero-CPU Deep Obsidian Black & Premium Crimson Ambient Canvas (pure static CSS, 0px blur) */
.ambient-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(50% 48% at 88% 20%, rgba(229, 9, 20, 0.2) 0%, rgba(153, 27, 27, 0.07) 44%, transparent 74%),
    radial-gradient(48% 46% at 84% 86%, rgba(190, 18, 60, 0.16) 0%, rgba(127, 29, 29, 0.05) 45%, transparent 74%),
    radial-gradient(46% 42% at 14% 12%, rgba(229, 9, 20, 0.1) 0%, transparent 66%);
}

.ambient-glow {
  display: none;
}

/* Crisp Zero-Blur Deep Carbon Surfaces outside Chat (0% CPU compositor blur load) */
.glass-card,
.glass-panel,
.glass-bar {
  background-color: var(--bg-surface);
  background-image: var(--bg-surface-sheen);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--inner-highlight), 0 22px 50px -26px rgba(0, 0, 0, 0.95);
}

.glass-card {
  border-radius: var(--radius-lg);
}

.glass-panel {
  border-radius: var(--radius-md);
}

/* Icons */
.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.icon-sm {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Glass Inputs */
.glass-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9375rem;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.55);
  transition: border-color 140ms var(--ease-out), background-color 140ms var(--ease-out),
    box-shadow 140ms var(--ease-out);
}

.glass-input::placeholder {
  color: var(--text-muted);
}

.glass-input:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.2);
}

.glass-input:focus-visible {
  outline: none;
  border-color: var(--border-focus);
  background: rgba(8, 8, 12, 0.96);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(229, 9, 20, 0.22);
}

.glass-input:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.mono-input {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

/* Tactile Glass & Brushed-Amber Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background-color 130ms var(--ease-out), border-color 130ms var(--ease-out),
    color 130ms var(--ease-out), box-shadow 130ms var(--ease-out), transform 70ms var(--ease-out);
}

.btn:focus-visible,
.icon-btn:focus-visible,
.tab-btn:focus-visible,
.room-code-pill:focus-visible,
.brand-compact:focus-visible,
.brand-link:focus-visible,
.viewer-ctrl-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.btn:active:not(:disabled),
.icon-btn:active:not(:disabled),
.room-code-pill:active {
  transform: scale(0.97);
}

.btn:disabled,
.icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(180deg, #ef1a25 0%, #dc0a15 55%, #b50812 100%);
  color: var(--accent-foreground);
  border-color: rgba(255, 115, 125, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), 0 10px 26px -10px rgba(229, 9, 20, 0.72);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #ff2b37 0%, #e50914 55%, #c40a15 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 12px 30px -8px rgba(229, 9, 20, 0.85);
}

.btn-secondary {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.035) 100%);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: linear-gradient(180deg, rgba(229, 9, 20, 0.16) 0%, rgba(255, 255, 255, 0.06) 100%);
  border-color: rgba(229, 9, 20, 0.48);
}

.btn-danger-active {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(244, 63, 94, 0.42);
  color: #fda4af;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.btn-danger-active:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: rgba(244, 63, 94, 0.58);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.025);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-sm {
  min-height: 36px;
  padding: 0 13px;
  font-size: 0.8125rem;
}

.btn-full {
  width: 100%;
}

.btn-icon {
  width: 44px;
  padding: 0;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 130ms var(--ease-out), border-color 130ms var(--ease-out),
    color 130ms var(--ease-out), transform 70ms var(--ease-out);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.icon-btn-danger:hover {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(244, 63, 94, 0.42);
  color: #fda4af;
}

/* ==================== CLEAN HOME VIEW ==================== */
.site-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.site-container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-top: 0;
  border-left: 0;
  border-right: 0;
}

.nav-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(155deg, rgba(229, 9, 20, 0.26) 0%, rgba(153, 27, 27, 0.1) 100%);
  border: 1px solid rgba(229, 9, 20, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: var(--accent-bright);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-mark svg {
  width: 19px;
  height: 19px;
}

.brand-mark-sm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.brand-mark-sm svg {
  width: 17px;
  height: 17px;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-main {
  flex: 1;
  display: flex;
  align-items: center;
}

.hero-section {
  padding-top: 32px;
  padding-bottom: 40px;
}

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

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-title {
  margin: 0;
  font-size: clamp(2.15rem, 4.4vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.hero-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 48ch;
}

.launcher-card {
  margin-top: 6px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.09);
}

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

.join-row .glass-input {
  flex: 1;
  min-width: 0;
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(244, 63, 94, 0.36);
  color: #fda4af;
  font-size: 0.85rem;
}

/* Theater Preview Card */
.preview-window {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.preview-topbar {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.025);
}

.preview-room-id {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-bright);
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(229, 9, 20, 0.14);
  border: 1px solid rgba(229, 9, 20, 0.35);
}

.preview-sync-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.preview-avatars {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mini-avatar {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: #09090b;
  font-size: 0.64rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.preview-body {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  min-height: 280px;
}

.preview-screen {
  background:
    radial-gradient(66% 66% at 45% 42%, rgba(229, 9, 20, 0.2) 0%, rgba(18, 8, 12, 0.72) 48%, rgba(5, 5, 7, 0.98) 78%);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border-subtle);
}

.preview-cinema-art {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.preview-screen-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(9, 10, 14, 0.72);
  border: 1px solid var(--border-subtle);
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.preview-screen-badge svg {
  color: var(--accent-primary);
}

.preview-center-play {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  margin: auto;
  background: rgba(229, 9, 20, 0.2);
  border: 1px solid rgba(255, 77, 90, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  color: var(--accent-bright);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-center-play svg {
  width: 22px;
  height: 22px;
  margin-left: 2px;
}

.preview-timeline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.preview-track {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.preview-progress {
  width: 38%;
  height: 100%;
  background: var(--accent-primary);
}

.preview-chat {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(160deg, rgba(16, 12, 16, 0.9) 0%, rgba(8, 8, 11, 0.96) 100%);
}

.preview-chat-header {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.preview-msg {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.78rem;
}

.preview-author {
  font-weight: 600;
  font-size: 0.74rem;
}

.preview-text {
  color: var(--text-primary);
  line-height: 1.4;
}

.preview-chat-fake-input {
  margin-top: auto;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(8, 10, 14, 0.65);
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* ==================== ROOM SHELL ==================== */
.room-shell {
  position: relative;
  z-index: 1;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.room-header {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  flex-shrink: 0;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-compact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.brand-name-compact {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.room-code-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(229, 9, 20, 0.34);
  background: rgba(229, 9, 20, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 130ms var(--ease-out), border-color 130ms var(--ease-out),
    transform 70ms var(--ease-out);
}

.room-code-pill:hover {
  background: rgba(229, 9, 20, 0.18);
  border-color: rgba(255, 77, 90, 0.55);
}

.mono-code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent-bright);
}

.copy-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  min-height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border-subtle);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-warn);
}

.status-dot.is-online {
  background: var(--status-live);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.65);
}

.status-dot.is-error {
  background: var(--status-danger);
}

.viewer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border-subtle);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Workspace Split */
.room-workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  padding: 14px;
}

.room-workspace.is-theater {
  grid-template-columns: minmax(0, 1fr);
}

.room-workspace.is-theater .sidebar {
  display: none;
}

.stage-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
}

.player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100dvh - 216px);
  background: #020203;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 28px 70px -28px rgba(0, 0, 0, 0.98), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.room-workspace.is-theater .player-frame {
  max-height: calc(100dvh - 200px);
}

.player-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000000;
}

.player-layer video,
.player-layer iframe,
#yt-player {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: contain;
}

.stage-empty {
  padding: 24px;
  text-align: center;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.empty-icon {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-icon svg {
  width: 26px;
  height: 26px;
}

.empty-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 600;
}

.empty-subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Lightweight Video Overlays (NO backdrop-filter over live 60fps video = 0 GPU compositor stalls!) */
.live-hud {
  position: absolute;
  top: 10px;
  left: 10px;
  max-width: 140px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(9, 10, 14, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-danger);
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.8);
}

.share-loading {
  position: absolute;
  inset: 0;
  z-index: 4;
  padding: 16px;
  text-align: center;
  background: rgba(7, 8, 12, 0.84);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

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

.spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--accent-primary);
  animation: cinesync-spin 750ms linear infinite;
}

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

.viewer-shield {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: transparent;
  cursor: default;
}

.viewer-controls {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
}

.viewer-ctrl-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(12, 14, 19, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 120ms var(--ease-out), transform 70ms var(--ease-out);
}

.viewer-ctrl-btn:hover {
  background: rgba(26, 29, 38, 0.92);
}

.viewer-ctrl-btn:active {
  transform: scale(0.94);
}

.unmute-floating {
  position: absolute;
  bottom: 54px;
  right: 10px;
  z-index: 6;
  pointer-events: auto;
}

.unmute-cta {
  padding: 0 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65);
}

/* Media Dock */
.media-dock {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.now-playing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.now-playing-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.source-badge {
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(229, 9, 20, 0.16);
  border: 1px solid rgba(255, 77, 90, 0.36);
  color: var(--accent-bright);
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.media-title-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.source-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.source-form .glass-input {
  flex: 1;
  min-width: 0;
}

.controls-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==================== EXCLUSIVE CHAT GLASSMORPHISM (DEEP BLACK & CRIMSON) ==================== */
/* ==================== CHAT SIDEBAR (static glass, no backdrop blur; see v27 layer) ==================== */
.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background-color: var(--bg-chat-glass);
  background-image: var(--bg-chat-sheen);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow:
    inset 0 1px 0 rgba(255, 228, 230, 0.16),
    inset 0 0 0 1px rgba(229, 9, 20, 0.08),
    0 24px 60px -24px rgba(0, 0, 0, 0.96);
}

.sidebar-tabs,
.mobile-tabs {
  display: flex;
  gap: 5px;
  padding: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(5, 5, 8, 0.45);
  flex-shrink: 0;
}

.mobile-tabs {
  display: none;
  border-left: 0;
  border-right: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(10, 10, 14, 0.96);
}

.tab-btn {
  flex: 1;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: background-color 120ms var(--ease-out), color 120ms var(--ease-out),
    border-color 120ms var(--ease-out);
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.tab-btn.is-active {
  background: linear-gradient(160deg, rgba(229, 9, 20, 0.24) 0%, rgba(153, 27, 27, 0.14) 100%);
  border-color: rgba(255, 77, 90, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 228, 230, 0.18);
  color: var(--text-primary);
}

.tab-count {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-primary);
}

.sidebar-panel {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.sidebar-panel.is-active {
  display: flex;
}

/* Chat Feed (layout+paint contained for zero-jank 60fps scrolling) */
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-anchor: none;
  contain: layout style paint;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-item {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 8px;
  animation: chat-pop 130ms var(--ease-out);
}

.chat-item-self {
  flex-direction: row-reverse;
}

.chat-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  max-width: 82%;
}

.chat-item-self .chat-content {
  align-items: flex-end;
}

@keyframes chat-pop {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-item-system {
  display: block;
  align-self: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #a1a1aa;
  font-size: 0.74rem;
  text-align: center;
  max-width: 92%;
}

.chat-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
}

.chat-author {
  font-size: 0.8rem;
  font-weight: 600;
}

.chat-time {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.chat-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 14px;
  color: var(--text-muted);
  user-select: none;
  flex-shrink: 0;
}

.chat-status svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chat-status.is-seen {
  color: var(--accent-bright);
}

.chat-seen-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
  padding-right: 2px;
}

.chat-seen-label {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.chat-seen-avatars {
  display: contents;
}

.seen-avatar {
  width: 16px;
  height: 16px;
  font-size: 0.5rem;
  border-width: 1px;
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: none;
}

/* Ultra-Premium Frosted Glass Typing Bubble (Dedicated Non-Overlapping Row) */
.typing-indicator {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 4px 14px 8px;
  background: transparent;
  flex-shrink: 0;
  animation: typing-in 160ms var(--ease-out);
}

@keyframes typing-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.typing-avatars {
  display: contents;
}

.typing-avatar {
  width: 24px;
  height: 24px;
  font-size: 0.62rem;
  border-width: 1.5px;
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  margin-bottom: 1px;
}

.typing-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  max-width: calc(100% - 34px);
  padding: 7px 12px;
  border-radius: 14px 14px 14px 4px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(229, 9, 20, 0.13) 100%);
  border: 1px solid rgba(255, 77, 90, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 228, 230, 0.16), 0 6px 18px -6px rgba(0, 0, 0, 0.72);
}

.typing-text {
  font-size: 0.77rem;
  line-height: 1.25;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.typing-name {
  font-weight: 600;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
  flex-shrink: 0;
  padding-top: 1px;
}

.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 7px rgba(229, 9, 20, 0.65);
  opacity: 0.45;
  animation: typing-wave 1.15s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 150ms;
}

.typing-dots span:nth-child(3) {
  animation-delay: 300ms;
}

@keyframes typing-wave {
  0%, 72%, 100% {
    opacity: 0.35;
    transform: translateY(0) scale(0.88);
  }
  36% {
    opacity: 1;
    transform: translateY(-2.5px) scale(1.1);
  }
}

.chat-bubble {
  margin: 0;
  max-width: 100%;
  padding: 8px 13px;
  border-radius: 4px 15px 15px 15px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.085) 0%, rgba(255, 255, 255, 0.035) 100%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.11), 0 4px 14px -5px rgba(0, 0, 0, 0.65);
  color: var(--text-primary);
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-item-self .chat-meta {
  justify-content: flex-end;
}

.chat-item-self .chat-bubble {
  border-radius: 15px 4px 15px 15px;
  background: linear-gradient(155deg, rgba(229, 9, 20, 0.34) 0%, rgba(153, 27, 27, 0.22) 100%);
  border-color: rgba(255, 77, 90, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 228, 230, 0.22), 0 6px 18px -6px rgba(229, 9, 20, 0.32);
}

/* Composer (lightweight frosted tray inside chat glass, zero nested blur) */
.chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(6, 6, 9, 0.65);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  max-height: 96px;
  resize: none;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  line-height: 1.4;
  padding: 10px 15px;
  border-radius: 22px;
}

.chat-input::-webkit-scrollbar {
  display: none;
}

#chat-send-btn {
  border-radius: 50%;
  transition: opacity 120ms var(--ease-out), background-color 120ms var(--ease-out),
    transform 70ms var(--ease-out);
}

#chat-send-btn.is-empty {
  opacity: 0.42;
}

/* Viewers */
.profile-row {
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.rename-form {
  display: flex;
  gap: 8px;
}

.viewers-list {
  list-style: none;
  margin: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  contain: layout style;
  flex: 1;
}

.viewer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.06) 0%, rgba(12, 12, 16, 0.45) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.viewer-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-avatar {
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #09090b;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.user-avatar.is-host-avatar {
  border-color: rgba(255, 77, 90, 0.9);
  box-shadow: 0 0 0 1px rgba(229, 9, 20, 0.45);
}

.user-avatar-fallback {
  line-height: 1;
  user-select: none;
}

.user-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.viewer-avatar {
  width: 34px;
  height: 34px;
  font-size: 0.78rem;
}

.chat-avatar {
  width: 26px;
  height: 26px;
  font-size: 0.66rem;
  margin-bottom: 2px;
}

.viewer-name-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.viewer-name {
  font-size: 0.875rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(229, 9, 20, 0.18);
  border: 1px solid rgba(255, 77, 90, 0.4);
  color: var(--accent-bright);
  flex-shrink: 0;
}

.you-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Modals (zero backdrop-filter outside chat = 0 CPU blur overhead) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 380px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: var(--bg-surface-elevated);
  border-color: rgba(255, 255, 255, 0.14);
}

.modal-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-subtitle {
  margin: -8px 0 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.modal-actions .btn {
  flex: 1;
}

/* Toast (lightweight solid-translucent glass, no expensive blur) */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 380px);
  pointer-events: none;
}

.toast {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  background: rgba(20, 22, 29, 0.95);
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 12px 32px rgba(0, 0, 0, 0.6);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}

.toast-error {
  border-color: rgba(244, 63, 94, 0.45);
  color: #fda4af;
}

/* ==================== MOBILE RESPONSIVE (< 960px) ==================== */
@media (max-width: 959px) {
  .desktop-only {
    display: none !important;
  }

  .site-container {
    padding: 0 16px;
  }

  .hero-section {
    padding-top: 24px;
    padding-bottom: 32px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .join-row {
    flex-direction: column;
  }

  .join-row .btn {
    width: 100%;
  }

  /* Room Mobile Layout locked to visual viewport */
  .room-shell {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--vvt, 0px);
    height: var(--vvh, 100dvh);
    overflow: hidden;
  }

  .room-header {
    height: 52px;
    padding: 0 10px;
  }

  .brand-name-compact,
  .copy-label,
  .status-text {
    display: none;
  }

  .status-indicator {
    padding: 0 8px;
  }

  .room-workspace {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    overflow: hidden;
  }

  .stage-column {
    display: contents;
  }

  .player-frame {
    order: 1;
    flex-shrink: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    max-height: 40dvh;
    box-shadow: none;
  }

  body.keyboard-open .room-header,
  body.keyboard-open .mobile-tabs {
    display: none;
  }

  body.keyboard-open .player-frame {
    aspect-ratio: auto;
    height: clamp(148px, 42%, 215px);
    max-height: 46%;
  }

  .chat-input {
    font-size: 16px; /* Prevents iOS Safari auto-zoom */
  }

  body.keyboard-open .chat-messages {
    padding: 8px 12px;
    gap: 6px;
  }

  body.keyboard-open .typing-indicator {
    padding: 2px 12px 6px;
  }

  body.keyboard-open .chat-input-bar {
    padding: 6px 10px;
  }

  body.keyboard-open .chat-input {
    min-height: 40px;
    padding: 8px 14px;
  }

  body.keyboard-open .btn-icon {
    min-height: 40px;
    height: 40px;
    width: 40px;
  }

  .mobile-tabs {
    order: 2;
    flex-shrink: 0;
    display: flex;
  }

  .tab-btn {
    min-height: 44px;
  }

  .media-dock {
    order: 3;
    display: none;
    border-radius: 0;
    border: 0;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
  }

  .room-workspace[data-mobile-view="media"] .media-dock {
    display: flex;
  }

  .room-workspace[data-mobile-view="media"] .sidebar {
    display: none;
  }

  .sidebar {
    order: 3;
    flex: 1;
    min-height: 0;
    border-radius: 0;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(10, 10, 14, 0.68);
    background-image: var(--bg-chat-sheen);
    box-shadow: inset 0 1px 0 rgba(255, 228, 230, 0.12);
  }

  .source-form {
    flex-wrap: wrap;
  }

  .source-form .glass-input {
    flex: 1 1 100%;
  }

  .source-form .btn {
    flex: 1;
  }
}

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

/* ==================== PREMIUM STATIC GLASS (v27) ====================
   Glassmorphism without runtime blur: the backdrop is a static, already-soft
   gradient, so a blur pass over it looks identical but costs GPU every frame
   the chat scrolls. Every surface below is a translucent tint + hairline edge
   + baked specular highlight. No backdrop-filter, no infinite animations. */
:root {
  --glass-fill: rgba(20, 16, 22, 0.52);
  --glass-fill-strong: rgba(18, 14, 20, 0.78);
  --glass-sheen: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.075) 0%,
    rgba(255, 255, 255, 0.018) 38%,
    rgba(255, 255, 255, 0) 60%,
    rgba(229, 9, 20, 0.07) 100%
  );
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-edge:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.015),
    inset 0 -1px 0 rgba(229, 9, 20, 0.12);
  --glass-drop: 0 30px 70px -34px rgba(0, 0, 0, 0.92);
}

/* Richer static ambient light, promoted to its own layer so it is painted once */
.ambient-backdrop {
  contain: strict;
  transform: translateZ(0);
  background:
    radial-gradient(58% 52% at 86% 10%, rgba(229, 9, 20, 0.3) 0%, rgba(153, 27, 27, 0.1) 42%, transparent 72%),
    radial-gradient(52% 50% at 92% 92%, rgba(190, 18, 60, 0.2) 0%, rgba(127, 29, 29, 0.06) 46%, transparent 74%),
    radial-gradient(44% 40% at 6% 6%, rgba(251, 113, 60, 0.1) 0%, transparent 68%),
    radial-gradient(50% 46% at 2% 96%, rgba(229, 9, 20, 0.1) 0%, transparent 70%),
    radial-gradient(130% 100% at 50% 45%, transparent 58%, rgba(0, 0, 0, 0.6) 100%),
    var(--bg-canvas);
}

/* Core glass surfaces */
.glass-card,
.glass-panel,
.glass-bar {
  background-color: var(--glass-fill);
  background-image: var(--glass-sheen);
  border-color: var(--glass-border);
  box-shadow: var(--glass-edge), var(--glass-drop);
}

.glass-bar {
  background-color: rgba(10, 8, 12, 0.62);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06), 0 12px 32px -22px rgba(0, 0, 0, 0.9);
}

/* Sticky lobby nav: content can scroll under it, so keep it denser for legibility */
.site-nav.glass-bar {
  background-color: rgba(8, 7, 10, 0.82);
}

.glass-card {
  border-radius: 22px;
}

/* Sidebar: same look as before, zero blur cost */
.sidebar {
  background-color: rgba(16, 12, 18, 0.5);
  background-image: var(--bg-chat-sheen), var(--glass-sheen);
  border-color: rgba(255, 255, 255, 0.11);
  box-shadow:
    inset 0 1px 0 rgba(255, 228, 230, 0.16),
    inset 0 0 0 1px rgba(229, 9, 20, 0.06),
    var(--glass-drop);
}

.sidebar-tabs {
  background: rgba(0, 0, 0, 0.22);
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

.chat-input-bar {
  background: rgba(0, 0, 0, 0.26);
  border-top-color: rgba(255, 255, 255, 0.07);
}

/* Inputs: recessed glass well */
.glass-input {
  background: rgba(0, 0, 0, 0.34);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.04);
}

.glass-input:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.18);
}

.glass-input:focus-visible {
  background: rgba(0, 0, 0, 0.44);
  border-color: var(--border-focus);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(229, 9, 20, 0.2);
}

/* Buttons: glossy crimson with a baked top sheen; hover lift uses transform only */
.btn-primary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 52%),
    linear-gradient(180deg, #f0202b 0%, #d40914 60%, #a8070f 100%);
  border-color: rgba(255, 128, 136, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 10px 28px -12px rgba(229, 9, 20, 0.8);
}

.btn-primary:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0) 52%),
    linear-gradient(180deg, #ff2f3b 0%, #e50914 60%, #b80811 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 14px 32px -12px rgba(229, 9, 20, 0.95);
}

.btn-secondary {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.03) 100%);
  border-color: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-secondary:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13) 0%, rgba(229, 9, 20, 0.1) 100%);
  border-color: rgba(255, 99, 110, 0.45);
}

@media (hover: hover) {
  .btn-primary:hover:not(:disabled),
  .btn-secondary:hover:not(:disabled) {
    transform: translateY(-1px);
  }
}

.icon-btn,
.status-indicator,
.viewer-pill {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.room-code-pill {
  background: linear-gradient(180deg, rgba(229, 9, 20, 0.18) 0%, rgba(229, 9, 20, 0.07) 100%);
  border-color: rgba(255, 99, 110, 0.36);
  box-shadow: inset 0 1px 0 rgba(255, 228, 230, 0.14);
}

.brand-mark {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(155deg, rgba(229, 9, 20, 0.42) 0%, rgba(127, 29, 29, 0.2) 100%);
  border-color: rgba(255, 99, 110, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 6px 18px -8px rgba(229, 9, 20, 0.7);
  color: #ffe4e6;
}

/* Hero */
.hero-eyebrow {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-live);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.hero-title-accent {
  white-space: nowrap;
  background: linear-gradient(100deg, #ffffff 0%, #ffd1d5 30%, #ff4d5a 75%, #e50914 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-chips li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
}

.hero-chips li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent-bright);
}

.launcher-card {
  padding: 26px;
}

/* Preview window gets a crimson rim light */
.preview-window {
  box-shadow: var(--glass-edge), 0 40px 90px -40px rgba(229, 9, 20, 0.45), var(--glass-drop);
}

.preview-topbar {
  background: rgba(0, 0, 0, 0.2);
}

.preview-chat {
  background: linear-gradient(160deg, rgba(16, 12, 16, 0.55) 0%, rgba(6, 6, 9, 0.7) 100%);
}

/* Player: static rim glow (painted once; video frames composite separately) */
.player-frame {
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 30px 80px -34px rgba(229, 9, 20, 0.35),
    0 28px 70px -30px rgba(0, 0, 0, 0.98);
}

.empty-icon {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(155deg, rgba(229, 9, 20, 0.22) 0%, rgba(127, 29, 29, 0.08) 100%);
  border-color: rgba(255, 99, 110, 0.36);
  color: #ff6b75;
}

/* Chat bubbles */
.chat-bubble {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.04) 100%);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 14px -6px rgba(0, 0, 0, 0.6);
}

.chat-item-self .chat-bubble {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(155deg, rgba(229, 9, 20, 0.5) 0%, rgba(153, 27, 27, 0.34) 100%);
  border-color: rgba(255, 99, 110, 0.5);
}

/* Typing dots: drop the per-frame glow, keep the cheap transform/opacity wave */
.typing-dots span {
  box-shadow: none;
}

.viewer-row {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.015) 100%);
  border-color: rgba(255, 255, 255, 0.08);
}

/* Modals and toasts */
.modal-backdrop {
  background: radial-gradient(70% 60% at 50% 45%, rgba(10, 6, 9, 0.72) 0%, rgba(0, 0, 0, 0.9) 100%);
}

.modal-card {
  background-color: var(--glass-fill-strong);
}

.toast {
  background: rgba(20, 15, 20, 0.92);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 14px 36px -10px rgba(0, 0, 0, 0.7);
}

@media (max-width: 959px) {
  .sidebar {
    background-color: rgba(12, 9, 14, 0.62);
    box-shadow: inset 0 1px 0 rgba(255, 228, 230, 0.12);
  }

  .player-frame {
    box-shadow: none;
  }

  .mobile-tabs.glass-bar {
    background-color: rgba(8, 7, 10, 0.86);
  }

  .media-dock.glass-panel {
    background-color: rgba(12, 9, 14, 0.62);
    box-shadow: none;
  }
}

/* Users who ask for less transparency get solid surfaces */
@media (prefers-reduced-transparency: reduce) {
  .glass-card,
  .glass-panel,
  .glass-bar,
  .sidebar,
  .modal-card {
    background-color: #0e0c10;
  }
}

/* ==================== CHAT REPLIES, REACTIONS, SYNC BADGES (v29) ==================== */
.chat-messages {
  position: relative; /* offsetTop anchor for jump-to-reply */
}

.chat-item {
  position: relative;
}

.chat-item.is-flash .chat-bubble {
  animation: chat-flash 1.3s var(--ease-out);
}

@keyframes chat-flash {
  0%,
  35% {
    box-shadow: 0 0 0 2px rgba(255, 77, 90, 0.75), 0 0 22px -4px rgba(229, 9, 20, 0.7);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 77, 90, 0);
  }
}

/* Reply quote above a bubble */
.chat-reply-quote {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-width: 100%;
  min-width: 0;
  padding: 5px 10px;
  border: 0;
  border-left: 2px solid var(--accent-bright);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms var(--ease-out);
}

.chat-reply-quote:hover {
  background: rgba(255, 255, 255, 0.09);
}

.chat-reply-quote:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.chat-reply-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-bright);
}

.chat-reply-text {
  font-size: 0.76rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 230px;
}

/* Hover / tap actions */
.chat-actions {
  display: flex;
  gap: 2px;
  align-self: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms var(--ease-out);
}

@media (hover: hover) {
  .chat-item:hover .chat-actions,
  .chat-item:focus-within .chat-actions {
    opacity: 1;
    pointer-events: auto;
  }
}

.chat-item.is-active .chat-actions {
  opacity: 1;
  pointer-events: auto;
}

.chat-action-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(16, 12, 18, 0.85);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 120ms var(--ease-out), border-color 120ms var(--ease-out), background-color 120ms var(--ease-out);
}

.chat-action-btn svg {
  width: 15px;
  height: 15px;
}

.chat-action-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 99, 110, 0.45);
  background: rgba(40, 16, 22, 0.92);
}

.chat-action-btn:focus-visible,
.react-picker-btn:focus-visible,
.reaction-chip:focus-visible,
.reply-cancel:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Emoji picker: solid glass (no blur), sits above the message */
.react-picker {
  position: absolute;
  bottom: calc(100% - 6px);
  left: 30px;
  z-index: 6;
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(22, 16, 22, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 12px 28px -10px rgba(0, 0, 0, 0.85);
  animation: chat-pop 120ms var(--ease-out);
}

.chat-item-self .react-picker {
  left: auto;
  right: 30px;
}

.react-picker-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 100ms var(--ease-out), transform 100ms var(--ease-out);
}

.react-picker-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.12);
}

/* Reaction chips under a bubble */
.chat-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.chat-item-self .chat-reactions {
  justify-content: flex-end;
}

.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 120ms var(--ease-out), border-color 120ms var(--ease-out);
}

.reaction-chip:hover {
  background: rgba(255, 255, 255, 0.11);
}

.reaction-chip.is-mine {
  border-color: rgba(255, 99, 110, 0.6);
  background: rgba(229, 9, 20, 0.2);
}

/* Composer reply bar */
.reply-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px;
  padding: 7px 8px 7px 12px;
  border-left: 2px solid var(--accent-bright);
  border-radius: 10px 10px 0 0;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.reply-bar-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.reply-bar-label {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.reply-bar-label strong {
  color: var(--accent-bright);
}

.reply-bar-snippet {
  font-size: 0.8rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-cancel {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.reply-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* Viewer sync badges */
.viewer-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.sync-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.sync-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.sync-badge.is-synced {
  color: #34d399;
}

.sync-badge.is-buffering {
  color: #fbbf24;
}

.sync-badge.is-behind,
.sync-badge.is-error {
  color: #fb7185;
}

.sync-badge.is-reconnecting {
  color: var(--text-muted);
}

@media (max-width: 959px) {
  .chat-reply-text {
    max-width: 180px;
  }

  .room-header .icon-btn {
    width: 36px;
    height: 36px;
  }

  .header-right {
    gap: 6px;
  }
}

/* ==================== PREMIUM REACTIONS (v30) ====================
   One-shot animations only (pop-in, bump); nothing loops. */
.react-picker {
  gap: 4px;
  padding: 6px 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0) 60%),
    rgba(24, 16, 22, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 18px 40px -14px rgba(0, 0, 0, 0.9),
    0 10px 30px -18px rgba(229, 9, 20, 0.55);
  transform-origin: 30px 100%;
  animation: picker-in 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-item-self .react-picker {
  transform-origin: calc(100% - 30px) 100%;
}

@keyframes picker-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.7);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.react-picker-btn {
  position: relative;
  width: 38px;
  height: 38px;
  font-size: 1.35rem;
  animation: emoji-in 260ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: calc(var(--i, 0) * 28ms);
  transition: transform 160ms cubic-bezier(0.34, 1.56, 0.64, 1), background-color 120ms var(--ease-out);
}

@keyframes emoji-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.5);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.react-picker-btn:hover,
.react-picker-btn:focus-visible {
  background: transparent;
  transform: translateY(-5px) scale(1.32);
}

/* Name tag above the hovered emoji */
.react-picker-btn::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%) scale(0.76);
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(10, 8, 12, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms var(--ease-out);
}

.react-picker-btn:hover::after,
.react-picker-btn:focus-visible::after {
  opacity: 1;
}

/* Your current reaction: crimson halo + dot */
.react-picker-btn.is-selected {
  background: radial-gradient(circle at 50% 40%, rgba(229, 9, 20, 0.38) 0%, rgba(229, 9, 20, 0.12) 70%);
  box-shadow: inset 0 0 0 1.5px rgba(255, 99, 110, 0.75);
}

.react-picker-btn.is-selected::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--accent-bright);
}

/* Chips */
.chat-reactions {
  gap: 5px;
  margin-top: 3px;
}

.reaction-chip {
  gap: 5px;
  min-height: 26px;
  padding: 0 9px 0 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.03) 100%),
    rgba(20, 15, 20, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 12px -6px rgba(0, 0, 0, 0.7);
  transition: transform 140ms cubic-bezier(0.34, 1.56, 0.64, 1), border-color 120ms var(--ease-out),
    background-color 120ms var(--ease-out);
}

@media (hover: hover) {
  .reaction-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.22);
  }
}

.reaction-chip.is-mine {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(155deg, rgba(229, 9, 20, 0.42) 0%, rgba(153, 27, 27, 0.3) 100%);
  border-color: rgba(255, 110, 120, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 228, 230, 0.24), 0 6px 16px -8px rgba(229, 9, 20, 0.75);
}

.reaction-glyph {
  font-size: 0.98rem;
  line-height: 1;
}

.reaction-faces {
  display: inline-flex;
  align-items: center;
}

.reaction-face {
  width: 16px;
  height: 16px;
  font-size: 0.45rem;
  border-width: 1.5px;
  border-color: rgba(20, 15, 20, 0.95);
  box-shadow: none;
}

.reaction-face + .reaction-face {
  margin-left: -6px;
}

.reaction-chip.is-mine .reaction-face {
  border-color: rgba(120, 12, 20, 0.95);
}

.reaction-count {
  font-size: 0.74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.reaction-chip.is-bump {
  animation: reaction-bump 360ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reaction-chip.is-bump .reaction-glyph {
  display: inline-block;
  animation: reaction-glyph-pop 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes reaction-bump {
  0% {
    transform: scale(0.7);
  }
  60% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes reaction-glyph-pop {
  0% {
    transform: scale(0.4) rotate(-12deg);
  }
  55% {
    transform: scale(1.35) rotate(6deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

@media (max-width: 959px) {
  .react-picker {
    left: 22px;
  }

  .chat-item-self .react-picker {
    right: 22px;
  }

  .react-picker-btn {
    width: 36px;
    height: 36px;
    font-size: 1.28rem;
  }
}
