
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html,
body {
    width: 100%;
    min-height: 100%;
}

body { 
    background-color: #e8ffe7;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
        
    padding-left: 50px;
    padding-right: 50px;
    position: relative;

}

/* MOBILE HEADER */
.mobile-header {
    width: 100%;
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    text-align: center;
    padding: 12px 10px;
    display: block;
}

.mobile-header h1 {
    font-size: clamp(1rem, 4vw, 1.4rem);
    color: #783d3d;
    /* Verde escuro para título */
    margin: 0;
}

.mobile-header p {
    font-size:clamp(0.75rem, 3vw, 0.95rem);
    color: #7FA653;
    /* Verde médio para texto */
    margin: 5px 0 0 0;
}

/* CONTENT */
.content {
    display: flex;
    width: 100%;
    height: 100%;
    justify-content: space-between;
    align-items: flex-end;
}

/* PRESENTE AREA */
.presente-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    flex: 1;
    gap: 20px;
}

/* PRESENTE */
.presente {
    width: 300px;
    height: 300px;
    position: relative;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    align-self: center;
}

.caixa {
    width: 180px;
    height: 120px;
    background: #7FA653;
    /* Verde médio para a caixa */
    display: flex;
    justify-content: center;
    border-radius: 0 0 10px 10px;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 8px rgba(99, 120, 61, 0.3);
}

.caixa:hover {
    transform: translateY(-5px);
    transition: transform 0.3s;
    box-shadow: 0 6px 12px rgba(99, 120, 61, 0.4);
}

.caixa>.fita {
    width: 60px;
    height: 100%;
}

.fita {
    background: #99CD85;
    /* Verde claro para as fitas */
}

.topo {
    width: 200px;
    height: 60px;
    background: #7FA653;
    /* Verde médio para o topo */
    border-radius: 10px;
    display: flex;
    justify-content: center;
    filter: drop-shadow(0 2px 3px rgba(99, 120, 61, 0.3));
    margin-top: -20px;
    z-index: 5;
}

.topo .fita {
    width: 80px;
    height: 100%;
}

.laco {
    display: flex;
    justify-content: center;
    position: absolute;
    top: -15px;
    width: 100%;
    z-index: 15;
}

.volta {
    border: 10px solid #63783D;
    /* Verde escuro para o laço */
    width: 80px;
    height: 40px;
    border-radius: 50% / 100% 50% 50% 0;
}

.volta.esq {
    transform: rotateY(180deg);
}

.container {
    transition: .3s ease;
    position: relative;
}

.caixa:hover+.container {
    transform: rotate(-15deg) translateY(-3rem);
}

/* ÁREA DAS CARTAS EMBAIXO DO PRESENTE */
.cartas-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
    max-width: 500px;
    justify-content: center;
    margin-top: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    pointer-events: none;
}

/* Classe que será adicionada via JavaScript quando o presente for clicado */
.cartas-container.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.paper {
    width: 80px;
    height: 100px;
    background: #CFE0BC;
    /* Verde claro de fundo para cartas */
    border: 2px solid #63783D;
    /* Borda verde escuro */
    border-radius: 5px;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 2px 5px rgba(99, 120, 61, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    transition: all 0.3s ease;
    opacity: 0.9;
    margin: 0 auto;
    color: #63783D;
    transform-origin: center;
}

.paper:hover {
    transform: translateY(-8px) scale(1.15);
    box-shadow: 0 5px 15px rgba(99, 120, 61, 0.3);
    opacity: 1;
    background: #99CD85;

}

.paper.clicked {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.5);
    width: 200px;
    height: 150px;
    font-size: 16px;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(99, 120, 61, 0.5);
    transition: all 0.5s ease;
    background: #CFE0BC;
}

/* Cartas expansíveis */
.paper {
    min-width: 80px;
    min-height: 100px;
    width: auto;
    height: auto;
    padding: 15px 10px;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    flex-direction: column;
}

/* Mostrar texto completo no hover */
.paper:hover::after {
    content: attr(data-content);
    position: absolute;
    background: #CFE0BC;
    border: 2px solid #63783D;
    border-radius: 5px;
    padding: 10px;
    width: 200px;
    max-height: 150px;
    overflow-y: auto;
    z-index: 100;
    top: -170px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 5px 15px rgba(99, 120, 61, 0.3);
    font-size: 14px;
    color: #63783D;
}

/* Balão de seta para o tooltip */
.paper:hover::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #63783D transparent transparent transparent;
}

/* CARTA */
.letter {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 90px;
    height: 3000px;
    background: #CFE0BC;
    /* Fundo verde claro */
    border: 3px solid #63783D;
    /* Borda verde escuro */
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(99, 120, 61, 0.3);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
    padding: 20px;
    overflow: hidden;
}

.letter.show {
    transform: translate(-50%, -50%) scale(1);
}

.letter::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(90deg, #99CD85, #7FA653, #63783D);
    /* Gradiente verde */
}

.letter .content {
    padding: 20px;
    text-align: center;
    overflow-y: auto;
    /* Adicione esta linha */
    max-height: calc(100% - 40px);
    /* E esta linha para limitar altura */
}

.letter .content h2 {
    margin: 0 0 15px 0;
    color: #63783D;
    font-size: 24px;
}

.letter .content p {
    margin: 0;
    color: #5a6c38;
    font-size: 16px;
    line-height: 1.5;
}

.decoration {
    font-size: 2rem;
    margin-top: 15px;
    animation: float 2s ease-in-out infinite;
    color: #7FA653;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-5px);
    }
}

.letter .close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #63783D;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.letter .close:hover {
    background: #7FA653;
    /* Verde médio no hover */
    transform: scale(1.1);
}

/* CONTROLES DE ÁUDIO */
.audio-controls {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.audio-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: 2px solid #63783D;
    color: #63783D;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(99, 120, 61, 0.2);
    transition: all 0.3s ease;
}

.audio-btn:hover {
    background: #63783D;
    color: white;
    transform: scale(1.1);
}

.audio-btn.muted {
    opacity: 0.5;
    transform: scale(0.9);
}

/* OVERLAY */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(99, 120, 61, 0.3);
    /* Overlay verde suave */
    z-index: 999;
}

.overlay.active {
    display: block;
}

/* RESPONSIVIDADE PARA MOBILE */
@media (max-width: 768px) {
    body {
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        padding: 10px;
    }

    .mobile-header {
        display: block;
        position: relative;
        top: 0;
        margin: 10px 0 20px 0;
    }

    .content {
        flex-direction: column;
        height: auto;
        padding: 0;
        gap: 30px;
    }

    .presente-area {
        order: 1;
        align-items: center;
        height: auto;
        margin-top: 20px;
        gap: 30px;
    }

    .presente {
        width: 200px;
        height: 200px;
    }

    .caixa {
        width: 120px;
        height: 80px;
    }

    .topo {
        width: 140px;
        height: 40px;
    }

    .cartas-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        max-width: 300px;
    }

    .paper {
        width: 60px;
        height: 80px;
        font-size: 18px;
    }
        .letter {
            width: 90%;
            height: 70vh;
            /* Alterar de 250px para 70vh */
            max-height: 900px;
            /* Adicionar altura máxima */
        }
    
        .letter .content {
            max-height: 900px;
            overflow-y: auto;
        }
        

    .letter .content h2 {
        font-size: 20px;
    }

    .letter .content p {
        font-size: 14px;
    }

    .audio-controls {
        bottom: 10px;
        left: 10px;
    }

    .audio-btn {
        width: 45px;
        height: 45px;
    }
}
@media (max-width: 1024px) {
    body {
        padding-left: 20px;
        padding-right: 20px;
    }

    .presente {
        width: 250px;
        height: 250px;
    }

    .caixa {
        width: 150px;
        height: 100px;
    }

    .topo {
        width: 170px;
        height: 50px;
    }

    .cartas-container {
        max-width: 400px;
    }

    .paper {
        width: 70px;
        height: 90px;
    }
}

@media (max-width: 768px) {
    .content {
        gap: 20px;
        padding-top: 40px;
    }

    .tartaruga-area {
        height: 250px;
        min-height: 250px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
        overflow: hidden;
    }

    .mobile-header {
        position: relative;
        margin: 5px 0 10px 0;
        padding: 10px;
    }

    .mobile-header h1 {
        font-size: 1.1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-header p {
        font-size: 0.75rem;
    }

    .content {
        flex-direction: column;
        height: auto;
        gap: 20px;
        padding-top: 0;
        justify-content: center;
        align-items: center;
        flex: 1;
    }

    .presente-area {
        order: 1;
        align-items: center;
        justify-content: center;
        height: auto;
        margin-top: 0;
        flex: 0 0 auto;
        gap: 20px;
    }

    .presente {
        width: 150px;
        height: 150px;
    }

    .caixa {
        width: 90px;
        height: 60px;
    }

    .topo {
        width: 110px;
        height: 30px;
        margin-top: -12px;
    }

    .volta {
        border-width: 6px;
        width: 50px;
        height: 25px;
    }

    .cartas-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        max-width: 250px;
    }

    .paper {
        width: 45px;
        height: 60px;
        font-size: 14px;
    }

    .tartaruga-area {
        order: 2;
        height: 180px;
        min-height: 180px;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: flex-end;
        flex: 0 0 auto;
        margin-bottom: 20px;
    }

    .letter {
        width: 95%;
        height: 220px;
        padding: 15px;
    }

    .letter .content {
        padding: 10px;
    }

    .letter .content h2 {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .letter .content p {
        font-size: 13px;
        line-height: 1.4;
    }

    .decoration {
        font-size: 1.5rem;
        margin-top: 10px;
    }

    .audio-controls {
        bottom: 5px;
        left: 5px;
    }

    .audio-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    .presente {
        width: 140px;
        height: 140px;
    }

    .caixa {
        width: 85px;
        height: 55px;
    }

    .topo {
        width: 100px;
        height: 28px;
    }

    .cartas-container {
        max-width: 220px;
        gap: 6px;
    }

    .paper {
        width: 40px;
        height: 55px;
        font-size: 12px;
    }

    .tartaruga-area {
        height: 160px;
        min-height: 160px;
    }

    .mobile-header h1 {
        font-size: 1rem;
    }

    .mobile-header p {
        font-size: 0.7rem;
    }
}
@media (max-width: 900px) {
    .content {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }

    .presente-area {
        width: 100%;
        align-items: center;
        justify-content: center;
    }
}

/* Garantir que as cartas estejam visíveis quando a classe show for adicionada */
.letter.show {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translate(-50%, -50%) scale(1) !important;
}

/* Overlay para quando carta estiver aberta */
.overlay.active {
    display: block;
    backdrop-filter: blur(3px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Ajustar z-index das cartas */
.letter {
    z-index: 1000;
}

.overlay {
    z-index: 999;
}