/**
 * Curelea TV — Compte à Rebours PPV Broadcast (25 à 59 secondes avant certaines émissions)
 * Conçu sur la toile 1280×720 verrouillée : halo orbital atmosphérique, anneau SVG haute précision,
 * chiffres géants tabulaires jusqu'à 00:00 et annonce du programme à suivre.
 */

.tv-countdown-layer {
  position: absolute;
  inset: 0;
  width: 1280px;
  height: 720px;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 54px 80px 58px;
  overflow: hidden;
  background: #04070e;
  color: #f8fafc;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.72s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.72s;
}

.tv-countdown-layer.is-active {
  opacity: 1;
  visibility: visible;
}

.tv-countdown-layer.is-fading-out {
  opacity: 0;
  transition: opacity 0.62s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fond atmosphérique animé inspiré des habillages PPV / cinéma nordique */
.tv-cd-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 62% at 50% 48%, rgba(15, 29, 58, 0.92) 0%, #050811 66%, #020308 100%);
}

.tv-cd-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(78px);
  opacity: 0.42;
  will-change: transform;
}

.tv-cd-orb-a {
  width: 620px;
  height: 620px;
  left: -120px;
  top: -140px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.58) 0%, rgba(37, 99, 235, 0.16) 52%, transparent 72%);
  animation: cdOrbDriftA 16s ease-in-out infinite alternate;
}

.tv-cd-orb-b {
  width: 580px;
  height: 580px;
  right: -110px;
  bottom: -160px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.52) 0%, rgba(16, 185, 129, 0.18) 54%, transparent 72%);
  animation: cdOrbDriftB 19s ease-in-out infinite alternate;
}

.tv-cd-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 48%, rgba(0, 0, 0, 0.85) 0%, transparent 74%);
  -webkit-mask-image: radial-gradient(circle at 50% 48%, rgba(0, 0, 0, 0.85) 0%, transparent 74%);
}

.tv-cd-horizon {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(125, 211, 252, 0.18) 28%, rgba(125, 211, 252, 0.34) 50%, rgba(167, 139, 250, 0.18) 72%, transparent 95%);
}

/* En-tête discret */
.tv-cd-top {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.tv-cd-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.95);
  animation: cdDotPulse 1.4s ease-in-out infinite;
}

.tv-cd-kicker {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.88);
}

/* Anneau central + compteur géant */
.tv-cd-center {
  position: relative;
  z-index: 3;
  width: 374px;
  height: 374px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tv-cd-ring-svg {
  position: absolute;
  inset: 0;
  width: 374px;
  height: 374px;
  transform: rotate(-90deg);
  filter: drop-shadow(0 0 22px rgba(56, 189, 248, 0.24));
}

.tv-cd-ring-outer {
  fill: none;
  stroke: rgba(148, 163, 184, 0.14);
  stroke-width: 1.25;
  stroke-dasharray: 4 10;
}

.tv-cd-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 5.5;
}

.tv-cd-ring-progress {
  fill: none;
  stroke: url(#tvCdGrad);
  stroke-width: 6.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.12s linear;
}

.tv-cd-digits-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.tv-cd-digits {
  font-family: "JetBrains Mono", monospace;
  font-size: 108px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
  text-shadow: 0 8px 40px rgba(56, 189, 248, 0.28);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), color 0.25s ease;
}

.tv-countdown-layer.is-final .tv-cd-digits {
  color: #e0f2fe;
  text-shadow: 0 0 42px rgba(56, 189, 248, 0.65), 0 0 16px rgba(255, 255, 255, 0.45);
}

.tv-countdown-layer.is-tick .tv-cd-digits {
  transform: scale(1.045);
}

.tv-cd-unit {
  margin-top: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.72);
}

/* Programme à suivre en bas */
.tv-cd-bottom {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.tv-cd-next-lbl {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: #7dd3fc;
}

.tv-cd-next-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #ffffff;
  text-shadow: 0 6px 26px rgba(0, 0, 0, 0.55);
}

@keyframes cdOrbDriftA {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(85px, 60px) scale(1.12); }
}

@keyframes cdOrbDriftB {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-90px, -55px) scale(1.10); }
}

@keyframes cdDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.84); }
}
