html, body { height: 100%; overflow: hidden; touch-action: none; }
#stage, #stage canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#hud { position: fixed; top: 0; left: 0; right: 0; padding: 10px 14px; pointer-events: none;
  transition: opacity 0.3s; }
#hud.dim { opacity: 0.25; }
.hud-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
  font-size: 14px; letter-spacing: 0.08em; text-shadow: 0 1px 3px #000; }
.hud-row b { color: #ffcf5e; font-size: 16px; }
#overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 5, 20, 0.62); backdrop-filter: blur(3px); transition: opacity 0.3s; }
#overlay.hidden, .hidden { display: none; }
#ov-box { max-width: min(520px, 88vw); text-align: center; padding: 28px;
  border: 1px solid #5d3352; border-radius: 14px; background: rgba(24, 13, 38, 0.92);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6); }
#ov-title { font-size: 30px; letter-spacing: 0.25em; color: #ffcf5e; margin-bottom: 12px; }
#ov-body { line-height: 1.55; color: #e8dcc8; margin-bottom: 18px; font-size: 15px; }
#ov-btn { pointer-events: auto; cursor: pointer; font-size: 17px; letter-spacing: 0.12em;
  padding: 12px 34px; border-radius: 10px; border: none; font-weight: 700;
  background: linear-gradient(#35e0c8, #1fa893); color: #06201c; }
#dpad { position: fixed; right: 14px; bottom: 14px; width: 150px; height: 150px;
  display: grid; grid-template-areas: ". u ." "l . r" ". d ."; opacity: 0.85; z-index: 5; }
.dbtn { display: flex; align-items: center; justify-content: center; font-size: 24px;
  color: #f2e8d8; background: rgba(93, 51, 82, 0.65); border: 1px solid rgba(53,224,200,0.4);
  border-radius: 12px; user-select: none; touch-action: none; }
.dbtn.on { background: rgba(53, 224, 200, 0.55); color: #06201c; }
.d-up { grid-area: u; } .d-down { grid-area: d; } .d-left { grid-area: l; } .d-right { grid-area: r; }
#tilt-ind { position: fixed; top: 44px; right: 16px; width: 56px; height: 56px;
  border: 1px solid rgba(53,224,200,0.5); border-radius: 50%; pointer-events: none; }
#tilt-ind::before, #tilt-ind::after { content: ""; position: absolute; background: rgba(53,224,200,0.25); }
#tilt-ind::before { left: 50%; top: 6px; bottom: 6px; width: 1px; }
#tilt-ind::after { top: 50%; left: 6px; right: 6px; height: 1px; }
#tilt-dot { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px;
  border-radius: 50%; background: #ffcf5e; box-shadow: 0 0 10px #ffcf5e; }
@media (max-width: 640px) { #tilt-ind { top: 40px; right: 8px; width: 44px; height: 44px; } }
