:root {
    --bg-color: #1a0b2e;
    /* Deep Violet / Deep Plum */
    --bg-gradient: linear-gradient(135deg, #1a0b2e 0%, #0f0518 100%);
    --primary-color: #FFCce6;
    /* Soft Neon Pink */
    --accent-color: #E6E6FA;
    /* Lavender */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --neon-glow: 0 0 10px rgba(255, 204, 230, 0.5), 0 0 20px rgba(255, 204, 230, 0.3), 0 0 30px rgba(255, 204, 230, 0.1);
    --text-color: #ffffff;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Background Animation for Desktop to fill space */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 204, 230, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(138, 43, 226, 0.08) 0%, transparent 50%);
    z-index: -2;
    animation: pulseBg 10s ease-in-out infinite alternate;
}

@keyframes pulseBg {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
}

/* --- Utilities --- */
.hidden {
    display: none !important;
}

.fadeIn {
    animation: fadeIn 1s ease-out forwards;
}

.slideUp {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.slideUp.active {
    opacity: 1;
    transform: translateY(0);
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 20px;
}

.neon-text {
    text-shadow: var(--neon-glow);
    color: var(--primary-color);
}

/* --- Lock Screen --- */
#lock-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease, transform 1s ease;
}

.lock-container {
    text-align: center;
    padding: 2rem;
    max-width: 90%;
    width: 400px;
}

.lock-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    animation: float 3s ease-in-out infinite;
    text-shadow: var(--neon-glow);
}

.lock-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--primary-color);
    padding: 1rem;
    color: white;
    font-size: 1.2rem;
    border-radius: 10px;
    width: 100%;
    margin-bottom: 1rem;
    text-align: center;
    outline: none;
    transition: all 0.3s;
}

.lock-input:focus {
    box-shadow: 0 0 15px var(--primary-color);
}

.btn-unlock {
    background: var(--primary-color);
    color: var(--bg-color);
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-unlock:hover {
    transform: scale(1.05);
    box-shadow: var(--neon-glow);
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s;
}

/* --- Music Widget --- */
#music-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.music-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 204, 230, 0.2);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 15px rgba(255, 204, 230, 0.3);
    transition: all 0.3s;
}

.music-btn:hover {
    transform: scale(1.1);
}

.music-btn.playing {
    animation: pulse 2s infinite;
    box-shadow: 0 0 25px rgba(255, 204, 230, 0.6);
}

.music-tooltip {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 220px;
    background: rgba(26, 11, 46, 0.9);
    color: white;
    padding: 0.8rem;
    border-radius: 10px;
    font-size: 0.9rem;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
    text-align: right;
    border: 1px solid var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.music-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

/* --- Hero Section --- */
#hero {
    height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.5;
    z-index: -1;
    filter: brightness(0.6);
    /* Improve background fit on large screens */
    background-repeat: no-repeat;
}

.hero-content {
    max-width: 800px;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.5rem;
    color: var(--accent-color);
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* --- Vertical Timeline --- */
#timeline {
    padding: 6rem 2rem;
    position: relative;
    max-width: 1000px;
    /* Increased width for desktop */
    margin: 0 auto;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    height: 100%;
    width: 4px;
    /* Thicker line */
    background: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-color);
    transform: translateX(-50%);
    border-radius: 2px;
}

.timeline-item {
    padding: 3rem 0;
    position: relative;
    width: 50%;
    padding-right: 4rem;
    /* More spacing */
    text-align: right;
    clear: both;
}

.timeline-item:nth-child(even) {
    margin-left: 50%;
    padding-right: 0;
    padding-left: 4rem;
    /* More spacing */
    text-align: left;
}

.timeline-dot {
    width: 24px;
    height: 24px;
    background: var(--bg-color);
    border: 4px solid var(--primary-color);
    border-radius: 50%;
    position: absolute;
    right: -14px;
    /* Centered on the 4px line */
    top: 3.8rem;
    /* Align with content top */
    box-shadow: 0 0 15px var(--primary-color);
    z-index: 2;
    transition: transform 0.3s;
}

.timeline-item:hover .timeline-dot {
    transform: scale(1.3);
    background: var(--primary-color);
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -14px;
    right: auto;
}

.timeline-content {
    padding: 2rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 204, 230, 0.15);
}

.timeline-date {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 0.8rem;
    display: block;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.timeline-img {
    width: 100%;
    border-radius: 12px;
    margin-top: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* --- Gallery (Masonry) --- */
#gallery {
    padding: 6rem 2rem;
    background: rgba(0, 0, 0, 0.2);
    /* Slight contrast section */
}

.masonry-grid {
    column-count: 4;
    /* More columns on wide screens */
    column-gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 0 25px rgba(255, 204, 230, 0.25);
    border-color: var(--primary-color);
}

.gallery-item img {
    width: 100%;
    display: block;
    border-radius: 15px;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 11, 46, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
    backdrop-filter: blur(2px);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* --- Lightbox --- */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 5, 20, 0.95);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(10px);
}

#lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 20px;
    padding: 1rem;
    background: transparent;
    border: none;
    box-shadow: none;
    text-align: center;
}

.lightbox-content img {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 50px rgba(255, 204, 230, 0.2);
}

.lightbox-note {
    margin-top: 2rem;
    color: white;
    font-size: 1.5rem;
    font-family: var(--font-heading);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* --- Open When Cards --- */
#open-when {
    padding: 8rem 2rem;
    text-align: center;
}

.cards-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 3rem;
    margin-top: 4rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.card-envelope {
    width: 280px;
    height: 400px;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy flip */
    transform-style: preserve-3d;
}

.card-envelope.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
}

.card-front {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    transition: transform 0.3s, box-shadow 0.3s;
}

.card-envelope:hover .card-front {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(255, 204, 230, 0.15);
    border-color: rgba(255, 204, 230, 0.3);
}

.card-back {
    background: #2a1b3d;
    background: linear-gradient(to bottom, #2a1b3d, #1a0b2e);
    transform: rotateY(180deg);
    overflow-y: auto;
    border: 1px solid var(--primary-color);
}

.card-icon {
    font-size: 4rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
    text-shadow: var(--neon-glow);
}

.card-front h3 {
    font-size: 1.5rem;
    color: white;
}

/* --- Location (Radar) --- */
#location {
    padding: 8rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at center, rgba(30, 15, 50, 0.5), transparent 70%);
}

.radar-container {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 3rem auto;
}

.radar-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid var(--primary-color);
    border-radius: 50%;
    opacity: 0;
    animation: radarRipple 4s infinite linear;
}

.radar-circle:nth-child(2) {
    animation-delay: 1.3s;
}

.radar-circle:nth-child(3) {
    animation-delay: 2.6s;
}

.radar-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 30px var(--primary-color), 0 0 60px var(--primary-color);
}

@keyframes radarRipple {
    0% {
        width: 0;
        height: 0;
        opacity: 0.8;
        border-width: 4px;
    }

    100% {
        width: 100%;
        height: 100%;
        opacity: 0;
        border-width: 0;
    }
}

/* --- Quiz --- */
#quiz {
    padding: 6rem 1rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 6rem auto;
}

.question-card {
    margin-bottom: 3rem;
    padding: 2.5rem;
    transition: transform 0.3s;
}

.question-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.question-card h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.quiz-btn {
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 204, 230, 0.3);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.1rem;
    font-family: var(--font-body);
}

.quiz-btn:hover:not(:disabled) {
    background: rgba(255, 204, 230, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 204, 230, 0.1);
}

.quiz-btn:disabled {
    cursor: default;
    opacity: 0.7;
}

.quiz-btn.correct {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4CAF50;
    color: #4CAF50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.3);
}

.quiz-btn.wrong {
    background: rgba(244, 67, 54, 0.2);
    border-color: #f44336;
    color: #f44336;
}

/* Confetti Canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

/* --- Responsive --- */

/* Tablet & Smaller Desktop */
@media (max-width: 1024px) {
    .masonry-grid {
        column-count: 3;
    }

    .hero-content h1 {
        font-size: 4rem;
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.8rem;
    }

    .timeline-line {
        left: 30px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 5rem;
        padding-right: 0;
        margin-left: 0;
        text-align: left;
    }

    .timeline-item:nth-child(even) {
        margin-left: 0;
        padding-left: 5rem;
    }

    .timeline-dot {
        left: 19px;
        /* Align with 30px line center (30 - 24/2 + 2(border?)) actually dot is 24px wide. Line is at 30px center. dot center should be at 30px. left = 30 - 12 = 18px. */
        left: 18px;
        top: 3.8rem;
    }

    .timeline-item:nth-child(even) .timeline-dot {
        left: 18px;
    }

    .masonry-grid {
        column-count: 2;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .radar-container {
        width: 300px;
        height: 300px;
    }
}

@media (max-width: 480px) {
    .masonry-grid {
        column-count: 1;
    }

    .lock-container {
        width: 100%;
    }

    .cards-container {
        gap: 2rem;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}