* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; overflow: hidden; background: #10141f; }
body { font-family: "Segoe UI", system-ui, sans-serif; color: #dfe8f5; }
#game-root { position: fixed; inset: 0; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }

#hud-top { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; pointer-events: none; }
.hud-stat, .hud-timer { background: rgba(16,22,36,.82); border: 1px solid #2e3a56; border-radius: 10px; padding: 6px 12px; display: flex; gap: 8px; align-items: baseline; }
.hud-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #7f92b3; }
.hud-stat b { color: #ffd980; font-size: 15px; }
.hud-timer b { color: #dfe8f5; font-size: 15px; }
#hud-banner { color: #ff8a95; font-weight: 700; text-shadow: 0 0 12px rgba(255,77,94,.6); }

#hud-cores { position: absolute; top: 56px; left: 8px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.corebar-row { display: flex; align-items: center; gap: 8px; }
.core-name { font-size: 11px; width: 74px; text-align: right; }
.core-name.you { color: #46e0c0; } .core-name.foe { color: #ff4d5e; }
.corebar { width: 150px; height: 10px; background: rgba(16,22,36,.82); border: 1px solid #2e3a56; border-radius: 5px; overflow: hidden; }
.corebar i { display: block; height: 100%; border-radius: 5px; }

#hud-msg { position: absolute; top: 110px; left: 0; right: 0; text-align: center; font-size: 15px; color: #ffd980; text-shadow: 0 1px 6px #000; pointer-events: none; }

#build-panel { position: absolute; right: 8px; top: 56px; display: flex; flex-direction: column; gap: 6px; width: 148px; }
#build-panel button { pointer-events: auto; cursor: pointer; padding: 9px 10px; border-radius: 10px; border: 1px solid #2e3a56; background: rgba(22,29,48,.9); color: #dfe8f5; font: 600 13px system-ui, sans-serif; text-align: left; }
#build-panel button em { color: #ffd980; font-style: normal; float: right; }
#build-panel button:hover { border-color: #46e0c0; }
#hud-queue { display: flex; gap: 4px; flex-wrap: wrap; }
.qchip { font-size: 10px; padding: 3px 6px; border-radius: 6px; }
.qg { background: rgba(70,224,192,.2); color: #46e0c0; } .qf { background: rgba(255,179,71,.2); color: #ffb347; }
.qempty { font-size: 10px; color: #57678a; }

#touch-nav { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 18px; align-items: flex-end; }
.dpad { display: grid; grid-template-columns: 46px 46px 46px; grid-template-rows: 46px 46px; gap: 4px; }
#btn-up { grid-column: 2; grid-row: 1; } #btn-left { grid-column: 1; grid-row: 2; }
#btn-right { grid-column: 2; grid-row: 2; } #btn-down { grid-column: 3; grid-row: 2; }
.dpad button, .zoombox button { pointer-events: auto; width: 46px; height: 46px; border-radius: 12px; border: 1px solid #2e3a56; background: rgba(22,29,48,.75); color: #9fb4d8; font-size: 18px; cursor: pointer; touch-action: none; }
.zoombox { display: flex; flex-direction: column; gap: 6px; }
@media (hover: hover) and (pointer: fine) { #touch-nav { opacity: .55; } }

#overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(10,13,22,.72); backdrop-filter: blur(3px); z-index: 10; }
#overlay.hidden { display: none; }
#overlay-card { max-width: 520px; margin: 16px; padding: 26px 30px; border-radius: 16px; background: rgba(20,27,45,.95); border: 1px solid #2e3a56; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
#o-title { color: #ffd980; font-size: 26px; margin-bottom: 12px; letter-spacing: .02em; }
#o-body { font-size: 14px; line-height: 1.55; color: #b9c8e2; margin-bottom: 18px; }
#o-body b { color: #dfe8f5; }
#o-btn { cursor: pointer; padding: 12px 26px; font-size: 16px; font-weight: 700; color: #10141f; background: linear-gradient(120deg, #46e0c0, #ffd980); border: 0; border-radius: 12px; }
