/* 16:9 캔버스를 화면 가운데에 비율 유지로 배치한다. Kenney 그림은 픽셀아트가 아니라 부드럽게 늘인다 */

* { margin: 0; padding: 0; box-sizing: border-box; }

/* 주소창이 접히고 펴져도 흔들리지 않게 dvw/dvh 를 쓰고,
   노치와 홈 인디케이터가 먹는 영역을 빼고 무대 크기를 잰다 */
:root {
  --safe-w: calc(100dvw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  --safe-h: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #9fd3ec;
}

body {
  position: fixed;
  inset: 0;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(#bfe4f5, #8ec9e6);
  font-family: system-ui, "Segoe UI", sans-serif;
  cursor: default;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#stage {
  /* 폰 기준: 노치와 홈 표시줄을 뺀 화면을 꽉 채운다. 캔버스의 실제 크기와 비율(16:9~21:9)은 main.js 가 정한다 */
  width: var(--safe-w);
  height: var(--safe-h);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#game {
  width: 100%;
  height: 100%;
  display: block;
  flex: none;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(20, 40, 70, 0.35);
}
