/* ============================================================
 * サピログ - スタイル
 * テーマ：オレンジ × レッド / モバイルファースト
 * ============================================================ */

:root {
  /* テーマ色＝SAPICA基調のローズ/ピンク（旧オレンジから変更。変数名は互換のため据え置き） */
  --orange: #e85377;
  --orange-dark: #c93b5e;
  --orange-light: #f4869f;
  --red: #e60012;
  --cream: #fdf6ec;
  --brown: #5a3e1b;
  --text: #3a2c16;
  --gray: #8a8073;
  --line: #f0e4d2;
  --green: #2e9e5b;
  --white: #fff;
  --shadow: 0 2px 10px rgba(90, 62, 27, .12);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #efe6d8;
  color: var(--text);
  font-family: "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "Yu Gothic UI", "Meiryo", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--cream);
  box-shadow: 0 0 24px rgba(0,0,0,.15);
}

button { font-family: inherit; cursor: pointer; }
a { color: var(--orange-dark); }
[hidden] { display: none !important; }

/* ---------------- スプラッシュ / 登録 ---------------- */
.screen-splash {
  display: block;
  min-height: 100dvh;
  padding-bottom: 32px;
  background:
    radial-gradient(circle at 80% -10%, #ffd9a3 0%, transparent 45%),
    linear-gradient(160deg, var(--orange) 0%, #f59b2d 55%, var(--orange-dark) 100%);
}

.splash-hero { text-align: center; padding: 48px 16px 24px; color: var(--white); }
.splash-logo svg { filter: drop-shadow(0 4px 10px rgba(0,0,0,.2)); }
.splash-title {
  margin: 12px 0 0;
  font-size: 32px;
  line-height: 1.25;
  letter-spacing: .08em;
  text-shadow: 0 2px 0 rgba(0,0,0,.12);
}
.splash-year {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 18px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: .2em;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.splash-sub { margin: 14px 0 0; font-size: 14px; opacity: .95; line-height: 1.7; }

.splash-card { margin: 8px 16px 0; }
.splash-note { font-size: 11px; color: var(--gray); line-height: 1.6; margin: 12px 0 0; }

/* 旧URLの常設移行バナー（起動時モーダルを閉じても導線を残す） */
.domain-migration-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  background: #163f36;
  color: #fff;
  border-bottom: 3px solid #f4c95d;
}
.domain-migration-banner-copy { flex: 1; min-width: 0; line-height: 1.35; }
.domain-migration-banner-copy strong { display: block; font-size: 13px; }
.domain-migration-banner-copy span { display: block; margin-top: 2px; font-size: 11px; }
.domain-migration-banner-action {
  flex: none;
  min-width: 78px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #fff;
  border-radius: 8px;
  background: #fff;
  color: #163f36;
  font-weight: 700;
  font-size: 13px;
}

/* 引き継ぎ導線（スプラッシュの「以前のデータをお持ちの方」）と起動モード別の注意書き */
.transfer-lead { font-size: 12px; color: var(--gray); line-height: 1.7; margin: 0 0 12px; }
.transfer-note { font-size: 12px; line-height: 1.7; color: var(--text); background: #fff6df; border-left: 3px solid #e0a63c; border-radius: 8px; padding: 9px 11px; margin: 0 0 12px; }
.new-domain-transfer-note {
  margin: 0 0 12px;
  padding: 10px 11px;
  border-left: 3px solid #2477c9;
  border-radius: 8px;
  background: #eef6ff;
  color: var(--text);
  font-size: 12px;
  line-height: 1.7;
}

/* 引き継ぎコード（スプラッシュの区切り・表示モーダル・マイページの行） */
.transfer-or { text-align: center; color: var(--gray); font-size: 11px; margin: 12px 0; }
#input-transfer-code { text-transform: uppercase; letter-spacing: 1px; }
.transfer-modal-lead { font-size: 13px; line-height: 1.8; margin: 0 0 12px; }
.transfer-code-big {
  font-size: 26px; font-weight: 700; letter-spacing: 3px; text-align: center;
  font-variant-numeric: tabular-nums; user-select: all; -webkit-user-select: all;
  background: var(--cream); border: 2px dashed var(--orange); border-radius: 12px;
  padding: 14px 8px; margin: 0 0 12px; color: var(--text);
}
.transfer-mypage { margin: 12px 0; }
.transfer-mypage-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; margin: 0 0 8px; }
.transfer-mypage-row code { font-weight: 700; font-size: 13px; }
.transfer-mypage .btn-row { display: flex; gap: 8px; }
.transfer-mypage .btn-row .btn { flex: 1; padding-left: 4px; padding-right: 4px; white-space: nowrap; }
.domain-migration-message { margin: 0 0 14px; color: var(--text); font-size: 13px; line-height: 1.75; }
.domain-migration-step { display: block; margin: 0 0 6px; color: var(--gray); font-size: 12px; font-weight: 700; }
.domain-migration-code-wrap .transfer-code-big { margin-bottom: 10px; }
.domain-migration-actions { display: grid; gap: 8px; }
.domain-migration-actions .btn { margin: 0; text-decoration: none; }
.domain-migration-modal .setting-note { margin-top: 12px; line-height: 1.65; }

/* ---------------- カード共通 ---------------- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
  margin: 0 0 14px;
}
.card-title { margin: 0 0 12px; font-size: 15px; color: var(--brown); }

/* ---------------- フォーム ---------------- */
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--brown); }
.field-label em {
  font-style: normal; font-size: 10px; color: #fff; background: var(--red);
  border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px;
}
.field-label small { font-size: 10px; color: var(--gray); margin-left: 6px; }
.field input, .field select, .code-input, .search-box {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
  color: var(--text);
}
.field input:focus, .field select:focus, .code-input:focus, .search-box:focus {
  outline: none;
  border-color: var(--orange);
}
.check-row { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin: 4px 0 16px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--orange); flex: none; margin-top: 1px; }

/* ---------------- ボタン ---------------- */
.btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 700;
  transition: transform .08s, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.btn-primary {
  background: linear-gradient(180deg, var(--orange) 0%, var(--orange-dark) 100%);
  color: #fff;
  box-shadow: 0 3px 0 #b85e00;
}
.btn-primary:active { box-shadow: 0 1px 0 #b85e00; }
.btn-outline {
  background: #fff;
  color: var(--orange-dark);
  border: 2px solid var(--orange);
}
.btn-ghost { background: #fff4e3; color: var(--orange-dark); }
.btn-danger { background: #fdeaea; color: #c0392b; }
.btn-big { width: 100%; padding: 16px; font-size: 16px; }
.btn-big small { font-weight: 400; font-size: 11px; opacity: .85; }
.btn-big-icon { font-size: 24px; }
.btn[disabled] { filter: grayscale(.8) opacity(.6); cursor: not-allowed; }

/* ---------------- ヘッダー ---------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1050;
  background: linear-gradient(180deg, var(--orange) 0%, var(--orange-dark) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
}
.header-logo { display: flex; }
/* ロゴのマーク（カード＋波）を選択中コースの色に追従させる（白丸は#fffのまま） */
.header-logo svg { color: var(--orange); transition: color .25s ease; }
.header-title { font-size: 14px; font-weight: 700; letter-spacing: .03em; flex: 1; }
.header-title strong { color: #ffe9c9; }
.header-count-pill {
  background: var(--red);
  border-radius: 15px;
  padding: 4px 12px 5px;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.15);
  display: flex; flex-direction: column; align-items: center;
  gap: 2px;
  line-height: 1.2;
}
.header-count { font-weight: 700; font-size: 16px; }
.header-count-total { font-size: 10px; font-weight: 700; opacity: .95; }
.header-count-total small { font-size: 9px; opacity: .9; }
/* ヘッダーの年度ピル（表示中の年度を切替） */
.year-pill {
  flex: none; appearance: none; -webkit-appearance: none;
  background: rgba(255,255,255,.18); color: #fff;
  border: 1.5px solid rgba(255,255,255,.55); border-radius: 999px;
  font-size: 11px; font-weight: 800; font-family: inherit;
  padding: 3px 22px 3px 10px; margin-right: 6px; cursor: pointer;
  /* ▾アイコンを内蔵 */
  background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: right 9px center, right 5px center;
  background-size: 4px 4px, 4px 4px; background-repeat: no-repeat;
}
.year-pill option { color: #222; }
.header-count small { font-size: 11px; opacity: .9; }

/* ---------------- メイン / 画面 ---------------- */
.main { padding: 16px 14px calc(86px + env(safe-area-inset-bottom)); }
/* 非表示制御はメイン内の画面のみに適用（スプラッシュ画面は対象外） */
.main .screen { display: none; animation: fadeIn .22s ease; }
.main .screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

.greeting { margin: 2px 4px 12px; font-size: 14px; color: var(--brown); font-weight: 700; }
.section-title { margin: 22px 4px 10px; font-size: 15px; color: var(--brown); }
.page-title { margin: 4px 4px 8px; font-size: 19px; color: var(--brown); }
.page-lead { margin: 0 4px 14px; font-size: 12px; color: var(--gray); line-height: 1.6; }

/* ---------------- ホーム：進捗カード ---------------- */
.progress-card { text-align: center; }
.progress-rank {
  display: inline-block;
  background: #fff4e3;
  color: var(--orange-dark);
  font-weight: 700;
  font-size: 13px;
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: 8px;
}
.progress-num { font-size: 14px; color: var(--gray); }
.progress-num b { font-size: 44px; color: var(--red); font-family: "Arial Black", sans-serif; margin-right: 4px; }
.progress-bar {
  height: 14px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 6px 8px;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange-light), var(--orange) 60%, var(--red));
  transition: width .6s cubic-bezier(.22,1,.36,1);
}
.progress-next { margin: 0; font-size: 12px; color: var(--gray); }

.action-grid { display: grid; gap: 10px; margin-bottom: 14px; }

/* ---------------- 次のおすすめ拠点（最寄りの未取得） ---------------- */
.nx { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 13px 14px; border: 1.5px solid var(--orange-light); margin-bottom: 14px; }
.nx.done { border-color: var(--green); }
.nx-head { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--orange-dark); margin-bottom: 8px; }
.nx-head-done { color: var(--green); }
.nx-body { display: flex; align-items: center; gap: 12px; }
.nx-ic { flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--cream); border: 2px solid var(--orange-light); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.nx.done .nx-ic { border-color: var(--green); }
.nx-main { flex: 1; min-width: 0; }
.nx-name { font-size: 15px; font-weight: 800; color: var(--brown); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-meta { font-size: 12px; color: var(--gray); margin-top: 2px; }
.nx-dist { color: var(--orange-dark); font-weight: 800; }
.nx-hint { font-size: 13px; color: var(--gray); line-height: 1.5; }
.nx-done-msg { font-size: 14px; font-weight: 800; color: var(--green); }
.nx-done-sub { font-size: 12px; color: var(--gray); margin-top: 2px; }
.nx-actions { display: flex; gap: 8px; margin-top: 11px; }
.nx-btn { flex: 1; border: 1.5px solid var(--orange); background: #fff; color: var(--orange-dark); border-radius: 10px; padding: 9px; font-weight: 800; font-size: 13px; cursor: pointer; }
.nx-btn.primary { background: var(--orange); color: #fff; border-color: var(--orange); }
.nx-actions #nearest-locate { flex: none; padding: 9px 16px; }

/* ---------------- バナー ---------------- */
.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(120deg, #fff0d8, #ffe2b8);
  border: 2px solid var(--orange-light);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.banner-icon { font-size: 28px; }
.banner-text { flex: 1; font-size: 14px; color: var(--brown); }
.banner-text small { color: var(--gray); font-size: 11px; }
.banner-arrow { font-size: 26px; color: var(--orange-dark); }

/* ---------------- 最近のスタンプ ---------------- */
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  font-size: 13px;
}
.recent-empty { color: var(--gray); text-align: center; line-height: 1.7; justify-content: center; }
.recent-stamp-mini { flex: none; }
.recent-name { flex: 1; font-weight: 700; }
.recent-date { color: var(--gray); font-size: 11px; }

/* ---------------- 店舗一覧 ---------------- */
.store-tools { margin-bottom: 10px; display: grid; gap: 8px; }
.area-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.area-tab {
  flex: none;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--gray);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
}
.area-tab.active { background: var(--orange); border-color: var(--orange); color: #fff; }

.store-list { list-style: none; margin: 0; padding: 0; }
.store-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.store-item:active { background: #fff8ee; }
.store-stamp-state { flex: none; width: 40px; height: 40px; }
.store-stamp-state .empty-slot {
  width: 40px; height: 40px;
  border: 2px dashed #d9c9ae;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #c9b692;
  font-size: 11px; font-weight: 700;
}
.store-info { flex: 1; min-width: 0; }
.store-name { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-meta { font-size: 11px; color: var(--gray); margin-top: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.badge-area { background: #fff4e3; color: var(--orange-dark); border-radius: 4px; padding: 1px 6px; font-weight: 700; }
.badge-hotchef { background: #fdeaea; color: var(--red); border-radius: 4px; padding: 1px 6px; font-weight: 700; }
.badge-done { background: var(--green); color: #fff; border-radius: 4px; padding: 1px 6px; font-weight: 700; }
.badge-pt { background: #fff3cf; color: #b07b00; border-radius: 4px; padding: 1px 6px; font-weight: 700; }
.badge-closed { background: #e9e5de; color: #7d7468; border-radius: 4px; padding: 1px 6px; font-weight: 700; }
.store-dist { flex: none; font-size: 12px; color: var(--gray); font-weight: 700; }
.store-list-empty { text-align: center; color: var(--gray); padding: 32px 0; font-size: 13px; }

/* ---------------- マップ ---------------- */
.screen-map { position: relative; }
/* ---------------- ルート作成 ---------------- */
.store-tool-btns { display: flex; gap: 8px; flex-wrap: wrap; }
#btn-route-mode.active, #btn-filter-todo.active { background: var(--orange); color: #fff; }
.map-route-btn.active { background: var(--orange); }
.map-track-btn.active { background: #e85377; }
/* マップのコースバー先頭「全コース」ボタン（未選択時は白＋オレンジ文字で区別、選択時はcourse-btn.activeで橙） */
.course-all-btn:not(.active) { background: #fff; color: var(--orange-dark); border-color: var(--orange-light); }

/* ===== 移動の軌跡モード ===== */
/* 淡色（デフォルメ）ベース＝地図を muted に */
.screen-map.map-track #map .leaflet-tile-pane { filter: grayscale(.9) brightness(1.12) contrast(.85) sepia(.14); }
/* 軌跡モード中は通常UIを隠してすっきり見せる */
.screen-map.map-track .map-course-bar,
.screen-map.map-track .map-area-select,
.screen-map.map-track .map-legend,
.screen-map.map-track .map-checkin-btn { display: none; }
/* 軌跡の拠点ピン */
.ckse { width: 20px; height: 20px; border-radius: 50%; background: #e85377; border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 800; }
.ckdot { width: 12px; height: 12px; border-radius: 50%; background: #e85377; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
/* 軌跡サマリー（マップ下のオーバーレイカード） */
.map-track-summary {
  position: absolute; left: 12px; right: 12px; bottom: 14px; z-index: 1000;
  background: rgba(253,246,236,.96); border-radius: 15px; padding: 12px 15px;
  box-shadow: 0 3px 14px rgba(0,0,0,.22);
}
.track-close { position: absolute; top: 8px; right: 10px; width: 26px; height: 26px; border: none; border-radius: 50%; background: var(--line); color: var(--brown); font-size: 14px; font-weight: 700; cursor: pointer; }
.track-title { font-size: 13px; font-weight: 800; color: #9e2c49; }
.track-km { font-size: 32px; font-weight: 900; color: #e85377; font-family: "Arial Black", sans-serif; line-height: 1.05; }
.track-km i { font-size: 15px; font-style: normal; margin-left: 2px; color: #9e2c49; }
.track-stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 3px; }
.track-stats span { font-size: 11px; color: #7a6a55; }
.track-stats b { font-size: 14px; color: #5a3e2b; font-weight: 800; }
/* ルート選択中のピン（マップ） */
.secoma-pin.selected {
  box-shadow: 0 0 0 4px rgba(240,131,0,.85), 0 1px 5px rgba(0,0,0,.4);
  transform: scale(1.25);
}
.store-item.route-pick { cursor: pointer; }
.store-item.route-selected { outline: 2px solid var(--orange); background: var(--cream); }
.route-check {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--orange); color: var(--orange);
  font-weight: 800; font-size: 18px;
}
.store-item.route-selected .route-check { background: var(--orange); color: #fff; }
.route-bar {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(60px + env(safe-area-inset-bottom));
  width: min(100%, 460px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 -2px 14px rgba(90,62,27,.18);
  padding: 10px 12px;
  z-index: 1061;
}
.route-bar-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.route-roundtrip { font-size: 12px; color: var(--text); display: flex; align-items: center; gap: 4px; margin-left: auto; }
.route-roundtrip input { width: 16px; height: 16px; accent-color: var(--orange); }
.route-bar-clear { margin-left: 8px; }
.route-bar-exit { background: var(--line); border: none; border-radius: 8px; padding: 4px 10px; font-size: 12px; font-weight: 700; color: var(--brown); }
.route-bar-info { font-size: 13px; color: var(--text); }
.route-bar-info b { font-size: 18px; color: var(--red); margin-right: 2px; }
.route-bar-clear { background: none; border: none; color: var(--gray); font-size: 12px; text-decoration: underline; }
.route-bar-modes { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.route-bar-label { font-size: 12px; color: var(--gray); }
.route-bar-modes .btn { flex: 1; min-width: 64px; }

#map {
  height: calc(100dvh - 220px);
  min-height: 320px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: #e8e0d2;
  /* Leaflet内部のz-index(最大1000)をこのコンテキスト内に閉じ込め、
     モーダル・スタンプ演出・ヘッダー等より手前に出ないようにする */
  position: relative;
  z-index: 0;
  isolation: isolate;
}
.map-unavailable {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--gray); font-size: 13px; text-align: center; line-height: 1.8;
}
.map-legend {
  display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center;
  margin-top: 10px; font-size: 12px; color: var(--gray);
}
/* マップ画面：現在地でチェックイン（地図下部中央のフロートボタン） */
.map-checkin-btn {
  position: absolute;
  left: 50%;
  bottom: 54px;
  transform: translateX(-50%);
  z-index: 1000;
  width: auto;
  padding: 12px 22px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .32);
}
.map-checkin-btn:active { transform: translateX(-50%) scale(.97); }
.map-checkin-btn:disabled { opacity: .65; }
/* マップ：エリア絞り込み（地図右上のオーバーレイ） */
.map-area-select {
  position: absolute;
  top: 60px; right: 8px;
  z-index: 1000;
  max-width: 52%;
  background: rgba(253, 246, 236, .96);
  color: var(--brown);
  border: 2px solid var(--orange);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px; font-weight: 700; font-family: inherit;
  box-shadow: var(--shadow);
}
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.dot-orange { background: var(--orange); }
.dot-green { background: var(--green); }
.secoma-pin {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 1px 5px rgba(0,0,0,.4);
}
.secoma-pin.done { background: var(--green); }
.secoma-pin.todo { background: var(--orange); }
/* 行きつけ（常連ランク）＝ピン自体を常連アイコン（🍀/⭐/🏮）のステッカー風に。
   丸枠なし・白フチ影＋落ち影で地図から浮き立たせる（主🏮は金の後光） */
.secoma-pin.done.loyal-pin {
  width: 30px; height: 30px;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; line-height: 1; letter-spacing: 0; text-align: center;
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff) drop-shadow(0 2px 3px rgba(0, 0, 0, .35));
}
.secoma-pin.done.loyal-pin.loyal-3 {
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 5px rgba(255, 196, 32, .95)) drop-shadow(0 2px 3px rgba(0, 0, 0, .35));
}
/* ルート選択中の選択リングは絵文字の周りに丸く出す */
.secoma-pin.loyal-pin.selected { border-radius: 50%; }

/* クラスタ（取得済み/全店で色分け・中央に「済/全」） */
.secoma-cluster {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.4);
  line-height: 1;
}
.secoma-cluster b { font-size: 15px; font-weight: 800; }
.secoma-cluster span { font-size: 10px; opacity: .9; }
.secoma-cluster.todo { background: var(--orange); }
.secoma-cluster.done { background: var(--green); }
.secoma-cluster.partial { background: linear-gradient(135deg, var(--green) 0 50%, var(--orange) 50% 100%); }

/* 現在地：青ドット＋パルス、精度円、現在地ボタン */
.user-location-dot {
  position: relative;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #1a73e8;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px rgba(26,115,232,.4), 0 1px 4px rgba(0,0,0,.4);
}
.user-location-dot::after {
  content: ""; position: absolute; inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(26,115,232,.5);
  animation: user-pulse 1.8s ease-out infinite;
}
@keyframes user-pulse {
  0% { transform: scale(1); opacity: .7; }
  100% { transform: scale(2.6); opacity: 0; }
}
.user-accuracy { stroke: #1a73e8; stroke-opacity: .4; fill: #1a73e8; fill-opacity: .12; }
.map-locate-btn {
  width: 34px; height: 34px;
  background: var(--white);
  border: none;
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 17px; line-height: 1;
  cursor: pointer;
}
.map-locate-btn:active { transform: scale(.94); }

.leaflet-popup-content { font-family: inherit; }
.map-popup-name { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.map-popup-btn {
  display: inline-block; margin-top: 6px;
  background: var(--orange); color: #fff; border: none;
  border-radius: 8px; padding: 6px 12px; font-size: 12px; font-weight: 700;
}

/* ---------------- ランキング ---------------- */
.ranking-updated { font-size: 11px; color: var(--gray); margin-left: 6px; }
/* ランキングの見出し＋年度セレクタ */
.ranking-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ranking-head .page-title { margin-bottom: 0; }
.ranking-year-select {
  flex: none; appearance: none; -webkit-appearance: none;
  background: var(--cream); color: var(--brown);
  border: 2px solid var(--orange); border-radius: 999px;
  font-size: 12px; font-weight: 800; font-family: inherit;
  padding: 5px 26px 5px 12px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--orange-dark) 50%), linear-gradient(135deg, var(--orange-dark) 50%, transparent 50%);
  background-position: right 11px center, right 7px center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
/* ランキングのコース/総合タブ（横スクロール）*/
.ranking-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; -webkit-overflow-scrolling: touch; }
.rank-tab {
  flex: none; white-space: nowrap;
  background: var(--white); border: 2px solid var(--line);
  border-radius: 999px; padding: 6px 12px;
  font-size: 12px; font-weight: 700; color: var(--gray); cursor: pointer;
}
.rank-tab.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.ranking-list { list-style: none; margin: 12px 0 0; padding: 0; }
.ranking-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px; margin-bottom: 8px;
}
.ranking-row.ranking-me { outline: 2px solid var(--orange); background: var(--cream); }
.ranking-rank {
  flex: none; width: 34px; text-align: center;
  font-size: 18px; font-weight: 800; color: var(--orange-dark);
}
.ranking-name {
  flex: 1; min-width: 0;
  font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ranking-count { flex: none; font-size: 13px; color: var(--gray); text-align: right; }
.ranking-count b { font-size: 20px; color: var(--red); font-family: "Arial Black", sans-serif; }
.ranking-pt { display: block; font-style: normal; font-size: 11px; color: var(--orange-dark); }
.ranking-row { cursor: pointer; transition: transform .08s ease, box-shadow .12s ease; }
.ranking-row:hover { box-shadow: 0 3px 12px rgba(40,25,5,.16); }
.ranking-row:active { transform: scale(.99); }
.ranking-go { flex: none; font-size: 13px; color: var(--orange); font-weight: 800; letter-spacing: -1px; }
.area-title-count { font-size: 12px; color: var(--orange-dark); font-weight: 700; margin-left: 6px; }
/* コース切替（目立たせる） */
.course-switch-card { margin-bottom: 14px; padding: 12px; }
/* スプラッシュ引き継ぎカードの折りたたみトグル（v111） */
.transfer-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: none; padding: 2px 0; cursor: pointer;
  font: inherit; text-align: left; color: var(--brown);
}
.transfer-toggle .card-title { margin: 0; flex: 1; }
.transfer-toggle-icon { font-size: 18px; }
.transfer-caret { font-size: 15px; font-weight: 800; color: var(--orange-dark); }
.transfer-card-body { margin-top: 12px; }
.course-switch-title { font-size: 13px; font-weight: 800; color: var(--brown); margin-bottom: 10px; }
.course-switch { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.course-total-line {
  margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line);
  font-size: 12px; font-weight: 800; color: var(--brown); text-align: center;
}
.course-total-line b { font-size: 15px; }
.course-total-line small { font-weight: 700; opacity: .75; }
.course-btn {
  background: var(--cream); border: 2px solid var(--line);
  border-radius: 12px; padding: 12px 10px;
  font-size: 13px; font-weight: 800; color: var(--brown);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: transform .08s;
}
.course-btn:active { transform: scale(.96); }
.course-btn.active {
  background: var(--orange); border-color: var(--orange-dark); color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
/* 奇数個の最後を全幅に */
.course-switch .course-btn:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* 店舗・マップのコース選択バー（横スクロールのピル） */
.course-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;            /* Firefox：横スクロールバーを隠す */
  margin-bottom: 10px;
  padding-bottom: 2px;
}
/* Chrome/Safari/Edge：横スクロールバーを隠す（PCの常時表示スクロールバーがバー高を押し広げてエリア選択と重なるのを防ぐ。スクロール自体は可能） */
.course-bar::-webkit-scrollbar { display: none; }
.course-bar .course-btn {
  flex: none;
  padding: 7px 13px;
  font-size: 12px;
  border-radius: 999px;
}
/* マップ画面：地図上にオーバーレイ表示 */
.map-course-bar {
  position: absolute;
  top: 8px; left: 8px; right: 8px;
  z-index: 1000;
  margin-bottom: 0;
  padding: 5px;
  background: rgba(253, 246, 236, .94);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
/* 地図の操作ボタン（ズーム/ルート/現在地）をコースバーの下へずらす */
.screen-map .leaflet-top { top: 60px; }
.ranking-empty {
  text-align: center; color: var(--gray); font-size: 13px; line-height: 1.8;
  padding: 32px 12px;
}

/* ---------------- スタンプ帳 ---------------- */
.book-head { display: flex; align-items: center; justify-content: space-between; }
.book-head-count { font-size: 15px; color: var(--gray); }
.book-head-count b { font-size: 32px; color: var(--red); font-family: "Arial Black", sans-serif; }
.book-head-rank { font-size: 13px; font-weight: 700; color: var(--orange-dark); }

.book-area-title {
  margin: 18px 4px 10px;
  font-size: 14px;
  color: var(--brown);
  display: flex; align-items: center; gap: 8px;
}
.book-area-title::after { content: ""; flex: 1; height: 2px; background: var(--line); border-radius: 2px; }
.book-area-count { font-size: 11px; color: var(--gray); font-weight: 400; }

.stamp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stamp-slot {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
}
.stamp-slot-circle {
  width: 76px; height: 76px;
  margin: 0 auto 6px;
  display: flex; align-items: center; justify-content: center;
}
.stamp-slot-circle .empty-slot {
  width: 70px; height: 70px;
  border: 2px dashed #d9c9ae;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #c9b692;
  font-size: 16px; font-weight: 700;
}
.stamp-slot-name {
  font-size: 10px;
  color: var(--gray);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stamp-slot.done .stamp-slot-name { color: var(--brown); font-weight: 700; }

/* ---------------- 賞品 ---------------- */
.prize-list { list-style: none; margin: 0; padding: 0; }
.prize-item {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.prize-icon { font-size: 32px; flex: none; }
.prize-info { flex: 1; min-width: 0; }
.prize-name { font-size: 14px; font-weight: 700; }
.prize-desc { font-size: 11px; color: var(--gray); margin-top: 2px; }
.prize-progress { font-size: 11px; color: var(--orange-dark); font-weight: 700; margin-top: 4px; }
.prize-item .btn { flex: none; }
.prize-item.locked { opacity: .75; }
.prize-item.current { outline: 2px solid var(--orange); background: var(--cream); }
.prize-applied {
  flex: none;
  background: var(--orange); color: #fff;
  border-radius: 8px; padding: 8px 12px;
  font-size: 12px; font-weight: 700;
  white-space: nowrap;
}
.prize-applied.done { background: var(--green); }

/* ---------------- 称号：目標別ダッシュボード ---------------- */
.title-dashboard { display: grid; gap: 10px; margin: 0 0 16px; }
.title-goal-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.title-goal-summary span {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 9px 6px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(90, 62, 27, .06);
}
.title-goal-summary b {
  display: block;
  color: var(--orange-dark);
  font-size: 22px;
  line-height: 1;
  font-family: "Arial Black", sans-serif;
}
.title-goal-summary small {
  display: block;
  margin-top: 4px;
  color: var(--gray);
  font-size: 10px;
  font-weight: 800;
}
.title-goal-group {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(90, 62, 27, .06);
}
.title-goal-group h3 {
  margin: 0 0 9px;
  font-size: 14px;
  color: var(--brown);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.title-goal-group h3 small {
  color: var(--orange-dark);
  background: var(--cream);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
}
.title-goal-list { display: grid; gap: 8px; }
.title-goal-card {
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fffdf8;
}
.title-goal-card.near { border-color: rgba(46, 158, 91, .34); background: #f2fbf5; }
.title-goal-card.done { border-color: rgba(240, 131, 0, .34); background: #fff8e9; }
.title-goal-card.long { border-color: rgba(142, 68, 173, .22); background: #faf7fc; }
.title-goal-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}
.title-goal-ic {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: #fff;
  border: 1.5px solid var(--line);
  font-size: 20px;
}
.title-goal-main { min-width: 0; display: flex; flex-direction: column; }
.title-goal-main b {
  font-size: 13px;
  color: var(--brown);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.title-goal-main small {
  margin-top: 2px;
  color: var(--gray);
  font-size: 10px;
  line-height: 1.35;
}
.title-goal-tag {
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}
.title-goal-card.done .title-goal-tag { background: var(--orange); }
.title-goal-card.long .title-goal-tag { background: #8e44ad; }
.title-goal-bar {
  height: 8px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}
.title-goal-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width .5s cubic-bezier(.22,1,.36,1);
}
.title-goal-card.done .title-goal-bar i { background: var(--orange); }
.title-goal-card.long .title-goal-bar i { background: #8e44ad; }
.title-goal-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  color: var(--gray);
  font-size: 10px;
  font-weight: 800;
}
.title-goal-empty {
  margin: 0;
  color: var(--gray);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  padding: 6px;
}

/* ---------------- マイページ ---------------- */
.mypage-profile { display: flex; align-items: center; gap: 12px; }
.mypage-avatar {
  width: 52px; height: 52px; flex: none;
  background: linear-gradient(180deg, var(--orange), var(--orange-dark));
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
}
.mypage-name-wrap { flex: 1; min-width: 0; }
.mypage-name { font-size: 17px; font-weight: 700; }
.mypage-meta { font-size: 11px; color: var(--gray); margin-top: 2px; }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
/* 奇数個のとき最後の箱を全幅に（5箱レイアウト対策） */
.stats-grid .stat-box:last-child:nth-child(odd) { grid-column: 1 / -1; }
.stat-box { background: #fff8ee; border-radius: 10px; padding: 10px; text-align: center; }
.stat-box b { display: block; font-size: 22px; color: var(--orange-dark); }
.stat-box span { font-size: 11px; color: var(--gray); }

/* コース横断コンプリート・ダッシュボード（マイページ） */
.complete-total { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.complete-total-lbl { font-size: 12px; color: var(--gray); }
.complete-total-num { font-size: 30px; line-height: 1; color: var(--orange-dark); font-family: "Arial Black", sans-serif; }
.complete-total-num i { font-size: 16px; font-style: normal; margin-left: 1px; }
.complete-total-sub { font-size: 11px; color: var(--gray); margin-left: auto; }
.complete-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.complete-row { display: flex; align-items: center; gap: 10px; }
.complete-ic { flex: none; width: 22px; text-align: center; font-size: 17px; }
.complete-info { flex: 1; min-width: 0; }
.complete-name { display: block; font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.complete-clear { font-style: normal; font-size: 11px; color: var(--orange-dark); font-weight: 800; }
.complete-bar { display: block; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.complete-bar i { display: block; height: 100%; border-radius: 999px; transition: width .5s cubic-bezier(.22,1,.36,1); }
.complete-pct { flex: none; width: 62px; text-align: right; }
.complete-pct b { font-size: 15px; color: var(--text); font-family: "Arial Black", sans-serif; }
.complete-pct small { display: block; font-size: 10px; color: var(--gray); }
.complete-meta { display: grid; gap: 7px; }
.cbadge { display: flex; align-items: center; gap: 10px; background: #fff8ee; border: 1.5px solid var(--line); border-radius: 11px; padding: 8px 11px; opacity: .62; }
.cbadge-on { opacity: 1; border-color: var(--orange); background: var(--cream); }
.cbadge-ic { flex: none; font-size: 19px; }
.cbadge-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cbadge-tx b { font-size: 12px; color: var(--brown); line-height: 1.3; }
.cbadge-tx small { font-size: 10px; color: var(--gray); }
.cbadge-state { flex: none; font-size: 14px; }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; font-size: 14px; font-weight: 700; color: var(--brown);
  padding: 4px 0 14px;
}
.toggle-row small { font-weight: 400; color: var(--gray); font-size: 11px; }
.toggle { width: 46px; height: 26px; accent-color: var(--orange); }
.card .btn-block { margin-top: 8px; }
.setting-note { font-size: 11px; color: var(--gray); line-height: 1.6; margin: 8px 2px 0; }
.about-card p { font-size: 12px; color: var(--gray); line-height: 1.7; margin: 0 0 8px; }
.attribution { font-size: 10px; opacity: .8; }

/* ---------------- 下部ナビ ---------------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 480px);
  z-index: 1060;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(90,62,27,.1);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 0 10px;
  font-size: 10px;
  font-weight: 700;
  color: var(--gray);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.nav-item .nav-icon { font-size: 20px; filter: grayscale(1) opacity(.6); }
.nav-item.active { color: var(--orange-dark); }
.nav-item.active .nav-icon { filter: none; }

/* ---------------- モーダル ---------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  /* Leaflet内部のz-index(最大1000)より必ず手前に出す */
  z-index: 1100;
  background: rgba(40, 25, 5, .55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn .18s ease;
}
.modal {
  position: relative;
  width: min(100%, 480px);
  max-height: 86dvh;
  overflow-y: auto;
  background: var(--cream);
  border-radius: 20px 20px 0 0;
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  animation: slideUp .25s cubic-bezier(.22,1,.36,1);
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close {
  position: absolute;
  top: 10px; right: 12px;
  width: 34px; height: 34px;
  border: none; border-radius: 50%;
  background: var(--line);
  color: var(--brown);
  font-size: 18px; font-weight: 700;
}
.modal-title { margin: 0 24px 10px 0; font-size: 17px; color: var(--brown); }
.modal-lead { font-size: 12px; color: var(--gray); margin: 0 0 12px; line-height: 1.6; }
.code-input { text-align: center; font-size: 22px; letter-spacing: .15em; font-weight: 700; }
.code-error { color: var(--red); font-size: 12px; font-weight: 700; margin: 8px 0 0; }
#btn-code-submit { margin-top: 12px; }
.terms-body { font-size: 12px; line-height: 1.8; color: var(--text); }
.terms-body p { margin: 0 0 12px; }

/* 店舗詳細モーダル */
.detail-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; padding-right: 24px; }
.detail-stamp { flex: none; }
.detail-name { font-size: 16px; font-weight: 700; color: var(--brown); }
.detail-city { font-size: 12px; color: var(--gray); margin-top: 2px; }
.detail-badges { margin: 4px 0 12px; display: flex; gap: 6px; flex-wrap: wrap; font-size: 11px; }
.detail-row {
  display: flex; justify-content: space-between;
  font-size: 13px; padding: 8px 2px;
  border-bottom: 1px dashed var(--line);
}
.detail-row span:first-child { color: var(--gray); }
.detail-actions { display: grid; gap: 8px; margin-top: 14px; }
.detail-democode {
  margin-top: 10px;
  background: #fff4e3;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--orange-dark);
  text-align: center;
}
.detail-democode b { font-size: 15px; letter-spacing: .1em; }

/* ライバルの称号カード */
.rival-head { display: flex; align-items: center; gap: 12px; margin: 2px 24px 14px 0; }
.rival-avatar {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  background: var(--orange); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800;
}
.rival-id { display: flex; flex-direction: column; min-width: 0; }
/* ひとこと（v117）: 一覧=1行省略・称号カード=全文・マイページ=タップで編集 */
.ranking-id-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ranking-id-col .ranking-name { flex: none; }
.ranking-tagline {
  font-size: 11px; font-weight: 600; color: var(--orange-dark);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rival-tagline { display: block; font-size: 12px; color: var(--brown); font-weight: 700; margin-top: 2px; }
.mypage-tagline { font-size: 12px; font-weight: 700; color: var(--orange-dark); cursor: pointer; margin: 1px 0 2px; }
.mypage-tagline.is-placeholder { color: var(--gray, #a08e75); font-weight: 600; }
.rival-rank { font-size: 12px; font-weight: 800; color: var(--orange-dark); }
.rival-name { font-size: 19px; color: var(--brown); overflow: hidden; text-overflow: ellipsis; }
.rival-you {
  font-size: 11px; font-weight: 700; color: #fff; background: var(--orange);
  border-radius: 999px; padding: 1px 8px; margin-left: 4px; vertical-align: middle;
}
.rival-region { font-size: 12px; color: var(--gray); margin-top: 2px; }
.rival-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.rival-section { margin: 0 0 8px; font-size: 14px; color: var(--brown); }
.rival-titles { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rival-title {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 12px; box-shadow: var(--shadow);
  padding: 10px 12px;
}
.rival-title--top { outline: 2px solid var(--orange); background: var(--cream); }
.rival-title-badge { flex: none; font-size: 26px; width: 34px; text-align: center; }
.rival-title-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rival-title-main b { font-size: 15px; color: var(--brown); }
.rival-title-main small { font-size: 11px; color: var(--gray); margin-top: 1px; }
.rival-title-tag {
  flex: none; font-size: 10px; font-weight: 800; color: #fff; background: var(--orange);
  border-radius: 999px; padding: 2px 8px;
}
.rival-title--none { display: block; text-align: center; color: var(--gray); font-size: 13px; line-height: 1.7; }
.rival-section-n { font-size: 12px; font-weight: 800; color: #fff; background: var(--orange); border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
.rival-master-course { margin-bottom: 10px; }
.rival-master-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--brown); margin-bottom: 5px; }
.rival-master-head em { font-style: normal; font-size: 11px; color: #fff; background: var(--orange); border-radius: 999px; padding: 1px 8px; }
.rival-master-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.rival-master-chip { font-size: 11px; font-weight: 700; color: var(--orange-dark); background: var(--cream); border: 1.5px solid var(--orange-light); border-radius: 999px; padding: 3px 9px; }
.rival-master-none { margin: 0; font-size: 12px; color: var(--gray); }
.rival-gm-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.rival-gm-chip { font-size: 11px; font-weight: 800; color: var(--orange-dark); background: var(--cream); border: 1.5px solid var(--orange-light); border-radius: 999px; padding: 3px 9px; }
.rival-gm-chip.gm-king { color: #fff; background: var(--orange); border-color: var(--orange); }
.rival-gm-chip.gm-emp { color: #fff; background: var(--orange-dark); border-color: var(--orange-dark); }
.rival-last { margin: 12px 0 0; font-size: 11px; color: var(--gray); text-align: right; }

/* ---------------- スタンプ取得演出 ---------------- */
.stamp-overlay {
  position: fixed;
  inset: 0;
  /* Leaflet内部のz-index(最大1000)より必ず手前に出す */
  z-index: 1200;
  background: rgba(40, 25, 5, .7);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stamp-overlay-inner {
  width: min(92vw, 430px);
  max-height: min(88dvh, 760px);
  overflow-y: auto;
  text-align: center;
  background: var(--cream);
  border-radius: 20px;
  padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
  margin: 0 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,.4);
  animation: popIn .3s cubic-bezier(.22,1.4,.36,1);
}
@keyframes popIn { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.stamp-get-label {
  font-size: 22px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: .12em;
  margin-bottom: 10px;
}
.stamp-get-svg { animation: stampHit .45s cubic-bezier(.34,1.56,.64,1) .15s backwards; }
@keyframes stampHit { from { transform: scale(2.4) rotate(-18deg); opacity: 0; } to { transform: none; opacity: 1; } }
.stamp-get-store { font-size: 14px; font-weight: 700; color: var(--brown); margin: 10px 0 16px; }
.stamp-result-summary {
  margin: -8px 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray);
  line-height: 1.5;
}
.stamp-result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 10px;
}
.stamp-result-stat {
  min-width: 0;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
  padding: 8px 5px;
}
.stamp-result-stat b {
  display: block;
  color: var(--green);
  font-size: 17px;
  line-height: 1.1;
  font-family: "Arial Black", sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stamp-result-stat span {
  display: block;
  margin-top: 2px;
  color: var(--gray);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stamp-result-lines {
  display: grid;
  gap: 7px;
  margin: 0 0 10px;
}
.stamp-result-line {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  text-align: left;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
  padding: 8px 9px;
}
.stamp-result-line.hot {
  border-color: var(--orange-light);
  background: #fff4e3;
}
.stamp-result-line-icon { font-size: 20px; line-height: 1; text-align: center; }
.stamp-result-line-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.stamp-result-line-main b {
  color: var(--brown);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stamp-result-line-main small {
  color: var(--gray);
  font-size: 10px;
  line-height: 1.35;
}
.stamp-result-line em {
  font-style: normal;
  color: #fff;
  background: var(--orange);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}
.stamp-result-next {
  margin: 0 0 10px;
  padding: 10px 11px;
  text-align: left;
  border-radius: 10px;
  border: 1.5px solid rgba(46, 158, 91, .22);
  background: #eff9f3;
  color: #246b42;
}
.stamp-result-next b {
  display: block;
  font-size: 12px;
  line-height: 1.35;
}
.stamp-result-next span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.55;
}
.stamp-result-actions {
  display: grid;
  gap: 8px;
  margin: 0 0 8px;
}
.stamp-result-action {
  min-height: 42px;
}
.stamp-batch-mark {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: 6px double var(--red);
  color: var(--red);
  background: #fffdf8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transform: rotate(-8deg);
  animation: stampHit .45s cubic-bezier(.34,1.56,.64,1) .15s backwards;
}
.stamp-batch-mark b {
  font-size: 27px;
  line-height: 1.05;
  font-family: "Arial Black", sans-serif;
}
.stamp-batch-mark small {
  margin-top: 5px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
}

/* ---------------- 演出（紙吹雪・フラッシュ・着弾・お祝い） ---------------- */
#fx-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 1240; }
.fx-flash { position: fixed; inset: 0; pointer-events: none; z-index: 1234; opacity: 0; }
/* スタンプ着弾リング（コース色） */
.stamp-get-svg-wrap { position: relative; display: inline-block; }
.stamp-ring {
  position: absolute; left: 50%; top: 50%;
  width: 120px; height: 120px; margin: -60px 0 0 -60px;
  border: 5px solid var(--orange); border-radius: 50%;
  opacity: 0; pointer-events: none;
  animation: stampRing .55s ease-out .12s;
}
@keyframes stampRing {
  from { transform: scale(.35); opacity: .7; }
  to { transform: scale(2.1); opacity: 0; }
}
/* お祝い（ランクアップ・エリア制覇）ポップ */
.celebrate {
  position: fixed; inset: 0; z-index: 1280;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.celebrate-inner {
  text-align: center;
  background: linear-gradient(180deg, var(--orange), var(--orange-dark));
  color: #fff; border-radius: 20px; padding: 22px 30px;
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
  transform: scale(.5); opacity: 0;
}
.celebrate.show .celebrate-inner { animation: celebratePop 2.2s cubic-bezier(.22,1.4,.36,1); }
@keyframes celebratePop {
  0% { transform: scale(.4); opacity: 0; }
  12% { transform: scale(1.08); opacity: 1; }
  20% { transform: scale(1); opacity: 1; }
  82% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}
.celebrate-icon { font-size: 52px; line-height: 1; }
.celebrate-title { font-size: 22px; font-weight: 800; margin-top: 6px; text-shadow: 0 1px 0 rgba(0,0,0,.15); }
.celebrate-sub { font-size: 13px; font-weight: 700; opacity: .92; margin-top: 2px; }

/* ---------------- トースト ---------------- */
.toast-wrap {
  position: fixed;
  bottom: calc(78px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(92%, 440px);
  z-index: 1300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: rgba(58, 44, 22, .94);
  color: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
  animation: toastIn .25s ease;
}
.toast.error { background: rgba(192, 57, 43, .95); }
.toast.success { background: rgba(46, 158, 91, .95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; } }

/* ---------------- ホーム：デイリー（連続日数＋ミッション） ---------------- */
.daily-card { padding: 14px 16px; }
.daily-streak {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}
.daily-streak-flame { font-size: 26px; line-height: 1; transition: filter .3s; }
.daily-streak-main { font-size: 14px; font-weight: 700; color: var(--brown); }
.daily-streak-main b {
  font-size: 26px; color: var(--red);
  font-family: "Arial Black", sans-serif; margin-right: 3px;
}
.daily-streak-sub { margin-left: auto; font-size: 11px; color: var(--gray); }

.daily-mission-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--brown);
  margin-bottom: 8px;
}
.daily-mission-icon { font-size: 18px; flex: none; }
.daily-mission-label { flex: 1; min-width: 0; }
.daily-mission-state { flex: none; font-size: 12px; font-weight: 700; color: var(--orange-dark); }
.daily-mission-bar {
  height: 12px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.daily-mission-fill {
  height: 100%; width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange-light), var(--orange));
  transition: width .5s cubic-bezier(.22,1,.36,1);
}
.daily-mission.done .daily-mission-state { color: var(--green); }
.daily-mission.done .daily-mission-fill { background: var(--green); }

/* ---------------- 称号：制覇マップ（ぬりえ） ---------------- */
.conquest-map {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.cmap-tile {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #fff8ee;
}
.cmap-fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, var(--orange-light), var(--orange));
  opacity: .82;
  transition: height .6s cubic-bezier(.22,1,.36,1);
}
.cmap-body {
  position: relative; /* fill より前面 */
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3px;
  gap: 2px;
}
.cmap-area {
  font-size: 11px; font-weight: 700; line-height: 1.15; color: var(--brown);
  text-shadow: 0 1px 2px rgba(255, 248, 238, .85);
}
.cmap-area small { display: block; font-size: 9px; font-weight: 700; opacity: .8; }
.cmap-count {
  font-size: 11px; font-weight: 700; color: var(--orange-dark);
  text-shadow: 0 1px 2px rgba(255, 248, 238, .85);
}
.cmap-tile.done { border-color: var(--orange); }
.cmap-tile.done .cmap-fill { opacity: 1; }
.cmap-tile.done .cmap-area,
.cmap-tile.done .cmap-count { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .28); }

/* ---------------- グランドマスター ---------------- */
.gm-ms { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; background: var(--cream); border: 1.5px solid var(--line); margin-bottom: 10px; }
.gm-ms.done { border-color: var(--orange); background: #fff2f5; }
.gm-ms-ic { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--orange-light); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.gm-ms.done .gm-ms-ic { background: var(--orange); }
.gm-ms-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gm-ms-name { font-size: 14px; font-weight: 800; color: var(--brown); }
.gm-ms-name em { font-style: normal; font-size: 11px; color: #fff; background: var(--orange); border-radius: 999px; padding: 1px 8px; margin-left: 4px; }
.gm-ms-sub { font-size: 11px; color: var(--gray); margin-top: 1px; }
.gm-ms-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 5px; }
.gm-ms-bar i { display: block; height: 100%; border-radius: 999px; background: var(--orange); transition: width .5s cubic-bezier(.22,1,.36,1); }
.gm-ms-state { flex: none; text-align: right; color: var(--orange-dark); }
.gm-ms-state b { font-size: 18px; font-family: "Arial Black", sans-serif; }
.gm-ms-state small { display: block; font-size: 10px; color: var(--gray); }
.gm-listhead { font-size: 14px; font-weight: 800; color: var(--brown); margin: 14px 0 4px; }
.gm-listhead span { font-size: 12px; color: var(--orange-dark); }
.gm-grp { font-size: 12px; font-weight: 800; color: var(--orange-dark); margin: 12px 0 7px; }
.gm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gm-area { border: 1.5px solid var(--line); border-radius: 11px; padding: 8px 10px; background: #fff8ee; }
.gm-area.done { border-color: var(--orange); background: #fff2f5; }
.gm-area-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.gm-area-name { font-size: 12px; font-weight: 800; color: var(--brown); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-area-badge { flex: none; font-size: 11px; color: var(--gray); }
.gm-area.done .gm-area-badge { color: var(--orange-dark); font-weight: 800; }
.gm-area-bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 6px; }
.gm-area-bar i { display: block; height: 100%; border-radius: 999px; background: var(--orange); }

/* ---------------- おでかけプラン提案 ---------------- */
.plan-form { display: grid; gap: 14px; margin-bottom: 6px; }
.plan-field { display: grid; gap: 6px; }
.plan-label { font-size: 12px; font-weight: 700; color: var(--brown); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-btn {
  flex: 1 1 auto; min-width: 64px;
  background: var(--cream); border: 2px solid var(--line);
  border-radius: 10px; padding: 9px 8px;
  font-size: 12px; font-weight: 700; color: var(--brown);
  white-space: nowrap;
}
.seg-btn.active { background: var(--orange); border-color: var(--orange-dark); color: #fff; }
.plan-empty { text-align: center; color: var(--gray); font-size: 13px; padding: 18px 8px; line-height: 1.6; }
.plan-area-hint {
  font-size: 12px; font-weight: 700; color: var(--orange-dark);
  background: var(--cream); border: 1.5px solid var(--orange-light);
  border-radius: 10px; padding: 8px 10px; margin: 0 0 12px;
}
.seg.seg-disabled { opacity: .45; }
.seg.seg-disabled .seg-btn { cursor: not-allowed; }
.plan-summary {
  background: #fff4e3; border-radius: 10px; padding: 10px 12px;
  font-size: 13px; color: var(--brown); text-align: center; margin: 12px 0 10px; line-height: 1.7;
}
.plan-summary b { color: var(--red); font-size: 17px; }
.plan-list { list-style: none; margin: 0 0 12px; padding: 0; }
.plan-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 4px; border-bottom: 1px dashed var(--line); font-size: 13px;
}
.plan-no {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--orange); color: #fff; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.plan-course { flex: none; font-size: 15px; }
.plan-name { flex: 1; min-width: 0; font-weight: 700; color: var(--brown); }
.plan-dist { flex: none; color: var(--gray); font-size: 12px; font-weight: 700; }
.plan-back .plan-no { background: var(--gray); }
.plan-back .plan-name { color: var(--gray); font-weight: 700; }
.plan-actions { display: grid; gap: 8px; }

/* ---------------- ポイントの楽しみ（常連ランク／ごほうび／+pt演出） ---------------- */

/* 常連ランク：スタンプの縁リング（銅/銀/金）とチップ */
.loyal-ring-1, .loyal-ring-2, .loyal-ring-3 { border-radius: 50%; }
.loyal-ring-1 { box-shadow: 0 0 0 2px #c08a4d; }
.loyal-ring-2 { box-shadow: 0 0 0 2px #93a5b8; }
.loyal-ring-3 { box-shadow: 0 0 0 2.5px #d4af37, 0 0 9px rgba(212, 175, 55, .5); }
.badge-loyal { border-radius: 4px; padding: 1px 6px; font-weight: 700; }
.badge-loyal.l1 { background: #f4e8d8; color: #8a5a24; }
.badge-loyal.l2 { background: #e8edf3; color: #4a5b70; }
.badge-loyal.l3 { background: #fcf3cf; color: #8a6d1a; }
.detail-loyal-next { color: var(--gray); font-size: 11px; }

/* 店舗詳細：閉店のお知らせ（履歴保全の説明） */
.detail-closed-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  background: #f4f1ec;
  border-radius: 8px;
  font-size: 12px; color: #7d7468; line-height: 1.6;
}

/* マップポップアップ：常連ランクチップ */
.map-popup-loyal {
  display: inline-block;
  margin-top: 3px;
  border-radius: 4px; padding: 1px 6px;
  font-size: 11px; font-weight: 700;
}
.map-popup-loyal.l1 { background: #f4e8d8; color: #8a5a24; }
.map-popup-loyal.l2 { background: #e8edf3; color: #4a5b70; }
.map-popup-loyal.l3 { background: #fcf3cf; color: #8a6d1a; }

/* マイページ：行きつけ（ポイント上位） */
.fav-empty { margin: 0; font-size: 12px; color: var(--gray); line-height: 1.7; }
.fav-list { list-style: none; margin: 0; padding: 0; }
.fav-row {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 4px;
  border-bottom: 1px dashed var(--line);
  cursor: pointer;
}
.fav-row:last-child { border-bottom: none; }
.fav-row:active { background: #fff8ee; }
.fav-loyal { flex: none; width: 86px; font-size: 11px; font-weight: 700; color: var(--gray); }
.fav-loyal.l1 { color: #8a5a24; }
.fav-loyal.l2 { color: #4a5b70; }
.fav-loyal.l3 { color: #8a6d1a; }
.fav-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-pt { flex: none; text-align: right; font-size: 12px; color: var(--brown); font-weight: 700; }
.fav-pt b { font-size: 16px; color: var(--orange-dark); }
.fav-pt small { display: block; font-size: 10px; color: var(--gray); }

/* マイページ：ごほうびボックス */
.perks-pt { float: right; font-size: 12px; font-weight: 900; color: var(--orange-dark); }
.perks-lead { margin: 0 0 10px; font-size: 12px; color: var(--gray); }
.perks-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.perk-card {
  border: 2px solid var(--line); background: #fff8ee; border-radius: 12px;
  padding: 10px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-align: center; color: var(--text);
}
.perk-card:active { transform: scale(.97); }
.perk-card.locked { opacity: .55; cursor: default; filter: grayscale(.35); }
.perk-card.on { border-color: var(--orange); background: #fff; box-shadow: var(--shadow); }
.perk-ic { font-size: 22px; line-height: 1.2; }
.perk-name { font-size: 12px; font-weight: 700; color: var(--brown); }
.perk-sub { font-size: 10px; color: var(--gray); line-height: 1.4; }
.perk-state { font-size: 10px; font-weight: 700; color: var(--orange-dark); min-height: 14px; }

/* ごほうび：ホーム背景（ささやかな模様＝読みやすさ優先の薄い水玉） */
#screen-home.hbg-yuki {
  background:
    radial-gradient(rgba(120, 170, 230, .16) 2.5px, transparent 3.5px) 0 0 / 34px 34px,
    radial-gradient(rgba(120, 170, 230, .10) 2px, transparent 3px) 17px 17px / 34px 34px;
}
#screen-home.hbg-lilac {
  background:
    radial-gradient(rgba(180, 120, 210, .14) 2.5px, transparent 3.5px) 0 0 / 38px 38px,
    radial-gradient(rgba(232, 83, 119, .09) 2px, transparent 3px) 19px 19px / 38px 38px;
}

/* ごほうび：アバターフレーム */
/* プロフィールアバター（v112）: 絵文字表示・ピッカー・編集バッジ */
.mypage-avatar { cursor: pointer; position: relative; }
.mypage-avatar::after {
  content: "✏️"; position: absolute; right: -4px; top: -4px; /* 右下はワンポイント（.av-sub）の定位置のため右上へ */
  font-size: 13px; background: #fff; border-radius: 50%;
  padding: 1px; line-height: 1; box-shadow: 0 1px 3px rgba(40,25,5,.25);
}
.mypage-avatar.has-emoji { font-size: 30px; }
.ranking-avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--orange); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800;
}
.ranking-avatar.has-emoji { font-size: 19px; }
.rival-avatar.has-emoji { font-size: 30px; }
.mypage-avatar, .ranking-avatar, .rival-avatar, .avatar-preview { position: relative; }
.av-sub {
  position: absolute; right: -4px; bottom: -4px;
  font-size: 14px; line-height: 1;
  background: #fff; border-radius: 50%; padding: 2px;
  box-shadow: 0 1px 3px rgba(40,25,5,.3);
}
.ranking-avatar .av-sub { font-size: 11px; right: -5px; bottom: -5px; }
/* エディタ */
.avatar-editor-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 10px; }
.avatar-preview {
  flex: none; width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(180deg, var(--orange), var(--orange-dark)); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 700;
}
.avatar-preview .av-sub { font-size: 16px; }
/* 背景パレット（v113/v114）: 各丸アイコン（.mypage-avatar/.ranking-avatar/.rival-avatar/.avatar-preview/.av-sub）の
   基底背景より後に置いて確実に上書きする（カスケード順が仕様。前に置くとプレビュー等で基底が勝つ） */
.av-bg-0 { background: linear-gradient(180deg, var(--orange), var(--orange-dark)); }
.av-bg-1 { background: linear-gradient(180deg, #f48fb1, #e85377); }
.av-bg-2 { background: linear-gradient(180deg, #7ec8f2, #3f8fd2); }
.av-bg-3 { background: linear-gradient(180deg, #8fd694, #4caf6d); }
.av-bg-4 { background: linear-gradient(180deg, #ffd54f, #f5a623); }
.av-bg-5 { background: linear-gradient(180deg, #b39ddb, #7e57c2); }
.av-bg-6 { background: linear-gradient(180deg, #bcaaa4, #795548); }
.av-bg-7 { background: linear-gradient(180deg, #b0bec5, #546e7a); }
.av-bg-8 { background: transparent; } /* 透明（v114）。丸の塗りなし＝絵文字が直接カードに乗る */
.av-sub.av-bg-8 { box-shadow: none; }
.avatar-preview.av-bg-8 { box-shadow: inset 0 0 0 2px var(--line); } /* エディタでは輪郭で範囲だけ示す */
/* 写真アバター（v115）: 丸いっぱいに中央クロップ表示 */
.av-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
}
/* 新機能のお知らせモーダル（v116） */
.news-list { list-style: none; margin: 6px 0 16px; display: flex; flex-direction: column; gap: 10px; }
.news-list li {
  font-size: 13px; line-height: 1.7; color: var(--brown); font-weight: 600;
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
#btn-news-cta { margin-bottom: 8px; }

/* ピッカーの機能タブ（絵文字で作る／写真にする・v115） */
.avatar-tab-row { display: flex; gap: 8px; margin: 2px 0 12px; }
.avatar-tab {
  flex: 1; padding: 10px 0; font-size: 13px; font-weight: 800; color: var(--brown);
  background: var(--cream); border: 2px solid var(--line); border-radius: 12px; cursor: pointer;
}
.avatar-tab.active { background: var(--orange); border-color: var(--orange-dark); color: #fff; }
.avatar-photo-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; }
.avatar-photo-lead { flex: 1; font-size: 13px; font-weight: 700; color: var(--brown); line-height: 1.6; }
#btn-avatar-photo { margin-bottom: 8px; }
.avatar-editor-side { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.avatar-bg-row { display: flex; gap: 6px; flex-wrap: wrap; }
.avatar-bg-swatch {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer;
}
.avatar-bg-swatch.active { box-shadow: 0 0 0 2px var(--orange-dark); }
.avatar-bg-white { background: #fff; }
.avatar-bg-swatch.avatar-bg-clear { /* 透明スウォッチは市松模様で表現 */
  background: conic-gradient(#e6dccb 0 25%, #fff 0 50%, #e6dccb 0 75%, #fff 0) 0 0/12px 12px;
}
.avatar-bg-label { font-size: 11px; font-weight: 800; color: var(--gray, #8a7a63); }
.avatar-reset-link {
  align-self: flex-start; background: none; border: none; cursor: pointer;
  font-size: 12px; font-weight: 700; color: var(--orange-dark); text-decoration: underline; padding: 0;
}
.avatar-save-bar {
  position: sticky; bottom: 0; z-index: 3;
  background: var(--cream); padding: 10px 0 6px; margin-top: 4px;
  box-shadow: 0 -8px 12px -8px rgba(40,25,5,.18);
}
.avatar-mode-row { display: flex; gap: 6px; }
.avatar-mode {
  flex: 1; padding: 7px 0; font-size: 12px; font-weight: 800; color: var(--brown);
  background: var(--cream); border: 2px solid var(--line); border-radius: 999px; cursor: pointer;
}
.avatar-mode.active { background: var(--orange); border-color: var(--orange-dark); color: #fff; }
.avatar-jump-row {
  position: sticky; top: -22px; z-index: 2; background: var(--cream);
  display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 6px; margin: 0 -2px;
  -webkit-overflow-scrolling: touch;
}
.avatar-jump {
  flex: none; font-size: 11px; font-weight: 800; color: var(--brown);
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 5px 10px; cursor: pointer; white-space: nowrap;
}
.avatar-grid { margin: 4px 0 14px; }
.avatar-group-label { font-size: 12px; font-weight: 800; color: var(--orange-dark); margin: 12px 2px 6px; }
.avatar-group-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
#btn-avatar-save { margin-bottom: 8px; }
#btn-avatar-save:disabled { opacity: .5; cursor: default; }
.avatar-choice {
  font-size: 26px; padding: 7px 0; line-height: 1.3;
  background: var(--cream); border: 2px solid var(--line); border-radius: 12px; cursor: pointer;
  transition: transform .08s;
}
.avatar-choice:active { transform: scale(.92); }
.avatar-choice.active { border-color: var(--orange-dark); background: #fff; box-shadow: 0 0 0 2px var(--orange); }

.mypage-avatar.avf-bronze { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #c08a4d; }
.mypage-avatar.avf-silver { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #9fb0c1; }
.mypage-avatar.avf-gold { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #d4af37, 0 2px 12px rgba(212, 175, 55, .55); }

/* 「+Npt」フライ演出（トースト1300より下・お祝い1280より上） */
.fly-pt {
  position: fixed; left: 50%; bottom: 128px; transform: translateX(-50%);
  z-index: 1290;
  pointer-events: none;
  font-size: 24px; font-weight: 900; color: var(--orange-dark);
  text-shadow: 0 1px 0 #fff, 0 0 6px #fff, 0 3px 10px rgba(90, 62, 27, .25);
  animation: flyPt 1.05s ease-out forwards;
}
@keyframes flyPt {
  0% { opacity: 0; transform: translate(-50%, 14px) scale(.7); }
  18% { opacity: 1; transform: translate(-50%, 0) scale(1.12); }
  100% { opacity: 0; transform: translate(-50%, -78px) scale(1); }
}

/* ---------------- PC・タブレット表示（広い画面を活用） ---------------- */
@media (min-width: 768px) {
  .app { max-width: 900px; box-shadow: 0 0 40px rgba(0,0,0,.18); }
  .bottom-nav { width: min(100%, 900px); }
  .main { padding: 22px 24px calc(92px + env(safe-area-inset-bottom)); }

  /* 登録・ホーム・賞品・マイページは単カラム内容なので読みやすい幅で中央寄せ */
  .screen-splash { max-width: 460px; margin: 0 auto; }
  #screen-home, #screen-prizes, #screen-mypage { max-width: 640px; margin: 0 auto; }

  /* ホームの2大ボタンは横並びに */
  .action-grid { grid-template-columns: 1fr; }

  /* 店舗一覧は2カラムグリッド */
  .store-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; align-items: start; }
  .store-item { margin-bottom: 0; }

  /* スタンプ帳は1行あたりの枠を増やす */
  .stamp-grid { grid-template-columns: repeat(5, 1fr); }

  /* 実績は4カラムで一列に */
  .stats-grid { grid-template-columns: repeat(4, 1fr); }

  /* 地図は大きく */
  #map { height: calc(100dvh - 210px); min-height: 480px; }
}

@media (min-width: 1180px) {
  .app { max-width: 1080px; }
  .bottom-nav { width: min(100%, 1080px); }
  .store-list { grid-template-columns: repeat(3, 1fr); }
  .stamp-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ============================================================
 * スプラッシュ: コース紹介LP（/courses/）への導線（v119）
 * ============================================================ */
.splash-courses {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 20px 10px 24px;
  font-size: 12px;
}
.splash-courses-label {
  width: 100%;
  text-align: center;
  color: rgba(255, 255, 255, .95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .12);
  margin-bottom: 2px;
  font-weight: 700;
}
.splash-courses a {
  color: var(--orange-dark);
  background: rgba(255, 255, 255, .88);
  border-radius: 999px;
  padding: 4px 12px;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(90, 62, 27, .15);
}
.splash-courses a:active { opacity: .7; }

/* ============================================================
 * フレンド（相互フレンド・フレンドランキング・v120）
 * ============================================================ */
.ranking-scope {
  display: flex;
  gap: 8px;
  margin: 0 0 10px;
}
.scope-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--gray);
  font-weight: 700;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.scope-btn.active {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--white);
}
.ranking-chase {
  background: var(--white);
  border: 1px dashed var(--orange-light);
  color: var(--orange-dark);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 700;
  margin: 0 0 10px;
}
.friends-card .btn-row { margin-top: 8px; }
.rival-unfriend { margin-top: 14px; }

/* ===== 実績シェアカード（v122） ===== */
.sharecard-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-top: 10px;
}
.sharecard-note {
  font-size: 12px;
  color: var(--gray);
  margin: 10px 0;
  line-height: 1.6;
}
#modal-sharecard .btn-row { display: flex; gap: 8px; margin-top: 8px; }

/* ===== インストール促進バナー（v129） ===== */
.install-banner {
  position: fixed;
  bottom: calc(66px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: min(100% - 20px, 460px);
  z-index: 1055; /* 下部ナビ(1060)とモーダルより下 */
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(90, 62, 27, .18);
  padding: 10px 12px;
  animation: install-banner-in .35s ease-out;
}
@keyframes install-banner-in {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.install-banner-icon { width: 38px; height: 38px; border-radius: 9px; flex: none; }
.install-banner-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.install-banner-text b { font-size: 13px; }
.install-banner-text span { font-size: 11px; color: var(--gray); }
.install-banner-add { flex: none; }
.install-banner-close {
  flex: none;
  background: none;
  border: none;
  color: var(--gray);
  font-size: 18px;
  padding: 4px 6px;
  line-height: 1;
}

/* ===== インストール案内（v129） ===== */
.install-steps {
  margin: 12px 0 14px;
  padding-left: 24px;
  font-size: 14px;
  line-height: 1.7;
}
.install-steps li + li { margin-top: 6px; }
.install-lead {
  font-size: 14px;
  line-height: 1.7;
  margin: 12px 0 14px;
}
#modal-install .transfer-note { margin-bottom: 12px; }
