/* 使用系统黑体字体 */

/* 全局样式重置和基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    font-family: 'SimHei', 'Microsoft YaHei', 'PingFang SC', 'Heiti SC', sans-serif;
    background: linear-gradient(135deg, #0f0f23, #1a1a3a);
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 主游戏容器 - 掌机造型 */
.game-container {
    width: 100%;
    max-width: 420px;
    height: 100vh;
    max-height: 740px;
    background: linear-gradient(145deg, #2a2a3a, #1a1a2a);
    border: 4px solid #333;
    border-radius: 20px;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    padding: 15px;
    position: relative;
}

/* 游戏标题头部 */
.game-header {
    text-align: center;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #444;
}

.game-header h1 {
    font-size: 20px;
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
    margin-bottom: 10px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #ffff00;
}

.hearts {
    display: inline-flex;
    gap: 4px;
}

.heart {
    color: #ff0000;
    text-shadow: 0 0 10px #ff0000;
    font-size: 16px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.heart.lost {
    color: #666;
    text-shadow: none;
    opacity: 0.3;
}

/* 游戏画布区域 */
.game-screen {
    flex: 1;
    position: relative;
    background: #000;
    border: 3px solid #444;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 0 20px rgba(0, 255, 255, 0.2);
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* 游戏覆盖层和屏幕 */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.screen {
    text-align: center;
    color: #ffffff;
    display: none;
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.screen.active {
    display: block;
}

.screen h2 {
    font-size: 18px;
    color: #00ffff;
    margin-bottom: 20px;
    text-shadow: 0 0 10px #00ffff;
}

.screen p {
    font-size: 12px;
    margin: 15px 0;
    line-height: 1.6;
}

/* 像素风格按钮 */
.pixel-btn {
    font-family: 'SimHei', 'Microsoft YaHei', 'PingFang SC', 'Heiti SC', sans-serif;
    font-size: 14px;
    padding: 15px 30px;
    background: linear-gradient(145deg, #444, #222);
    color: #00ffff;
    border: 3px solid #00ffff;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    margin: 8px;
    min-width: 120px;
}

.pixel-btn:hover {
    background: linear-gradient(145deg, #555, #333);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    transform: translateY(-1px);
}

.pixel-btn:active {
    transform: translateY(0);
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
}

/* 控制区域 */
.controls-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 2px solid #444;
    margin-bottom: 12px;
}

/* 触摸摇杆 */
.joystick-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 150px;
}

.joystick {
    position: relative;
    width: 120px;
    height: 120px;
    background: linear-gradient(145deg, #333, #111);
    border: 3px solid #555;
    border-radius: 50%;
    box-shadow: 
        inset 0 0 15px rgba(0, 0, 0, 0.5),
        0 0 10px rgba(0, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.joystick-handle {
    position: absolute;
    width: 45px;
    height: 45px;
    background: linear-gradient(145deg, #00ffff, #0088cc);
    border: 2px solid #00ccff;
    border-radius: 50%;
    box-shadow: 
        0 3px 8px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(0, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
}

.joystick-handle:active {
    background: linear-gradient(145deg, #00ccff, #006699);
    box-shadow: 
        inset 0 2px 5px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(0, 255, 255, 0.6);
    transform: scale(0.95);
}

/* 控制按钮样式 */
.control-btn {
    width: 45px;
    height: 45px;
    background: linear-gradient(145deg, #333, #111);
    border: 3px solid #555;
    border-radius: 10px;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    font-family: 'SimHei', 'Microsoft YaHei', 'PingFang SC', 'Heiti SC', sans-serif;
}

.control-btn:active {
    background: linear-gradient(145deg, #555, #333);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
    transform: translateY(1px);
    color: #00ffff;
    border-color: #00ffff;
}

/* 功能按钮区域 */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.action-btn {
    width: 80px;
    height: 45px;
    font-size: 14px;
    background: linear-gradient(145deg, #444, #222);
    border: 3px solid #666;
}

.action-btn.shoot {
    background: linear-gradient(145deg, #ff4444, #cc2222);
    border-color: #ff6666;
    color: #ffffff;
    height: 65px;
    width: 100px;
}

.action-btn.shoot:active {
    background: linear-gradient(145deg, #ff6666, #ff4444);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.action-btn.pause {
    background: linear-gradient(145deg, #ffaa00, #cc8800);
    border-color: #ffcc33;
    color: #000000;
    height: 45px;
    width: 45px;
    margin-top: 10px;
}

.action-btn.pause:active {
    background: linear-gradient(145deg, #ffcc33, #ffaa00);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* 游戏说明 */
.game-instructions {
    text-align: center;
    font-size: 10px;
    color: #aaa;
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 5px;
    border: 1px solid #333;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .game-container {
        border-radius: 0;
        height: 100vh;
        max-height: none;
        border: none;
        padding: 12px;
    }
    
    .game-header h1 {
        font-size: 18px;
    }
    
    .game-info {
        font-size: 12px;
    }
    
    .direction-pad {
        width: 130px;
        height: 130px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .direction-center {
        width: 35px;
        height: 35px;
    }
    
    .action-btn {
        width: 70px;
        height: 40px;
        font-size: 9px;
    }
    
    .game-instructions {
        font-size: 8px;
    }
    
    .pixel-btn {
        font-size: 12px;
        padding: 12px 25px;
        min-width: 100px;
    }
    
    .screen h2 {
        font-size: 16px;
    }
    
    .screen p {
        font-size: 10px;
    }
}

@media (max-height: 600px) {
    .game-container {
        padding: 8px;
    }
    
    .game-header {
        margin-bottom: 5px;
        padding: 8px;
    }
    
    .controls-container {
        padding: 12px;
        margin-bottom: 8px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .game-header h1 {
        font-size: 16px;
    }
    
    .game-info {
        font-size: 9px;
    }
    
    .joystick-container {
        width: 115px;
        height: 115px;
    }
    
    .joystick {
        width: 100px;
        height: 100px;
    }
    
    .joystick-handle {
        width: 35px;
        height: 35px;
    }
    
    .control-btn {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
    
    .action-btn {
        width: 65px;
        height: 36px;
        font-size: 8px;
    }
    
    .pixel-btn {
        font-size: 10px;
        padding: 10px 20px;
        min-width: 90px;
    }
    
    .controls-container {
        padding: 10px;
    }
}

/* 动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pixel-btn:hover {
    animation: pulse 1s infinite;
}

@keyframes glow {
    0% { box-shadow: 0 0 10px rgba(0, 255, 255, 0.3); }
    50% { box-shadow: 0 0 20px rgba(0, 255, 255, 0.6); }
    100% { box-shadow: 0 0 10px rgba(0, 255, 255, 0.3); }
}

.game-container {
    animation: glow 3s infinite;
} 