@font-face {
	font-family: PressStart2P;
	src: url(./fonts/Press_Start_2P/PressStart2P-Regular.ttf)
}
@font-face {
	font-family: Assistant;
	src: url(./fonts/assistant/Assistant-VariableFont_wght.ttf)
}

/* --- Typography and General Layout --- */

.titleGame {
    margin-top: 1rem;
    font-family: PressStart2P;
}

.titleGame,
.createdBy {
    color: var(--color-primary); /* Assuming a primary color variable is defined elsewhere */
    display: flex;
    justify-content: center;
}

.createdBy small {
    font-family: Assistant;
    font-weight: 300;
}

/* --- GAME BOARD STYLES (Used for Desktop/Large Screens) --- */
.memory-game {
    height: 640px;
    width: 640px;

    margin: 1rem auto;
    /* Changed display from 'none' to 'flex'. The visibility logic (showing/hiding) is now fully handled by responsivity.css */
    display: flex; 
    flex-wrap: wrap;
    perspective: 1000px; /* User's perspective on the z-axis. Higher value = stronger perspective effect */
}

.card {
    /* Calculates card size for a 4x3 grid (12 cards) with 5px margin on all sides */
    height: calc( 33.333% - 10px);
    width: calc(25% - 10px); 
    margin: 5px;
    position: relative;
    cursor: pointer;
    transform: scale(1);
    transform-style: preserve-3d; /* Adds 3D perspective so the element isn't flattened on the plane */
    transition: transform .9s;    /* Adds a motion effect to the card flip */
    
    /* 🔥 Touchscreen Optimization: Removes the default tap-highlight in Webkit browsers (iOS/Chrome) */
    -webkit-tap-highlight-color: transparent;
}

/* Optimized for Touchscreens/Mobile Tap Feedback */
.card:active {
    transform: scale(0.97);
    transition: transform .2s;
}

.card-front,
.card-back {
    width: 100%;
    height: 100%;
    padding: 10px;
    position: absolute;
    border-radius: 7px;
    background: #f8d86e;
    /* Hides the back side of the element when facing away from the viewer */
    backface-visibility: hidden; 
}

.card-front {
    /* Rotates the front side so it starts face-down (hidden) */
    transform: rotateY(180deg);  
}

/* flip card animation class (controlled by JavaScript) */
.card.flip {
    transform: rotateY(180deg);
}

/* --- MOBILE/UNSUPPORTED MESSAGE STYLES --- */

.not-supported {
    width: 90%;
    padding: 50px 20px 0;
    margin: 0 auto;

    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center; /* Center text within the message box */
}

.title_NS {
    margin-bottom: 2rem;
}

.description_NS {
    margin-bottom: 1rem;
}

p.description_NS a img {
    display: flex;
    margin: 0 auto 2rem;
}
