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

:root {
    --pink: #FF69B4;
    --purple: #9B59B6;
    --gold: #FFD700;
    --coral: #FF6B6B;
    --teal: #00BCD4;
    --bg-start: #1a0a2e;
    --bg-end: #2d1b69;
}

body {
    font-family: 'Nunito', sans-serif;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.screen {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.screen.active { display: flex; }

/* Start Screen */
#start-screen {
    background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 50%, #c0392b 100%);
    animation: bgShift 8s ease-in-out infinite alternate;
}
@keyframes bgShift {
    from { filter: hue-rotate(0deg); }
    to { filter: hue-rotate(15deg); }
}
.start-content { text-align: center; z-index: 2; padding: 2rem; }
.title {
    font-family: 'Fredoka One', cursive;
    font-size: clamp(2.5rem, 8vw, 5rem);
    line-height: 1.2;
    margin-bottom: 1rem;
}
.rainbow-text {
    background: linear-gradient(90deg, #ff6b6b, #ffd93d, #6bcb77, #4d96ff, #ff6b6b);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow 3s linear infinite;
}
@keyframes rainbow { to { background-position: 200% center; } }
.subtitle { color: #fff; font-size: clamp(1rem, 3vw, 1.5rem); margin-bottom: 2rem; opacity: 0.9; }
.pulse-btn {
    font-family: 'Fredoka One', cursive;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    padding: 1rem 3rem;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--gold), #FFA500);
    color: #5D3A1A;
    cursor: pointer;
    animation: pulse 1.5s ease-in-out infinite;
    box-shadow: 0 8px 32px rgba(255,215,0,0.4);
    transition: transform 0.2s;
}
.pulse-btn:hover { transform: scale(1.1); }
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,215,0,0.5); }
    50% { box-shadow: 0 0 0 30px rgba(255,215,0,0); }
}
.hint { color: rgba(255,255,255,0.6); margin-top: 1.5rem; font-size: 0.9rem; }
.floating-balloons { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.balloon {
    position: absolute;
    font-size: 3rem;
    animation: floatUp 6s ease-in infinite;
}
@keyframes floatUp {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translateY(-100px) rotate(20deg); opacity: 0.6; }
}

/* Game Screen */
#game-screen {
    background: linear-gradient(180deg, #87CEEB 0%, #FFE4E1 40%, #FFB6C1 100%);
}
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hud {
    position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 2rem; z-index: 10;
    font-family: 'Fredoka One', cursive; font-size: 1.5rem; color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    background: rgba(0,0,0,0.3); padding: 0.5rem 1.5rem;
    border-radius: 50px; backdrop-filter: blur(10px);
}
.score, .bonus { display: flex; align-items: center; gap: 0.5rem; }
.mobile-hint {
    position: absolute; bottom: 120px; left: 50%; transform: translateX(-50%);
    color: rgba(255,255,255,0.7); font-size: 1rem; z-index: 10;
    display: none; transition: opacity 0.5s;
}
@media (pointer: coarse) { .mobile-hint { display: block; } }

/* Reveal Screen */
#reveal-screen {
    background: linear-gradient(135deg, #1a0a2e 0%, #2d1b69 40%, #c0392b 100%);
}
#confetti-canvas { position: absolute; inset: 0; pointer-events: none; }
.reveal-content { text-align: center; z-index: 2; }
.gift-box {
    position: relative; width: 200px; height: 200px;
    margin: 0 auto 2rem; cursor: pointer; transition: transform 0.3s;
}
.gift-box:hover { transform: scale(1.05); }
.gift-box.opened {
    animation: giftOpen 0.8s ease-in-out forwards;
    pointer-events: none;
}
@keyframes giftOpen {
    0% { transform: scale(1); }
    30% { transform: scale(1.2); }
    60% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0) rotate(360deg); opacity: 0; }
}
.gift-lid {
    position: absolute; top: -10px; left: 20px; width: 160px; height: 50px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    border-radius: 10px 10px 0 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3); z-index: 2;
}
.gift-body {
    position: absolute; bottom: 0; left: 30px; width: 140px; height: 150px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
.ribbon-v {
    position: absolute; top: 0; left: 65px; width: 10px; height: 100%;
    background: var(--gold);
}
.ribbon-h {
    position: absolute; top: 70px; left: 0; width: 100%; height: 10px;
    background: var(--gold);
}
.reveal-message { transition: all 0.5s ease-in-out; }
.reveal-message.hidden { opacity: 0; transform: translateY(30px); }
.reveal-title {
    font-family: 'Fredoka One', cursive;
    font-size: clamp(2rem, 6vw, 4rem);
    color: var(--gold); margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
.gift-content {
    background: rgba(255,255,255,0.1); backdrop-filter: blur(10px);
    border-radius: 20px; padding: 2rem; margin: 1rem auto;
    max-width: 500px; border: 2px solid rgba(255,255,255,0.2);
}
.gift-content a {
    color: var(--gold); font-size: 1.5rem;
    font-family: 'Fredoka One', cursive; text-decoration: none;
    word-break: break-all; display: inline-block;
    padding: 0.5rem 1rem; background: rgba(255,215,0,0.15);
    border-radius: 12px; transition: background 0.3s;
}
.gift-content a:hover { background: rgba(255,215,0,0.3); }
.love-note {
    color: rgba(255,255,255,0.8); font-size: 1.2rem;
    margin-top: 1.5rem; font-style: italic;
}
.click-hint {
    color: rgba(255,255,255,0.7); font-size: 1.1rem;
    margin-top: 1rem; animation: blink 1.5s ease-in-out infinite;
    transition: opacity 0.3s;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.hidden { display: none; }
