/* 고전·한지 톤: 미색 바탕, 먹색 글자, 녹우당 녹색 포인트 */
:root {
  --paper: #f4eee2;
  --paper-2: #ebe3d2;
  --card: #fbf8f1;
  --ink: #2a2521;
  --ink-2: #5b524a;
  --line: #d8cdb8;
  --green: #36553b;
  --green-2: #4d7353;
  --red: #8a3b2e;
  --serif: "Nanum Myeongjo", "AppleMyungjo", serif;
  --sans: "Pretendard", -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.7 var(--sans);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
[hidden] { display: none !important; }

.view {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px calc(32px + var(--safe-b));
}

h1, h2 { font-family: var(--serif); font-weight: 800; line-height: 1.35; margin: 0; }
h1 { font-size: 30px; }
h2 { font-size: 19px; margin-bottom: 10px; }

.eyebrow { margin: 0 0 6px; color: var(--green); font-weight: 700; font-size: 14px; letter-spacing: .04em; }
.lead { margin: 10px 0 4px; color: var(--ink-2); }
.meta { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; }

.hero { padding: 28px 4px 20px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 16px 0;
}

.tips { margin: 0 0 14px; padding-left: 20px; }
.tips li { margin-bottom: 4px; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 52px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent;
  font: 700 17px/1 var(--sans); text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:active { background: var(--green-2); }
.btn-ghost { background: transparent; color: var(--green); border-color: var(--green); }
.btn-link { background: none; color: var(--ink-2); text-decoration: underline; min-height: 48px; width: 100%; font-weight: 500; font-size: 15px; }
.btn-block { width: 100%; margin: 8px 0; }
.btn:disabled { opacity: .5; }

.icon-btn {
  min-width: 48px; min-height: 48px;
  background: none; border: 0; color: var(--ink);
  font-size: 22px; cursor: pointer; border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn small { font-size: 10px; display: block; margin-top: -6px; }
.icon-btn:active { background: var(--paper-2); }

.banner {
  background: var(--green); color: #fff;
  border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; font-weight: 600;
}

/* 지점 목록 */
.spot-list { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.spot-list li + li { border-top: 1px solid var(--line); }
.spot-list button {
  display: flex; width: 100%; align-items: center; gap: 12px;
  background: none; border: 0; padding: 12px 2px; text-align: left;
  font: inherit; color: inherit; cursor: pointer; min-height: 56px;
}
.spot-list .num {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid var(--green); color: var(--green); font-weight: 700; font-size: 14px;
}
.spot-list .done .num { background: var(--green); color: #fff; }
.spot-list .current .num { outline: 3px solid rgba(54, 85, 59, .25); }
.spot-list .walk { margin-left: auto; color: var(--ink-2); font-size: 13px; white-space: nowrap; }

/* 플레이어 (상단 고정) */
.player {
  position: sticky; top: 0; z-index: 10;
  margin: -16px -16px 0; padding: 8px 12px 10px;
  background: rgba(244, 238, 226, .96);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.player-top { display: flex; align-items: center; gap: 4px; }
.player-title { flex: 1; min-width: 0; text-align: center; line-height: 1.3; }
.player-title strong { display: block; font-family: var(--serif); font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spot-no { font-size: 12px; color: var(--green); font-weight: 700; }
.speed { font-size: 14px; font-weight: 700; }

.player-ctrl { display: flex; justify-content: center; align-items: center; gap: 24px; margin: 2px 0; }
.play {
  width: 64px; height: 64px; border-radius: 50%; border: 0;
  background: var(--green); color: #fff; font-size: 22px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.play span { display: inline-block; vertical-align: middle; }
.play .ico-play { margin-left: 5px; border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent #fff; }
.play .ico-pause { display: none; width: 18px; height: 22px; border-left: 6px solid #fff; border-right: 6px solid #fff; }
.playing .play .ico-play { display: none; }
.playing .play .ico-pause { display: inline-block; }
.play.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(54, 85, 59, .18); } }

.progress { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.progress input { flex: 1; accent-color: var(--green); height: 28px; }

.tap-hint { text-align: center; color: var(--green); font-weight: 700; margin: 12px 0 0; }

/* 카드뉴스 */
.cards { margin: 16px 0 8px; }
.card-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  gap: 12px; scrollbar-width: none; border-radius: var(--radius);
}
.card-track::-webkit-scrollbar { display: none; }
.card {
  flex: 0 0 100%; scroll-snap-align: center;
  aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden;
  background: var(--card); border: 1px solid var(--line); position: relative;
}
.card img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 이미지가 준비되기 전 대체 카드 */
.card-ph {
  height: 100%; padding: 28px 24px; display: flex; flex-direction: column; justify-content: flex-end;
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,.7), transparent 50%),
    linear-gradient(160deg, var(--paper-2), var(--card));
}
.card-ph .kind { position: absolute; top: 16px; left: 16px; font-size: 12px; font-weight: 700; color: var(--green); border: 1px solid var(--green); border-radius: 999px; padding: 2px 10px; }
.card-ph h3 { font-family: var(--serif); font-size: 26px; line-height: 1.35; margin: 0 0 10px; }
.card-ph p { margin: 0; color: var(--ink-2); }
.card-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }

.ended { background: var(--green); color: #fff; border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.ended p { margin: 0 0 10px; }
.ended .btn { background: #fff; color: var(--green); width: 100%; }

.script summary { font-weight: 700; cursor: pointer; min-height: 32px; }
.script p { margin: 12px 0 0; }
.credits { font-size: 13px; color: var(--ink-2); margin: 8px 4px; }

.spot-nav { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 20px; }

.nearby { list-style: none; margin: 0; padding: 0; }
.nearby li + li { border-top: 1px solid var(--line); }
.nearby a { display: block; padding: 12px 0; color: inherit; text-decoration: none; }
.nearby strong { display: block; }
.nearby span { color: var(--ink-2); font-size: 14px; }

/* 하단 시트 */
.sheet {
  width: 100%; max-width: 480px; margin: auto auto 0; max-height: 80vh;
  border: 0; border-radius: 20px 20px 0 0; padding: 12px 20px calc(16px + var(--safe-b));
  background: var(--card); color: var(--ink);
}
.sheet::backdrop { background: rgba(30, 25, 20, .45); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h2 { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .card-track { scroll-behavior: auto; }
  .play.pulse { animation: none; }
}
