body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #000033;
    margin: 0;
}

.container {
    text-align: center;
    background: pink;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 90%; /* Responzívna šírka */
    max-width: 450px; /* Max. šírka pre PC */
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    font-size: 1.1em;
    font-weight: bold;
}

#game-board {
    display: grid;
    /* Mriežka 4x4 s flexibilnou veľkosťou buniek */
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
    /* Zabezpečí štvorcovú mriežku */
    aspect-ratio: 1 / 1; 
    margin-bottom: 20px;
}

.card {
    position: relative;
    cursor: pointer;
    background-color: transparent;
    border-radius: 5px;
    perspective: 1000px; /* Pre 3D efekt otočenia */
}

/* Štýly pre prednú a zadnú stranu karty */
.card-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    border-radius: 5px;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; /* Skryje zadnú stranu pri otočení */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    border-radius: 5px;
}

/* Zadná strana - skrytá */
.card-back {
    background-color: #4CAF50; /* Zelená farba kariet */
    color: white;
    /* Pôvodný text: ? */
}

/* Predná strana - odkrytá (ikona) */
.card-front {
    background-color: #ffffff;
    color: #333;
    transform: rotateY(180deg);
}

/* Karta, ktorá bola nájdená (pár) */
.card.matched .card-back {
    background-color: transparent;
    color: transparent; 
}

#reset-button {
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

#reset-button:hover {
    background-color: #0056b3;
}