* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #000;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 10px;
}

.game-container {
    text-align: center;
    background-color: #111;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.5);
    width: 100%;
    max-width: 840px;
}

h1 {
    color: #ffcc00;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.8);
    font-size: 2em;
}

.canvas-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    overflow: hidden;
    border-radius: 5px;
}

#gameCanvas {
    border: 2px solid #ffcc00;
    background-color: #000;
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.6);
    max-width: 100%;
    height: auto;
}

.game-info {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    font-size: 18px;
    flex-wrap: wrap;
    gap: 20px;
}

.score, .lives {
    background-color: #222;
    padding: 10px 20px;
    border-radius: 5px;
    border: 1px solid #ffcc00;
}

#score, #lives {
    color: #ffcc00;
    font-weight: bold;
}

.controls {
    margin-top: 20px;
    font-size: 14px;
    color: #ccc;
}

.controls h3 {
    color: #ffcc00;
    margin-bottom: 10px;
}

.back-btn {
    background-color: #ffcc00;
    color: #000;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background-color: #fff;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.8);
}

/* 虚拟方向键样式 */
.virtual-controls {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.d-pad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.d-pad-row {
    display: flex;
    gap: 5px;
}

.d-pad-btn {
    width: 60px;
    height: 60px;
    background-color: #222;
    color: #ffcc00;
    border: 2px solid #ffcc00;
    border-radius: 10px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.1s ease;
    outline: none;
}

.d-pad-btn:active {
    background-color: #ffcc00;
    color: #000;
    transform: scale(0.95);
}

/* 响应式设计 */
@media (max-width: 900px) {
    .game-container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8em;
        margin-bottom: 15px;
    }
    
    #gameCanvas {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 768px) {
    .d-pad-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .game-info {
        font-size: 16px;
        gap: 15px;
    }
    
    .score, .lives {
        padding: 8px 15px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5em;
    }
    
    .d-pad-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .game-info {
        flex-direction: column;
        align-items: center;
    }
}