:root {
    --bg-gradient: linear-gradient(135deg, #fde4e4 0%, #f9d8d8 50%, #e6e6fa 100%);
    --text-color: #5d4037;
    --card-bg: #fffcf9;
    --btn-color: #ffb6b9;
    --btn-hover: #fa9296;
    --accent-color: #d4838f;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-color);
    scroll-behavior: smooth;
    overflow-x: hidden; 
}

#countdown-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 5px;
    font-weight: 300;
}

h5 {
    font-weight: 300;
    margin-top: 0;
    margin-bottom: 30px;
    color: #8a6c64;
}

.timer {
    display: flex;
    gap: 20px;
    font-size: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.time-box {
    background: rgba(255, 255, 255, 0.6);
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    min-width: 80px;
}

.time-box span {
    display: block;
    font-size: 3rem;
    font-weight: bold;
    color: var(--accent-color);
}

.scroll-hint {
    position: absolute;
    bottom: 30px;
    font-size: 0.9rem;
    opacity: 0.7;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

#history-section {
    min-height: 100vh;
    padding: 50px 20px;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.history-title {
    color: var(--accent-color);
    font-weight: 300;
    margin-bottom: 30px;
    text-align: center;
}

.letters-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center;
    width: 100%;
    max-width: 800px;
}

.letter-item {
    background: rgba(255, 255, 255, 0.5);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    width: 120px; /* Tamaño de la tarjeta */
}

.letter-item:hover {
    transform: translateY(-5px) scale(1.05);
    background: rgba(255, 255, 255, 0.8);
}

.letter-item-icon {
    font-size: 60px; /* Icono grande */
    margin-bottom: 10px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.letter-item-date {
    font-weight: bold;
    color: var(--accent-color);
    font-size: 1rem;
}

#letter-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease;
    padding: 20px;
    box-sizing: border-box;
}

#letter-modal.active {
    opacity: 1;
    visibility: visible;
}

.envelope-container {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s;
}

.envelope-container:hover {
    transform: scale(1.05);
}

.envelope-icon {
    font-size: 100px;
    text-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: opacity 0.3s;
}

.letter-content {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5) translateY(100px);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    background-image: repeating-linear-gradient(transparent, transparent 29px, #f2f2f2 30px);
    line-height: 30px;
}

.letter-content.open {
    transform: translate(-50%, -50%) scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.letter-title {
    font-family: 'Brush Script MT', cursive; 
    color: var(--accent-color);
    margin-top: 0;
}

.letter-signature {
    font-family: 'Brush Script MT', cursive; 
    color: var(--accent-color);
    text-align: right;
    font-size: 1.4rem;
    margin-top: 15px;
    margin-bottom: 25px;
}

.close-btn {
    margin-top: 20px;
    padding: 10px 25px;
    border: none;
    background: var(--btn-color);
    color: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
    width: 100%;
    max-width: 250px;
}

.close-btn:hover {
    background: var(--btn-hover);
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.8rem;
    }

    .timer {
        gap: 10px;
        font-size: 1rem;
    }

    .time-box {
        min-width: 60px;
        padding: 10px;
    }

    .time-box span {
        font-size: 1.8rem; 
    }

    .envelope-icon {
        font-size: 80px;/
    }

    .letter-content {
        padding: 25px; 
        line-height: 26px; 
        background-image: repeating-linear-gradient(transparent, transparent 25px, #f2f2f2 26px);
    }
}