/* Elite Media Center v0.10.5.44: one poster size across the site, Live TV guide
   and player layout. Loaded after every other stylesheet. */

/* #22b: Profile > Poster size applies on every page, on every device.
   Medium keeps today's sizes; Small and Large scale the series, season and
   movie pages the same way they already scale the libraries. */
html[data-poster-density="small"] .eliteSeasonGrid{grid-template-columns:repeat(auto-fill,minmax(125px,1fr))}
html[data-poster-density="large"] .eliteSeasonGrid{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}
html[data-poster-density="small"] #homePage #homeMovies.mediaRail,
html[data-poster-density="small"] #homePage #homeTv.mediaRail,
html[data-poster-density="small"] #homePage #homeDvr.mediaRail{grid-auto-columns:minmax(112px,152px)!important}
html[data-poster-density="large"] #homePage #homeMovies.mediaRail,
html[data-poster-density="large"] #homePage #homeTv.mediaRail,
html[data-poster-density="large"] #homePage #homeDvr.mediaRail{grid-auto-columns:minmax(180px,250px)!important}
html[data-poster-density="small"] .eliteShowHero{grid-template-columns:minmax(130px,200px) minmax(0,1fr)}
html[data-poster-density="small"] .eliteShowPoster{max-width:200px}
html[data-poster-density="large"] .eliteShowHero{grid-template-columns:minmax(200px,300px) minmax(0,1fr)}
html[data-poster-density="large"] .eliteShowPoster{max-width:300px}
html[data-poster-density="small"] #movieFullPage #detailPanel .detailPoster{width:clamp(125px,14vw,210px)}
html[data-poster-density="large"] #movieFullPage #detailPanel .detailPoster{width:clamp(185px,22vw,310px)}
html[data-poster-density="small"] .eliteEpisodeItem{grid-template-columns:minmax(125px,210px) minmax(0,1fr)}
html[data-poster-density="large"] .eliteEpisodeItem{grid-template-columns:minmax(190px,320px) minmax(0,1fr)}
@media(max-width:480px){
  html[data-poster-density] .eliteEpisodeItem{grid-template-columns:1fr}
  html[data-poster-density] .eliteShowHero{grid-template-columns:1fr}
}

/* #22b on the TV: series, season and movie pages use the same size as Home
   (sized from the screen's width and height, see elite_tv_42.css). */
html.elite-tv .eliteSeasonGrid{
  grid-template-columns:repeat(auto-fill,minmax(min(calc((100% - (var(--elite-tv-grid) - 1) * var(--elite-tv-gap)) / var(--elite-tv-grid)),calc((var(--elite-tv-rowh) - 60px) / 1.5)),1fr))!important;
  gap:16px var(--elite-tv-gap)!important}
html.elite-tv .eliteSeasonCard{padding:7px;gap:5px}
html.elite-tv .eliteSeasonCard strong{font-size:14px}
html.elite-tv .eliteShowHero{grid-template-columns:min(245px,calc((var(--elite-tv-rowh) + 10vh) / 1.5)) minmax(0,1fr)!important;min-height:0!important}
html.elite-tv .eliteShowPoster{max-width:min(245px,calc((var(--elite-tv-rowh) + 10vh) / 1.5))!important}
html.elite-tv #movieFullPage #detailPanel .detailPoster{width:min(260px,calc((var(--elite-tv-rowh) + 10vh) / 1.5))!important}
html.elite-tv .eliteEpisodeItem{grid-template-columns:min(265px,calc(var(--elite-tv-rowh) * 1.25)) minmax(0,1fr)!important}

/* #24: the guide never bounces on iPad/iPhone. The channel column and the
   time row stay locked; only the programmes move. */
.guideScroller,#appBox #livePage .guideScroller{overscroll-behavior:none!important}

/* #25: the player's picture is sized so its title and buttons (Cast, Report,
   Minimize, Full Screen, Close Player) fit on screen with it. Full Screen and
   the corner player are unchanged. --elite-player-reserve is set by app.js. */
#playerBox:not(.playbackOverlay):not(.miniDock) .videoStage:not(:fullscreen) #video{
  max-height:max(200px,calc(100dvh - var(--elite-player-reserve,190px)))!important;object-fit:contain}

/* #29: one colour per tuner device, the same in the Overview, the channel
   manager and (admins only) the guide's channel column, like Plex. */
.eliteLiveTuner{border-left:4px solid var(--elite-device-color,#5b6b80)!important}
.deviceLineupTab.eliteDeviceColored{border-left:5px solid var(--elite-device-color,#5b6b80)!important}
.eliteCarriers{display:flex;flex-wrap:wrap;gap:4px;align-items:center;min-width:0}
.eliteCarrier{display:inline-flex;align-items:center;gap:5px;font-size:11px;line-height:1.2;color:#c9d6e6;background:#ffffff0d;border-radius:5px;padding:2px 6px 2px 0;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.eliteCarrier::before{content:"";align-self:stretch;width:4px;border-radius:4px 0 0 4px;background:var(--elite-device-color,#5b6b80)}
.eliteGuideSources{position:absolute;left:0;top:6px;bottom:6px;display:flex;gap:2px;pointer-events:none;z-index:2}
.eliteGuideSources i{display:block;width:3px;border-radius:2px}
.eliteEpgGrab{display:grid;gap:6px}
.eliteEpgGrab button{justify-self:start}

.eliteNextMovieLabel{display:block;font-size:.69rem;letter-spacing:.08em;font-weight:750;color:#8fbafa;margin:0 0 5px;}
/* v0.10.5.47: Admin > Streaming > Measured Viewer Connections */
.eliteMeasuredList{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}
.eliteMeasuredTable{width:100%;border-collapse:collapse;font-size:.9rem}
.eliteMeasuredTable th,.eliteMeasuredTable td{padding:6px 8px;text-align:left;white-space:nowrap;border-bottom:1px solid rgba(255,255,255,.08)}
.eliteMeasuredTable th{font-weight:600;opacity:.75}

/* v0.10.5.48: the A-Z quick-scroll rail must not cover posters. Reserve its width beside the grid. */
body.hasAlphabetRail #library{padding-right:44px;box-sizing:border-box}
body.hasAlphabetRail #libraryPage .libraryHeading{padding-right:44px;box-sizing:border-box}

/* v0.10.5.48: Needs attention rows are buttons that open the place to fix the item. */
button.eliteLiveAttention.eliteAttentionLink{width:100%;text-align:left;font:inherit;font-size:13px;color:inherit;cursor:pointer;min-height:0;line-height:1.35}
button.eliteLiveAttention.eliteAttentionLink:hover{filter:brightness(1.18)}
button.eliteLiveAttention.eliteAttentionLink:focus-visible{outline:3px solid #6db3f2;outline-offset:2px}
.eliteAttentionGo{flex:none;font-size:12px;font-weight:700;opacity:.85;white-space:nowrap}
.eliteLivePanel.eliteAttentionTarget{box-shadow:0 0 0 3px #6db3f2;transition:box-shadow .3s}

/* v0.10.5.49: Now Playing separates measured throughput from configured limits. */
.eliteNowGroupTitle{margin:12px 0 4px;font-size:12px;font-weight:700;letter-spacing:.02em;opacity:.8;text-transform:uppercase}
.eliteRecoveryHistory{margin:4px 0 8px;padding-left:18px;font-size:12px;line-height:1.5}
.eliteRecoveryHistory b{font-weight:700;margin-right:4px}
