:root {
  color-scheme: dark;
  --bg: #040612;
  --panel: rgba(10, 16, 40, .78);
  --line: rgba(112, 235, 255, .22);
  --cyan: #60f2ff;
  --magenta: #ff4fd8;
  --lime: #7dff8a;
  --text: #f2f6ff;
  --muted: #9ba8c7;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at 50% 15%, #101a49 0, #050819 34%, #02030a 100%); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { min-height: 100vh; overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .18; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 34px 34px; }
button, input, select { font: inherit; }
button { touch-action: manipulation; }
.app-shell { width: min(1500px, 100%); margin: auto; padding: 18px; }
.topbar, footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar { padding: 8px 8px 18px; }
h1 { margin: 0; letter-spacing: .08em; font-size: clamp(1.35rem, 3vw, 2.3rem); text-shadow: 0 0 24px rgba(96,242,255,.45); }
.eyebrow { margin: 0 0 5px; color: var(--cyan); font-size: .72rem; letter-spacing: .22em; font-weight: 800; }
.subtitle { margin: 4px 0 0; color: var(--muted); font-size: .82rem; letter-spacing: .12em; }
.icon-btn { width: 45px; height: 45px; border-radius: 50%; border: 1px solid var(--line); background: rgba(10,18,45,.85); color: white; cursor: pointer; }
.layout { display: grid; grid-template-columns: minmax(190px, 250px) minmax(280px, 600px) minmax(190px, 250px); gap: 18px; justify-content: center; align-items: start; }
.side-panel { display: grid; gap: 14px; }
.panel-card, .hud { border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(12px); box-shadow: 0 12px 35px rgba(0,0,0,.28); }
.panel-card { padding: 16px; border-radius: 16px; }
.panel-card h2 { font-size: .92rem; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 13px; color: #dbe7ff; }
.panel-card p { color: var(--muted); line-height: 1.55; font-size: .9rem; }
.field-label { display: block; margin: 11px 0 7px; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: #070d25; color: white; outline: none; }
input:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(96,242,255,.1); }
.small-note { margin-bottom: 0; font-size: .78rem !important; }
.controls-list { display: grid; gap: 10px; color: var(--muted); font-size: .83rem; }
kbd { display: inline-block; min-width: 27px; margin-right: 4px; padding: 4px 7px; border: 1px solid rgba(255,255,255,.16); border-bottom-width: 3px; border-radius: 6px; color: white; background: #10183a; text-align: center; font-size: .72rem; }
.game-column { min-width: 0; }
.hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 10px 13px; border-radius: 16px 16px 8px 8px; margin-bottom: 8px; }
.hud-player { min-width: 0; }
.hud-row { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: .72rem; letter-spacing: .07em; }
.bar { height: 10px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.09); }
.bar-fill { height: 100%; width: 100%; transition: width .18s ease; }
.enemy-fill { background: linear-gradient(90deg, #ff4f81, #ff9a54); }
.player-fill { background: linear-gradient(90deg, #58c7ff, #68ffd8); }
.round-box { text-align: center; min-width: 56px; }
.round-box span { display:block; color: var(--muted); font-size: .58rem; letter-spacing: .12em; }
.round-box strong { font-size: 1.15rem; }
.game-frame { position: relative; width: 100%; aspect-ratio: 9 / 16; overflow: hidden; border: 1px solid rgba(96,242,255,.35); border-radius: 10px 10px 22px 22px; box-shadow: 0 0 0 1px rgba(255,79,216,.08), 0 22px 70px rgba(0,0,0,.45), 0 0 50px rgba(65,135,255,.13); background: #030716; }
canvas { display: block; width: 100%; height: 100%; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 22px; background: rgba(2,5,18,.72); opacity: 0; visibility: hidden; transition: .25s ease; z-index: 10; }
.overlay.active { opacity: 1; visibility: visible; }
.overlay-card { width: min(390px, 100%); padding: 25px; border: 1px solid rgba(96,242,255,.3); border-radius: 20px; background: linear-gradient(145deg, rgba(12,21,53,.96), rgba(8,8,25,.96)); box-shadow: 0 25px 70px rgba(0,0,0,.55), inset 0 0 35px rgba(96,242,255,.04); }
.overlay-card.compact { text-align: center; }
.overlay-card h2 { margin: 4px 0 10px; font-size: 1.55rem; }
.overlay-card p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.primary-btn { width: 100%; margin-top: 18px; padding: 13px 16px; border: 0; border-radius: 12px; color: #031018; background: linear-gradient(90deg, var(--cyan), #a0ffce); font-weight: 900; letter-spacing: .08em; cursor: pointer; box-shadow: 0 0 24px rgba(96,242,255,.25); }
.primary-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.countdown { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; pointer-events: none; font-size: clamp(4rem, 15vw, 8rem); font-weight: 1000; color: white; text-shadow: 0 0 30px var(--cyan); }
.status-grid { display: grid; gap: 10px; margin: 0; }
.status-grid div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.06); padding-bottom: 8px; }
dt { color: var(--muted); } dd { margin: 0; font-weight: 700; }
.mobile-controls { display: none; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; margin-top: 12px; }
.mobile-controls button { user-select: none; -webkit-user-select: none; border: 1px solid var(--line); color: white; background: rgba(11,20,50,.95); min-height: 54px; border-radius: 14px; font-weight: 800; }
.move-pad { display: grid; grid-template-columns: 1fr 52px 1fr; gap: 6px; }
.vertical-pad { display: grid; gap: 6px; }
.vertical-pad button { min-height: 25px; }
.fire-btn { width: 74px; background: linear-gradient(145deg, #ff4f81, #ff6c43) !important; }
.shield-btn { width: 74px; color: var(--cyan) !important; }
footer { margin-top: 17px; padding: 12px 6px; color: #6f7d9e; font-size: .74rem; }
@media (max-width: 1050px) { .layout { grid-template-columns: minmax(280px, 590px); } .side-panel { display: none; } .mobile-controls { display: grid; } }
@media (max-width: 620px) { .app-shell { padding: 8px; } .topbar { padding: 6px 5px 10px; } .subtitle { font-size: .66rem; } .hud { gap: 7px; padding: 8px; } .hud-row { font-size: .61rem; } .game-frame { max-height: calc(100vh - 235px); margin-inline: auto; width: auto; max-width: 100%; } footer { display: none; } }
@media (max-height: 750px) and (orientation: landscape) { .game-frame { height: 72vh; width: auto; margin-inline: auto; } }
