/* Core Design System & Variables */
:root {
    --bg-gradient: linear-gradient(135deg, #03001e, #7303c0, #ec38bc, #05011a);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-shadow: rgba(0, 0, 0, 0.5);
    --text-color: #ffffff;
    --heart-color: #ff3366;
    --heart-glow: rgba(255, 51, 102, 0.6);
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #03001e;
    font-family: 'Quicksand', sans-serif;
    color: var(--text-color);
}

/* Canvas Styling */
#galaxyCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: block;
    cursor: pointer;
}

/* Glassmorphism UI Components */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 var(--glass-shadow);
}

/* Audio Control Button */
.music-toggle {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-color);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.music-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform 0.4s ease;
}

.music-toggle:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 6px 20px rgba(236, 56, 188, 0.4);
}

.music-toggle.paused::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 24px;
    background: var(--heart-color);
    transform: rotate(45deg);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Instruction Text Overlay */
.instruction {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    text-align: center;
    pointer-events: none;
    transition: opacity 1s ease, transform 1s ease;
    opacity: 0.85;
}

.instruction p {
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 12px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.heart-pulse-icon {
    color: var(--heart-color);
    animation: pulse 1.8s infinite ease-in-out;
    filter: drop-shadow(0 0 8px var(--heart-glow));
}

.instruction.fade-out {
    opacity: 0;
    transform: translate(-50%, 20px);
}

/* Surprise Glass Card / Modal */
.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 90%;
    max-width: 400px;
    border-radius: 24px;
    padding: 32px;
    text-align: center;
    position: relative;
    transform: scale(0.8) translateY(20px);
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal:not(.hidden) .modal-content {
    transform: scale(1) translateY(0);
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--heart-color);
}

.heart-decor {
    color: var(--heart-color);
    margin-bottom: 20px;
    animation: pulse 1.5s infinite ease-in-out;
    filter: drop-shadow(0 0 10px var(--heart-glow));
    display: inline-block;
}

.love-message {
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.6;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}
