.game {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 1100px;
}

.gameTop {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'WDXL Lubrifont SC', Arial, Helvetica, sans-serif;
    font-size: 40px;
    border-bottom: 2px solid white;
}

.gameTop p {
    margin: 0;
}

.gameTopLeft {
    width: 40%;
    height: 100%;
    display: flex;
    justify-content: center;
    padding-left: 30px;
    align-items: left;
    flex-direction: column;
}

.gameTopRight {
    width: 60%;
    height: 100%;
    display: flex;
    justify-content: right;
    align-items: center;
}

.gameTopRightScore {
    width: 50%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.gameTopRightLevel {
    width: 50%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.gameCanvas {
    max-height: calc(100vh - 150px);
    width: 50%;
    border: 2px solid white;
    aspect-ratio: 11/16;
    display: flex;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    grid-template-rows: repeat(16, 1fr);
    grid-column-gap: 0px;
    grid-row-gap: 0px;
    background-color: rgb(0, 0, 0);
}


/* overlay styles */

.overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    height: 30vh;
    transform: translate(-50%, -50%);
    display: flex;
    background-color: black;
    border: 2px solid white;
    flex-direction: column;
}

.overlayButtons {
    width: 100%;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 50px;
}


.overlay button {
    width: 200px;
    height: 60px;
    background-color: rgb(0, 0, 0);
    color: white;
    border: 2px solid white;
    font-family: 'WDXL Lubrifont SC', Arial, Helvetica, sans-serif;
    font-size: 30px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    margin-left: 40px;
    margin-right: 40px;
}

.overlay button#selected {
    color: black;
    background-color: white;
}

#selected {
    color: black;
    background-color: white;
}

.overlay p {
    color: white;
    font-family: 'WDXL Lubrifont SC', Arial, Helvetica, sans-serif;
    font-size: 60px;
    text-align: center;
    margin: auto;
}

/* game pause */

.pauseOverlay {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70%;
    height: 40vh;
    transform: translate(-50%, -50%);
    display: flex;
    background-color: black;
    border: 2px solid white;
    flex-direction: column;
}

.pauseOverlayButtons {
    width: 100%;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 50px;
}

.pauseOverlay button {
    width: 200px;
    height: 60px;
    background-color: rgb(0, 0, 0);
    color: white;
    border: 2px solid white;
    font-family: 'WDXL Lubrifont SC', Arial, Helvetica, sans-serif;
    font-size: 30px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.pauseButtons {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 50px;
}

.pauseOverlay p {
    color: white;
    font-family: 'WDXL Lubrifont SC', Arial, Helvetica, sans-serif;
    font-size: 60px;
    text-align: center;
    margin: auto;
}

/* ukazka levelu */
.levelInfo {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40%;
    height: 25vh;
    padding: 20px;
    transform: translate(-50%, -50%);
    display: flex;
    background-color: rgb(0, 0, 0);
    border: 2px solid white;
    flex-direction: column;
    z-index: 1000;
}

.levelInfo p {
    margin: 0;
    color: white;
    font-family: 'WDXL Lubrifont SC', Arial, Helvetica, sans-serif;
    font-size: 40px;
    text-align: center;
    margin: auto;
}

/* hra */

.cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    background-color: #570c9e;
    user-select: none;
    position: relative;
}

.player-image {
    position: absolute;
    width: 40px;
    height: 40px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: transform 0.2s ease;
}

.cell.revealed {
    background-color: #000000;
}

.explosionInfo {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70%;
    height: 30vh;
    transform: translate(-50%, -50%);
    display: flex;
    background-color: rgb(0, 0, 0);
    flex-direction: column;
    z-index: 1000;
}

.explosionInfo p {
    margin: 0;
    color: white;
    font-family: 'WDXL Lubrifont SC', Arial, Helvetica, sans-serif;
    font-size: 40px;
    text-align: center;
    margin: auto;
}

@media screen and (max-width: 1200px) {
    .gameCanvas {
        max-height: calc(100vh - 150px);
    }
}

@media screen and (max-width: 820px) {
    .gameCanvas {
        width: auto;
        height: 60vh;
    }

    .player-image {
        width: 30px;
        height: 30px;
    }

    .overlay {
        width: 95%;
    }

    .levelInfo {
        width: 90%;
    }

}

@media screen and (max-width: 600px) {
    .gameCanvas {
        width: auto;
        height: 60%;
    }

    .gameTop p {
        font-size: 22px;
    }

    .player-image {
        width: 20px;
        height: 20px;
    }

    .gameTop {
        height: 80px;
        font-size: 25px;
    }
}

/* screenshake pri explozi */
@keyframes shake {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    10% {
        transform: translate(-5px, -5px) rotate(-1deg);
    }

    20% {
        transform: translate(5px, -5px) rotate(1deg);
    }

    30% {
        transform: translate(-5px, 5px) rotate(0deg);
    }

    40% {
        transform: translate(5px, 5px) rotate(1deg);
    }

    50% {
        transform: translate(-5px, -5px) rotate(-1deg);
    }

    60% {
        transform: translate(5px, -5px) rotate(1deg);
    }

    70% {
        transform: translate(-5px, 5px) rotate(0deg);
    }

    80% {
        transform: translate(5px, 5px) rotate(1deg);
    }

    90% {
        transform: translate(-5px, -5px) rotate(1deg);
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

.shake {
    animation: shake 0.6s ease-in-out;
    animation-iteration-count: 1;
}