* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a0a2e 0%, #16213e 50%, #0f3460 100%);
    overflow-x: hidden;
    position: relative;
}

/* Estrellas de fondo */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 2s infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.3; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.2); }
}

/* Estrella de Belén */
.bethlehem-star {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 4rem;
    animation: glow 2s infinite alternate, float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px gold) drop-shadow(0 0 40px yellow);
    z-index: 10;
}

@keyframes glow {
    0% { filter: drop-shadow(0 0 20px gold) drop-shadow(0 0 40px yellow); }
    100% { filter: drop-shadow(0 0 40px gold) drop-shadow(0 0 60px yellow) drop-shadow(0 0 80px orange); }
}

@keyframes float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-15px); }
}

/* Contenedor principal */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Pantalla de introducción */
.intro-screen {
    text-align: center;
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.title {
    font-family: 'Pacifico', cursive;
    font-size: 3.5rem;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 4px 8px rgba(0,0,0,0.3);
    margin-bottom: 10px;
    animation: titlePulse 3s infinite;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.subtitle {
    font-size: 1.5rem;
    color: #e0e0e0;
    margin-bottom: 40px;
    letter-spacing: 3px;
}

/* Reyes Magos */
.reyes-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.rey {
    text-align: center;
    animation: reyWalk 4s ease-in-out infinite;
}

.rey:nth-child(2) {
    animation-delay: 0.3s;
}

.rey:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes reyWalk {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.rey-emoji {
    font-size: 3rem;
    animation: crownShine 2s infinite;
}

.melchor .rey-emoji { filter: hue-rotate(0deg); }
.gaspar .rey-emoji { filter: hue-rotate(60deg); }
.baltasar .rey-emoji { filter: hue-rotate(180deg); }

@keyframes crownShine {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

.camello {
    font-size: 4rem;
    margin: 10px 0;
}

.rey p {
    color: #ffd700;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Caja de regalo */
.gift-wrapper {
    margin-top: 20px;
}

.gift-box {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gift-box:hover {
    transform: scale(1.1);
}

.gift-base {
    position: absolute;
    bottom: 0;
    width: 150px;
    height: 120px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    overflow: hidden;
}

.gift-ribbon-v {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 100%;
    background: linear-gradient(90deg, #f1c40f, #f39c12, #f1c40f);
}

.gift-ribbon-h {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 30px;
    background: linear-gradient(180deg, #f1c40f, #f39c12, #f1c40f);
}

.gift-lid {
    position: absolute;
    top: -20px;
    left: -10px;
    width: 170px;
    height: 40px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 2;
}

.gift-lid::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 35px;
    height: 100%;
    background: linear-gradient(90deg, #f1c40f, #f39c12, #f1c40f);
}

.gift-bow {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 40px;
}

.gift-bow::before,
.gift-bow::after {
    content: '';
    position: absolute;
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    border-radius: 50% 50% 10px 50%;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.gift-bow::before {
    left: 0;
    transform: rotate(-45deg);
}

.gift-bow::after {
    right: 0;
    transform: rotate(45deg) scaleX(-1);
}

/* Animación de apertura */
.gift-box.opened .gift-lid {
    transform: translateY(-80px) rotate(-30deg);
    opacity: 0;
}

.gift-text {
    margin-top: 20px;
    color: #fff;
    font-size: 1.2rem;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Pantalla del mensaje */
.message-screen {
    text-align: center;
    animation: revealMessage 1s ease-out;
}

.message-screen.hidden {
    display: none;
}

@keyframes revealMessage {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

.message-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,250,240,0.95) 100%);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 40px rgba(255,215,0,0.3);
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.message-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #e74c3c, #f1c40f, #2ecc71, #3498db, #9b59b6);
}

.crown-decoration {
    font-size: 2rem;
    margin-bottom: 15px;
}

.message-card h2 {
    font-family: 'Pacifico', cursive;
    font-size: 2.5rem;
    color: #c0392b;
    margin-bottom: 20px;
}

.greeting {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 20px;
}

.gift-reveal {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    animation: giftPulse 2s infinite;
}

@keyframes giftPulse {
    0%, 100% { box-shadow: 0 5px 20px rgba(252, 182, 159, 0.5); }
    50% { box-shadow: 0 5px 40px rgba(252, 182, 159, 0.8); }
}

.gift-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
    animation: spin 3s linear infinite;
}

/* Botón de descarga PDF */
.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(46, 204, 113, 0.4);
    animation: pulseDownload 2s infinite;
}

.download-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(46, 204, 113, 0.6);
}

.download-btn:active {
    transform: translateY(0);
}

.download-btn span {
    font-size: 1.3rem;
}

.download-btn.hidden {
    display: none;
}

@keyframes pulseDownload {
    0%, 100% { 
        box-shadow: 0 5px 20px rgba(46, 204, 113, 0.4);
    }
    50% { 
        box-shadow: 0 5px 35px rgba(46, 204, 113, 0.7);
    }
}

@keyframes spin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.gift-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #c0392b;
}

.personal-message {
    font-size: 1rem;
    color: #555;
    line-height: 1.8;
    margin-top: 20px;
    font-style: italic;
}

.magic-dust {
    margin-top: 20px;
    font-size: 1.5rem;
    animation: sparkle 1.5s infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Confeti */
.confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 20px;
    top: -20px;
    animation: confettiFall 4s linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Botón reiniciar */
.restart-btn {
    margin-top: 30px;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.restart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.restart-btn span {
    margin-right: 8px;
}

/* Partículas mágicas */
.magic-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.particle {
    position: absolute;
    font-size: 1.5rem;
    animation: floatParticle 6s linear infinite;
    opacity: 0.7;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* ==================== */
/* PANTALLA DE BIENVENIDA */
/* ==================== */

.welcome-screen {
    text-align: center;
    animation: fadeIn 1s ease-out;
    max-width: 500px;
    padding: 20px;
}

.welcome-screen.hidden {
    display: none;
}

.welcome-title {
    font-family: 'Pacifico', cursive;
    font-size: 3rem;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 4px 8px rgba(0,0,0,0.3);
    margin-bottom: 15px;
    animation: titlePulse 3s infinite;
}

.welcome-subtitle {
    font-size: 1.3rem;
    color: #e0e0e0;
    margin-bottom: 40px;
    line-height: 1.6;
}

.name-form {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.name-form label {
    display: block;
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 20px;
    font-weight: 600;
}

.name-form input {
    width: 100%;
    padding: 18px 25px;
    font-size: 1.2rem;
    font-family: 'Poppins', sans-serif;
    border: 3px solid rgba(255, 215, 0, 0.5);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
}

.name-form input:focus {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    transform: scale(1.02);
}

.name-form input::placeholder {
    color: #999;
}

.enter-btn {
    margin-top: 25px;
    padding: 18px 40px;
    font-size: 1.2rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: #1a0a2e;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 25px rgba(255, 215, 0, 0.4);
    width: 100%;
}

.enter-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 35px rgba(255, 215, 0, 0.6);
}

.enter-btn:active {
    transform: translateY(0);
}

.enter-btn span {
    animation: sparkleBtn 1.5s infinite;
}

@keyframes sparkleBtn {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Camellos caminando */
.wise-men-walking {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.walking-camel {
    font-size: 2.5rem;
    animation: walkCamel 3s ease-in-out infinite;
    display: inline-block;
}

.walking-camel:nth-child(1) { animation-delay: 0s; }
.walking-camel:nth-child(2) { animation-delay: 0.3s; }
.walking-camel:nth-child(3) { animation-delay: 0.6s; }

@keyframes walkCamel {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-8px) translateX(5px); }
    50% { transform: translateY(0) translateX(10px); }
    75% { transform: translateY(-8px) translateX(5px); }
}

/* Intro screen hidden */
.intro-screen.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .reyes-container {
        gap: 20px;
    }
    
    .camello {
        font-size: 3rem;
    }
    
    .message-card {
        padding: 25px;
        margin: 0 15px;
    }
    
    .message-card h2 {
        font-size: 2rem;
    }
    
    .bethlehem-star {
        font-size: 3rem;
    }
    
    .welcome-title {
        font-size: 2.2rem;
    }
    
    .welcome-subtitle {
        font-size: 1.1rem;
    }
    
    .name-form {
        padding: 25px;
    }
    
    .name-form input {
        font-size: 1rem;
        padding: 15px 20px;
    }
    
    .enter-btn {
        font-size: 1rem;
        padding: 15px 30px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2rem;
    }
    
    .rey-emoji {
        font-size: 2rem;
    }
    
    .camello {
        font-size: 2.5rem;
    }
    
    .gift-box {
        width: 120px;
        height: 120px;
    }
    
    .gift-base {
        width: 120px;
        height: 100px;
    }
    
    .gift-lid {
        width: 140px;
    }
}
