:root {
    --christmas-red: #c41e3a;
    --christmas-green: #165B33;
    --snow-white: #f8f9fa;
    --gold: #FFD700;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--christmas-green);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Snow Animation */
.snow {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

/* First layer of snow */
.snow::before,
.snow::after,
.snow::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 120vh;
    background-image: 
        /* Layer 1 - big flakes */
        radial-gradient(4px 4px at 50px 50px, white 50%, transparent),
        radial-gradient(4px 4px at 150px 150px, white 50%, transparent),
        radial-gradient(4px 4px at 250px 250px, white 50%, transparent),
        radial-gradient(4px 4px at 350px 350px, white 50%, transparent),
        radial-gradient(4px 4px at 450px 450px, white 50%, transparent),
        radial-gradient(4px 4px at 550px 550px, white 50%, transparent),
        radial-gradient(4px 4px at 650px 650px, white 50%, transparent),
        radial-gradient(4px 4px at 750px 750px, white 50%, transparent),
        radial-gradient(4px 4px at 850px 850px, white 50%, transparent),
        /* Layer 2 - medium flakes */
        radial-gradient(3px 3px at 100px 100px, white 50%, transparent),
        radial-gradient(3px 3px at 200px 200px, white 50%, transparent),
        radial-gradient(3px 3px at 300px 300px, white 50%, transparent),
        radial-gradient(3px 3px at 400px 400px, white 50%, transparent),
        radial-gradient(3px 3px at 500px 500px, white 50%, transparent),
        radial-gradient(3px 3px at 600px 600px, white 50%, transparent),
        radial-gradient(3px 3px at 700px 700px, white 50%, transparent),
        radial-gradient(3px 3px at 800px 800px, white 50%, transparent),
        radial-gradient(3px 3px at 900px 900px, white 50%, transparent),
        /* Layer 3 - small flakes */
        radial-gradient(2px 2px at 75px 75px, white 50%, transparent),
        radial-gradient(2px 2px at 175px 175px, white 50%, transparent),
        radial-gradient(2px 2px at 275px 275px, white 50%, transparent),
        radial-gradient(2px 2px at 375px 375px, white 50%, transparent),
        radial-gradient(2px 2px at 475px 475px, white 50%, transparent),
        radial-gradient(2px 2px at 575px 575px, white 50%, transparent),
        radial-gradient(2px 2px at 675px 675px, white 50%, transparent),
        radial-gradient(2px 2px at 775px 775px, white 50%, transparent),
        radial-gradient(2px 2px at 875px 875px, white 50%, transparent),
        /* Additional coverage - scattered flakes */
        radial-gradient(3px 3px at 125px 125px, white 50%, transparent),
        radial-gradient(2px 2px at 225px 225px, white 50%, transparent),
        radial-gradient(4px 4px at 325px 325px, white 50%, transparent),
        radial-gradient(3px 3px at 425px 425px, white 50%, transparent),
        radial-gradient(2px 2px at 525px 525px, white 50%, transparent),
        radial-gradient(4px 4px at 625px 625px, white 50%, transparent),
        /* Extra density */
        radial-gradient(2px 2px at 25px 25px, white 50%, transparent),
        radial-gradient(2px 2px at 125px 225px, white 50%, transparent),
        radial-gradient(3px 3px at 225px 325px, white 50%, transparent),
        radial-gradient(2px 2px at 325px 425px, white 50%, transparent),
        radial-gradient(3px 3px at 425px 525px, white 50%, transparent),
        radial-gradient(2px 2px at 525px 625px, white 50%, transparent);
    background-size: 900px 900px;
    opacity: 0.9;
}

/* Multiple layers with different speeds and directions */
.snow::before {
    animation: snow 8s linear infinite;
    opacity: 0.9;
}

.snow::after {
    animation: snow-reverse 10s linear infinite;
    animation-delay: -5s;
    opacity: 0.8;
}

.snow::before {
    animation: snow-diagonal 6s linear infinite;
    animation-delay: -2s;
    opacity: 0.9;
}

@keyframes snow {
    0% {
        transform: translateY(-120vh) translateX(0);
    }
    100% {
        transform: translateY(120vh) translateX(-50px);
    }
}

@keyframes snow-reverse {
    0% {
        transform: translateY(-120vh) translateX(0);
    }
    100% {
        transform: translateY(120vh) translateX(50px);
    }
}

@keyframes snow-diagonal {
    0% {
        transform: translateY(-120vh) translateX(-50px);
    }
    100% {
        transform: translateY(120vh) translateX(50px);
    }
}

/* Add this to create a swirling effect */
@keyframes snowSwirl {
    0% {
        transform: translateY(-120vh) translateX(0) rotate(0deg);
    }
    50% {
        transform: translateY(0vh) translateX(-50px) rotate(180deg);
    }
    100% {
        transform: translateY(120vh) translateX(-100px) rotate(360deg);
    }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--snow-white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    animation: fadeIn 1s ease-out;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

h1 {
    text-align: center;
    color: var(--christmas-red);
    animation: pulse 2s infinite;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

h1 i {
    color: var(--christmas-green);
    animation: wiggle 2s infinite;
}

#riddle-section, #clue-section {
    margin: 20px 0;
    text-align: center;
    animation: fadeIn 1s ease-out;
}

#clue-button {
    padding: 15px 30px;
    background-color: var(--christmas-red);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

#clue-button i {
    margin: 0 5px;
    animation: bounce 2s infinite;
}

#clue-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

#clue-button:not(:disabled):hover {
    transform: scale(1.05);
    background-color: #a01830;
}

#clue-button:not(:disabled):active {
    transform: scale(0.95);
}

#clue-button.shake {
    animation: shake 0.5s ease-in-out;
}

.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#timer {
    margin-top: 15px;
    font-size: 1.1em;
    color: var(--christmas-green);
    font-weight: bold;
}

/* Additional Animations */
@keyframes wiggle {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

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

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes timerPulse {
    0% { color: var(--christmas-green); }
    50% { color: var(--christmas-red); }
    100% { color: var(--christmas-green); }
}

#timer.almost-done {
    animation: timerPulse 1s infinite;
    font-size: 1.2em;
}

/* Responsive design */
@media (max-width: 600px) {
    .container {
        padding: 15px;
        margin: 10px;
    }

    h1 {
        font-size: 1.8em;
    }

    #clue-button {
        padding: 10px 20px;
        font-size: 1em;
    }
} 

/* Christmas Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, transparent 0%, transparent 49%, var(--christmas-red) 49%, var(--christmas-red) 51%, transparent 51%, transparent 100%),
        linear-gradient(45deg, transparent 0%, transparent 49%, var(--christmas-green) 49%, var(--christmas-green) 51%, transparent 51%, transparent 100%);
    background-size: 30px 30px;
    opacity: 0.05; /* Reduced opacity to make snow more visible */
    z-index: -2;
}

/* Christmas Trees */
.trees {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 150px;
    z-index: 1;
    display: flex;
    justify-content: space-around;
}

.tree {
    width: 0;
    height: 0;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 100px solid var(--christmas-green);
    position: relative;
    margin: 20px;
}

.tree::after {
    content: '';
    width: 20px;
    height: 20px;
    background: #8B4513;
    position: absolute;
    bottom: -110px;
    left: -10px;
}

/* Christmas Lights */
.lights-container {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    z-index: 3;
}

.light {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin: 10px;
    animation: lightTwinkle 1s infinite alternate;
}

.light:nth-child(1) { background: red; animation-delay: 0s; }
.light:nth-child(2) { background: yellow; animation-delay: 0.2s; }
.light:nth-child(3) { background: green; animation-delay: 0.4s; }
.light:nth-child(4) { background: blue; animation-delay: 0.6s; }
.light:nth-child(5) { background: purple; animation-delay: 0.8s; }
.light:nth-child(6) { background: orange; animation-delay: 1s; }

/* Animations */
@keyframes lightTwinkle {
    from { opacity: 0.4; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1.2); }
}

.word-search-container {
    display: flex;
    justify-content: center;
    margin: 2rem auto;
    max-width: 100%;
    padding: 0 10px;
}

.words-to-find {
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.words-to-find ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.words-to-find li {
    padding: 0.5rem;
    color: var(--christmas-green);
    font-weight: bold;
}

.puzzle-grid {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    overflow: auto;
    max-width: 100%;
}

.puzzle-row {
    display: flex;
    justify-content: center;
    gap: 1px;
}

.puzzle-cell {
    width: clamp(20px, 4vw, 35px);
    height: clamp(20px, 4vw, 35px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: clamp(12px, 2vw, 18px);
}

.puzzle-cell:hover {
    background: var(--christmas-red);
    color: white;
}

/* Responsive styles */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        margin: 10px;
    }

    .word-search-container {
        margin: 1rem auto;
    }

    .puzzle-grid {
        padding: 0.5rem;
    }

    .puzzle-cell {
        border-width: 0.5px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
        margin: 5px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .puzzle-grid {
        padding: 0.3rem;
    }
}

/* Touch device optimization */
@media (hover: none) {
    .puzzle-cell {
        padding: 0;
    }

    .puzzle-cell:active {
        background: var(--christmas-red);
        color: white;
        transform: scale(1.1);
    }
}

/* Landscape mode optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        padding: 10px;
    }

    .word-search-container {
        margin: 0.5rem auto;
    }

    h1, h2 {
        margin: 0.5rem 0;
    }
}

/* Update heading styles */
#word-puzzle-section h2 {
    text-align: center;
    margin: 1rem auto;
    color: var(--christmas-red);
    text-transform: none; /* This will prevent automatic capitalization */
}

#first-riddle {
    font-size: 1.8em;
}

.riddle-text {
    color: var(--christmas-red);
    font-weight: bold;
}

.dare-text {
    font-size: 1.2em;
    font-weight: bold;
    font-style: italic;
}

#word-puzzle-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed var(--christmas-red);
}