html, body { height: 100%; overflow: hidden; }
#stage { position: fixed; inset: 0; }
#game-canvas { width: 100%; height: 100%; display: block; touch-action: none; }
#hud {
  position: absolute; top: 0; left: 0; right: 0; display: flex; gap: 14px;
  align-items: center; padding: 10px 14px; pointer-events: none;
  background: linear-gradient(180deg, rgba(10,12,26,.72), transparent);
  font-size: 14px; flex-wrap: wrap;
}
.hud-item b { color: #ffd45e; font-variant-numeric: tabular-nums; }
#hud .hud-item:first-child b { font-size: 18px; }
.hud-buttons { margin-left: auto; display: flex; gap: 8px; pointer-events: auto; }
.hud-buttons button {
  background: rgba(47,143,139,.35); color: #eef2ff; border: 1px solid #2f8f8b;
  border-radius: 8px; padding: 4px 10px;
}
#pad { position: absolute; right: 18px; bottom: 18px; width: 150px; height: 150px; display: none; }
@media (pointer: coarse) { #pad { display: block; } }
.pad-btn {
  position: absolute; width: 48px; height: 48px; border-radius: 12px;
  background: rgba(232,176,106,.28); border: 1px solid rgba(232,176,106,.6);
  color: #ffe6bb; font-size: 18px; touch-action: none; user-select: none;
}
.pad-btn:active { background: rgba(232,176,106,.55); }
.pad-up { left: 51px; top: 0; } .pad-down { left: 51px; bottom: 0; }
.pad-left { top: 51px; left: 0; } .pad-right { top: 51px; right: 0; }
#overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(12, 14, 30, 0.78); backdrop-filter: blur(4px);
}
#overlay.hidden { display: none; pointer-events: none; }
.panel {
  max-width: 460px; margin: 16px; padding: 26px 30px; text-align: center;
  background: rgba(22, 26, 51, 0.92); border: 1px solid #2f8f8b; border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.panel h1, .panel h2 { margin: 0 0 6px; color: #ffd45e; letter-spacing: .04em; }
.panel .tag { margin: 0 0 14px; color: #9fe8ff; font-style: italic; }
.panel .how { text-align: left; margin: 0 0 18px; padding-left: 18px; line-height: 1.7; font-size: 15px; }
.panel .orb { color: #6fd4ff; } .panel .pit { color: #ff7b7b; }
.panel button, .panel a.btn {
  background: linear-gradient(135deg, #ffd45e, #ff9a2e); color: #221605;
  border: 0; border-radius: 12px; padding: 12px 28px; font-size: 17px; font-weight: 700;
  text-decoration: none; display: inline-block;
}
#pad.hidden { display: none !important; }
