* {
  box-sizing: border-box;
}

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

body {
  position: fixed;
  inset: 0;
}

#gameWrap {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

#hud {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 14px;
  right: 14px;
  display: grid;
  grid-template-columns: minmax(76px, 1fr) auto minmax(76px, 1fr);
  align-items: start;
  gap: 12px;
  pointer-events: none;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

.readout {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.readout.right {
  justify-items: end;
}

.label {
  color: rgba(245, 240, 223, 0.62);
  font-size: 10px;
  font-weight: 800;
}

.readout strong {
  color: #fff7d5;
  font-size: clamp(24px, 8vw, 38px);
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

#lives {
  display: flex;
  justify-content: center;
  gap: 7px;
  min-width: 72px;
  padding-top: 7px;
}

.life {
  width: 14px;
  height: 14px;
  border-radius: 50% 50% 45% 45%;
  background: linear-gradient(180deg, #fff4a8 0%, #ff7b49 55%, #d83255 100%);
  box-shadow: 0 0 15px rgba(255, 123, 73, 0.75);
}

.life.empty {
  background: rgba(245, 240, 223, 0.18);
  box-shadow: none;
}

#toast {
  position: absolute;
  left: 50%;
  bottom: max(32px, calc(env(safe-area-inset-bottom) + 28px));
  transform: translateX(-50%);
  padding: 9px 13px;
  border: 1px solid rgba(245, 240, 223, 0.16);
  border-radius: 6px;
  background: rgba(18, 19, 22, 0.54);
  color: rgba(245, 240, 223, 0.88);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  transition: opacity 180ms ease, transform 180ms ease;
}

body[data-phase="aiming"] #toast,
body[data-phase="flight"] #toast,
body[data-phase="settle"] #toast {
  opacity: 0;
  transform: translate(-50%, 8px);
}

body[data-phase="over"] #toast {
  opacity: 1;
}
