/* ============ RESET & BASE ============ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    width: 100%; height: 100%;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
    background: #0a0a1a;
    color: #fff;
    cursor: default;
}

/* ============ LANDING PAGE ============ */
#landing-page {
    position: fixed; inset: 0;
    z-index: 100;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0f0c29, #1a1a3e, #24243e);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
#landing-page.exit {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
}

.landing-nav {
    position: absolute; top: 0; left: 0; right: 0;
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.5rem 3rem;
    opacity: 0.8;
}
.nav-logo { font-weight: 700; font-size: 1.2rem; letter-spacing: 1px; }
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
    color: rgba(255,255,255,0.6); text-decoration: none;
    font-size: 0.9rem; transition: color 0.3s;
}
.nav-links a:hover { color: #fff; }

.landing-content { text-align: center; z-index: 2; }

.landing-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 2rem;
    animation: pulse-badge 2s ease infinite;
}

.landing-content h1 {
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}
.gradient-text {
    background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.landing-desc {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.7;
    margin-bottom: 2.5rem;
    font-weight: 300;
}

#enter-btn {
    display: inline-flex; align-items: center; gap: 0.75rem;
    padding: 1rem 2.5rem;
    border: none; border-radius: 60px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem; font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 30px rgba(99,102,241,0.4);
    position: relative;
    overflow: hidden;
}
#enter-btn::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    opacity: 0;
    transition: opacity 0.3s;
}
#enter-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 40px rgba(168,85,247,0.5);
}
#enter-btn:hover::before { opacity: 1; }
#enter-btn span, #enter-btn .btn-arrow { position: relative; z-index: 1; }
.btn-arrow { font-size: 1.3rem; transition: transform 0.3s; }
#enter-btn:hover .btn-arrow { transform: translateX(5px); }

.landing-stats {
    display: flex; justify-content: center; gap: 3rem;
    margin-top: 4rem; opacity: 0.5;
}
.stat { text-align: center; }
.stat strong { display: block; font-size: 1.1rem; font-weight: 600; }
.stat span { font-size: 0.8rem; color: rgba(255,255,255,0.5); }

/* Floating Shapes */
.floating-shapes {
    position: absolute; inset: 0;
    overflow: hidden; pointer-events: none;
}
.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.15;
}
.shape-1 { width: 400px; height: 400px; background: #6366f1; top: -100px; right: -100px; animation: floatShape 8s ease-in-out infinite; }
.shape-2 { width: 300px; height: 300px; background: #a855f7; bottom: -50px; left: -50px; animation: floatShape 10s ease-in-out infinite reverse; }
.shape-3 { width: 200px; height: 200px; background: #ec4899; top: 40%; left: 10%; animation: floatShape 12s ease-in-out infinite; }
.shape-4 { width: 250px; height: 250px; background: #3b82f6; bottom: 20%; right: 10%; animation: floatShape 9s ease-in-out infinite reverse; }
.shape-5 { width: 150px; height: 150px; background: #f59e0b; top: 20%; right: 30%; animation: floatShape 11s ease-in-out infinite; }

@keyframes floatShape {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}
@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 20px 5px rgba(99,102,241,0.15); }
}

/* ============ CANVAS ============ */
#game-canvas {
    position: fixed; inset: 0;
    width: 100%; height: 100%;
    z-index: 1;
    display: none;
}
#game-canvas.active { display: block; }

/* ============ OVERLAYS ============ */
.overlay {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    z-index: 200;
    transition: opacity 0.5s ease;
}
.overlay.hidden { opacity: 0; pointer-events: none; }

/* ============ INSTRUCTIONS ============ */
#instructions {
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(20px);
}
.instruction-content {
    text-align: center;
    animation: slideUp 0.6s ease;
}
.instruction-icon {
    font-size: 4rem;
    animation: heartbeat 1.2s ease infinite;
    margin-bottom: 1rem;
}
.instruction-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ff6b9d, #ffd93d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.instruction-content p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 0.5rem;
}
.sub-info { font-size: 0.95rem !important; color: rgba(255,255,255,0.4) !important; margin-bottom: 2rem !important; }

.desktop-only { display: block; }
.mobile-only { display: none; }
@media (pointer: coarse) {
    .desktop-only { display: none; }
    .mobile-only { display: block; }
}

#start-btn {
    padding: 1rem 3rem;
    border: none; border-radius: 60px;
    background: linear-gradient(135deg, #ff6b9d, #ff3b6f);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem; font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 30px rgba(255,107,157,0.4);
}
#start-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 40px rgba(255,59,111,0.5);
}

/* ============ MESSAGE POPUP ============ */
#message-popup {
    z-index: 250;
    pointer-events: none;
}
#message-popup.show { opacity: 1; }
.msg-box {
    text-align: center;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 24px;
    padding: 2.5rem 3rem;
    max-width: 420px;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.msg-emoji { font-size: 3rem; margin-bottom: 1rem; }
.msg-text {
    font-size: 1.3rem;
    font-weight: 500;
    line-height: 1.5;
    color: rgba(255,255,255,0.9);
}
.msg-progress {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
}

/* ============ CELEBRATION ============ */
#celebration {
    background: rgba(10, 5, 20, 0.6);
    flex-direction: column;
    z-index: 300;
}
#fireworks-canvas {
    position: fixed; inset: 0;
    width: 100%; height: 100%;
    z-index: 999;
    pointer-events: none;
    display: none;
}
#fireworks-canvas.active { display: block; }
.celebration-content {
    position: relative;
    z-index: 2;
    pointer-events: auto;
    text-align: center;
    max-width: 600px;
    padding: 2rem;
}
.cele-title {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    background: linear-gradient(135deg, #ffd93d, #ff6b9d, #ff3b6f, #ffd93d);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
    margin-bottom: 0.5rem;
    text-shadow: none;
    filter: drop-shadow(0 0 30px rgba(255, 107, 157, 0.4));
}
.cele-sub {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.5s both;
}

/* Card */
.cele-card {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    padding: 2.5rem;
    text-align: center;
    animation: slideUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: opacity 0.5s ease;
}
.cele-card.hidden { opacity: 0; pointer-events: none; }
.cele-card.show { opacity: 1; pointer-events: all; }
.card-deco { font-size: 3rem; margin-bottom: 1rem; }
.cele-card h2 {
    font-family: 'Dancing Script', cursive;
    font-size: 2rem;
    color: #ffd93d;
    margin-bottom: 1rem;
}
.cele-card p {
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.75);
    margin-bottom: 0.5rem;
}
.card-sign {
    font-family: 'Dancing Script', cursive;
    font-size: 1.3rem !important;
    color: #ff6b9d !important;
    margin-top: 1rem !important;
}

/* Action Buttons */
.card-actions {
    display: flex; gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}
.act-btn {
    padding: 0.75rem 1.5rem;
    border: none; border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem; font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    color: #fff;
}
.act-btn.hug {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    box-shadow: 0 4px 20px rgba(245,158,11,0.3);
}
.act-btn.love {
    background: linear-gradient(135deg, #ec4899, #ef4444);
    box-shadow: 0 4px 20px rgba(236,72,153,0.3);
}
.act-btn.best {
    background: linear-gradient(135deg, #a855f7, #6366f1);
    box-shadow: 0 4px 20px rgba(168,85,247,0.3);
}
.act-btn:hover {
    transform: translateY(-3px) scale(1.08);
}
.act-btn:active {
    transform: scale(0.95);
}

/* ============ ANIMATIONS ============ */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.3); }
    30% { transform: scale(1); }
    45% { transform: scale(1.15); }
    60% { transform: scale(1); }
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .landing-nav { padding: 1rem 1.5rem; }
    .nav-links { display: none; }
    .landing-stats { gap: 1.5rem; flex-wrap: wrap; }
    .msg-box { margin: 1rem; padding: 2rem; }
    .cele-card { margin: 0 1rem; padding: 2rem; }
    .card-actions { flex-direction: column; align-items: center; }
    .act-btn { width: 80%; }
    .celebration-content { padding: 1rem; }
}

/* ============ DOM-BASED BUTTON EFFECTS ============ */
#effect-layer {
    position: fixed; inset: 0;
    z-index: 9999;
    pointer-events: none;
    overflow: hidden;
}
.floating-emoji {
    position: absolute;
    font-size: 2.5rem;
    animation: floatUp 2.5s ease-out forwards;
    pointer-events: none;
    filter: drop-shadow(0 0 8px rgba(255,107,157,0.6));
}
@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(0.5) rotate(0deg); }
    50% { opacity: 1; transform: translateY(-40vh) scale(1.2) rotate(20deg); }
    100% { opacity: 0; transform: translateY(-80vh) scale(0.8) rotate(-10deg); }
}
#screen-flash {
    position: fixed; inset: 0;
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s ease;
}
#screen-flash.flash {
    opacity: 1;
    animation: flashFade 0.5s ease-out forwards;
}
@keyframes flashFade {
    0% { opacity: 0.7; }
    100% { opacity: 0; }
}
body.shake {
    animation: screenShake 0.4s ease-out;
}
@keyframes screenShake {
    0%, 100% { transform: translate(0,0); }
    15% { transform: translate(-6px, 4px); }
    30% { transform: translate(5px, -3px); }
    45% { transform: translate(-4px, 5px); }
    60% { transform: translate(3px, -2px); }
    75% { transform: translate(-2px, 3px); }
}
