/* ITAHUKA Video Platform v5.0.13 — Unified Video Dock
   Home, Shorts and Playlists now use the same permanent full-screen video
   canvas as Live, Videos, Schedule and Playback. Every other surface is a
   floating dock/overlay above the video. */

@media (max-width: 1180px), (pointer: coarse) {
  body[data-theme="itahuka-mobile-live-overlay"].it-unified-video-dock {
    --uvd-safe-left: max(12px, env(safe-area-inset-left));
    --uvd-safe-right: max(12px, env(safe-area-inset-right));
    --uvd-safe-bottom: env(safe-area-inset-bottom, 0px);
    --uvd-dock-height: 68px;
    overflow: hidden !important;
    background: #000 !important;
  }

  body[data-theme="itahuka-mobile-live-overlay"].it-unified-video-dock .site-header.yt-header,
  body[data-theme="itahuka-mobile-live-overlay"].it-unified-video-dock .channel-page-head,
  body[data-theme="itahuka-mobile-live-overlay"].it-unified-video-dock .global-live-alert,
  body[data-theme="itahuka-mobile-live-overlay"].it-unified-video-dock .broadcast-home-alert,
  body[data-theme="itahuka-mobile-live-overlay"].it-unified-video-dock .site-footer,
  body[data-theme="itahuka-mobile-live-overlay"].it-unified-video-dock.home-page .page-space > .container > :not(.it-live-overlay-shell):not(.mobile-bottom-nav),
  body[data-theme="itahuka-mobile-live-overlay"].it-unified-video-dock.shorts-page .page-space > .container > :not(.it-live-overlay-shell):not(.mobile-bottom-nav),
  body[data-theme="itahuka-mobile-live-overlay"].it-unified-video-dock.playlist-directory-page .page-space > .container > :not(.it-live-overlay-shell):not(.mobile-bottom-nav),
  body[data-theme="itahuka-mobile-live-overlay"].it-unified-video-dock .channel-feature,
  body[data-theme="itahuka-mobile-live-overlay"].it-unified-video-dock .content-section,
  body[data-theme="itahuka-mobile-live-overlay"].it-unified-video-dock .shorts-page-header,
  body[data-theme="itahuka-mobile-live-overlay"].it-unified-video-dock .shorts-grid,
  body[data-theme="itahuka-mobile-live-overlay"].it-unified-video-dock .playlist-directory-header,
  body[data-theme="itahuka-mobile-live-overlay"].it-unified-video-dock .channel-content-toolbar,
  body[data-theme="itahuka-mobile-live-overlay"].it-unified-video-dock .playlist-library-section,
  body[data-theme="itahuka-mobile-live-overlay"].it-unified-video-dock .playlist-signin-panel {
    display: none !important;
  }

  body[data-theme="itahuka-mobile-live-overlay"].it-unified-video-dock .site-content.public-content,
  body[data-theme="itahuka-mobile-live-overlay"].it-unified-video-dock .page-space,
  body[data-theme="itahuka-mobile-live-overlay"].it-unified-video-dock .page-space > .container {
    width: 100% !important;
    max-width: none !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  .it-unified-video-base,
  .it-unified-video-base .itahuka-linear-player,
  .it-unified-video-base .itahuka-player-stage {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-width: 100vw !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    background: #000 !important;
  }

  .it-unified-video-base .itahuka-provider-host,
  .it-unified-video-base .itahuka-provider-host iframe,
  .it-unified-video-base .it-unified-video-poster {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: max(100vw, 177.778dvh) !important;
    height: max(100dvh, 56.25vw) !important;
    min-width: 100vw !important;
    min-height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    transform: translate(-50%, -50%) !important;
    border: 0 !important;
    object-fit: cover !important;
    background-position: center !important;
    background-size: cover !important;
  }

  .it-unified-video-vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
      linear-gradient(180deg, rgba(0,0,0,.60) 0%, rgba(0,0,0,.05) 28%, rgba(0,0,0,.04) 62%, rgba(0,0,0,.68) 100%);
  }

  body[data-theme="itahuka-mobile-live-overlay"].it-unified-video-dock .mobile-live-overlay-head {
    z-index: 5400 !important;
    transition: opacity .22s ease, transform .24s ease !important;
  }

  /* The bottom navigation becomes a compact floating dock rather than a frame. */
  body[data-theme="itahuka-mobile-live-overlay"] .mobile-bottom-nav {
    left: 50% !important;
    right: auto !important;
    bottom: calc(10px + var(--uvd-safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    width: min(94vw, 760px) !important;
    height: auto !important;
    min-height: var(--uvd-dock-height, 68px) !important;
    padding: 7px 9px !important;
    border: 1px solid rgba(255,255,255,.11) !important;
    border-radius: 24px !important;
    background: rgba(5,7,11,.58) !important;
    box-shadow: 0 18px 42px rgba(0,0,0,.30) !important;
    backdrop-filter: blur(18px) !important;
    transform: translateX(-50%) !important;
    transition: opacity .22s ease, transform .24s ease !important;
  }

  body[data-theme="itahuka-mobile-live-overlay"] .mobile-bottom-nav a {
    min-height: 52px !important;
    border-radius: 17px !important;
  }

  body[data-theme="itahuka-mobile-live-overlay"].is-unified-chrome-hidden .mobile-bottom-nav {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translate(-50%, calc(100% + 34px)) !important;
  }

  body[data-theme="itahuka-mobile-live-overlay"].is-unified-chrome-hidden .mobile-live-overlay-head,
  body[data-theme="itahuka-mobile-live-overlay"].is-unified-chrome-hidden .it-live-action-group {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-18px) !important;
  }

  body[data-theme="itahuka-mobile-live-overlay"][data-overlay-major-open="1"] .mobile-bottom-nav,
  body[data-theme="itahuka-mobile-live-overlay"][data-overlay-major-open="1"] .mobile-live-overlay-head {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Unified Home tabs: For You / Shorts / Playlists. */
  .it-unified-home-tabs {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 12px;
    padding: 5px;
    overflow-x: auto;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 999px;
    background: rgba(8,10,16,.48);
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 30px rgba(0,0,0,.22);
    scrollbar-width: none;
  }
  .it-unified-home-tabs::-webkit-scrollbar { display: none; }

  .it-unified-home-tabs button {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(255,255,255,.72);
    font-size: 13px;
    font-weight: 800;
  }
  .it-unified-home-tabs button.is-active {
    background: var(--it-theme-accent, #ef233c);
    color: #fff;
    box-shadow: 0 8px 20px rgba(239,35,60,.28);
  }

  .it-unified-home-content {
    min-width: 0;
    overflow: visible;
  }

  /* Shorts float vertically but swipe horizontally above the player. */
  .it-unified-short-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, 31vw);
    gap: 12px;
    padding: 2px 2px 12px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .it-unified-short-strip::-webkit-scrollbar { display: none; }

  .it-unified-short-card {
    scroll-snap-align: center;
    min-width: 0;
    padding: 8px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px;
    background: rgba(8,10,16,.50);
    color: #fff;
    text-align: left;
    box-shadow: 0 16px 38px rgba(0,0,0,.28);
    backdrop-filter: blur(15px);
  }

  .it-unified-short-thumb {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border-radius: 14px;
    background: linear-gradient(145deg, #131927, #07120d);
  }
  .it-unified-short-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .it-unified-short-thumb i {
    position: absolute;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-style: normal;
  }
  .it-unified-short-card strong {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 9px;
    font-size: 13px;
    line-height: 1.28;
  }
  .it-unified-short-card small {
    display: block;
    margin-top: 5px;
    color: rgba(255,255,255,.64);
    font-size: 11px;
  }

  /* Playlist covers float in a horizontal dock. */
  .it-unified-playlist-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(238px, 60vw);
    gap: 12px;
    padding: 2px 2px 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .it-unified-playlist-strip::-webkit-scrollbar { display: none; }

  .it-unified-playlist-card {
    scroll-snap-align: center;
    min-width: 0;
    padding: 8px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px;
    background: rgba(8,10,16,.50);
    color: #fff;
    text-align: left;
    box-shadow: 0 16px 38px rgba(0,0,0,.28);
    backdrop-filter: blur(15px);
  }
  .it-unified-playlist-cover {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 14px;
    background: linear-gradient(145deg, #172037, #07120d);
  }
  .it-unified-playlist-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .it-unified-playlist-cover > small {
    position: absolute;
    right: 7px;
    bottom: 7px;
    min-height: 28px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(0,0,0,.72);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
  }
  .it-unified-playlist-card > span:last-child {
    display: grid;
    gap: 5px;
    padding: 10px 3px 3px;
  }
  .it-unified-playlist-card strong {
    font-size: 14px;
    line-height: 1.25;
  }
  .it-unified-playlist-card em {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: rgba(255,255,255,.64);
    font-size: 11px;
    font-style: normal;
    line-height: 1.3;
  }

  /* Home overlay uses the same floating frame-free treatment. */
  body[data-theme="itahuka-mobile-live-overlay"] .it-live-overlay-tray[data-overlay-panel="home"] {
    left: var(--uvd-safe-left) !important;
    right: var(--uvd-safe-right) !important;
    bottom: calc(var(--uvd-dock-height) + var(--uvd-safe-bottom) + 22px) !important;
    max-height: min(52dvh, 560px) !important;
  }

  @media (orientation: landscape) {
    body[data-theme="itahuka-mobile-live-overlay"] .it-live-overlay-tray[data-overlay-panel="home"] {
      max-height: min(43dvh, 360px) !important;
    }
    .it-unified-short-strip {
      grid-auto-columns: minmax(112px, 16vw);
    }
    .it-unified-playlist-strip {
      grid-auto-columns: minmax(260px, 27vw);
    }
  }
}
