* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  overflow: hidden; position: fixed; inset: 0;
  background: #0d3555; color: #10263d;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.stage { position: absolute; inset: 0; overflow: hidden; background: #0d3555; }
#cv { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; }
.hidden { display: none !important; }

.hud { position: absolute; inset: 0; pointer-events: none; }
.score-pill {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 14px;
  display: flex; align-items: baseline; gap: 7px;
  padding: 6px 15px 7px; border-radius: 999px;
  background: rgba(9, 42, 76, 0.58);
  color: #ffffff; box-shadow: 0 2px 10px rgba(0, 30, 60, 0.18);
}
.score-label { font-size: 12px; letter-spacing: 1px; opacity: 0.85; }
.score-pill b { font-size: 22px; line-height: 1; color: #FFC46B; font-variant-numeric: tabular-nums; }

.pause-btn {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 14px;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.45);
  background: rgba(9, 42, 76, 0.55); color: #ffffff; padding: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: auto; cursor: pointer;
}
.pause-btn:active { transform: scale(0.94); }
.pause-btn .mp-icon { width: 22px; height: 22px; }

.controls { position: absolute; left: 0; right: 0; bottom: calc(22px + env(safe-area-inset-bottom)); pointer-events: none; }
.steer-btn {
  position: absolute; bottom: 0; width: 66px; height: 66px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.62); color: #13528a;
  display: flex; align-items: center; justify-content: center;
  padding: 0; pointer-events: auto; cursor: pointer;
  box-shadow: 0 3px 12px rgba(20, 60, 100, 0.18);
}
.steer-btn .mp-icon { width: 34px; height: 34px; }
#leftBtn { left: 18px; }
#rightBtn { right: 18px; }
.steer-btn:active, .steer-btn.on { background: rgba(255,255,255,0.92); transform: scale(0.95); }

.start-hit {
  position: absolute; z-index: 4; padding: 0; border: 0; border-radius: 999px;
  background: transparent; cursor: pointer;
}
.start-hit:active { background: rgba(255,255,255,0.16); box-shadow: 0 0 0 6px rgba(255,255,255,0.12); }

.modal {
  position: absolute; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(5, 26, 48, 0.58);
}
.sheet {
  width: 100%; max-width: 330px; padding: 24px 22px 20px;
  border-radius: 22px; background: #FFF9F0;
  box-shadow: 0 18px 44px rgba(0, 22, 48, 0.35);
  text-align: center;
}
.sheet h2 { margin: 0; font-size: 23px; font-weight: 800; color: #123a62; letter-spacing: 0.02em; }
.modal-text { margin: 10px 0 18px; font-size: 14px; line-height: 1.7; color: #5b6b7c; }
.modal-text .big { display: block; font-size: 34px; font-weight: 800; color: #FF8A3D; line-height: 1.25; font-variant-numeric: tabular-nums; }
.modal-text .sub { display: block; margin-top: 4px; font-size: 12.5px; color: #7b8794; }
.modal-btns { display: flex; flex-direction: column; gap: 10px; }
.btn {
  height: 50px; border-radius: 14px; border: 0; font-size: 16px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: #FF8A3D; color: #ffffff; box-shadow: 0 4px 0 #d96a22; }
.btn-primary:active { box-shadow: 0 1px 0 #d96a22; }
.btn-ghost { background: #eef1f4; color: #33546f; }

@media (max-height: 560px) {
  .controls { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .steer-btn { width: 56px; height: 56px; }
  .sheet { padding: 18px; }
  .modal-text { margin: 6px 0 12px; }
  .btn { height: 44px; }
}
