.card-container {
    perspective: 1000px;
    width: 300px;
    height: 200px;
    margin: 20px;
    position: relative;
}

.card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
}

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

.card-side {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border: 5px solid #f3d189;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 30px;
    box-sizing: border-box;
    background: #fff6e3;
}

.card-front {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: flex-start;
    align-items: flex-start;
    cursor: pointer;
}

.card-back {
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: stretch;
    height: 100%;
}

.card img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.card textarea {
    width: 100%;
    height: 80px;
    resize: none;
    cursor: pointer;
}

@media (max-width: 400px) {
    .card-container {
        width: 90%;
        height: auto;
    }
    .card img {
        height: auto;
    }

    .card textarea {
        height: 60px;
    }
}

.card textarea, 
.card input,
.card label {
    cursor: text;
}

.card-back form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-back label {
    margin-bottom: 10px;
}

.card-back textarea {
    flex: 1;
    resize: none;
}

.non-flippable .card-back {
    transform: none;
    position: static;
    backface-visibility: visible;
}

.non-flippable .card-front {
    display: none;
}

.non-flippable .card-back form::before {
    content: attr(data-prompt);
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
    font-size: 1.1em;
}