/* Font setup */
@font-face {
    font-family: 'League Spartan';
    src: url('assets/fonts/LeagueSpartan-VariableFont_wght.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

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

body {
    font-family: 'League Spartan', Arial, 'Helvetica Neue', Helvetica, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f5f5f5;
}

.game-container {
    width: 80rem;
    height: 42rem;
    padding: 1rem;
    background-color: #fff;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
}

.game-title {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.game-instructions {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.memory-board {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 0.8rem;
    perspective: 1000px;
    padding: 1rem;
}

.card {
    width: 10rem;

    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
    aspect-ratio: 4/3; /* Landscape cards */
    user-select: none;
}

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

.card.matched {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.1);
}

.card-back {
    background-image: url('back.jpg');
    background-size: cover;
    background-position: center;
    border: 0.15rem solid #00699F;
}

.card-front {
    transform: rotateY(180deg);
    background-color: #fff;
    padding: 0.5rem;
    border: 0.15rem solid #F9B002;
}

.card-text {
    text-align: center;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
}

.card-image {
    max-width: 70%;
    max-height: 80%;
    object-fit: contain;
}

/* Text cards */
.card-text-only {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    padding: 0.8rem;
/*    background-color: #f8f8f8;*/
    font-size: 1.2rem;
    text-align: center;
}

/* Animation for matched cards */
@keyframes matched {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.card.matched .card-front {
    animation: matched 0.5s;
    border-color: #248174; /* Green color for matched cards */
} 