:root {
    --primary: #ff4d6d;
    --bg: #0a0a0c;
    --tape-color: rgba(255, 255, 230, 0.8); /* Color de cinta de enmascarar */
}

body, html {
    margin: 0; padding: 0;
    background-color: var(--bg);
    font-family: 'Montserrat', sans-serif;
    color: white;
    overflow-x: hidden;
}

#canvas-album { position: fixed; top: 0; left: 0; z-index: 0; }

.album-wrapper {
    position: relative; z-index: 10;
    padding: 30px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.album-nav { margin-bottom: 20px; }
.btn-back {
    background: rgba(255,255,255,0.1);
    color: white; border: 1px solid rgba(255,255,255,0.2);
    padding: 10px 20px; border-radius: 30px;
    cursor: pointer; transition: 0.3s;
}
.btn-back:hover { background: var(--primary); border-color: var(--primary); }

.album-title {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(3rem, 8vw, 5rem);
    color: var(--primary);
    text-align: center; margin-bottom: 10px;
}
.album-subtitle { text-align: center; color: #ccc; margin-bottom: 50px; }

/* --- ESTILO SCRAPBOOK --- */
.scrapbook {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px; /* Espacio entre fotos */
    padding-bottom: 50px;
}

/* La tarjeta de foto */
.photo-item {
    position: relative;
    background: white;
    padding: 15px 15px 40px 15px; /* Espacio abajo para escribir algo si quisieras */
    box-shadow: 5px 10px 20px rgba(0,0,0,0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    width: 280px; /* Ancho fijo para que parezcan polaroids reales */
    animation: popIn 0.6s ease backwards;
}

.photo-item img {
    width: 100%;
    height: 280px; /* Cuadradas */
    object-fit: cover;
    filter: sepia(20%); /* Un toquecito vintage sutil */
    transition: 0.4s;
}

/* Truco para la "cinta adhesiva" arriba de la foto */
.photo-item::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 30px;
    background-color: var(--tape-color);
    opacity: 0.7;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transform: translateX(-50%) rotate(-3deg); /* Cinta un poco chueca */
    z-index: 2;
}

/* Rotaciones aleatorias para el desorden */
.photo-item:nth-child(3n+1) { transform: rotate(3deg); }
.photo-item:nth-child(3n+2) { transform: rotate(-4deg); margin-top: 20px; }
.photo-item:nth-child(3n+3) { transform: rotate(5deg); margin-top: -15px; }
.photo-item:nth-child(4n)   { transform: rotate(-2deg); }

/* Efecto HOVER: La foto cobra vida */
.photo-item:hover {
    transform: scale(1.15) rotate(0deg) !important; /* Se endereza y agranda */
    z-index: 50; /* Se pone encima de todas las demás */
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}
.photo-item:hover img { filter: sepia(0%); /* Vuelve a color normal */ }

@keyframes popIn {
    from { opacity: 0; transform: scale(0.8) translateY(50px); }
    to { opacity: 1; }
}

/* MODAL */
.modal { display: none; position: fixed; z-index: 100; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.95); }
.modal-content { margin: 5% auto; display: block; max-width: 90%; max-height: 80vh; animation: zoom 0.3s; border: 5px solid white;}
.close { position: absolute; top: 20px; right: 40px; color: #f1f1f1; font-size: 50px; cursor: pointer; }
@keyframes zoom { from {transform:scale(0)} to {transform:scale(1)} }

/* MÓVIL */
@media (max-width: 600px) {
    .scrapbook { gap: 25px; }
    .photo-item { width: 90%; } /* En cel ocupan casi todo el ancho */
    .photo-item:nth-child(n) { transform: rotate(0deg); margin-top: 0; } /* Quitamos el desorden en cel para que sea legible */
    .photo-item:hover { transform: scale(1.02) rotate(0deg) !important; } /* Hover más sutil en táctil */
}

/* --- TARJETA DE MENSAJE PERSONALIZADO --- */
.message-item {
    position: relative;
    background: #fff9c4; /* Un amarillo post-it muy suave */
    padding: 30px 20px;
    box-shadow: 5px 10px 15px rgba(0,0,0,0.3);
    width: 250px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.4s ease;
    animation: popIn 0.6s ease backwards;
}

.message-item p {
    color: #5d4037;
    font-family: 'Dancing Script', cursive;
    font-size: 1.6rem;
    margin: 0;
    line-height: 1.2;
}

/* Reutilizamos el efecto de la cinta para las notas también */
.message-item::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%) rotate(2deg);
    width: 80px;
    height: 25px;
    background-color: rgba(255, 77, 109, 0.3); /* Cinta rosadita para las notas */
    z-index: 2;
}

/* Rotación para que se vea "pegado" al azar */
.message-item:nth-child(even) { transform: rotate(-3deg); }
.message-item:nth-child(odd) { transform: rotate(2deg); }

.message-item:hover {
    transform: scale(1.1) rotate(0deg) !important;
    z-index: 50;
}