/* One-on-One camera setup: the sheet pushes your picture, it never covers it.
   While you set up (lobby, waiting, camera preview, effects), the stage has `is-setup` and your picture sits in
   its own window between the header and the top of whichever sheet is showing. The controller measures that sheet
   into --sheet-h. On desktop the sheet is a panel on the right instead.
   `:is(.is-setup, #video-setup)` gives these rules id weight, so they beat the call's small-tile rules (drag
   corner, pinch, tuck) without !important; nothing has that id. */

.pf\:video-stage {
  --setup-top: calc(4.4rem + env(safe-area-inset-top, 0px));
  --sheet-h: 40dvh;
  --setup-gap: 0.6rem;
}

/* Your picture in its window. Video and canvas do not stretch between left and right, so the size is explicit. */
.pf\:video-stage:is(.is-setup, #video-setup) :is(.pf\:video-canvas.is-preview, .pf\:video-local:not(.is-hidden-source)) {
  inset: auto;
  top: var(--setup-top);
  left: 0.7rem;
  width: calc(100% - 1.4rem);
  height: calc(100% - var(--setup-top) - var(--sheet-h) - var(--setup-gap));
  aspect-ratio: auto;
  border: 0;
  border-radius: 1.25rem;
  box-shadow: none;
  background: #050505;
  opacity: 1;
  scale: none;
  z-index: 5;
  pointer-events: none;
  transition: height 0.3s ease;
}

/* The pill and the Effects button ride on the same window. */
.pf\:video-self-frame {
  position: absolute;
  display: none;
  top: var(--setup-top);
  left: 0.7rem;
  right: 0.7rem;
  bottom: calc(var(--sheet-h) + var(--setup-gap));
  z-index: 6;
  pointer-events: none;
  transition: bottom 0.3s ease;
}
.pf\:video-stage.is-setup .pf\:video-self-frame { display: block; }
.pf\:video-self-pill {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}
.pf\:video-self-pill::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}
.pf\:video-self-pill.is-live::before { background: #e11d48; box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.3); }
.pf\:video-self-fx {
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font: 600 0.8rem/1 Inter, system-ui, sans-serif;
  cursor: pointer;
  pointer-events: auto;
}
.pf\:video-self-fx svg { width: 1rem; height: 1rem; }
.pf\:video-stage.is-camera-off .pf\:video-self-fx,
.pf\:video-stage:has(.pf\:video-effects:not([hidden])) .pf\:video-self-fx { display: none; }

/* Before a call the header is one row: coins earned and the small-window button only mean something in a call. */
.pf\:video-stage:not(.is-live) .pf\:video-earned,
.pf\:video-stage:not(.is-live) [data-video-pip-target="button"] { display: none; }
.pf\:video-stage:not(.is-live) .pf\:video-coins { flex-direction: row; align-items: center; }

/* The sheets. */
.pf\:video-stage.is-setup .pf\:video-sheet {
  justify-content: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  background: #121012;
  max-height: calc(100dvh - var(--setup-top) - 6rem);
  overflow: hidden;
}
.pf\:video-sheet-handle {
  appearance: none;
  flex: none;
  width: 100%;
  height: 1.4rem;
  margin: 0 0 -0.2rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pf\:video-sheet-handle::before {
  content: "";
  width: 2.75rem;
  height: 0.3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}
.pf\:video-stage.is-setup .pf\:video-sheet .pf\:video-mode { margin: 0; }
.pf\:video-stage.is-setup .pf\:video-sheet .pf\:video-primary { width: min(100%, 24rem); }
.pf\:video-stage.is-setup .pf\:video-people { background: transparent; border: 0; padding: 0; }
.pf\:video-stage.is-setup .pf\:video-people-list { max-height: 6.5rem; }

/* Check your camera (before a call rings) and Answer. */
.pf\:video-sheet-head { display: flex; flex-direction: column; gap: 0.2rem; width: min(100%, 24rem); text-align: left; padding-top: 0.5rem; }
.pf\:video-sheet-head h2 { margin: 0; font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; }
.pf\:video-stage .pf\:video-sheet-head p { margin: 0; font-size: 0.85rem; color: rgba(243, 244, 246, 0.7); }
.pf\:video-stage .pf\:video-sheet-note { width: min(100%, 24rem); margin: 0; text-align: left; font-size: 0.8rem; color: rgba(243, 244, 246, 0.7); }
.pf\:video-sheet-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 0.5rem; width: min(100%, 24rem); }
.pf\:video-sheet-actions > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf\:video-answer-lock {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: min(100%, 24rem);
  min-height: 2.75rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.9rem;
  background: transparent;
  color: #f3f4f6;
  font: 600 0.875rem/1.2 Inter, system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
}
.pf\:video-answer-lock svg { width: 1rem; height: 1rem; flex: none; }
.pf\:video-answer-lock span { flex: 1; }
.pf\:video-answer-lock small { color: rgba(243, 244, 246, 0.55); font-weight: 500; }
.pf\:video-answer-lock.is-set { border-color: #f59e0b; color: #f59e0b; }
.pf\:video-answer-gifts { display: flex; flex-direction: column; gap: 0.5rem; width: min(100%, 24rem); }
.pf\:video-answer-gifts[hidden] { display: none; }
.pf\:video-answer-gift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: 0.4rem; max-height: 9rem; overflow-y: auto; }
.pf\:video-answer-gift {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.5rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.pf\:video-answer-gift input { position: absolute; opacity: 0; pointer-events: none; }
.pf\:video-answer-gift img { width: 1.4rem; height: 1.4rem; object-fit: contain; flex: none; }
.pf\:video-answer-gift:has(input:checked) { border-color: #e11d48; background: rgba(225, 29, 72, 0.15); }
.pf\:video-answer-gift:has(input:focus-visible) { outline: 2px solid #f59e0b; outline-offset: 1px; }

/* Lobby pulled up to search: the list takes the screen and your picture shrinks to a live corner tile. */
.pf\:video-stage.is-sheet-up .pf\:video-sheet:not([hidden]) {
  height: calc(100dvh - var(--setup-top) - 0.5rem);
  max-height: none;
}
.pf\:video-stage.is-sheet-up .pf\:video-sheet :is(.pf\:video-mode, .pf\:video-primary, .pf\:video-people-title, .pf\:video-paypal) { display: none; }
.pf\:video-stage.is-sheet-up .pf\:video-people { flex: 1; min-height: 0; }
/* The search row is as tall as the tile beside it, so no person in the list starts under your picture. */
.pf\:video-stage.is-sheet-up .pf\:video-people-head { padding-right: 5.5rem; min-height: 5rem; align-items: flex-start; }
.pf\:video-stage.is-sheet-up .pf\:video-people-search { flex: 1; width: auto; }
.pf\:video-stage.is-sheet-up .pf\:video-people-list { max-height: none; flex: 1; }
.pf\:video-stage:is(.is-sheet-up, #video-setup) :is(.pf\:video-canvas.is-preview, .pf\:video-local:not(.is-hidden-source)) {
  inset: auto;
  top: calc(var(--setup-top) + 0.4rem);
  right: 1rem;
  left: auto;
  bottom: auto;
  width: 4.5rem;
  height: 6rem;
  border-radius: 0.9rem;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  z-index: 7;
  pointer-events: auto;
  cursor: pointer;
}
.pf\:video-stage.is-sheet-up .pf\:video-self-frame { display: none; }

/* Effects open: they are the sheet; whatever sheet was there steps aside until Done. */
.pf\:video-stage:has(.pf\:video-effects:not([hidden])) :is(.pf\:video-sheet, .pf\:video-dock, .pf\:cam-preview) { visibility: hidden; }
.pf\:video-stage.is-setup .pf\:video-effects { background: #121012; }

/* Camera back on, in a call: the preview card becomes the sheet. */
.pf\:video-stage .pf\:cam-preview {
  inset: auto 0 0 0;
  z-index: 9;
  width: min(100%, 28rem);
  margin: 0 auto;
  box-sizing: border-box;
  padding: 0.9rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  border-radius: 1.25rem 1.25rem 0 0;
  background: #121012;
}
.pf\:video-stage.is-cam-preview .pf\:cam-preview { display: flex; flex-direction: column; gap: 0.75rem; }
.pf\:video-stage .pf\:cam-preview-top {
  position: static;
  max-width: none;
  margin: 0;
  background: rgba(245, 158, 11, 0.1);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.pf\:video-stage .pf\:cam-preview-actions { position: static; padding: 0; background: none; }
.pf\:video-stage.is-cam-preview :is(.pf\:video-dock, .pf\:video-sheet) { visibility: hidden; }

/* In a call, the other person stays in view as a small tile while you fix your picture. */
.pf\:video-stage.is-live:is(.is-setup, #video-setup) .pf\:video-remote {
  inset: auto;
  top: calc(var(--setup-top) + 3rem);
  left: 1.4rem;
  width: 5rem;
  height: auto;
  aspect-ratio: 3 / 4;
  border-radius: 0.9rem;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  scale: none;
  opacity: 1;
  z-index: 7;
}
.pf\:video-stage.is-live.is-setup :is(.pf\:video-tile-tab, .pf\:video-gifts) { display: none; }
/* In a call the coin counters hang just below the header, over the window's top left: the pill moves down. */
.pf\:video-stage.is-live.is-setup .pf\:video-self-pill { top: auto; bottom: 0.7rem; }

/* Desktop: picture on the left, the sheet as a panel on the right. */
@media (min-width: 64rem) {
  .pf\:video-stage:is(.is-setup, #video-setup) :is(.pf\:video-canvas.is-preview, .pf\:video-local:not(.is-hidden-source)) {
    left: 1rem;
    width: calc(100% - 27rem);
    height: calc(100% - var(--setup-top) - 1rem);
  }
  .pf\:video-stage.is-setup .pf\:video-self-frame {
    left: 1rem;
    right: 26rem;
    bottom: 1rem;
  }
  .pf\:video-stage.is-setup :is(.pf\:video-sheet, .pf\:video-effects, .pf\:cam-preview) {
    top: var(--setup-top);
    right: 1rem;
    bottom: 1rem;
    left: auto;
    width: 24rem;
    height: auto;
    max-height: none;
    margin: 0;
    border-radius: 1.25rem;
    overflow: auto;
  }
  .pf\:video-stage.is-setup .pf\:video-sheet-handle { display: none; }
  .pf\:video-stage.is-setup .pf\:video-people { flex: 1; min-height: 0; }
  .pf\:video-stage.is-setup .pf\:video-people-list { max-height: none; flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .pf\:video-stage :is(.pf\:video-canvas, .pf\:video-local, .pf\:video-self-frame) { transition: none; }
}

/* Who's around (one_on_one_directory_controller): creators see fans waiting and their "Stay available"
   window; everyone sees creators taking One-on-Ones now. */
.pf\:video-demand { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.pf\:video-demand:not(:has(> :not([hidden]))) { display: none; }
.pf\:video-sheet p.pf\:video-demand-count { color: #fbbf24; font-weight: 700; font-size: 0.95rem; }
.pf\:video-sheet p.pf\:video-demand-missed { color: rgba(243,244,246,0.72); font-size: 0.82rem; }
.pf\:video-demand-available {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.4rem 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(34,197,94,0.16);
  border: 1px solid rgba(34,197,94,0.4);
  color: #bbf7d0;
  font-size: 0.82rem;
  font-weight: 600;
}
.pf\:video-demand-available[hidden] { display: none; }
.pf\:video-demand-stop {
  border: 0;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  background: rgba(255,255,255,0.14);
  color: #f3f4f6;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}
.pf\:video-available-btn { min-width: 14rem; }
.pf\:video-available-btn[hidden], .pf\:video-available-now[hidden] { display: none; }
.pf\:video-available-now { border-color: rgba(34,197,94,0.35); }
.pf\:video-live-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.4rem;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.25);
  vertical-align: 0.05rem;
}
.pf\:video-stage.is-sheet-up .pf\:video-sheet :is(.pf\:video-demand, .pf\:video-available-btn, .pf\:video-available-now) { display: none; }
.pf\:video-stay-dialog[open] { margin: auto; text-align: center; }
.pf\:video-stay-dialog h2 { margin: 0 0 0.4rem; font-size: 1.1rem; }
.pf\:video-stay-dialog .pf\:video-dialog-actions { flex-direction: column; align-items: stretch; }
