/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f2f5;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.container {
    max-width: 800px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.game-title {
    color: #4caf50;
    margin-bottom: 20px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    font-weight: bold;
}

/* 游戏信息栏 */
.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px;
    border-radius: 10px;
    color: white;
    flex-wrap: wrap;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.info-item {
    display: flex;
    flex-direction: column;
    margin: 0 10px;
}

.info-label {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 5px;
    font-weight: normal;
}

.info-value {
    font-size: 1.8em;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 游戏容器 */
.game-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    background: rgba(238, 242, 247, 0.8);
    border-radius: 10px;
    padding: 15px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

#gameCanvas {
    border: 3px solid #4caf50;
    border-radius: 10px;
    background: linear-gradient(to bottom, #2c3e50 0%, #34495e 100%);
    cursor: pointer;
    display: block;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* 控制区域 */
.control-section {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* 控制按钮 */
.control-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #f44336, #da190b);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4);
}

.btn:active {
    transform: translateY(-1px);
}

/* 方向控制按钮 */
.direction-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.control-row {
    display: flex;
    gap: 8px;
}

.dir-btn {
    width: 60px;
    height: 60px;
    font-size: 20px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.dir-btn:hover {
    background: linear-gradient(135deg, #1976d2, #1565c0);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.dir-btn:active {
    transform: scale(0.95);
}

/* 游戏说明 */
.game-instructions {
    text-align: left;
    background: rgba(248, 249, 250, 0.8);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.game-instructions h3 {
    color: #4caf50;
    margin-bottom: 15px;
    font-size: 1.3em;
    text-align: center;
}

.game-instructions ul {
    list-style-type: none;
    padding-left: 0;
}

.game-instructions li {
    margin-bottom: 12px;
    padding-left: 30px;
    position: relative;
    line-height: 1.6;
    font-size: 1em;
    color: #555;
}

.game-instructions li:before {
    content: "▶";
    color: #4caf50;
    font-weight: bold;
    position: absolute;
    left: 0;
    font-size: 1.2em;
    line-height: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .game-title {
        font-size: 2em;
    }
    
    #gameCanvas {
        width: 100%;
        height: auto;
        max-width: 400px;
    }
    
    .control-section {
        flex-direction: column;
        gap: 20px;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .info-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .game-title {
        font-size: 1.8em;
    }
    
    .btn {
        padding: 10px 18px;
        font-size: 14px;
        min-width: 100px;
    }
    
    .dir-btn {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
    
    .game-instructions {
        padding: 15px;
    }
    
    .game-instructions li {
        padding-left: 25px;
        font-size: 0.9em;
    }
}