@font-face { font-family: "Black Han Sans"; src: url("/assets/fonts/BlackHanSans.3c9cea35.woff2") format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "Chainmate Sans KR"; src: url("/assets/fonts/ChainmateSansKR-Medium.52bdf9cd.woff2") format("woff2"); font-weight: 500; font-display: block; }
@font-face { font-family: "Chainmate Sans KR"; src: url("/assets/fonts/ChainmateSansKR-Bold.d5b80d30.woff2") format("woff2"); font-weight: 700; font-display: block; }
/* 화면 맞춤(docs/design-notes/layout.md 「화면 맞춤」): 캔버스 자리 · 크기는 main.js가 기기 화소 정수 자리에 둔다.
   창은 끌리지도 · 튕기지도 · 확대되지도 않는다(손가락 두 번 누르기 · 벌리기 · 길게 누르기 선택과 메뉴 포함) */
html, body {
  margin: 0; height: 100%; background: #05061a; overflow: hidden;
  overscroll-behavior: none; touch-action: none;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
body { position: fixed; inset: 0; }
canvas {
  display: block;
  position: absolute;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
  outline: none;
}
/* 캔버스 바탕은 비워 둔다: WebKit은 반 CSS 화소 자리의 캔버스 그림을 1 기기 화소 밀어 그려, 바탕이 있으면 테두리에 한 줄이 비친다(뒤는 같은 결의 여백 판) */
#screen { background: transparent; cursor: default; }
#pad { background: #05061a; }
/* 안전 영역 재기(노치 · 홈 막대): main.js가 padding을 읽는다 */
#safe {
  position: fixed; inset: 0; visibility: hidden; pointer-events: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
/* 캔버스 · 여백 판이 놓이는 틀. 폰 세로면 세로 틀(270 × H)을 그린다(src/ui/fit.js) */
#stage { position: fixed; left: 0; top: 0; width: 100%; height: 100%; overflow: hidden; transform-origin: 0 0; }
/* 글자 입력 칸(CHM-72, src/ui/textfield.js): 캔버스 위에 겹치는 아이디 · 비번 칸. 자리 · 크기 · 글 크기는 textfield.js가 게임 좌표에서 옮겨 적는다.
   body가 글 고르기를 막고 있어 칸에서만 푼다(안 풀면 아이폰에서 글 자리 표시가 안 뜬다) */
.tf { position: fixed; left: 0; top: 0; width: 0; height: 0; margin: 0; padding: 0; z-index: 5; }
.tf-in {
  position: fixed; box-sizing: border-box; margin: 0; border: 1px solid #3a4280; border-radius: 9px;
  background: #161a44; color: #fff1b8; caret-color: #efbd55; outline: none;
  font-family: "Chainmate Sans KR", sans-serif; font-weight: 500; line-height: 1; letter-spacing: 0;
  transform-origin: 0 0; -webkit-appearance: none; appearance: none;
  -webkit-user-select: text; user-select: text; touch-action: manipulation; -webkit-touch-callout: default;
}
.tf-in:focus { border-color: #efbd55; }
.tf-in::selection { background: #efbd55; color: #2a1c08; }
/* 비번 관리자가 채운 칸의 바탕을 게임 결로 */
.tf-in:-webkit-autofill { -webkit-text-fill-color: #fff1b8; box-shadow: 0 0 0 1000px #161a44 inset; caret-color: #efbd55; }
/* 이름표는 캔버스가 그린다 — 화면 읽기 프로그램에만 보인다 */
.tf-label { position: fixed; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; color: #ece3cf; font-family: "Chainmate Sans KR", sans-serif; }
.tf-go { position: fixed; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* 그리기가 이어 실패해 멈췄을 때의 알림(src/main.js showFatal): 캔버스 위를 덮고 다시 불러오기 단추 하나 */
#fatal {
  position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  padding: 24px; background: rgba(5, 6, 26, 0.92); color: #f6eedc; text-align: center;
  font: 600 17px/1.5 system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  -webkit-user-select: text; user-select: text; touch-action: manipulation;
}
#fatal p { margin: 0; max-width: 22em; word-break: keep-all; }
#fatal button {
  font: inherit; color: #12153a; background: #efbd55; border: 2px solid #12153a; border-radius: 999px; padding: 12px 28px; min-height: 48px; cursor: pointer;
}

/* 뜨기 전 안내(index.html의 작은 스크립트): 늦으면 「불러오는 중」, 모듈을 못 받으면 다시 불러오기 단추. 게임이 뜨면 걷는다 */
#boot, #boot-noscript {
  position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  margin: 0; padding: 24px; color: #8f97c9; text-align: center; word-break: keep-all;
  font: 600 16px/1.5 system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
#boot[hidden] { display: none; }
#boot p { margin: 0; max-width: 22em; }
#boot button {
  font: inherit; color: #12153a; background: #efbd55; border: 2px solid #12153a; border-radius: 999px; padding: 12px 28px; min-height: 48px; cursor: pointer; touch-action: manipulation;
}
#boot button[hidden] { display: none; }
