/* ============================================================
   akemi's map 大和郡山さんぽ  スタイル
   紙地図の手作り感(クリーム色の紙・手書き風ロゴ・丸ゴシック)を残しつつ、
   Webアプリとしては大きな文字・大きなボタンで迷わない構成にしています。
   ============================================================ */

:root {
  /* 色: 紙・木・テラコッタ屋根・庭の緑 */
  --paper: #fbf7ef;
  --paper-2: #f4ecdf;
  --paper-3: #ebe1cf;
  --ink: #4b3b30;
  --ink-soft: #79685c;
  --ink-faint: #b8a898;
  --line: #e6dacb;
  --terracotta: #c96f52;
  --terracotta-dark: #ad5a40;
  --terracotta-soft: #f6e3da;
  --sage: #7c9a6d;
  --sage-dark: #5f7f52;
  --sage-soft: #e6eddf;
  --gold: #d9b45f;
  --blush: #f2d9cf;
  --sky: #5b8fc9;
  --white: #fffdf9;

  --shadow-sm: 0 1px 2px rgba(75, 59, 48, .08), 0 2px 8px rgba(75, 59, 48, .06);
  --shadow-md: 0 4px 14px rgba(75, 59, 48, .14);
  --shadow-lg: 0 12px 32px rgba(75, 59, 48, .22);

  --radius: 16px;
  --radius-sm: 10px;
  --tabbar-h: 64px;
  --header-h: 56px;

  --font-body: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-script: "Caveat", "Segoe Script", cursive;

  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

/* ---------- 全体レイアウト ---------- */
.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 720px;          /* 小さな旅のしおりとして読める幅 */
  margin: 0 auto;
  background: var(--paper);
  position: relative;
  overflow: hidden;
}

.demo-banner {
  background: #fff4c2;
  color: #6b5400;
  font-size: 13px;
  text-align: center;
  padding: 6px 12px;
  border-bottom: 1px solid #f0dd8a;
}

/* ---------- ヘッダー ---------- */
.app-header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: calc(var(--header-h) + var(--safe-top));
  padding: var(--safe-top) 16px 0;
  background: var(--paper);
  z-index: 5;
}
.brand { display: flex; align-items: baseline; gap: 10px; line-height: 1; }
.brand-script {
  font-family: var(--font-script);
  font-size: 30px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .5px;
}
.brand-script.big { font-size: 44px; }
.brand-sub { font-size: 14px; font-weight: 700; letter-spacing: .12em; color: var(--ink-soft); }

.progress-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-height: 40px;
  padding: 4px 14px;
  border: 2px solid var(--terracotta);
  border-radius: 999px;
  background: var(--white);
  color: var(--terracotta-dark);
  font-weight: 700;
  transition: transform .15s;
}
.progress-chip:active { transform: scale(.96); }
.progress-count { font-size: 22px; }
.progress-total { font-size: 14px; color: var(--ink-soft); }

.progress-track {
  height: 6px;
  background: var(--paper-3);
  position: relative;
  z-index: 5;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sage), var(--terracotta));
  border-radius: 0 4px 4px 0;
  transition: width .6s cubic-bezier(.2, .8, .3, 1);
}

/* ---------- ビュー ---------- */
.views { flex: 1; min-height: 0; position: relative; z-index: 1; } /* Leafletのz-indexを閉じ込める */
.view { position: absolute; inset: 0; overflow: hidden; }
.view-map, .view-list, .view-reward { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.view-inner { padding: 26px 22px 36px; }
.view-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.view-lead { color: var(--ink-soft); font-size: 15px; margin-bottom: 18px; }

/* ---------- 地図 ---------- */
.map { position: absolute; inset: 0; background: var(--paper-2); }
/* 地図タイルを紙のような風合いに */
.leaflet-tile-pane { filter: sepia(.14) saturate(.78); }
.leaflet-container { font-family: var(--font-body); }
.leaflet-control-attribution { font-size: 10px; background: rgba(251, 247, 239, .8) !important; color: var(--ink-soft); }
.leaflet-control-attribution a { color: var(--ink-soft); }
.leaflet-control-zoom { display: none; }   /* ピンチ操作で十分。画面を広く使う */
.leaflet-div-icon { background: none; border: none; }

/* スポットの番号マーカー */
.marker {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--terracotta);
  color: var(--terracotta-dark);
  font-weight: 700;
  font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform .2s;
  position: relative;
}
.marker.is-visited {
  background: var(--sage);
  border-color: var(--sage-dark);
  color: #fff;
}
.marker.is-visited::after {
  content: "";
  position: absolute; inset: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5 10 17l9-10' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.marker.is-visited .marker-num { display: none; }
.marker.is-next {
  background: var(--terracotta);
  border-color: var(--white);
  color: #fff;
  transform: scale(1.15);
  z-index: 10;
}
.marker.is-next::before {
  content: "";
  position: absolute; inset: -8px;
  border-radius: 50%;
  border: 3px solid var(--terracotta);
  opacity: 0;
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  0%   { transform: scale(.7); opacity: .8; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* サンプーペー(ゴール)のピン */
.marker-home {
  display: flex; flex-direction: column; align-items: center;
  width: 110px; margin-left: -37px; margin-top: -8px;
}
.marker-home svg { width: 36px; height: 44px; filter: drop-shadow(0 3px 4px rgba(75,59,48,.35)); }
.marker-home-label {
  margin-top: -2px;
  background: var(--white);
  border: 1.5px solid var(--terracotta);
  color: var(--terracotta-dark);
  font-size: 12px; font-weight: 700;
  padding: 1px 8px; border-radius: 999px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

/* 現在地 */
.user-dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--sky);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px rgba(91,143,201,.35), var(--shadow-sm);
}

/* 「次はここ」カード */
.next-card {
  position: absolute; top: 12px; left: 12px; right: 12px;
  z-index: 400;
}
.next-card-inner {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 253, 249, .96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  text-align: left;
}
.next-card-inner:active { background: var(--paper-2); }
.next-badge {
  flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--terracotta); color: #fff;
  font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.next-card.is-complete .next-badge { background: var(--sage); }
.next-text { flex: 1; min-width: 0; line-height: 1.3; display: flex; flex-direction: column; }
.next-label { font-size: 12px; color: var(--ink-soft); font-weight: 700; letter-spacing: .08em; }
.next-name { font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-dist { font-size: 13px; color: var(--terracotta-dark); font-weight: 700; }
.next-arrow { flex: none; color: var(--ink-faint); font-size: 22px; }

.locate-btn {
  position: absolute; right: 14px;
  bottom: calc(16px + var(--tabbar-h) + var(--safe-bottom));
  z-index: 400;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--white); border: 1px solid var(--line);
  color: var(--ink-soft);
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
}
.locate-btn.is-active { color: var(--sky); }
.locate-btn:active { transform: scale(.95); }

.geo-notice {
  position: absolute; left: 12px; right: 12px;
  bottom: calc(16px + var(--tabbar-h) + var(--safe-bottom));
  z-index: 400;
  padding: 12px 14px;
  padding-right: 80px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  font-size: 14px; line-height: 1.5;
}
.geo-notice b { color: var(--terracotta-dark); }
.geo-notice .btn { margin-top: 8px; }

/* ---------- さんぽリスト ---------- */
.spot-list { display: flex; flex-direction: column; gap: 12px; }
.spot-card {
  display: flex; gap: 12px; align-items: stretch;
  width: 100%; padding: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: transform .12s, box-shadow .12s;
}
.spot-card:active { transform: scale(.985); }
.spot-card.is-visited { background: linear-gradient(180deg, #fff, var(--sage-soft)); }
.spot-card.is-next { border-color: var(--terracotta); box-shadow: 0 0 0 3px var(--terracotta-soft), var(--shadow-sm); }

.thumb {
  flex: none;
  width: 84px; height: 84px;
  border-radius: 12px; overflow: hidden;
  background: var(--paper-2);
  position: relative;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
}
.thumb-fallback[data-category="cafe"] { background: #f3e2d3; }
.thumb-fallback[data-category="shop"] { background: #e9e6d6; }
.thumb-fallback[data-category="sightseeing"] { background: #e2e9de; }

.spot-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.spot-head { display: flex; align-items: center; gap: 8px; }
.spot-num {
  flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--terracotta); color: var(--terracotta-dark);
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  background: var(--white);
}
.is-visited .spot-num { background: var(--sage); border-color: var(--sage); color: #fff; }
.spot-name { font-size: 18px; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spot-catch { font-size: 13px; color: var(--ink-soft); line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.spot-meta { display: flex; align-items: center; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.status-pill {
  font-size: 12px; font-weight: 700;
  padding: 2px 10px; border-radius: 999px;
}
.status-pill.is-visited { background: var(--sage); color: #fff; }
.status-pill.is-next { background: var(--terracotta); color: #fff; }
.status-pill.is-todo { background: var(--paper-2); color: var(--ink-soft); }
.spot-dist { font-size: 13px; color: var(--ink-soft); }

.goal-card {
  margin-top: 8px;
  padding: 16px;
  background: var(--terracotta-soft);
  border: 1px dashed var(--terracotta);
  border-radius: var(--radius);
  display: flex; gap: 12px; align-items: center;
  width: 100%; text-align: left;
}
.goal-card .goal-icon { font-size: 30px; flex: none; }
.goal-card .goal-title { font-weight: 700; font-size: 17px; }
.goal-card .goal-sub { font-size: 13px; color: var(--ink-soft); }

/* ---------- タブバー ---------- */
.tabbar {
  flex: none;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--white);
  border-top: 1px solid var(--line);
  z-index: 500;
  position: relative;
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  background: none; border: none;
  color: var(--ink-soft);
  font-size: 12px; font-weight: 700;
  position: relative;
}
.tab svg { width: 26px; height: 26px; }
.tab.is-active { color: var(--terracotta-dark); }
.tab-badge {
  position: absolute; top: 8px; left: calc(50% + 8px);
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  background: var(--terracotta); color: #fff;
  font-size: 11px; line-height: 18px;
}

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-size: 17px; font-weight: 700;
  line-height: 1.3;
  transition: transform .12s, background .15s, opacity .15s;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn-block { width: 100%; }
.btn-primary { background: var(--terracotta-dark); color: #fff; box-shadow: 0 4px 12px rgba(201,111,82,.2); }
.btn-primary:active { background: var(--terracotta-dark); }
.btn-secondary { background: var(--white); border-color: var(--terracotta); color: var(--terracotta-dark); }
.btn-success { background: var(--sage-dark); color: #fff; }
.btn-ghost { background: none; color: var(--ink-soft); min-height: 44px; font-size: 15px; }
.btn:disabled { background: var(--paper-3); color: var(--ink-faint); box-shadow: none; cursor: default; transform: none; }
.btn-small { min-height: 40px; font-size: 14px; padding: 6px 14px; }

/* ---------- スポット詳細シート ---------- */
.sheet { position: absolute; inset: 0; z-index: 900; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(75,59,48,.35); animation: fade .2s; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 92%;
  background: var(--paper);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: slideUp .28s cubic-bezier(.2,.8,.3,1);
}
.sheet-handle { width: 44px; height: 5px; border-radius: 3px; background: var(--ink-faint); margin: 10px auto 4px; flex: none; opacity: .6; }
.sheet-content { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(20px + var(--safe-bottom)); }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sheet-hero { margin: 8px 16px 0; border-radius: var(--radius); overflow: hidden; height: 190px; background: var(--paper-2); position: relative; }
.sheet-hero img { width: 100%; height: 100%; object-fit: cover; }
.sheet-hero .thumb-fallback { font-size: 56px; }
.sheet-hero .spot-num { position: absolute; top: 10px; left: 10px; width: 36px; height: 36px; font-size: 17px; }

.sheet-body { padding: 14px 20px 0; }
.sheet-title { font-size: 24px; font-weight: 700; line-height: 1.3; }
.sheet-sub { font-size: 14px; color: var(--ink-soft); margin-top: 2px; }
.cat-chip { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--ink-soft); background: var(--paper-2); padding: 2px 10px; border-radius: 999px; }
.sheet-catch { margin-top: 12px; font-weight: 700; color: var(--terracotta-dark); }
.sheet-desc { margin-top: 6px; font-size: 15px; color: var(--ink); }

.info-list { margin: 16px 0 0; padding: 0; list-style: none; border-top: 1px dashed var(--line); }
.info-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.info-label { flex: none; width: 72px; color: var(--ink-soft); font-weight: 700; }
.info-value { flex: 1; }

.sheet-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.visit-hint { text-align: center; font-size: 14px; color: var(--ink-soft); margin-top: -2px; }
.visit-hint b { color: var(--terracotta-dark); }
.visited-box {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--sage-soft); border: 1px solid #cddcc4; border-radius: var(--radius);
  color: var(--sage-dark); font-weight: 700;
}
.visited-box small { display: block; font-weight: 400; color: var(--ink-soft); font-size: 13px; }
.visited-box .check {
  flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--sage); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.sheet-close { margin: 14px 20px 0; width: calc(100% - 40px); }

/* ---------- 訪問完了スタンプ演出 ---------- */
.stamp-overlay {
  position: absolute; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(251,247,239,.82);
  animation: fade .2s;
}
.stamp {
  width: 170px; height: 170px; border-radius: 50%;
  border: 6px double var(--terracotta);
  color: var(--terracotta);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transform: rotate(-12deg);
  animation: stampIn .5s cubic-bezier(.2,1.4,.4,1);
  background: rgba(255,253,249,.7);
}
.stamp-num { font-size: 54px; font-weight: 700; line-height: 1; }
.stamp-text { font-size: 15px; font-weight: 700; letter-spacing: .2em; margin-top: 4px; }
.stamp-caption { margin-top: 22px; font-size: 22px; font-weight: 700; color: var(--ink); animation: fade .6s; }
.stamp-caption small { display: block; text-align: center; font-size: 14px; color: var(--ink-soft); font-weight: 400; }
@keyframes stampIn {
  0% { transform: rotate(-12deg) scale(2.2); opacity: 0; }
  60% { transform: rotate(-12deg) scale(.95); opacity: 1; }
  100% { transform: rotate(-12deg) scale(1); opacity: 1; }
}

/* ---------- 初回説明モーダル ---------- */
.modal { position: absolute; inset: 0; z-index: 950; background: rgba(75,59,48,.35); display: flex; align-items: flex-end; animation: fade .25s; }
.modal-panel {
  width: 100%; max-height: 94%; overflow-y: auto;
  background: var(--paper);
  border-radius: 24px 24px 0 0;
  padding: 28px 24px calc(24px + var(--safe-bottom));
  box-shadow: var(--shadow-lg);
  animation: slideUp .3s cubic-bezier(.2,.8,.3,1);
}
.modal-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .2em; color: var(--terracotta-dark); }
.modal-title { font-size: 22px; font-weight: 700; line-height: 1.25; margin-top: 4px; }
.modal-lead { margin-top: 12px; color: var(--ink-soft); font-size: 15px; }
.how-list { list-style: none; margin: 18px 0 22px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.how-list li { display: flex; align-items: center; gap: 14px; font-size: 16px; line-height: 1.4; }
.how-list b { color: var(--terracotta-dark); }
.how-num {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  background: var(--terracotta); color: #fff; font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.modal-note { margin-top: 12px; font-size: 12px; color: var(--ink-soft); line-height: 1.5; }

/* ---------- ごほうび(特典) ---------- */
.reward-hero { text-align: center; padding: 8px 0 4px; }
.reward-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .2em; color: var(--terracotta-dark); }
.reward-title { font-size: 26px; font-weight: 700; line-height: 1.3; margin-top: 4px; }
.reward-title .brand-script { font-size: 38px; }
.reward-lead { margin-top: 8px; color: var(--ink-soft); font-size: 15px; }
.reward-count { font-size: 44px; font-weight: 700; color: var(--terracotta-dark); line-height: 1; margin-top: 8px; }
.reward-count small { font-size: 16px; color: var(--ink-soft); margin-left: 4px; }

.stamp-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin: 18px 0;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stamp-cell {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px dashed var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--ink-faint);
  background: none;
  padding: 0;
}
.stamp-cell .n { font-size: 22px; font-weight: 700; line-height: 1; }
.stamp-cell .t { font-size: 10px; line-height: 1.2; margin-top: 4px; max-width: 90%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.stamp-cell.is-visited {
  border: 4px double var(--terracotta);
  color: var(--terracotta);
  background: var(--terracotta-soft);
  transform: rotate(-8deg);
}
.stamp-cell.is-visited .t { color: var(--terracotta-dark); }

.ticket {
  position: relative;
  margin: 18px 0;
  padding: 22px 20px;
  background: var(--white);
  border: 2px solid var(--terracotta);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.ticket::before, .ticket::after {
  content: ""; position: absolute; top: 50%; width: 22px; height: 22px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--terracotta); transform: translateY(-50%);
}
.ticket::before { left: -13px; }
.ticket::after { right: -13px; }
.ticket-eyebrow { font-size: 12px; letter-spacing: .25em; color: var(--ink-soft); font-weight: 700; }
.ticket-title { font-size: 24px; font-weight: 700; color: var(--terracotta-dark); margin-top: 6px; }
.ticket-desc { font-size: 14px; color: var(--ink-soft); margin-top: 8px; }
.ticket-status { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 15px; }
.ticket-code { font-size: 28px; font-weight: 700; letter-spacing: .3em; color: var(--ink); margin-top: 4px; }
.ticket.is-used { border-color: var(--ink-faint); background: var(--paper-2); }
.ticket.is-used .ticket-title { color: var(--ink-soft); }
.used-stamp {
  position: absolute; right: 14px; top: 14px;
  padding: 4px 10px; border: 3px double var(--sage-dark); color: var(--sage-dark);
  font-weight: 700; font-size: 13px; letter-spacing: .15em; transform: rotate(10deg); border-radius: 6px;
}

.staff-box {
  margin-top: 8px;
  padding: 16px;
  background: var(--paper-2);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.staff-box h3 { font-size: 15px; font-weight: 700; color: var(--ink-soft); margin-bottom: 8px; letter-spacing: .05em; }
.staff-box p { font-size: 14px; color: var(--ink-soft); margin-bottom: 12px; }

.reward-rule { margin-top: 18px; font-size: 13px; color: var(--ink-soft); line-height: 1.6; }
.reward-rule li { margin-bottom: 2px; }
.reward-links { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.btn-line { background: #06c755; color: #fff; }
.reset-link { display: block; margin: 28px auto 0; }

/* 紙吹雪 */
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.confetti i {
  position: absolute; top: -12px;
  width: 9px; height: 14px; border-radius: 2px;
  opacity: .9;
  animation: fall linear forwards;
}
@keyframes fall {
  0%   { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ---------- トースト ---------- */
.toast {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 20px);
  z-index: 1100;
  background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 700;
  box-shadow: var(--shadow-lg);
  max-width: 90%; text-align: center;
  animation: fade .2s;
}

/* ---------- P1: 旅のしおりの構図 × Fableの肌触り ---------- */
.header-actions { display: flex; gap: 12px; align-items: center; }
.help-btn { border: 0; background: none; color: var(--ink-soft); font-size: 13px; min-height: 44px; padding: 6px; text-decoration: underline; text-underline-offset: 4px; }
.progress-chip { min-height: 44px; border-width: 1px; padding: 3px 12px; }
.brand-sub { font-size: 12px; letter-spacing: .06em; }
.app-header { border-bottom: 1px solid var(--line); padding-inline: 22px; }
.map-page { padding: 24px 22px 26px; }
.page-eyebrow { color: var(--sage-dark); font-size: 11px; font-weight: 700; letter-spacing: .16em; margin-bottom: 6px; }
.sanpo-intro h1 { font-size: clamp(26px, 4.6vw, 34px); letter-spacing: .04em; line-height: 1.4; }
.sanpo-intro h1 span { display: inline-block; }
.intro-note { font-size: 13px; color: var(--ink-soft); margin-top: 5px; }
.month-card { margin: 20px 0 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); padding: 14px 18px 10px; box-shadow: 0 2px 5px #4b3b3005; }
.month-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.month-heading h2 { font-size: 17px; }
.month-heading button { min-height: 44px; border: 0; background: none; color: var(--terracotta-dark); font-size: 12px; padding: 0; }
.month-card .progress-track { height: 5px; border-radius: 10px; overflow: hidden; margin: 4px 0 8px; }
.month-card .progress-fill { background: var(--sage); border-radius: 10px; }
.month-encouragement { font-size: 12px; color: var(--ink-soft); }
.progress-stops { display: grid; grid-template-columns: repeat(9, 1fr); margin: 7px -7px 0; }
.progress-stop { position: relative; min-width: 0; min-height: 44px; border: 0; background: none; font-size: 13px; color: var(--sage-dark); font-weight: 700; z-index: 0; }
.progress-stop::before { content: ""; position: absolute; width: 27px; height: 27px; border: 1px solid #b7c4ad; background: var(--white); border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: -1; }
.progress-stop.is-visited { color: var(--white); }
.progress-stop.is-visited::before { background: var(--sage-dark); border-color: var(--sage-dark); }
.progress-stop span { position: absolute; right: 0; bottom: 0; font-size: 10px; color: var(--sage-dark); }
.map-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.map-heading h2 { font-size: 17px; }
.map-heading > span { font-size: 11px; color: var(--ink-soft); }
.map-frame { position: relative; height: clamp(330px, 46dvh, 440px); border: 1px solid #d8d9c9; border-radius: 20px; overflow: hidden; isolation: isolate; background: var(--paper-2); }
.map-area-label { position: absolute; z-index: 400; left: 12px; top: 12px; background: #fffdf9ee; border: 1px solid var(--line); padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; pointer-events: none; }
.map-controls { position: absolute; top: 12px; right: 12px; z-index: 400; display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; box-shadow: var(--shadow-sm); }
.map-controls button { width: 44px; min-height: 44px; border: 0; background: none; font-size: 22px; }
.map-controls button + button { border-top: 1px solid var(--line); }
.map-controls #map-fit-all { font-size: 12px; font-weight: 700; }
.map-legend { position: absolute; z-index: 400; bottom: 26px; left: 10px; display: flex; align-items: center; gap: 9px; border-radius: 999px; background: #fffdf9f2; padding: 7px 10px; font-size: 10px; pointer-events: none; }
.map-legend span { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.map-legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-flex; justify-content: center; align-items: center; font-style: normal; font-size: 9px; line-height: 1; }
.legend-todo { border: 1px solid var(--sage-dark); }
.legend-visited { background: var(--sage-dark); color: #fff; }
.legend-home { background: var(--terracotta-dark); color: #fff; }
.locate-btn { right: 10px; bottom: 26px; width: auto; height: 44px; border-radius: 999px; padding: 0 12px; gap: 6px; box-shadow: var(--shadow-sm); font-size: 12px; font-weight: 700; }
.locate-btn svg { width: 18px; height: 18px; }
.map-selection { font-size: 11px; color: var(--terracotta-dark); padding: 9px 2px; min-height: 34px; }
.map-pin-note { font-size: 10px; color: var(--ink-soft); margin: -5px 2px 12px; }
.geo-notice { position: static; padding: 12px 14px; box-shadow: none; font-size: 13px; margin-bottom: 12px; }
.next-card { position: static; }
.next-card-inner { box-shadow: none; padding: 14px; border-color: #d6dccb; background: #f1f4eb; }
.next-label { color: var(--sage-dark); font-size: 11px; margin-bottom: 3px; }
.next-name { font-size: 17px; }
.next-badge { background: var(--sage-dark); width: 38px; height: 38px; }
.next-dist { font-size: 12px; font-weight: 500; margin-top: 4px; }
.browse-spots { margin-top: 14px; width: 100%; min-height: 48px; display: flex; justify-content: space-between; align-items: center; background: none; border: 0; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 700; padding: 8px 2px; }
.walking-note { text-align: center; font-size: 12px; color: var(--ink-soft); margin-top: 18px; }

/* ピンの先端は座標を指す。番号は訪問後も残し、選択中だけパルス。 */
.pin-tether { position: absolute; overflow: visible; pointer-events: none; }
.pin-tether path { stroke: var(--sage-dark); stroke-width: 1.5px; stroke-dasharray: 3 2; }
.pin-tether circle { fill: var(--sage-dark); stroke: var(--white); stroke-width: 1px; }
.pin-position { position: absolute; inset: 0; }
.marker { width: 36px; height: 36px; border: 2px solid var(--sage-dark); border-radius: 50% 50% 50% 4px; color: var(--sage-dark); transform: rotate(-45deg); box-shadow: 0 3px 6px #4b3b3028; }
.marker .marker-num { transform: rotate(45deg); display: block; }
.marker.is-next { background: var(--white); border-color: var(--sage-dark); color: var(--sage-dark); transform: rotate(-45deg); }
.marker.is-next::before, .marker.is-visited::after { content: none; }
.marker.is-visited { background: var(--sage-dark); }
.marker.is-visited .marker-num { display: block; }
.marker.is-selected { background: var(--terracotta-dark); border-color: var(--white); color: var(--white); transform: rotate(-45deg) scale(1.08); }
.marker.is-selected::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--terracotta); animation: pulse 1.8s ease-out infinite; }
.marker-check { position: absolute; top: -5px; right: -8px; width: 17px; height: 17px; font-size: 10px; border-radius: 50%; background: var(--white); border: 1px solid var(--sage-dark); color: var(--sage-dark); transform: rotate(45deg); display: grid; place-items: center; }
.marker-home { margin-top: 0; position: relative; }
.marker-home.is-selected::before { content: ""; position: absolute; top: 0; left: 36px; width: 36px; height: 36px; border: 2px solid var(--terracotta); border-radius: 50%; animation: pulse 1.8s ease-out infinite; }
.marker-home-label { font-size: 10px; padding: 1px 6px; }

/* 写真・番号・カテゴリを揃えた、小さな旅のしおり */
.guide-note { border-block: 1px dashed var(--line); padding: 12px 0; font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; }
.spot-list { gap: 0; }
.guide-row { display: flex; align-items: center; gap: 14px; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 15px 0; text-align: left; border-radius: 0; transition: background .15s; }
.guide-row:hover, .guide-row:focus-visible { background: var(--white); }
.guide-row .thumb { width: 94px; height: 80px; border-radius: 12px; }
.paper-photo { display: block; width: 100%; height: 100%; }
.guide-copy { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 4px; }
.guide-kicker { font-size: 10px; color: var(--ink-soft); display: flex; align-items: center; gap: 5px; }
.guide-kicker b { font-size: 14px; letter-spacing: .05em; color: var(--terracotta-dark); }
.guide-check { color: var(--sage-dark); margin-left: auto; font-weight: 700; }
.guide-row .spot-name { font-size: 17px; white-space: normal; overflow: visible; line-height: 1.4; }
.guide-row .spot-catch { font-size: 12px; line-height: 1.55; }
.guide-row .spot-meta { margin-top: 1px; min-height: 18px; }
.guide-row .status-pill { padding: 1px 7px; font-size: 10px; background: var(--sage-soft); color: var(--sage-dark); }
.guide-row .status-pill.is-next { background: var(--terracotta-soft); color: var(--terracotta-dark); }
.guide-row .spot-dist { font-size: 10px; }
.guide-arrow { color: var(--ink-soft); font-size: 19px; }
.goal-card { margin-top: 20px; }
.photo-note { font-size: 11px; color: var(--ink-soft); margin-top: 16px; }

/* 9つの思い出が1枚に収まる台紙 */
.passport { position: relative; background: var(--white); padding: 24px 24px 18px 30px; border: 1px solid var(--line); border-radius: 8px 20px 20px 8px; box-shadow: 3px 4px 0 var(--paper-2), 0 6px 18px #4b3b3008; }
.passport::before { content: ""; position: absolute; left: 11px; top: 0; bottom: 0; border-left: 1px solid var(--line); }
.passport-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 16px; border-bottom: 1px dashed var(--line); }
.passport-eyebrow { font-size: 11px; color: var(--sage-dark); letter-spacing: .12em; }
.passport-heading h2 { font-size: 22px; margin-top: 4px; }
.passport-count { font-size: 32px; font-weight: 700; color: var(--terracotta-dark); white-space: nowrap; }
.passport-count small { font-size: 13px; color: var(--ink-soft); margin-left: 4px; }
.passport .stamp-grid { background: none; border: 0; box-shadow: none; border-radius: 0; margin: 20px 0; padding: 0; gap: 16px; }
.stamp-cell { position: relative; color: var(--ink-soft); border: 1px dashed #cdbdaa; min-width: 0; padding: 8px 3px; box-shadow: inset 0 0 0 5px var(--white), inset 0 0 0 6px var(--paper-2); }
.stamp-cell .n { font-family: var(--font-script); font-size: 30px; }
.stamp-cell .t { white-space: normal; font-size: 12px; line-height: 1.4; max-width: 96%; }
.stamp-cell.is-visited { color: var(--terracotta-dark); border: 4px double var(--terracotta); box-shadow: none; }
.stamp-check { position: absolute; right: 6px; top: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--terracotta-dark); color: var(--white); font-size: 12px; display: grid; place-items: center; }
.passport-note { padding-top: 14px; border-top: 1px dashed var(--line); font-size: 11px; color: var(--ink-soft); text-align: center; }
.reward-hero { padding: 18px 0 4px; }
.reward-history-note { margin-top: 10px; font-size: 13px; color: var(--sage-dark); }
.reward-section-title { font-size: 22px; font-weight: 500; margin: 32px 0 12px; text-align: center; letter-spacing: .03em; }
.ticket { border: 1px solid #d8b89f; border-radius: 20px; box-shadow: 0 6px 20px #4b3b3008; padding: 30px 24px 0; background: linear-gradient(150deg, var(--white), #faf0e3); margin: 14px 0 22px; }
.ticket::before, .ticket::after { top: auto; bottom: 48px; border-width: 1px; border-color: #d8b89f; transform: none; }
.ticket-mark { display: grid; place-items: center; width: 68px; height: 68px; border: 1px solid #d8b89f; border-radius: 50%; margin: 0 auto 16px; font-size: 30px; background: var(--paper); }
.ticket-eyebrow { font-size: 10px; letter-spacing: .15em; }
.ticket-title { font-size: clamp(19px, 3.7vw, 25px); font-weight: 500; margin-top: 10px; }
.ticket-desc { font-size: 12px; line-height: 1.8; }
.ticket-pending { display: inline-block; font-size: 11px; background: var(--terracotta-soft); color: var(--terracotta-dark); padding: 4px 12px; border-radius: 999px; margin-top: 14px; }
.ticket-status { margin: 24px -24px 0; padding: 18px 22px; font-size: 12px; border-top: 1px dashed #d8b89f; background: #fffdf960; }
.ticket-code { font-size: 24px; }
.reward-rule { list-style: none; padding: 0; font-size: 12px; }
.onboarding-reassurance { padding: 14px; margin: 0 0 18px; background: var(--sage-soft); border-radius: 14px; font-size: 13px; }
.onboarding-reassurance b { color: var(--sage-dark); }
.onboarding-reassurance p { margin-top: 4px; }
.stamp-caption { padding: 0 20px; text-align: center; }

@media (min-width: 600px) {
  .map-page, .view-inner { padding-inline: 32px; }
  .spot-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .guide-row { align-items: flex-start; gap: 12px; }
  .guide-row .thumb { width: 82px; height: 86px; }
  .guide-row .spot-name { font-size: 16px; }
  .guide-arrow { display: none; }
  .goal-card { grid-column: 1 / -1; }
  .passport { padding-inline: 40px; }
  .passport .stamp-grid { gap: 18px 26px; }
  .stamp-cell { max-width: 136px; width: 100%; justify-self: center; }
}
@media (max-width: 420px) {
  .app-header { padding-inline: 16px; }
  .brand { display: block; }
  .brand-script { font-size: 27px; }
  .brand-sub { display: block; font-size: 10px; margin-top: 3px; }
  .header-actions { gap: 8px; }
  .map-page, .view-inner { padding: 20px 16px 28px; }
  .month-card { padding: 10px 14px 6px; margin-block: 16px; }
  .map-heading { display: block; }
  .map-heading > span { display: block; margin-top: 2px; }
  .map-legend { gap: 6px; padding: 7px 8px; font-size: 9px; }
  .locate-btn { padding-inline: 9px; font-size: 11px; }
  .guide-row { gap: 12px; padding-block: 13px; }
  .guide-row .thumb { width: 80px; height: 78px; }
  .passport { padding: 20px 14px 16px 24px; }
  .passport-heading h2 { font-size: 19px; }
  .passport-count { font-size: 28px; }
  .passport .stamp-grid { gap: 13px 9px; }
  .stamp-cell .n { font-size: 27px; }
  .stamp-cell .t { font-size: 10px; }
  .passport-note { font-size: 10px; }
}

/* ---------- アクセシビリティ ---------- */
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
