/*
  Persistent inline-player stage. See priv/static/js/kinescope-player.js.

  Holds the live `iframe.kc-inline-player` under <body>. JS positions
  the stage on top of the active `.link-preview-image-host` while it's
  visible (anchored mode), and snaps to a fixed bottom-right
  mini-player when the host scrolls out of view or the user switches
  channels (floating mode). Keeping the iframe out of the message
  scroller is what preserves PiP / playback across navigation and
  renderMessages innerHTML rebuilds.
*/

.kc-video-stage {
  position: fixed;
  display: none;
  background: #000;
  overflow: hidden;
  z-index: 150;
}
.kc-video-stage.active { display: block; }

.kc-video-stage.anchored {
  border-radius: var(--radius-m);
}

.kc-video-stage.floating {
  width: 360px;
  height: 202px;
  /* Sit clear above the channel/DM composer (~56–96 px tall depending
     on attachments + multi-line input). Discord uses the same ~120 px
     offset for its mini-player. */
  bottom: 120px;
  right: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-l);
}

.kc-video-stage iframe.kc-inline-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.kc-video-stage__close {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 26px;
  height: 26px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: var(--on-accent);
  font-size: var(--font-lg);
  line-height: 1;
  cursor: pointer;
}
.kc-video-stage__close:hover { background: rgba(0, 0, 0, 0.8); }
.kc-video-stage.floating .kc-video-stage__close { display: flex; }

/* The host still occupies layout space (same width/aspect as the
   iframe) so surrounding messages don't reflow when the user
   mounts/unmounts — but its children are hidden because the persistent
   stage sits on top in anchored mode. */
.link-preview-image-host.link-preview-image-host--playing > * {
  visibility: hidden;
}
