/* Google Fonts: Fredoka is very rounded and fun! */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=Outfit:wght@400;600;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- Loading Screen --- */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background: rgba(255, 255, 255, 0.9);
    /* Frosty glass */
    backdrop-filter: blur(25px);
    /* Strong blur to show scene behind */
    -webkit-backdrop-filter: blur(25px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), visibility 1s;
    color: #ff0844;
    /* Brighter accent color */
    box-shadow: inset 0 0 100px rgba(255, 255, 255, 0.5);
    /* Inner glow */
    pointer-events: auto;
    /* Ensure click works while body is locked */
    cursor: pointer;
}

body.night-mode .loading-screen {
    background: rgba(35, 5, 10, 0.95);
    /* Deep dark crimson/burgundy */
    color: #ffd1dc;
    /* Bright pale pink for high contrast */
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.8);
}

.app-container {
    transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(0.9);
    /* Start slightly zoomed out */
}

.app-container.zoomed-in {
    transform: scale(1);
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.1);
    /* Zoom out the loading screen while fading */
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), transform 1s cubic-bezier(0.4, 0, 0.2, 1), visibility 1s;
    pointer-events: none;
}

.loader-mascot {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    animation: loaderFloat 2.5s ease-in-out infinite;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
}

.loader-mascot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.loading-screen p {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.5px;
}

#loading-text {
    animation: loaderPulse 1.5s ease-in-out infinite alternate;
}

#loading-instruction {
    margin-top: 15px;
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.5;
    animation: instrPulse 3s ease-in-out infinite;
}

#loading-instruction.hidden {
    display: none;
}

@keyframes instrPulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes loaderFloat {

    0%,
    100% {
        transform: translateY(0) rotate(-2deg);
    }

    50% {
        transform: translateY(-15px) rotate(2deg);
    }
}

@keyframes loaderPulse {
    from {
        opacity: 0.6;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1.02);
    }
}

html {
    scroll-behavior: smooth;
    height: auto;
}

html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

body {
    font-family: 'Fredoka', 'Outfit', sans-serif;
    color: white;
    overflow-x: hidden;
    min-height: 100vh;
    background-color: #ff0844;
    /* Vibrant True Red */
    transition: background 1s ease;
    position: relative;
}

.snap-point {
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    pointer-events: none;
}

/* --- Environmental Backgrounds --- */
.env-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: linear-gradient(180deg, #ff0844 0%, #ffffff 100%);
    /* Sweet Red to White */
    transition: background 2s ease;
}

.env-container-fg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 20;
    /* In front of Canvas (zIndex 1) but behind UI (zIndex 100) */
    overflow: hidden;
    pointer-events: none;
}


.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.night-mode .env-container {
    background: linear-gradient(180deg, #8e0e00 0%, #1f1c18 100%);
    /* Deep Crimson Night */
}

/* --- Settings UI --- */
.settings-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#settings-btn {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 3px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 0 15px rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#settings-btn svg {
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
}

#settings-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

body.night-mode #settings-btn {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 0 10px rgba(255, 255, 255, 0.1);
}

body.night-mode #settings-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

#settings-btn:active {
    transform: scale(0.95);
}

.settings-panel {
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 3px solid rgba(255, 255, 255, 0.6);
    border-radius: 40px;
    padding: 30px;
    min-width: 280px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 0 30px rgba(255, 255, 255, 0.8);
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body.day-mode .settings-panel {
    color: #2d3436;
    background: rgba(255, 255, 255, 0.75);
}

body.night-mode .settings-panel {
    background: rgba(15, 15, 20, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.4);
}

.settings-panel.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.settings-panel h3 {
    margin-bottom: 20px;
    font-size: 1.4rem;
    color: #ff0844;
    text-shadow: none;
}

.setting-group {
    margin-bottom: 18px;
}

.setting-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #e0e0e0;
    /* Brighter for night */
    text-transform: uppercase;
}

body.day-mode .setting-group label {
    color: #555;
    /* Darker for day */
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.hidden {
    display: none !important;
}

/* Segmented Control - Glassmorphism */
.segmented-control {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(4px);
    padding: 3px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

body.day-mode .segmented-control {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.segmented-control input {
    display: none;
}

.segmented-control label {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    margin: 0;
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ccc;
    /* Brighter for night visibility */
    transition: all 0.2s;
}

body.day-mode .segmented-control label {
    color: #666;
    /* Standard for day */
}

.segmented-control input:checked+label {
    background: #ff0844;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 8, 68, 0.4);
}

/* Glassmorphism Select Dropdown */
select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: inherit;
    font-family: inherit;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpolyline points="6 9 12 15 18 9"%3E%3C/polyline%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    transition: all 0.3s ease;
}

body.day-mode select {
    background-color: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%232d3436" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpolyline points="6 9 12 15 18 9"%3E%3C/polyline%3E%3C/svg%3E');
}

select:focus {
    border-color: #ff0844;
    box-shadow: 0 0 0 3px rgba(255, 8, 68, 0.2);
}

select option {
    background: #fff;
    color: #333;
}

body.night-mode select {
    background-color: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

body.night-mode select option {
    background: #2d3436;
    color: #fff;
}

/* Switch Styling - Glassmorphism Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
    transition: .4s;
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

body.day-mode .slider {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: #ff0844;
}

input:focus+.slider {
    box-shadow: 0 0 1px #ff0844;
}

input:checked+.slider:before {
    transform: translateX(24px);
}

/* Rain Effect - Snow-style Scattered Capsules */
body.weather-rain .rain {
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(1.5px 40px at 40px 60px, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1.2px 60px at 140px 140px, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1.8px 80px at 250px 300px, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1.3px 50px at 300px 50px, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 35px at 100px 250px, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1.4px 45px at 200px 200px, rgba(255, 255, 255, 0.3), transparent);
    background-size: 350px 350px;
    animation: rainRolling 0.45s linear infinite;
    z-index: 5;
    opacity: 1;
    pointer-events: none;
    transform: rotate(10deg) scale(1.2);
}

/* Stormy mood overlay */
body.weather-rain .env-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 20, 30, 0.4);
    backdrop-filter: blur(2px);
    pointer-events: none;
    z-index: 4;
}

/* Hide clouds based on weather */
body.weather-rain .clouds-container,
body.weather-clear .clouds-container,
body.weather-snow .clouds-container {
    display: none !important;
}

/* Specific visibility for rain */
body.weather-rain .stars,
body.weather-rain .sun {
    display: none !important;
}

@keyframes rainRolling {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 350px;
    }
}

/* Snow Effect */
@keyframes snowFall {
    0% {
        transform: translateY(-400px);
    }

    100% {
        transform: translateY(400px);
    }
}

/* Rain Layers */
.rain {
    display: none;
    position: absolute;
    top: -100px;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.5));
    background-size: 2px 30px;
    will-change: transform;
}

body.weather-rain .rain.layer-bg {
    display: block;
    animation: rain linear infinite;
    animation-duration: 0.5s;
    opacity: 0.3;
}

body.weather-rain .rain.layer-fg {
    display: block;
    animation: rain linear infinite;
    animation-duration: 0.3s;
    /* Faster foreground rain */
    background-size: 4px 50px;
    /* Larger drops */
    opacity: 0.6;
}

/* Snow Layers */
.snow {
    display: none;
    position: absolute;
    top: -100px;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(4px 4px at 100px 50px, #fff, transparent),
        radial-gradient(6px 6px at 200px 150px, #fff, transparent),
        radial-gradient(3px 3px at 300px 250px, #fff, transparent);
    background-size: 500px 500px;
    will-change: transform;
}

body.weather-snow .snow.layer-bg {
    display: block;
    animation: snowFall 10s linear infinite;
    opacity: 0.6;
    transform: scale(0.8);
}

body.weather-snow .snow.layer-fg {
    display: block;
    animation: snowFall 6s linear infinite;
    /* Faster/Closer */
    opacity: 0.9;
    background-size: 600px 600px;
}

/* Multi-Cloud Layer Parallax */
.clouds-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.cloud {
    position: absolute;
    background: #fff;
    border-radius: 100px;
    filter: blur(25px);
    opacity: 0.6;
    will-change: transform;
    /* Hardware acceleration hint */
    transform: translateZ(0);
}

@media (max-width: 768px) {
    .cloud {
        filter: blur(15px);
        /* Reduce blur cost on mobile */
    }
}

.cloud-1 {
    width: 400px;
    height: 120px;
    top: 10%;
    animation: drift 55s linear infinite;
    opacity: 0.4;
    z-index: 1;
    /* Behind */
}

.cloud-2 {
    width: 250px;
    height: 80px;
    top: 30%;
    left: 20%;
    animation: drift 40s linear infinite -10s;
    opacity: 0.5;
    z-index: 2;
}

.cloud-3 {
    width: 500px;
    height: 160px;
    top: 50%;
    left: -10%;
    animation: drift 25s linear infinite -5s;
    /* Faster foreground */
    opacity: 0.7;
    z-index: 21;
    /* In front of Imma */
}

.cloud-4 {
    width: 300px;
    height: 100px;
    top: 70%;
    left: 60%;
    animation: drift 30s linear infinite -15s;
    opacity: 0.65;
    z-index: 21;
    /* In front of Imma */
}

.cloud-4 {
    width: 180px;
    height: 60px;
    top: 80%;
    animation: drift 40s linear infinite -10s;
}

@keyframes drift {
    from {
        left: -600px;
    }

    to {
        left: 100vw;
    }
}

/* CELESTIAL BODIES */
.sun,
.moon {
    display: none;
    position: absolute;
    border-radius: 50%;
    filter: blur(20px);
    transition: opacity 1s ease;
    opacity: 0.8;
}

/* SUN - Top Right */
body.day-mode .sun {
    display: block;
    top: -50px;
    right: -50px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, #fff 0%, rgba(255, 107, 129, 0.4) 50%, rgba(255, 255, 255, 0) 70%);
    animation: sunGlow 6s ease-in-out infinite alternate;
}

body.day-mode.weather-cloudy .sun {
    opacity: 0.4;
}

/* MOON - Top Left */
body.night-mode .moon {
    display: block;
    top: -30px;
    left: -30px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, #ffd1dc 0%, rgba(255, 121, 148, 0.2) 60%, rgba(255, 255, 255, 0) 70%);
    box-shadow: 0 0 50px rgba(255, 121, 148, 0.1);
    animation: moonGlow 8s ease-in-out infinite alternate;
}

body.night-mode.weather-cloudy .moon {
    opacity: 0.3;
}

/* Hide celebrities during heavy weather */
body.weather-rain .sun,
body.weather-rain .moon,
body.weather-snow .sun,
body.weather-snow .moon {
    display: none !important;
}

@keyframes sunGlow {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1.15);
        opacity: 0.9;
    }
}

@keyframes moonGlow {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.05) translate(10px, 10px);
        opacity: 0.8;
    }
}

/* STARS */
body.night-mode .stars {
    display: block;
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    box-shadow:
        15vw 12vh 0 white, 25vw 55vh 1px white, 35vw 22vh 1px white,
        45vw 85vh 0 white, 55vw 15vh 1px white, 65vw 35vh 0 white,
        75vw 95vh 1px white, 85vw 45vh 0 white, 95vw 15vh 1px white;
    opacity: 0.5;
    animation: starFlicker 4s linear infinite;
}

@keyframes starFlicker {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.7;
    }
}

/* Animations */
@keyframes rain {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 20% 100%;
    }
}

@keyframes snow {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 50px 550px;
    }
}

@keyframes floatCloud {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100vw);
    }
}

@keyframes sunGlow {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }

    100% {
        opacity: 0.9;
        transform: scale(1.1);
    }
}

/* --- Three.js Canvas --- */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: auto;
    /* Allow dragging */
    touch-action: none;
    /* Fix mobile scroll */
}

/* --- Content Layers --- */
.track {
    height: 600vh;
    position: relative;
    z-index: 20;
}

.text-layer {
    position: absolute;
    width: 100%;
    padding: 0 1.5rem;
    text-align: center;
    opacity: 1;
    /* Fallback */
    transition: all 0.8s ease;
    pointer-events: none;
    display: flex;
    justify-content: center;
}

body.js-active .text-layer {
    opacity: 0;
    /* Hide completely instead of ghosting */
    transition: opacity 0.8s ease;
}

body.js-active .text-layer.visible {
    opacity: 1;
}

body.flight-mode .text-layer {
    opacity: 0 !important;
    pointer-events: none;
}

/* ... text-card preserved ... */
.text-card {
    background: rgba(255, 255, 255, 0.45);
    /* Fluffier/Brighter */
    backdrop-filter: blur(16px);
    padding: 35px 45px;
    border-radius: 60px;
    /* Extremely rounded/Cloud-like */
    max-width: 500px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 0 30px rgba(255, 255, 255, 0.8);
    /* Inner puff glow */
    color: #fff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: 3px solid rgba(255, 255, 255, 0.6);
    transition: transform 0.3s ease;
}

.text-card:hover {
    transform: scale(1.02) translateY(-5px);
    /* Gentle float on hover */
}

body.day-mode .text-card {
    color: #2d3436;
    background: rgba(255, 255, 255, 0.75);
}

body.night-mode .text-card {
    background: rgba(10, 10, 15, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.4),
        inset 0 0 25px rgba(0, 0, 0, 0.3);
}

/* Scroll Indicator Styling - Subtle Arrows Only */
.scroll-indicator {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.35;
    /* Even more subtle */
    transition: opacity 0.5s ease;
    z-index: 100;
}

/* Hide when scrolling starts */
body.scrolled .scroll-indicator {
    opacity: 0;
    pointer-events: none;
}

.arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.arrow span {
    display: block;
    width: 12px;
    height: 12px;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(45deg);
    margin: -4px;
    animation: arrowBounce 2s infinite;
}

body.day-mode .arrow span {
    border-color: #2d3436;
}

.arrow span:nth-child(2) {
    animation-delay: 0.2s;
}

@keyframes arrowBounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0) rotate(45deg);
        opacity: 0.3;
    }

    40% {
        transform: translateY(10px) rotate(45deg);
        opacity: 1;
    }

    60% {
        transform: translateY(5px) rotate(45deg);
        opacity: 0.8;
    }
}

/* Positioning */
#layer-exit {
    top: 65vh;
    /* Same position as Intro, but logic will toggle them */
}

#layer-0 {
    top: 65vh;
    /* Intro Page - Moved Lower */
}

#layer-1 {
    top: 145vh;
    /* Shifted down */
}

#layer-2 {
    top: 245vh;
}

#layer-bug {
    top: 345vh;
    /* New Bug Layer */
}

#layer-3 {
    top: 445vh;
}

/* --- Interaction Zone (Bottom) --- */
.interaction-zone {
    height: 100vh;
    height: 100dvh;
    position: absolute;
    bottom: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    pointer-events: none;
    /* Let clicks pass through zone generally */
    z-index: 2000000;
}

.buttons-container {
    position: absolute;
    /* Floating independently */
    bottom: 15vh;
    width: 100%;
    height: 180px;
    /* Taller for vertical stack */
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    /* Buttons are clickable */
    z-index: 2000000;
}

button {
    font-family: 'Fredoka', sans-serif;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 1px;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    -webkit-tap-highlight-color: transparent;
}

#btn-yes {
    position: absolute;
    left: 50%;
    top: 35%;
    /* Upper half */
    transform: translate(-50%, -50%);

    background: linear-gradient(135deg, #ff9a9e 0%, #ff6b81 100%);
    color: white;
    font-size: 1.8rem;
    /* Larger */
    padding: 1.2rem 4rem;
    /* Wider */
    box-shadow: 0 8px 30px rgba(255, 107, 129, 0.6);
    /* Stronger glow */
    z-index: 2147483647;
    white-space: nowrap;
}

#btn-no {
    position: absolute;
    left: 50%;
    /* Centered horizontally */
    top: 80%;
    /* Below Yes */
    transform: translate(-50%, -50%);
    /* Center origin */

    background: #ffffff;
    color: #636e72;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 2147483647;
    /* Slightly below Yes visually if overlaps (won't) */
    white-space: nowrap;
    transition: all 0.3s ease;
}

body.night-mode #btn-no {
    background: rgba(255, 255, 255, 0.85);
    color: #2d3436;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Bubbles (Styled like .text-card) */
.bubble {
    position: absolute;
    left: 50%;
    transform: translateX(-50%) scale(0);

    /* Text Card Properties: Glassmorphism */
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 3px solid rgba(255, 255, 255, 0.6);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 0 30px rgba(255, 255, 255, 0.8);

    color: #fff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);

    padding: 3rem 4.5rem;
    border-radius: 60px;
    /* Fully rounded */

    font-size: 2.2rem;
    font-weight: 800;
    /* Extra bold */
    text-align: center;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 90;
    width: auto;
    min-width: 400px;
    max-width: 95%;
    pointer-events: auto;

    /* Center Origin */
    transform: translate(-50%, -50%) scale(0);
}

body.day-mode .bubble {
    color: #2d3436;
    background: rgba(255, 255, 255, 0.85);
    /* Slightly more opaque for readability */
}

body.night-mode .bubble {
    background: rgba(20, 20, 25, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.5),
        inset 0 0 30px rgba(0, 0, 0, 0.4);
}

.bubble.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

#question-bubble {
    top: 45%;
    /* Vertically centered (slightly higher to accommodate buttons) */
    bottom: auto;
    margin-bottom: 0;
}

#success-bubble {
    top: 50%;
    /* Dead center for success */
    bottom: auto;
    z-index: 200;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 5px;
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 20px 15px 15px 15px;
    /* More top padding for fade space */
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    z-index: 200;
    transition: color 1s ease;
}

footer::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Adaptive Gradient to Match Background */
    background: linear-gradient(to top, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: -1;
    mask-image: linear-gradient(to top, black 30%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, black 30%, transparent 100%);
    pointer-events: none;
}

body.night-mode footer::before {
    background: linear-gradient(to top, rgba(15, 23, 42, 0.15), rgba(15, 23, 42, 0));
}

/* --- 404 ERROR PAGE STYLES --- */
.loading-screen.error-mode {
    background: rgba(255, 255, 255, 0.6);
    /* Slightly more transparent */
    pointer-events: auto;
    /* Always interactive */
    cursor: default;
    display: flex;
    justify-content: center;
    align-items: center;
}

.error-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
}

body.night-mode .loading-screen.error-mode {
    background: rgba(15, 23, 42, 0.8);
}

.loader-mascot.large-mascot {
    width: 280px;
    height: 280px;
    margin-bottom: 10px;
}

.error-title {
    font-size: 8rem;
    font-weight: 800;
    line-height: 1;
    margin: 0;
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #ff0844, #ffb199);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 10px rgba(255, 8, 68, 0.2));
}

.error-text {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.return-btn {
    display: inline-block;
    padding: 12px 30px;
    background: #ff0844;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(255, 8, 68, 0.3);
}

.return-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 8, 68, 0.4);
}

body.day-mode footer {
    color: rgba(45, 52, 54, 0.8);
}

.text-card.tutorial {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 25px 35px;
    border-radius: 40px;
    font-size: 1.1rem;
    max-width: 320px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    border: 3px solid rgba(255, 255, 255, 0.7);
    color: #ff0844;
    font-weight: 700;
}

body.night-mode .text-card.tutorial {
    background: rgba(15, 15, 20, 0.85);
}

#layer-tutorial {
    position: fixed;
    top: 65%;
    left: 0;
    width: 100%;
    z-index: 1000000;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#layer-tutorial.visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}