body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #000;
    color: #fff;
    font-family: Arial, sans-serif;
}

#tetris-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
}

#tetris-grid {
    display: grid;
    grid-template-columns: repeat(10, 30px);
    grid-template-rows: repeat(20, 30px);
    gap: 1px;
    background-color: #333;
}

.tetris-block {
    width: 30px;
    height: 30px;
    background-color: #fff;
}

#score-display {
    margin-top: 20px;
    font-size: 24px;
}

#game-over-message {
    margin-top: 20px;
    font-size: 24px;
    color: red;
}

@keyframes block-fall {
    0% {
        transform: translateY(-30px);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes line-clear {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.tetris-block {
    animation: block-fall 0.5s ease-in-out;
}

.line-clear {
    animation: line-clear 0.5s ease-in-out;
}

@media (max-width: 600px) {
    #tetris-grid {
        grid-template-columns: repeat(10, 20px);
        grid-template-rows: repeat(20, 20px);
    }

    .tetris-block {
        width: 20px;
        height: 20px;
    }

    #score-display, #game-over-message {
        font-size: 18px;
    }
}

#touch-controls {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

#touch-controls button {
    width: 50px;
    height: 50px;
    margin: 0 10px;
    font-size: 18px;
    background-color: #444;
    color: #fff;
    border: none;
    border-radius: 5px;
}

#touch-controls button:active {
    background-color: #666;
}

#speed-control {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

#speed-control label {
    font-size: 18px;
    margin-right: 10px;
}

#speed-control input {
    width: 200px;
}
