* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

body {
    font-family: Arial, Tahoma, sans-serif;
    height: 100vh;
}

.no-clicking {
    pointer-events: none;
}


.button {
    background-color: #F44336;
    color: #FFF;
    padding: 15px 25px;
    font-size: 30px;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
}

.control-buttons ,
.game-over-panel {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
}

.game-over-panel {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    p {
        font-size: 24px;
        color: #333;
        margin: 15px 0;
        font-weight: 600;
        letter-spacing: 0.5px;
        text-transform: uppercase;
    }

    p:first-of-type {
        font-size: 32px;
        color: #F44336;
        margin-bottom: 20px;
        font-weight: 700;
    }

    p:last-of-type {
        font-size: 28px;
        background-color: rgba(0, 0, 0, 0.1);
        padding: 15px 30px;
        border-radius: 8px;
        margin-top: 20px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    p span {
        font-weight: 700;
        color: #F44336;
        display: inline-block;
        min-width: 100px;
    }
}

.control-buttons {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    background-color: rgba(3, 169, 244, 0.9);
    .game-options {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 300px;
        #opponent-type {
            padding: 15px;
            font-size: 20px;
            border-radius: 8px;
            border: none;
            outline: none;
        }
    }
    
    h1 {
        position: absolute;
        top: 30%;
        left: 50%;
        font-size: 48px;
        font-weight: 700;
        color: #fff;
        text-align: center;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
        letter-spacing: 2px;
        line-height: 1.4;
        animation: slideDown 0.8s ease-out;
        -webkit-animation: slideDown 0.8s ease-out;
        transform: translate(-50%, -50%);
        -webkit-transform: translate(-50%, -50%);
        -moz-transform: translate(-50%, -50%);
        -ms-transform: translate(-50%, -50%);
        -o-transform: translate(-50%, -50%);
    }
}

/* Add animation effect */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -100%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.score {
    position: fixed;
    top: 20px;
    font-size: 24px;
    color: #FFF;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 6px;
    z-index: 2;
    &.player1-score {
        left: 20px;
        color: #2196f3;
    }

    &.player2-score {
        right: 20px;
        color: #F44336;
    }
}

.memory-game-blocks {
    display: grid;
    height: calc(85% - 40px);
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 20px;
    width: 75%;
    margin: 20px auto 0;
    justify-content: space-between;
    .game-block {
        transition: transform .5s;
        -webkit-transition: transform .5s;
        -moz-transition: transform .5s;
        -ms-transition: transform .5s;
        -o-transition: transform .5s;
        transform-style: preserve-3d;
        cursor: pointer;
        position: relative;
        .face {
            position: absolute;
            text-align: center;
            width: 100%;
            height: 100%;
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
            -moz-backface-visibility: hidden;
            -ms-backface-visibility: hidden;
            -o-backface-visibility: hidden;
        }
        .front {
            background-color: #333;
            &:before {
                content: '!';
                color: #FFF;
                font-size: clamp(30px, 10vw, 80px);
                font-weight: bold;
            }
        }
        .back {
            background-color: #607D8B;
            transform: rotateY(180deg);
            -webkit-transform: rotateY(180deg);
            -moz-transform: rotateY(180deg);
            -ms-transform: rotateY(180deg);
            -o-transform: rotateY(180deg);
            img {
                width: 70%;
                height: 70%;
            }
        }
        .front ,
        .back {
            display: flex;
            justify-content: center;
            align-items: center;
        }
        &.is-flipped,
        &.is-matched {
            -webkit-transform: rotateY(180deg);
            -moz-transform: rotateY(180deg);
            transform: rotateY(180deg);
            pointer-events: none;
        }
    }
}

/* Responsive */
@media (max-width: 800px) {
    .control-buttons h1 {
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .info-container {
        font-size: 18px;
    }

    .memory-game-blocks {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(5, 1fr);
    }
}

@media (max-width: 692px) {
    .memory-game-blocks {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        margin: 20px 10px 0;
        width: calc(100% - 20px);
    }

    .player1-score {
        font-size: 20px;
        top:5px;
    }
    
    .player2-score {
        font-size: 20px;
        top: unset;
        bottom: 5px;
    }
}

@media (max-width: 480px) {
    .info-container {
        font-size: 16px;
    }

    .memory-game-blocks {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(7, 1fr);
    }

    .button {
        font-size: 24px;
        padding: 10px 20px;
    }
    
}


