* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #0f1724;
  color: #eef2f8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 10px 24px;
}
h1 { font-size: 1.3em; margin: 4px 0 2px; text-align: center; }
.sub { font-size: 0.85em; margin: 0 0 10px; text-align: center; opacity: 0.75; }
.hud {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  margin-bottom: 10px; font-size: 0.9em;
}
.hud .pill {
  background: #1a2336; border: 1px solid #2a3a55; border-radius: 999px;
  padding: 4px 12px;
}
.hud b { color: #48dbfb; }
.controls {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 10px;
}
button, select {
  background: #1a2336; color: #eef2f8; border: 1px solid #2a3a55;
  border-radius: 8px; padding: 6px 12px; font-size: 0.9em; cursor: pointer;
}
button.primary { background: #2e5cff; border-color: #2e5cff; }
button:active { transform: scale(0.97); }
#stage { width: 100%; max-width: 420px; display: flex; justify-content: center; }
canvas {
  width: 100%; max-width: 420px; height: auto; aspect-ratio: 1 / 1;
  background: #111827; border-radius: 10px; touch-action: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.status { margin-top: 10px; font-size: 0.9em; text-align: center; min-height: 1.4em; opacity: 0.9; }
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: none; align-items: center; justify-content: center; z-index: 50;
}
.modal.show { display: flex; }
.modal-card {
  background: #1a2336; border: 1px solid #2a3a55; border-radius: 14px;
  padding: 22px 24px; text-align: center; max-width: 320px;
}
.modal-card h2 { margin: 0 0 8px; }
.modal-card p { margin: 0 0 14px; opacity: 0.85; }
