body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', sans-serif;
    background-color: #2a2f45;
    color: #fff;
    overflow-x: hidden;
    text-align: center;
}

canvas#snow {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #fffae4;
    text-shadow: 0 0 10px #fff;
}

/* CSS Tree - Bigger and with shadow */
#tree {
    position: relative;
    margin-bottom: 20px; 
    width: 250px; 
    margin-left: auto;
    margin-right: auto;
}

.tree-top, .tree-middle, .tree-bottom {
    width: 0;
    height: 0;
    border-left: 75px solid transparent;
    border-right: 75px solid transparent;
    margin: 0 auto;
    filter: drop-shadow(0 4px 3px rgba(0,0,0,0.4));
}

.tree-top {
    border-bottom: 75px solid green;
    z-index: 3;
    position: relative;
}

.tree-middle {
    border-bottom: 90px solid green;
    margin-top: -30px; 
    z-index: 2;
    position: relative;
}

.tree-bottom {
    border-bottom: 105px solid green;
    margin-top: -35px; 
    z-index: 1;
    position: relative;
}

.tree-trunk {
    width: 45px;
    height: 60px;
    background: #8b4513;
    margin: -35px auto 0 auto; 
    border-radius: 5px;
    position: relative;
    z-index: 0;
}

.star {
    width: 0;
    height: 0;
    border-left: 22px solid transparent;
    border-right: 22px solid transparent;
    border-bottom: 44px solid gold;
    margin: -25px auto 10px auto; 
    position: relative;
    z-index: 4;
    animation: starGlow 1.5s infinite ease-in-out alternate;
}

.star::after {
    content: '';
    position: absolute;
    top: 12px;
    left: -22px; 
    width: 0;
    height: 0;
    border-left: 22px solid transparent;
    border-right: 22px solid transparent;
    border-top: 44px solid gold;
}

@keyframes starGlow {
    from { filter: drop-shadow(0 0 5px gold); }
    to { filter: drop-shadow(0 0 15px gold); }
}

/* Animated Lights */
.tree-lights {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px; 
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.light {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
    animation: twinkle 1.5s infinite ease-in-out alternate;
}

.light.red { background-color: #FF4136; color: #FF4136; }
.light.blue { background-color: #0074D9; color: #0074D9; }
.light.green { background-color: #2ECC40; color: #2ECC40; }
.light.yellow { background-color: #FFDC00; color: #FFDC00; }

@keyframes twinkle {
    0% { opacity: 0.5; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}


/* Gifts - Back to 2 rows */
#giftsContainer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 20px 0;
    width: 380px; 
}

.gift-box {
    width: 50px;
    height: 50px;
    background-color: red;
    margin: 5px;
    position: relative; 
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 5px 10px rgba(0,0,0,0.2);
    transition: transform 0.2s ease-in-out;
}

.gift-box:hover {
    transform: translateY(-5px) scale(1.1);
}

.gift-box::before {
    content: '';
    position: absolute;
    top: 22px;
    left: 0;
    width: 100%;
    height: 6px;
    background-color: gold;
    border-radius: 2px;
}

.gift-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 22px;
    width: 6px;
    height: 100%;
    background-color: gold;
    border-radius: 2px;
}

.gift-box.pop {
    animation: pop 0.5s forwards;
}

@keyframes pop {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5) rotate(10deg); opacity: 0.7; }
    100% { transform: scale(0); opacity: 0; }
}

#card {
    background-color: rgba(255,255,255,0.1);
    border: 2px solid #ffdf5d;
    border-radius: 10px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    margin-top: 20px;
    display: none;
    text-align: center;
    animation: fadeIn 0.5s ease-in-out;
}

#card.show {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

button {
    background-color: #ffdf5d;
    border: none;
    padding: 10px 20px;
    margin-top: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    color: #2a2f45;
    transition: transform 0.2s;
}

button:hover {
    transform: scale(1.05);
}

.test-controls {
    margin-top: 15px;
    display: none;
}

.test-controls select {
    padding: 5px;
    margin-left: 5px;
}

/* --- NEW STYLES FOR COUNTDOWN --- */
#countdown {
    background-color: rgba(0,0,0,0.2);
    border: 2px solid #ffdf5d;
    border-radius: 10px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    margin-bottom: 20px;
}
#countdown-timer {
    display: flex;
    justify-content: space-around;
    font-size: 2rem;
}
#countdown-timer div {
    display: flex;
    flex-direction: column;
}
#countdown-timer div span {
    font-size: 0.8rem;
    text-transform: uppercase;
    opacity: 0.8;
}