* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #B7F8DB 0%, #50A7C2 100%);
    font-family: 'Arial', sans-serif;
    padding: 20px;
}

.birthday-card {
    width: 350px;
    height: 450px;
    perspective: 1000px;
    position: relative;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-page {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.page-1 {
    background: linear-gradient(135deg, #37ecba 0%, #72afd3 100%);
    transform: rotateY(0deg);
}

.page-2 {
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
    transform: rotateY(90deg);
}

.page-3 {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb045 100%);
    transform: rotateY(180deg);
}

.page-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.page-content h1,
.page-content h2 {
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.page-content p {
    font-size: 20px;
    margin-bottom: 30px;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    line-height: 1.4;
}

.cake-icon,
.balloon-icon,
.gift-icon {
    font-size: 70px;
    animation: bounce 2s infinite;
}

.cake-icon {
    animation-delay: 0s;
}

.balloon-icon {
    animation-delay: 0.5s;
}

.gift-icon {
    animation-delay: 1s;
}

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

.card-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.nav-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.nav-btn:active {
    transform: scale(0.95);
}

/* Animazioni per il flip */
.flip-right {
    transform: rotateY(-90deg);
}

.flip-left {
    transform: rotateY(90deg);
}

/* Immagine inizialmente nascosta */
.gift-btn {
    width: 180px;
    height: 180px;

    display: flex;
    justify-content: center;
    align-items: center;

    font-size: 100px;

    border: none;
    background: transparent;
    cursor: pointer;

    transition: opacity .8s ease, transform .2s ease;
}

.gift-btn:hover {
    transform: scale(1.08);
}

.gift-btn:active {
    transform: scale(0.95);
}

.gift-image {
    position: absolute;
    max-width: 80%;
    opacity: 0;
    transition: opacity .8s ease;

    pointer-events: none;
}

/* Stati */
.gift-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

.gift-image.visible {
    opacity: 1;
}