/* Mini-player while a pop-up is open, plus the Random remote button.
   Moves the existing #player with CSS only (the iframe is never reloaded).
   Nothing is laid over the YouTube player. */
body.hbn-pip.tv-mode .watch {
  z-index: 90;
  background: transparent !important;
  pointer-events: none;
}
body.hbn-pip.tv-mode .player-win,
body.hbn-pip.tv-mode .player-win > .window-body,
body.hbn-pip.tv-mode .tv-frame {
  overflow: visible !important;
  background: transparent !important;
  pointer-events: none;
}
body.hbn-pip.tv-mode .tv-side,
body.hbn-pip.tv-mode .channel-strip,
body.hbn-pip.tv-mode .tv-controls {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* The player itself sits in a corner above the pop-up (leo-pop-root is z-index 80). */
body.hbn-pip #player,
body.hbn-pip.leo-pop-dim #player,
body.hbn-pop-open.hbn-pip #player {
  position: fixed !important;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: auto !important;
  top: auto !important;
  width: 320px !important;
  height: 180px !important;
  max-width: calc(100vw - 24px) !important;
  max-height: none !important;
  min-height: 0 !important;
  aspect-ratio: 16 / 9 !important;
  margin: 0 !important;
  z-index: 91 !important;
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: #000 !important;
  border: 2px solid #172554 !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  overflow: hidden !important;
}
html[data-theme="night"] body.hbn-pip #player {
  border-color: #ffffff;
}
body.hbn-pip #yt-host,
body.hbn-pip #yt-host iframe,
body.hbn-pip #yt-player,
body.hbn-pip #pd-video,
body.hbn-pip #pd-shield,
body.hbn-pip #test-pattern,
body.hbn-pip #bumper-slot,
body.hbn-pip.leo-pop-dim #yt-host,
body.hbn-pip.leo-pop-dim #yt-host iframe,
body.hbn-pip.leo-pop-dim #yt-player,
body.hbn-pip.leo-pop-dim #pd-video,
body.hbn-pip.leo-pop-dim #pd-shield,
body.hbn-pip.leo-pop-dim #test-pattern,
body.hbn-pip.leo-pop-dim #bumper-slot,
body.hbn-pip.leo-pop-dim #tv-frame .player {
  visibility: visible !important;
  opacity: 1 !important;
}
body.hbn-pip #yt-host,
body.hbn-pip #yt-host iframe,
body.hbn-pip #yt-player,
body.hbn-pip #pd-video {
  pointer-events: auto !important;
}

@media (max-width: 760px) {
  body.hbn-pip #player,
  body.hbn-pip.leo-pop-dim #player,
  body.hbn-pop-open.hbn-pip #player {
    width: 200px !important;
    height: 112px !important;
    right: calc(10px + env(safe-area-inset-right, 0px));
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
}

body.tv-mode.tv-nobar .tv-remote .remote-btn-random {
  font: 700 10px "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}
body.kids #hbn-random,
body.kids .remote-btn-random { display: none !important; }

body.tv-mode.tv-nobar .tv-remote .remote-row-extra {
  flex-wrap: wrap;
  max-width: 100%;
  box-sizing: border-box;
}

/* Keep every modal pop-up clear of the corner mini-player
   (320x180 desktop, 16px from the edges; 200x112 iPhone, 10px from the edges).
   Desktop: inset the pop-up window itself from the right (player width + gap).
   Bottom padding alone is not enough, because right-hand columns such as the
   Finance DAX/CAC change values sit under the player as the list scrolls.
   iPhone: full-width sheet, so keep bottom clearance instead.
   Chat's side-docked pop-up is excluded. Not in Jolie's files.
   The mini-player is the existing #player, moved by CSS; nothing is laid over it. */
@media (min-width: 761px) {
  body.hbn-pip:not(.leo-pop-side) #leo-pop-window {
    top: 24px;
    left: 24px;
    right: calc(320px + 16px + 16px);
    bottom: 24px;
    transform: none;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
  }
}
@media (max-width: 760px) {
  body.hbn-pip:not(.leo-pop-side) #leo-pop-body {
    padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px));
  }
  body.hbn-pip:not(.leo-pop-side) #leo-pop-body:has(.hbn-news-paper),
  body.hbn-pip:not(.leo-pop-side) #leo-pop-body:has(.hbn-legal-paper),
  body.hbn-pip:not(.leo-pop-side) #leo-pop-body:has(.hbn-shop-paper),
  body.hbn-pip:not(.leo-pop-side) #leo-pop-body:has(.hbn-world-paper) {
    padding-bottom: 0;
  }
  body.hbn-pip:not(.leo-pop-side) #leo-pop-body .hbn-news-paper,
  body.hbn-pip:not(.leo-pop-side) #leo-pop-body .hbn-legal-paper,
  body.hbn-pip:not(.leo-pop-side) #leo-pop-body .hbn-shop-paper,
  body.hbn-pip:not(.leo-pop-side) #leo-pop-body .hbn-world-paper {
    padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px));
  }
}

/* Shop photo lightbox. Sits above the Shop pop-up, below the corner mini-player
   so nothing is laid over the YouTube player. */
.hbn-shop-photo,
.hbn-shop-media:has(.hbn-shop-photo) {
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(23, 37, 84, 0.18);
}
.hbn-shop-lightbox {
  position: fixed;
  inset: 0;
  z-index: 89;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 24px;
  padding-bottom: calc(24px + 180px + 16px);
  background: rgba(0, 0, 0, 0.82);
  -webkit-tap-highlight-color: transparent;
}
@media (max-width: 760px) {
  .hbn-shop-lightbox {
    padding: 16px;
    padding-bottom: calc(16px + 112px + 10px);
  }
}
.hbn-shop-lightbox-img {
  display: block;
  max-width: min(800px, 100%);
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.hbn-shop-lightbox-close {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top, 0px));
  right: calc(8px + env(safe-area-inset-right, 0px));
  z-index: 90;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #172554;
  color: #fff;
  font: 700 28px/44px "Helvetica Neue", Helvetica, Arial, sans-serif;
  cursor: pointer;
  box-shadow: none;
}
html[data-theme="night"] .hbn-shop-lightbox-close {
  background: #ffffff;
  color: #111;
}

/* Visitor local time, immediately beside the IP weather readout. */
body.tv-mode .hbn-wx-clock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  white-space: nowrap;
  min-width: 0;
}
body.tv-mode .hbn-local-time {
  font: 600 12px/1 "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: inherit;
  opacity: 0.9;
}
@media (max-width: 760px) {
  body.tv-mode .hbn-wx-clock { gap: 4px; }
  body.tv-mode .hbn-local-time { font-size: 10px; letter-spacing: 0; }
  /* Drop the weekday on iPhone so "Nov 25 · 10:37 PM" stays on one line. */
  body.tv-mode .hbn-local-dow { display: none; }
}
/* Chat in the side panel uses the site TV palette in styles.css
   (same --tv-* tokens, title bar and buttons as the side tabs).
   The separate futuristic/AIM skin was removed so it matches
   World, Games, Radio, SOS and the rest of the site. */
