/* =========================================================
   Lapisan hiasan tema (editor tema) — dikongsi kad & editor
   Unit --lu = lebar bekas / 480 → reka bentuk pada 480px, diskala automatik.
   Gerakan berulang guna sifat individu (rotate/translate/scale) supaya
   bergabung dengan putaran/flip statik dalam `transform`.
   ========================================================= */
.ly-wrap { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; container-type: inline-size; isolation: isolate; }
.ly-wrap.ly-front { z-index: 5; }
.ly { position: absolute; --lu: calc(100cqw / 480); }
.ly-wrap { --lu: 1px; }
.ly-i { position: absolute; inset: 0; will-change: transform; }
.ly-g { position: absolute; inset: 0; background-repeat: no-repeat; background-position: center; background-size: 100% 100%; transform-origin: 50% 50%; }
#cover-screen .ly-wrap { z-index: 1; }
#cover-screen .ly-wrap.ly-front { z-index: 3; }

/* Seksyen perlu menjadi bekas berkedudukan */
.countdown-section, .site-footer { position: relative; overflow: hidden; }
.countdown-section > *:not(.ly-wrap), .site-footer > *:not(.ly-wrap) { position: relative; z-index: 1; }

/* ---------- Gerakan berulang (parameter: --a amplitud, --d tempoh, --dl lengah) ---------- */
.ly-swing   { animation: ly-swing   var(--d, 2s) ease-in-out var(--dl, 0s) infinite alternate; }
.ly-wind    { animation: ly-wind    var(--d, 3s) ease-in-out var(--dl, 0s) infinite alternate; }
.ly-rotate  { animation: ly-rotate  var(--d, 20s) linear var(--dl, 0s) infinite; }
.ly-float   { animation: ly-float   var(--d, 3s) ease-in-out var(--dl, 0s) infinite alternate; }
.ly-pulse   { animation: ly-pulse   var(--d, 2s) ease-in-out var(--dl, 0s) infinite alternate; }
.ly-cloud   { animation: ly-cloud   var(--d, 6s) ease-in-out var(--dl, 0s) infinite alternate; }
.ly-balloon { animation: ly-balloon var(--d, 5s) ease-in-out var(--dl, 0s) infinite; }
.ly-fly     { animation: ly-fly     var(--d, 14s) linear var(--dl, 0s) infinite; }
.ly-fall    { animation: ly-fall    var(--d, 10s) linear var(--dl, 0s) infinite; }
.ly-blink   { animation: ly-blink   var(--d, 1.5s) ease-in-out var(--dl, 0s) infinite alternate; }

@keyframes ly-swing   { from { rotate: calc(var(--a, 3) * -1deg); } to { rotate: calc(var(--a, 3) * 1deg); } }
@keyframes ly-wind    { 0% { rotate: calc(var(--a, 4) * -.5deg); translate: calc(var(--a, 4) * -.5px) 0; } 100% { rotate: calc(var(--a, 4) * 1deg); translate: calc(var(--a, 4) * 1px) 0; } }
@keyframes ly-rotate  { from { rotate: 0deg; } to { rotate: calc(var(--a, 360) * 1deg); } }
@keyframes ly-float   { from { translate: 0 0; } to { translate: 0 calc(var(--a, 12) * -1px); } }
@keyframes ly-pulse   { from { scale: 1; } to { scale: calc(1 + var(--a, 6) / 100); } }
@keyframes ly-cloud   { from { translate: calc(var(--a, 20) * -1px) 0; } to { translate: calc(var(--a, 20) * 1px) 0; } }
@keyframes ly-balloon { 0%, 100% { translate: 0 0; rotate: -3deg; } 50% { translate: 0 calc(var(--a, 20) * -1px); rotate: 3deg; } }
@keyframes ly-fly     { 0% { translate: calc(var(--a, 600) * -.5px) 0; opacity: 0; } 8%, 92% { opacity: 1; } 100% { translate: calc(var(--a, 600) * .5px) calc(var(--a, 600) * -.05px); opacity: 0; } }
@keyframes ly-fall    { 0% { translate: 0 calc(var(--a, 900) * -.5px); rotate: 0deg; opacity: 0; } 10%, 90% { opacity: 1; } 100% { translate: 20px calc(var(--a, 900) * .5px); rotate: 200deg; opacity: 0; } }
@keyframes ly-blink   { from { opacity: 1; } to { opacity: calc(1 - var(--a, 60) / 100); } }

@media (prefers-reduced-motion: reduce) {
    .ly-i { animation: none !important; }
}
