body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
    font-family: sans-serif;
}

#background-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#vignette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, transparent 0%, rgba(50, 50, 50, 0.7) 100%);
    z-index: 5;
    pointer-events: none;
}

#rainbow-glow-top {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 150px;
    z-index: 6;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
    background: linear-gradient(to bottom, rgba(255, 0, 0, 0.4) 0%, transparent 100%);
}

#rainbow-glow-top.active {
    opacity: 1;
    animation: rainbowGlowTop 12s ease-in-out infinite;
}

@keyframes rainbowGlowTop {
    0% {
        background: linear-gradient(to bottom, rgba(255, 0, 0, 0.5) 0%, transparent 100%);
    }
    8.33% {
        background: linear-gradient(to bottom, rgba(255, 80, 0, 0.5) 0%, transparent 100%);
    }
    16.67% {
        background: linear-gradient(to bottom, rgba(255, 165, 0, 0.5) 0%, transparent 100%);
    }
    25% {
        background: linear-gradient(to bottom, rgba(255, 255, 0, 0.5) 0%, transparent 100%);
    }
    33.33% {
        background: linear-gradient(to bottom, rgba(150, 255, 0, 0.5) 0%, transparent 100%);
    }
    41.67% {
        background: linear-gradient(to bottom, rgba(0, 255, 0, 0.5) 0%, transparent 100%);
    }
    50% {
        background: linear-gradient(to bottom, rgba(0, 255, 150, 0.5) 0%, transparent 100%);
    }
    58.33% {
        background: linear-gradient(to bottom, rgba(0, 150, 255, 0.5) 0%, transparent 100%);
    }
    66.67% {
        background: linear-gradient(to bottom, rgba(0, 0, 255, 0.5) 0%, transparent 100%);
    }
    75% {
        background: linear-gradient(to bottom, rgba(150, 0, 255, 0.5) 0%, transparent 100%);
    }
    83.33% {
        background: linear-gradient(to bottom, rgba(255, 0, 255, 0.5) 0%, transparent 100%);
    }
    91.67% {
        background: linear-gradient(to bottom, rgba(255, 0, 150, 0.5) 0%, transparent 100%);
    }
    100% {
        background: linear-gradient(to bottom, rgba(255, 0, 0, 0.5) 0%, transparent 100%);
    }
}

.strip {
    position: absolute;
    left: 0;
    width: 100%;
    /* Height will be set in JS */
    overflow: hidden;
    will-change: transform;
}

.strip-track {
    display: flex;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    will-change: transform;
}

.strip-track img {
    height: 100%;
    width: auto;
    display: block;
}

.strip-track img.mirror {
    transform: scaleX(-1);
}

.scene {
    position: absolute;
    top: 35%;
    left: 50%;
    width: 0;
    height: 0;
    perspective: 800px;
    z-index: 10;
}

.cube {
    position: relative;
    width: 300px;
    height: 300px;
    transform-style: preserve-3d;
    transform: translate(-50%, -50%) rotateX(0deg) rotateY(0deg);
    animation: rotateCube 10s infinite linear;
}

/* Center content wrapper - Counter-rotates to face camera */
.center-content {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform-style: preserve-3d;
    animation: counterRotate 10s infinite linear;
    z-index: 5;
}

@keyframes counterRotate {
    0% { transform: translate(-50%, -50%) rotate3d(1, 1, 1, 0deg); }
    100% { transform: translate(-50%, -50%) rotate3d(1, 1, 1, -360deg); }
}

/* The huge fluffy ball */
.cloud-visual {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1250px; /* 5x previous 250px */
    height: 1250px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    /* Exponential drop-off approximation */
    background: radial-gradient(
        circle, 
        rgba(255, 255, 255, 1) 0%, 
        rgba(255, 255, 255, 0.8) 10%, 
        rgba(255, 255, 255, 0.4) 25%, 
        rgba(255, 255, 255, 0.1) 45%, 
        rgba(255, 255, 255, 0.01) 70%,
        rgba(255, 255, 255, 0) 100%
    );
    filter: blur(20px);
    animation: cloudPulse 4s ease-in-out infinite alternate;
    pointer-events: none; /* Let clicks pass through */
}

@keyframes cloudPulse {
    0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

/* The Blood Drop - Dynamic Class */
.blood-drop {
    position: fixed; /* Fixed to viewport so it falls straight down regardless of cube rotation */
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background-color: rgba(200, 0, 0, 0.9);
    border-radius: 50%; /* Starts as circle */
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 20; /* In front of everything */
    box-shadow: 0 0 5px rgba(100, 0, 0, 0.5);
}

/* The rising lake of blood */
#blood-lake {
    position: fixed;
    bottom: 0;
    left: -5%;
    width: 110%;
    height: 0px; /* Starts empty */
    background: linear-gradient(to bottom, rgba(150, 0, 0, 0.9) 0%, rgba(255, 0, 0, 0.75) 100%);
    z-index: 30; /* On top of background, maybe behind cube? Prompt says "fills with red". */
    pointer-events: none;
    transition: height 0.1s linear;
    filter: url(#blood-distortion);
    backdrop-filter: blur(1px);
    transform: translateY(30px); /* Shift down to extend past bottom without moving surface */
}

.ripple {
    position: fixed;
    bottom: 0; /* Will be adjusted dynamically based on lake height */
    width: 40px;
    height: 10px;
    background: rgba(255, 100, 100, 0.6);
    border-radius: 50%;
    transform: translate(-50%, 50%) scale(0);
    pointer-events: none;
    z-index: 35;
}

#mouse-boat {
    position: relative; /* relative to boat-container */
    width: 80px; /* Adjust size as needed */
    height: auto;
    z-index: 40; /* On top of blood */
    pointer-events: none; /* Let clicks pass through to background if needed, though controls are mouse buttons */
    transition: transform 0.2s; /* Smooth flip */
}

.boat-shield {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 105, 180, 0.4) 0%, rgba(255, 105, 180, 0) 70%);
    box-shadow: 0 0 20px 5px rgba(255, 105, 180, 0.6);
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

.cheese {
    position: fixed;
    top: -100px;
    left: 5%; /* 5% from the left */
    width: 60px;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: 38;
    pointer-events: none;
    will-change: transform;
}

.cheese.rainbow-glow {
    animation: rainbowGlow 3s linear infinite;
}

@keyframes rainbowGlow {
    0% {
        filter: drop-shadow(0 0 20px red) drop-shadow(0 0 40px red);
    }
    16.67% {
        filter: drop-shadow(0 0 20px orange) drop-shadow(0 0 40px orange);
    }
    33.33% {
        filter: drop-shadow(0 0 20px yellow) drop-shadow(0 0 40px yellow);
    }
    50% {
        filter: drop-shadow(0 0 20px lime) drop-shadow(0 0 40px lime);
    }
    66.67% {
        filter: drop-shadow(0 0 20px blue) drop-shadow(0 0 40px blue);
    }
    83.33% {
        filter: drop-shadow(0 0 20px magenta) drop-shadow(0 0 40px magenta);
    }
    100% {
        filter: drop-shadow(0 0 20px red) drop-shadow(0 0 40px red);
    }
}

.debris {
    position: fixed;
    font-size: 24px;
    pointer-events: none;
    z-index: 45;
}

.feast-item {
    position: fixed;
    font-size: 40px;
    pointer-events: none;
    z-index: 41; /* In front of cheese (38) */
    transition: transform 1s ease-in, opacity 1s;
}

.fish-pink {
    filter: hue-rotate(300deg) brightness(1.2); /* Pink fish */
}

.particle {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 50;
    will-change: transform, opacity;
    filter: blur(2px);
    box-shadow: 0 0 10px currentColor; /* Glow based on background-color */
}

.heart-particle {
    position: fixed;
    pointer-events: none;
    z-index: 45;
    will-change: transform, opacity;
}

#lives-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: row-reverse; /* Newest hearts appear on the left */
    gap: 10px;
    z-index: 100;
}

#jesus-collection {
    position: fixed;
    top: 70px; /* Below hearts */
    right: 20px;
    display: grid;
    grid-template-columns: repeat(2, 100px);
    gap: 10px;
    z-index: 90;
    max-height: 80vh;
    overflow: visible;
}

.jesus-thumb {
    width: 100px;
    height: 100px;
    border: 2px solid white;
    background: #000;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    overflow: hidden;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.5s, transform 0.5s;
    position: relative;
}

.jesus-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jesus-thumb.reveal {
    opacity: 1;
    transform: scale(1);
}

.jesus-thumb-number {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 3px;
    font-family: 'DotGothic16', sans-serif;
    z-index: 1;
}

.heart {
    font-size: 30px;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    position: relative;
}

.heart.pop {
    transform: scale(1.5);
}

.joy-particle {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 105;
    background: #FFD700; /* Gold */
    box-shadow: 0 0 10px #FFF700;
}

#game-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(150, 0, 0, 0); /* Starts transparent */
    display: none;
    z-index: 200;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: background-color 2s ease-in;
}

#game-over-overlay.active {
    background-color: rgba(150, 0, 0, 1); /* Fills with dark blood red */
}

#game-over-text {
    font-family: 'DotGothic16', sans-serif;
    font-size: 80px;
    color: white;
    -webkit-text-stroke: 2px black;
    cursor: pointer;
}

#jesus-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    display: none;
    z-index: 100;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: scale(0);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

#jesus-overlay.active {
    display: flex; /* Note: display: flex and transition don't mix well, will handle in JS */
    opacity: 1;
    transform: scale(1);
}

#jesus-overlay.exit {
    opacity: 0;
    transform: scale(3); /* Scale up significantly while fading out */
}

#jesus-overlay img {
    width: 100%;
    height: 100%;
    object-fit: fill; /* "stretch to fill the whole screen" */
}

/* Heaven Overlay Styles */
#heaven-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: none;
    z-index: 110;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

#heaven-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: opacity 2s ease-in-out;
}

.comic-sans {
    font-family: "Comic Sans MS", "Comic Sans", cursive;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    z-index: 10;
}

.dot-font {
    font-family: 'DotGothic16', sans-serif;
    color: #fff;
    z-index: 10;
}

#heaven-text-top {
    position: absolute;
    top: 15%; /* Brought in from margin more */
    right: 15%; /* Brought in from margin more */
    font-size: 60px; /* Bigger */
    display: flex;
    gap: 5px;
}

.letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s, transform 0.5s;
}

.letter.float-in {
    opacity: 1;
    transform: translateY(0);
}

#heaven-options {
    position: absolute;
    bottom: 10%;
    left: 5%; /* Aligned bottom-left */
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Aligned left */
    gap: 20px;
    z-index: 20;
}

.heaven-option {
    font-size: 36px;
    cursor: pointer;
    background: rgba(0,0,0,0.3);
    padding: 10px 20px;
    transition: background 0.3s, opacity 0.5s;
}

.heaven-option:hover {
    background: rgba(255,255,255,0.2);
}

#heaven-text-float {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 60px;
    text-align: center;
    width: 80%;
    opacity: 0;
    transition: opacity 2s;
}

#puppy-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    background: white;
    z-index: 50;
    opacity: 0;
    transition: opacity 2s;
}

.frame {
    padding: 20px;
    background: white;
    border: 10px solid #8b4513;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.frame img {
    max-width: 80vw;
    max-height: 80vh;
    display: block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#strip-fail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 60;
    /* We will use a more complex background in JS if needed, but for now simple repeat */
    background-size: auto 100%;
    background-repeat: repeat-x;
}

/* To handle the mirroring requirement for the fail strip, we'll use a pseudo-element if needed, 
   or just ensure the asset itself is mirrored in logic. 
   Actually, the user asked for the strip to be mirrored. */
.fail-container {
    display: flex;
    height: 100%;
    width: 200%; /* Enough for normal + mirror */
    animation: failScroll 10s linear infinite;
}

@keyframes failScroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.fail-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 100px;
    color: white;
    -webkit-text-stroke: 3px black;
    z-index: 70;
    cursor: pointer;
}

.edge {
    position: absolute;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1); /* Faint guide */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

/* Text styles */
.marquee-text {
    white-space: nowrap;
    font-size: 38px;
    font-family: 'DotGothic16', sans-serif;
    font-weight: 900; /* Try bold */
    text-shadow: 0 0 1px black; /* Faux bold if font doesn't support 900 */
    color: black;
    /* Stroke removed */
    image-rendering: pixelated;
    position: absolute;
    animation: marquee 16s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } /* Assuming content is doubled */
}

@keyframes rotateCube {
    0% { transform: translate(-50%, -50%) rotate3d(1, 1, 1, 0deg); }
    100% { transform: translate(-50%, -50%) rotate3d(1, 1, 1, 360deg); }
}
