@font-face {
  font-family: "Galmuri11";
  src: url("assets/fonts/Galmuri11.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Galmuri11";
  src: url("assets/fonts/Galmuri11-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: #0d0b0a;
  overflow: hidden;
}
body {
  display: flex;
  align-items: center;
  justify-content: center;
  /* 안전 영역(노치·홈 표시줄) 안에서 가운데. src/main.js fit()도 같은 넓이에 맞춘다 */
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  /* 손가락: 끌어도 화면이 밀리거나 커지지 않게, 길게 눌러도 메뉴·선택이 뜨지 않게 */
  touch-action: none;
  overscroll-behavior: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
#stage {
  position: relative;
  line-height: 0;
}
#game {
  display: block;
  border: 0;
  padding: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: none;
  background: #000;
}
/* 레벨업 카드·상자·공명 컷인(src/ui) 뿌리. 레이어가 없으면 클릭은 캔버스로 */
#ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* 결과·일시정지 화면 */
#overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-family: "Galmuri11", monospace;
  line-height: 1.4;
}

#overlay.on {
  pointer-events: auto;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 11, 10, 0.62);
}
#overlay .panel {
  min-width: 15em;
  padding: 1.4em 1.8em 1.5em;
  background: #211d1a;
  border: 2px solid #4a4038;
  box-shadow: 0 0 0 2px #171311;
  color: #e6dac8;
  font-size: 1em;
  line-height: 1.5;
  text-align: center;
  animation: rise 0.28s steps(4) both;
}
#overlay h1 {
  margin: 0 0 0.9em;
  font-size: 1.4em;
  font-weight: 700;
  color: #ff8a3d;
  letter-spacing: 0.04em;
}
#overlay dl {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.3em 1.6em;
  margin: 0 0 1.3em;
  text-align: left;
}
#overlay dt { color: #a4927c; }
#overlay dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
#overlay dd.hot { color: #ffc070; }
#overlay .buttons { display: flex; gap: 0.8em; justify-content: center; }
#overlay button {
  font: inherit;
  font-weight: 700;
  color: #171311;
  background: #e6dac8;
  border: 0;
  box-shadow: 0 3px 0 #857666;
  padding: 0.35em 1.4em;
  cursor: pointer;
}
#overlay button:hover, #overlay button:focus-visible {
  background: #ff8a3d;
  box-shadow: 0 3px 0 #a0441b;
  outline: none;
}
#overlay button:active { transform: translateY(2px); box-shadow: 0 1px 0 #a0441b; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  #overlay .panel { animation: none; }
}
