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

:root {
    --christmas-red: #c41e3a;
    --christmas-green: #228b22;
    --christmas-gold: #ffd700;
    --snow-white: #fffafa;
    --dark-night: #1a1a2e;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: var(--snow-white);
    overflow-x: hidden;
}

.snowfall {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10px;
    color: white;
    font-size: 1em;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.7);
    animation: fall linear infinite;
    opacity: 0.8;
}

@keyframes fall {
    0% {
        transform: translateY(-10px) rotate(0deg);
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
    }
}

.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(180deg, rgba(196, 30, 58, 0.1) 0%, transparent 100%);
}

.title {
    font-size: 3.5rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ffd700, #ff6b6b, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    animation: titleGlow 3s ease-in-out infinite alternate;
    margin-bottom: 10px;
}

@keyframes titleGlow {
    from {
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    }
    to {
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
    }
}

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

.countdown {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.countdown-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px 30px;
    min-width: 100px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.countdown-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
}

.countdown-value {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--christmas-gold);
}

.countdown-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.tree-section {
    text-align: center;
    margin-bottom: 60px;
}

.christmas-tree {
    position: relative;
    width: 300px;
    height: 400px;
    margin: 0 auto 30px;
}

.tree-top {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 100px solid transparent;
    border-right: 100px solid transparent;
    border-bottom: 120px solid #228b22;
}

.tree-middle {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 130px solid transparent;
    border-right: 130px solid transparent;
    border-bottom: 140px solid #2e8b2e;
}

.tree-bottom {
    position: absolute;
    top: 200px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 160px solid transparent;
    border-right: 160px solid transparent;
    border-bottom: 160px solid #228b22;
}

.tree-trunk {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 50px;
    background: linear-gradient(90deg, #4a2c0f, #6b3d0f, #4a2c0f);
    border-radius: 0 0 10px 10px;
}

.star {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3rem;
    animation: starGlow 2s ease-in-out infinite alternate;
    z-index: 10;
}

@keyframes starGlow {
    from {
        filter: drop-shadow(0 0 10px gold);
        transform: translateX(-50%) scale(1);
    }
    to {
        filter: drop-shadow(0 0 30px gold);
        transform: translateX(-50%) scale(1.1);
    }
}

.ornaments-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.ornament {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    pointer-events: all;
    cursor: pointer;
    transition: transform 0.3s ease;
    animation: ornamentSwing 3s ease-in-out infinite;
}

.ornament:hover {
    transform: scale(1.3);
}

@keyframes ornamentSwing {
    0%, 100% {
        transform: rotate(-5deg);
    }
    50% {
        transform: rotate(5deg);
    }
}

.lights-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.light {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: lightBlink 1s ease-in-out infinite;
}

@keyframes lightBlink {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 10px currentColor;
    }
    50% {
        opacity: 0.5;
        box-shadow: 0 0 5px currentColor;
    }
}

.tree-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 12px 25px;
    font-size: 1rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--christmas-red), #ff6b6b);
    color: white;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.4);
}

.control-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.6);
}

.control-btn:active {
    transform: translateY(0);
}

.gifts-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gifts-section h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
    color: var(--christmas-gold);
}

.gifts-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.gift {
    width: 80px;
    height: 70px;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gift::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 60px;
    background: var(--gift-color);
    border-radius: 5px;
}

.gift:hover {
    transform: scale(1.1) rotate(5deg);
}

.gift-ribbon-v {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 60px;
    background: linear-gradient(180deg, #ffd700, #ffec8b);
}

.gift-ribbon-h {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 10px;
    background: linear-gradient(90deg, #ffd700, #ffec8b);
}

.gift-bow {
    position: absolute;
    bottom: 55px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 15px;
    background: #ffd700;
    border-radius: 50% 50% 0 0;
}

.wishes-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.wishes-section h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
    color: var(--christmas-gold);
}

.wish-form {
    max-width: 600px;
    margin: 0 auto 30px;
}

.wish-input,
.wish-textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    margin-bottom: 15px;
    transition: border-color 0.3s ease;
}

.wish-input:focus,
.wish-textarea:focus {
    outline: none;
    border-color: var(--christmas-gold);
}

.wish-textarea {
    min-height: 100px;
    resize: vertical;
}

.submit-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--christmas-green), #32cd32);
    color: white;
    font-weight: bold;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(34, 139, 34, 0.6);
}

.wishes-display {
    max-width: 600px;
    margin: 0 auto;
}

.wish-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid var(--christmas-gold);
    animation: wishSlideIn 0.5s ease;
}

@keyframes wishSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.wish-card h4 {
    color: var(--christmas-gold);
    margin-bottom: 10px;
}

.wish-card p {
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
}

.games-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.games-section h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
    color: var(--christmas-gold);
}

.games-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.game-card {
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.3), rgba(34, 139, 34, 0.3));
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 215, 0, 0.3);
    min-width: 200px;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
    border-color: var(--christmas-gold);
}

.game-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.game-card h3 {
    margin-bottom: 10px;
    color: var(--christmas-gold);
}

.game-card p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    position: relative;
    border: 2px solid var(--christmas-gold);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: white;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--christmas-red);
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--christmas-gold);
}

.score {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--christmas-gold);
}

.game-area {
    width: 100%;
    height: 300px;
    background: linear-gradient(180deg, #1a1a2e, #0f3460);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    cursor: crosshair;
}

.target {
    position: absolute;
    font-size: 3rem;
    cursor: pointer;
    transition: transform 0.1s ease;
    user-select: none;
}

.target:active {
    transform: scale(0.9);
}

.snowball {
    position: absolute;
    font-size: 1.5rem;
    pointer-events: none;
    animation: snowballFly 0.5s ease-out forwards;
}

@keyframes snowballFly {
    to {
        opacity: 0;
        transform: translateY(-100px) scale(0.5);
    }
}

.memory-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.memory-card {
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--christmas-red), #ff6b6b);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    transition: transform 0.3s ease, background 0.3s ease;
    transform-style: preserve-3d;
}

.memory-card.flipped {
    background: linear-gradient(135deg, var(--christmas-green), #32cd32);
}

.memory-card.matched {
    background: linear-gradient(135deg, var(--christmas-gold), #ffd700);
    animation: matchPulse 0.5s ease;
}

@keyframes matchPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.memory-card.hidden {
    visibility: hidden;
}

.footer {
    text-align: center;
    padding: 30px;
    background: rgba(0, 0, 0, 0.3);
    margin-top: 40px;
}

.footer p {
    color: rgba(255, 255, 255, 0.7);
}

.shake {
    animation: treeShake 0.5s ease;
}

@keyframes treeShake {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }
    
    .countdown-item {
        min-width: 80px;
        padding: 15px 20px;
    }
    
    .countdown-value {
        font-size: 1.8rem;
    }
    
    .christmas-tree {
        width: 200px;
        height: 300px;
    }
    
    .tree-top {
        border-left: 70px solid transparent;
        border-right: 70px solid transparent;
        border-bottom: 80px solid #228b22;
    }
    
    .tree-middle {
        top: 70px;
        border-left: 90px solid transparent;
        border-right: 90px solid transparent;
        border-bottom: 100px solid #2e8b2e;
    }
    
    .tree-bottom {
        top: 140px;
        border-left: 110px solid transparent;
        border-right: 110px solid transparent;
        border-bottom: 120px solid #228b22;
    }
    
    .game-card {
        min-width: 150px;
        padding: 20px;
    }
}
