body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f0f0;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10+ */
    user-select: none; /* Standard syntax */
}

h1 {
    margin-bottom: 10px;
}

.game-container {
    display: flex;
    align-items: flex-start;
    border: 3px solid #333;
    background-color: #fff;
    padding: 10px;
}

#game-board {
    border: 2px solid #333;
    background-color: #000;
}

.side-panel {
    margin-left: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h2 {
    margin: 0 0 10px 0;
    font-size: 1.2em;
}

#next-tetromino {
    border: 2px solid #333;
    background-color: #000;
    margin-bottom: 20px;
}

#score {
    font-size: 1.5em;
    font-weight: bold;
    border: 2px solid #333;
    padding: 10px 20px;
    margin-bottom: 20px;
    min-width: 80px;
    text-align: center;
}

.buttons button {
    padding: 10px 20px;
    font-size: 1em;
    margin-bottom: 10px;
    cursor: pointer;
    border: 2px solid #333;
    background-color: #fff;
    font-weight: bold;
}

.buttons button:hover {
    background-color: #e0e0e0;
}

.touch-controls {
    display: none; /* Hidden by default */
}

/* --- Mobile Styles --- */
@media (max-width: 768px) {
    body {
        justify-content: flex-start;
        padding-top: 10px;
    }

    .game-container {
        flex-direction: column;
        align-items: center;
        border: none;
        padding: 0;
    }

    .side-panel {
        margin-left: 0;
        margin-top: 10px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    .side-panel h2, .side-panel #score {
        margin: 5px 10px;
    }

    .side-panel .buttons {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 10px;
    }

    .side-panel .buttons button {
        margin: 0 5px;
    }

    .touch-controls {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: #333;
        padding: 10px 0;
    }

    .touch-controls button {
        font-size: 1.8em;
        font-weight: bold;
        padding: 10px 20px;
        border-radius: 10px;
        background-color: #f0f0f0;
        border: 2px solid #ccc;
        flex-grow: 1;
        margin: 0 5px;
    }
}