#gameBackgroundVideo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

#gameBackgroundVideo.show {
    opacity: 1;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.modal {
    background: linear-gradient(135deg, #666666, #EEEEEE);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.modal h3 {
    font-size: 36px;
    color: #EEEEEE;
    text-align: center;
    line-height: 1.2;
}

.modal-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.modal-button {
    width: 100%;
    height: 60px;
    border: none;
    border-radius: 10px;
    font-size: 24px;
    cursor: pointer;
}

.modal-button.confirm {
    background: linear-gradient(135deg, #2192f3, #2192f3, #78c5fd);
    color: #EEEEEE;
}

.modal-button.cancel {
    background: linear-gradient(135deg, #EEEEEE, #EEEEEE, #666666);
    color: #333333;
}

.back-button {
    width: 70px;
    height: 70px;
    cursor: pointer;
    background-color: transparent;
    transition: transform 0.2s ease;
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 999;
    display: none;
    border: none;
}

.back-button:hover{
    transform: translateX(-10px) rotate(-5deg);
}

.back-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.shuffle-button {
    width: 70px;
    height: 70px;
    cursor: pointer;
    background-color: transparent;
    transition: transform 0.3s ease;
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 999;
    display: none;
    border: none;
}

.shuffle-button:hover {
    transform: rotate(-180deg);
}

.shuffle-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.game-settings-button {
    width: 70px;
    height: 70px;
    cursor: pointer;
    background-color: transparent;
    transition: transform 0.5s ease;
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 899;
    display: none;
    border: none;
}

.game-settings-button:hover {
    transform: rotate(180deg);
}

.game-settings-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.game-panel {
    display: none;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100vh;
    padding: 20px 0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.game-panel.show {
    opacity: 1;
    transform: scale(1);
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    width: calc(100vh - 40px);
    height: calc(100vh - 40px);
    max-width: calc(100vw - 40px);
    max-height: calc(100vw - 40px);
    border: none;
    padding: 10px;
    background-image: url('/src/resources/panel.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 15px;
    position: relative;
}

@media screen and (max-width: 768px) {
    .panel-grid {
        gap: 10px;
        padding: 10px;
    }

    .back-button, .shuffle-button, .game-settings-button {
        width: 50px;
        height: 50px;
    }

    .back-button:hover, .shuffle-button:hover, .game-settings-button:hover {
        transform: none;
    }



    .shuffle-button:focus {
        transform: rotate(180deg);
    }

    .modal {
        padding: 20px;
        max-width: calc(100vw - 20px);
    }

    .modal h3 {
        font-size: 24px;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .modal-button {
        font-size: 18px;
    }

    #gameBackgroundVideo {
        object-position: left center;
    }
}