* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #f4f5f8; font-family: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif; -webkit-user-select: none; user-select: none; touch-action: none; }
#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; image-rendering: pixelated; }
#caption {
  position: fixed; top: max(16px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  background: rgba(70, 72, 80, 0.72); color: #fff; padding: 8px 18px 10px; text-align: center;
  display: flex; flex-direction: column; gap: 2px; pointer-events: none; transition: opacity .3s; max-width: 92vw;
}
#caption b { font-size: 20px; letter-spacing: 2px; }
#caption span { font-size: 15px; font-weight: 600; opacity: .95; }
#labels { position: fixed; inset: 0; pointer-events: none; }
#labels .tgt { position: absolute; transform: translate(-50%, -130%); font: 700 12px/1 ui-monospace, Menlo, monospace; color: #fff; background: #e2453a; padding: 3px 6px; border-radius: 3px; }
#labels .tgt.next { background: #1b2350; }
#hud {
  position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.86); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(20, 30, 60, .08); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
  max-width: 96vw; box-shadow: 0 6px 24px rgba(20, 30, 60, .08);
}
#hud .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
#state { font: 600 12px ui-monospace, Menlo, monospace; color: #1b2350; min-width: 52px; }
#jumpinfo { font: 12px ui-monospace, Menlo, monospace; color: #667; }
.meter { width: 110px; height: 8px; background: #e5e8f0; border-radius: 4px; overflow: hidden; display: inline-block; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6fb37d, #e0a33a, #d8483c); }
button { appearance: none; border: 1px solid #d5d9e4; background: #fff; color: #1b2350; padding: 6px 11px; border-radius: 8px; font-size: 13px; cursor: pointer; }
button.on { background: #1b2350; color: #fff; border-color: #1b2350; }
.hint { font-size: 11px; color: #889; text-align: center; }
@media (max-width: 520px) { #caption b { font-size: 16px; } #caption span { font-size: 12px; } button { padding: 5px 8px; font-size: 12px; } }
