:root {
    --christmas-red: #d42426;
    --christmas-green: #2f5a2e;
    --gold: #f8b229;
    --white: #ffffff;
    --bg-color: #f0f0f0;
}

body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    background-image: url('https://www.transparenttextures.com/patterns/snow.png'); /* Textura de nieve */
    color: #333;
    overflow-x: hidden;
}

/* LOADER */
#loader-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--christmas-red);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
    color: white;
    text-align: center;
}

.elf-gif {
    max-width: 200px;
    border-radius: 50%;
    border: 5px solid var(--gold);
    margin-bottom: 20px;
}

#enter-btn {
    padding: 15px 30px;
    font-size: 1.2rem;
    background-color: var(--christmas-green);
    color: white;
    border: 2px solid var(--gold);
    border-radius: 25px;
    cursor: pointer;
    margin-top: 20px;
    font-family: 'Mountains of Christmas', cursive;
    font-weight: bold;
}

.small-text {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 10px;
}

/* MAIN CONTENT */
.hidden {
    display: none !important;
}

main {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
    background: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    min-height: 100vh;
    border-left: 10px solid var(--christmas-red);
    border-right: 10px solid var(--christmas-red);
}

header h1 {
    font-family: 'Mountains of Christmas', cursive;
    color: var(--christmas-red);
    font-size: 2.5rem;
}

.date, .location {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--christmas-green);
    margin: 10px 0;
}

/* FORMULARIO */
.rsvp-section {
    background-color: #e8f5e9;
    padding: 20px;
    border-radius: 15px;
    margin: 30px 0;
    border: 2px dashed var(--christmas-green);
}

input, select {
    width: 80%;
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    border: 1px solid #ccc;
}

button {
    background-color: var(--christmas-red);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s;
}

button:active {
    transform: scale(0.95);
}

/* FOTO */
.photo-booth {
    margin-top: 30px;
}

.camera-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 500px; /* Altura fija para evitar saltos */
    margin: 0 auto;
    background: #000;
    border: 5px solid var(--gold);
    border-radius: 10px;
    overflow: hidden;
}

#video, #photo-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

/* El canvas estará oculto hasta que se haga la foto */
#photo-canvas {
    z-index: 2;
}

#sticker-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    display: none;
}

#sticker-overlay img {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 40%; /* Ajusta según necesites */
}

.stickers-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.sticker-opt {
    width: 50px;
    height: 50px;
    cursor: pointer;
    border: 2px solid transparent;
    padding: 5px;
    border-radius: 50%;
    background: #f9f9f9;
}

.sticker-opt.selected {
    border-color: var(--christmas-red);
    background: #ffebeb;
}

.whatsapp-btn {
    display: inline-block;
    background-color: #25D366;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    margin-top: 15px;
}

/* --- LUCES DE NAVIDAD --- */
.lightrope {
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    position: absolute;
    z-index: 1;
    margin: -15px 0 0 0;
    padding: 0;
    pointer-events: none;
    width: 100%;
    top: 0;
}

.lightrope li {
    position: relative;
    animation-fill-mode: both;
    animation-iteration-count: infinite;
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline-block;
    width: 12px;
    height: 28px;
    border-radius: 50%;
    margin: 20px;
    background: #00f7a5;
    box-shadow: 0px 4.66667px 24px 3px #00f7a5;
    animation-name: flash-1;
    animation-duration: 2s;
}

.lightrope li:nth-child(2n+1) {
    background: #00ffff;
    box-shadow: 0px 4.66667px 24px 3px rgba(0, 255, 255, 0.5);
    animation-name: flash-2;
    animation-duration: 0.4s;
}

.lightrope li:nth-child(4n+2) {
    background: #f70094;
    box-shadow: 0px 4.66667px 24px 3px #f70094;
    animation-name: flash-3;
    animation-duration: 1.1s;
}

.lightrope li:nth-child(odd) {
    animation-duration: 1.8s;
}

.lightrope li:nth-child(3n+1) {
    animation-duration: 1.4s;
}

.lightrope li:before {
    content: "";
    position: absolute;
    background: #222;
    width: 10px;
    height: 9.33333px;
    border-radius: 3px;
    top: -4.66667px;
    left: 1px;
}

.lightrope li:after {
    content: "";
    top: -14px;
    left: 9px;
    position: absolute;
    width: 52px;
    height: 18.66667px;
    border-bottom: solid #222 2px;
    border-radius: 50%;
}

.lightrope li:last-child:after {
    content: none;
}

.lightrope li:first-child {
    margin-left: -40px;
}

@keyframes flash-1 {
    0%, 100% { background: #00f7a5; box-shadow: 0px 4.66667px 24px 3px #00f7a5; }
    50% { background: rgba(0, 247, 165, 0.4); box-shadow: 0px 4.66667px 24px 3px rgba(0, 247, 165, 0.2); }
}
@keyframes flash-2 {
    0%, 100% { background: #00ffff; box-shadow: 0px 4.66667px 24px 3px #00ffff; }
    50% { background: rgba(0, 255, 255, 0.4); box-shadow: 0px 4.66667px 24px 3px rgba(0, 255, 255, 0.2); }
}
@keyframes flash-3 {
    0%, 100% { background: #f70094; box-shadow: 0px 4.66667px 24px 3px #f70094; }
    50% { background: rgba(247, 0, 148, 0.4); box-shadow: 0px 4.66667px 24px 3px rgba(247, 0, 148, 0.2); }
}

/* --- EFECTO NIEVE --- */
.snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.snow {
    position: absolute;
    top: -10px;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    opacity: 0.8;
    animation: fall linear infinite;
}

@keyframes fall {
    0% { transform: translateY(-10vh) translateX(0); }
    100% { transform: translateY(110vh) translateX(20px); }
}

.snow:nth-child(1) { left: 1%; animation-duration: 10s; animation-delay: -1s; }
.snow:nth-child(2) { left: 3%; animation-duration: 12s; animation-delay: -5s; width: 6px; height: 6px; }
.snow:nth-child(3) { left: 5%; animation-duration: 8s; animation-delay: -2s; }
.snow:nth-child(4) { left: 7%; animation-duration: 15s; animation-delay: -8s; width: 12px; height: 12px; }
.snow:nth-child(5) { left: 9%; animation-duration: 11s; animation-delay: -3s; }
.snow:nth-child(5n+1) { left: 10%; animation-duration: 13s; }
.snow:nth-child(5n+2) { left: 30%; animation-duration: 11s; width: 8px; height: 8px; }
.snow:nth-child(5n+3) { left: 50%; animation-duration: 15s; }
.snow:nth-child(5n+4) { left: 70%; animation-duration: 9s; width: 5px; height: 5px; }
.snow:nth-child(5n+5) { left: 90%; animation-duration: 12s; }
.snow:nth-child(7n) { animation-delay: -2s; opacity: 0.5; }
.snow:nth-child(7n+1) { animation-delay: -5s; }
.snow:nth-child(7n+2) { animation-delay: -1s; }
.snow:nth-child(7n+3) { animation-delay: -8s; }
.snow:nth-child(3n) { left: 25%; }
.snow:nth-child(3n+1) { left: 55%; }
.snow:nth-child(3n+2) { left: 85%; }

/* --- BOTÓN AUDIO --- */
.audio-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--christmas-green);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: transform 0.2s;
    font-size: 24px;
}

.audio-btn:hover {
    transform: scale(1.1);
}

.audio-btn.playing {
    animation: pulse-border 1.5s infinite;
    background: #fff0f0;
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(212, 36, 38, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(212, 36, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 36, 38, 0); }
}