/* 그늘각 — 여름 종이지도 테마 (하차각 형제 브랜딩: 잉크 윤곽 + 하드 섀도) */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  background: #fbf3e2;
  color: #1f2430;
  display: flex; flex-direction: column;
  user-select: none; -webkit-user-select: none;
}

/* ── 상단 바 ── */
#topbar {
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 10px;
  background: #fbf3e2;
  border-bottom: 3px solid #1f2430;
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 8px; }
.logo { font-size: 22px; }
.brand h1 { font-size: 21px; letter-spacing: 1px; }
#locBtn {
  margin-left: auto; font-size: 17px; line-height: 1;
  background: none; border: none; color: #1f2430; padding: 4px 6px;
  cursor: pointer;
}
#locBtn.locating { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#infoBtn {
  font-size: 18px; line-height: 1;
  background: none; border: none; color: #1f2430; padding: 4px 6px;
}
#areaChips {
  display: flex; gap: 8px; margin-top: 9px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; padding-bottom: 2px;
}
#areaChips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-width: 66px; padding: 8px 12px; text-align: center;
  font-size: 14px; font-weight: 700; font-family: inherit;
  background: #fff; color: #1f2430;
  border: 2.5px solid #1f2430; border-radius: 12px;
  box-shadow: 2.5px 2.5px 0 #1f2430;
}
.chip.on { background: #0d9488; color: #fff; box-shadow: 1px 1px 0 #1f2430; transform: translate(1.5px, 1.5px); }

/* ── 지도 ── */
#mapWrap { position: relative; flex: 1; min-height: 0; background: #f3ead3; }
#map { width: 100%; height: 100%; display: block; touch-action: none; }
#compass {
  position: absolute; top: 12px; right: 12px; width: 52px; height: 52px;
  background: #fff; border: 2.5px solid #1f2430; border-radius: 50%;
  box-shadow: 2.5px 2.5px 0 #1f2430;
  display: flex; align-items: center; justify-content: center;
}
#compass .north { position: absolute; top: 2px; font-size: 10px; font-weight: 800; }
#sunArrow { font-size: 18px; transform-origin: center; }
#legend {
  position: absolute; top: 12px; left: 12px; display: flex; gap: 6px;
}
.lg {
  font-size: 11.5px; font-weight: 700; padding: 4px 9px;
  border: 2px solid #1f2430; border-radius: 999px; background: #fff;
}
.lg.shade { background: #2c3e6b; color: #fff; }
.lg.sunny { background: #ffd35c; }
#osmCredit {
  position: absolute; bottom: 6px; left: 8px;
  font-size: 10px; color: #6b7280; background: #fbf3e2cc;
  padding: 1px 5px; border-radius: 6px;
}
#hint {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  background: #1f2430; color: #fff; font-size: 13.5px;
  padding: 9px 16px; border-radius: 999px; white-space: nowrap;
  opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
#hint.show { opacity: 0.94; }
#hint b { color: #ffd35c; }

/* ── 하단 패널 ── */
#panel {
  background: #fff; border-top: 3px solid #1f2430;
  padding: 12px 16px calc(env(safe-area-inset-bottom, 0px) + 12px);
  z-index: 5;
}
#timeRow { display: flex; align-items: flex-start; gap: 10px; }
#nowBtn {
  font-family: inherit; font-size: 13px; font-weight: 700;
  padding: 7px 12px; background: #ffd35c;
  border: 2.5px solid #1f2430; border-radius: 10px;
  box-shadow: 2px 2px 0 #1f2430; flex: none; margin-top: 3px;
}
#nowBtn:active { transform: translate(1.5px, 1.5px); box-shadow: none; }
#sliderWrap { flex: 1; display: flex; flex-direction: column; }
#timeSlider { width: 100%; accent-color: #0d9488; height: 28px; }
#timeMarks {
  display: flex; justify-content: space-between;
  font-size: 9.5px; color: #9ca3af; padding: 0 2px; margin-top: -2px;
  pointer-events: none;
}
#timeInfo { display: flex; flex-direction: column; align-items: flex-end; min-width: 64px; margin-top: 3px; }
#timeLabel { font-size: 16px; font-weight: 800; }
#sunLabel { font-size: 11px; color: #6b7280; }

#result { margin-top: 11px; border-top: 2px dashed #d6cdb6; padding-top: 10px; }
#result.hidden, .hidden { display: none; }
.route-row { margin-bottom: 2px; }
.route-line { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 3px 0; }
.route-line b { font-size: 14px; }
.route-line span:last-child { margin-left: auto; font-size: 13px; color: #374151; }
.dot { width: 14px; height: 14px; border-radius: 4px; border: 2px solid #1f2430; flex: none; }
.dot.teal { background: #0d9488; }
.dot.orange { background: #f97316; }
.sun-bar-wrap {
  height: 7px; background: #e5e7eb; border-radius: 4px;
  margin: 2px 0 4px 22px; overflow: hidden;
}
.sun-bar { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.teal-bar { background: linear-gradient(90deg, #0d9488, #5eead4); }
.orange-bar { background: linear-gradient(90deg, #f97316, #fdba74); }
#verdict {
  margin-top: 7px; font-size: 13.5px; font-weight: 700; color: #0f766e;
  background: #ccfbf1; border: 2px solid #0d9488; border-radius: 10px;
  padding: 8px 11px;
}
#actionBtns { display: flex; gap: 8px; margin-top: 9px; }
#bestTimeBtn, #shareBtn, #resetBtn {
  flex: 1; padding: 9px 0;
  font-family: inherit; font-size: 13px; font-weight: 700;
  background: #fff; border: 2.5px solid #1f2430; border-radius: 10px;
  box-shadow: 2px 2px 0 #1f2430; cursor: pointer;
}
#bestTimeBtn:active, #shareBtn:active, #resetBtn:active { transform: translate(1.5px, 1.5px); box-shadow: none; }
#bestTimeBtn.working { background: #fef3c7; }

/* ── 정보 모달 ── */
#infoModal {
  position: fixed; inset: 0; background: rgba(31, 36, 48, 0.55);
  display: flex; align-items: flex-end; z-index: 20;
}
#infoModal .sheet {
  background: #fbf3e2; width: 100%; max-height: 78%;
  border-top: 3px solid #1f2430; border-radius: 18px 18px 0 0;
  padding: 20px 20px calc(env(safe-area-inset-bottom, 0px) + 20px);
  overflow-y: auto;
}
.sheet h2 { font-size: 19px; margin-bottom: 10px; }
.sheet h3 { font-size: 14px; margin: 12px 0 6px; }
.sheet p, .sheet li { font-size: 13.5px; line-height: 1.65; color: #374151; }
.sheet ul { padding-left: 18px; }
.sheet b { color: #1f2430; }
#infoClose {
  margin-top: 14px; width: 100%; padding: 11px 0;
  font-family: inherit; font-size: 15px; font-weight: 700;
  background: #0d9488; color: #fff;
  border: 2.5px solid #1f2430; border-radius: 12px;
  box-shadow: 2.5px 2.5px 0 #1f2430;
}
.ver { text-align: center; margin-top: 10px; font-size: 11px; color: #9ca3af; }
