/* =====================================================================
   AIYANA COUNTDOWN (Tage / Stunden / Minuten) – NACH deinem Theme-CSS laden.
   Alles ist mit .aiy_countdown geprefixt, damit nichts mit dem Theme kollidiert.
   ===================================================================== */

.aiy_countdown {
  --cd-a: #8fb4ff;                       /* Hauptakzent (kühles Nebelblau) */
  --cd-b: #c7a6ff;                       /* zweiter Akzent (Flieder) */
  --cd-line: rgba(255,255,255,.11);

  display: flex;
  justify-content: flex-start;           /* data-align="center" | "right" möglich */
  margin-top: 36px;

  opacity: 0;                            /* wird vom JS eingeblendet (.is-ready) */
  transform: translateY(12px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1);
}
.aiy_countdown[data-align="center"] { justify-content: center; }
.aiy_countdown[data-align="right"]  { justify-content: flex-end; }
.aiy_countdown.is-ready  { opacity: 1; transform: none; }
.aiy_countdown.is-done   { opacity: 0; transform: translateY(-8px); }   /* Abgang, danach hidden */
.aiy_countdown[hidden]   { display: none !important; }
.aiy_countdown.is-urgent { --cd-a: #ff9ad5; --cd-b: #ffc27a; }          /* letzte 24 Stunden: wärmere Farben */
.aiy_countdown, .aiy_countdown * { box-sizing: border-box; }

.aiy_countdown .cd_wrap { display: inline-flex; flex-direction: column; gap: 18px; max-width: 100%; }
.aiy_countdown .cd_tiles { display: flex; align-items: stretch; gap: clamp(8px, 2vw, 18px); }

/* ---------- Kachel ---------- */
.aiy_countdown .cd_tile {
  position: relative;
  overflow: hidden;
  min-width: clamp(78px, 17vw, 128px);
  padding: clamp(14px, 2.4vw, 22px) clamp(10px, 2vw, 18px) clamp(12px, 2vw, 16px);
  text-align: center;
  border-radius: 18px;
  border: 1px solid var(--cd-line);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.015));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 18px 40px rgba(0,0,0,.35);
}
/* atmender Nebel-Glow hinter der Zahl */
.aiy_countdown .cd_tile::before {
  content: "";
  position: absolute; left: 50%; top: -40%;
  width: 140%; height: 90%;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--cd-a) 32%, transparent), transparent 70%);
  pointer-events: none;
  animation: cdBreathe 6s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -2s);
}
@keyframes cdBreathe {
  0%, 100% { opacity: .55; transform: translateX(-50%) scale(1); }
  50%      { opacity: 1;   transform: translateX(-50%) scale(1.15); }
}

/* ---------- Zahl (rollt beim Wechsel) ---------- */
.aiy_countdown .cd_num {
  position: relative;
  display: grid;
  overflow: hidden;
  height: 1.08em;
  font-size: clamp(38px, 9vw, 76px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.aiy_countdown .cd_num span {
  grid-area: 1 / 1;
  display: block;
  background: linear-gradient(180deg, #fff 25%, var(--cd-a) 135%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- Beschriftung ---------- */
.aiy_countdown .cd_unit {
  position: relative;
  margin-top: 6px;
  padding-left: .3em;                    /* gleicht das Letter-Spacing am Ende aus */
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  opacity: .6;
}

/* ---------- Trenner (zwei pulsierende Punkte) ---------- */
.aiy_countdown .cd_sep { align-self: center; display: flex; flex-direction: column; gap: 10px; }
.aiy_countdown .cd_sep::before,
.aiy_countdown .cd_sep::after {
  content: "";
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--cd-a);
  box-shadow: 0 0 10px var(--cd-a);
  animation: cdBlink 2s ease-in-out infinite;
}
.aiy_countdown .cd_sep::after { animation-delay: -1s; }
@keyframes cdBlink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ---------- Sekunden-Puls: Linie füllt sich einmal pro Minute ---------- */
.aiy_countdown .cd_pulse { position: relative; height: 2px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; }
.aiy_countdown .cd_pulse span {
  position: absolute; inset: 0;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1s linear;
  background: linear-gradient(90deg, transparent, var(--cd-a), var(--cd-b));
  box-shadow: 0 0 14px var(--cd-a);
}

@media (max-width: 420px) {
  
}

@media (prefers-reduced-motion: reduce) {
  .aiy_countdown, .aiy_countdown .cd_pulse span { transition: none; }
  .aiy_countdown .cd_tile::before, .aiy_countdown .cd_sep::before, .aiy_countdown .cd_sep::after { animation: none; }
}
