:root{
  --bg:#05060a;
  --fg:#e8e8e8;
  --accent:#52e04a;
  --bezel1:#1a1c24;
  --bezel2:#0b0c11;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--bg);color:var(--fg);overflow:hidden;
  font-family:'Press Start 2P',ui-monospace,monospace;touch-action:none;
  -webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}
body{background:radial-gradient(ellipse at 50% 40%,#12162a 0%,#05060a 70%) fixed}

#app{position:fixed;left:0;right:0;top:36px;bottom:0;display:flex;align-items:center;justify-content:center}
body.touch.portrait #app{bottom:var(--ctrl-h,200px)}

#cabinet{position:relative;padding:12px;border-radius:22px;
  background:linear-gradient(160deg,var(--bezel1),var(--bezel2));
  box-shadow:0 0 0 2px #000,0 0 0 4px #23262f,0 20px 60px rgba(0,0,0,.8),0 0 80px rgba(82,224,74,.12)}
#screen{display:block;border-radius:14px;background:#000;image-rendering:auto}
#glass{position:absolute;inset:12px;border-radius:14px;pointer-events:none;
  background:linear-gradient(135deg,rgba(255,255,255,.07) 0%,rgba(255,255,255,0) 35%,rgba(255,255,255,0) 70%,rgba(255,255,255,.03) 100%);
  box-shadow:inset 0 0 30px rgba(0,0,0,.9),inset 0 0 4px rgba(0,0,0,1)}

#toolbar{position:fixed;top:6px;right:8px;display:flex;gap:6px;z-index:5}
#toolbar button{font:inherit;font-size:9px;color:#9aa;background:#11131a;border:1px solid #2a2e3a;
  border-radius:6px;padding:6px 8px;cursor:pointer;letter-spacing:1px}
#toolbar button:hover{color:#fff;border-color:var(--accent)}
#toolbar button.off{color:#555;text-decoration:line-through}

#touch{display:none}
body.touch #touch{display:flex;position:fixed;left:0;right:0;bottom:0;justify-content:space-between;
  align-items:center;padding:12px 18px calc(12px + env(safe-area-inset-bottom));pointer-events:none;z-index:4}
body.touch.portrait #touch{height:var(--ctrl-h,200px)}
#touch button{pointer-events:auto;font:inherit;color:#dfe;border:2px solid rgba(255,255,255,.18);
  background:rgba(30,34,48,.75);touch-action:none}
#touch button:active,#touch button.down-state{background:rgba(82,224,74,.45);border-color:var(--accent)}
.dpad{position:relative;width:168px;height:168px}
.dpad button{position:absolute;width:58px;height:58px;border-radius:14px;font-size:20px}
.dpad .up{left:55px;top:0}.dpad .down{left:55px;bottom:0}
.dpad .left{left:0;top:55px}.dpad .right{right:0;top:55px}
.side{display:flex;flex-direction:column;gap:14px}
.side button{border-radius:30px;padding:14px 18px;font-size:11px}
body.touch.landscape .dpad{transform:scale(.85);transform-origin:left bottom}

.dpad.lr{width:150px;height:70px}
.dpad.lr .left{left:0;top:6px}.dpad.lr .right{left:82px;top:6px}
.firebtn{width:96px;height:96px;border-radius:50% !important;font-size:14px !important;background:rgba(255,60,80,.55) !important}
body.touch #touch{align-items:flex-end}

#stick{position:relative;width:150px;height:150px;border-radius:50%;pointer-events:auto;touch-action:none;
  background:radial-gradient(circle,rgba(58,208,255,.10) 0%,rgba(30,34,48,.75) 62%,rgba(30,34,48,.85) 100%);
  border:2px solid rgba(255,255,255,.18);box-shadow:inset 0 0 18px rgba(0,0,0,.6)}
#stick .ring{position:absolute;inset:22px;border-radius:50%;border:1px dashed rgba(58,208,255,.35)}
#stick::before,#stick::after{content:"";position:absolute;left:50%;top:50%;background:rgba(255,255,255,.12);transform:translate(-50%,-50%)}
#stick::before{width:2px;height:120px}#stick::after{width:120px;height:2px}
#stick .knob{position:absolute;left:50%;top:50%;width:62px;height:62px;margin:-31px 0 0 -31px;border-radius:50%;
  background:radial-gradient(circle at 35% 30%,#bff3ff,#3ad0ff 45%,#1a6a9a 100%);border:2px solid rgba(255,255,255,.5);
  box-shadow:0 4px 10px rgba(0,0,0,.6),0 0 14px rgba(58,208,255,.45);transition:transform .12s ease-out;will-change:transform}
#stick.active .knob{transition:none}
body.touch.landscape #stick{transform:scale(.85);transform-origin:left bottom}

.sbtn{border-radius:30px !important;padding:10px 14px !important;font-size:10px !important;background:rgba(80,140,255,.45) !important}
.sbtn.bomb{background:rgba(255,210,58,.45) !important}
.side .firebtn{width:84px;height:84px}
