/* ============ 위글로우 웰니스 스토어 — 기본 스타일 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --gold: #c9a86a;
  --gold-deep: #a9854a;
  --walnut: #5d4531;
  --cream: #f7f1e6;
  --ink: #2b2118;
  --coral: #e8734a;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--ink);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', '맑은 고딕', sans-serif;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overscroll-behavior: none;
}

#game {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
}

.hidden { display: none !important; }

/* ============ HUD ============ */
#hud {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: 12px; right: 12px;
  display: flex; justify-content: space-between; align-items: flex-start;
  pointer-events: none;
  z-index: 10;
}
.hud-left { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

#brand-pill {
  background: rgba(43, 33, 24, 0.88);
  color: var(--gold);
  border: 1px solid rgba(201, 168, 106, 0.55);
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 1px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
#brand-pill span {
  color: var(--cream);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0;
  margin-left: 4px;
}

#zone-pill {
  background: rgba(247, 241, 230, 0.92);
  color: var(--walnut);
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.18);
}

#point-pill {
  background: rgba(43, 33, 24, 0.88);
  color: var(--cream);
  border: 1px solid rgba(201, 168, 106, 0.55);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
#point-pill b { color: var(--gold); }

.hud-right { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
#online-pill {
  background: rgba(90, 127, 158, 0.9);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}
#mute-btn {
  pointer-events: auto;
  background: rgba(43, 33, 24, 0.88);
  border: 1px solid rgba(201, 168, 106, 0.55);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
#mute-btn:active { transform: scale(0.92); }

/* ============ 존 토스트 ============ */
#zone-toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 70px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(43, 33, 24, 0.9);
  color: var(--cream);
  border: 1px solid rgba(201, 168, 106, 0.5);
  padding: 9px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
  z-index: 11;
  white-space: nowrap;
}
#zone-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ 인터랙션 버튼 ============ */
#action-btn {
  position: fixed;
  left: 0; top: 0;                          /* JS가 매 프레임 캐릭터 위로 이동 */
  transform: translate(-50%, -100%);
  background: linear-gradient(180deg, #d8b87c, var(--gold-deep));
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  font-family: inherit;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.4);
  z-index: 12;
  cursor: pointer;
}
#action-btn:active { transform: translate(-50%, -100%) scale(0.94); }

/* ============ 모달 ============ */
#modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 14, 8, 0.55);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 20;
  padding: 24px;
}
#modal-card {
  width: 100%;
  max-width: 340px;
  background: var(--cream);
  border-radius: 22px;
  padding: 26px 22px 20px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  border: 1px solid rgba(201, 168, 106, 0.4);
  animation: card-in 0.28s cubic-bezier(0.2, 1.4, 0.5, 1);
}
@keyframes card-in {
  from { transform: translateY(24px) scale(0.92); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
#modal-img {
  display: none;
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 18px;
  margin: 0 auto 10px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  border: 1px solid rgba(93, 69, 49, 0.1);
}
#modal-img { cursor: pointer; }
#modal-dots {
  display: none;
  justify-content: center;
  gap: 6px;
  margin: -2px 0 10px;
}
#modal-dots .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #d8cbb5;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
#modal-dots .dot.on {
  background: var(--gold-deep);
  transform: scale(1.25);
}
#modal-icon { font-size: 46px; margin-bottom: 8px; }
#modal-title { font-size: 21px; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
#modal-review {
  display: none;
  font-size: 13px;
  font-weight: 700;
  color: #55483a;
  margin-bottom: 8px;
}
#modal-review .star { color: #f0a029; }
#modal-review .cnt { color: #a08f78; font-weight: 600; }
#modal-chips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
#modal-chips .chip {
  background: #ece2cf;
  color: var(--walnut);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
#modal-band {
  display: inline-block;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 12px;
  background: var(--gold-deep);
}
#modal-desc {
  font-size: 14px;
  line-height: 1.6;
  color: #55483a;
  margin-bottom: 10px;
  white-space: pre-line;
}
#modal-note {
  font-size: 11px;
  color: #a08f78;
  margin-bottom: 14px;
}
#modal-link {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(180deg, #ddbd82, var(--gold-deep));
  color: #fff;
  text-decoration: none;
  padding: 13px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(169,133,74,0.35), inset 0 1px 0 rgba(255,255,255,0.4);
}
#modal-link:active { opacity: 0.85; }

#modal-close {
  width: 100%;
  background: var(--ink);
  color: var(--cream);
  border: none;
  padding: 13px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
#modal-close:active { opacity: 0.85; }

/* ============ 매장 안내판 ============ */
#guide-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 14, 8, 0.55);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 20;
  padding: 24px;
}
#guide-card {
  width: 100%;
  max-width: 360px;
  background: var(--cream);
  border-radius: 22px;
  padding: 24px 18px 18px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  border: 1px solid rgba(201, 168, 106, 0.4);
  animation: card-in 0.28s cubic-bezier(0.2, 1.4, 0.5, 1);
}
#guide-title { font-size: 20px; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
#guide-sub { font-size: 12px; color: #a08f78; margin-bottom: 14px; }
#guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.guide-btn {
  display: flex; align-items: center; gap: 8px;
  background: #fff;
  border: 1px solid rgba(93, 69, 49, 0.15);
  border-radius: 13px;
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.guide-btn:active {
  background: #f3e8d4;
  transform: scale(0.96);
}
.guide-btn .gi { font-size: 17px; }
.guide-floor {
  grid-column: 1 / -1;
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #a08f78;
  margin: 6px 2px 0;
  border-bottom: 1px solid rgba(93, 69, 49, 0.12);
  padding-bottom: 4px;
}
#guide-close {
  width: 100%;
  background: var(--ink);
  color: var(--cream);
  border: none;
  padding: 12px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

/* ============ 강아지 메뉴 ============ */
#pet-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 14, 8, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 20;
  padding: 24px;
}
#pet-card {
  width: 100%;
  max-width: 260px;
  background: var(--cream);
  border-radius: 20px;
  padding: 20px 16px 14px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  border: 1px solid rgba(201, 168, 106, 0.4);
  animation: card-in 0.25s cubic-bezier(0.2, 1.4, 0.5, 1);
}
#pet-title { font-size: 19px; font-weight: 800; color: var(--ink); margin-bottom: 12px; }
.pet-btn {
  display: block;
  width: 100%;
  background: #fff;
  border: 1px solid rgba(93, 69, 49, 0.15);
  border-radius: 13px;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  margin-bottom: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.pet-btn:active { background: #f3e8d4; transform: scale(0.97); }
#pet-close {
  width: 100%;
  background: var(--ink);
  color: var(--cream);
  border: none;
  padding: 11px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 2px;
}

/* ============ 자유 채팅 ============ */
#chat-open {
  position: fixed;
  left: 14px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(43, 33, 24, 0.88);
  border: 1px solid rgba(201, 168, 106, 0.55);
  font-size: 21px;
  cursor: pointer;
  z-index: 12;
  box-shadow: 0 5px 16px rgba(0,0,0,0.3);
}
#chat-open:active { transform: scale(0.92); }
#chat-bar {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  display: flex;
  gap: 7px;
  z-index: 14;
}
#chat-input {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(201, 168, 106, 0.6);
  background: rgba(247, 241, 230, 0.97);
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}
#chat-send {
  background: linear-gradient(180deg, #d8b87c, var(--gold-deep));
  color: #fff;
  border: none;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
#chat-bar-close {
  background: rgba(43, 33, 24, 0.88);
  color: var(--cream);
  border: 1px solid rgba(201, 168, 106, 0.4);
  width: 44px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
}
#chat-log {
  position: fixed;
  left: 14px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 80px);
  z-index: 11;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
  max-width: 72%;
}
.chat-line {
  align-self: flex-start;
  background: rgba(43, 33, 24, 0.72);
  color: var(--cream);
  padding: 5px 11px;
  border-radius: 11px;
  font-size: 12px;
  line-height: 1.4;
  transition: opacity 0.6s;
  word-break: break-all;
}
.chat-line b { color: #9ecbe8; margin-right: 4px; }
.chat-line.me b { color: var(--gold); }
.chat-line.fade { opacity: 0; }

/* ============ 인트로 ============ */
#intro {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at 50% 30%, #4a3826 0%, var(--ink) 70%);
  display: flex; align-items: center; justify-content: center;
  z-index: 30;
  padding: 24px;
  transition: opacity 0.5s ease;
}
#intro.fade-out { opacity: 0; pointer-events: none; }
#intro-card { text-align: center; max-width: 340px; width: 100%; }
#intro-logo {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--gold);
  margin-bottom: 10px;
}
#intro-title {
  font-size: 30px;
  font-weight: 800;
  color: var(--cream);
  margin-bottom: 12px;
}
#intro-sub {
  font-size: 14px;
  line-height: 1.6;
  color: #cbb899;
  margin-bottom: 26px;
}
#intro-howto {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(201,168,106,0.3);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 26px;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 13px;
  color: #e8ddc8;
  text-align: left;
}
#intro-start {
  width: 100%;
  background: linear-gradient(180deg, #ddbd82, var(--gold-deep));
  color: #fff;
  border: none;
  padding: 16px;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(201,168,106,0.3), inset 0 1px 0 rgba(255,255,255,0.4);
}
#intro-start:active { transform: scale(0.97); }
