/*
 * Dream Runner seasonal effects — styles for dr-effects.js.
 * The SAME file is used by the admin preview and the storefront
 * (public/admin/assets/css/dr-effects.css <-> public/assets/css/dr-effects.css).
 */

.dr-fx-host {
    position: relative;
}

.dr-fx-layer {
    position: absolute;
    inset: 0;
    z-index: 5;
    overflow: hidden;
    pointer-events: none;
    border-radius: inherit;
}

.dr-fx-layer.is-viewport {
    position: fixed;
    z-index: 9000;
    border-radius: 0;
}

.dr-fx-canvas {
    position: absolute;
    inset: 0;
    display: block;
}

/* ===================== Ice / Frost ===================== */
.dr-fx-frost {
    /* Frosted, icy edges */
    box-shadow:
        inset 0 0 30px rgba(220, 240, 255, .55),
        inset 0 0 90px rgba(180, 220, 255, .28);
    background:
        radial-gradient(120% 60% at 0% 0%, rgba(235, 247, 255, .55), transparent 45%),
        radial-gradient(120% 60% at 100% 0%, rgba(235, 247, 255, .5), transparent 45%),
        radial-gradient(120% 60% at 0% 100%, rgba(225, 242, 255, .35), transparent 40%),
        radial-gradient(120% 60% at 100% 100%, rgba(225, 242, 255, .35), transparent 40%);
}

/* Icicles hanging from the top edge */
.dr-fx-frost::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 34px;
    background: linear-gradient(180deg, rgba(240, 249, 255, .95), rgba(205, 232, 255, .75));
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='34' viewBox='0 0 120 34'%3E%3Cpath d='M0 0h120v6c-3 0-4 4-5 10-1-6-2-10-5-10s-4 9-5 22c-1-13-2-22-6-22s-3 5-4 12c-1-7-2-12-5-12s-4 7-5 16c-1-9-2-16-5-16s-3 3-4 8c-1-5-2-8-5-8s-4 10-5 26c-1-16-2-26-6-26s-3 6-4 13c-1-7-2-13-5-13s-4 5-5 11c-1-6-2-11-5-11s-4 8-5 18c-1-10-2-18-5-18s-3 4-4 9c-1-5-2-9-5-9s-3 6-4 14C9 12 8 6 5 6S1 8 0 12z' fill='%23000'/%3E%3C/svg%3E") repeat-x top / 120px 34px;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='34' viewBox='0 0 120 34'%3E%3Cpath d='M0 0h120v6c-3 0-4 4-5 10-1-6-2-10-5-10s-4 9-5 22c-1-13-2-22-6-22s-3 5-4 12c-1-7-2-12-5-12s-4 7-5 16c-1-9-2-16-5-16s-3 3-4 8c-1-5-2-8-5-8s-4 10-5 26c-1-16-2-26-6-26s-3 6-4 13c-1-7-2-13-5-13s-4 5-5 11c-1-6-2-11-5-11s-4 8-5 18c-1-10-2-18-5-18s-3 4-4 9c-1-5-2-9-5-9s-3 6-4 14C9 12 8 6 5 6S1 8 0 12z' fill='%23000'/%3E%3C/svg%3E") repeat-x top / 120px 34px;
    filter: drop-shadow(0 2px 3px rgba(120, 170, 220, .35));
    opacity: .9;
}

/* Slow icy shimmer across the frost */
.dr-fx-frost::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .16) 50%, transparent 65%);
    background-size: 250% 100%;
    animation: dr-fx-shimmer 7s linear infinite;
}

@keyframes dr-fx-shimmer {
    from { background-position: 150% 0; }
    to { background-position: -100% 0; }
}

/* ===================== Christmas lights ===================== */
.dr-fx-lights {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 44px;
}

.dr-fx-wire {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 40px;
    overflow: visible;
}

.dr-fx-wire path {
    fill: none;
    stroke: #1f2a1f;
    stroke-width: 2;
    opacity: .85;
}

.dr-fx-bulb {
    position: absolute;
    top: 14px;
    width: 9px;
    height: 14px;
    margin-left: -4.5px;
    border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
    background: var(--c);
    box-shadow: 0 0 10px 2px var(--c), 0 0 22px 4px color-mix(in srgb, var(--c) 45%, transparent);
    animation: dr-fx-blink 2s ease-in-out infinite;
}

/* Bulb socket */
.dr-fx-bulb::before {
    content: "";
    position: absolute;
    top: -4px;
    left: 2px;
    width: 5px;
    height: 5px;
    border-radius: 1px;
    background: #2b2b2b;
}

@keyframes dr-fx-blink {
    0%, 100% { opacity: 1; filter: brightness(1.1); }
    50% { opacity: .35; filter: brightness(.7); box-shadow: 0 0 3px 0 var(--c); }
}

.dr-fx-lights.is-paused .dr-fx-bulb,
.dr-fx-layer:has(.is-paused)::after {
    animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
    /* The admin preview passes { force: true } so it can still be seen. */
    .dr-fx-layer:not(.is-forced) { display: none !important; }
}
