/* ===== CSS Variables ===== */
:root {
    --primary-red: #e63946;
    --deep-red: #9d0208;
    --gold: #ffd700;
    --gold-light: #ffe66d;
    --dark-bg: #0a0a0f;
    --darker-bg: #050508;
    --text-light: #fff;
    --text-gold: #ffc857;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: var(--dark-bg);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at top, rgba(230, 57, 70, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(157, 2, 8, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ===== Fireworks Canvas ===== */
#fireworks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ===== Firecracker Container ===== */
.firecracker-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.firecracker {
    position: absolute;
    font-size: 2rem;
    animation: firecrackerFall 3s linear forwards;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

@keyframes firecrackerFall {
    0% {
        transform: translateY(-50px) rotate(0deg);
        opacity: 1;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.firecracker-spark {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--gold);
    border-radius: 50%;
    animation: sparkle 0.5s ease-out forwards;
}

@keyframes sparkle {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* ===== Welcome Overlay ===== */
.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a0a1a 50%, #0a0a1a 100%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.welcome-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.welcome-content {
    text-align: center;
    padding: 40px;
}

.gift-box {
    font-size: 8rem;
    animation: giftBounce 1s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.5));
}

@keyframes giftBounce {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-20px) scale(1.1);
    }
}

.welcome-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 3rem;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 30px 0 15px;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.welcome-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 40px;
}

.start-button {
    background: linear-gradient(135deg, var(--primary-red), var(--deep-red));
    border: 2px solid var(--gold);
    border-radius: 50px;
    padding: 18px 50px;
    font-size: 1.5rem;
    color: var(--gold);
    cursor: pointer;
    font-family: 'Ma Shan Zheng', cursive;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {

    0%,
    100% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 50px rgba(255, 215, 0, 0.6);
        transform: scale(1.05);
    }
}

.start-button:hover {
    background: linear-gradient(135deg, #ff4444, var(--primary-red));
    transform: scale(1.1) !important;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.5);
}

.button-icon {
    font-size: 1.3rem;
}

.welcome-hint {
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* ===== Sound Toggle ===== */
.sound-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    z-index: 1000;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sound-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* ===== Content Wrapper ===== */
.content-wrapper {
    position: relative;
    z-index: 10;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

/* ===== Lanterns ===== */
.lantern {
    position: fixed;
    top: 20px;
    z-index: 100;
    animation: lanternSwing 3s ease-in-out infinite;
}

.lantern-left {
    left: 20px;
}

.lantern-right {
    right: 20px;
    animation-delay: 0.5s;
}

.lantern-body {
    width: 60px;
    height: 80px;
    background: linear-gradient(180deg, #ff4444 0%, #cc0000 50%, #990000 100%);
    border-radius: 50% 50% 45% 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2rem;
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold);
    box-shadow:
        0 0 30px rgba(255, 68, 68, 0.6),
        inset 0 0 20px rgba(255, 255, 200, 0.3);
    position: relative;
}

.lantern-body::before {
    content: '';
    position: absolute;
    top: -10px;
    width: 30px;
    height: 10px;
    background: linear-gradient(90deg, #ffd700, #ffaa00, #ffd700);
    border-radius: 5px;
}

.lantern-tassel {
    width: 4px;
    height: 40px;
    background: linear-gradient(180deg, #ffd700, #cc0000);
    margin: 0 auto;
    position: relative;
}

.lantern-tassel::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #ffd700, #ffaa00);
    border-radius: 50% 50% 40% 40%;
}

@keyframes lanternSwing {

    0%,
    100% {
        transform: rotate(-5deg);
    }

    50% {
        transform: rotate(5deg);
    }
}

/* ===== Hero Section ===== */
.hero {
    text-align: center;
    padding: 80px 20px 40px;
    position: relative;
}

.dragon-pattern {
    position: absolute;
    width: 150px;
    height: 300px;
    background: linear-gradient(180deg,
            transparent 0%,
            rgba(255, 215, 0, 0.1) 20%,
            transparent 40%,
            rgba(230, 57, 70, 0.1) 60%,
            transparent 80%);
    opacity: 0.5;
}

.dragon-pattern.left {
    left: 0;
    top: 0;
    transform: rotate(-15deg);
}

.dragon-pattern.right {
    right: 0;
    top: 0;
    transform: rotate(15deg) scaleX(-1);
}

.main-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: clamp(4rem, 15vw, 8rem);
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.title-char {
    display: inline-block;
    background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 50%, #cc9900 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
    animation: titleFloat 2s ease-in-out infinite;
    animation-delay: calc(var(--delay) * 0.2s);
}

@keyframes titleFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.year-display {
    margin: 30px 0;
}

.year-number {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-red), #ff6b6b, var(--primary-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    text-shadow: none;
    filter: drop-shadow(0 0 15px rgba(230, 57, 70, 0.5));
}

.zodiac {
    display: block;
    font-size: 1.5rem;
    color: var(--text-gold);
    margin-top: 10px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.subtitle {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 20px;
    font-weight: 300;
    letter-spacing: 5px;
}

/* ===== Photo Section ===== */
.photo-section {
    padding: 40px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.photo-frame {
    position: relative;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    padding: 8px;
    background: linear-gradient(135deg, var(--gold), var(--primary-red), var(--gold));
    box-shadow:
        0 0 40px rgba(255, 215, 0, 0.4),
        0 0 80px rgba(230, 57, 70, 0.3);
    animation: photoGlow 3s ease-in-out infinite;
}

@keyframes photoGlow {

    0%,
    100% {
        box-shadow:
            0 0 40px rgba(255, 215, 0, 0.4),
            0 0 80px rgba(230, 57, 70, 0.3);
    }

    50% {
        box-shadow:
            0 0 60px rgba(255, 215, 0, 0.6),
            0 0 100px rgba(230, 57, 70, 0.5);
    }
}

.photo-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.helen-photo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.photo-overlay {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.1) 0%,
            transparent 50%,
            rgba(0, 0, 0, 0.1) 100%);
    pointer-events: none;
}

.name-banner {
    margin-top: 30px;
    text-align: center;
}

.chinese-name {
    font-size: 1.2rem;
    color: var(--text-gold);
    display: block;
    margin-bottom: 5px;
}

.english-name {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 3rem;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

/* ===== Message Section ===== */
.message-section {
    padding: 40px 0;
}

.message-card {
    background: linear-gradient(135deg,
            rgba(230, 57, 70, 0.1) 0%,
            rgba(157, 2, 8, 0.1) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    padding: 40px 30px;
    position: relative;
    overflow: hidden;
}

.message-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(255, 215, 0, 0.1) 0%, transparent 30%),
        radial-gradient(circle at bottom right, rgba(230, 57, 70, 0.1) 0%, transparent 30%);
    pointer-events: none;
}

.card-decoration {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid var(--gold);
    opacity: 0.5;
}

.card-decoration.top-left {
    top: 10px;
    left: 10px;
    border-right: none;
    border-bottom: none;
}

.card-decoration.top-right {
    top: 10px;
    right: 10px;
    border-left: none;
    border-bottom: none;
}

.card-decoration.bottom-left {
    bottom: 10px;
    left: 10px;
    border-right: none;
    border-top: none;
}

.card-decoration.bottom-right {
    bottom: 10px;
    right: 10px;
    border-left: none;
    border-top: none;
}

.message-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.5rem;
    color: var(--gold);
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.message-content {
    position: relative;
    z-index: 1;
}

.blessing-text {
    font-size: 1.2rem;
    line-height: 2;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
}

.signature {
    text-align: right;
    margin-top: 30px;
    font-style: italic;
    color: var(--text-gold);
    font-size: 1.1rem;
}

/* ===== Wishes Section ===== */
.wishes-section {
    padding: 40px 0;
    overflow: hidden;
}

.wish-scroll {
    display: flex;
    gap: 20px;
    animation: scrollWishes 20s linear infinite;
    width: max-content;
}

.wish-scroll:hover {
    animation-play-state: paused;
}

@keyframes scrollWishes {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.wish-item {
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.2), rgba(157, 2, 8, 0.2));
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 50px;
    padding: 15px 30px;
    font-size: 1.2rem;
    white-space: nowrap;
    color: var(--text-gold);
    transition: all 0.3s ease;
}

.wish-item:hover {
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.4), rgba(157, 2, 8, 0.4));
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

/* ===== Footer ===== */
.footer {
    padding: 60px 20px;
    text-align: center;
}

.countdown-message {
    font-size: 1.3rem;
    color: var(--text-gold);
    margin-bottom: 30px;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.heart-animation {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.heart {
    font-size: 2rem;
    animation: heartbeat 1s ease-in-out infinite;
}

.heart:nth-child(1) {
    animation-delay: 0s;
}

.heart:nth-child(2) {
    animation-delay: 0.2s;
}

.heart:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .lantern {
        display: none;
    }

    .content-wrapper {
        padding: 10px;
    }

    .hero {
        padding: 60px 10px 30px;
    }

    .photo-frame {
        width: 220px;
        height: 220px;
    }

    .message-card {
        padding: 30px 20px;
    }

    .blessing-text {
        font-size: 1rem;
    }

    .wish-item {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 3rem;
        gap: 5px;
    }

    .year-number {
        font-size: 2rem;
    }

    .photo-frame {
        width: 180px;
        height: 180px;
    }

    .english-name {
        font-size: 2.5rem;
    }
}

/* ===== Sparkle Effect ===== */
.sparkle {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
    border-radius: 50%;
    animation: sparkleAnim 1s ease-out forwards;
}

@keyframes sparkleAnim {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: scale(1.5) rotate(180deg);
        opacity: 0;
    }
}