:root{
  --bg:#070A12;
  --panel:#0C1223;
  --panel2:#0A1020;
  --text:#E7EEFF;
  --muted:#94A3B8;
  --accent:#7C3AED;
  --accent2:#22C55E;
  --danger:#EF4444;
  --border:rgba(255,255,255,.08);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1200px 700px at 30% 20%, rgba(124,58,237,.18), transparent 60%),
              radial-gradient(900px 600px at 70% 10%, rgba(34,197,94,.14), transparent 55%),
              linear-gradient(180deg, #050713, var(--bg));
  color:var(--text);
}

#app{min-height:100%; display:flex; flex-direction:column}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 18px;
  border-bottom:1px solid var(--border);
  background: rgba(10,16,32,.6);
  backdrop-filter: blur(10px);
}
.brand{font-weight:800; letter-spacing:.5px; font-size:18px}
.meta{display:flex; gap:10px; align-items:center}
.pill{
  padding:8px 10px;
  background: rgba(255,255,255,.04);
  border:1px solid var(--border);
  border-radius:999px;
  font-size:13px;
  color:var(--muted);
}
.pill span{color:var(--text); font-weight:700}

.content{
  display:grid;
  grid-template-columns: 360px 1fr;
  gap:14px;
  padding:14px;
  flex:1;
}

body.shop-full .content{grid-template-columns: 1fr}
body.shop-full .gamepanel{display:none}

.panel{
  border:1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border-radius:14px;
  overflow:hidden;
}

#ui{padding:0}
#screen{padding:16px}

.gamepanel{position:relative; display:flex; align-items:center; justify-content:center}
canvas#game{width:100%; height:100%; display:block; background: #050814}

.hint{
  position:absolute;
  left:14px;
  top:12px;
  padding:8px 10px;
  border-radius:10px;
  background: rgba(0,0,0,.35);
  border:1px solid rgba(255,255,255,.10);
  color: rgba(231,238,255,.9);
  font-size:12px;
  max-width: calc(100% - 28px);
  pointer-events:none;
  display:none;
}

.footer{
  border-top:1px solid var(--border);
  background: rgba(10,16,32,.55);
  backdrop-filter: blur(10px);
  padding:12px 14px;
}
.controls{display:flex; gap:12px; flex-wrap:wrap}
.control{
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background: rgba(255,255,255,.03);
  min-width: 160px;
}
.label{font-weight:800; font-size:12px; color: rgba(231,238,255,.95); margin-bottom:6px}
.keys{font-size:12px; color: var(--muted); line-height:1.4}

h1,h2,h3{margin:0 0 10px 0}
h1{font-size:24px}
h2{font-size:18px}

.small{color:var(--muted); font-size:13px; line-height:1.4}

.grid{display:grid; gap:10px}
.grid.two{grid-template-columns: 1fr 1fr}

.btn{
  appearance:none;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700;
  text-align:left;
}
.btn:hover{border-color: rgba(124,58,237,.45); background: rgba(124,58,237,.12)}
.btn.primary{border-color: rgba(124,58,237,.55); background: rgba(124,58,237,.20)}
.btn.danger:hover{border-color: rgba(239,68,68,.55); background: rgba(239,68,68,.14)}
.btn:disabled{opacity:.55; cursor:not-allowed}

.row{display:flex; gap:10px; align-items:center; justify-content:space-between}
.badge{
  font-size:12px;
  padding:6px 8px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--muted);
}
.badge.ok{border-color: rgba(34,197,94,.45); background: rgba(34,197,94,.12); color: rgba(220,252,231,.95)}
.badge.locked{border-color: rgba(148,163,184,.30); background: rgba(148,163,184,.08)}

.card{
  border:1px solid var(--border);
  background: rgba(0,0,0,.22);
  border-radius:14px;
  padding:12px;
}
.card .title{font-weight:800; margin-bottom:6px}
.card .desc{color:var(--muted); font-size:12px; line-height:1.4; margin-bottom:10px}
.card .price{font-weight:800}

.card.outline-frost{border-color: rgba(37,99,235,.60); box-shadow: 0 0 0 1px rgba(37,99,235,.22) inset}
.card.outline-field{border-color: rgba(56,189,248,.55); box-shadow: 0 0 0 1px rgba(56,189,248,.20) inset}
.card.outline-flame{border-color: rgba(249,115,22,.55); box-shadow: 0 0 0 1px rgba(249,115,22,.20) inset}
.card.outline-light{border-color: rgba(250,204,21,.65); box-shadow: 0 0 0 1px rgba(250,204,21,.22) inset}
.card.outline-matter{border-color: rgba(168,85,247,.60); box-shadow: 0 0 0 1px rgba(168,85,247,.22) inset}
.card.outline-raygun{border-color: rgba(0,0,0,.85); box-shadow: 0 0 0 1px rgba(255,255,255,.25) inset}
.card.outline-shock{border-color: rgba(161,98,7,.70); box-shadow: 0 0 0 1px rgba(161,98,7,.22) inset}
.card.outline-stun{border-color: rgba(30,64,175,.65); box-shadow: 0 0 0 1px rgba(30,64,175,.22) inset}
 .card.outline-water{border-color: rgba(56,189,248,.65); box-shadow: 0 0 0 1px rgba(30,64,175,.20) inset}
 .card.outline-mshield{border-color: rgba(120,74,43,.70); box-shadow: 0 0 0 1px rgba(34,197,94,.14) inset}

hr.sep{border:none; border-top:1px solid var(--border); margin:12px 0}

@media (max-width: 980px){
  .content{grid-template-columns: 1fr}
}

/* Touch Controls Overlay */
.touch-controls{
  position:absolute;
  left:0;
  top:0;
  width:100%;
  height:100%;
  pointer-events:none;
  z-index:100;
  touch-action:none;
}
.touch-key{
  position:absolute;
  width:56px;
  height:56px;
  border-radius:12px;
  background: rgba(255,255,255,.12);
  border:2px solid rgba(255,255,255,.25);
  color: rgba(255,255,255,.85);
  font-family: 'Orbitron', ui-sans-serif, system-ui, sans-serif;
  font-weight:700;
  font-size:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events:auto;
  user-select:none;
  -webkit-user-select:none;
  touch-action:manipulation;
  backdrop-filter:blur(4px);
  transition:background .08s, border-color .08s, transform .05s;
  text-shadow:0 1px 2px rgba(0,0,0,.5);
}
.touch-key:active, .touch-key.pressed{
  background: rgba(124,58,237,.35);
  border-color: rgba(124,58,237,.65);
  transform:scale(0.95);
}
/* QWEASD Layout - positioned like a real keyboard (left side) */
.touch-q{left:16px; bottom:178px;}
.touch-w{left:78px; bottom:178px;}
.touch-e{left:140px; bottom:178px;}
.touch-a{left:16px; bottom:116px;}
.touch-s{left:78px; bottom:116px;}
.touch-d{left:140px; bottom:116px;}
/* Weapon keys - right side and bottom */
.touch-space{left:78px; bottom:54px; width:118px;}
.touch-f{right:16px; bottom:178px;}
.touch-t{right:16px; bottom:116px;}
.touch-c{right:78px; bottom:178px;}
.touch-h{right:78px; bottom:116px;}
.touch-m{right:140px; bottom:178px;}
.touch-g{right:140px; bottom:116px;}
.touch-y{right:202px; bottom:178px;}
.touch-u{right:202px; bottom:116px;}
/* Hidden by default until unlocked */
.touch-key[data-key="KeyF"]:not(.unlocked),
.touch-key[data-key="KeyT"]:not(.unlocked),
.touch-key[data-key="KeyC"]:not(.unlocked),
.touch-key[data-key="KeyH"]:not(.unlocked),
.touch-key[data-key="KeyM"]:not(.unlocked),
.touch-key[data-key="KeyG"]:not(.unlocked),
.touch-key[data-key="KeyY"]:not(.unlocked),
.touch-key[data-key="KeyU"]:not(.unlocked){display:none;}
/* Responsive adjustments for smaller screens */
@media (max-width: 640px){
  .touch-key{width:48px; height:48px; font-size:16px;}
  .touch-q{left:10px; bottom:156px;}
  .touch-w{left:66px; bottom:156px;}
  .touch-e{left:122px; bottom:156px;}
  .touch-a{left:10px; bottom:102px;}
  .touch-s{left:66px; bottom:102px;}
  .touch-d{left:122px; bottom:102px;}
  .touch-space{left:66px; bottom:48px; width:104px;}
  .touch-f{right:10px; bottom:156px;}
  .touch-t{right:10px; bottom:102px;}
  .touch-c{right:66px; bottom:156px;}
  .touch-h{right:66px; bottom:102px;}
  .touch-m{right:122px; bottom:156px;}
  .touch-g{right:122px; bottom:102px;}
  .touch-y{right:178px; bottom:156px;}
  .touch-u{right:178px; bottom:102px;}
}
