/* 파스텔 '장난감 섬' 꾸밈. 지도 색은 assets/cute.js 의 PASTEL 과 맞춘다. */
:root {
  --bg: #cfeaf8;          /* 강릉 밖 (하늘색 바다 같은 배경) */
  --panel: #fffaf2;
  --ink: #5b4636;
  --muted: #9a8270;
  --line: #f1dfc9;
  --accent: #ff8f6b;      /* 살구 */
  --accent-2: #4fb7a0;    /* 민트 */
  --pink: #ffc9d6;
  --shadow: 0 6px 0 #f0d9bf, 0 14px 30px rgba(122, 90, 67, 0.18);   /* 아래로 두툼한 '쿠키' 그림자 */
  --cute: "Jua", "Pretendard Variable", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
/* 정거장 사이에 멈추지 않고 한 칸씩 딱딱 넘어가게 */
html { scroll-snap-type: y mandatory; }
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  line-height: 1.65; word-break: keep-all;
}
#map { position: fixed; inset: 0; z-index: 0; }

.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; pointer-events: none;
}
.brand {
  pointer-events: auto; font-family: var(--cute); font-size: 1.15rem; background: var(--panel);
  padding: 8px 16px; border-radius: 999px; box-shadow: var(--shadow); border: 2px solid var(--line);
}
.dots { pointer-events: auto; display: flex; gap: 7px; background: var(--panel); padding: 10px 12px; border-radius: 999px; box-shadow: var(--shadow); border: 2px solid var(--line); }
.dots button { width: 12px; height: 12px; padding: 0; border-radius: 999px; border: 0; background: var(--line); cursor: pointer; transition: all .25s; }
.dots button[aria-current="true"] { background: var(--accent); width: 26px; }

.story { position: relative; z-index: 2; pointer-events: none; }
.stop {
  pointer-events: auto; width: min(420px, calc(100% - 32px)); margin: 0 0 0 max(16px, 5vw);
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  scroll-snap-align: start; scroll-snap-stop: always;
}
.stop > * { background: var(--panel); margin: 0; padding: 0 24px; border-left: 3px solid var(--line); border-right: 3px solid var(--line); }
.stop > :first-child { padding-top: 22px; border-radius: 28px 28px 0 0; border-top: 3px solid var(--line); }
.stop > :last-child { padding-bottom: 24px; border-radius: 0 0 28px 28px; border-bottom: 3px solid var(--line); box-shadow: var(--shadow); }
.stop h1, .stop h2 { font-family: var(--cute); font-weight: 400; letter-spacing: -0.01em; color: #4a3729; }
.stop.cover h1 { font-size: clamp(2rem, 5.5vw, 2.9rem); line-height: 1.22; padding-top: 6px; padding-bottom: 12px; }
.stop h2 { font-size: 1.85rem; padding-top: 4px; padding-bottom: 8px; }
.stop p { padding-bottom: 10px; }
.kicker {
  font-family: var(--cute); font-size: .98rem; color: var(--accent) !important;
}
.hint { animation: nudge 1.6s ease-in-out infinite; }
.hint, .note { color: var(--muted) !important; font-size: .93rem; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 16px !important; }
.tags li { font-size: .82rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; background: #fdebd8; color: #a06a45; }
.tags li:nth-child(2) { background: #e3f4ea; color: #3d8a63; }
.tags li:nth-child(3) { background: #e9e3fb; color: #6b5bb0; }
.tags li:nth-child(4) { background: #fde3ea; color: #b45673; }
.go {
  display: block; width: 100%; cursor: pointer; text-align: center; text-decoration: none; font-family: var(--cute); font-size: 1.1rem;
  color: #fff !important; background: var(--accent-2); margin: 4px 0 0; padding: 10px 0 !important;
  border-radius: 999px !important; border: 0 !important; box-shadow: 0 4px 0 #3a9784 !important; transition: transform .1s;
}
.go:active { transform: translateY(3px); box-shadow: 0 1px 0 #3a9784 !important; }
.legend { list-style: none; padding-bottom: 16px !important; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: .97rem; padding: 4px 0; cursor: pointer; }
.legend li::before { content: "🏭"; font-size: 1.05rem; }
.legend li:hover { color: var(--accent); }

.credit {
  position: fixed; right: 8px; bottom: 6px; z-index: 3; font-size: .72rem; color: var(--muted);
  background: var(--panel); padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line);
}
.credit a { color: inherit; }
.maplibregl-ctrl-attrib { display: none; }

/* 지도 위 둥실 핀 */
.pin-wrap { padding-bottom: 10px; }
.bubble {
  position: relative;
  display: flex; align-items: center; gap: 4px; padding: 4px 10px 4px 6px; border-radius: 999px;
  background: #fffaf2; border: 2px solid #f1dfc9; box-shadow: 0 4px 0 #f0d9bf, 0 8px 14px rgba(122, 90, 67, .2);
  font-family: var(--cute); font-size: 14px; color: #5b4636; white-space: nowrap;
  animation: bob 2.6s ease-in-out infinite; transform-origin: bottom center;
}
.bubble .em { font-size: 20px; line-height: 1; }
.bubble::after {   /* 아래 꼬리 */
  content: ""; position: absolute; left: 50%; bottom: -9px; margin-left: -6px;
  border: 6px solid transparent; border-top-color: #f1dfc9;
}
.bubble.project { background: var(--accent); border-color: #ff7a52; color: #fff; box-shadow: 0 4px 0 #e2643f, 0 10px 18px rgba(226, 100, 63, .3); font-size: 16px; }
.bubble.project::after { border-top-color: #ff7a52; }
.bubble.deco { opacity: .96; }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

@media (max-width: 640px) {
  .stop { margin: 0 auto; width: calc(100% - 32px); justify-content: flex-end; padding-bottom: 64px; }
  .stop.cover { justify-content: flex-end; }
  .stop h2 { font-size: 1.55rem; }
  .brand { font-size: 1rem; }
  .credit { left: 8px; text-align: center; border-radius: 12px; }
  .bubble.deco .nm { display: none; }  /* 좁은 화면은 명소 이름 없이 그림만 */
}
@media (prefers-reduced-motion: reduce) {
  .bubble, .hint { animation: none; }
}

/* 처음 지도 불러오는 동안 */
.loading {
  position: fixed; inset: 0; z-index: 1; display: grid; place-items: center; pointer-events: none;
  font-family: var(--cute); font-size: 1.2rem; color: var(--muted); transition: opacity .6s;
}
.loading span { animation: bob 1.4s ease-in-out infinite; display: inline-block; font-size: 2.4rem; }
.loading.done { opacity: 0; }

/* 필지 크게 보기 (큰 지도 + 옆 찾기 칸) */
body.sheet-open { overflow: hidden; }
.sheet {
  position: fixed; inset: 12px; z-index: 10; display: grid; grid-template-columns: 1fr min(380px, 40%);
  background: var(--panel); border: 3px solid var(--line); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow);
}
.sheet[hidden] { display: none; }
.sheet-map { position: relative; min-height: 0; }
.sheet-side { display: flex; flex-direction: column; min-height: 0; border-left: 3px solid var(--line); padding: 16px; gap: 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sheet-head h2 { margin: 0; font-family: var(--cute); font-weight: 400; font-size: 1.5rem; }
.sheet-close {
  width: 44px; height: 44px; border-radius: 999px; border: 2px solid var(--line); background: #fff; font-size: 1.1rem;
  cursor: pointer; color: var(--ink); flex: none;
}
#parcelSearch {
  font: inherit; font-size: 1rem; width: 100%; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line);
  background: #fff; color: var(--ink);
}
#parcelSearch:focus { outline: 3px solid #ffd2bd; border-color: var(--accent); }
.parcel-info h3 { margin: 4px 0 6px; font-family: var(--cute); font-weight: 400; font-size: 1.3rem; }
.parcel-info dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0 0 8px; }
.parcel-info dt { color: var(--muted); font-weight: 600; }
.parcel-info dd { margin: 0; font-weight: 700; }
.parcel-info .ksic-h { margin: 6px 0 2px; font-weight: 700; }
.parcel-info .ksic { margin: 0; padding-left: 18px; }
.parcel-info .muted, .parcel-list .muted { color: var(--muted); font-size: .9rem; }
.parcel-info .empty { background: #fff3e6; border-radius: 16px; padding: 4px 14px; }
.parcel-info code { font-size: .85em; background: #fdebd8; padding: 0 4px; border-radius: 4px; }
.parcel-list { list-style: none; margin: 0; padding: 0; overflow: auto; min-height: 0; flex: 1; }
.parcel-list li { padding: 10px 6px; border-top: 1px solid var(--line); cursor: pointer; display: flex; flex-direction: column; }
.parcel-list li span { color: var(--muted); font-size: .88rem; }
.parcel-list li:hover { background: #fff3e6; }
@media (max-width: 640px) {
  .sheet { inset: 0; border-radius: 0; grid-template-columns: 1fr; grid-template-rows: 45vh 1fr; }
  .sheet-side { border-left: 0; border-top: 3px solid var(--line); }
}

/* ITS */
.speed-legend { list-style: none; display: flex; gap: 10px; flex-wrap: wrap; padding-bottom: 12px !important; }
.speed-legend li { display: flex; align-items: center; gap: 5px; font-size: .9rem; font-weight: 700; }
.speed-legend li::before { content: ""; width: 22px; height: 7px; border-radius: 99px; }
.speed-legend .g::before { background: #5cc98a; } .speed-legend .y::before { background: #ffc95c; }
.speed-legend .r::before { background: #ff6b6b; } .speed-legend .n::before { background: #f3e2cc; border: 1px solid #e5cdb0; }
.gn-its { padding-bottom: 14px !important; max-height: 46vh; overflow: auto; overscroll-behavior: contain; }
@media (max-width: 640px) { .gn-its { max-height: 30vh; } }
.mini-h { font-weight: 800; margin: 6px 0 2px; padding: 0 !important; }
.mini { list-style: none; margin: 0; padding: 0 !important; }
.mini li { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.mini li span { color: var(--muted); white-space: nowrap; }
.bubble.park { background: #e9f6ff; border-color: #bfe0f5; }
.bubble.full { background: #ffe3e3; border-color: #ffbcbc; }

.cute-pop .maplibregl-popup-content { font-family: "Pretendard Variable", sans-serif; border-radius: 14px; border: 2px solid var(--line); color: var(--ink); box-shadow: var(--shadow); }
.bubble.park .nm, .bubble.full .nm { font-size: 15px; }

.legend li { justify-content: flex-start; }
.legend li.on .nm { color: var(--accent); font-weight: 800; }
.mini-go {
  margin-left: auto; font: inherit; font-family: var(--cute); font-size: .95rem; color: #fff; cursor: pointer;
  background: var(--accent-2); border: 0; border-radius: 999px; padding: 4px 12px; box-shadow: 0 3px 0 #3a9784;
  animation: pop .25s ease-out;
}
.mini-go[hidden] { display: none; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.block-card { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 10px 14px; margin: 0 0 10px; }
.block-card h4 { margin: 0 0 4px; font-family: var(--cute); font-weight: 400; font-size: 1.15rem; }
.block-card .ratio { color: var(--muted); font-size: .9rem; margin: 0 0 6px; }
.block-card ul { margin: 0; padding-left: 18px; font-size: .92rem; }

.pop-ksic { margin: 4px 0 0; padding-left: 16px; font-size: .85rem; }

.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.08); }
.zone-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 10px; padding-bottom: 8px !important; font-size: .82rem; color: var(--muted); max-height: 7.5em; overflow: auto; }
.zone-legend li { white-space: nowrap; }

/* 필지 창: 처음엔 지도 크게 + 검색창만. 찾거나 '목록'을 누르면 아래 목록이 펼쳐짐 */
.sheet-search { display: flex; gap: 8px; }
.sheet-search input { flex: 1; min-width: 0; }
.sheet-toggle {
  flex: none; font: inherit; font-family: var(--cute); font-size: 1rem; padding: 0 14px; border-radius: 14px; cursor: pointer;
  border: 2px solid var(--line); background: #fff; color: var(--ink);
}
.sheet-more { display: none; flex-direction: column; gap: 10px; min-height: 0; flex: 1; overflow: auto; }
.sheet.expanded .sheet-more { display: flex; }
.sheet-side { gap: 10px; }
@media (max-width: 640px) {
  .sheet { grid-template-rows: 1fr auto; }
  .sheet.expanded { grid-template-rows: 38vh 1fr; }
  .sheet-side { padding: 12px 14px; }
  .sheet-head h2 { font-size: 1.25rem; }
  .sheet-close { width: 38px; height: 38px; }
}

.block-card ul li { display: list-item; flex-direction: initial; padding: 1px 0; border: 0; cursor: default; }
.block-card ul li:hover { background: none; }

/* 주차장 정보 카드 */
.park-pop .maplibregl-popup-content { padding: 14px 16px; min-width: 220px; }
.pp-name { font-family: var(--cute); font-size: 1.15rem; margin-bottom: 4px; }
.pp-free { font-size: 1rem; color: var(--accent-2); }
.pp-free b { font-size: 1.8rem; font-family: var(--cute); font-weight: 400; }
.pp-free.full { color: #e2564a; }
.pp-bar { height: 8px; border-radius: 99px; background: #e3f4ea; overflow: hidden; margin: 6px 0; }
.pp-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffc95c, #ff6b6b); border-radius: 99px; }
.pp-row { font-size: .88rem; margin-top: 3px; }
.pp-row.muted { color: var(--muted); font-size: .8rem; }
.pp-go { display: inline-block; margin-top: 8px; font-weight: 700; color: var(--accent-2); text-decoration: none; }

/* 시민 소통 신호등 */
.t-blue { color: #3d8bfd; } .t-yellow { color: #e0a800; } .t-red { color: #f0564f; }
.civic { display: grid; gap: 10px; padding-bottom: 14px !important; max-height: 50vh; overflow: auto; overscroll-behavior: contain; }
@media (max-width: 640px) { .civic { max-height: 34vh; } }
.civic-card { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 10px 12px; }
.civic-card h3 { margin: 0; font-family: var(--cute); font-size: 1.15rem; }
.civic-card p { padding: 0 !important; margin: 2px 0; }
.civic-desc { color: var(--muted); font-size: .85rem; }
.civic-body { display: flex; align-items: center; gap: 12px; margin: 8px 0 4px; }
.signal { display: grid; gap: 5px; background: #4a3a2e; border-radius: 14px; padding: 7px 10px; flex: 1; min-width: 0; }
.lamp { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 8px; color: #fff; font-size: .9rem; }
.lamp i { width: 20px; height: 20px; border-radius: 50%; }
.lamp.blue i { background: #3d8bfd; box-shadow: 0 0 10px #3d8bfd; }
.lamp.yellow i { background: #ffc93c; box-shadow: 0 0 10px #ffc93c; }
.lamp.red i { background: #f0564f; box-shadow: 0 0 10px #f0564f; }
.lamp.off i { opacity: .28; box-shadow: none; }
.lamp.off b { color: #cdbcae; font-weight: 600; font-size: .8rem; }
.lamp b { font-size: 1rem; white-space: nowrap; }
.civic-total { text-align: center; line-height: 1.1; }
.civic-total span { display: block; font-size: .8rem; color: var(--muted); }
.civic-total b { display: block; font-family: var(--cute); font-size: 1.8rem; color: var(--accent); }
.civic-total small { display: block; font-size: .72rem; color: var(--muted); margin-top: 3px; }
.civic-extra { font-size: .85rem; }
.civic-extra.muted { color: var(--muted); }
.civic-src { font-size: .75rem; }
.civic-src a { color: var(--muted); }

/* 휴대폰: 카드 접기 (제목·버튼만, 나머지는 '자세히'로) */
.peek { display: none; }
@media (max-width: 640px) {
  .peek { display: block; padding-bottom: 16px !important; }
  .peek button { border: 2px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 700; font-size: .9rem;
    padding: 6px 14px; border-radius: 999px; cursor: pointer; }
  .stop:not(.cover):not(.open) > :not(.kicker):not(h2):not(.go-wrap):not(.peek) { display: none; }
  .stop:not(.cover) > h2 { padding-bottom: 6px; }
  .stop:not(.cover) > .go-wrap { padding-bottom: 6px; }
}
