/* ========== TOKENS & CUSTOM PROPERTIES ========== */
:root {
    --space-black: #020105;
    --midnight-blue: rgba(10, 25, 47, 0.4);
    --nebula-deep: rgba(13, 17, 38, 0.5);
    --star-white: #ffffff;
    --star-cold-blue: #a5d8ff;

    --accent-cyan: #4cc9f0;
    --accent-blue: #4361ee;
    --accent-pink: #f72585;
    --accent-purple: #7209b7;
    --accent-orange: #f77f00;
    --accent-yellow: #f4d03f;
    --accent-rose: #e91e8c;
    --accent-teal: #4ecdc4;

    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-bg-hover: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.10);
    --glass-border-active: rgba(255, 255, 255, 0.22);

    --font-main: 'Outfit', sans-serif;
    --text-muted: rgba(255, 255, 255, 0.45);
    --radius-card: 18px;
    --transition-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== GLOBAL SCROLLBARS ========== */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(247, 37, 133, 0.3) transparent;

    &::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }

    &::-webkit-scrollbar-track {
        background: transparent;
    }

    &::-webkit-scrollbar-thumb {
        background: rgba(247, 37, 133, 0.3);
        border-radius: 10px;
        transition: background 0.2s;

        &:hover {
            background: rgba(247, 37, 133, 0.7);
        }
    }

    &::-webkit-scrollbar-corner {
        background: transparent;
    }
}

/* ========== LOADING SCREEN ========== */
#love-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #020105;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: loaderFadeOut 0.7s ease 2.8s forwards;

    @keyframes loaderFadeOut {
        to {
            opacity: 0;
            pointer-events: none;
        }
    }

    .loader-inner {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 18px;
    }

    .loader-photo-wrap {
        position: relative;
        width: 160px;
        height: 160px;
    }

    .loader-photo {
        width: 160px;
        height: 160px;
        border-radius: 50%;
        object-fit: cover;
        border: 3px solid rgba(247, 37, 133, 0.5);
        animation: loaderPulse 2s ease infinite;
    }

    .loader-photo-glow {
        position: absolute;
        inset: -8px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(247, 37, 133, 0.2) 0%, transparent 70%);
        animation: loaderPulse 2s ease infinite;
    }

    @keyframes loaderPulse {

        0%,
        100% {
            transform: scale(1);
            opacity: 0.8;
        }

        50% {
            transform: scale(1.04);
            opacity: 1;
        }
    }

    .loader-names {
        font-size: 2rem;
        font-weight: 600;
        color: #fff;
        letter-spacing: 1px;

        span {
            color: #f72585;
            margin: 0 8px;
        }
    }

    .loader-sub {
        font-size: 0.9rem;
        color: rgba(255, 255, 255, 0.45);
    }

    .loader-dots {
        display: flex;
        gap: 8px;
        margin-top: 8px;

        span {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: rgba(247, 37, 133, 0.5);
            animation: dotBounce 1.2s ease infinite;

            &:nth-child(2) {
                animation-delay: 0.2s;
            }

            &:nth-child(3) {
                animation-delay: 0.4s;
            }
        }
    }

    @keyframes dotBounce {

        0%,
        80%,
        100% {
            transform: scale(0.7);
            opacity: 0.4;
        }

        40% {
            transform: scale(1);
            opacity: 1;
        }
    }
}

.loader-avatar {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    animation: loaderPulse 2s ease infinite;
    filter: drop-shadow(0 0 20px rgba(247, 37, 133, 0.4));
}

/* ========== RESET & BASE ========== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    font-family: var(--font-main);
    color: var(--star-white);
}

body {
    min-height: 100vh;
    overflow: hidden;
}

[hidden] {
    display: none !important;
}

.contain {
    max-width: 1170px;
    margin-inline: auto;
    padding-inline: 2rem;
}


/* ========== GALAXY BACKGROUND ========== */
.galaxy-wrapper {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--space-black);
    overflow: hidden;

    .layer {
        position: absolute;
        top: -10%;
        left: -10%;
        width: 120%;
        height: 120%;
    }

    .nebula {
        background:
            radial-gradient(circle at 20% 30%, var(--midnight-blue), transparent 60%),
            radial-gradient(circle at 80% 70%, var(--nebula-deep), transparent 50%),
            radial-gradient(circle at 50% 50%, #000, transparent 70%);
        filter: blur(80px);
        opacity: 0.9;
        animation: nebulaDrift 40s ease-in-out infinite alternate;
    }

    .stars-large {
        background-image:
            radial-gradient(4px 4px at 100px 150px, #fff, rgba(0, 0, 0, 0)),
            radial-gradient(6px 6px at 400px 200px, var(--accent-pink), rgba(0, 0, 0, 0)),
            radial-gradient(3px 3px at 700px 450px, var(--accent-cyan), rgba(0, 0, 0, 0)),
            radial-gradient(2px 2px at 300px 10px, #eee, rgba(0, 0, 0, 0));
        background-size: 800px 800px;
        opacity: 0.8;
        animation: warpSpeed 50s linear infinite;
    }

    .stars-medium {
        background-image:
            radial-gradient(1px 1px at 20px 30px, var(--star-white), transparent),
            radial-gradient(1.5px 1.5px at 100px 150px, var(--star-cold-blue), transparent);
        background-size: 300px 300px;
        animation: warpSpeed 30s linear infinite, coldTwinkle 5s ease-in-out infinite;
    }

    .stars-small {
        background-image:
            radial-gradient(1px 1px at 10px 10px, #fff, rgba(0, 0, 0, 0)),
            radial-gradient(1px 1px at 50px 100px, #fff, rgba(0, 0, 0, 0)),
            radial-gradient(1px 1px at 150px 40px, #fff, rgba(0, 0, 0, 0)),
            radial-gradient(1px 1px at 190px 190px, #fff, rgba(0, 0, 0, 0));
        background-size: 200px 200px;
        opacity: 0.3;
        animation: warpSpeed 20s linear infinite;
    }

    .heart-particle {
        position: absolute;
        color: var(--accent-pink);
        opacity: 0;
        animation: heartFloat 12s ease-in-out infinite;
        pointer-events: none;
    }

    .planet {
        border-radius: 50%;
        position: absolute;
        filter: blur(1px);
        z-index: 2;

        &.gas-giant {
            width: 250px;
            height: 250px;
            top: 15%;
            right: 10%;
            background: radial-gradient(circle at 30% 30%, #1e3a8a, #0f172a);
            box-shadow: inset -30px -30px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(30, 58, 138, 0.2);

            &::after {
                content: '';
                position: absolute;
                top: 50%;
                left: 50%;
                width: 160%;
                height: 20%;
                border: 2px solid rgba(255, 255, 255, 0.05);
                border-radius: 50%;
                transform: translate(-50%, -50%) rotate(-15deg);
                box-shadow: 0 0 10px rgba(255, 255, 255, 0.02);
            }
        }

        &.ice-world {
            width: 120px;
            height: 120px;
            bottom: 20%;
            left: 15%;
            background: radial-gradient(circle at 35% 35%, #94a3b8, #334155);
            box-shadow: inset -15px -15px 30px rgba(0, 0, 0, 0.9), 0 0 20px rgba(148, 163, 184, 0.1);
            opacity: 0.5;
        }
    }
}

/* ========== MUSIC COCKPIT ========== */
.music-cockpit {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--midnight-blue);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    padding: 8px 16px 8px 8px;
    border-radius: 50px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 300px;
    overflow: hidden;

    &:hover {
        background: rgba(15, 23, 42, 0.9);
        border-color: var(--accent-pink);
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(247, 37, 133, 0.15);
    }

    /* Spinning disc */
    .cockpit-disc-btn {
        flex-shrink: 0;
        cursor: pointer;
    }

    .cockpit-art {
        width: 34px;
        height: 34px;
        background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        animation: rotateDisc 4s linear infinite;
        animation-play-state: paused;
        transition: box-shadow 0.3s ease;

        i {
            color: #fff;
            font-size: 1rem;
            animation: rotateDiscReverse 4s linear infinite;
            animation-play-state: paused;
        }
    }

    &.playing .cockpit-art {
        animation-play-state: running;
        box-shadow: 0 0 12px rgba(247, 37, 133, 0.5);

        i {
            animation-play-state: running;
        }
    }

    /* Full cockpit content */
    .cockpit-full {
        display: flex;
        align-items: center;
        gap: 12px;
        overflow: hidden;
        max-width: 260px;
        opacity: 1;
        transition:
            max-width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
            opacity 0.3s ease,
            padding 0.3s ease;
        padding-left: 12px;
    }

    .cockpit-info {
        display: flex;
        flex-direction: column;
        overflow: hidden;
        min-width: 0;
        flex: 1;
    }

    .cockpit-title {
        color: var(--star-white);
        font-size: 0.8rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .cockpit-artist {
        color: rgba(255, 255, 255, 0.5);
        font-size: 0.65rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .cockpit-controls {
        display: flex;
        gap: 4px;
        border-left: 1px solid var(--glass-border);
        padding-left: 10px;
        align-items: center;
        flex-shrink: 0;
    }

    .cockpit-btn {
        background: transparent;
        border: none;
        color: var(--star-white);
        font-size: 1.1rem;
        cursor: pointer;
        transition: color 0.2s ease, transform 0.2s ease;
        outline: none;
        line-height: 1;

        &:hover {
            color: var(--accent-pink);
            transform: scale(1.15);
        }
    }

    /* Collapsed state */
    &.cockpit-collapsed {
        padding: 8px;
        max-width: 52px;
        border-radius: 50%;

        .cockpit-full {
            max-width: 0;
            opacity: 0;
            padding-left: 0;
            pointer-events: none;
        }
    }

    &.cockpit-collapsed.cockpit-force-expand {
        padding: 8px 16px 8px 8px;
        max-width: 300px;
        border-radius: 50px;

        .cockpit-full {
            max-width: 260px;
            opacity: 1;
            padding-left: 12px;
            pointer-events: all;
        }
    }

    &.playing.cockpit-collapsed .cockpit-art,
    &.playing.cockpit-force-expand .cockpit-art {
        animation-play-state: running;
        box-shadow: 0 0 12px rgba(247, 37, 133, 0.5);
    }
}

/* Mobile cockpit */
@media (max-width: 640px) {
    .music-cockpit:not(.cockpit-collapsed) {
        left: 50% !important;
        transform: translateX(-50%);
        bottom: 10px !important;
        width: 320px;
        border-radius: 160px !important;
        max-width: 100% !important;
        padding: 10px 10px !important;
        border-bottom: none !important;

        .cockpit-full {
            max-width: 100%;
            flex: 1;
        }
    }

    .music-cockpit.cockpit-collapsed {
        left: 16px !important;
        right: auto !important;
        bottom: 16px !important;
        border-radius: 50% !important;
        max-width: 52px !important;
        padding: 8px !important;
        width: 52px !important;
        height: 52px !important;
    }

    .music-cockpit.cockpit-collapsed.cockpit-force-expand {
        border-radius: 160px !important;
        left: 50% !important;
        transform: translateX(-50%);
        bottom: 10px !important;
        width: 320px;
        max-width: 100% !important;
        padding: 10px !important;
        width: auto !important;
        height: auto !important;
        border: unset;
    }
}


/* ========== APP CONTAINER ========== */
.app-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}


/* ========== VIEW SECTIONS (shared) ========== */
.view-section {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100%;

    /* fade + slide transition */
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity 0.45s var(--transition-smooth), transform 0.45s var(--transition-smooth);

    &::before {
        content: '';
        flex: 1;
        max-height: 50vh;
    }

    &::after {
        content: '';
        flex: 1;
        max-height: 50vh;
    }

    &.active {
        opacity: 1;
        pointer-events: all;
        transform: translateY(0);
    }

    /* Shared back button — fixed inside the section */
    .back-nav {
        position: fixed;
        top: 24px;
        left: 24px;
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 18px;
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        border-radius: 50px;
        color: var(--star-white);
        font-family: var(--font-main);
        font-size: 0.85rem;
        cursor: pointer;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        z-index: 50;
        transition: all 0.3s ease;

        &:hover {
            border-color: var(--accent-cyan);
            background: rgba(255, 255, 255, 0.08);
        }

        i {
            font-size: 1rem;
        }
    }

    /* Shared page title */
    .page-title {
        font-size: clamp(1.5rem, 4vw, 2rem);
        font-weight: 600;
        letter-spacing: -0.5px;
        text-align: center;
        text-shadow: 0 0 30px rgba(76, 201, 240, 0.3);
    }
}

/* Mobile bottom safe padding (for music bar) */
@media (max-width: 640px) {
    .view-section {
        padding-bottom: 90px;
        padding-inline: 16px;
    }
}

/* ========== DASHBOARD ========== */
#view-dashboard {
    justify-content: flex-start;
    min-height: 100%;
    padding: 80px 16px 100px;

    @media (max-width: 640px) {
        padding: 80px 12px 110px;
    }

    .dashboard-header {
        text-align: center;
        margin-bottom: 24px;

        h1 {
            font-size: clamp(1.6rem, 5vw, 2.8rem);
            font-weight: 700;
            letter-spacing: -1px;
            color: var(--star-white);
            text-shadow: 0 0 40px rgba(76, 201, 240, 0.4);

            .name-hers {
                color: var(--accent-pink);
            }

            .name-his {
                color: var(--accent-cyan);
            }
        }

        p {
            margin-top: 6px;
            color: var(--text-muted);
            font-weight: 300;
            font-size: 0.95rem;
        }
    }

    /* View toggle pill */
    .view-toggle {
        display: flex;
        align-items: center;
        background: var(--glass-bg);
        backdrop-filter: blur(10px);
        border: 1px solid var(--glass-border);
        border-radius: 100px;
        padding: 5px;
        margin-bottom: 28px;
        align-self: center;

        .toggle-btn {
            background: transparent;
            border: none;
            color: rgba(255, 255, 255, 0.45);
            padding: 9px 24px;
            border-radius: 100px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 7px;
            font-family: var(--font-main);
            font-size: 0.9rem;
            font-weight: 500;
            transition: all 0.35s var(--transition-bounce);

            i {
                font-size: 1rem;
            }

            &.active {
                background: rgba(255, 255, 255, 0.10);
                color: #fff;
            }

            &:hover:not(.active) {
                color: var(--accent-cyan);
            }
        }

        .divider {
            width: 1px;
            height: 18px;
            background: var(--glass-border);
            margin: 0 4px;
        }
    }

    /* ── GRID LAYOUT ── */
    #layout-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
        width: 100%;
        max-width: 860px;

        .nav-card {
            position: relative;
            background: var(--glass-bg);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-card);
            padding: 28px 20px 36px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 10px;
            cursor: pointer;
            overflow: hidden;
            transition:
                transform 0.35s var(--transition-bounce),
                background 0.3s ease,
                border-color 0.3s ease;
            aspect-ratio: 1 / 1;

            i {
                font-size: 2rem;
                color: var(--star-white);
                opacity: 0.75;
                transition: transform 0.3s ease, color 0.3s ease, opacity 0.3s ease;
            }

            h3 {
                font-family: var(--font-main);
                font-size: 0.88rem;
                font-weight: 500;
                color: var(--star-white);
                text-align: center;
                line-height: 1.3;
                margin: 0;
            }

            p {
                font-size: 0.72rem;
                color: var(--text-muted);
                text-align: center;
                line-height: 1.4;
                margin: 0;
            }

            &:hover {
                transform: translateY(-6px) scale(1.02);
                background: var(--glass-bg-hover);
                border-color: var(--glass-border-active);

                i {
                    transform: scale(1.15) rotate(6deg);
                    opacity: 1;
                }
            }

            /* Colored bottom accent bar */
            .border-glow {
                position: absolute;
                bottom: 0;
                left: 0;
                width: 100%;
                height: 3px;
                border-radius: 0 0 var(--radius-card) var(--radius-card);
                transition: height 0.3s ease, opacity 0.3s ease;

                &.glow-blue {
                    background: var(--accent-blue);
                    box-shadow: 0 0 12px var(--accent-blue);
                }

                &.glow-cyan {
                    background: var(--accent-cyan);
                    box-shadow: 0 0 12px var(--accent-cyan);
                }

                &.glow-pink {
                    background: var(--accent-pink);
                    box-shadow: 0 0 12px var(--accent-pink);
                }

                &.glow-purple {
                    background: var(--accent-purple);
                    box-shadow: 0 0 12px var(--accent-purple);
                }

                &.glow-orange {
                    background: var(--accent-orange);
                    box-shadow: 0 0 12px var(--accent-orange);
                }

                &.glow-yellow {
                    background: var(--accent-yellow);
                    box-shadow: 0 0 12px var(--accent-yellow);
                }

                &.glow-rose {
                    background: var(--accent-rose);
                    box-shadow: 0 0 12px var(--accent-rose);
                }

                &.glow-teal {
                    background: var(--accent-teal);
                    box-shadow: 0 0 12px var(--accent-teal);
                }
            }

            &:hover .border-glow {
                height: 4px;
                opacity: 1;
            }
        }

        @media (max-width: 768px) {
            grid-template-columns: repeat(2, 1fr);
            max-width: 420px;
            gap: 12px;
        }

        @media (max-width: 640px) {
            grid-template-columns: repeat(2, 1fr);
            max-width: 100%;
            gap: 16px;
            padding: 0 4px;

            .nav-card {
                padding: 20px 12px 28px;
                aspect-ratio: 1 / 1;

                i {
                    font-size: 1.6rem;
                }

                h3 {
                    font-size: 0.78rem;
                }

                p {
                    display: none;
                }
            }
        }
    }

    /* ── ORBIT LAYOUT ── */
    #layout-orbit {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: default;
        flex-shrink: 0;
    }

    #orbit-rings-svg {
        position: absolute;
        inset: 0;
        pointer-events: none;
        overflow: visible;
    }

    .orbit-center {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 20;
        width: 68px;
        height: 68px;
        border-radius: 50%;
        background: var(--star-white);
        box-shadow:
            0 0 15px 6px rgba(255, 255, 255, 0.98),
            0 0 35px 15px rgba(255, 255, 255, 0.75),
            0 0 70px 30px rgba(165, 216, 255, 0.40),
            0 0 120px 60px rgba(165, 216, 255, 0.15);
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: var(--font-main);
        font-weight: 800;
        font-size: 0.68rem;
        color: var(--space-black);
        letter-spacing: 0.5px;
        text-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
        animation: starPulse 3.5s ease-in-out infinite;
        user-select: none;
        pointer-events: none;
    }

    .orbit-planet {
        position: absolute;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        background: radial-gradient(circle at 33% 30%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03) 65%, rgba(0, 0, 0, 0.4));
        border: 1px solid rgba(255, 255, 255, 0.15);
        box-shadow: inset -4px -4px 10px rgba(0, 0, 0, 0.5);
        transition: border-color 0.3s ease, filter 0.3s ease;

        &::before {
            content: '';
            position: absolute;
            top: 12%;
            left: 16%;
            width: 30%;
            height: 25%;
            background: rgba(255, 255, 255, 0.35);
            border-radius: 50%;
            filter: blur(2px);
            pointer-events: none;
            z-index: 1;
        }

        &:hover {
            filter: brightness(1.2);
            z-index: 50 !important;

            .planet-label {
                opacity: 1;
                transform: translateX(-50%) translateY(-2px);
            }
        }
    }

    .planet-icon-badge {
        position: relative;
        z-index: 2;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;

        i {
            font-size: 1.1em;
            color: #fff;
            opacity: 1;
            line-height: 1;
            transition: transform 0.3s ease, filter 0.3s ease;
        }
    }

    .planet-label {
        position: absolute;
        bottom: calc(100% + 6px);
        left: 50%;
        transform: translateX(-50%);
        white-space: nowrap;
        font-family: var(--font-main);
        font-size: 0.65rem;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.95);
        background: rgba(2, 1, 8, 0.82);
        backdrop-filter: blur(6px);
        padding: 3px 9px;
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.12);
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.2s ease, transform 0.2s ease;
        z-index: 60;
    }

    /* Planet color systems */
    .planet-blue {
        &:hover {
            border-color: var(--accent-blue);
        }

        i {
            color: var(--accent-blue);
            filter: drop-shadow(0 0 6px var(--accent-blue)) drop-shadow(0 0 12px var(--accent-blue));
        }

        &:hover i {
            filter: drop-shadow(0 0 10px var(--accent-blue)) drop-shadow(0 0 20px var(--accent-blue));
            transform: scale(1.2);
        }
    }

    .planet-cyan {
        &:hover {
            border-color: var(--accent-cyan);
        }

        i {
            color: var(--accent-cyan);
            filter: drop-shadow(0 0 6px var(--accent-cyan)) drop-shadow(0 0 12px var(--accent-cyan));
        }

        &:hover i {
            filter: drop-shadow(0 0 10px var(--accent-cyan)) drop-shadow(0 0 20px var(--accent-cyan));
            transform: scale(1.2);
        }
    }

    .planet-orange {
        &:hover {
            border-color: var(--accent-orange);
        }

        i {
            color: var(--accent-orange);
            filter: drop-shadow(0 0 6px var(--accent-orange)) drop-shadow(0 0 12px var(--accent-orange));
        }

        &:hover i {
            filter: drop-shadow(0 0 10px var(--accent-orange)) drop-shadow(0 0 20px var(--accent-orange));
            transform: scale(1.2);
        }
    }

    .planet-purple {
        &:hover {
            border-color: var(--accent-purple);
        }

        i {
            color: var(--accent-purple);
            filter: drop-shadow(0 0 6px var(--accent-purple)) drop-shadow(0 0 12px var(--accent-purple));
        }

        &:hover i {
            filter: drop-shadow(0 0 10px var(--accent-purple)) drop-shadow(0 0 20px var(--accent-purple));
            transform: scale(1.2);
        }
    }

    .planet-pink {
        &:hover {
            border-color: var(--accent-pink);
        }

        i {
            color: var(--accent-pink);
            filter: drop-shadow(0 0 6px var(--accent-pink)) drop-shadow(0 0 12px var(--accent-pink));
        }

        &:hover i {
            filter: drop-shadow(0 0 10px var(--accent-pink)) drop-shadow(0 0 20px var(--accent-pink));
            transform: scale(1.2);
        }
    }

    .planet-yellow {
        &:hover {
            border-color: var(--accent-yellow);
        }

        i {
            color: var(--accent-yellow);
            filter: drop-shadow(0 0 6px var(--accent-yellow)) drop-shadow(0 0 12px var(--accent-yellow));
        }

        &:hover i {
            filter: drop-shadow(0 0 10px var(--accent-yellow)) drop-shadow(0 0 20px var(--accent-yellow));
            transform: scale(1.2);
        }
    }

    .planet-rose {
        &:hover {
            border-color: var(--accent-rose);
        }

        i {
            color: var(--accent-rose);
            filter: drop-shadow(0 0 6px var(--accent-rose)) drop-shadow(0 0 12px var(--accent-rose));
        }

        &:hover i {
            filter: drop-shadow(0 0 10px var(--accent-rose)) drop-shadow(0 0 20px var(--accent-rose));
            transform: scale(1.2);
        }
    }

    .planet-teal {
        &:hover {
            border-color: var(--accent-teal);
        }

        i {
            color: var(--accent-teal);
            filter: drop-shadow(0 0 6px var(--accent-teal)) drop-shadow(0 0 12px var(--accent-teal));
        }

        &:hover i {
            filter: drop-shadow(0 0 10px var(--accent-teal)) drop-shadow(0 0 20px var(--accent-teal));
            transform: scale(1.2);
        }
    }
}

@keyframes starPulse {

    0%,
    100% {
        box-shadow:
            0 0 15px 6px rgba(255, 255, 255, 0.98),
            0 0 35px 15px rgba(255, 255, 255, 0.75),
            0 0 70px 30px rgba(165, 216, 255, 0.40),
            0 0 120px 60px rgba(165, 216, 255, 0.15);
    }

    50% {
        box-shadow:
            0 0 22px 10px rgba(255, 255, 255, 1.00),
            0 0 45px 22px rgba(255, 255, 255, 0.85),
            0 0 90px 40px rgba(165, 216, 255, 0.55),
            0 0 150px 75px rgba(165, 216, 255, 0.22);
    }
}


/* ========== GLASS PANEL (shared across sub-views) ========== */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    width: 100%;
    max-width: 640px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    h3 {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--star-white);
        margin-bottom: 16px;
    }
}

@media (max-width: 640px) {
    .glass-panel {
        padding: 20px 16px;
        border-radius: 18px;
    }
}

/* ========== JOURNEY / TIMELINE ========== */
#view-journey {
    /* FIX: center content; padding-top clears the fixed back button */
    justify-content: flex-start;
    padding: 90px 20px 100px;

    @media (max-width: 640px) {
        padding: 80px 18px 110px;
    }

    .page-title {
        margin-bottom: 40px;
    }

    /* Timeline wrapper — owns the spine */
    .tl-wrapper {
        position: relative;
        width: 100%;
        max-width: 860px;
    }

    /* Spine line */
    .tl-spine {
        position: absolute;
        left: 50%;
        top: 0;
        bottom: 0;
        width: 2px;
        transform: translateX(-50%);
        background: rgba(247, 37, 133, 0.15);
        border-radius: 2px;
        overflow: hidden;

        .tl-spine-fill {
            width: 100%;
            height: 0%;
            background: linear-gradient(to bottom, var(--accent-pink), rgba(247, 37, 133, 0.3));
            border-radius: 2px;
            transition: height 0.1s linear;
        }
    }

    /* Each timeline row */
    .tl-item {
        position: relative;
        display: grid;
        grid-template-columns: 1fr 60px 1fr;
        align-items: start;
        margin-bottom: 64px;
    }

    /* Center column */
    .tl-node {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        position: relative;
        z-index: 5;
        padding-top: 4px;
    }

    .tl-date {
        font-size: 0.68rem;
        letter-spacing: 1.5px;
        text-transform: uppercase;
        color: var(--accent-pink);
        white-space: nowrap;
        font-weight: 600;
        text-shadow: 0 0 8px rgba(247, 37, 133, 0.5);
    }

    .tl-dot {
        width: 34px;
        height: 34px;
        border-radius: 50%;
        background: var(--space-black);
        border: 2px solid var(--accent-pink);
        box-shadow: 0 0 10px rgba(247, 37, 133, 0.4), inset 0 0 6px rgba(247, 37, 133, 0.1);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;

        i {
            font-size: 0.8rem;
            color: var(--accent-pink);
        }
    }

    .tl-connector {
        width: 2px;
        height: 28px;
        background: linear-gradient(to bottom, var(--accent-pink), rgba(247, 37, 133, 0.1));
        border-radius: 2px;
        flex-shrink: 0;
    }

    /* Cards */
    .tl-card {
        position: relative;
        background: rgba(247, 37, 133, 0.06);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(247, 37, 133, 0.3);
        border-radius: 16px;
        padding: 18px 22px;
        box-shadow: 0 0 20px rgba(247, 37, 133, 0.08), inset 0 0 20px rgba(247, 37, 133, 0.04);
        margin-top: 10px;
        opacity: 0;
        transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;

        &:hover {
            box-shadow: 0 0 30px rgba(247, 37, 133, 0.18), inset 0 0 20px rgba(247, 37, 133, 0.07);
            border-color: rgba(247, 37, 133, 0.55);
        }

        .tl-title {
            font-size: 0.95rem;
            font-weight: 700;
            color: var(--star-white);
            margin-bottom: 6px;
        }

        p {
            color: var(--text-muted);
            font-size: 0.82rem;
            line-height: 1.6;
            margin: 0;
        }

        &.visible {
            opacity: 1;
            transform: translateX(0) !important;
        }
    }

    /* Card actions (edit/delete) */
    .tl-card-actions {
        position: absolute;
        top: 10px;
        right: 10px;
        display: flex;
        gap: 6px;
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .tl-card:hover .tl-card-actions {
        opacity: 1;
    }

    /* Left item: card | node | empty */
    .tl-left {
        .tl-card {
            grid-column: 1;
            grid-row: 1;
            transform: translateX(-30px);
        }

        .tl-node {
            grid-column: 2;
            grid-row: 1;
        }

        &::after {
            content: '';
            grid-column: 3;
            grid-row: 1;
        }
    }

    /* Right item: empty | node | card */
    .tl-right {
        &::before {
            content: '';
            grid-column: 1;
            grid-row: 1;
        }

        .tl-node {
            grid-column: 2;
            grid-row: 1;
        }

        .tl-card {
            grid-column: 3;
            grid-row: 1;
            transform: translateX(30px);
        }
    }

    /* Mobile: single column */
    @media (max-width: 640px) {
        .tl-wrapper {
            max-width: 100%;
        }

        .tl-item {
            grid-template-columns: 40px 1fr;
            margin-bottom: 40px;
        }

        .tl-spine {
            left: 20px;
        }

        .tl-left .tl-node,
        .tl-right .tl-node {
            grid-column: 1;
            grid-row: 1;
        }

        .tl-date {
            font-size: 0.65rem;
        }

        .tl-left .tl-card,
        .tl-right .tl-card {
            grid-column: 2;
            grid-row: 1;
            transform: translateX(20px) !important;
            margin-top: 0;
        }

        .tl-left::after,
        .tl-right::before {
            display: none;
        }

        .tl-card.visible {
            transform: translateX(0) !important;
        }
    }
}

/* Journey FAB */
.tl-add-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(247, 37, 133, 0.4);
    z-index: 999;
    transition: transform 0.3s var(--transition-bounce), box-shadow 0.3s ease;

    &:hover {
        transform: scale(1.12) rotate(90deg);
        box-shadow: 0 6px 28px rgba(247, 37, 133, 0.6);
    }
}

/* Shared action buttons for timeline/calendar cards */
.tl-action-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;

    &:hover {
        color: var(--accent-cyan);
        border-color: var(--accent-cyan);
    }

    &.danger:hover {
        color: var(--accent-pink);
        border-color: var(--accent-pink);
    }
}

@media (max-width: 640px) {

    .tl-add-btn,
    .cal-add-btn {
        bottom: 80px;
    }
}

/* ========== STAR CALENDAR ========== */
#view-calendar {
    /* FIX: center content vertically */
    justify-content: center;
    padding: 90px 20px 110px;
    align-items: center;

    @media (max-width: 640px) {
        padding: 80px 12px 120px;
    }

    .page-title {
        margin-bottom: 28px;
    }

    /* Calendar panel uses .glass-panel — scoped overrides here */
    .calendar-wrapper {
        width: 100%;

        .calendar-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;

            h3 {
                font-size: 1.1rem;
                font-weight: 600;
            }

            button {
                background: transparent;
                border: 1px solid var(--glass-border);
                border-radius: 50%;
                width: 32px;
                height: 32px;
                color: var(--star-white);
                cursor: pointer;
                display: flex;
                align-items: center;
                justify-content: center;
                transition: border-color 0.2s ease;

                &:hover {
                    border-color: var(--accent-cyan);
                    color: var(--accent-cyan);
                }
            }
        }

        .calendar-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 6px;
            margin-bottom: 6px;

            .calendar-day-header {
                text-align: center;
                font-size: 0.7rem;
                color: var(--text-muted);
                padding: 4px 0;
                text-transform: uppercase;
                letter-spacing: 1px;
            }

            .calendar-day {
                aspect-ratio: 1;
                display: flex;
                align-items: center;
                justify-content: center;
                border-radius: 8px;
                font-size: 0.8rem;
                cursor: pointer;
                transition: background 0.2s ease;

                &:hover {
                    background: var(--glass-bg-hover);
                }

                &.today {
                    background: var(--accent-cyan);
                    color: var(--space-black);
                    font-weight: 700;
                }

                &.has-event {
                    border: 1px solid var(--accent-pink);
                    color: var(--accent-pink);
                }
            }
        }
    }
}

/* Calendar event list — global (rendered outside #view-calendar) */
.cal-event-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: border-color 0.2s ease;

    &:hover {
        border-color: rgba(247, 37, 133, 0.35);
    }

    .cal-event-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .cal-event-date {
        font-size: 0.7rem;
        color: var(--accent-pink);
        font-weight: 600;
        letter-spacing: 0.5px;
        text-transform: uppercase;
    }

    .cal-event-text {
        font-size: 0.85rem;
        color: var(--star-white);
    }

    .cal-event-actions {
        display: flex;
        gap: 6px;
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    &:hover .cal-event-actions {
        opacity: 1;
    }
}

.cal-add-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(76, 201, 240, 0.4);
    z-index: 999;
    transition: transform 0.3s var(--transition-bounce), box-shadow 0.3s ease;

    &:hover {
        transform: scale(1.12) rotate(90deg);
        box-shadow: 0 6px 28px rgba(76, 201, 240, 0.6);
    }
}

/* ========== MEMORY LANE ========== */
#view-memory {
    /* FIX: center content vertically */
    justify-content: flex-start;
    padding: 90px 20px 110px;
    align-items: center;
    gap: 24px;

    @media (max-width: 640px) {
        padding: 80px 18px 120px;
        gap: 20px;
    }

    .page-title {
        margin-bottom: 0;
    }

    /* Add-memory form panel uses .glass-panel */
    .memory-form {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 20px;
    }

    .mem-upload-row {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .mem-upload-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 9px 18px;
        background: var(--glass-bg);
        border: 1px dashed var(--glass-border);
        border-radius: 10px;
        color: var(--star-white);
        font-size: 0.88rem;
        cursor: pointer;
        transition: border-color 0.2s ease, background 0.2s ease;
        width: fit-content;

        &:hover {
            border-color: var(--accent-cyan);
            background: var(--glass-bg-hover);
        }
    }

    .mem-photo-strip {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 4px;

        .mem-strip-thumb {
            position: relative;
            width: 64px;
            height: 64px;
            border-radius: 8px;
            overflow: hidden;
            border: 1px solid var(--glass-border);

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

            .mem-strip-remove {
                position: absolute;
                top: 2px;
                right: 2px;
                width: 18px;
                height: 18px;
                border-radius: 50%;
                background: rgba(0, 0, 0, 0.7);
                border: none;
                color: #fff;
                font-size: 0.65rem;
                cursor: pointer;
                display: flex;
                align-items: center;
                justify-content: center;
                line-height: 1;

                &:hover {
                    background: var(--accent-pink);
                }
            }
        }
    }

    .mem-recorder {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 12px 16px;
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        flex-wrap: wrap;

        .mem-record-btn {
            width: 42px;
            height: 42px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
            border: none;
            color: #fff;
            font-size: 1.1rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            transition: transform 0.2s ease, box-shadow 0.2s ease;

            &:hover {
                transform: scale(1.08);
            }

            &.recording {
                background: var(--accent-pink);
                box-shadow: 0 0 0 6px rgba(247, 37, 133, 0.25);
                animation: recordPulse 1s ease-in-out infinite;
            }
        }

        .mem-recorder-info {
            display: flex;
            flex-direction: column;
            gap: 2px;
            font-size: 0.85rem;
            color: var(--text-muted);
        }
    }

    /* Memory grid */
    .memory-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 16px;
        width: 100%;
        max-width: 800px;

        @media (max-width: 640px) {
            grid-template-columns: 1fr;
            padding: 0 4px;
        }

        .memory-card {
            position: relative;
            background: var(--glass-bg);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-card);
            overflow: hidden;
            backdrop-filter: blur(10px);
            display: flex;
            flex-direction: column;
            min-height: 180px;
            cursor: pointer;
            transition: transform 0.3s var(--transition-bounce), border-color 0.3s ease;
            background-size: cover;
            background-position: center;

            &:hover {
                transform: translateY(-4px);
                border-color: var(--glass-border-active);

                .memory-card-actions {
                    opacity: 1;
                }
            }

            &.has-photo {

                .mem-title,
                .mem-note {
                    color: #fff;
                    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
                }

                .mem-date {
                    color: var(--accent-cyan);
                }
            }

            .memory-card-overlay {
                position: absolute;
                inset: 0;
                background: linear-gradient(to bottom, rgba(2, 1, 5, 0.1) 0%, rgba(2, 1, 5, 0.7) 55%, rgba(2, 1, 5, 0.95) 100%);
                z-index: 0;
            }

            .memory-card-actions {
                position: absolute;
                top: 10px;
                right: 10px;
                z-index: 10;
                opacity: 0;
                transition: opacity 0.2s ease;
            }

            .mem-photo-count {
                position: absolute;
                top: 10px;
                left: 10px;
                z-index: 10;
                background: rgba(0, 0, 0, 0.55);
                backdrop-filter: blur(6px);
                border: 1px solid var(--glass-border);
                border-radius: 20px;
                padding: 3px 10px;
                font-size: 0.72rem;
                color: #fff;
                display: flex;
                align-items: center;
                gap: 4px;
            }

            .memory-card-body {
                position: relative;
                z-index: 1;
                padding: 16px;
                flex: 1;
                display: flex;
                flex-direction: column;
                justify-content: flex-end;

                .mem-title {
                    font-weight: 600;
                    font-size: 0.95rem;
                    margin-bottom: 4px;
                }

                .mem-date {
                    font-size: 0.72rem;
                    color: var(--accent-orange);
                    margin-bottom: 6px;
                }

                .mem-note {
                    font-size: 0.8rem;
                    color: var(--text-muted);
                    line-height: 1.5;
                    margin: 0;
                }
            }

            .memory-audio-bar {
                position: relative;
                z-index: 1;
                display: flex;
                align-items: center;
                gap: 8px;
                padding: 8px 14px;
                background: rgba(0, 0, 0, 0.35);
                border-top: 1px solid var(--glass-border);
            }
        }
    }
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.96);
    z-index: 500;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    gap: 12px;

    .lightbox-close {
        position: absolute;
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        color: #fff;
        font-size: 1.3rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10;
        transition: background 0.2s ease;

        &:hover {
            background: var(--glass-bg-hover);
        }
    }

    .lightbox-header {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding-right: 60px;

        .lightbox-meta {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .lb-title {
            font-size: 1rem;
            font-weight: 600;
            color: var(--star-white);
        }

        .lb-date {
            font-size: 0.75rem;
            color: var(--accent-cyan);
        }

        .lb-counter {
            font-size: 0.8rem;
            color: var(--text-muted);
            white-space: nowrap;
        }
    }

    .lightbox-stage {
        flex: 1;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 16px;
        min-height: 0;

        .lightbox-img {
            max-width: calc(100% - 120px);
            max-height: 100%;
            object-fit: contain;
            border-radius: 12px;
            box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
        }

        .lightbox-arrow {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            background: var(--glass-bg);
            border: 1px solid var(--glass-border);
            color: #fff;
            font-size: 1.4rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            transition: background 0.2s ease, border-color 0.2s ease;

            &:hover {
                background: var(--glass-bg-hover);
                border-color: var(--accent-cyan);
            }
        }
    }

    .lightbox-footer {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;

        .lb-note {
            font-size: 0.85rem;
            color: var(--text-muted);
            text-align: center;
            max-width: 500px;
        }

        .lb-audio-bar {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            max-width: 400px;
            background: var(--glass-bg);
            border: 1px solid var(--glass-border);
            border-radius: 30px;
            padding: 6px 16px;
        }

        .lb-thumbs {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            justify-content: center;

            .lb-thumb {
                width: 52px;
                height: 52px;
                object-fit: cover;
                border-radius: 8px;
                cursor: pointer;
                border: 2px solid transparent;
                opacity: 0.6;
                transition: opacity 0.2s ease, border-color 0.2s ease;

                &:hover {
                    opacity: 0.9;
                }

                &.active {
                    border-color: var(--accent-cyan);
                    opacity: 1;
                }
            }
        }
    }
}

@keyframes recordPulse {

    0%,
    100% {
        box-shadow: 0 0 0 6px rgba(247, 37, 133, 0.25);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(247, 37, 133, 0.10);
    }
}


/* ========== LOVE QUIZ ========== */
#view-quiz {
    /* FIX: center content vertically */
    justify-content: center;
    padding: 90px 20px 110px;
    align-items: center;
    gap: 20px;

    @media (max-width: 640px) {
        padding: 80px 12px 120px;
    }

    .page-title {
        margin-bottom: 0;
    }

    /* Mode select */
    .quiz-mode-select {
        width: 100%;
        max-width: 520px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .quiz-mode-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
        width: 100%;
        margin-bottom: 20px;
    }

    .quiz-mode-card {
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        border-radius: 18px;
        padding: 28px 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        cursor: pointer;
        text-align: center;
        transition: transform 0.3s var(--transition-bounce), border-color 0.3s ease, background 0.3s ease;

        i {
            font-size: 2.2rem;
            color: var(--accent-pink);
        }

        h3 {
            font-size: 1rem;
            font-weight: 600;
        }

        p {
            font-size: 0.78rem;
            color: var(--text-muted);
            line-height: 1.4;
            margin: 0;
        }

        &:hover {
            transform: translateY(-5px);
            border-color: var(--accent-pink);
            background: rgba(247, 37, 133, 0.05);
        }
    }

    .quiz-custom-toggle {
        background: transparent;
        border: 1px dashed var(--glass-border);
        border-radius: 50px;
        color: var(--text-muted);
        font-family: var(--font-main);
        font-size: 0.82rem;
        padding: 8px 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 6px;
        transition: color 0.2s ease, border-color 0.2s ease;

        &:hover {
            color: var(--accent-cyan);
            border-color: var(--accent-cyan);
        }

        i {
            font-size: 1rem;
        }
    }

    .quiz-builder {
        margin-top: 20px;
        width: 100%;
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        border-radius: 16px;
        padding: 20px;
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    /* Player intro */
    .quiz-player-intro {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .quiz-player-badge {
        font-size: 1.5rem;
        font-weight: 700;
        padding: 16px 36px;
        border-radius: 60px;
        border: 2px solid var(--accent-pink);
        color: var(--accent-pink);
        letter-spacing: 1px;
        margin-bottom: 8px;
    }

    /* Active quiz panel uses .glass-panel */
    #quiz-panel {
        position: relative;
        padding-top: 60px;

        .quiz-progress {
            font-size: 0.72rem;
            text-transform: uppercase;
            letter-spacing: 2px;
            color: var(--text-muted);
            margin-bottom: 16px;
            text-align: center;
        }

        .question-text {
            font-size: 1.15rem;
            font-weight: 600;
            margin-bottom: 24px;
            line-height: 1.45;
            text-align: center;
        }

        .answers-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;

            .answer-btn {
                background: var(--glass-bg);
                border: 1px solid var(--glass-border);
                border-radius: 12px;
                padding: 14px 12px;
                color: var(--star-white);
                font-family: var(--font-main);
                font-size: 0.88rem;
                cursor: pointer;
                transition: all 0.25s ease;
                text-align: left;

                &:hover:not(:disabled) {
                    background: var(--glass-bg-hover);
                    border-color: var(--accent-cyan);
                }

                &.correct {
                    border-color: var(--accent-teal);
                    background: rgba(78, 205, 196, 0.12);
                    animation: correctPop 0.4s var(--transition-bounce);
                }

                &.wrong {
                    border-color: var(--accent-pink);
                    background: rgba(247, 37, 133, 0.1);
                    animation: wrongShake 0.4s ease;
                }
            }
        }
    }

    /* Timer */
    .quiz-timer-wrap {
        position: absolute;
        top: -28px;
        left: 50%;
        transform: translateX(-50%);
        width: 56px;
        height: 56px;
        display: flex;
        align-items: center;
        justify-content: center;

        .quiz-timer-svg {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
        }

        #quiz-timer-num {
            font-size: 0.9rem;
            font-weight: 700;
            color: var(--star-white);
            position: relative;
            z-index: 1;
        }
    }

    /* Results */
    .quiz-result {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        position: relative;
    }

    .quiz-love-level {
        font-size: 3.5rem;
        margin-bottom: 6px;
    }

    .quiz-compat-bar-wrap {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .quiz-compat-bar {
        width: 100%;
        height: 6px;
        background: var(--glass-border);
        border-radius: 3px;
        overflow: hidden;

        div {
            height: 100%;
            background: linear-gradient(90deg, var(--accent-pink), var(--accent-cyan));
            border-radius: 3px;
            transition: width 1s ease;
            width: 0%;
        }
    }

    .quiz-hearts-burst {
        position: fixed;
        inset: 0;
        pointer-events: none;
        z-index: 999;
    }

    .burst-heart {
        position: absolute;
        font-size: 1.4rem;
        animation: burstHeart 1.2s ease-out forwards;
        color: var(--accent-pink);
    }

    /* Custom question list */
    .qb-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 12px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--glass-border);
        border-radius: 10px;
        font-size: 0.82rem;
        color: var(--text-muted);

        button {
            background: transparent;
            border: none;
            color: var(--accent-pink);
            cursor: pointer;
            font-size: 1rem;
            line-height: 1;
        }
    }
}

@keyframes burstHeart {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 1;
    }

    100% {
        transform: translate(var(--bx), var(--by)) scale(1.4);
        opacity: 0;
    }
}

@keyframes correctPop {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }
}

@keyframes wrongShake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-7px);
    }

    60% {
        transform: translateX(7px);
    }
}

/* ========== PLAYLIST ========== */
#view-playlist {
    --pl-rose: #e8b4c8;
    --pl-rose-deep: #c4607e;
    --pl-rose-glow: rgba(196, 96, 126, 0.25);
    --pl-warm: rgba(255, 220, 190, 0.08);
    --pl-warm-border: rgba(232, 180, 200, 0.2);
    --pl-warm-text: rgba(255, 220, 200, 0.75);

    /* FIX: center content vertically; no horizontal overflow */
    justify-content: center;
    padding: 80px 20px 110px;
    align-items: center;
    overflow-x: hidden;

    @media (max-width: 640px) {
        padding: 70px 18px 110px;
        justify-content: flex-start;
    }

    /* Outer glass panel */
    .playlist-glass {
        /* FIX: constrain width so it never escapes viewport on mobile */
        max-width: 900px;
        width: 100%;
        background: linear-gradient(145deg, rgba(40, 10, 20, 0.7) 0%, rgba(20, 5, 15, 0.85) 100%);
        border-color: var(--pl-warm-border);
        padding: 0;
        overflow: hidden;

        @media (max-width: 640px) {
            max-width: 100%;
            /* FIX: keep border-radius on mobile, just remove side borders */
            border-radius: 18px;
            border-left: none;
            border-right: none;
            margin: 0;
        }
    }

    /* Split layout */
    .playlist-split {
        display: grid;
        grid-template-columns: 280px 1fr;
        min-height: 480px;

        /* FIX: stack vertically on mobile, prevent overflow */
        @media (max-width: 640px) {
            grid-template-columns: 1fr;
            min-height: unset;
        }

        /* LEFT: player panel */
        .player-panel {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 16px;
            padding: 28px 24px;
            border-right: 1px solid var(--pl-warm-border);
            background: rgba(0, 0, 0, 0.15);
            /* FIX: prevent panel itself from overflowing */
            min-width: 0;
            overflow: hidden;

            @media (max-width: 640px) {
                border-right: none;
                border-bottom: 1px solid var(--pl-warm-border);
                padding: 24px 20px;
                gap: 12px;
                /* FIX: full width on mobile */
                width: 100%;
            }

            .player-cover {
                width: 140px;
                height: 140px;
                border-radius: 50%;
                background-size: cover;
                background-position: center;
                background-color: #3d0f1f;
                border: 2px solid var(--pl-warm-border);
                box-shadow: 0 0 0 5px rgba(196, 96, 126, 0.10), 0 0 30px rgba(196, 96, 126, 0.25);
                animation: rotateDisc 10s linear infinite;
                animation-play-state: paused;
                position: relative;
                flex-shrink: 0;

                &::after {
                    content: '';
                    position: absolute;
                    top: 50%;
                    left: 50%;
                    width: 14px;
                    height: 14px;
                    background: rgba(10, 3, 8, 0.9);
                    border-radius: 50%;
                    border: 2px solid rgba(196, 96, 126, 0.3);
                    transform: translate(-50%, -50%);
                }

                &.spinning {
                    animation-play-state: running;
                }

                @media (max-width: 640px) {
                    width: 110px;
                    height: 110px;
                }
            }

            .player-meta {
                text-align: center;
                /* FIX: constrain width so text truncation works */
                width: 100%;
                min-width: 0;

                .player-title {
                    font-size: 1rem;
                    font-weight: 700;
                    color: var(--star-white);
                    letter-spacing: -0.2px;
                    margin-bottom: 3px;
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                }

                .player-artist {
                    font-size: 0.78rem;
                    color: var(--pl-warm-text);
                    margin-bottom: 6px;
                }

                .player-memory-tag {
                    display: inline-flex;
                    align-items: center;
                    gap: 5px;
                    padding: 3px 11px;
                    background: rgba(196, 96, 126, 0.12);
                    border: 1px solid rgba(196, 96, 126, 0.3);
                    border-radius: 20px;
                    font-size: 0.7rem;
                    color: var(--pl-rose);
                    font-style: italic;
                    margin-bottom: 6px;
                    /* FIX: don't let tag overflow on narrow screens */
                    max-width: 100%;
                    overflow: hidden;
                    white-space: normal;
                    text-overflow: unset;
                    overflow: visible;
                    text-align: center;

                    i {
                        font-size: 0.6rem;
                        color: var(--pl-rose-deep);
                        flex-shrink: 0;
                    }
                }

                .equalizer {
                    display: flex;
                    align-items: flex-end;
                    gap: 3px;
                    height: 14px;
                    justify-content: center;
                    margin-top: 6px;

                    span {
                        display: block;
                        width: 3px;
                        height: 4px;
                        background: var(--pl-rose-deep);
                        border-radius: 2px;
                    }

                    &.active span {
                        animation: eqBounce 0.8s ease-in-out infinite alternate;

                        &:nth-child(2) {
                            animation-delay: 0.15s;
                        }

                        &:nth-child(3) {
                            animation-delay: 0.30s;
                        }

                        &:nth-child(4) {
                            animation-delay: 0.10s;
                        }

                        &:nth-child(5) {
                            animation-delay: 0.45s;
                        }
                    }
                }
            }

            .player-progress-wrap {
                width: 100%;
                cursor: pointer;

                .player-progress-track {
                    width: 100%;
                    height: 3px;
                    background: rgba(255, 255, 255, 0.08);
                    border-radius: 2px;
                    overflow: hidden;

                    .player-progress-fill {
                        height: 100%;
                        background: linear-gradient(90deg, var(--pl-rose-deep), var(--pl-rose));
                        border-radius: 2px;
                        transition: width 0.5s linear;
                    }
                }

                .player-time-row {
                    display: flex;
                    justify-content: space-between;
                    margin-top: 5px;
                    font-size: 0.68rem;
                    color: var(--pl-warm-text);
                }
            }

            .player-controls {
                display: flex;
                align-items: center;
                gap: 16px;

                .ctrl-btn {
                    background: transparent;
                    border: none;
                    color: rgba(255, 255, 255, 0.7);
                    font-size: 1.3rem;
                    cursor: pointer;
                    transition: color 0.2s ease, transform 0.2s ease;

                    &:hover {
                        color: var(--pl-rose);
                        transform: scale(1.1);
                    }

                    &.play-btn {
                        font-size: 2.2rem;
                        color: var(--pl-rose);
                        filter: drop-shadow(0 0 6px rgba(196, 96, 126, 0.5));
                    }
                }
            }
        }

        /* RIGHT: tracklist panel */
        .tracklist-panel {
            display: flex;
            flex-direction: column;
            overflow: hidden;
            /* FIX: prevent tracklist from blowing out the grid column */
            min-width: 0;

            .tracklist-header {
                display: flex;
                align-items: center;
                gap: 14px;
                padding: 20px 22px 16px;
                border-bottom: 1px solid var(--pl-warm-border);
                flex-shrink: 0;
                /* FIX: truncate header content on narrow screens */
                min-width: 0;

                @media (max-width: 640px) {
                    display: none;
                }

                .tl-album-icon {
                    width: 40px;
                    height: 40px;
                    border-radius: 10px;
                    background: linear-gradient(135deg, #7b2d42, #3d0f1f);
                    border: 1px solid var(--pl-warm-border);
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    flex-shrink: 0;

                    i {
                        font-size: 1.1rem;
                        color: var(--pl-rose);
                    }
                }

                .tl-header-meta {
                    flex: 1;
                    min-width: 0;

                    h3 {
                        font-size: 0.95rem;
                        font-weight: 700;
                        background: linear-gradient(135deg, var(--pl-rose), #fff 70%);
                        -webkit-background-clip: text;
                        -webkit-text-fill-color: transparent;
                        background-clip: text;
                        margin: 0 0 1px;
                        /* FIX: truncate long titles */
                        white-space: nowrap;
                        overflow: hidden;
                        text-overflow: ellipsis;
                    }

                    p {
                        font-size: 0.72rem;
                        color: var(--pl-warm-text);
                        font-style: italic;
                        margin: 0;
                        white-space: nowrap;
                        overflow: hidden;
                        text-overflow: ellipsis;
                    }
                }
            }

            .track-list {
                flex: 1;
                overflow-y: auto;
                overflow-x: hidden;
                padding: 8px 10px;
                display: flex;
                flex-direction: column;
                gap: 2px;
                max-height: 380px;

                @media (max-width: 640px) {
                    max-height: 260px;
                }

                &::-webkit-scrollbar {
                    width: 4px;
                }

                &::-webkit-scrollbar-track {
                    background: transparent;
                }

                &::-webkit-scrollbar-thumb {
                    background: rgba(196, 96, 126, 0.25);
                    border-radius: 2px;
                }

                .track-row {
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    padding: 9px 10px;
                    border-radius: 10px;
                    cursor: pointer;
                    transition: background 0.2s ease;
                    gap: 8px;
                    border: 1px solid transparent;
                    /* FIX: prevent track rows from overflowing */
                    min-width: 0;

                    &:hover {
                        background: var(--pl-warm);
                    }

                    &.active {
                        background: rgba(196, 96, 126, 0.08);
                        border-color: rgba(196, 96, 126, 0.15);

                        .track-row-title {
                            color: var(--pl-rose);
                        }
                    }

                    .track-row-left {
                        display: flex;
                        align-items: flex-start;
                        gap: 10px;
                        flex: 1;
                        min-width: 0;

                        i {
                            color: var(--pl-warm-text);
                            font-size: 0.85rem;
                            margin-top: 3px;
                            flex-shrink: 0;
                        }
                    }

                    .track-row-meta {
                        display: flex;
                        flex-direction: column;
                        gap: 1px;
                        min-width: 0;
                        /* FIX: let meta flex and truncate properly */
                        flex: 1;
                        overflow: hidden;

                        .track-row-title {
                            font-size: 0.85rem;
                            font-weight: 500;
                            white-space: nowrap;
                            overflow: hidden;
                            text-overflow: ellipsis;
                        }

                        .track-row-artist {
                            font-size: 0.7rem;
                            color: var(--pl-warm-text);
                            white-space: nowrap;
                            overflow: hidden;
                            text-overflow: ellipsis;
                        }

                        .track-memory-label {
                            display: flex;
                            align-items: center;
                            gap: 4px;
                            font-size: 0.68rem;
                            color: var(--pl-rose);
                            font-style: italic;
                            margin-top: 2px;
                            white-space: nowrap;
                            overflow: hidden;
                            text-overflow: ellipsis;

                            i {
                                font-size: 0.58rem;
                                color: var(--pl-rose-deep);
                                margin-top: 0 !important;
                                flex-shrink: 0;
                            }

                            &.track-memory-empty {
                                color: rgba(255, 255, 255, 0.22);
                                font-style: normal;
                                cursor: pointer;
                                transition: color 0.2s ease;

                                &:hover {
                                    color: var(--pl-rose);
                                }
                            }
                        }
                    }

                    .track-memory-edit-btn {
                        background: transparent;
                        border: 1px solid transparent;
                        border-radius: 8px;
                        color: rgba(255, 255, 255, 0.2);
                        width: 26px;
                        height: 26px;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        cursor: pointer;
                        font-size: 0.75rem;
                        transition: all 0.2s ease;
                        flex-shrink: 0;
                        opacity: 0;
                    }

                    &:hover .track-memory-edit-btn {
                        opacity: 1;
                        color: var(--pl-rose);
                        border-color: rgba(196, 96, 126, 0.3);
                    }
                }
            }

            .mini-eq {
                display: flex;
                align-items: flex-end;
                gap: 2px;
                height: 14px;
                flex-shrink: 0;

                span {
                    display: block;
                    width: 3px;
                    height: 4px;
                    background: var(--pl-rose);
                    border-radius: 1px;
                    animation: eqBounce 0.8s ease-in-out infinite alternate;

                    &:nth-child(2) {
                        animation-delay: 0.2s;
                    }

                    &:nth-child(3) {
                        animation-delay: 0.4s;
                    }
                }
            }
        }
    }
}

/* ========== JOURNAL ========== */
#view-journal {
    /* FIX: center content vertically */
    justify-content: center;
    padding: 90px 20px 110px;
    align-items: center;

    @media (max-width: 640px) {
        padding: 80px 18px 120px;
    }

    .page-title {
        margin-bottom: 24px;
    }

    /* Journal panel uses .glass-panel — override internal layout */
    .journal-container {
        max-width: 600px;
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0;
        background: transparent;
        border: none;
        box-shadow: none;

        .journal-messages {
            background: var(--glass-bg);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-card) var(--radius-card) 0 0;
            padding: 20px;
            min-height: 320px;
            max-height: 420px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 12px;

            @media (max-width: 640px) {
                max-height: 300px;
            }

            .journal-message {
                max-width: 70%;
                padding: 10px 14px;
                border-radius: 16px;
                font-size: 0.88rem;
                line-height: 1.5;

                .message-time {
                    display: block;
                    font-size: 0.65rem;
                    color: var(--text-muted);
                    margin-top: 4px;
                }

                &.mike {
                    align-self: flex-end;
                    background: rgba(76, 201, 240, 0.15);
                    border: 1px solid rgba(76, 201, 240, 0.2);
                    border-radius: 16px 16px 4px 16px;
                }

                &.sarah {
                    align-self: flex-start;
                    background: rgba(247, 37, 133, 0.12);
                    border: 1px solid rgba(247, 37, 133, 0.2);
                    border-radius: 16px 16px 16px 4px;
                }
            }

            /* Also support .message without .journal-message prefix */
            .message {
                max-width: 70%;
                padding: 10px 14px;
                border-radius: 16px;
                font-size: 0.88rem;
                line-height: 1.5;

                .message-time {
                    display: block;
                    font-size: 0.65rem;
                    color: var(--text-muted);
                    margin-top: 4px;
                }

                &.mike {
                    align-self: flex-end;
                    background: rgba(76, 201, 240, 0.15);
                    border: 1px solid rgba(76, 201, 240, 0.2);
                    border-radius: 16px 16px 4px 16px;
                }

                &.sarah {
                    align-self: flex-start;
                    background: rgba(247, 37, 133, 0.12);
                    border: 1px solid rgba(247, 37, 133, 0.2);
                    border-radius: 16px 16px 16px 4px;
                }
            }
        }

        .journal-input-area {
            display: flex;
            gap: 10px;
            padding: 12px 16px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid var(--glass-border);
            border-top: none;
            border-radius: 0 0 var(--radius-card) var(--radius-card);

            input {
                flex: 1;
            }

            button {
                background: var(--accent-cyan);
                border: none;
                border-radius: 10px;
                color: var(--space-black);
                width: 40px;
                height: 40px;
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;
                font-size: 1rem;
                transition: opacity 0.2s ease;

                &:hover {
                    opacity: 0.85;
                }
            }
        }
    }
}

/* ========== TIME CAPSULES ========== */
#view-capsules {
    justify-content: flex-start;
    padding: 90px 20px 120px;
    align-items: center;
    gap: 0;

    @media (max-width: 640px) {
        padding: 80px 18px 120px;
    }

    .page-title {
        margin-bottom: 6px;
    }

    .capsules-subtitle {
        color: var(--text-muted);
        font-size: 0.88rem;
        text-align: center;
        margin-bottom: 40px;
        font-style: italic;
    }

    /* ── Shelf ── */
    .capsule-shelf {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 26px;
        width: 100%;
        max-width: 860px;
        padding-bottom: 20px;

        @media (max-width: 640px) {
            grid-template-columns: repeat(2, 1fr);
            gap: 14px;
        }
    }

    /* ── Individual capsule card ── */
    .capsule-card {
        position: relative;
        border-radius: 20px;
        border: 1px solid var(--glass-border);
        padding: 28px 18px 22px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        cursor: pointer;
        text-align: center;
        overflow: hidden;
        transition: transform 0.35s var(--transition-bounce), border-color 0.3s ease, box-shadow 0.3s ease;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);

        /* Float animation — each card gets its own delay via inline style */
        animation: capsuleFloat 6s ease-in-out infinite;

        &::before {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: 20px;
            opacity: 0;
            transition: opacity 0.3s ease;
            pointer-events: none;
        }

        &:hover {
            transform: translateY(-8px) scale(1.02);

            &::before {
                opacity: 1;
            }
        }

        .capsule-card-icon {
            font-size: 2.2rem;
            transition: transform 0.3s ease;
        }

        &:hover .capsule-card-icon {
            transform: scale(1.15) rotate(-6deg);
        }

        .capsule-card-title {
            font-size: 0.88rem;
            font-weight: 600;
            color: var(--star-white);
            line-height: 1.3;
        }

        .capsule-card-author {
            font-size: 0.7rem;
            letter-spacing: 0.5px;
            font-weight: 600;
            text-transform: uppercase;
        }

        .capsule-card-condition {
            font-size: 0.72rem;
            color: var(--text-muted);
            font-style: italic;
            line-height: 1.4;
        }

        .capsule-card-badge {
            position: absolute;
            top: 12px;
            right: 12px;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.7rem;

            &.badge-new {
                background: var(--accent-pink);
                color: #fff;
                animation: badgePulse 2s ease-in-out infinite;
            }
        }

        /* ── Unlocked variant ── */
        &.cap-unlocked {
            background: rgba(78, 205, 196, 0.06);
            border-color: rgba(78, 205, 196, 0.3);

            &::before {
                background: radial-gradient(circle at 50% 0%, rgba(78, 205, 196, 0.12), transparent 70%);
            }

            &:hover {
                border-color: var(--accent-teal);
                box-shadow: 0 8px 30px rgba(78, 205, 196, 0.15);
            }

            .capsule-card-icon {
                color: var(--accent-teal);
                filter: drop-shadow(0 0 8px rgba(78, 205, 196, 0.5));
            }
        }

        /* ── Locked variant ── */
        &.cap-locked {
            background: rgba(255, 255, 255, 0.02);
            border-color: rgba(255, 255, 255, 0.08);
            opacity: 0.75;

            &::before {
                background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.04), transparent 70%);
            }

            &:hover {
                border-color: rgba(255, 255, 255, 0.2);
                box-shadow: 0 8px 30px rgba(255, 255, 255, 0.05);
                opacity: 1;
            }

            .capsule-card-icon {
                color: var(--text-muted);
                filter: none;
            }

            /* Frost shimmer */
            &::after {
                content: '';
                position: absolute;
                top: -40%;
                left: -40%;
                width: 180%;
                height: 80px;
                background: linear-gradient(to bottom, rgba(255, 255, 255, 0.04), transparent);
                transform: rotate(-15deg);
                pointer-events: none;
            }
        }

        /* ── Just unlocked (newly available) ── */
        &.cap-newly-unlocked {
            background: rgba(247, 37, 133, 0.06);
            border-color: rgba(247, 37, 133, 0.4);
            animation: capsuleFloat 6s ease-in-out infinite, newCapsuleGlow 3s ease-in-out infinite;

            .capsule-card-icon {
                color: var(--accent-pink);
                filter: drop-shadow(0 0 10px rgba(247, 37, 133, 0.6));
            }
        }

        /* ── Mike's capsule accent ── */
        &.author-mike {
            .capsule-card-author {
                color: var(--accent-cyan);
            }
        }

        /* ── Sarah's capsule accent ── */
        &.author-sarah {
            .capsule-card-author {
                color: var(--accent-pink);
            }
        }
    }

    /* ── Modal overlay (shared) ── */
    .capsule-modal-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.75);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        z-index: 300;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }

    /* ── Modal box ── */
    .capsule-modal {
        background: rgba(10, 8, 20, 0.97);
        border: 1px solid var(--glass-border);
        border-radius: 24px;
        width: 100%;
        max-width: 480px;
        max-height: 88vh;
        overflow-y: auto;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
        position: relative;

        &::-webkit-scrollbar {
            width: 4px;
        }

        &::-webkit-scrollbar-thumb {
            background: var(--glass-border);
            border-radius: 2px;
        }
    }

    .capsule-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 24px 28px 0;

        h3 {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--star-white);
        }
    }

    .capsule-modal-close {
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        border-radius: 50%;
        width: 32px;
        height: 32px;
        color: var(--star-white);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        transition: background 0.2s ease;

        &:hover {
            background: var(--glass-bg-hover);
        }
    }

    .capsule-modal-body {
        padding: 20px 28px 0;
    }

    .capsule-modal-footer {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        padding: 20px 28px 28px;
        border-top: 1px solid var(--glass-border);
        margin-top: 20px;

        .btn-ghost {
            background: transparent;
            border: 1px solid var(--glass-border);
            border-radius: 50px;
            padding: 10px 20px;
            color: var(--text-muted);
            font-family: var(--font-main);
            font-size: 0.9rem;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: color 0.2s ease, border-color 0.2s ease;

            &:hover {
                color: var(--star-white);
                border-color: var(--glass-border-active);
            }
        }
    }

    /* ── Step layout ── */
    .capsule-step {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .capsule-step-label {
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        color: var(--text-muted);
        margin-bottom: 4px;
    }

    /* ── Type grid ── */
    .capsule-type-grid,
    .capsule-lock-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .capsule-type-btn,
    .capsule-lock-btn {
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        border-radius: 14px;
        padding: 16px 12px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        cursor: pointer;
        transition: all 0.25s ease;

        i {
            font-size: 1.6rem;
            color: var(--text-muted);
            transition: color 0.2s ease, transform 0.2s ease;
        }

        span {
            font-size: 0.78rem;
            color: var(--text-muted);
            font-weight: 500;
        }

        &.active {
            border-color: var(--accent-pink);
            background: rgba(247, 37, 133, 0.08);

            i {
                color: var(--accent-pink);
                transform: scale(1.1);
            }

            span {
                color: var(--star-white);
            }
        }

        &:hover:not(.active) {
            border-color: var(--glass-border-active);
            background: var(--glass-bg-hover);

            i {
                color: var(--star-white);
            }
        }
    }

    /* ── Author row ── */
    .capsule-author-row {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-top: 4px;
    }

    .capsule-author-btns {
        display: flex;
        gap: 8px;
    }

    .cap-author-btn {
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        border-radius: 50px;
        padding: 6px 18px;
        color: var(--text-muted);
        font-family: var(--font-main);
        font-size: 0.82rem;
        cursor: pointer;
        transition: all 0.2s ease;

        &.active {
            border-color: var(--accent-cyan);
            color: var(--accent-cyan);
            background: rgba(76, 201, 240, 0.1);
        }
    }

    /* ── Attach row ── */
    .cap-attach-row {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .cap-lock-extra {
        margin-top: 4px;
    }

    /* ── Open modal ── */
    .capsule-open-modal {
        padding: 28px;
    }

    .cap-open-header {
        display: flex;
        align-items: center;
        gap: 16px;
        margin-bottom: 20px;
        padding-bottom: 16px;
        border-bottom: 1px solid var(--glass-border);

        h3 {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--star-white);
            margin: 0 0 4px;
        }
    }

    .cap-open-icon {
        font-size: 2.6rem;
        flex-shrink: 0;
        line-height: 1;
    }

    .cap-open-meta {
        font-size: 0.72rem;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .cap-open-letter {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--glass-border);
        border-radius: 14px;
        padding: 18px 20px;
        margin-bottom: 16px;

        p {
            font-size: 0.95rem;
            line-height: 1.8;
            color: var(--star-white);
            margin: 0;
            white-space: pre-wrap;
        }
    }

    .cap-open-photo {
        width: 100%;
        border-radius: 12px;
        margin-bottom: 14px;
        border: 1px solid var(--glass-border);
        object-fit: cover;
        max-height: 240px;
    }

    .cap-open-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 16px;
        padding-top: 14px;
        border-top: 1px solid var(--glass-border);
        font-size: 0.8rem;
        color: var(--text-muted);
    }

    /* ── Lock animation ── */
    .capsule-lock-anim {
        width: 64px;
        height: 64px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--glass-border);
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 16px;
        font-size: 1.8rem;
        color: var(--text-muted);
        animation: lockShake 4s ease-in-out infinite;
    }

    /* ── Seal overlay ── */
    .capsule-seal-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.9);
        z-index: 500;
        display: flex;
        align-items: center;
        justify-content: center;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .capsule-seal-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }

    .capsule-wax-stamp {
        width: 100px;
        height: 100px;
        border-radius: 50%;
        background: radial-gradient(circle at 35% 35%, var(--accent-rose), var(--accent-purple));
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 2.5rem;
        color: #fff;
        animation: waxStamp 0.6s var(--transition-bounce) forwards;
        box-shadow: 0 0 40px rgba(233, 30, 140, 0.5);
    }

    .capsule-seal-text {
        font-size: 1rem;
        color: var(--text-muted);
        letter-spacing: 1px;
    }
}

.capsule-fab {
    position: fixed;
    bottom: 100px;
    right: 28px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-rose), var(--accent-purple));
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(233, 30, 140, 0.4);
    z-index: 999;
    transition: transform 0.3s var(--transition-bounce), box-shadow 0.3s ease;

    &:hover {
        transform: scale(1.12) rotate(90deg);
        box-shadow: 0 6px 28px rgba(233, 30, 140, 0.6);
    }
}

/* ── Capsule keyframes ── */
@keyframes capsuleFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-6px);
    }
}

@keyframes newCapsuleGlow {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(247, 37, 133, 0.15);
    }

    50% {
        box-shadow: 0 0 25px rgba(247, 37, 133, 0.35);
    }
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

@keyframes lockShake {

    0%,
    90%,
    100% {
        transform: rotate(0deg);
    }

    92% {
        transform: rotate(-8deg);
    }

    94% {
        transform: rotate(8deg);
    }

    96% {
        transform: rotate(-5deg);
    }

    98% {
        transform: rotate(5deg);
    }
}

@keyframes waxStamp {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }

    60% {
        transform: scale(1.15) rotate(10deg);
        opacity: 1;
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* ========== BUCKET LIST ========== */
#view-bucket {
    justify-content: flex-start;
    padding: 80px 20px 120px;
    align-items: center;
    gap: 0;

    @media (max-width: 640px) {
        padding: 70px 18px 120px;
    }

    /* ── Stats header ── */
    .bucket-stats-header {
        text-align: center;
        margin-bottom: 28px;
        width: 100%;
        max-width: 860px;

        .bucket-tagline {
            color: var(--text-muted);
            font-size: 0.88rem;
            font-style: italic;
            margin-bottom: 20px;
        }

        .bucket-stats-row {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0;
            margin-bottom: 16px;
            background: var(--glass-bg);
            border: 1px solid var(--glass-border);
            border-radius: 50px;
            padding: 12px 28px;
            width: fit-content;
            margin-inline: auto;
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
        }

        .bucket-stat {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
            padding: 0 20px;

            @media (max-width: 640px) {
                font-size: 0.75rem;
            }

            .bucket-stat-num {
                font-size: 1.3rem;
                font-weight: 700;
                color: var(--star-white);
                line-height: 1;

                @media (max-width: 640px) {
                    font-size: 1.2rem;
                }
            }

            .bucket-stat-label {
                font-size: 0.65rem;
                text-transform: uppercase;
                letter-spacing: 1.5px;
                color: var(--text-muted);
            }
        }

        .bucket-stat-divider {
            width: 1px;
            height: 28px;
            background: var(--glass-border);
            flex-shrink: 0;
        }

        .bucket-master-bar {
            width: 100%;
            max-width: 500px;
            height: 3px;
            background: rgba(255, 255, 255, 0.08);
            border-radius: 2px;
            margin-inline: auto;
            overflow: hidden;

            .bucket-master-fill {
                height: 100%;
                background: linear-gradient(90deg, var(--accent-teal), var(--accent-cyan), var(--accent-pink));
                border-radius: 2px;
                transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
                width: 0%;
            }
        }

        @media (max-width: 640px) {
            width: 100%;
            overflow-x: hidden;
            flex-wrap: wrap;
            gap: 8px;
        }
    }

    /* ── Filter pills ── */
    .bucket-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
        margin-bottom: 28px;
        width: 100%;
        max-width: 860px;

        .bucket-filter-pill {
            background: var(--glass-bg);
            border: 1px solid var(--glass-border);
            border-radius: 50px;
            padding: 7px 16px;
            color: var(--text-muted);
            font-family: var(--font-main);
            font-size: 0.8rem;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            transition: all 0.25s ease;

            i {
                font-size: 0.85rem;
            }

            &.active {
                background: rgba(78, 205, 196, 0.12);
                border-color: var(--accent-teal);
                color: var(--accent-teal);
            }

            &:hover:not(.active) {
                border-color: var(--glass-border-active);
                color: var(--star-white);
            }
        }
    }

    /* ── Dream cards grid ── */
    .bucket-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
        width: 100%;
        max-width: 860px;
        margin-bottom: 20px;

        @media (max-width: 640px) {
            grid-template-columns: 1fr;
            gap: 12px;
        }
    }

    /* ── Individual dream card ── */
    .dream-card {
        position: relative;
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        border-radius: 20px;
        overflow: hidden;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        transition: transform 0.3s var(--transition-bounce), border-color 0.3s ease, box-shadow 0.3s ease;
        cursor: pointer;

        &:hover {
            transform: translateY(-5px);
            box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);

            .dream-card-actions {
                opacity: 1;
            }
        }

        /* Photo background */
        .dream-card-photo {
            width: 100%;
            height: 120px;
            object-fit: cover;
            display: block;
            border-bottom: 1px solid var(--glass-border);
        }

        /* Category accent top bar */
        .dream-cat-bar {
            height: 3px;
            width: 100%;
            border-radius: 0;
        }

        .dream-card-body {
            padding: 16px 18px 14px;
        }

        .dream-card-top {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 8px;
            margin-bottom: 8px;
        }

        .dream-card-title {
            font-size: 0.95rem;
            font-weight: 600;
            color: var(--star-white);
            line-height: 1.3;
            flex: 1;
        }

        .dream-priority-badge {
            font-size: 0.65rem;
            font-weight: 600;
            padding: 3px 9px;
            border-radius: 20px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            flex-shrink: 0;

            &.priority-someday {
                background: rgba(255, 255, 255, 0.06);
                color: var(--text-muted);
                border: 1px solid var(--glass-border);
            }

            &.priority-thisyear {
                background: rgba(76, 201, 240, 0.12);
                color: var(--accent-cyan);
                border: 1px solid rgba(76, 201, 240, 0.3);
            }

            &.priority-urgent {
                background: rgba(247, 100, 37, 0.15);
                color: var(--accent-orange);
                border: 1px solid rgba(247, 100, 37, 0.35);
            }
        }

        .dream-card-note {
            font-size: 0.78rem;
            color: var(--text-muted);
            line-height: 1.5;
            margin-bottom: 10px;
        }

        .dream-card-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            flex-wrap: wrap;
        }

        .dream-card-meta {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .dream-who-badge {
            font-size: 0.68rem;
            padding: 2px 8px;
            border-radius: 12px;
            font-weight: 600;

            &.who-both {
                background: rgba(247, 37, 133, 0.1);
                color: var(--accent-pink);
                border: 1px solid rgba(247, 37, 133, 0.25);
            }

            &.who-mike {
                background: rgba(76, 201, 240, 0.1);
                color: var(--accent-cyan);
                border: 1px solid rgba(76, 201, 240, 0.25);
            }

            &.who-sarah {
                background: rgba(247, 37, 133, 0.1);
                color: var(--accent-pink);
                border: 1px solid rgba(247, 37, 133, 0.25);
            }
        }

        .dream-target-date {
            font-size: 0.68rem;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            gap: 4px;

            i {
                font-size: 0.75rem;
            }
        }

        /* Complete button */
        .dream-complete-btn {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            border: 2px solid var(--glass-border);
            background: transparent;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            font-size: 1rem;
            transition: all 0.25s var(--transition-bounce);
            flex-shrink: 0;

            &:hover {
                border-color: var(--accent-teal);
                color: var(--accent-teal);
                transform: scale(1.15);
            }
        }

        /* Actions overlay */
        .dream-card-actions {
            position: absolute;
            top: 10px;
            right: 10px;
            display: flex;
            gap: 6px;
            opacity: 0;
            transition: opacity 0.2s ease;
            z-index: 5;
        }

        /* ── Completed state ── */
        &.dream-done {
            opacity: 0.65;

            .dream-card-title {
                text-decoration: line-through;
                color: var(--text-muted);
            }

            &:hover {
                opacity: 0.85;
            }
        }

        /* ── Category color systems ── */
        &.cat-travel {
            .dream-cat-bar {
                background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
            }

            .dream-card-cat-icon {
                color: var(--accent-cyan);
            }
        }

        &.cat-experience {
            .dream-cat-bar {
                background: linear-gradient(90deg, var(--accent-purple), var(--accent-pink));
            }

            .dream-card-cat-icon {
                color: var(--accent-purple);
            }
        }

        &.cat-home {
            .dream-cat-bar {
                background: linear-gradient(90deg, var(--accent-orange), var(--accent-yellow));
            }

            .dream-card-cat-icon {
                color: var(--accent-orange);
            }
        }

        &.cat-together {
            .dream-cat-bar {
                background: linear-gradient(90deg, var(--accent-pink), var(--accent-rose));
            }

            .dream-card-cat-icon {
                color: var(--accent-pink);
            }
        }

        &.cat-wildcard {
            .dream-cat-bar {
                background: linear-gradient(90deg, var(--accent-teal), var(--accent-blue));
            }

            .dream-card-cat-icon {
                color: var(--accent-teal);
            }
        }
    }

    /* ── Passport stamp overlay on done cards ── */
    .dream-stamp {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(-18deg);
        font-size: 0.7rem;
        font-weight: 800;
        letter-spacing: 3px;
        text-transform: uppercase;
        color: var(--accent-teal);
        border: 2px solid var(--accent-teal);
        padding: 5px 14px;
        border-radius: 4px;
        opacity: 0.55;
        pointer-events: none;
        white-space: nowrap;
    }

    /* ── Next dream banner ── */
    .bucket-next-banner {
        width: 100%;
        max-width: 860px;
        background: rgba(247, 37, 133, 0.06);
        border: 1px solid rgba(247, 37, 133, 0.25);
        border-radius: 14px;
        padding: 12px 20px;
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 0.85rem;
        color: var(--star-white);
        margin-bottom: 16px;

        i {
            color: var(--accent-yellow);
            font-size: 1rem;
            flex-shrink: 0;
        }
    }

    /* ── FAB ── */
    .bucket-fab {
        position: fixed;
        bottom: 28px;
        right: 28px;
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
        border: none;
        color: #fff;
        font-size: 1.6rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 20px rgba(78, 205, 196, 0.4);
        z-index: 200;
        transition: transform 0.3s var(--transition-bounce), box-shadow 0.3s ease;

        &:hover {
            transform: scale(1.12) rotate(90deg);
            box-shadow: 0 6px 28px rgba(78, 205, 196, 0.6);
        }

        @media (max-width: 640px) {
            bottom: 80px;
        }
    }

    /* ── Modal ── */
    .bucket-modal-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.75);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        z-index: 300;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }

    .bucket-modal {
        background: rgba(10, 8, 20, 0.97);
        border: 1px solid var(--glass-border);
        border-radius: 24px;
        width: 100%;
        max-width: 480px;
        max-height: 88vh;
        overflow-y: auto;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);

        &::-webkit-scrollbar {
            width: 4px;
        }

        &::-webkit-scrollbar-thumb {
            background: var(--glass-border);
            border-radius: 2px;
        }
    }

    .bucket-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 24px 28px 0;

        h3 {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--star-white);
        }
    }

    .bucket-modal-body {
        padding: 20px 28px 0;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .bucket-modal-footer {
        padding: 20px 28px 28px;
        border-top: 1px solid var(--glass-border);
        margin-top: 20px;
    }

    .bucket-form-label {
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        color: var(--text-muted);
        margin-bottom: -4px;
    }

    /* ── Category selector ── */
    .bucket-cat-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;

        .bucket-cat-btn {
            background: var(--glass-bg);
            border: 1px solid var(--glass-border);
            border-radius: 50px;
            padding: 7px 16px;
            color: var(--text-muted);
            font-family: var(--font-main);
            font-size: 0.8rem;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            transition: all 0.2s ease;

            i {
                font-size: 0.85rem;
            }

            &.active {
                border-color: var(--accent-teal);
                color: var(--accent-teal);
                background: rgba(78, 205, 196, 0.1);
            }

            &:hover:not(.active) {
                border-color: var(--glass-border-active);
                color: var(--star-white);
            }
        }
    }

    /* ── Priority selector ── */
    .bucket-priority-row {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;

        .bucket-priority-btn {
            background: var(--glass-bg);
            border: 1px solid var(--glass-border);
            border-radius: 50px;
            padding: 7px 16px;
            color: var(--text-muted);
            font-family: var(--font-main);
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s ease;

            &.active {
                background: rgba(76, 201, 240, 0.12);
                border-color: var(--accent-cyan);
                color: var(--accent-cyan);
            }

            &.urgent.active {
                background: rgba(247, 100, 37, 0.12);
                border-color: var(--accent-orange);
                color: var(--accent-orange);
            }

            &:hover:not(.active) {
                border-color: var(--glass-border-active);
                color: var(--star-white);
            }
        }
    }

    /* ── Who row ── */
    .bucket-who-row {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;

        .bucket-who-btn {
            background: var(--glass-bg);
            border: 1px solid var(--glass-border);
            border-radius: 50px;
            padding: 7px 16px;
            color: var(--text-muted);
            font-family: var(--font-main);
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s ease;

            &.active {
                background: rgba(247, 37, 133, 0.1);
                border-color: var(--accent-pink);
                color: var(--accent-pink);
            }

            &:hover:not(.active) {
                border-color: var(--glass-border-active);
                color: var(--star-white);
            }
        }
    }

    /* ── Completion ceremony ── */
    .bucket-complete-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.88);
        z-index: 500;
        display: flex;
        align-items: center;
        justify-content: center;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .bucket-complete-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 16px;
        text-align: center;
    }

    .bucket-stamp-circle {
        width: 100px;
        height: 100px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 2.8rem;
        color: #fff;
        animation: stampDrop 0.6s var(--transition-bounce) forwards;
        box-shadow: 0 0 40px rgba(78, 205, 196, 0.5);
    }

    .bucket-complete-title {
        font-size: 1.3rem;
        font-weight: 700;
        color: var(--star-white);
    }

    .bucket-complete-sub {
        color: var(--text-muted);
        font-size: 0.9rem;
    }
}

@keyframes stampDrop {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }

    60% {
        transform: scale(1.2) rotate(10deg);
        opacity: 1;
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes dreamCardIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== SHARED FORM ELEMENTS ========== */
.form-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--star-white);
    font-family: var(--font-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease;
    resize: none;

    &::placeholder {
        color: var(--text-muted);
    }

    &:focus {
        border-color: var(--accent-cyan);
    }
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    border: none;
    border-radius: 50px;
    padding: 10px 28px;
    color: var(--star-white);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s ease, transform 0.2s ease;

    &:hover {
        opacity: 0.88;
        transform: translateY(-2px);
    }
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 200;
    align-items: center;
    justify-content: center;

    .modal-content {
        background: rgba(13, 17, 38, 0.95);
        border: 1px solid var(--glass-border);
        border-radius: 24px;
        padding: 36px;
        max-width: 480px;
        width: 90%;
        text-align: center;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    }

    @media (max-width: 640px) {
        .modal-content {
            padding: 24px 20px;
        }
    }
}

/* ========== ANIMATIONS ========== */
@keyframes rotateDisc {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes rotateDiscReverse {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(-360deg);
    }
}

@keyframes nebulaDrift {
    0% {
        transform: scale(1) translate(0, 0);
    }

    100% {
        transform: scale(1.1) translate(-2%, -2%);
    }
}

@keyframes warpSpeed {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes coldTwinkle {

    0%,
    100% {
        opacity: 0.2;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

@keyframes heartFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.4;
    }

    100% {
        transform: translateY(-10vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes eqBounce {
    from {
        height: 4px;
    }

    to {
        height: 14px;
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-5px);
    }

    80% {
        transform: translateX(5px);
    }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== MOBILE PERFORMANCE ========== */
@media (max-width: 768px) {
    /* Disable expensive background animations */
    .stars-large, .stars-medium, .stars-small {
        animation: none !important;
    }
    .nebula {
        animation: none !important;
        filter: blur(40px); /* reduce from 80px */
    }
    .heart-particle {
        display: none !important;
    }

    /* Replace backdrop-filter blur with solid fallbacks */
    .music-cockpit,
    .nav-rail,
    .modal,
    .modal-content,
    [style*="backdrop-filter"] {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(10, 15, 30, 0.92) !important;
    }

    /* Promote animated elements to GPU */
    .galaxy-wrapper .layer {
        will-change: transform;
        transform: translateZ(0);
    }
}

.orbit-planet {
    will-change: transform;
    transform: translateZ(0);
}

#layout-orbit {
    transform: translateZ(0);
    backface-visibility: hidden;
}

.orbit-planet {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

@media (max-width: 768px) {
    .stars-large, .stars-medium, .stars-small {
        animation: none !important;
    }
    .nebula {
        animation: none !important;
        filter: blur(30px) !important;
    }
    .heart-particle {
        display: none !important;
    }
    .music-cockpit, .nav-rail {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(10, 15, 30, 0.93) !important;
    }
}

#orbit-items-container {
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
}
