.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    display: none; /* 默认隐藏 */
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.game-over h2 {
    color: #333;
    margin-bottom: 10px;
}

.game-over p {
    color: #666;
    margin-bottom: 20px;
}

.game-over button {
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.game-over button:hover {
    background-color: #45a049;
}

.game-container {
    position: relative;
    width: 400px;
    margin: 0 auto;
}

.touch-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 10px;
    margin-top: 20px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.direction-btn {
    width: 100%;
    height: 80px;
    font-size: 24px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.direction-btn:hover, .direction-btn:active {
    background-color: #45a049;
    transform: scale(0.98);
}

.horizontal-controls {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
}

/* 定位方向按钮 */
[data-direction="up"] {
    grid-column: 2;
    grid-row: 1;
}

.horizontal-controls {
    grid-column: 1 / -1;
    grid-row: 2;
}

[data-direction="down"] {
    grid-column: 2;
    grid-row: 3;
}

/* 响应式调整 */
@media (max-width: 400px) {
    .game-container {
        width: 100%;
        padding: 0 10px;
    }
    
    #gameCanvas {
        width: 100%;
        height: auto;
    }
    
    .direction-btn {
        height: 70px;
    }
}