/* Popout windows — detached tile or chat in a standalone browser window */

/* body.popout-window — higher specificity (0,1,1) beats body { display: grid } (0,0,1)
   in layout.css so the 3-column grid is suppressed in standalone popup windows. */
body.popout-window {
  display: block;
  margin: 0;
  padding: 0;
  background: #0e0e14;
  color: var(--text-primary, #ededef);
  font-family: "IBM Plex Sans", -apple-system, sans-serif;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
}

/* ── Tile popout ────────────────────────────────────────────────────────────── */

/* position: fixed + inset: 0 takes the element completely out of the body grid
   and covers the entire viewport regardless of what layout the parent uses. */
.popout-tile {
  position: fixed;
  inset: 0;
  background: #0a0a10;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.popout-tile__video {
  width: 100%;
  flex: 1;
  object-fit: contain;
  background: #0a0a10;
  display: block;
}

.popout-tile__footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  pointer-events: none;
}

.popout-tile__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.popout-tile__name {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── "Session ended" state ──────────────────────────────────────────────────── */

.popout-ended {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 2rem;
}

.popout-ended__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.popout-ended__body {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.35);
}

.popout-ended__close {
  margin-top: 8px;
}

/* ── Chat popout ────────────────────────────────────────────────────────────── */

.popout-chat {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.popout-chat .chat-panel-wrap {
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
}

/* ── Popout buttons in main UI ──────────────────────────────────────────────── */

.popout-btn {
  color: rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  pointer-events: auto;
}

.popout-btn:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.1);
}

/* Chat tab popout button — sits to the right of the tab bar */
.chat-tab--popout {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  padding: 0;
  color: rgba(255, 255, 255, 0.35);
  border-bottom: 2px solid transparent;
  text-decoration: none;
  transition: color 0.15s;
}

.chat-tab--popout:hover {
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.06);
}
