body {
    background-color: #020617 !important;
    /* Ultra Dark Navy */
    background-image:
        radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.08) 0%, transparent 70%),
        linear-gradient(rgba(56, 189, 248, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.03) 1px, transparent 1px) !important;
    background-size: 100% 100%, 45px 45px, 45px 45px !important;
    background-attachment: fixed !important;
}

/* --- Liquid Effect Styling --- */
.gooey-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    filter: url('#goo');
    /* The Magic SVG Filter */
    z-index: 1;
}

.liquid-drop {
    position: absolute;
    background: var(--card-accent-color, #38bdf8);
    border-radius: 50%;
    transform: scale(0);
    opacity: 0;
}

@keyframes explode {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }

    40% {
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(var(--s));
        opacity: 0;
    }
}

.exploding .liquid-drop {
    animation: explode 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.link-card {
    position: relative;
    overflow: hidden !important;
    /* Required for the liquid effect */
}

.link-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--card-accent-color, #38bdf8);
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 2;
}

.link-card.loading::after {
    opacity: 0.15;
}

/* Ensure chapter pages (A4) look good with the new background */
.page {
    background: rgba(15, 23, 42, 0.7) !important;
    backdrop-filter: blur(10px);
}

@media print {
    body {
        background: white !important;
        background-image: none !important;
    }

    .page {
        background: white !important;
        backdrop-filter: none;
        box-shadow: none !important;
        border: none !important;
    }
}