body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #f5af19 0%, #f12711 100%); /* Tema cerveza - naranja/ámbar */
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    perspective: 1000px;
}

.card-container {
    position: relative;
    width: 100%;
    height: 400px;
    transform-style: preserve-3d;
}

.envelope-wrapper {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 2;
    transition: opacity 0.8s ease;
}

.envelope {
    position: relative;
    width: 280px;
    height: 180px;
    background-color: #f8d775; /* Amarillo cerveza */
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.8s ease;
}

.envelope:hover {
    transform: translateY(-10px) rotateY(5deg);
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 90px; /* Half height */
    background-color: #e6c35a; /* Slightly darker yellow */
    border-radius: 10px 10px 0 0;
    transform-origin: bottom center;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transition: transform 0.7s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1;
}

.envelope-body {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f8d775;
    border-radius: 0 0 10px 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon {
    font-size: 3em;
    opacity: 0.8;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.envelope:hover .icon {
    transform: scale(1.1);
    opacity: 1;
}

/* Open state */
.envelope.open {
    transform: translateY(-50px) scale(0.8);
    opacity: 0;
}

.envelope.open .envelope-flap {
    transform: rotateX(180deg);
}

.letter {
    position: absolute;
    width: 100%;
    height: auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    padding: 30px;
    text-align: left;
    color: #333;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    z-index: 1;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M30,30L70,70M30,70L70,30" stroke="rgba(222, 184, 135, 0.1)" stroke-width="8"/></svg>');
    background-size: 20px 20px;
}

.letter.visible {
    opacity: 1;
    transform: translateY(0);
}

.letter-content h2 {
    font-family: 'Satisfy', cursive;
    color: #c45c26; /* Marrón cerveza */
    font-size: 2em;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.letter-content p {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 15px;
}

.letter-content .next-clue {
    font-weight: bold;
    color: #d35400; /* Naranja oscuro */
    margin-top: 20px;
    padding: 10px;
    border-left: 3px solid #f39c12;
    background-color: rgba(243, 156, 18, 0.1);
}

.letter-content .signature {
    font-family: 'Satisfy', cursive;
    font-size: 1.3em;
    color: #c45c26;
    text-align: right;
    margin-top: 25px;
}

/* Decoraciones temáticas */
.beer-bubbles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: float 4s infinite ease-in-out;
}

.bubble:nth-child(1) {
    width: 20px;
    height: 20px;
    left: 10%;
    top: 40%;
    animation-delay: 0s;
}

.bubble:nth-child(2) {
    width: 15px;
    height: 15px;
    left: 20%;
    top: 30%;
    animation-delay: 0.5s;
}

.bubble:nth-child(3) {
    width: 25px;
    height: 25px;
    left: 30%;
    top: 50%;
    animation-delay: 1s;
}

.bubble:nth-child(4) {
    width: 18px;
    height: 18px;
    left: 70%;
    top: 20%;
    animation-delay: 1.5s;
}

.bubble:nth-child(5) {
    width: 22px;
    height: 22px;
    left: 80%;
    top: 60%;
    animation-delay: 2s;
}

@keyframes float {
    0% {
        transform: translateY(0);
        opacity: 0;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100px);
        opacity: 0;
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .envelope {
        width: 240px;
        height: 150px;
    }
    
    .envelope-flap {
        height: 75px;
    }
    
    .letter-content h2 {
        font-size: 1.8em;
    }
    
    .letter-content p {
        font-size: 1em;
    }
    
    .letter-content .signature {
        font-size: 1.2em;
    }
}
