/* === Корона навколо ядра (постійне світло, не пульсує) === */
.sun .corona {
  fill: none;
  stroke: var(--core-color);
  stroke-width: 0.8;
  opacity: 0.35;
}

/* === Ядро Сонця === */
.sun .core {
  fill: var(--core-color);
  filter: drop-shadow(0 0 8px var(--core-glow)) drop-shadow(0 0 28px var(--core-glow));
  animation: core-breathe var(--pulse-duration) ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes core-breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.06); opacity: 0.92; }
}

/* === Хвилі магнітного поля === */
.sun .wave {
  fill: none;
  stroke: var(--core-color);
  stroke-width: 1.4;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: wave-pulse var(--pulse-duration) ease-out infinite;
}
.sun .wave-1 { animation-delay: 0s; }
.sun .wave-2 { animation-delay: calc(var(--pulse-duration) * -0.2); }
.sun .wave-3 { animation-delay: calc(var(--pulse-duration) * -0.4); }
.sun .wave-4 { animation-delay: calc(var(--pulse-duration) * -0.6); }
.sun .wave-5 { animation-delay: calc(var(--pulse-duration) * -0.8); }

/* Видимість хвиль контролюється --waves-visible (1-5) */
.sun .wave-1 { opacity: 0; }
.sun .wave-2 { display: none; }
.sun .wave-3 { display: none; }
.sun .wave-4 { display: none; }
.sun .wave-5 { display: none; }

[style*="--waves-visible: 2"] .sun .wave-1,
[style*="--waves-visible: 2"] .sun .wave-2 { display: block; }
[style*="--waves-visible: 3"] .sun .wave-1,
[style*="--waves-visible: 3"] .sun .wave-2,
[style*="--waves-visible: 3"] .sun .wave-3 { display: block; }
[style*="--waves-visible: 5"] .sun .wave-1,
[style*="--waves-visible: 5"] .sun .wave-2,
[style*="--waves-visible: 5"] .sun .wave-3,
[style*="--waves-visible: 5"] .sun .wave-4,
[style*="--waves-visible: 5"] .sun .wave-5 { display: block; }
[style*="--waves-visible: 7"] .sun .wave { display: block; }

@keyframes wave-pulse {
  0%   { opacity: 0;   transform: scale(0.6); }
  15%  { opacity: 0.7; }
  100% { opacity: 0;   transform: scale(1.8); }
}

/* === Глітч на вердикті (підвищується через --glitch-amount) === */
@keyframes glitch-shift {
  0%, 90%, 100% { transform: translateX(0); }
  92% { transform: translateX(calc(var(--glitch-amount) * 0.3)); }
  94% { transform: translateX(calc(var(--glitch-amount) * -0.5)); }
  96% { transform: translateX(calc(var(--glitch-amount) * 0.2)); }
  98% { transform: translateX(0); }
}
.verdict.glitch { animation: glitch-shift 3s steps(1) infinite; }

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
  .sun .core,
  .sun .wave,
  .verdict.glitch {
    animation: none !important;
  }
  #meta-kp { transition: none; }
}
