/* 机巧结界战记 V3.0 像素版 — 界面样式（移植自 1.4，主题色 #dac49f） */
body, html { margin: 0; padding: 0; width: 100%; height: 100%; background-color: #000; color: #dac49f; font-family: 'Courier New', Courier, monospace; overflow: hidden; touch-action: none; user-select: none; -webkit-touch-callout: none; }
#game-container { position: relative; width: 100vw; height: 100vh; display: flex; justify-content: center; align-items: center; background: #000; }

#gameCanvas { background: #08090a; image-rendering: pixelated; width: min(100vw, 177.78vh); height: min(56.25vw, 100vh); display: block; z-index: 1; box-shadow: 0 0 30px rgba(0,0,0,1); }

/* 标题界面（半透明左侧栏，露出后面的双机体演出） */
#title-screen { position: absolute; width: 100%; height: 100%; background: linear-gradient(90deg, rgba(10,10,12,0.95) 0%, rgba(20,18,15,0.8) 45%, transparent 100%); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding-left: 10%; box-sizing: border-box; z-index: 200; transition: opacity 1s; pointer-events: none; }
.title-main, .title-sub, .btn-title { pointer-events: auto; }
.title-main { font-size: 55px; font-weight: bold; letter-spacing: 8px; margin-bottom: 5px; text-shadow: 2px 2px 0px #000; color: #fff; }
.title-sub { font-size: 16px; letter-spacing: 4px; margin-bottom: 50px; border-bottom: 2px solid #54301a; padding-bottom: 10px; width: 60%; color: #aaa; }
.btn-title { background: rgba(0,0,0,0.5); border: 1px solid #dac49f; color: #dac49f; font-family: 'Courier New', Courier, monospace; font-size: 20px; font-weight: bold; padding: 12px 25px; margin-bottom: 15px; cursor: pointer; transition: 0.2s; text-align: left; width: 350px; letter-spacing: 2px; backdrop-filter: blur(2px); }
.btn-title:hover, .btn-title:active { background: #dac49f; color: #000; box-shadow: 0 0 15px rgba(218, 196, 159, 0.5); padding-left: 35px; }
.btn-title-hard { display: none; border-color: #ff33ff; color: #ff33ff; }
.btn-title-hard:hover, .btn-title-hard:active { background: #ff33ff; color: #000; box-shadow: 0 0 15px rgba(255, 51, 255, 0.5); }

/* 声音开关（全局左上角常驻） */
#btn-audio { position: absolute; top: 20px; left: 20px; z-index: 201; background: rgba(0,0,0,0.5); border: 1px solid #666; color: #666; font-family: 'Courier New', Courier, monospace; font-size: 14px; padding: 5px 10px; cursor: pointer; letter-spacing: 1px; }

/* 自检/报错条（默认隐藏，仅 ?debug=1 或报错时显示） */
#debug-bar { position: absolute; bottom: 0; left: 0; right: 0; z-index: 500; display: none; color: #0f0; background: rgba(0,0,0,0.7); font-size: 12px; padding: 2px 8px; pointer-events: none; white-space: nowrap; overflow: hidden; }

#ui-layer { display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }
#touch-ui { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; justify-content: space-between; align-items: flex-end; padding: 20px; box-sizing: border-box; }
.touch-zone { pointer-events: auto; }

/* 虚拟摇杆 */
#joystick-zone { position: relative; width: 150px; height: 150px; margin-bottom: 10px; margin-left: 20px; border-radius: 50%; }
#joystick-base { position: absolute; top: 25px; left: 25px; width: 100px; height: 100px; background: rgba(255,255,255,0.05); border: 2px solid rgba(0, 255, 255, 0.3); border-radius: 50%; box-sizing: border-box; box-shadow: inset 0 0 15px rgba(0,255,255,0.1); backdrop-filter: blur(2px); }
#joystick-stick { position: absolute; top: 25px; left: 25px; width: 50px; height: 50px; background: rgba(0, 255, 255, 0.5); border-radius: 50%; pointer-events: none; transition: 0.05s transform ease-out; box-shadow: 0 0 10px rgba(0,255,255,0.5); }

.action-pad { position: relative; width: 180px; height: 180px; margin-bottom: 10px; margin-right: 30px; }
.btn { background: rgba(200, 200, 200, 0.05); border: 2px solid rgba(255, 255, 255, 0.2); border-radius: 50%; color: rgba(255,255,255,0.6); font-weight: bold; display: flex; justify-content: center; align-items: center; backdrop-filter: blur(2px); transition: background 0.1s, transform 0.1s; text-align: center; line-height: 1.1; }
.btn:active, .btn.active-touch { background: rgba(200, 200, 200, 0.3); border-color: #fff; transform: scale(0.9); color: #fff; }
.btn-act { width: 56px; height: 56px; position: absolute; font-size: 11px; }
#btn-q { top: 0; left: 62px; border-color: rgba(255,0,255,0.4); display: none; }
#btn-e { top: 0; left: 124px; border-color: rgba(255,0,255,0.4); }
#btn-k { top: 62px; left: 0; border-color: rgba(100,255,255,0.4); }
#btn-j { top: 62px; left: 124px; border-color: rgba(255,100,100,0.4); }
#btn-space { top: 124px; left: 62px; }

/* 顶部信息 */
#top-ui { position: absolute; top: 15px; right: 20px; text-align: right; text-shadow: 1px 1px 2px #000; }
.theme-red { color: #ff4444; text-shadow: 0 0 5px red; } .theme-white { color: #ffffff; text-shadow: 0 0 5px cyan; }
#score-display { font-size: 20px; font-weight: bold; color: #ffd700; text-shadow: 0 0 5px #aa8800; margin-bottom: 5px; }
#stage-name { color: #aaa; font-size: 12px; margin-bottom: 5px; letter-spacing: 2px; }
#hard-mode-text { display: none; color: #ff00ff; font-weight: bold; font-size: 18px; margin-top: 5px; animation: pulse 1s infinite; letter-spacing: 2px; text-shadow: 0 0 10px #f0f; }

/* 结算/失败覆盖层 */
#overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.9); z-index: 100; display: none; flex-direction: column; justify-content: center; align-items: center; backdrop-filter: blur(5px); pointer-events: auto; }
#overlay-title { font-size: 45px; margin-bottom: 10px; text-align: center; text-shadow: 0 0 15px currentColor; letter-spacing: 4px; }
.btn-menu { padding: 12px 30px; font-size: 18px; font-weight: bold; font-family: 'Courier New', Courier, monospace; background: transparent; cursor: pointer; text-transform: uppercase; letter-spacing: 2px; margin: 10px; transition: 0.2s; color: #dac49f; border: 2px solid #dac49f; }
.btn-menu:active, .btn-menu:hover { background: #dac49f; color: #000; }

#controls-hint { position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%); font-size: 11px; color: rgba(255,255,255,0.3); text-align: center; letter-spacing: 1px; }

@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }
@media screen and (orientation: portrait) { #portrait-warning { position: absolute; top:0; left:0; width:100%; height:100%; background: #000; color: #fff; z-index: 999; display: flex; justify-content: center; align-items: center; font-size: 20px; text-align: center; padding: 20px; box-sizing: border-box; } }
@media screen and (orientation: landscape) { #portrait-warning { display: none; } }
