* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 300;
    src: url('/fonts/Poppins-Light.woff2') format('woff2');
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    src: url('/fonts/Poppins-Regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    src: url('/fonts/Poppins-SemiBold.woff2') format('woff2');
}

img{
    user-select: none;
    -webkit-user-drag: none;
}

body {
    font-family: 'Poppins', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    background-color: #2a2d34;
    color: #e8e6e3;
}

/* Herní deska (grid layout) */
.game-board {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-gap: 10px;
    margin: 20px auto;
    margin-top: 125px;
    width: 90%;
    max-width: 1200px;
}

/* Responzivní přizpůsobení pro mobilní zařízení */

@media (max-width: 980px) {
    .game-board {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 768px) {
    .game-board {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Počítadlo tahů */
.moves-counter {
    margin: 10px 0;
    font-size: 19px;
}

@media (max-width: 330px) {
    .moves-counter {
        font-size: 18px;
    }
}

@media (max-width: 310px) {
    .moves-counter {
        font-size: 16px;
    }
}

/* Text pro hráče, který je na tahu */
.player-turn {
    font-size: 20px;
    text-align: center;
    font-weight: bold;
}

.remaining-pairs {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
    color: #e7350f;
}

.card {
    width: 100%;
    padding-top: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    outline: none;
}

.card.flipped {
    transform: rotateY(180deg);
}

/* Styl pro přední a zadní stranu karty */
.card .front,
.card .back {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    backface-visibility: hidden;
    border-radius: 8px;
    overflow: hidden;
}

.card .front {
    background: linear-gradient(135deg, rgba(42, 45, 52, 0.3), rgba(255, 255, 255, 0.1));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.25);
}

.card .back {
    background-color: #e8e6e3;
    transform: rotateY(180deg);
    font-size: 14px;
    font-weight: bold;
    color: #333;
    padding: 10px;
    box-sizing: border-box;
    text-align: center;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
    #e8e6e3-space: nowrap;
}

@media (max-width: 645px) {
    .card .back {
        padding: 5px !important;
    }

    .card .back p {
        font-size: 12px !important;
        padding: 0 !important;
        line-height: 1.5 !important;
    }
}

/* Styling pro text v kartě */
.card .back p {
    word-wrap: break-word;
    #e8e6e3-space: normal;
    overflow: hidden;
    text-align: center;
    padding: 5px;
    font-size: 14px;
    line-height: 1.5;
}

.card .back img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

/* Efekt pro shodné karty */
.matched {
    visibility: hidden;
    pointer-events: none;
}

.matched-flash {
    animation: flash 0.6s ease;
}

@keyframes flash {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Zpráva o stavu hry */
.message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.1);
    font-size: 24px;
    font-weight: bold;
    color: #4CAF50;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    text-align: center;
    max-width: 80%;
}

.message.visible {
    opacity: 1;
}

/* Restartovací tlačítko */
.restart-button {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 16px;
    background-color: #4ec10b;
    color: #000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.restart-button:hover {
    background-color: #45a049;
}
