* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: #160f07;
    overflow: hidden;
}

.birthday-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    overflow: hidden;
    position: relative;
    isolation: isolate;

    background:
        radial-gradient(circle at 20% 20%, rgba(212, 170, 90, 0.18), transparent 32%),
        radial-gradient(circle at 80% 80%, rgba(160, 105, 45, 0.15), transparent 35%),
        radial-gradient(circle at center, #2a190d 0%, #160d07 55%, #0c0704 100%);
}

.birthday-page::before,
.birthday-page::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.35;
    z-index: -1;
}

.birthday-page::before {
    width: 320px;
    height: 320px;
    background: #c99745;
    top: -100px;
    left: -80px;
    animation: glowMoveOne 7s ease-in-out infinite alternate;
}

.birthday-page::after {
    width: 280px;
    height: 280px;
    background: #8f5c24;
    bottom: -100px;
    right: -60px;
    animation: glowMoveTwo 8s ease-in-out infinite alternate;
}

.card {
    width: min(420px, 90vw);
    perspective: 1200px;
    cursor: pointer;
    position: relative;
    z-index: 2;
    transition: transform 0.4s ease, filter 0.4s ease;
    animation: cardEntrance 1.2s ease 2.3s both;
}

.card-inner {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
    will-change: transform;
}

.card.is-flipped .card-inner {
    transform: rotateY(180deg);
}

.card.is-flipped {
    transform: translateY(-5px) scale(1.015);
}

@media (hover: hover) {
    .card:hover .card-inner {
        transform: rotateY(180deg);
    }
}
@media (hover: hover) {
    .card:hover {
        transform: translateY(-5px) scale(1.015);
        box-shadow: 0 20px 50px rgba(0,0,0,.35);
    }
}


.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    backface-visibility: hidden;
}

.card-front img,
.card-back img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
}

.card-back {
    transform: rotateY(180deg);
}

@keyframes glowMoveOne {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(70px, 50px);
    }
}

@keyframes glowMoveTwo {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(-60px, -40px);
    }
}

.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.particles span {
    position: absolute;
    width: 5px;
    height: 5px;
    background: #e5bb69;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(229, 187, 105, 0.8);
    opacity: 0;
    animation: particleFloat 7s linear infinite;
}

.particles span:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
}

.particles span:nth-child(2) {
    left: 20%;
    animation-delay: 2s;
}

.particles span:nth-child(3) {
    left: 30%;
    animation-delay: 4s;
}

.particles span:nth-child(4) {
    left: 42%;
    animation-delay: 1s;
}

.particles span:nth-child(5) {
    left: 55%;
    animation-delay: 3s;
}

.particles span:nth-child(6) {
    left: 65%;
    animation-delay: 5s;
}

.particles span:nth-child(7) {
    left: 75%;
    animation-delay: 1.5s;
}

.particles span:nth-child(8) {
    left: 85%;
    animation-delay: 3.5s;
}

.particles span:nth-child(9) {
    left: 92%;
    animation-delay: 5.5s;
}

.particles span:nth-child(10) {
    left: 48%;
    animation-delay: 6s;
}

@keyframes particleFloat {
    0% {
        bottom: -20px;
        transform: translateX(0) scale(0.6);
        opacity: 0;
    }

    15% {
        opacity: 0.8;
    }

    50% {
        transform: translateX(25px) scale(1);
    }

    85% {
        opacity: 0.5;
    }

    100% {
        bottom: 105%;
        transform: translateX(-20px) scale(0.4);
        opacity: 0;
    }
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.intro-message {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 10;
    color: #f3d796;
    animation: introMessage 3s ease forwards;
    pointer-events: none;
}

.intro-message h1 {
    font-size: clamp(22px, 4vw, 34px);
    font-weight: 400;
    margin-bottom: 14px;
    text-shadow: 0 0 18px rgba(229, 187, 105, 0.25);
}

.intro-message p {
    font-size: clamp(15px, 2.5vw, 20px);
    color: #caa765;
    letter-spacing: 1px;
}

@keyframes introMessage {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    20% {
        opacity: 1;
        transform: translateY(0);
    }

    70% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}

@media (max-width: 600px) {

    .card {
        perspective: 800px;
    }

}
.card {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.card:focus,
.card:focus-visible {
    outline: none;
}