html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0f172a;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  touch-action: none;
  user-select: none;
}

#gameWrap {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, #77d8ff 0, #47a8ee 45%, #276bbf 100%);
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

#hud {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-shadow: 0 2px 7px rgba(0,0,0,.35);
}

.hud-card,
.hud-btn {
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .22);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  white-space: nowrap;
}

.hud-card b { color: #fde047; }
.physics-tag { color: #bbf7d0; font-weight: 800; }
.hud-btn {
  color: #fff;
  cursor: pointer;
}

#centerPanel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  width: min(520px, calc(100vw - 36px));
  text-align: center;
  color: #fff;
  background: rgba(15, 23, 42, .56);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 28px;
  padding: 30px 24px;
  box-shadow: 0 24px 90px rgba(15,23,42,.35);
  backdrop-filter: blur(14px);
}

#centerPanel.hide { display: none; }
#centerPanel h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 5vw, 44px);
  letter-spacing: 2px;
}
#centerPanel p { margin: 0 0 18px; opacity: .9; line-height: 1.65; }
#centerPanel button {
  border: 0;
  border-radius: 999px;
  padding: 13px 34px;
  font-size: 18px;
  font-weight: 800;
  color: #713f12;
  background: linear-gradient(180deg, #fde68a, #facc15);
  box-shadow: 0 12px 32px rgba(250,204,21,.34);
  cursor: pointer;
}
.tips {
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.6;
  opacity: .78;
}

#mobileControls {
  position: fixed;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: none;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 18px;
  pointer-events: none;
}
#mobileControls button {
  width: 62px;
  height: 62px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(15, 23, 42, .48);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(15,23,42,.25);
  backdrop-filter: blur(9px);
  pointer-events: auto;
}
#mobileControls .jumpBtn {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: rgba(250,204,21,.82);
  color: #713f12;
}
.moveBtns { display: flex; gap: 12px; }

@media (max-width: 900px), (pointer: coarse) {
  #mobileControls { display: flex; }
  #hud { top: max(8px, env(safe-area-inset-top)); gap: 6px; }
  .hud-card, .hud-btn { padding: 7px 10px; font-size: 12px; }
}
