* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    font-family: 'Poppins', sans-serif;
    color: #ffffff;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.8), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.4), transparent),
        radial-gradient(2px 2px at 160px 30px, rgba(255,255,255,0.7), transparent);
    background-repeat: repeat;
    background-size: 200px 150px;
    pointer-events: none;
    z-index: 1;
    animation: twinkle 4s infinite;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(45deg, transparent 30%, rgba(138,43,226,0.1) 50%, transparent 70%),
        linear-gradient(-45deg, transparent 30%, rgba(75,0,130,0.08) 50%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    animation: nebulaShift 8s ease-in-out infinite;
}

#container {
    width: 100vw;
    height: 100vh;
    display: block;
    cursor: crosshair;
    position: relative;
    z-index: 10;
}

#header {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 50;
    backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, 0.08);
    padding: 25px 45px;
    border-radius: 30px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 30px rgba(138, 43, 226, 0.3);
    animation: headerGlow 3s ease-in-out infinite;
}

#header h1 {
    font-family: 'Dancing Script', cursive;
    font-size: 2.8rem;
    font-weight: 700;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57, #ff9ff3);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease-in-out infinite;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

#current-date {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
    letter-spacing: 1.2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#instructions {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 50;
    backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, 0.08);
    padding: 18px 35px;
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 25px rgba(75, 0, 130, 0.4);
    animation: instructionsPulse 2s ease-in-out infinite;
}

#instructions p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#memory-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    padding: 45px;
    border-radius: 30px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 50px rgba(138, 43, 226, 0.4);
    z-index: 200;
    text-align: center;
    max-width: 90%;
    width: 550px;
    min-height: 220px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#memory-modal.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    animation: modalGlow 2s ease-in-out infinite;
}

#memory-modal.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(0.8);
}

#memory-modal::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57, #ff9ff3, #ff6b6b);
    background-size: 500% 500%;
    border-radius: 32px;
    z-index: -1;
    animation: gradientShift 4s ease-in-out infinite;
    opacity: 0.4;
}

#memory-date {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 25px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: 300;
    letter-spacing: 0.8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#memory-text {
    font-size: 1.3rem;
    margin-bottom: 30px;
    line-height: 1.9;
    color: #ffffff;
    font-weight: 400;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

#memory-text strong {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.4rem;
    display: block;
    margin-bottom: 15px;
}

#memory-quote {
    font-size: 1.1rem;
    display: block;
    margin-top: 25px;
    color: rgba(255, 255, 255, 0.85);
    font-style: italic;
    line-height: 1.7;
    padding: 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    border-left: 5px solid rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 5px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
}

#memory-quote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 15px;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.3);
    font-family: serif;
}

#close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#close-modal:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.15);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

#close-modal span {
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 300;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.shooting-star {
    position: fixed;
    width: 2px;
    height: 2px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 6px #ffffff;
    animation: shootingStar 3s linear infinite;
    opacity: 0;
}

.shooting-star::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100px;
    width: 100px;
    height: 1px;
    background: linear-gradient(to right, transparent, #ffffff);
}

.shooting-star:nth-child(1) {
    top: 20%;
    left: -10px;
    animation-delay: 0s;
}

.shooting-star:nth-child(2) {
    top: 40%;
    left: -10px;
    animation-delay: 2s;
}

.shooting-star:nth-child(3) {
    top: 60%;
    left: -10px;
    animation-delay: 4s;
}

.floating-particles {
    position: fixed;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: floatUp 8s linear infinite;
}

.particle:nth-child(odd) {
    background: rgba(138, 43, 226, 0.4);
    animation-duration: 10s;
}

.particle:nth-child(3n) {
    background: rgba(75, 0, 130, 0.3);
    animation-duration: 12s;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@keyframes nebulaShift {
    0%, 100% { 
        background-position: 0% 0%, 100% 100%;
        opacity: 0.3;
    }
    50% { 
        background-position: 100% 100%, 0% 0%;
        opacity: 0.6;
    }
}

@keyframes headerGlow {
    0%, 100% { 
        box-shadow: 
            0 15px 40px rgba(0, 0, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.2),
            0 0 30px rgba(138, 43, 226, 0.3);
    }
    50% { 
        box-shadow: 
            0 15px 40px rgba(0, 0, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.2),
            0 0 50px rgba(138, 43, 226, 0.5);
    }
}

@keyframes instructionsPulse {
    0%, 100% { 
        transform: translateX(-50%) scale(1);
        box-shadow: 
            0 10px 30px rgba(0, 0, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.2),
            0 0 25px rgba(75, 0, 130, 0.4);
    }
    50% { 
        transform: translateX(-50%) scale(1.02);
        box-shadow: 
            0 12px 35px rgba(0, 0, 0, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.2),
            0 0 35px rgba(75, 0, 130, 0.6);
    }
}

@keyframes modalGlow {
    0%, 100% { 
        box-shadow: 
            0 30px 60px rgba(0, 0, 0, 0.8),
            inset 0 1px 0 rgba(255, 255, 255, 0.2),
            0 0 50px rgba(138, 43, 226, 0.4);
    }
    50% { 
        box-shadow: 
            0 35px 70px rgba(0, 0, 0, 0.9),
            inset 0 1px 0 rgba(255, 255, 255, 0.2),
            0 0 70px rgba(138, 43, 226, 0.6);
    }
}

@keyframes shootingStar {
    0% {
        transform: translateX(-100px) translateY(-100px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateX(100vw) translateY(100px);
        opacity: 0;
    }
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) translateX(0px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) translateX(50px);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    #header h1 {
        font-size: 2.2rem;
    }
    
    #header {
        padding: 20px 30px;
    }
    
    #memory-modal {
        width: 95%;
        padding: 35px 25px;
    }
    
    #memory-text {
        font-size: 1.15rem;
    }
    
    #instructions p {
        font-size: 0.9rem;
    }
}