/* ----- RESET Y ESTILOS GENERALES ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Quicksand', sans-serif;
    background: #fcf3ee;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.container {
    max-width: 900px;
    width: 100%;
    background: rgba(255, 248, 245, 0.85);
    backdrop-filter: blur(4px);
    border-radius: 60px 60px 40px 40px;
    padding: 2rem 1.5rem 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

/* Fondo decorativo de papel */
.container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(255, 215, 175, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

h1, h2, h3 {
    font-weight: 600;
    color: #6b3f34;
}

/* ----- SOBRE ANIMADO ----- */
.envelope-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    cursor: pointer;
    transition: transform 0.3s;
}
.envelope-wrapper:hover {
    transform: scale(1.02);
}

.envelope {
    width: 260px;
    height: 170px;
    background: #e8c9b0;
    border-radius: 10px 10px 0 0;
    position: relative;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: all 0.8s ease;
    transform-origin: bottom;
}
.envelope .flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #dbb8a0;
    clip-path: polygon(0 0, 50% 60%, 100% 0);
    transition: transform 0.8s ease;
    transform-origin: top;
    z-index: 2;
    border-radius: 10px 10px 0 0;
}
.envelope .flap.open {
    transform: rotateX(180deg);
}
.envelope .body {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: #f2dac8;
    border-radius: 0 0 10px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #7a4d3a;
    font-weight: 600;
    letter-spacing: 2px;
    border-top: 3px dashed #dbb8a0;
    z-index: 1;
}
.envelope .body span {
    background: white;
    padding: 0.2rem 1rem;
    border-radius: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Carta que aparece dentro del sobre */
.letter {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.8s ease, opacity 0.6s ease, margin 0.6s ease, padding 0.6s ease;
    opacity: 0;
    margin-top: 0;
    background: #fffbf7;
    border-radius: 30px;
    padding: 0 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}
.letter.show {
    max-height: 1200px;
    opacity: 1;
    margin-top: 2rem;
    padding: 2rem 1.5rem;
}
.letter h2 {
    font-family: 'Dancing Script', cursive;
    font-size: 2.8rem;
    color: #b05a4b;
    text-align: center;
    margin-bottom: 1rem;
}
.letter p {
    font-size: 1.15rem;
    line-height: 1.9;
    color: #3d2c25;
    margin-bottom: 1rem;
    text-align: justify;
}
.letter .firma {
    font-family: 'Dancing Script', cursive;
    font-size: 2rem;
    text-align: right;
    color: #b05a4b;
    margin-top: 1.5rem;
}

/* ----- POLAROIDS ----- */
.polaroid-section {
    margin: 3rem 0 2rem;
}
.polaroid-section h2 {
    font-family: 'Patrick Hand', cursive;
    font-size: 2.2rem;
    text-align: center;
    color: #7a4d3a;
    margin-bottom: 1.5rem;
}
.polaroid-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    justify-items: center;
}
.polaroid {
    background: white;
    padding: 0.8rem 0.8rem 2rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transform: rotate(var(--rot, 0deg));
    transition: transform 0.4s ease, box-shadow 0.3s;
    border-radius: 5px;
    width: 100%;
    max-width: 220px;
    cursor: default;
}
.polaroid:hover {
    transform: rotate(0deg) scale(1.03);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    z-index: 10;
}
.polaroid img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}
.polaroid .caption {
    text-align: center;
    font-family: 'Patrick Hand', cursive;
    font-size: 1rem;
    color: #4d2e24;
    margin-top: 0.6rem;
    padding: 0 0.2rem;
}

/* ----- BOTÓN DE ABRAZOS ----- */
.hug-section {
    text-align: center;
    margin: 3rem 0;
}
.hug-btn {
    background: #f5d4c0;
    border: none;
    border-radius: 60px;
    padding: 0.8rem 2.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #6b3f34;
    box-shadow: 0 6px 0 #dbb8a0;
    cursor: pointer;
    transition: all 0.1s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    position: relative;
}
.hug-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #dbb8a0;
}
.hug-count {
    background: white;
    border-radius: 30px;
    padding: 0.2rem 1rem;
    font-size: 1.4rem;
    color: #b05a4b;
}
.heart-rain {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    width: 100%;
    height: 100%;
    z-index: 9999;
}
.heart-rain span {
    position: absolute;
    font-size: 1.8rem;
    animation: fall linear forwards;
    opacity: 0.9;
}
@keyframes fall {
    0% { transform: translateY(-20px) rotate(0deg); opacity: 0.9; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ----- FRASES ESCONDIDAS (en flores) ----- */
.hidden-phrases {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
}
.flower {
    font-size: 2.8rem;
    cursor: pointer;
    transition: transform 0.3s;
    position: relative;
    display: inline-block;
}
.flower:hover {
    transform: scale(1.3) rotate(10deg);
}
.flower .tooltip {
    visibility: hidden;
    opacity: 0;
    width: 200px;
    background: #6b3f34;
    color: #fff7f0;
    text-align: center;
    padding: 0.6rem 1rem;
    border-radius: 30px;
    font-size: 1rem;
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    transition: opacity 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    white-space: nowrap;
}
.flower:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* ----- RECUERDOS AÑADIDOS POR ELLA (desde el panel) ----- */
.recuerdos-section {
    margin-top: 3rem;
    border-top: 2px dashed #e8c9b0;
    padding-top: 2rem;
}
.recuerdos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}
.recuerdo-card {
    background: white;
    border-radius: 20px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    text-align: center;
}
.recuerdo-card img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 0.5rem;
}
.recuerdo-card h4 {
    color: #6b3f34;
    margin-bottom: 0.3rem;
}
.recuerdo-card p {
    font-size: 0.95rem;
    color: #5a4036;
}
.recuerdo-card button {
    background: none;
    border: none;
    color: #b05a4b;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

/* ----- PANEL DE ADMIN (solo visible con el enlace) ----- */
.admin-panel {
    display: none;
    background: #f5e8e0;
    border-radius: 40px;
    padding: 2rem;
    margin-top: 3rem;
    border: 2px solid #dbb8a0;
}
.admin-panel.open {
    display: block;
}
.admin-panel h3 {
    font-family: 'Patrick Hand', cursive;
    font-size: 2rem;
    color: #6b3f34;
    margin-bottom: 1rem;
}
.admin-panel input, 
.admin-panel textarea {
    width: 100%;
    padding: 0.8rem 1.2rem;
    margin-bottom: 1rem;
    border: 2px solid #dbb8a0;
    border-radius: 30px;
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    outline: none;
    background: white;
}
.admin-panel input:focus, 
.admin-panel textarea:focus {
    border-color: #b05a4b;
}
.admin-panel button {
    background: #b05a4b;
    border: none;
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 40px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.admin-panel button:hover {
    background: #8f473b;
}
.admin-link {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: #a07a6a;
}
.admin-link a {
    color: #b05a4b;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}
.admin-link a:hover {
    text-decoration: underline;
}

/* ----- ADMIN: LISTA DE RECUERDOS (nuevo) ----- */
#adminListaRecuerdos {
    margin-top: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e8c9b0;
    border-radius: 20px;
    padding: 0.5rem;
    background: #fcf3ee;
}
.admin-recuerdo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #e8c9b0;
    background: white;
    border-radius: 10px;
    margin-bottom: 0.5rem;
}
.admin-recuerdo-item span {
    flex: 1;
    margin-right: 1rem;
}
.admin-recuerdo-item button {
    background: #b05a4b;
    border: none;
    color: white;
    padding: 0.3rem 1.2rem;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}
.admin-recuerdo-item button:hover {
    background: #8f473b;
}

/* ----- REPRODUCTOR DE MÚSICA ----- */
.music-player {
    display: flex;
    justify-content: center;
    margin: 2rem 0 1rem;
}
.music-player audio {
    width: 100%;
    max-width: 300px;
    border-radius: 40px;
    background: #f5e8e0;
}

/* ----- RESPONSIVE ----- */
@media (max-width: 600px) {
    .container { padding: 1rem; }
    .letter h2 { font-size: 2.2rem; }
    .polaroid-grid { grid-template-columns: repeat(2, 1fr); }
    .flower { font-size: 2rem; }
}