/* --- VARIABLES --- */
:root {
    --bg-dark: #2c0b15;
    --bg-gradient: #5e2a38;
    --book-cover: #8b4513;
    --paper-color: #fdfbf7;
    --polaroid-white: #fffdf5;
}

body {
    margin: 0; padding: 0;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-gradient) 100%);
    height: 100vh; width: 100vw;
    display: flex; justify-content: center; align-items: center;
    font-family: 'Patrick Hand', cursive;
    overflow: hidden; user-select: none;
}

/* --- FONDO ANIMADO --- */
#floating-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 0; overflow: hidden;
}
.floater {
    position: absolute; font-size: 2rem; opacity: 0.5;
    animation: floatUp 25s linear infinite;
    text-shadow: 0 0 5px rgba(255, 183, 197, 0.3);
}
@keyframes floatUp {
    0% { transform: translateY(110vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.6; }
    100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

/* --- PORTADA --- */
#cover-screen {
    position: fixed; width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center;
    z-index: 200; transition: transform 1s ease, opacity 0.8s ease;
}
.book-cover {
    width: 300px; height: 420px;
    background-color: var(--book-cover);
    border-radius: 5px 15px 15px 5px;
    box-shadow: 20px 20px 40px rgba(0,0,0,0.5), inset 10px 0 30px rgba(0,0,0,0.4);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    position: relative; border: 3px solid #5a2d0c;
}
.spine-deco {
    position: absolute; left: 15px; top: 0; bottom: 0; width: 25px;
    border-left: 3px dashed rgba(255,255,255,0.2);
    border-right: 3px dashed rgba(255,255,255,0.2);
}
.cover-title {
    font-family: 'Indie Flower', cursive; color: #eecfa1; font-size: 3.5rem;
    text-align: center; text-shadow: 3px 3px 5px rgba(0,0,0,0.7);
    margin-bottom: 30px; line-height: 1.1;
}
.sticker-deco { font-size: 5rem; margin-bottom: 30px; filter: drop-shadow(0 5px 10px rgba(0,0,0,0.3)); }
#open-btn {
    padding: 12px 35px; font-size: 1.6rem;
    background: #f4e1c1; border: 2px solid #d4b181; border-radius: 8px;
    font-family: 'Patrick Hand', cursive; cursor: pointer;
    box-shadow: 0 5px 10px rgba(0,0,0,0.4); transition: all 0.2s; color: #5a2d0c;
}
#open-btn:hover { transform: scale(1.05) translateY(-3px); background: #fff; }

/* --- ESCENARIO --- */
#stage {
    position: relative; width: 100%; height: 100%;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    opacity: 0; transition: opacity 1s ease; z-index: 10;
}
#stage.active { opacity: 1; }

#moment-title {
    font-size: 2.8rem; color: #ffb7c5; margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.9);
    font-family: 'Indie Flower', cursive; min-height: 60px;
    z-index: 10; text-align: center;
}

#open-book {
    width: 92%; max-width: 1100px; height: 65vh;
    background-color: var(--paper-color);
    display: flex; position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.7);
    border-radius: 8px; overflow: hidden;
}
#open-book::before {
    content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 4px;
    background: rgba(0,0,0,0.15); box-shadow: inset 0 0 15px rgba(0,0,0,0.2); z-index: 5;
    transform: translateX(-50%);
}
.page {
    flex: 1; height: 100%; position: relative;
    background-image: repeating-linear-gradient(var(--paper-color) 0px, var(--paper-color) 24px, #e0d8c8 25px);
}
.left-page { border-right: 2px solid rgba(0,0,0,0.1); border-radius: 8px 0 0 8px; }
.right-page { border-left: 2px solid rgba(0,0,0,0.1); border-radius: 0 8px 8px 0; }

/* --- POLAROIDS --- */
#collage-area {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 20; pointer-events: none;
}
.polaroid {
    position: absolute;
    background-color: var(--polaroid-white);
    padding: 12px 12px 45px 12px;
    box-shadow: 3px 5px 15px rgba(0,0,0,0.4);
    width: 190px; border-radius: 3px;
    opacity: 0; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.4) rotate(0deg); 
    transition: all 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10; text-align: center; pointer-events: auto;
}
.polaroid img.photo {
    width: 100%; height: 175px; object-fit: cover;
    background: #f4f4f4; border: 1px solid #ddd;
}
.photo-caption {
    font-family: 'Patrick Hand', cursive; font-size: 1.2rem; color: #333;
    margin-top: 12px; line-height: 1.1; transform: rotate(-1deg);
}

/* --- CINTA ADHESIVA (TAPE) --- */
.tape {
    position: absolute; top: -12px; left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    width: 80px; height: 25px;
    background-color: rgba(255, 183, 197, 0.6); /* Rosa translúcido */
    z-index: 15; box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    opacity: 0.9;
}

/* --- DECORACIONES (Solo Flores) --- */
.flower-decoration {
    position: absolute; width: 50px; z-index: 20;
    filter: drop-shadow(2px 2px 3px rgba(0,0,0,0.2)); pointer-events: none;
}

.polaroid.visible { opacity: 1; }
.polaroid.visible:hover {
    z-index: 100 !important; transform: translate(-50%, -50%) scale(1.25) rotate(0deg) !important;
    transition: transform 0.3s ease-out; box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

#click-hint {
    margin-top: 20px; color: rgba(255,255,255,0.8);
    font-size: 1.3rem; cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}
.hidden { display: none !important; }

@media (max-width: 768px) {
    #open-book { flex-direction: column; height: 80vh; }
    .page { width: 100%; height: 50%; border-bottom: 3px solid rgba(0,0,0,0.2); }
    #open-book::before { display: none; }
    .polaroid { width: 140px; padding: 8px 8px 35px 8px; }
    .polaroid img.photo { height: 130px; }
    .photo-caption { font-size: 1rem; margin-top: 8px; }
    .flower-decoration { width: 40px; }
    .tape { width: 60px; height: 20px; top: -10px; }
}