/* Player TV — thème sombre émeraude & or (surchargé par les thèmes de l'admin).
   Compatibilité Smart TV : grid/flex + unités relatives, pas d'API CSS récente.
   Les couleurs statiques servent de repli si les variables CSS sont indisponibles. */

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 10px; /* recalculé par player.js selon résolution de conception × zoom × police */
}

:root {
  --fond: #0b1e17;
  --primaire: #0f5132;
  --accent: #c9a227;
  --texte: #f4efe3;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: none;
}

body {
  background: #0b1e17;
  background: var(--fond);
  color: #f4efe3;
  color: var(--texte);
  font-family: "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

[dir="rtl"] {
  font-family: "Noto Naskh Arabic", "Amiri", "Scheherazade New", "Traditional Arabic",
               "Segoe UI", Tahoma, sans-serif;
}

/* ---------- grille de layout ---------- */
.app {
  display: grid;
  width: 100%;
  height: 100%;
  padding: 1.4rem 2rem;
}
.zone {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- widget entête ---------- */
.entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
}
.entete-gauche { width: 28%; }
.entete-centre { width: 44%; text-align: center; }
.entete-droite { width: 28%; text-align: right; }

.mosquee-nom { font-size: 2.6rem; font-weight: 700; color: #c9a227; color: var(--accent); }
.ecran-code  { font-size: 1.3rem; opacity: .55; }

.horloge {
  font-size: 7.6rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}
.zone .horloge-seule { font-size: 9rem; text-align: center; }

.date-hijri { font-size: 2rem; font-weight: 600; color: #c9a227; color: var(--accent); }
.date-greg  { font-size: 1.8rem; }
.date-hijri-ar { font-size: 1.6rem; opacity: .85; }

/* ---------- widget zone médias / playlist ---------- */
.zone-centre {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, .04);
  overflow: hidden;
  height: 100%;
}
.calques {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: transparent;
}
.calque {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity .9s;
}
.calque.visible { opacity: 1; }
.calque img, .calque video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.calque iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- pages personnalisées (blocs positionnés en %) ---------- */
.page-rendu {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.bloc {
  position: absolute;
  overflow: hidden;
  line-height: 1.35;
}
.bloc-image img { width: 100%; height: 100%; object-fit: contain; }
.bloc-image.couvrir img { object-fit: cover; }

/* ---------- widget contenu spirituel ---------- */
.spirituel {
  text-align: center;
  padding: 2rem 3rem;
  margin: auto;
}
.spirituel-ar  { font-size: 3.4rem; line-height: 1.6; }
.spirituel-fr  { font-size: 2.2rem; margin-top: 1.2rem; opacity: .9; }
.spirituel-ref { font-size: 1.6rem; margin-top: .8rem; color: #c9a227; color: var(--accent); }
.spirituel.fondu { transition: opacity .8s; }
.spirituel.cache { opacity: 0; }

/* ---------- widget colonne des prières ---------- */
.colonne-prieres {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.prochaine {
  flex: 0 0 auto;
  text-align: center;
  padding: 1rem 1.2rem;
  border: .2rem solid #c9a227;
  border-color: var(--accent);
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, .04);
}
.prochaine-libelle { font-size: 1.7rem; }
.prochaine-nom { font-weight: 700; color: #c9a227; color: var(--accent); margin-left: .6rem; }
.prochaine-nom-ar { margin-left: .8rem; font-size: 1.9rem; }
.compte-rebours {
  font-size: 4.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .05em;
  line-height: 1.15;
}
.compte-rebours.iqama { color: #c9a227; color: var(--accent); }
.zone .countdown-seul { margin: auto; text-align: center; }
.zone .countdown-seul .compte-rebours { font-size: 6rem; }

.liste-prieres {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  margin-top: 1rem;
  min-height: 0;
}
.ligne-priere {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem 1.4rem;
  border-radius: 1rem;
  border: .15rem solid transparent;
}
.ligne-priere.prochaine-carte {
  background: #0f5132;
  background: var(--primaire);
  border-color: #c9a227;
  border-color: var(--accent);
}
.lp-noms { display: flex; flex-direction: column; }
.lp-nom    { font-size: 2.2rem; font-weight: 600; line-height: 1.15; }
.lp-nom-ar { font-size: 1.7rem; opacity: .85; }
.lp-heures { text-align: right; }
.lp-heure  { font-size: 3.1rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.lp-iqama  { font-size: 1.3rem; opacity: .75; }
.lp-iqama b { color: #c9a227; color: var(--accent); }

/* ---------- widget astro ---------- */
.astro {
  flex: 0 0 auto;
  margin-top: .8rem;
  padding: .8rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, .04);
  text-align: center;
  color: #c9a227;
  color: var(--accent);
}
.astro-subh { font-size: 1.6rem; }
.astro-ligne { display: flex; justify-content: space-around; margin-top: .5rem; }
.astro-item { font-size: 1.4rem; line-height: 1.4; }
.astro-item b { font-size: 1.7rem; color: #f4efe3; color: var(--texte); }

/* ---------- widget texte libre ---------- */
.texte-libre { margin: auto; text-align: center; padding: 1rem; }
.texte-libre .tl-fr { font-size: 2.4rem; }
.texte-libre .tl-ar { font-size: 2.6rem; margin-top: .6rem; }

/* ---------- widget ticker annonces ---------- */
.ticker {
  overflow: hidden;
  white-space: nowrap;
  background: #0f5132;
  background: var(--primaire);
  border-top: .15rem solid #c9a227;
  border-top-color: var(--accent);
  border-radius: .6rem;
  display: flex;
  align-items: center;
  height: 100%;
}
.ticker-contenu {
  display: inline-block;
  padding-left: 100%;
  font-size: 2rem;
  animation: defile 30s linear infinite;
}
.ticker-contenu .sep { color: #c9a227; color: var(--accent); margin: 0 2.4rem; }
@keyframes defile {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* ---------- indicateur hors-ligne ---------- */
.hors-ligne {
  position: absolute;
  top: .8rem;
  right: 1rem;
  font-size: 1.2rem;
  padding: .3rem .8rem;
  border-radius: 1rem;
  background: rgba(180, 60, 40, .85);
  color: #fff;
  z-index: 40;
}

/* ---------- overlay « prière en cours » ---------- */
.overlay-priere {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #081510;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 50;
}
.overlay-ar  { font-size: 12rem; color: #c9a227; color: var(--accent); line-height: 1.3; }
.overlay-nom { font-size: 4rem; font-weight: 700; margin-top: 2rem; }
.overlay-fr  { font-size: 2.6rem; margin-top: 2.4rem; opacity: .9; }
.overlay-tel { font-size: 2.6rem; margin-top: 1rem; opacity: .9; }

/* ---------- veille (écran « éteint ») ---------- */
.overlay-veille {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  z-index: 60;
}
