/* Underhell — styles (remastered) */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: #05030a;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  font-family: 'Courier New', monospace;
}
#wrap { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
#stage { position: relative; }
canvas#game {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #0a0612;
  width: min(100vw, calc(100vh * 5 / 3));
  height: min(100vh, calc(100vw * 3 / 5));
  border: 2px solid rgba(60, 35, 85, 0.6);
  box-shadow: 0 0 40px rgba(120, 60, 160, 0.15), inset 0 0 60px rgba(0, 0, 0, 0.4);
}

/* ---- touch controls (mobile D-pad) ---- */
#touchui { display: none; }
body.touch #touchui { display: block; }
.tbtn {
  position: absolute;
  width: 60px; height: 60px;
  border: 2px solid rgba(255,120,40,.5);
  background: rgba(30,10,25,.5);
  color: #ffb27a;
  font-size: 22px; font-weight: bold;
  border-radius: 14px;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  z-index: 10;
  backdrop-filter: blur(4px);
  transition: transform 0.05s, background 0.05s;
}
.tbtn:active, .tbtn.on {
  background: rgba(255,90,30,.55);
  border-color: #ffcf9a;
  transform: scale(0.92);
  color: #fff;
}
.tbtn.round { border-radius: 50%; font-size: 18px; }
#t-left  { left: 16px;  bottom: 80px; }
#t-right { left: 136px; bottom: 80px; }
#t-up    { left: 76px;  bottom: 140px; }
#t-down  { left: 76px;  bottom: 20px; }
#t-fire  { right: 100px; bottom: 36px; }
#t-jump  { right: 20px;  bottom: 96px; }

/* ---- loading screen ---- */
#loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0612;
  color: #ffd23f;
  font-size: 14px;
  font-family: monospace;
  z-index: 20;
  transition: opacity 0.3s;
}
#loader.hide { opacity: 0; pointer-events: none; }