/* A compact shared player, with room for the live conversation and controls. */
body.immersive-stage #roomsPanel .room-stage > .room-youtube:not(:fullscreen):not(.room-youtube-fullscreen),
body.immersive-stage #roomsPanel .room-stage > #sharedStageVideo:not(:fullscreen) {
  top:calc(76px + env(safe-area-inset-top,0px));
  right:auto;
  bottom:auto;
  left:50%;
  width:min(760px,calc(100% - 32px),calc(max(96px,100dvh - var(--live-chat-height) - 190px - var(--chat-keyboard-inset,0px) - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)) * 1.77778));
  height:auto;
  max-width:calc(100% - 32px);
  max-height:none;
  aspect-ratio:16 / 9;
  transform:translateX(-50%);
  box-sizing:border-box;
  border:1px solid #ffffff3b;
  border-radius:22px;
  overflow:hidden;
  background:#070709;
  box-shadow:0 14px 40px #0005;
}
body.immersive-stage #roomsPanel .room-stage > #sharedStageVideo:not(:fullscreen) { object-fit:contain; object-position:center; }
body.immersive-stage .room-youtube:not(:fullscreen):not(.room-youtube-fullscreen) .room-youtube-player { border-radius:inherit; }
body .room-youtube-search-dialog,
body #videoSourcesPanel.netflix-session-panel {
  width:min(520px,calc(100vw - 28px));
  box-sizing:border-box;
  max-height:calc(100dvh - 32px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));
  padding:20px;
  border-radius:24px;
  overscroll-behavior:contain;
}
body #videoSourcesPanel.netflix-session-panel { width:min(440px,calc(100vw - 28px)); }
body .room-youtube-search-dialog .room-youtube-heading { margin-bottom:12px; }
body .room-youtube-search-dialog .room-youtube-heading h2,
body #videoSourcesPanel h2 { font-size:21px; }
body .room-youtube-search-dialog input,
body #videoSourcesPanel input { min-height:46px; padding:10px 12px; border-radius:14px; font-size:16px; }
body .room-youtube-search-dialog .room-youtube-search-submit,
body #videoSourcesPanel #videoSourceSave { min-height:44px; border-radius:16px; }
body .room-youtube-search-dialog .room-youtube-results { gap:8px; }
body .room-youtube-search-dialog .room-youtube-result { grid-template-columns:104px minmax(0,1fr); gap:10px; min-height:72px; border-radius:14px; }
body .room-youtube-search-dialog .room-youtube-result img { width:104px; border-radius:9px; }
body .room-youtube-search-dialog .room-youtube-actions { margin-top:12px; }
body #videoSourcesPanel .video-source-choices { gap:9px; margin:16px 0; }
body #videoSourcesPanel .video-source-choices button { min-height:48px; border-radius:16px; }
body #videoSourcesPanel header button { min-width:44px; min-height:44px; }
@media(max-width:760px) {
  body.immersive-stage #roomsPanel .room-stage > .room-youtube:not(:fullscreen):not(.room-youtube-fullscreen),
  body.immersive-stage #roomsPanel .room-stage > #sharedStageVideo:not(:fullscreen) { border-radius:18px; }
  body .room-youtube-search-dialog,
  body #videoSourcesPanel.netflix-session-panel { padding:16px; }
}
@media(max-width:360px) {
  body .room-youtube-search-dialog .room-youtube-result { grid-template-columns:84px minmax(0,1fr); gap:8px; }
  body .room-youtube-search-dialog .room-youtube-result img { width:84px; }
}

body .room-youtube-search-fallback { margin-top:12px; padding:12px; border:1px solid #ffbc7a44; border-radius:16px; background:#ffffff08; }
body .room-youtube-search-fallback[hidden] { display:none; }
body .room-youtube-search-fallback .room-youtube-external-search { display:flex; justify-content:center; align-items:center; min-height:44px; border-radius:14px; text-decoration:none; }
body .room-youtube-search-fallback .hint { margin-bottom:0; }

/* YouTube requires an API viewport of at least 200x200. */
body.immersive-stage #roomsPanel .room-stage > .room-youtube:not(:fullscreen):not(.room-youtube-fullscreen) { min-width:200px; min-height:200px; border:0; box-shadow:0 0 0 1px #ffffff3b,0 14px 40px #0005; }
@media(max-height:500px) {
  body.immersive-stage { --live-chat-height:120px; }
  body.immersive-stage #roomsPanel .room-stage > .room-youtube:not(:fullscreen):not(.room-youtube-fullscreen) { top:calc(48px + env(safe-area-inset-top,0px)); }
}
