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

body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card-container {
    perspective: 1500px;
}

.card {
    width: 400px;
    height: 300px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-8px) scale(1.03);
}

.front {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.card.open .cover {
    transform: perspective(1200px) rotateX(-160deg);
}

.cover {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    backface-visibility: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transform-origin: top center;
    transform-style: preserve-3d;
    transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 2;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 100% 72%, 50% 100%, 0 72%);
    transform: translateZ(1px);
}

.cover::after {
    content: "";
    position: absolute;
    bottom: 8px;
    left: 50%;
    width: 64px;
    height: 18px;
    background: rgba(255,255,255,0.2);
    transform: translateX(-50%) rotate(10deg);
    border-radius: 10px;
    filter: blur(0.5px);
    pointer-events: none;
}

.cover::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35%;
    background: rgba(255,255,255,0.08);
    transform: skewY(-4deg);
    pointer-events: none;
}

.cover h2 {
    color: white;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.inside {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    background: white;
    border-radius: 0 0 10px 10px;
    display: flex;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    z-index: 1;
    transform: translateY(18px) rotateX(6deg);
    opacity: 0;
    transition: transform 0.8s ease 0.15s, opacity 0.5s ease 0.15s;
}

.card.open .inside {
    transform: translateY(0) rotateX(0);
    opacity: 1;
}

.inside-left {
    width: 30%;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 10px 0 0 10px;
    display: flex;
    align-items: flex-start;
    padding: 20px 10px;
}

.inside-left h3 {
    color: white;
    font-size: 1rem;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.inside-right {
    width: 70%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-text {
    color: #333;
    font-size: 0.9rem;
    line-height: 1.5;
}

.card-title {
    color: #f5576c;
    font-size: 1.5rem;
    text-align: center;
    margin: 0;
}

.align-self-end {
    align-self: flex-end;
    font-style: italic;
}

.birthday-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
