:root {
    --christmas-red: #D32F2F;
    --christmas-green: #2E7D32;
    --christmas-gold: #FFD700;
    --snow-white: #FFFFFF;
    --dark-green: #1B5E20;
    --dark-red: #B71C1C;
    --bg-color: #0f380f;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--snow-white);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

h1,
h2 {
    font-family: 'Mountains of Christmas', cursive;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--christmas-gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2.5rem;
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    transition: opacity 0.3s ease;
}

.hidden {
    display: none;
    opacity: 0;
}

/* Grid Layout */
.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 10px;
}

.door {
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--christmas-red), var(--dark-red));
    border: 2px solid var(--christmas-gold);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Mountains of Christmas', cursive;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--snow-white);
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.door:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.door::before {
    /* Ribbon effect vertical */
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 10px;
    background-color: var(--christmas-gold);
    transform: translateX(-50%);
    opacity: 0.7;
}

.door::after {
    /* Ribbon effect horizontal */
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 10px;
    background-color: var(--christmas-gold);
    transform: translateY(-50%);
    opacity: 0.7;
}

.door.completed {
    background: linear-gradient(135deg, var(--christmas-green), var(--dark-green));
    border-color: var(--snow-white);
    opacity: 0.8;
}

.door.completed::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    width: auto;
    height: auto;
    background: none;
    font-size: 1.5rem;
    color: var(--christmas-gold);
    transform: none;
    opacity: 1;
}

.door span {
    z-index: 2;
    background-color: rgba(183, 28, 28, 0.8);
    padding: 5px 15px;
    border-radius: 50%;
    border: 1px solid var(--christmas-gold);
}

/* Timer View */
.timer-display {
    font-size: 5rem;
    font-weight: bold;
    text-align: center;
    margin: 40px 0;
    font-family: 'Roboto', monospace;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.btn {
    padding: 15px 30px;
    font-size: 1.2rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.1s, filter 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background-color: var(--christmas-green);
    color: white;
    box-shadow: 0 4px 0 var(--dark-green);
}

.btn-secondary {
    background-color: var(--christmas-red);
    color: white;
    box-shadow: 0 4px 0 var(--dark-red);
}

.btn-text {
    background: transparent;
    color: var(--christmas-gold);
    text-decoration: underline;
    display: block;
    margin: 0 auto;
    font-size: 1rem;
}

/* Snowflakes Animation */
.snowflake {
    color: #fff;
    font-size: 1em;
    font-family: Arial, sans-serif;
    text-shadow: 0 0 5px #000;
    position: fixed;
    top: -10%;
    z-index: 9999;
    user-select: none;
    cursor: default;
    animation-name: snowflakes-fall, snowflakes-shake;
    animation-duration: 10s, 3s;
    animation-timing-function: linear, ease-in-out;
    animation-iteration-count: infinite, infinite;
    animation-play-state: running, running;
}

.snowflake:nth-of-type(0) {
    left: 1%;
    animation-delay: 0s, 0s;
}

.snowflake:nth-of-type(1) {
    left: 10%;
    animation-delay: 1s, 1s;
}

.snowflake:nth-of-type(2) {
    left: 20%;
    animation-delay: 6s, 0.5s;
}

.snowflake:nth-of-type(3) {
    left: 30%;
    animation-delay: 4s, 2s;
}

.snowflake:nth-of-type(4) {
    left: 40%;
    animation-delay: 2s, 2s;
}

.snowflake:nth-of-type(5) {
    left: 50%;
    animation-delay: 8s, 3s;
}

.snowflake:nth-of-type(6) {
    left: 60%;
    animation-delay: 6s, 2s;
}

.snowflake:nth-of-type(7) {
    left: 70%;
    animation-delay: 2.5s, 1s;
}

.snowflake:nth-of-type(8) {
    left: 80%;
    animation-delay: 1s, 0s;
}

.snowflake:nth-of-type(9) {
    left: 90%;
    animation-delay: 3s, 1.5s;
}

@keyframes snowflakes-fall {
    0% {
        top: -10%;
    }

    100% {
        top: 100%;
    }
}

@keyframes snowflakes-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(80px);
    }
}

/* Mobile adjustments */
@media (max-width: 400px) {
    h1 {
        font-size: 2.5rem;
    }

    .timer-display {
        font-size: 4rem;
    }

    .btn {
        padding: 12px 24px;
        font-size: 1rem;
    }
}