/* Camera setup on lives, phones: while Go Live, Effects or the camera preview is open, your picture sits in a window
   between the top bar and the open sheet (live_setup_controller.js measures --sheet-h and --setup-top). The window
   shows the whole 9:16 frame viewers get. Desktop already docks those sheets beside the picture (live_room.css).
   `:is(.is-setup, #live-setup)` gives id weight over the older effects rules; nothing has that id. */

.pf\:live-room {
  --setup-top: calc(3.6rem + env(safe-area-inset-top, 0px));
  --sheet-h: 46dvh;
  --setup-gap: 0.5rem;
}
.pf\:live-setup-frame,
.pf\:live-setup-chat { display: none; }

@media (max-width: 63.99rem) {
  .pf\:live-room:is(.is-setup, #live-setup) .pf\:live-video {
    inset: auto;
    top: var(--setup-top);
    left: 0.6rem;
    width: calc(100% - 1.2rem);
    height: calc(100% - var(--setup-top) - var(--sheet-h) - var(--setup-gap));
    border-radius: 1.25rem;
    object-fit: contain !important;
    object-position: 50% 50%;
    background: #050505;
    transition: height 0.3s ease;
  }
  /* Everything that would sit over the window steps aside; the HUD, the picture, the sheets and the frame stay. */
  .pf\:live-room.is-setup > :not(.pf\:live-video, canvas, .pf\:live-hud-top, .pf\:live-sheet, .pf\:live-sheet-backdrop, .pf\:cam-preview, .pf\:live-setup-frame, .pf\:live-setup-chat, .pf\:camera-warming, .pf\:camera-blocked, dialog) {
    visibility: hidden;
  }
  .pf\:live-room.is-setup .pf\:live-sheet-backdrop { background: transparent; }
  /* The hint under Start with costs the picture two lines; the choice speaks for itself on a phone. */
  .pf\:live-go.is-setup .pf\:video-mode + .pf\:hint { display: none; }

  .pf\:live-room.is-setup .pf\:live-setup-frame {
    display: block;
    position: absolute;
    z-index: 45;
    top: var(--setup-top);
    left: 0.6rem;
    right: 0.6rem;
    bottom: calc(var(--sheet-h) + var(--setup-gap));
    pointer-events: none;
  }
  .pf\:live-setup-frame .pf\:video-self-pill { top: 0.6rem; left: 0.6rem; }
  .pf\:live-setup-frame .pf\:live-setup-fx { pointer-events: auto; }
  .pf\:live-setup-frame .pf\:live-setup-flip { right: auto; left: 0.7rem; }
  .pf\:live-room:not(.is-camera-preview):has(.pf\:live-sheet-effects.is-open) .pf\:live-setup-fx,
  .pf\:live-room.is-camera-off .pf\:live-setup-fx,
  .pf\:live-go.is-effects-tab .pf\:live-setup-fx,
  .pf\:live-room.is-camera-preview:has(.pf\:live-sheet-effects.is-open) .pf\:live-setup-fx { display: none; }
  .pf\:live-setup-guides {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    appearance: none;
    min-height: 2.25rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font: 600 0.75rem/1 Inter, system-ui, sans-serif;
    cursor: pointer;
    pointer-events: auto;
  }
  .pf\:live-setup-guides[aria-pressed="true"] { background: #fff; color: #111; }
  /* The 9:16 frame inside the window: full height, centred, as wide as the window allows. */
  .pf\:live-guides {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    translate: -50% 0;
    aspect-ratio: 9 / 16;
    max-width: 100%;
  }
  .pf\:live-guides[hidden] { display: none; }
  .pf\:live-guides i {
    position: absolute;
    border: 1.5px dashed rgba(255, 255, 255, 0.6);
    border-radius: 0.6rem;
    background: rgba(255, 255, 255, 0.06);
  }
  .pf\:live-guides .is-chat { left: 3%; bottom: 3%; width: 64%; height: 28%; }
  .pf\:live-guides .is-rail { right: 2%; bottom: 18%; width: 15%; height: 42%; }

  .pf\:live-room.is-setup .pf\:live-setup-chat:not([hidden]) {
    display: block;
    position: absolute;
    z-index: 46;
    left: 50%;
    translate: -50% 0;
    bottom: calc(var(--sheet-h) + var(--setup-gap) + 0.6rem);
    margin: 0;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(225, 29, 72, 0.92);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
  }

  /* Go Live: the setup sheet is a band at the bottom, not a floating card over the camera. */
  .pf\:live-go.is-setup .pf\:live-sheet.pf\:live-go-settings {
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 1.5rem 1.5rem 0 0;
    max-height: 54dvh;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    background: rgba(12, 12, 12, 0.97);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* The loading pill sits in the middle of the picture's window. */
  .pf\:live-room.is-setup .pf\:camera-blocked,
  .pf\:live-room.is-setup .pf\:camera-warming { top: calc(var(--setup-top) + (100% - var(--setup-top) - var(--sheet-h) - var(--setup-gap)) / 2); }

  /* Go Live's Effects tab: a taller band than the live page's effects sheet (it has a Start live footer under the
     effects), and a slimmer footer. On a 375 x 667 phone the effects had 39 px before the one-row header.
     The XS's Safari leaves 375 x 588. */
  .pf\:live-go.is-effects-tab .pf\:live-sheet.pf\:live-go-settings { height: min(60dvh, 30rem); max-height: none; padding-top: 0; }
  .pf\:live-go.is-setup .pf\:live-go-settings > .pf\:live-sheet-grip { height: 1.1rem; }
  .pf\:live-go.is-effects-tab .pf\:live-go-settings-footer { padding-top: 0.5rem; }
  .pf\:live-go.is-effects-tab .pf\:live-go-submit { padding-top: 0.6rem; padding-bottom: 0.6rem; }

  /* Camera back on, mid-live: the preview card becomes the sheet. */
  .pf\:live-room.is-setup.is-camera-preview .pf\:cam-preview {
    inset: auto 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.9rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    border-radius: 1.25rem 1.25rem 0 0;
    background: #121012;
  }
  .pf\:live-room.is-setup .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\:live-room.is-setup .pf\:cam-preview-actions { position: static; padding: 0; background: none; }
  .pf\:live-room.is-setup.is-camera-preview:has(.pf\:live-sheet-effects.is-open) .pf\:cam-preview { visibility: hidden; }
}

/* Go Live sheet's top row: Setup | Looks | Background beside the close button. The embedded effects keep their own
   Looks | Background switch for the live page's sheet; here the row above replaces it. */
.pf\:live-go-sheet-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; flex: none; }
.pf\:live-go-tabs { flex: 1 1 auto; min-width: 0; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin-bottom: 0; }
.pf\:live-go-tabs .pf\:fx-tab { min-width: 0; padding: 0 0.35rem; white-space: nowrap; }
.pf\:live-go-tabs .pf\:fx-tab[hidden] { display: none; }
.pf\:live-go-settings .pf\:fx-tabs:not(.pf\:live-go-tabs) { display: none; }
@media (max-width: 26rem) {
  .pf\:live-go-tabs .pf\:fx-tab-icon { display: none; }
  .pf\:live-go-tabs .pf\:fx-tab { font-size: 0.8rem; }
}

/* Go Live: who can watch, the gift unlock and the live goal fold under More settings. */
.pf\:live-go-more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.pf\:live-go-more > summary::-webkit-details-marker { display: none; }
.pf\:live-go-more > summary::after { content: "+"; font-size: 1.1rem; opacity: 0.7; }
.pf\:live-go-more[open] > summary::after { content: "−"; }
.pf\:live-go-more[open] > summary { margin-bottom: 1rem; }

/* The guest's join preview: the picture on top, the controls in a sheet under it; Effects push the picture up. */
.pf\:guest-preview:not([hidden]) {
  position: fixed;
  inset: 0;
  max-width: none;
  max-height: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 0.75rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  border: 0;
  border-radius: 0;
  background: #0a0a0a;
  overflow: hidden;
}
.pf\:guest-preview .pf\:guest-preview-head { margin: 0; flex: none; }
.pf\:guest-preview .pf\:guest-preview-view { flex: 1 1 auto; min-height: 10rem; width: 100%; aspect-ratio: auto; border-radius: 1.25rem; }
.pf\:guest-preview .pf\:guest-preview-view video { object-fit: contain; }
.pf\:guest-preview .pf\:guest-preview-actions { flex: none; margin: 0; }
.pf\:guest-preview .pf\:guest-preview-effects:not([hidden]) { flex: none; max-height: 42dvh; overflow-y: auto; margin: 0; }
.pf\:guest-preview > .pf\:guest-preview-actions:last-child { position: static; margin: 0; padding: 0.5rem 0 0; }
@media (min-width: 64rem) {
  .pf\:guest-preview:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) 24rem; grid-template-rows: auto auto 1fr auto; column-gap: 1rem; padding: 1rem; }
  .pf\:guest-preview .pf\:guest-preview-view { grid-column: 1; grid-row: 1 / span 4; }
  .pf\:guest-preview > :not(.pf\:guest-preview-view) { grid-column: 2; }
  .pf\:guest-preview .pf\:guest-preview-effects:not([hidden]) { max-height: none; }
}

/* The host's camera while the look starts: blurred (live_publisher#showWarmingCamera) with this over it, so it
   doesn't look frozen. */
.pf\:camera-warming {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font: 600 0.85rem/1.2 Inter, system-ui, sans-serif;
  white-space: nowrap;
  pointer-events: none;
}
.pf\:camera-warming[hidden] { display: none; }

/* Go Live: the camera was refused or is busy. Starts by itself once the camera is allowed. */
.pf\:camera-blocked {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  z-index: 46;
  width: min(20rem, calc(100% - 2rem));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font: 600 0.9rem/1.35 Inter, system-ui, sans-serif;
  text-align: center;
}
.pf\:camera-blocked[hidden] { display: none; }
.pf\:camera-blocked-retry {
  padding: 0.55rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font: 700 0.85rem/1 Inter, system-ui, sans-serif;
  cursor: pointer;
}
.pf\:camera-warming-spinner {
  width: 1.1rem;
  height: 1.1rem;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 999px;
  animation: pf-camera-warming 0.8s linear infinite;
}
@keyframes pf-camera-warming { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .pf\:camera-warming-spinner { animation: pf-camera-warming-pulse 1.2s ease-in-out infinite alternate; }
  @keyframes pf-camera-warming-pulse { from { opacity: 1; } to { opacity: 0.35; } }
}
