/* Base minimale qui imite la mise en page télé de Jellyfin (thème sombre d'origine).
   Le thème Halo (halo.css) est chargé par-dessus, exactement comme dans Jellyfin. */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; background: #101010; }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  font-family: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: rgba(255, 255, 255, .87); background: transparent;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; text-align: inherit; }

/* Fond de fiche (comme Jellyfin : image fixe derrière, voile par-dessus) */
.backdropContainer { position: fixed; inset: 0; z-index: -2; background: center / cover no-repeat; }
.backgroundContainer { position: fixed; inset: 0; z-index: -1; }
.backgroundContainer.withBackdrop { opacity: .86; }

/* En-tête */
.skinHeader { position: fixed; inset: 0 0 auto 0; z-index: 50; padding-bottom: 1.2em; }
.headerTop { display: flex; align-items: center; gap: 2em; padding: .9em 4.5%; }
.pageTitle { font-size: 1.5em; font-weight: 800; display: flex; align-items: center; gap: .45em; flex: none; }
.pageTitle::before { content: ""; width: .9em; height: .9em; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffd38a, #ff7a45 75%); box-shadow: 0 0 18px rgba(255, 160, 70, .7); }
.headerTabs { display: flex; gap: .2em; }
.emby-tab-button { padding: .55em 1.2em; font-weight: 600; outline: none; }
.demoBack { margin-left: auto; color: #a19fa8; text-decoration: none; font-size: .9em; flex: none; }
.demoBack:hover { color: #fff; }

/* Rangées : la marge haute/basse laisse la place au zoom et au halo de la carte sélectionnée */
.page { padding-bottom: 5em; }
.homeSections { padding-top: 5.6em; }
.verticalSection { margin-bottom: .6em; }
.sectionTitleContainer { padding: 0 4.5%; }
.sectionTitle { margin: 0; }
.emby-scroller { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding: 1.5em 4.5% 1.4em; }
.emby-scroller::-webkit-scrollbar { display: none; }
.itemsContainer { display: flex; width: max-content; }
.itemsContainer.vertical-wrap { width: auto; flex-wrap: wrap; padding: 1.5em 4.5% 1em; row-gap: 1.4em; }
.vertical-wrap .overflowPortraitCard { width: calc(100% / 7); }

/* Cartes */
.card { display: block; flex: none; position: relative; outline: none; }
.overflowPortraitCard { width: clamp(132px, 13vw, 210px); }
.overflowBackdropCard { width: clamp(230px, 23vw, 380px); }
.cardBox { margin: 0 .75em; }
.cardScalable { position: relative; }
.cardPadder { padding-bottom: 150%; }
.overflowBackdropCard .cardPadder { padding-bottom: 56.25%; }
.cardImageContainer { position: absolute; inset: 0; overflow: hidden; }
.cardFooter { padding: .55em .1em 0; min-width: 0; }
.cardText { font-size: .92em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.itemProgressBar { position: absolute; left: .7em; right: .7em; bottom: .7em; z-index: 2; }
.itemProgressBarForeground { height: 100%; }

/* Affiches : image réelle ou affiche générée */
.art { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: .9em; overflow: hidden; }
.art--img { background: #1a1a22 center / cover no-repeat; padding: 0; }
.art:not(.art--img)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 0, .65), transparent 55%); }
.art__shape { position: absolute; border-radius: 50%; }
.art__title { position: relative; z-index: 1; font-weight: 800; line-height: .95; letter-spacing: -.02em; text-transform: uppercase; overflow-wrap: anywhere; text-shadow: 0 2px 12px rgba(0, 0, 0, .5); }
.overflowPortraitCard .art__title { font-size: clamp(1.05em, 1.5vw, 1.5em); }
.overflowBackdropCard .art__title { font-size: clamp(1.1em, 1.7vw, 1.7em); }
.art__kicker { position: relative; z-index: 1; font-size: .62em; letter-spacing: .2em; text-transform: uppercase; opacity: .85; margin-bottom: .4em; }

/* Fiche, disposition télé de Jellyfin : affiche à gauche, infos à droite */
.itemDetailPage { padding-top: 6.5em; }
.detailPageWrapperContainer { display: flex; gap: 4vw; padding: 0 4.5%; align-items: flex-start; }
.detailImageContainer { flex: none; width: 22vw; max-width: 340px; }
.detailImageContainer .card { width: 100%; pointer-events: none; }
.detailImageContainer .cardBox { margin: 0; }
.detailPagePrimaryContainer { flex: 1; min-width: 0; max-width: 52em; padding-top: 1em; }
.itemName { font-size: clamp(2em, 4vw, 3.4em); margin: 0 0 .3em; line-height: 1.05; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.itemMiscInfo { display: flex; flex-wrap: wrap; gap: .5em 1em; align-items: center; font-size: .95em; margin-bottom: .6em; }
.itemGenres { color: #c9c7cf; margin-bottom: 1em; font-size: .95em; }
.star { color: #ffb547; }
.overview { font-size: 1.02em; line-height: 1.6; margin: 0 0 1.6em; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.mainDetailButtons { display: flex; gap: .9em; flex-wrap: wrap; padding: .3em 0; }
.detailButton { display: inline-flex; align-items: center; gap: .5em; padding: .75em 1.5em; background: rgba(255, 255, 255, .12); font-weight: 700; outline: none; transition: transform .2s; }
.detailButton svg { width: 1.2em; height: 1.2em; fill: currentColor; }
.detailSection { padding-top: 2.4em; }

/* Épisodes */
.episodeList { padding: .6em 4.5% 1em; display: grid; gap: .4em; }
.listItem { display: flex; align-items: center; gap: 1.2em; padding: .7em; outline: none; width: 100%; max-width: 70em; }
.listItemImage { flex: none; width: 12em; aspect-ratio: 16 / 9; position: relative; overflow: hidden; }
.listItemBody { min-width: 0; flex: 1; }
.listItemBody h4 { margin: 0 0 .25em; font-size: 1.05em; }
.listItemBody p { margin: 0; color: #a19fa8; font-size: .9em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.listItemDuration { flex: none; color: #a19fa8; font-size: .9em; padding: 0 .6em; }

/* Lecteur */
.videoPlayer { position: fixed; inset: 0; z-index: 100; background: #000; }
.osdHeader { position: absolute; inset: 0 0 auto 0; padding: 1.4em 4.5%; display: flex; align-items: center; gap: 1em; background: linear-gradient(180deg, rgba(0, 0, 0, .8), transparent); }
.osdTitle { font-size: 1.3em; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.videoOsdBottom { position: absolute; inset: auto 0 0 0; padding: 0 4.5% 2em; }
.osdTimes { display: flex; justify-content: space-between; font-size: .9em; color: #ddd; margin-bottom: .5em; }
.osdSlider { position: relative; height: .35em; background: rgba(255, 255, 255, .25); border-radius: 99px; }
.mdl-slider-background-lower { position: absolute; inset: 0 auto 0 0; border-radius: 99px; }
.sliderBubble { position: absolute; top: 50%; width: 1em; height: 1em; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 14px rgba(255, 181, 71, .7); }
.osdControls { display: flex; justify-content: center; align-items: center; gap: 1.2em; margin-top: 1.2em; }
.paper-icon-button-light { flex: none; width: 3.2em; height: 3.2em; display: grid; place-items: center; border-radius: 50%; outline: none; transition: transform .2s; }
.paper-icon-button-light svg { width: 1.6em; height: 1.6em; fill: currentColor; }
.btnPause { width: 4.2em; height: 4.2em; }
.btnPause svg { width: 2.2em; height: 2.2em; }
.isPlayer .demoHint { bottom: auto; top: 1.2em; }

/* Aide clavier : disparaît après quelques secondes d'utilisation */
.demoHint { position: fixed; right: 1.2em; bottom: 1.2em; z-index: 120; display: flex; gap: 1.2em; padding: .6em 1em; font-size: .8em; color: #c9c7cf; background: rgba(18, 18, 24, .92); border: 1px solid rgba(255, 255, 255, .08); border-radius: 999px; transition: opacity .6s, transform .6s; }
.demoHint.is-hidden { opacity: 0; transform: translateY(1em); pointer-events: none; }
kbd { display: inline-block; min-width: 1.6em; padding: .05em .35em; margin-right: .2em; text-align: center; font: inherit; font-size: .9em; border: 1px solid rgba(255, 255, 255, .2); border-radius: 5px; }

@media (max-width: 1100px) { .vertical-wrap .overflowPortraitCard { width: calc(100% / 5); } }
@media (max-width: 700px) {
  .demoHint { display: none; }
  .headerTop { gap: .6em 1em; flex-wrap: wrap; padding: .7em 16px; }
  .headerTabs { order: 3; width: 100%; }
  .pageTitle { font-size: 1.2em; }
  .homeSections { padding-top: 7.4em; }
  .itemDetailPage { padding-top: 7.6em; }
  .sectionTitleContainer, .emby-scroller, .episodeList, .itemsContainer.vertical-wrap { padding-left: 16px; padding-right: 16px; }
  .detailPageWrapperContainer { padding: 0 16px; gap: 1em; flex-direction: column; }
  .detailImageContainer { width: 42vw; }
  .vertical-wrap .overflowPortraitCard { width: calc(100% / 3); }
  .listItemImage { width: 7.5em; }
  .listItemDuration { display: none; }
}
