* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    overflow: hidden;
    background: #000;
    font-family: 'Ma Shan Zheng', 'Crimson Pro', serif;
    user-select: none;
    -webkit-user-select: none;
}

canvas {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
}

#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 10;
    padding: 20px 10px 10px;
    pointer-events: none;
}

#title {
    font-family: 'Ma Shan Zheng', serif;
    font-size: clamp(48px, 10vw, 96px);
    color: #FFD700;
    text-shadow: 
        0 0 20px rgba(255,215,0,0.8),
        0 0 40px rgba(255,165,0,0.5),
        0 0 60px rgba(255,69,0,0.3),
        0 2px 4px rgba(0,0,0,0.8);
    animation: titleGlow 3s ease-in-out infinite;
    letter-spacing: 8px;
}

#subtitle {
    font-family: 'Crimson Pro', serif;
    font-size: clamp(14px, 3vw, 24px);
    font-weight: 200;
    color: #FFECD2;
    text-shadow: 0 0 10px rgba(255,215,0,0.4), 0 1px 3px rgba(0,0,0,0.8);
    margin-top: 4px;
    letter-spacing: 2px;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 0 20px rgba(255,215,0,0.8), 0 0 40px rgba(255,165,0,0.5), 0 0 60px rgba(255,69,0,0.3), 0 2px 4px rgba(0,0,0,0.8); }
    50% { text-shadow: 0 0 30px rgba(255,215,0,1), 0 0 60px rgba(255,165,0,0.7), 0 0 90px rgba(255,69,0,0.5), 0 2px 4px rgba(0,0,0,0.8); }
}

#lucky-money {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 15;
    background: linear-gradient(135deg, rgba(180,0,0,0.9), rgba(120,0,0,0.9));
    border: 1px solid #FFD700;
    border-radius: 12px;
    padding: 6px 14px;
    color: #FFD700;
    font-family: 'Crimson Pro', serif;
    font-weight: 700;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 0 15px rgba(255,215,0,0.3);
}

#lucky-icon { font-size: 22px; }

#firework-counter {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 15;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,215,0,0.3);
    border-radius: 12px;
    padding: 6px 14px;
    color: #FFD700;
    font-family: 'Crimson Pro', serif;
    font-weight: 700;
    font-size: 18px;
}

#greeting-text {
    position: fixed;
    bottom: 80px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 10;
    pointer-events: none;
    font-family: 'Ma Shan Zheng', serif;
    font-size: clamp(24px, 5vw, 48px);
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255,215,0,0.6), 0 2px 4px rgba(0,0,0,0.9);
    opacity: 0;
    transition: opacity 1.5s ease;
}

#greeting-text.visible {
    opacity: 1;
}

#controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px 10px;
    background: linear-gradient(to top, rgba(10,5,15,0.95), rgba(10,5,15,0.0));
    padding-top: 30px;
}

#controls button {
    background: linear-gradient(135deg, rgba(180,20,20,0.85), rgba(100,10,10,0.85));
    border: 1px solid rgba(255,215,0,0.5);
    border-radius: 16px;
    padding: 10px 18px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
}

#controls button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255,215,0,0.5), 0 2px 10px rgba(0,0,0,0.5);
    border-color: #FFD700;
}

#controls button:active {
    transform: scale(0.95);
}

#controls button.active {
    background: linear-gradient(135deg, rgba(255,215,0,0.3), rgba(180,20,20,0.85));
    border-color: #FFD700;
    box-shadow: 0 0 25px rgba(255,215,0,0.6);
}

/* Fortune Modal */
#fortune-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

#fortune-modal.hidden { display: none; }

#fortune-scroll {
    background: linear-gradient(180deg, #FFF8DC, #FAEBD7, #FFF8DC);
    border: 4px solid #8B0000;
    outline: 3px solid #FFD700;
    border-radius: 8px;
    padding: 30px 25px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 60px rgba(255,215,0,0.3), 0 10px 40px rgba(0,0,0,0.5);
    position: relative;
}

#fortune-ornament-top, #fortune-ornament-bottom {
    color: #8B0000;
    font-size: 18px;
    letter-spacing: 10px;
    margin: 5px 0;
}

#fortune-text {
    font-family: 'Ma Shan Zheng', serif;
    font-size: 26px;
    color: #8B0000;
    margin: 20px 0;
    line-height: 1.6;
    min-height: 80px;
}

#fortune-text .english {
    font-family: 'Crimson Pro', serif;
    font-size: 16px;
    font-weight: 400;
    color: #555;
    display: block;
    margin-top: 10px;
}

#fortune-close {
    font-family: 'Ma Shan Zheng', serif;
    background: linear-gradient(135deg, #CC0000, #8B0000);
    color: #FFD700;
    border: 2px solid #FFD700;
    border-radius: 8px;
    padding: 10px 30px;
    font-size: 20px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s;
}

#fortune-close:hover {
    background: linear-gradient(135deg, #FF0000, #CC0000);
    box-shadow: 0 0 15px rgba(255,215,0,0.5);
}

/* Share Modal */
#share-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

#share-modal.hidden { display: none; }

#share-content {
    background: linear-gradient(135deg, #1a0505, #2a0a0a);
    border: 2px solid #FFD700;
    border-radius: 16px;
    padding: 25px;
    max-width: 380px;
    width: 90%;
    text-align: center;
}

#share-text {
    font-family: 'Ma Shan Zheng', serif;
    font-size: 20px;
    color: #FFD700;
    line-height: 1.8;
    margin-bottom: 20px;
    white-space: pre-line;
}

#share-copy {
    font-family: 'Crimson Pro', serif;
    background: linear-gradient(135deg, #CC0000, #8B0000);
    color: #FFD700;
    border: 1px solid #FFD700;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 16px;
    cursor: pointer;
    margin: 5px;
}

#share-close {
    background: transparent;
    color: #999;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    margin: 5px;
}

#footer-link {
    position: fixed;
    bottom: 62px;
    right: 10px;
    z-index: 15;
}

#footer-link a {
    color: rgba(255,215,0,0.4);
    font-family: 'Crimson Pro', serif;
    font-size: 11px;
    text-decoration: none;
}

#footer-link a:hover {
    color: rgba(255,215,0,0.7);
}