/* Prevent page scrolling on mobile */
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

html, body {
    height: 100%;
    width: 100%;
}

.game-container {
    display: flex;
    gap: 20px;
}

#game-board {
    width: 300px;
    height: 600px;
    background-color: #27262b;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(20, 1fr);
    border: 1px solid #424049;
}

.cell {
    border: 1px solid #424049;
}

.filled {
    border: 1px solid #424049;
}

.info {
    color: #ffffff;
}

.controls {
    margin-top: 20px;
}

.game-button-newgame {
    padding: 8px 20px; 
    margin: 4px; 
    background-color: #3d9740; 
    color: white; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer;
}

.game-button-restart {
    padding: 8px 20px; 
    margin: 4px; 
    background-color: rgb(175, 76, 76); 
    color: white; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer;
}

#next-piece-board {
    width: 120px;
    height: 120px;
    background-color: #27262b;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    border: 1px solid #424049;
}

.next-cell {
    border: 1px solid #424049;
}

#game-over {
    position: absolute;
    top: 55%;
    left: 20%;
    transform: translate(-25%, -25%);
    z-index: 100;
}

.game-over-text {
    color: #ffffff;
    font-size: 24px;
    font-weight: 300;
    text-align: center;
}

.game-over-hidden {
    display: none;
}

.game-over-visible {
    display: block;
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    margin-top: 20px;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.mobile-row {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.mobile-btn {
    width: 60px;
    height: 60px;
    background-color: #3d3b45;
    color: white;
    border: 2px solid #424049;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.mobile-btn:active {
    background-color: #5a5766;
    transform: scale(0.95);
}

.hard-drop {
    width: 120px;
    border-radius: 30px;
    font-size: 16px;
}

@media (max-width: 768px) {
    .mobile-controls {
        display: flex;
    }
    /* .game-container {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    } */
    
    #game-board {
        width: 300px;
        height: 600px;
    }

    .controls {
        display: flex;
        flex-direction: column;
    }
    
    /* .info {
        text-align: center;
    } */
    
    #game-over {
        top: 55%;
        left: 30%;
        transform: translate(-60%, -50%);
    } 
}

@media (max-width: 480px) {
    #game-board {
        width: 300px;
        height: 400px;
    }

    .controls {
        display: flex;
        flex-direction: column;
    }

    #game-over {
        top: 55%;
        left: 35%;
        transform: translate(-50%, -50%);
    } 
    
    .mobile-btn {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
    
    .hard-drop {
        width: 100px;
        font-size: 14px;
    }
}