:root {
    --gistop-ddm-orange: #f28c00;
    --gistop-ddm-gold: #ffc233;
    --gistop-ddm-purple: #6c2aa6;
    --gistop-ddm-pink: #d61b72;
    --gistop-ddm-blue: #0571b8;
}

#gistop-ddm {
    position: fixed;
    inset: 0;
    z-index: 99990;
    overflow: hidden;
    pointer-events: none;
}

.gistop-ddm__images {
    position: absolute;
    inset: 0;
    opacity: 1;
    visibility: visible;
    transition: opacity .25s ease, visibility .25s ease;
}

.gistop-ddm--images-hidden .gistop-ddm__images {
    opacity: 0;
    visibility: hidden;
}

.gistop-ddm__toggle {
    position: fixed;
    right: 50%;
    bottom: 18px;
    z-index: 99991;
    padding: 8px 13px;
    transform: translateX(50%);
    border: 1px solid rgba(255, 194, 51, .9);
    border-radius: 999px;
    color: #fff;
    background: rgba(50, 19, 76, .92);
    box-shadow: 0 5px 16px rgba(31, 12, 45, .28);
    font: 600 13px/1.2 Arial, sans-serif;
    cursor: pointer;
    transition: background-color .2s ease, transform .2s ease;
}

.gistop-ddm__toggle:hover {
    background: rgba(108, 42, 166, .96);
    transform: translateX(50%) translateY(-2px);
}

.gistop-ddm__toggle:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.gistop-ddm__scene {
    position: absolute;
    bottom: 18px;
    width: clamp(190px, 24vw, 330px);
    margin: 0;
    overflow: hidden;
    border: 3px solid rgba(255, 194, 51, .88);
    border-radius: 22px;
    background: #32134c;
    box-shadow: 0 10px 28px rgba(31, 12, 45, .32);
    opacity: .94;
    transform-origin: 50% 100%;
    animation: gistop-ddm-scene-float 6.8s ease-in-out infinite;
}

.gistop-ddm__scene--left {
    left: 16px;
    aspect-ratio: 106 / 60;
}

.gistop-ddm__scene--right {
    right: 16px;
    aspect-ratio: 160 / 106;
    animation-delay: -3.4s;
}

.gistop-ddm__scene img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gistop-ddm__petal {
    --x: 50vw;
    --drift: 30px;
    --drift-end: -16px;
    --duration: 10s;
    --delay: 0s;
    position: absolute;
    top: -30px;
    left: var(--x);
    width: 11px;
    height: 19px;
    border-radius: 75% 20% 70% 30%;
    background: linear-gradient(145deg, #ffd43b 0 18%, #f28c00 52%, #d95000 100%);
    box-shadow: 0 1px 2px rgba(87, 44, 0, .25);
    opacity: .86;
    animation: gistop-ddm-fall var(--duration) linear var(--delay) infinite;
}

.gistop-ddm__petal:nth-child(3n) { width: 8px; height: 14px; opacity: .68; }
.gistop-ddm__petal:nth-child(4n) { background: linear-gradient(145deg, #ffe571, #f5a000 65%, #ee6c00); }

@keyframes gistop-ddm-scene-float {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(-.35deg); }
    50% { transform: translate3d(0, -9px, 0) rotate(.35deg); }
}

@keyframes gistop-ddm-fall {
    0% { transform: translate3d(0, -8vh, 0) rotate(0); }
    45% { transform: translate3d(var(--drift), 48vh, 0) rotate(240deg); }
    100% { transform: translate3d(var(--drift-end), 108vh, 0) rotate(610deg); }
}

@media (max-width: 782px) {
    .gistop-ddm__toggle {
        bottom: 8px;
        padding: 7px 11px;
        font-size: 12px;
    }
    .gistop-ddm__scene {
        bottom: 10px;
        width: min(41vw, 178px);
        border-width: 2px;
        border-radius: 14px;
        opacity: .86;
    }
    .gistop-ddm__scene--left { left: 8px; }
    .gistop-ddm__scene--right { right: 8px; }
    .gistop-ddm__petal:nth-child(n+15) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .gistop-ddm__images,
    .gistop-ddm__toggle,
    .gistop-ddm__scene,
    .gistop-ddm__petal { animation: none !important; }
    .gistop-ddm__images,
    .gistop-ddm__toggle { transition: none !important; }
    .gistop-ddm__petals { display: none; }
}

