/* --- 全局与布局 --- */
body {
    margin: 0;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

#game-container {
    position: absolute;
    width: 1280px;
    height: 720px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transform-origin: top left;
}

#game-stage { position: absolute; width: 100%; height: 100%; }
canvas { position: absolute; top: 0; left: 0; }
.hidden { display: none !important; }

/* --- 覆盖层 (菜单, 大厅) --- */
.overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.75); display: flex; align-items: center; justify-content: center; text-align: center; z-index: 100; }
#start-screen { background: #111; z-index: 101; flex-direction: column; }
.start-content h1 { font-size: 80px; color: #ff4757; text-shadow: 0 0 20px red, 0 0 30px red; margin-bottom: 0; }
.start-content h2 { font-size: 30px; color: #feca57; letter-spacing: 5px; margin-top: 0; }
.start-btn { margin-top: 40px; background: none; border: 2px solid #ff4757; color: #ff4757; padding: 15px 30px; font-size: 24px; cursor: pointer; transition: all 0.3s ease; }
.start-btn:hover { background: #ff4757; color: white; box-shadow: 0 0 25px red; }
.panel { background: rgba(20, 20, 20, 0.9); padding: 30px 40px; border-radius: 10px; border: 1px solid #555; width: 500px; box-shadow: 0 5px 25px rgba(0,0,0,0.5); }
.panel h1 { margin-top: 0; }
.panel p { color: #aaa; margin: 20px 0 10px 0; line-height: 1.4; }
.btn-large { width: 100%; padding: 15px; font-size: 20px; background: #00d2d3; color: white; border: none; border-radius: 5px; cursor: pointer; margin: 10px 0; transition: background-color 0.2s; }
.btn-large:hover { background: #01a3a4; }
.btn-group { display: flex; justify-content: space-around; margin: 20px 0; }
.btn-group button { width: 45%; padding: 12px; font-size: 16px; background: #ff9f43; color: white; border: none; border-radius: 5px; cursor: pointer; transition: background-color 0.2s; }
.btn-group button:hover { background: #f0932b; }
.btn-small { width: 100%; padding: 10px; font-size: 16px; background: #576574; color: white; border: none; border-radius: 5px; cursor: pointer; margin-top: 15px; transition: background-color 0.2s; }
.btn-small:hover { background: #8395a7; }
input[type="text"] { width: calc(100% - 24px); padding: 12px; background: #333; border: 1px solid #666; border-radius: 5px; color: white; text-align: center; font-size: 16px; }
.log-text { color: #ccc; min-height: 40px; margin-top: 20px; font-style: italic; }
hr { border-color: #444; margin: 30px 0; }

/* --- 游戏内UI (HUD) --- */
#game-ui { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.hud { position: absolute; top: 20px; width: 40%; }
.hud.p1 { left: 30px; } .hud.p2 { right: 30px; text-align: right; }
.hp-bar-bg, .sp-bar-bg { background: rgba(50, 50, 50, 0.7); padding: 2px; border: 1px solid #555; margin-bottom: 5px; border-radius: 3px; }
.hp-bar { height: 25px; background: linear-gradient(90deg, #ff6b6b, #ee5253); width: 100%; transition: width 0.2s ease-out; border-radius: 2px; }
.sp-bar { height: 12px; background: linear-gradient(90deg, #54a0ff, #2e86de); width: 100%; transition: width 0.2s ease-out; border-radius: 2px; }
.mp-container { display: flex; gap: 4px; margin-top: 5px; }
.hud.p2 .mp-container { flex-direction: row-reverse; }
.mp-bar-bg { flex: 1; background: rgba(50, 50, 50, 0.7); padding: 1px; border: 1px solid #555; border-radius: 2px; }
.mp-bar { height: 8px; width: 0%; background: linear-gradient(90deg, #feca57, #ff9f43); transition: width 0.1s linear; border-radius: 1px; }
.hp-text { font-weight: bold; font-size: 18px; text-shadow: 1px 1px 3px black; }
.exit-btn { position: absolute; top: 15px; left: 50%; transform: translateX(-50%); padding: 5px 15px; background: rgba(0,0,0,0.5); border: 1px solid #888; border-radius: 5px; color: white; cursor: pointer; pointer-events: all; }
.skill-hud { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; background: rgba(0,0,0,0.4); padding: 8px; border-radius: 5px; }
.skill-icon { width: 55px; height: 55px; border: 2px solid #666; background: #222; color: #ccc; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: bold; text-align: center; position: relative; overflow: hidden; line-height: 1.2; border-radius: 4px; }
.cooldown { position: absolute; bottom: 0; left: 0; width: 100%; height: 0%; background: rgba(0, 150, 255, 0.6); transition: height 0.1s linear; }