:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --text-color: #2d3436;
    --bg-color: #f7f1e3;
    --card-bg: #ffffff;
}

body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-color);
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
    /* Prevent scrolling when card flips */
}

.scene {
    width: 90vw;
    max-width: 400px;
    /* iPhone width approx */
    height: 80vh;
    /* Good aspect ratio for a card */
    max-height: 600px;
    perspective: 1000px;
}

.card {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 1s;
    transform-style: preserve-3d;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
}

.card.is-flipped {
    transform: rotateY(-180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    background: var(--card-bg);
    overflow: hidden;
}

/* Front of Card */
.card-front {
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    z-index: 2;
}

.pattern-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/tennis_pattern.png');
    background-size: 150px;
    opacity: 0.15;
    z-index: -1;
}

.card-front h1 {
    font-family: 'Dancing Script', cursive;
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.card-front .hook {
    font-size: 1.2rem;
    color: var(--text-color);
    margin: 20px;
}

.card-front .tap-hint {
    margin-top: auto;
    font-size: 0.9rem;
    color: #888;
    animation: bounce 2s infinite;
}

/* Inside of Card (Back Face) */
.card-inner {
    transform: rotateY(180deg);
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Align content to top */
    padding-top: 40px;
}

.card-inner h2 {
    font-family: 'Dancing Script', cursive;
    font-size: 2rem;
    color: var(--secondary-color);
    margin: 0;
}

.subtitle {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    margin-bottom: 20px;
}

.grid-images {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    /* Allow wrapping */
    gap: 15px;
    margin: 10px 0;
}

.img-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.img-container img {
    width: 50px;
    /* Slightly smaller to fit more */
    height: 50px;
    object-fit: contain;
    transition: transform 0.2s;
}

.img-container img:hover {
    transform: scale(1.1);
}

.emoji-placeholder {
    font-size: 3rem;
    display: block;
}

.family-message {
    margin-top: 10px;
    background: #fff0f0;
    padding: 10px;
    border-radius: 10px;
    width: 100%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.family-img {
    width: 100%;
    max-height: 120px;
    object-fit: contain;
    /* Don't crop the family */
    border-radius: 8px;
    margin-bottom: 5px;
}

.message {
    font-size: 1rem;
    color: #333;
    line-height: 1.4;
    margin-bottom: 10px;
}

.sign-off {
    font-family: 'Dancing Script', cursive;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 10px;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

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