/* ヒャッキマップ — 闇夜の和風テーマ */
:root {
  --bg: #0f0d15;
  --bg2: #17141f;
  --panel: #1c1826;
  --panel2: #242032;
  --line: #332d45;
  --text: #e8e2d3;
  --muted: #9a92a8;
  --accent: #ff9d45;   /* 提灯 */
  --shu: #d4544a;      /* 朱 */
  --gold: #ffd76a;
  /* 表示書体: Noto Serif JP を Google Fonts から読む（index.html / 各生成HTMLの <link>）。
     読み込み失敗時に備えて OS 標準明朝のフォールバック連鎖はそのまま残す。 */
  --serif: "Noto Serif JP", "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic UI", sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
.cat-icon {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  object-fit: contain;
  vertical-align: -.18em;
  flex: none;
}

/* ---------- ヘッダー ---------- */
.topbar {
  position: relative;
  background:
    radial-gradient(ellipse 120% 100% at 50% -30%, #2a2140 0%, transparent 60%),
    linear-gradient(180deg, #17131f 0%, #100d17 100%);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px 0;
  overflow: hidden;
  flex: none;
  z-index: 1100;
}
/* 百鬼夜行図（PD）をぼかして薄く敷く */
.topbar::before {
  content: '';
  position: absolute;
  inset: -10% -3%;
  background: url(../img/art/hyakki.jpg) center 42% / cover no-repeat;
  opacity: .16;
  filter: blur(1.6px) saturate(.85);
  pointer-events: none;
}
.topbar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,13,21,.15) 0%, rgba(15,13,21,.55) 100%);
  pointer-events: none;
}
.topbar > * { position: relative; z-index: 1; }
.topbar h1 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: .12em;
  font-weight: 600;
  text-shadow: 0 0 18px rgba(255, 157, 69, .35);
  /* ⚠ 行高を固定する。游明朝 → Noto Serif JP に差し替わる瞬間に h1 の高さが変わると、
     下の地図・タブ・フッタが丸ごとずれる（実測 CLS 0.084 / 1440×900）。
     高さを先に決めておけば、書体が入れ替わってもレイアウトは1pxも動かない。 */
  line-height: 1.5;
  min-height: calc(1.35rem * 1.5);
}
.brand-logo {
  display: block;
  width: 1.45em;
  height: 1.45em;
  flex: none;
  object-fit: contain;
}
.topbar .tag {
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: .05em;
}
/* 人魂（地図の上端あたりをゆっくり漂う。UIの下・ピンの上） */
.hitodama {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 46%;
  z-index: 650;
  pointer-events: none;
  overflow: hidden;
}
.hitodama span {
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: radial-gradient(circle at 38% 38%, rgba(215,245,255,.95), rgba(120,190,255,.35) 55%, transparent 72%);
  filter: blur(1.2px) drop-shadow(0 0 10px rgba(140,200,255,.8));
  opacity: 0;
  animation: drift 22s ease-in-out infinite;
}
.hitodama span:nth-child(1) { left: 44%; top: 62%; animation-delay: 0s; }
.hitodama span:nth-child(2) { left: 78%; top: 78%; width: 16px; height: 16px; animation-delay: 11s; animation-duration: 27s; }
@keyframes drift {
  0% { opacity: 0; transform: rotate(-45deg) translate(0, 0); }
  12% { opacity: .75; }
  50% { opacity: .55; transform: rotate(-45deg) translate(-14px, -40px); }
  100% { opacity: 0; transform: rotate(-45deg) translate(-44px, -96px); }
}
/* タブ */
.tabs { display: flex; gap: 4px; position: relative; }
.tabs button {
  appearance: none;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  padding: 8px 14px;
  font-size: .88rem;
  cursor: pointer;
  font-family: inherit;
}
.tabs button.active {
  background: var(--bg);
  color: var(--text);
  border-color: var(--line);
  font-weight: 600;
}
.badge-mini {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--shu);
  color: #fff;
  font-size: .68rem;
  line-height: 1.5;
  vertical-align: 1px;
}

/* ---------- ビュー共通 ---------- */
main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.view.hidden, .hidden { display: none !important; }
.scroll { overflow-y: auto; padding: 14px; }

/* ---------- 地図 ---------- */
.mapwrap { position: relative; flex: 1; min-height: 0; }
#map { position: absolute; inset: 0; background: #0c0a12; }
/* タイルを夜にする */
.leaflet-tile-pane {
  filter: invert(.93) hue-rotate(205deg) saturate(.22) brightness(.72) contrast(1.22);
  opacity: .88; /* #map の紫黒を透かす */
}
.leaflet-container { font-family: inherit; }
.leaflet-control-attribution {
  background: rgba(15, 13, 21, .75) !important;
  color: #877f96 !important;
  font-size: .62rem !important;
}
.leaflet-control-attribution a { color: #a99fc0 !important; }
.leaflet-control-zoom a {
  background: var(--panel) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

/* 地図上のUI */
.map-ui {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 10px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(15,13,21,.88) 0%, rgba(15,13,21,.55) 70%, transparent 100%);
}
.map-ui > * { pointer-events: auto; }
.ui-row { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.searchbox { position: relative; flex: 1; min-width: 0; z-index: 5; }
#search {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 16px; /* iOSズーム防止 */
  font-family: inherit;
}
#search::placeholder { color: #6e6683; }
#search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 5; /* チップの件数(opacityで別スタッキング)が透けるのを防ぐ */
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.6);
  max-height: 46dvh;
  overflow-y: auto;
}
#search-results button {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  padding: 9px 10px;
  font-size: .85rem;
  cursor: pointer;
  font-family: inherit;
}
#search-results button:last-child { border-bottom: none; }
#search-results button:hover { background: var(--panel2); }
#search-results .sub { color: var(--muted); font-size: .72rem; }
select, .btn {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 8px 8px;
  font-size: .82rem;
  font-family: inherit;
  cursor: pointer;
  flex: none;
}
.btn:active { transform: scale(.97); }
.chips {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .78rem;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.chip.on {
  color: var(--text);
  border-color: var(--cc, var(--accent));
  box-shadow: 0 0 7px color-mix(in srgb, var(--cc, var(--accent)) 45%, transparent);
  background: color-mix(in srgb, var(--cc, var(--accent)) 14%, var(--panel));
}
.chip .n { font-size: .68rem; opacity: .75; }
.chip .cat-icon { width: 1.05em; height: 1.05em; }
.search-cat-icon { width: 1.35rem; height: 1.35rem; }

/* 今日の一体 */
.daily {
  position: absolute;
  left: 10px; right: 56px;
  bottom: 12px;
  z-index: 1000;
  display: flex;
}
.daily button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  background: linear-gradient(135deg, #241b30, #1a1524);
  border: 1px solid #4b3a2a;
  box-shadow: 0 0 14px rgba(255,157,69,.18), 0 4px 14px rgba(0,0,0,.5);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: .82rem;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.daily .lantern { font-size: 1.1rem; filter: drop-shadow(0 0 6px rgba(255,157,69,.8)); }
.daily b { color: var(--accent); }
.daily .sub { color: var(--muted); font-size: .7rem; display: block; }

/* ピン */
.pin-wrap { background: none; border: none; }
.pin {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: radial-gradient(circle at 50% 32%, #262038, #141020 78%);
  border: 1.5px solid var(--c, #888);
  box-shadow: 0 0 9px color-mix(in srgb, var(--c, #888) 55%, transparent), 0 2px 6px rgba(0,0,0,.55);
  transition: transform .15s;
  position: relative;
}
.pin:hover { transform: scale(1.18); }
.pin-cat-icon { width: 21px; height: 21px; }
/* 遠景（zoom<9）は小さな灯りだけ */
.leaflet-container.far .pin {
  width: 12px; height: 12px;
  margin: 9px;
  font-size: 0;
  border-width: 1px;
  background: radial-gradient(circle, #fff6e0 0%, var(--c, #888) 50%, color-mix(in srgb, var(--c, #888) 60%, #141020) 100%);
  box-shadow: 0 0 9px 2px color-mix(in srgb, var(--c, #888) 70%, transparent), 0 0 3px rgba(255,255,255,.4);
}
.leaflet-container.far .pin-cat-icon { display: none; }
.leaflet-container.far .pin.found::after { display: none; }
.leaflet-container.far .pin.found { box-shadow: 0 0 10px 3px rgba(255,215,106,.8); }
.pin.found { border-color: var(--gold); }
.pin.found::after {
  content: '✔';
  position: absolute;
  right: -3px; top: -3px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--gold);
  color: #201700;
  font-size: 9px;
  line-height: 13px;
  text-align: center;
  font-weight: 700;
}

/* 集約ピン（提灯）: zoom<=5 は地方ごと、zoom 6 は都道府県ごと */
/* ★.pin-wrap 配下にスコープすること。素の .lantern にすると
   「今日の一体」バナーの <span class="lantern">🏮</span>（.daily .lantern）にも当たり、
   絵文字の背後にオレンジの提灯型が二重に出る（2026-08-23に一度やらかした） */
.pin-wrap .lantern {
  position: relative;
  width: 28px; height: 32px;
  margin: 3px auto 0;
  border-radius: 46% / 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 12px;
  color: #3a1300;
  background:
    repeating-linear-gradient(180deg, transparent 0 5px, rgba(110, 40, 0, .16) 5px 6px),
    radial-gradient(ellipse at 50% 32%, #ffe0a8 0%, #ffb054 40%, #e0702a 75%, #b54a18 100%);
  border: 1px solid rgba(70, 25, 0, .7);
  box-shadow:
    0 0 12px rgba(255, 157, 69, .75),
    0 0 28px rgba(255, 120, 40, .35),
    inset 0 -5px 8px rgba(120, 30, 0, .4);
  transition: transform .15s;
}
.pin-wrap .lantern::before, .pin-wrap .lantern::after {
  content: '';
  position: absolute;
  left: 28%; right: 28%;
  height: 4px;
  background: #2a1a12;
  border-radius: 2px;
  box-shadow: 0 0 2px rgba(0,0,0,.6);
}
.pin-wrap .lantern::before { top: -3px; }
.pin-wrap .lantern::after { bottom: -3px; }
.pin-wrap .lantern .ln { position: relative; line-height: 1; }
.pin-wrap .lantern.big { width: 42px; height: 46px; margin-top: 1px; font-size: 15px; }
.pin-wrap .lantern.comp {
  background:
    repeating-linear-gradient(180deg, transparent 0 5px, rgba(110, 80, 0, .16) 5px 6px),
    radial-gradient(ellipse at 50% 32%, #fff4c8 0%, #ffd76a 45%, #d9a830 80%, #a67a14 100%);
  box-shadow: 0 0 14px rgba(255, 215, 106, .8), 0 0 30px rgba(255, 215, 106, .35), inset 0 -5px 8px rgba(120, 90, 0, .35);
}
/* ラベルの置き場所は JS(layoutLabels) が transform で上書きする */
.lantern-label {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, calc(-50% + 31px));
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: .06em;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(15, 13, 21, .72);
  color: #ffe3c2;
  text-shadow: 0 0 4px #000, 0 1px 2px #000;
}
.pin-wrap:hover .lantern { transform: scale(1.1); }

/* ---------- モーダル ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(5, 4, 10, .62);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  position: relative;
  width: 100%;
  max-width: 580px;
  max-height: 86dvh;
  overflow-y: auto;
  background: linear-gradient(180deg, #201b2d 0%, #17131f 100%);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 18px 18px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  animation: rise .22s ease-out;
}
@keyframes rise { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (min-width: 640px) {
  .modal { align-items: center; padding: 20px; }
  .sheet { border-radius: 18px; border-bottom: 1px solid var(--line); }
}
.sheet .close {
  position: absolute;
  top: 10px; right: 10px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  z-index: 2;
}
.spot-head { display: flex; gap: 12px; align-items: flex-start; padding-right: 34px; }
.spot-emoji {
  flex: none;
  width: 54px; height: 54px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  background: radial-gradient(circle at 50% 30%, #2b2440, #171223);
  border: 1.5px solid var(--cc, var(--line));
  box-shadow: 0 0 12px color-mix(in srgb, var(--cc, #888) 40%, transparent);
}
.spot-cat-icon { width: 34px; height: 34px; }
.spot-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: .04em;
}
.spot-head .kana { color: var(--muted); font-size: .72rem; }
.spot-meta { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 2px; }
.tagchip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .72rem;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 3px 9px;
  border-radius: 999px;
}
.tagchip.cat { color: var(--text); border-color: var(--cc); }
.tagchip.place { cursor: pointer; }
.spook-row { margin: 8px 0 0; font-size: .8rem; color: var(--muted); }
.spook-row .l { letter-spacing: .1em; }
.story {
  font-family: var(--serif);
  font-size: .95rem;
  line-height: 2;
  margin: 14px 0;
  padding: 14px 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,0)),
    var(--bg2);
  border-left: 3px solid var(--cc, var(--accent));
  border-radius: 4px 12px 12px 4px;
  letter-spacing: .02em;
}
.source { color: var(--muted); font-size: .74rem; margin: -4px 0 12px; }
/* 挿絵（古典妖怪画） */
.artwrap {
  margin: 14px 0 0;
  text-align: center;
  background:
    radial-gradient(ellipse at 30% 15%, rgba(255, 228, 180, .06), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .014) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, .08) 0 1px, transparent 1px 7px),
    linear-gradient(180deg, #211c17 0%, #17130f 100%);
  border: 1px solid #4b3d2c;
  outline: 1px solid rgba(255, 215, 150, .10);
  outline-offset: -5px;
  border-radius: 8px;
  padding: 14px 12px 10px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .6), 0 3px 12px rgba(0, 0, 0, .45);
}
.artwrap img {
  max-width: 100%;
  max-height: 340px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .7), 0 6px 18px rgba(0, 0, 0, .6);
}
.artwrap figcaption {
  font-family: var(--serif);
  color: #a8977a;
  font-size: .7rem;
  letter-spacing: .04em;
  margin-top: 9px;
}
.zthumb {
  width: 60px; height: 60px;
  flex: none;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  filter: sepia(.2) brightness(.95);
}
.spot-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.spot-actions .btn { font-size: .86rem; padding: 10px 14px; }
.btn.primary {
  background: linear-gradient(135deg, #c8463a 0%, #a2332a 55%, #86261f 100%);
  border-color: #e86a5e;
  color: #fff4ec;
  font-weight: 700;
  letter-spacing: .04em;
  box-shadow: 0 0 16px rgba(212, 84, 74, .45), 0 2px 8px rgba(0, 0, 0, .45);
  text-shadow: 0 1px 1px rgba(0,0,0,.35);
}
.btn.primary.done {
  background: linear-gradient(135deg, #2a3d2a, #1e2c1f);
  border-color: #4d7a4d;
  color: #d5f0d0;
  box-shadow: none;
}
/* 発見スタンプ */
.stamp {
  position: absolute;
  top: 46px; right: 20px;
  transform: rotate(-12deg);
  border: 3px double var(--shu);
  color: #e0625a;
  font-family: var(--serif);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .25em;
  padding: 4px 10px 4px 13px;
  border-radius: 10px;
  opacity: .92;
  pointer-events: none;
  animation: stamp .28s cubic-bezier(.2, 2, .4, 1);
}
@keyframes stamp { from { transform: rotate(-12deg) scale(2.2); opacity: 0; } to { transform: rotate(-12deg) scale(1); opacity: .92; } }

/* ---------- 図鑑 ---------- */
#zukan-search {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 9px 12px;
  font-size: 16px;
  font-family: inherit;
  margin-bottom: 4px;
}
#zukan-search::placeholder { color: #6e6683; }
.zukan-cat { margin-top: 14px; }
.zukan-cat summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px 6px 0;
  border-bottom: 1px solid var(--line);
  user-select: none;
}
.zukan-cat summary::-webkit-details-marker { display: none; }
.zukan-cat summary::after {
  content: '';
  flex: none;
  width: 7px; height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform .2s;
  margin-right: 4px;
}
.zukan-cat[open] summary::after { transform: rotate(45deg); }
.zukan-cat h2 {
  font-family: var(--serif);
  font-size: 1.05rem;
  margin: 0;
  letter-spacing: .06em;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: none;
}
.zukan-cat h2 .cnt { color: var(--muted); font-size: .75rem; font-family: system-ui, sans-serif; }
.zbar {
  flex: 1;
  max-width: 180px;
  height: 5px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.zbar i {
  display: block;
  height: 100%;
  background: var(--cc, var(--accent));
  box-shadow: 0 0 6px var(--cc, var(--accent));
  border-radius: 6px;
}
.zukan-cat .desc { color: var(--muted); font-size: .74rem; margin: 8px 0 10px; }
.zukan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.zcard {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font-family: inherit;
  font-size: .8rem;
  min-height: 52px;
}
.zcard .ico { font-size: 1.25rem; flex: none; filter: none; }
.zcard .ico .cat-icon { width: 24px; height: 24px; }
.zcard.mystery { color: #6e6683; border-color: color-mix(in srgb, var(--cc, #888) 22%, var(--line)); }
/* 未発見: カテゴリ印を薄くして正体を伏せる */
.zcard.mystery .ico {
  opacity: .38;
}
.zcard b { display: block; font-size: .8rem; line-height: 1.25; }
.zcard .sub { color: var(--muted); font-size: .68rem; }
.zcard.foundcard { border-color: color-mix(in srgb, var(--cc, var(--gold)) 55%, var(--line)); }

/* ---------- 記録 ---------- */
.kiroku-hero {
  background: linear-gradient(135deg, #221b33, #191424);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  text-align: center;
}
.kiroku-hero .title-now {
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: .12em;
  color: var(--accent);
  text-shadow: 0 0 14px rgba(255,157,69,.4);
  margin: 4px 0;
}
.kiroku-hero .big { font-size: 1.9rem; font-weight: 700; font-family: var(--serif); }
.kiroku-hero .big small { font-size: .9rem; color: var(--muted); font-weight: 400; }
.pbar {
  height: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px auto 6px;
  max-width: 420px;
}
.pbar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #7a3f2b, var(--accent));
  box-shadow: 0 0 8px rgba(255,157,69,.6);
  border-radius: 999px;
  transition: width .5s ease;
}
.next-title { color: var(--muted); font-size: .74rem; }
.kiroku h3 {
  font-family: var(--serif);
  font-size: 1rem;
  margin: 22px 0 10px;
  letter-spacing: .08em;
}
.pref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 6px;
}
.pref-cell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 9px;
  font-size: .74rem;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  text-align: left;
}
.pref-cell .bar { height: 4px; background: var(--bg); border-radius: 4px; margin-top: 5px; overflow: hidden; }
.pref-cell .bar i { display: block; height: 100%; background: var(--accent); }
.pref-cell.comp { border-color: var(--gold); box-shadow: 0 0 8px rgba(255,215,106,.25); }
.pref-cell.comp .bar i { background: var(--gold); }
.pref-cell .num { color: var(--muted); font-size: .68rem; }
.cat-progress { display: flex; flex-direction: column; gap: 6px; }
.cat-progress .row { display: flex; align-items: center; gap: 8px; font-size: .78rem; }
.cat-progress .row .nm { width: 9.5em; flex: none; display: inline-flex; align-items: center; gap: 4px; }
.cat-progress .row .bar { flex: 1; height: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.cat-progress .row .bar i { display: block; height: 100%; background: var(--cc); }
.cat-progress .row .num { width: 4em; text-align: right; color: var(--muted); font-size: .7rem; }
.danger { color: #e08a86; border-color: #6e3a37 !important; }

/* ---------- トースト・その他 ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  background: #2a2438;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 16px;
  font-size: .82rem;
  z-index: 3000;
  box-shadow: 0 6px 20px rgba(0,0,0,.5);
  transition: opacity .3s;
  max-width: 88vw;
}
footer {
  flex: none;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: #6e6683;
  font-size: .66rem;
  line-height: 1.7;
  background: var(--bg2);
}
footer a { color: #a99fc0; }
#foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  padding-top: 7px;
  padding-bottom: calc(7px + env(safe-area-inset-bottom));
}
#foot .foot-note { display: none; flex-basis: 100%; margin: 2px 0 0; }
#foot.open .foot-note { display: block; }
/* 免責の短縮版は常時表示（全文は ⓘ の中） */
.foot-mini { font-size: 12px; line-height: 1.4; color: #8f86a6; }
.foot-info {
  appearance: none;
  width: 18px; height: 18px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #6e6683;
  background: transparent;
  color: #a99fc0;
  font-family: Georgia, "Times New Roman", var(--serif);
  font-style: italic;
  font-weight: 700;
  font-size: .72rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
#foot.open .foot-info { background: #6e6683; color: #fff; }
#onboard .sheet::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(32,27,45,.55) 0%, rgba(23,19,31,.82) 100%),
    url(../img/art/hyakki.jpg) center 30% / cover no-repeat;
  opacity: .42;
  filter: blur(2px) saturate(.9);
  pointer-events: none;
}
.onboard-body { position: relative; z-index: 1; text-align: center; padding: 6px 4px; }
.onboard-body .big-lantern { font-size: 3rem; filter: drop-shadow(0 0 16px rgba(255,157,69,.6)); }
.onboard-body h2 { font-family: var(--serif); letter-spacing: .1em; margin: 8px 0; }
.onboard-body p { color: var(--muted); font-size: .85rem; line-height: 1.9; text-align: left; }
.onboard-body .steps { text-align: left; font-size: .85rem; line-height: 2.1; margin: 10px 0; }
.onboard-body .steps b { color: var(--accent); }

/* ---------- PC レイアウト（スマホは変えない） ---------- */
@media (min-width: 900px) {
  .topbar {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 10px 18px 0;
  }
  .topbar h1 { margin-bottom: 8px; }
  .topbar .tag { margin: 0 0 11px; flex: 1; }
  .topbar .tabs { margin-left: auto; }
  .map-ui {
    top: 12px; left: 12px; right: auto;
    width: 420px;
    max-width: 420px;
    padding: 10px;
    gap: 8px;
    border-radius: 14px;
    background: rgba(20, 17, 30, .88);
    border: 1px solid var(--line);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
    backdrop-filter: blur(6px);
    pointer-events: auto;
  }
  .chips { flex-wrap: wrap; overflow: visible; padding-bottom: 0; gap: 4px 3px; }
  .chip { padding: 2px 7px; font-size: .72rem; }
  .daily { left: 12px; right: auto; max-width: 420px; }
  #foot { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
  #foot .foot-info { display: none; }
  #foot .foot-mini { display: none; } /* PCは全文を常時出すので不要 */
  #foot .foot-note { display: inline; flex: 0 1 auto; margin: 0; order: 1; overflow: hidden; text-overflow: ellipsis; }
  #foot .foot-links { order: 2; }
  #foot #reset-wrap { order: 3; }
}
