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

body {
    overflow: hidden;
    background: #0a0015;
    font-family: 'Poppins', sans-serif;
    color: #fff;
    height: 100vh;
    width: 100vw;
}

/* ============ SCREENS ============ */
.screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
    z-index: 1;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
    z-index: 10;
}

/* ============ STARS BACKGROUND ============ */
.stars-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(2px 2px at 20% 30%, #fff, transparent),
        radial-gradient(2px 2px at 40% 70%, #fff, transparent),
        radial-gradient(1px 1px at 60% 20%, #fff, transparent),
        radial-gradient(2px 2px at 80% 50%, #fff, transparent),
        radial-gradient(1px 1px at 10% 80%, #fff, transparent),
        radial-gradient(1px 1px at 90% 10%, #fff, transparent),
        radial-gradient(2px 2px at 50% 90%, #fff, transparent),
        radial-gradient(1px 1px at 30% 50%, #fff, transparent),
        radial-gradient(1px 1px at 70% 40%, #fff, transparent),
        radial-gradient(2px 2px at 15% 60%, #fff, transparent),
        radial-gradient(1px 1px at 85% 80%, #fff, transparent),
        radial-gradient(2px 2px at 55% 15%, #fff, transparent);
    background-size: 200px 200px;
    animation: twinkle 4s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes twinkle {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* ============ GLOW TEXT ============ */
.glow-text {
    font-family: 'Dancing Script', cursive;
    text-shadow:
        0 0 10px rgba(255, 105, 180, 0.8),
        0 0 20px rgba(255, 105, 180, 0.6),
        0 0 40px rgba(255, 105, 180, 0.4),
        0 0 80px rgba(255, 105, 180, 0.2);
    animation: glow-pulse 2s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
    0% { text-shadow: 0 0 10px rgba(255,105,180,0.8), 0 0 20px rgba(255,105,180,0.6); }
    100% { text-shadow: 0 0 20px rgba(255,105,180,1), 0 0 40px rgba(255,105,180,0.8), 0 0 80px rgba(255,105,180,0.4); }
}

/* ============ INTRO SCREEN ============ */
.intro-content {
    text-align: center;
    z-index: 2;
    position: relative;
}

.intro-content h1 {
    font-size: clamp(2rem, 6vw, 4rem);
    margin-bottom: 10px;
}

.highlight {
    color: #ff69b4;
    font-weight: 700;
}

.subtitle {
    font-size: clamp(1rem, 3vw, 1.4rem);
    color: #d8a7ff;
    margin-bottom: 40px;
    font-weight: 300;
}

/* ENVELOPE */
.envelope {
    width: 120px; height: 90px;
    margin: 0 auto 30px;
    position: relative;
    cursor: pointer;
    animation: float 3s ease-in-out infinite;
}

.envelope-body {
    width: 120px; height: 80px;
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    border-radius: 5px;
    position: absolute;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 5px 30px rgba(255, 105, 180, 0.5);
}

.envelope-flap {
    width: 0; height: 0;
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-top: 50px solid #ff1493;
    position: absolute;
    top: 0;
    transition: transform 0.6s ease;
    transform-origin: top center;
}

.envelope.open .envelope-flap {
    transform: rotateX(180deg);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* INTRO PARTICLES */
#intro-particles {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ============ BUTTONS ============ */
.btn-magic {
    background: linear-gradient(135deg, #ff69b4, #8b5cf6, #ff69b4);
    background-size: 200% 200%;
    color: #fff;
    border: none;
    padding: 16px 48px;
    font-size: 1.2rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: gradient-shift 3s ease infinite;
    box-shadow: 0 5px 30px rgba(255, 105, 180, 0.4);
}

.btn-magic:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(255, 105, 180, 0.6);
}

.btn-magic::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-magic:hover::before {
    opacity: 1;
}

.btn-small {
    padding: 10px 30px;
    font-size: 0.9rem;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ============ PUZZLE SCREEN ============ */
.puzzle-content {
    text-align: center;
    z-index: 2;
    position: relative;
    padding: 20px;
}

.puzzle-content h2 {
    font-size: clamp(1.8rem, 5vw, 3rem);
    margin-bottom: 15px;
}

.puzzle-instruction {
    color: #d8a7ff;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    margin-bottom: 30px;
}

.letter-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    min-height: 70px;
    padding: 15px;
    margin-bottom: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.answer-zone {
    border: 2px dashed rgba(255, 105, 180, 0.4);
    border-radius: 15px;
    min-height: 80px;
    background: rgba(255, 105, 180, 0.05);
}

.letter-tile {
    width: 50px; height: 55px;
    background: linear-gradient(135deg, #1a0030, #2d1050);
    border: 2px solid rgba(255, 105, 180, 0.5);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ff69b4;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    text-transform: uppercase;
    box-shadow: 0 3px 15px rgba(255, 105, 180, 0.2);
}

.letter-tile:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px rgba(255, 105, 180, 0.5);
    border-color: #ff69b4;
}

.letter-tile.correct {
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: #fff;
    border-color: #fff;
    animation: pop 0.4s ease;
}

.letter-tile.space-tile {
    width: 25px;
    border: none;
    background: none;
    box-shadow: none;
    cursor: default;
    pointer-events: none;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.hint-text {
    color: #ffd700;
    font-size: 0.95rem;
    min-height: 25px;
    margin-bottom: 15px;
    font-style: italic;
}

.hidden {
    display: none !important;
}

.success-text {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: #ffd700;
    margin-bottom: 20px;
    animation: glow-pulse 1.5s ease-in-out infinite alternate;
}

/* ============ WEBGL HEART SCREEN ============ */
#webgl-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
}

.heart-overlay {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 20px;
}

.message-container {
    max-width: 700px;
}

.main-question {
    font-size: clamp(2.5rem, 7vw, 5rem);
    margin-bottom: 20px;
    line-height: 1.2;
}

.typewriter {
    font-size: clamp(1.2rem, 3.5vw, 2rem);
    font-family: 'Dancing Script', cursive;
    color: #ffd700;
    min-height: 50px;
    margin-bottom: 30px;
}

.typewriter .cursor {
    display: inline-block;
    width: 3px;
    height: 1.2em;
    background: #ffd700;
    margin-left: 4px;
    vertical-align: text-bottom;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* RESPONSE BUTTONS */
.response-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-yes {
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: #fff;
    border: none;
    padding: 18px 60px;
    font-size: 1.5rem;
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 30px rgba(255, 20, 147, 0.5);
    animation: pulse-btn 1.5s ease-in-out infinite;
}

.btn-yes:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 50px rgba(255, 20, 147, 0.8);
}

@keyframes pulse-btn {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.btn-no {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 18px 40px;
    font-size: 1.2rem;
    font-family: 'Poppins', sans-serif;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

/* ============ CELEBRATION SCREEN ============ */
#fireworks-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
}

.celebration-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 20px;
}

.mega-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    margin-bottom: 30px;
    animation: mega-glow 2s ease-in-out infinite alternate;
}

@keyframes mega-glow {
    0% {
        text-shadow: 0 0 20px #ff69b4, 0 0 40px #ff69b4, 0 0 80px #ff69b4;
        transform: scale(1);
    }
    100% {
        text-shadow: 0 0 30px #ff69b4, 0 0 60px #ff69b4, 0 0 120px #ff1493, 0 0 200px #ff69b4;
        transform: scale(1.02);
    }
}

.love-message {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: #f0d0ff;
    margin-bottom: 15px;
    font-weight: 300;
    line-height: 1.6;
}

.love-message strong {
    color: #ff69b4;
    font-weight: 600;
}

.signature {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: #ff69b4;
    margin-top: 30px;
}

.floating-hearts {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
}

.floating-heart {
    position: absolute;
    font-size: 2rem;
    animation: heart-rise linear forwards;
    opacity: 0;
}

@keyframes heart-rise {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 600px) {
    .letter-tile {
        width: 40px;
        height: 45px;
        font-size: 1.2rem;
    }

    .letter-tile.space-tile {
        width: 15px;
    }

    .btn-magic {
        padding: 14px 36px;
        font-size: 1rem;
    }
}