:root {
  --bg: #07090c;
  --card: #11161d;
  --line: #243040;
  --fg: #d8e1ea;
  --dim: #7d8a99;
  --accent: #3fae5a;
  --err: #ff7a6b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Segoe UI", sans-serif; }
[hidden] { display: none !important; }

.panel { max-width: 560px; margin: 0 auto; padding: 48px 16px; }
h1 { font-size: 28px; letter-spacing: .02em; margin: 0 0 24px; }
h1 small { font-size: 14px; color: var(--dim); font-weight: 400; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; display: grid; gap: 14px; }
label { display: grid; gap: 4px; }
.settings label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
input:not([type]), input[type=password] { background: #0b0f14; color: var(--fg); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px; font: inherit; }
button { background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 10px 16px; font: inherit;
  font-weight: 600; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
button.link { background: none; color: var(--dim); padding: 0; font-weight: 400; text-decoration: underline; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions #start-full { background: #2a3a4c; }
fieldset { border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 8px; padding: 12px; }
legend { color: var(--dim); padding: 0 6px; }
.hint { color: var(--dim); font-size: 13px; }
.err { color: var(--err); margin: 0; min-height: 1.5em; white-space: pre-wrap; }
.who { margin: 0; color: var(--dim); }
.bar { height: 8px; background: #0b0f14; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
#bar-fill { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
#status { margin: 6px 0 0; color: var(--dim); font-size: 13px; font-variant-numeric: tabular-nums; }
.storage summary { cursor: pointer; color: var(--dim); }
.maps.drag { border-color: var(--accent); background: #0f1a12; }
.maps-add { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.maps-add button { background: #2a3a4c; padding: 6px 12px; }
.maps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 180px; overflow: auto; }
.maps-list li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.maps-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.maps-list li button { flex: none; }
.maps-list:empty { display: none; }

/* 게임 화면: 4:3 레터박스, 최근접 확대(게임은 640×480 8bpp). OS 커서는 숨김(게임이 자기 커서를 그림) */
#stage { position: fixed; inset: 0; background: #000; display: flex; align-items: center; justify-content: center; }
#screen { image-rendering: pixelated; image-rendering: crisp-edges; cursor: none; outline: none; background: #000;
  touch-action: none; }
#screen.oscursor { cursor: default; }
/* 한국어 IME 입력용 숨긴 textarea(app.js focusInput): 보이지 않고 클릭을 가로채지 않음 */
#sc-ime { position: fixed; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; resize: none;
  pointer-events: none; z-index: -1; }
#hud { position: fixed; top: 8px; right: 8px; display: flex; gap: 8px; align-items: center; opacity: .0; transition: opacity .3s; }
#stage:hover #hud, #hud.show { opacity: .85; }
#hud-msg { background: rgba(0,0,0,.7); color: #cfd8e3; padding: 4px 8px; border-radius: 4px; font-size: 12px; }
#hud-msg:empty { display: none; }
#hud-msg.warn { background: rgba(60,40,0,.9); color: #ffd27a; border: 1px solid #c9922e; max-width: 420px; line-height: 1.4; }
#hud button { background: rgba(0,0,0,.6); color: #cfd8e3; padding: 4px 8px; font-size: 16px; }
