/* 방치마을 — 2.5D 쿼터뷰 방치형. 파스텔·귀여운 톤. */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --grass: #8fbf7f;
  --sky1: #cde7f5;
  --sky2: #acdcf0;
  --ink: #3b4a3a;
  --panel: #fffdf5;
  --gold: #ffcf5c;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--sky2);
  color: var(--ink);
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  /* 모바일 앱 규칙 — 웹뷰라도 글자가 잡히거나 확대되면 안 된다 */
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* 상단바 — 노치·다이나믹 아일랜드 밑으로 안 들어가게 안전영역 확보 */
#topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top))
           calc(14px + env(safe-area-inset-right))
           10px
           calc(14px + env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.45));
  z-index: 10;
}
#topbar .stat { font-size: 15px; font-weight: 700; }
#topbar .stat b { font-size: 17px; }
#btn-sound {
  margin-left: auto;
  font: inherit; font-size: 18px;
  background: none; border: 0; color: inherit;
  padding: 4px 8px;
}

/* 마을 캔버스 — 남는 공간을 다 채운다 */
#village {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: block;
  touch-action: none;   /* 캔버스 위 드래그로 마을을 미는 조작 */
}

/* 하단 도크 — 홈 인디케이터 위로 */
#dock {
  display: flex;
  gap: 8px;
  padding: 10px
           calc(12px + env(safe-area-inset-right))
           calc(10px + env(safe-area-inset-bottom))
           calc(12px + env(safe-area-inset-left));
  background: var(--panel);
  box-shadow: 0 -2px 14px rgba(0,0,0,.08);
  z-index: 10;
}
#dock button {
  flex: 1;
  min-height: 52px;
  font: inherit; font-size: 15px; font-weight: 700;
  color: var(--ink);
  background: #f3efe2;
  border: 0; border-radius: 16px;
}
#dock button:active { transform: scale(.97); }

/* 가상 조이스틱 — 화면 위에 떠 있고, 안전영역·홈바를 피한다 */
#stick {
  position: fixed;
  left: calc(22px + env(safe-area-inset-left));
  bottom: calc(92px + env(safe-area-inset-bottom));
  width: 108px; height: 108px;
  border-radius: 50%;
  background: rgba(255,255,255,.28);
  border: 2px solid rgba(255,255,255,.55);
  z-index: 20;
  touch-action: none;
}
#knob {
  position: absolute;
  left: 50%; top: 50%;
  width: 52px; height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  transition: transform .05s linear;
}
