:root {
    --primary-pink: #ff4d6d;
    --secondary-pink: #ff758f;
    --dark-bg: #0a0a0a;
    --darker-bg: #050505;
    --card-bg: rgba(20, 20, 20, 0.85);
    --glass-border: rgba(255, 77, 109, 0.3);
    --text-pink: #ffb3c1;
    --white: #ffffff;
    --shadow: rgba(255, 77, 109, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: radial-gradient(circle at center, #2b0000 0%, #000000 100%);
    background-size: 200% 200%;
    animation: gradientBG 15s ease infinite;
    color: var(--white);
    min-height: 100vh;
    overflow-x: hidden;
    scroll-behavior: smooth;
    position: relative;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

body.locked {
    overflow: hidden;
}

/* Background Lyrics */
.lyrics-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
    display: flex;
    justify-content: center;
}

.lyrics-wrapper {
    width: 90%;
    max-width: 800px;
    text-align: center;
    color: rgba(255, 77, 109, 0.08);
    /* Very subtle lyrics */
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    line-height: 1.5;
    position: absolute;
    bottom: -100%;
    animation: scrollLyrics 150s linear infinite;
}

@keyframes scrollLyrics {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-300%);
    }
}

/* Overlays */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 1s ease, visibility 1s;
}

.overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Quiz UI */
.quiz-container {
    text-align: center;
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    animation: fadeIn 0.5s ease;
}

.quiz-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--primary-pink);
    font-size: 2rem;
    margin-bottom: 2rem;
    text-shadow: 0 0 10px var(--primary-pink), 0 0 20px var(--primary-pink);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.quiz-content h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--white);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--white);
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
}

.option-btn:hover {
    background: var(--primary-pink);
    box-shadow: 0 0 15px var(--shadow);
}

/* Dashboard UI */
/* Premium Frame Effect */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid transparent;
    border-radius: 30px;
    background-image: linear-gradient(var(--card-bg), var(--card-bg)),
        linear-gradient(135deg, var(--primary-pink), var(--secondary-pink));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 0 30px rgba(255, 77, 109, 0.2);
    width: 100%;
    margin-bottom: 2rem;
    padding: 2.5rem;
}

.stats-grid {
    margin: 2rem 0;
}

.stat-item {
    text-align: center;
}

.stat-item label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-pink);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-family: monospace;
    font-size: 2.5rem;
    color: var(--primary-pink);
    text-shadow: 0 0 10px var(--shadow);
}

.chart-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 2rem;
}

.chart-item label {
    font-size: 0.8rem;
    color: var(--white);
    margin-bottom: 8px;
    display: block;
}

.gauge,
.progress-bar {
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.gauge-fill,
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-pink), var(--secondary-pink));
    transition: width 1s ease-out;
}

.gauge span,
.progress-bar span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: 600;
    width: 100%;
    text-align: center;
}

/* Timeline UI */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 4rem auto;
    padding: 0 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: var(--glass-border);
    transform: translateX(-50%);
}

.moment {
    position: relative;
    margin-bottom: 100px;
    width: 50%;
}

.moment.left {
    left: 0;
    padding-right: 40px;
    text-align: right;
}

.moment.right {
    left: 50%;
    padding-left: 40px;
    text-align: left;
}

.moment::after {
    content: '❤️';
    position: absolute;
    top: 0;
    left: 100%;
    transform: translateX(-50%);
    background: var(--dark-bg);
    padding: 5px;
}

.moment.right::after {
    left: 0;
}

.moment img {
    width: 100%;
    border-radius: 15px;
    border: 3px solid transparent;
    background-image: linear-gradient(var(--dark-bg), var(--dark-bg)),
        linear-gradient(to bottom right, var(--primary-pink), #fff);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 0 20px rgba(255, 77, 109, 0.3);
    transition: transform 0.4s, box-shadow 0.4s;
    cursor: pointer;
}

.heart-frame img {
    clip-path: path('M12 21.593c-5.63-5.539-11-10.297-11-14.402 0-3.791 3.068-5.191 5.281-5.191 1.312 0 4.151.501 5.719 4.457 1.568-3.956 4.407-4.457 5.719-4.457 2.213 0 5.281 1.4 5.281 5.191 0 4.105-5.37 8.863-11 14.402z');
    /* Note: clip-path coordinates are normalized or fixed. For simplicity, let's use a mask or a container */
}

/* Simplified heart shape using clip-path on container */
.heart-frame {
    display: block;
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    clip-path: path('M25,50 C25,20 60,20 60,50 C60,80 25,110 25,110 C25,110 -10,80 -10,50 C-10,20 25,20 25,50 Z');
    /* Refining path for a better heart shape */
    clip-path: path('M50,90 C10,50 10,20 50,20 C90,20 90,50 50,90 Z');
    /* Simple V-heart */
    clip-path: path('M50 30 C 50 10, 10 10, 10 40 C 10 70, 50 100, 50 100 C 50 100, 90 70, 90 40 C 90 10, 50 10, 50 30');
    /* Classic heart shape */
    background: var(--primary-pink);
    padding: 3px;
    transform: scale(1.1);
}

.heart-frame img {
    clip-path: inherit;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
}

.heart-moment .moment-date {
    font-size: 1.5rem;
    color: var(--primary-pink);
    text-shadow: 0 0 10px var(--shadow);
}

.moment img:hover {
    transform: scale(1.05);
    border-color: var(--primary-pink);
}

.moment-date {
    font-size: 0.8rem;
    color: var(--primary-pink);
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.moment-text {
    font-size: 1rem;
    color: #ccc;
    margin-top: 10px;
}

/* Scroll Animations */
.anim-fade {
    opacity: 0;
    transition: all 1s ease-out;
}

.anim-fade.visible {
    opacity: 1;
}

.anim-slide-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s ease-out;
}

.anim-slide-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.anim-slide-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 1s ease-out;
}

.anim-slide-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.anim-slide-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 1s ease-out;
}

.anim-slide-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Keypad UI (Existing with small updates) */
.keypad-container {
    text-align: center;
    width: 100%;
    max-width: 320px;
}

.passcode-dots {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 2rem;
}

.passcode-dots span {
    width: 15px;
    height: 15px;
    border: 2px solid var(--primary-pink);
    border-radius: 50%;
}

.passcode-dots span.filled {
    background: var(--primary-pink);
    box-shadow: 0 0 10px var(--primary-pink);
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.key {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.key:hover {
    background: rgba(255, 77, 109, 0.2);
    border-color: var(--primary-pink);
}

/* Error Pop-up */
.error-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.popup-content {
    background: var(--darker-bg);
    border: 2px solid var(--primary-pink);
    padding: 3rem;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 0 30px var(--shadow);
    max-width: 400px;
    width: 90%;
    animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.popup-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.popup-content h2 {
    color: var(--primary-pink);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.popup-content p {
    color: #ccc;
    margin-bottom: 2rem;
    font-size: 1.2rem;
}

.popup-close {
    background: var(--primary-pink);
    color: white;
    border: none;
    padding: 0.8rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.popup-close:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--primary-pink);
}

@keyframes scaleUp {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

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

.error-popup.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Sound Button */
/* Sound Engine */
.sound-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
}

.sound-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s;
}

.sound-btn:hover {
    transform: scale(1.1);
}

#volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-pink);
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary-pink);
}

/* Heart Animation (Subtle Background) */
.heart {
    position: fixed;
    bottom: -20px;
    font-size: 20px;
    animation: floatUp 15s linear infinite;
    /* Slowed down */
    z-index: -1;
    /* Behind content */
    opacity: 0.8;
    /* Brighter */
    pointer-events: none;
    /* Non-interactive */
}

/* Star Animation */
.star {
    position: fixed;
    background: white;
    border-radius: 50%;
    z-index: -3;
    /* Deepest layer */
    animation: twinkle 4s infinite ease-in-out;
}

@keyframes twinkle {

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

    50% {
        opacity: 1;
        transform: scale(1.5);
        box-shadow: 0 0 10px white;
    }
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }

    20% {
        opacity: 0.3;
    }

    80% {
        opacity: 0.3;
    }

    100% {
        transform: translateY(-110vh) scale(1.5);
        opacity: 0;
    }
}

.hidden {
    display: none;
}

.hidden-content {
    display: none;
}

/* Use display none to prevent interference before unlock */


/* Footer Styling */
.footer-msg {
    margin-top: 5rem;
    text-align: center;
    font-family: 'Dancing Script', cursive;
    font-size: 1.8rem;
    color: var(--primary-pink);
    text-shadow: 0 0 10px var(--primary-pink), 0 0 20px var(--primary-pink);
    padding-bottom: 3rem;
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }

    .moment {
        width: 100%;
        left: 0 !important;
        padding-left: 50px !important;
        padding-right: 0 !important;
        text-align: left !important;
    }

    .moment::after {
        left: 20px !important;
    }

    .chart-container {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    .title {
        font-size: 2.5rem;
    }
}