:root {
  color-scheme: dark;
  --background: #0c1723;
  --panel: #13222f;
  --text: #e0e9ef;
  --muted: #9fb1bf;
  --accent: #65d7b4;
  --button: #1d3445;
  --button-hover: #27465c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font: 16px/1.5 system-ui, "Noto Sans KR", "Malgun Gothic", sans-serif;
}

main { max-width: 1200px; margin: 0 auto; padding: 24px 16px; }

[hidden] { display: none !important; }

.panel { padding: 8px 0; }

h1 { margin: 0 0 8px; font-size: 32px; font-weight: 600; }
#screen.title h1 { font-size: 64px; }

p { margin: 0 0 12px; color: var(--muted); white-space: pre-line; }

.buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }

button {
  min-width: 140px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid #2c4a5e;
  border-radius: 6px;
  background: var(--button);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
button:hover:not(:disabled) { background: var(--button-hover); }
button:disabled { opacity: 0.45; cursor: default; }
button.armed { border-color: #b4edff; color: #b4edff; }

#status { margin: 0 0 8px; color: var(--text); }
#hud { margin: 0 0 8px; color: var(--text); font-size: 20px; font-weight: 600; }
#canvas-host { position: relative; width: 100%; }
#canvas-host canvas { display: block; border-radius: 6px; }
/* The editor's canvas takes touches and the right button for itself (req~web.pointer~1). */
#canvas-host.editing canvas { touch-action: none; cursor: crosshair; }
#palette button, #settings button { min-width: 0; }
#stage-name {
  width: min(100%, 420px);
  min-height: 40px;
  margin: 0 0 8px;
  padding: 6px 10px;
  border: 1px solid #2c4a5e;
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}
/* The stage list: a row per stage, its name first (design/decisions/0022). */
#buttons.stages { flex-direction: column; align-items: stretch; }
#buttons .stage-row, #buttons .stage-actions { display: flex; flex-wrap: wrap; gap: 10px; }
#buttons .stage-row button:first-child { flex: 1 1 240px; text-align: left; }
#settings .setting { display: flex; align-items: center; gap: 8px; }
#outcome {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 8, 12, 0.55);
  color: var(--text);
  font-size: 48px;
  font-weight: 700;
  text-align: center;
  white-space: pre-line;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(4, 8, 12, 0.85);
}
.overlay .panel { max-width: 640px; width: 100%; padding: 24px; border-radius: 8px; background: var(--panel); }

/* The license link (design/decisions/0023) sits under the page while loading and on the title screen. */
#site-notices { max-width: 1200px; margin: 0 auto; padding: 0 16px 24px; font-size: 14px; }
#site-notices a { color: var(--muted); }
