/* ===== 基本設定（レトロポップ版 v2：参考画像のトーン 2026-11-22） ===== */
/* 方針：水色・ピンク・レモン色の80〜90年代ポップ。線は深い青緑。
   ずらした色つきの影、昔のパソコンの「窓」風の枠、方眼と紙吹雪の飾りで、にぎやかで可愛く。
   ※ デザイン規則の例外（ひこさんの指示）：背景色・影・大きめの角丸・装飾を使う。フォントはゴシック系のまま。 */
:root {
  --bg: #FFF7E3;          /* 背景：うすいクリーム */
  --panel: #FFFFFF;       /* パネル */
  --ink: #1B4F5E;         /* 文字とフチ：深い青緑（参考画像の線の色） */
  --muted: #4E7480;       /* 補足テキスト */
  --line: #1B4F5E;
  --aqua: #5ACBCB;        /* 水色（ターコイズ） */
  --aqua-pale: #CFF1EF;
  --pink: #FF8DB5;        /* ピンク */
  --pink-deep: #F2569A;
  --lemon: #FFE55C;       /* レモン色 */
  --lilac: #9B87F5;       /* 紫（差し色） */
  --accent: var(--pink-deep);
  --accent-dark: #D93D82;
  --mustard: var(--lemon);
  --accent-tint: #FFF3B8; /* 一覧のホバー背景 */
  --accent-tint2: #FFE0EC;/* 一覧の選択中背景 */
  --pop-shadow: 5px 5px 0 var(--pink);        /* ずらしたピンクの影 */
  --pop-shadow-aqua: 5px 5px 0 var(--aqua);   /* ずらした水色の影 */
  /* 方眼（参考画像の背景のマス目） */
  --grid: linear-gradient(rgba(90,203,203,.28) 1px, transparent 1px) 0 0 / 18px 18px,
          linear-gradient(90deg, rgba(90,203,203,.28) 1px, transparent 1px) 0 0 / 18px 18px;
  /* お店の種類ごとの色は app.js の CATEGORIES で指定し、各要素に --c として渡す */
  --radius: 12px;
  --font: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  --font-head: "Dela Gothic One", var(--font);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.8;
  color: var(--ink);
  background: var(--bg);
  line-break: strict;     /* 日本語の禁則処理 */
  overflow: hidden;
}
#map { position: fixed; inset: 0; }
/* 地図の上に細かい網点（ドット）を重ねて、昔の印刷物のようなレトロ感を出す（ひこさんの指示）
   ・深い青緑の点と、半分ずらしたピンクの点の2層で、刷りのズレっぽさを出す
   ・multiply で重ねるので、地図の色はそのまま、少しだけざらっとした質感になる
   ・pointer-events: none で地図の操作は邪魔しない */
#map::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(rgba(27, 79, 94, .16) .9px, transparent 1.3px) 0 0 / 5px 5px,
    radial-gradient(rgba(242, 86, 154, .09) .9px, transparent 1.3px) 2.5px 2.5px / 5px 5px;
  mix-blend-mode: multiply;
}
/* ピンと右下のボタンは網点より上に出す（網点がかぶらないように） */
#map .maplibregl-marker { z-index: 2; }
#map .maplibregl-control-container { position: relative; z-index: 2; }

/* ===== ヘッダー（タイトルとエリア切り替え） ===== */
.topbar {
  position: fixed; top: 16px; left: 16px; right: 16px;
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; /* タブの上端をロゴの上端にそろえる */
  pointer-events: none; /* 地図操作を妨げない */
  z-index: 10;
}
.topbar > * { pointer-events: auto; }
.logo {
  background: var(--panel);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--pop-shadow-aqua);
  background: var(--grid), var(--panel);
  padding: 10px 36px;     /* ロゴを小さくした分、左右の余白で枠の幅（298px）を一覧カードにそろえる */
  position: relative;
  line-height: 0;
}
/* ロゴ画像（横:縦 ≒ 2:1） */
.logo-img { display: block; width: 220px; height: auto; position: relative; } /* ひこさんの指示で小さく。枠の幅（220＋余白72＋フチ6＝298px）は一覧カードの幅にそろえる */
/* ロゴのまわりの紙吹雪（星・波線・丸。参考画像のメンフィス柄） */
.logo::before, .logo::after {
  content: ""; position: absolute; pointer-events: none;
  background: no-repeat center / contain;
}
.logo::before {
  width: 44px; height: 44px; right: -22px; top: -16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 2l4.5 11.5L36 18l-11.5 4.5L20 34l-4.5-11.5L4 18l11.5-4.5z' fill='%23FFE55C' stroke='%231B4F5E' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E");
  animation: twinkle 2.4s ease-in-out infinite;
}
.logo::after {
  width: 54px; height: 22px; left: -14px; bottom: -14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 54 22'%3E%3Cpath d='M3 15c6-10 10-10 16 0s10 10 16 0 10-10 16 0' fill='none' stroke='%23FF8DB5' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E");
}
/* ロゴ（C案：足あとの道）。文字の下に、行った店を点でつないだ道を引く */
.logo-mark { display: inline-block; line-height: 1; }
.logo-text { display: flex; align-items: baseline; gap: .3em; font-size: 30px; }
.logo-kobe { font-weight: 900; }
.logo-en { font-family: "Outfit", var(--font); font-weight: 600; }
.logo-path { display: block; width: 0; min-width: 100%; height: auto; margin-top: 5px; color: var(--accent); }
.logo-ja { display: block; font-size: 14px; font-weight: 500; color: var(--muted); margin-top: 8px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font: inherit; font-size: 16px; font-weight: 700; line-height: 1.4;
  cursor: pointer;
  padding: 8px 18px;
  border-radius: var(--radius);            /* カードと同じ角丸四角形 */
  border: 3px solid var(--line);
  background: var(--panel); color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transition: background .2s, color .2s, transform .15s, box-shadow .15s;
}
/* 押すとベタ影の分だけ沈む */
.chip:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); background: var(--lemon); }
.chip:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.chip.is-active { background: var(--c, var(--accent)); color: #fff; box-shadow: 3px 3px 0 var(--lemon), 3px 3px 0 2.5px var(--ink); }
/* タブの丸印＝ピンの色。どの色がどの種類か分かるようにする */
/* タブのアイコン：種類の色の丸の中に白いアイコン。ホバーでボヨンと弾む */
.chip-icon {
  display: inline-grid; place-items: center; vertical-align: middle;
  width: 28px; height: 28px; margin: -4px 8px -4px -6px;
  border-radius: 50%; border: 2px solid var(--ink);
  background: var(--c); color: #fff;
  transform-origin: 50% 100%;
}
.chip-icon svg { width: 17px; height: 17px; }
.chip.is-active .chip-icon { background: #fff; color: var(--c); }
.chip:hover .chip-icon { animation: chipBoing .7s cubic-bezier(.28, .84, .42, 1); }
@keyframes chipBoing {
  0%   { transform: scale(1, 1); }
  20%  { transform: scale(1.25, .75); }   /* つぶれる */
  40%  { transform: translateY(-9px) scale(.85, 1.2); } /* 伸びて跳ねる */
  60%  { transform: translateY(0) scale(1.12, .9); }    /* 着地 */
  80%  { transform: translateY(-3px) scale(.97, 1.04); }
  100% { transform: scale(1, 1); }
}
.chip .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); border: 2px solid var(--ink); margin-right: 8px; vertical-align: 1px; }
.chip.is-active .dot { background: #fff; }

/* タブを丸いボタンにして、ロゴの右に2×2で並べる（ひこさんのラフ：アイコンが上、文字が下）
   丸の大きさは、2段でロゴ枠の高さ（約132px）にそろうように 62px×2＋すき間8px */
.chips {
  display: grid; grid-template-columns: repeat(2, 62px); grid-auto-rows: 62px; gap: 8px;
  padding-top: 0;
}
.chips .chip {
  width: 62px; height: 62px; padding: 0;
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12px; line-height: 1.2; letter-spacing: .02em;
}
.chips .chip-icon { margin: 0; width: 26px; height: 26px; }

/* ===== お店一覧 ===== */
/* 外枠はなくし、カードを1枚ずつ独立させる。ベタ影が切れないよう、内側に余白をとる */
.list {
  position: fixed; left: 10px; top: 165px; bottom: 10px; /* ロゴ（横:縦 ≒ 2:1）の下に、影と波線の飾りぶん余白をあけて置く */
  width: 316px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 22px;   /* カードとカードの間（ここに点線を引く） */
  padding: 6px 12px 14px 6px;
  z-index: 5;
  scrollbar-width: thin;
}
.list-item {
  position: relative; flex: none;
  display: flex; align-items: flex-start; gap: 12px;
  text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  background: var(--panel);
  padding: 26px 16px 14px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  /* 上のタイトルバー（種類の色）＋白い丸3つ＋バーの下線 */
  background:
    radial-gradient(circle at 12px 7px, #fff 3px, transparent 3.5px),
    radial-gradient(circle at 24px 7px, #fff 3px, transparent 3.5px),
    radial-gradient(circle at 36px 7px, #fff 3px, transparent 3.5px),
    linear-gradient(to bottom, var(--c, var(--accent)) 0 14px, var(--ink) 14px 16.5px, var(--panel) 16.5px);
  box-shadow: var(--pop-shadow);
  transition: background .2s, opacity .3s, transform .15s, box-shadow .15s;
}
/* カードの間の短い点線（最初のカードの上には引かない） */
.list-item + .list-item::before {
  content: ""; position: absolute; left: 50%; top: -15px; width: 72px; margin-left: -36px;
  border-top: 3px dotted var(--ink); opacity: .5; pointer-events: none;
}
/* 影の色を、ピンク・水色・紫・レモンの順に変えてにぎやかに */
.list-item:nth-child(4n+2) { box-shadow: var(--pop-shadow-aqua); }
.list-item:nth-child(4n+3) { box-shadow: 5px 5px 0 var(--lilac); }
.list-item:nth-child(4n)   { box-shadow: 5px 5px 0 var(--lemon); }
.list-item:hover, .list-item.is-hover { transform: translate(-2px, -3px) rotate(-1deg); }
/* 種類で絞り込んだとき、ほかの種類のカードは一覧から消す（ひこさんの指示） */
.list-item.is-dim { display: none; }
.list-item.is-active { outline: 3px solid var(--lemon); outline-offset: 3px; }

/* ピンが落ちたあと、カードが上から順にぽよんと現れる。
   .is-ready が付くまでは隠しておく（app.js でピンの着地に合わせて付ける） */
.list:not(.is-ready) .list-item { opacity: 0; }
.list.is-ready .list-item {
  /* fill-mode を backwards にするのは、アニメ終了後に元の見た目へ戻すため */
  animation: cardIn .75s linear backwards;
  animation-delay: calc(var(--i) * .08s);
}
.list-num {
  flex: none; width: 28px; height: 28px; border-radius: 50%; margin-top: 2px;
  display: grid; place-items: center;
  background: var(--c, var(--accent)); color: #fff; font-size: 14px; font-weight: 800; line-height: 1;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
/* 店名と説明は別の行に分ける */
.list-name { display: block; font-size: 17px; font-weight: 800; line-height: 1.5; word-break: auto-phrase; }
.list-catch { display: block; word-break: auto-phrase; font-size: 14px; color: var(--muted); line-height: 1.6; margin-top: 2px; }

/* ===== ピン ===== */
/* 注意：.pin 本体には MapLibre が transform（位置）と position: absolute を指定する。
   ここで transform を動かすアニメーションや position を書くと、ピンが地図上の位置から外れてしまう。
   そのため、落下アニメーションは内側の .pin-inner にかける。 */
.pin {
  border: 0; background: none; cursor: pointer; padding: 0;
  width: 52px; height: 66px;
}
.pin-inner {
  position: absolute; inset: 0;
  animation: pinDrop .9s linear both;   /* 順番に落ちてきて、着地でぽよんと弾む */
  transform-origin: 50% 100%;
  animation-delay: var(--d);
}
.pin-body {
  position: absolute; left: 50%; top: 0;
  width: 48px; height: 48px; margin-left: -24px;
  border-radius: 50% 50% 50% 0;
  background: var(--c, var(--accent));            /* お店の種類の色 */
  border: 3px solid #fff;                         /* 地図の上で埋もれないよう太めの白フチ */
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.15), 0 0 0 2.5px var(--ink); /* ぷっくり感＋外側にこげ紺のフチ */
  transform: rotate(-45deg);
  transition: transform .3s var(--ease-back);
}
.pin-icon {
  position: absolute; left: 50%; top: 11px; margin-left: -13px;
  width: 26px; height: 26px; color: #fff;
  transition: transform .3s var(--ease-back);
}
.pin-steam { display: none; }  /* 湯気の装飾はやめる */
.pin-shadow {
  position: absolute; left: 50%; bottom: 2px; width: 26px; height: 9px; margin-left: -13px;
  border-radius: 50%; background: rgba(60,50,30,.22);
  transition: transform .3s var(--ease-back), opacity .3s;
}
.pin-label {
  position: absolute; left: 50%; top: -34px; transform: translate(-50%, 6px);
  white-space: nowrap; font-size: 14px; font-weight: 700; line-height: 1.4;
  background: var(--mustard); color: var(--ink); padding: 4px 12px; border-radius: 999px;
  border: 2.5px solid var(--ink); box-shadow: 2px 2px 0 var(--ink);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .3s var(--ease-out);
}
.pin:hover .pin-body, .pin.is-hover .pin-body { transform: translateY(-8px) rotate(-45deg) scale(1.08); }
.pin:hover .pin-icon, .pin.is-hover .pin-icon { transform: translateY(-8px) scale(1.08); }
.pin:hover .pin-shadow, .pin.is-hover .pin-shadow { transform: scale(.7); opacity: .5; }
.pin:hover .pin-label, .pin.is-hover .pin-label { opacity: 1; transform: translate(-50%, -6px); }

/* 選択中：大きくなって波紋が広がる（どこを見ているか分かるので残す） */
.pin.is-active { z-index: 3; }
.pin.is-active .pin-body { transform: translateY(-10px) rotate(-45deg) scale(1.25); }
.pin.is-active .pin-icon { transform: translateY(-10px) scale(1.25); }
.pin.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: 0; width: 40px; height: 14px; margin-left: -20px;
  border-radius: 50%; border: 2px solid var(--c, var(--accent));
  animation: ripple 1.6s ease-out infinite;
}
/* 絞り込み中、ほかの種類のピンは地図から消す。
   注意：MapLibre が .pin 本体に style="opacity: 1" を直接書き込むため、.pin の opacity は効かない。
   また .pin-inner は落下アニメ（fill-mode: both）が opacity を握ったままなので、これも効かない。
   そこで .pin-inner のさらに中身（影・本体・アイコンなど）を透明にし、クリックも効かなくする */
.pin.is-dim { pointer-events: none; }
.pin.is-dim .pin-inner > * { opacity: 0; transition: opacity .3s; }

/* ===== 詳細カード ===== */
.card {
  position: fixed; top: 16px; right: 16px; bottom: 16px;
  width: 400px; max-width: calc(100% - 32px);
  background: var(--panel);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 7px 7px 0 var(--aqua), 7px 7px 0 3px var(--ink);
  overflow: hidden auto; z-index: 20;
  transform: translateX(calc(100% + 40px));
  transition: transform .5s var(--ease-out);
}
.card.is-open { transform: none; }
.card-close {
  position: absolute; top: 11px; right: 12px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--line); cursor: pointer;
  background: var(--panel); color: var(--ink); font-size: 22px; line-height: 1;
}
.card-close:hover { background: var(--lemon); }
/* 写真の代わりの装飾グラフィックは出さない（自分の写真が入ったらここに表示する） */
.card-visual { display: none; }
/* 上のタイトルバー：種類の色＋白い丸3つ＋紙吹雪 */
.card::before {
  content: ""; display: block; height: 64px;
  border-bottom: 3px solid var(--ink);
  background:
    radial-gradient(circle at 20px 18px, #fff 5px, transparent 5.5px),
    radial-gradient(circle at 38px 18px, #fff 5px, transparent 5.5px),
    radial-gradient(circle at 56px 18px, #fff 5px, transparent 5.5px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 64'%3E%3Cg stroke='%231B4F5E' stroke-width='2.5' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M92 40l4 9 9 4-9 4-4 9-4-9-9-4 9-4z' fill='%23FFE55C'/%3E%3Ccircle cx='140' cy='22' r='7' fill='%23FF8DB5'/%3E%3Crect x='176' y='34' width='14' height='14' transform='rotate(20 183 41)' fill='%239B87F5'/%3E%3Cpath d='M206 18c5-8 9-8 14 0s9 8 14 0' fill='none' stroke='%23FFFFFF' stroke-width='5'/%3E%3Cpath d='M118 50l14-8' fill='none' stroke='%23FFFFFF' stroke-width='5'/%3E%3C/g%3E%3C/svg%3E") right 40px center / 260px 64px no-repeat,
    radial-gradient(rgba(255,255,255,.35) 1.5px, transparent 2px) 0 0 / 10px 10px,
    var(--c, var(--accent));
}
.card-body { padding: 24px 28px 32px; background: var(--grid); }
/* カードを開いた時、中身が上から順番にポンポンと出てくる（カードが滑り込むのに合わせて少し遅らせる） */
.card.is-open .card-body > * { animation: cardPop .45s var(--ease-back) backwards; animation-delay: calc(.3s + var(--n, 0) * .09s); }
.card-body > :nth-child(2) { --n: 1; }
.card-body > :nth-child(3) { --n: 2; }
.card-body > :nth-child(4) { --n: 3; }
.card-body > :nth-child(5) { --n: 4; }
.card-body > :nth-child(6) { --n: 5; }
.card-body > :nth-child(7) { --n: 6; }
.card-body > :nth-child(8) { --n: 7; }
@keyframes cardPop {
  from { opacity: 0; transform: translateY(14px) scale(.85); }
  to   { opacity: 1; transform: none; }
}
.card-area { display: inline-block; font-size: 13px; font-weight: 800; color: var(--ink); background: var(--lemon); border: 2px solid var(--ink); border-radius: 999px; padding: 1px 12px; margin-right: 48px; }
.card-name { font-family: var(--font-head); font-weight: 400; font-size: 26px; line-height: 1.4; text-shadow: 2px 2px 0 var(--pink), 3px 3px 0 var(--lemon); margin-top: 4px; padding-right: 32px; word-break: auto-phrase; } /* 単語の途中で改行しない（対応ブラウザのみ） */
.card-catch { font-size: 18px; font-weight: 700; margin-top: 14px; line-height: 1.7; }
.card-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin-top: 20px; font-size: 16px; line-height: 1.7; }
.card-meta dt { color: var(--muted); }
.card-story { font-size: 17px; line-height: 1.9; margin-top: 20px; text-wrap: pretty; }
.card-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 20px; }
.card-tags { gap: 8px; }
.card-tags li { font-size: 14px; font-weight: 700; color: var(--ink); background: var(--aqua-pale); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 12px; }
.card-btn {
  display: block; text-align: center; margin-top: 28px;
  padding: 14px; border-radius: 999px;
  background: var(--accent); color: #fff; text-decoration: none; font-weight: 800; font-size: 16px;
  border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--lemon), 5px 5px 0 3px var(--ink);
  transition: background .2s, transform .15s, box-shadow .15s;
}
.card-btn:hover { background: var(--accent-dark); transform: translate(-1px, -1px); }
.card-btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }

/* ===== リセットボタン ===== */
.reset {
  position: fixed; right: 176px; bottom: 40px; z-index: 6; /* 右下の犬をよけて左に寄せる */
  border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 16px; line-height: 1.4;
  padding: 10px 20px; border-radius: 999px;
  background: var(--lemon); color: var(--ink);
  border: 3px solid var(--ink); box-shadow: var(--pop-shadow);
  transition: transform .15s, box-shadow .15s;
}
.reset:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.reset:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }

/* ===== ローディング画面 ===== */
/* 方眼のクリーム地に、犬がぴょこぴょこ跳ねる。地図の準備ができたらふわっと消える */
.loader {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: var(--grid), var(--bg);
  transition: opacity .5s ease, visibility .5s;
}
.loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
/* 紙吹雪（星とピンクの波線）を左上と右下に */
.loader::before, .loader::after { content: ""; position: absolute; background: no-repeat center / contain; }
.loader::before {
  width: 70px; height: 70px; left: 18%; top: 22%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 2l4.5 11.5L36 18l-11.5 4.5L20 34l-4.5-11.5L4 18l11.5-4.5z' fill='%23FFE55C' stroke='%231B4F5E' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E");
  animation: twinkle 2.4s ease-in-out infinite;
}
.loader::after {
  width: 90px; height: 36px; right: 18%; bottom: 24%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 54 22'%3E%3Cpath d='M3 15c6-10 10-10 16 0s10 10 16 0 10-10 16 0' fill='none' stroke='%23FF8DB5' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E");
}
.loader-stage { position: relative; width: 150px; height: 190px; }
.loader-dog {
  position: absolute; left: 0; bottom: 10px; width: 150px; height: auto;
  transform-origin: 50% 100%;
  animation: dogHop 1s linear infinite;
}
/* 足もとの影：犬が高く跳ぶと小さく薄くなる */
.loader-shadow {
  position: absolute; left: 50%; bottom: 0; width: 110px; height: 18px; margin-left: -55px;
  border-radius: 50%; background: rgba(27, 79, 94, .2);
  animation: dogShadow 1s linear infinite;
}
.loader-text {
  font-family: var(--font-head); font-size: 20px; letter-spacing: .08em; color: var(--ink);
  background: var(--panel); border: 3px solid var(--ink); border-radius: 999px;
  padding: 4px 22px; box-shadow: var(--pop-shadow);
}
/* 考えごとの吹き出し：犬の右上に、小さな丸→大きな雲の順に浮かぶ */
.loader-think { position: absolute; left: 112px; top: -92px; width: 120px; height: 120px; pointer-events: none; }
.think-dot {
  position: absolute; border-radius: 50%; background: var(--panel); border: 3px solid var(--ink);
  animation: thinkPop .4s var(--ease-back) both;
}
.think-dot1 { width: 12px; height: 12px; left: 0; bottom: 6px; animation-delay: .1s; }
.think-dot2 { width: 20px; height: 20px; left: 14px; bottom: 22px; animation-delay: .25s; }
.think-cloud {
  position: absolute; right: 0; top: 0; width: 92px; height: 78px;
  background: var(--panel); border: 3px solid var(--ink); border-radius: 46px 46px 40px 40px / 40px 40px 38px 38px;
  box-shadow: 4px 4px 0 var(--aqua);
  animation: thinkPop .45s var(--ease-back) .4s both, thinkFloat 2.4s ease-in-out .85s infinite;
}
/* 雲の中の食べ物：0.45秒ずつ順番に入れ替わる（4つで1.8秒＝ちょうど表示時間ぶん） */
.think-food {
  position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px 0 0 -25px;
  opacity: 0; animation: foodSwap 1.8s linear infinite;
}
.think-food:nth-child(2) { animation-delay: .45s; }
.think-food:nth-child(3) { animation-delay: .9s; }
.think-food:nth-child(4) { animation-delay: 1.35s; }

/* 「...」が1つずつ点滅する */
.loader-text span { animation: dotBlink 1.2s infinite both; }
.loader-text span:nth-child(2) { animation-delay: .2s; }
.loader-text span:nth-child(3) { animation-delay: .4s; }

/* ===== アニメーション定義（ピンの落下・一覧カードの登場・波紋） ===== */
/* 落ちてきて、着地でつぶれて、ぽよんと戻る */
@keyframes pinDrop {
  0%   { opacity: 0; transform: translateY(-140px); animation-timing-function: cubic-bezier(.55, 0, 1, .45); }
  45%  { opacity: 1; transform: translateY(0) scale(1, 1); }
  58%  { transform: translateY(0) scale(1.18, .78); }
  72%  { transform: translateY(-14px) scale(.94, 1.08); }
  86%  { transform: translateY(0) scale(1.05, .95); }
  100% { opacity: 1; transform: none; }
}
/* 一覧カード：上からふわっと落ちて、着地でむにっとつぶれて、ぽよんと戻る（ピンと同じ動き方を小さめに） */
@keyframes cardIn {
  0%   { opacity: 0; transform: translateY(-28px); animation-timing-function: cubic-bezier(.55, 0, 1, .45); }
  40%  { opacity: 1; transform: translateY(0) scale(1, 1); }
  55%  { transform: translateY(0) scale(1.04, .9); }
  72%  { transform: translateY(-6px) scale(.98, 1.03); }
  88%  { transform: translateY(0) scale(1.01, .99); }
  100% { opacity: 1; transform: none; }
}
/* ロゴの星：ゆっくり回ってきらっとする */
@keyframes twinkle {
  0%, 100% { transform: rotate(0) scale(1); }
  50%      { transform: rotate(20deg) scale(1.15); }
}
/* 犬：しゃがんで → ぴょんと跳ねて → 着地でむにっとつぶれる */
@keyframes dogHop {
  0%   { transform: translateY(0) scale(1.08, .9); animation-timing-function: cubic-bezier(.2, .7, .4, 1); }
  15%  { transform: translateY(0) scale(.95, 1.06); animation-timing-function: cubic-bezier(.2, .7, .4, 1); }
  50%  { transform: translateY(-46px) scale(1, 1) rotate(-3deg); animation-timing-function: cubic-bezier(.6, 0, .8, .3); }
  85%  { transform: translateY(0) scale(1.1, .88); }
  100% { transform: translateY(0) scale(1.08, .9); }
}
@keyframes dogShadow {
  0%, 15%, 85%, 100% { transform: scale(1); opacity: 1; }
  50%                { transform: scale(.6); opacity: .5; }
}
@keyframes dotBlink {
  0%, 100% { opacity: .15; }
  40%      { opacity: 1; }
}
/* 吹き出しがぽこっと出る */
@keyframes thinkPop {
  0%   { opacity: 0; transform: scale(.3); }
  100% { opacity: 1; transform: scale(1); }
}
/* 雲がふわふわ浮く */
@keyframes thinkFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
/* 食べ物：ぽんと出て、少し揺れて、消える（4分の1の時間だけ見える） */
@keyframes foodSwap {
  0%   { opacity: 0; transform: scale(.4) rotate(-12deg); }
  6%   { opacity: 1; transform: scale(1.12) rotate(4deg); }
  12%  { opacity: 1; transform: scale(1) rotate(0); }
  22%  { opacity: 1; transform: scale(1) rotate(-3deg); }
  25%  { opacity: 0; transform: scale(.8) rotate(0); }
  100% { opacity: 0; }
}
@keyframes ripple {
  0%   { transform: scale(.6); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* ===== スマホ ===== */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .list { display: none; }
  .logo-text { font-size: 24px; }
  .card {
    top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 72vh;
    transform: translateY(calc(100% + 40px));
  }
  .reset { bottom: 30px; }
}

/* 地図の右下のズームボタンもレトロに */
.maplibregl-ctrl-group { border: 3px solid var(--ink) !important; border-radius: 12px !important; box-shadow: var(--pop-shadow) !important; overflow: hidden; }

/* 動きを減らす設定の人への配慮 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* ===== 右下の犬（次のおすすめ） ===== */
/* 犬の画像は下半分が画面の外に出るように置き、上半身だけ見せる */
.maplibregl-ctrl-bottom-right { right: 160px !important; } /* ズームボタンも犬をよける */
.buddy {
  position: fixed; right: 18px; bottom: -28px; z-index: 15;
  width: 140px; height: 153px;
}
.buddy-dog-btn { border: 0; background: none; padding: 0; cursor: pointer; display: block; }
.buddy-dog {
  display: block; width: 140px; height: auto;
  transform-origin: 50% 100%;
  animation: buddyHop 6s ease-in-out infinite; /* 6秒ごとにぴょん */
}
.buddy-dog-btn:hover .buddy-dog { animation: buddyHop .9s ease-in-out; }
@keyframes buddyHop {
  0%, 82%, 100% { transform: translateY(0) scale(1, 1); }
  85% { transform: translateY(0) scale(1.08, .92); }     /* しゃがむ */
  90% { transform: translateY(-26px) scale(.95, 1.06); } /* ぴょん */
  95% { transform: translateY(0) scale(1.06, .94); }     /* 着地 */
  98% { transform: translateY(-4px) scale(1, 1); }
}

/* 吹き出し（「次、どこ行く？」をずっと表示。ふわふわ上下にゆれる） */
.buddy-bubble {
  position: absolute; right: 60px; bottom: 150px; white-space: nowrap;
  font: inherit; font-size: 15px; font-weight: 700; line-height: 1.4; color: var(--ink);
  background: var(--panel); border: 3px solid var(--ink); border-radius: 999px;
  padding: 8px 16px; cursor: pointer; box-shadow: 4px 4px 0 var(--lemon);
  opacity: 0; transform: translateY(8px) scale(.8); transform-origin: 85% 100%;
  pointer-events: none; transition: opacity .25s, transform .35s cubic-bezier(.34, 1.56, .64, 1);
}
.buddy-bubble::after { /* 吹き出しのしっぽ */
  content: ""; position: absolute; right: 22px; bottom: -11px; width: 14px; height: 14px;
  background: var(--panel); border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink);
  transform: rotate(45deg);
}
.buddy-bubble.is-show { opacity: 1; transform: none; pointer-events: auto; animation: bubbleFloat 2.6s ease-in-out infinite; }
@keyframes bubbleFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
.buddy-bubble:hover { background: var(--lemon); }

/* おすすめのお店カード */
.buddy-pop {
  position: absolute; right: 30px; bottom: 210px; width: 320px; /* 吹き出しの上に出す */
  background: var(--panel); border: 3px solid var(--ink); border-radius: 16px;
  box-shadow: var(--pop-shadow); padding: 16px 18px 18px;
  animation: buddyPopIn .4s cubic-bezier(.34, 1.56, .64, 1);
}
.buddy-pop[hidden] { display: none; }
@keyframes buddyPopIn { from { opacity: 0; transform: translateY(10px) scale(.85); } to { opacity: 1; transform: none; } }
.buddy-close {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--panel); color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer;
}
.buddy-pop-head { font-size: 14px; font-weight: 700; color: var(--muted, #5F6368); }
.buddy-pop-cat { font-size: 14px; font-weight: 700; color: var(--c, var(--ink)); margin-top: 6px; }
.buddy-pop-name { font-size: 19px; font-weight: 700; line-height: 1.4; margin-top: 2px; padding-right: 8px; word-break: auto-phrase; }
.buddy-pop-memo { font-size: 14px; color: var(--muted, #5F6368); margin-top: 4px; }
.buddy-pop-actions { display: flex; gap: 8px; margin-top: 12px; }
.buddy-link, .buddy-next {
  flex: 1; text-align: center; font: inherit; font-size: 14px; font-weight: 700; line-height: 1.4;
  padding: 8px 6px; border-radius: 999px; border: 2px solid var(--ink); cursor: pointer; text-decoration: none;
}
.buddy-link { background: var(--ink); color: #fff; }
.buddy-next { background: var(--lemon); color: var(--ink); }

/* ===== 質問ポップアップ（右下の犬） ===== */
.quiz.is-swap { animation: buddyPopIn .35s cubic-bezier(.34, 1.56, .64, 1); }
.quiz-step { font-size: 13px; font-weight: 800; color: var(--pink-deep, #F2569A); padding-right: 34px; display: flex; align-items: center; gap: 8px; }
.quiz-dots { display: inline-flex; gap: 4px; }
.quiz-dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--ink); background: var(--panel); }
.quiz-dot.is-on { background: var(--lemon); }
.quiz-q { font-family: var(--font-head, inherit); font-weight: 400; font-size: 20px; line-height: 1.4; margin: 6px 0 12px; }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quiz-opt {
  font: inherit; font-size: 15px; font-weight: 800; line-height: 1.35; color: var(--ink);
  min-height: 52px; padding: 8px 6px; cursor: pointer;
  background: var(--panel); border: 3px solid var(--ink); border-radius: 12px;
  box-shadow: 3px 3px 0 var(--aqua);
  transition: transform .15s, box-shadow .15s, background .2s;
}
.quiz-options.is-two .quiz-opt { min-height: 70px; }
.quiz-opt:nth-child(2) { box-shadow: 3px 3px 0 var(--pink); }
.quiz-opt:nth-child(3) { box-shadow: 3px 3px 0 var(--lilac); }
.quiz-opt:nth-child(4) { box-shadow: 3px 3px 0 var(--lemon); }
.quiz-opt:hover { background: var(--lemon); transform: translate(-1px, -1px); }
.quiz-opt:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.quiz-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quiz-badge { font-size: 12px; font-weight: 800; padding: 1px 10px; border: 2px solid var(--ink); border-radius: 999px; background: var(--aqua-pale, #CFF1EF); }
.quiz-badge.is-cat { background: var(--c, var(--accent)); color: #fff; }
.quiz-name { font-family: var(--font-head, inherit); font-weight: 400; font-size: 22px; line-height: 1.4; margin-top: 8px; word-break: auto-phrase; text-shadow: 2px 2px 0 var(--lemon); }
.quiz-memo { font-size: 14px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.quiz-actions { display: flex; gap: 8px; margin-top: 14px; }
.quiz-btn {
  flex: 1; text-align: center; font: inherit; font-size: 14px; font-weight: 800; line-height: 1.4;
  padding: 9px 6px; border-radius: 12px; border: 3px solid var(--ink); cursor: pointer; text-decoration: none;
  background: var(--c, var(--accent)); color: #fff; box-shadow: 3px 3px 0 var(--ink);
}
.quiz-btn.is-sub { background: var(--lemon); color: var(--ink); }
.quiz-btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.quiz-retry { display: block; margin: 10px auto 0; border: 0; background: none; font: inherit; font-size: 13px; color: var(--muted); text-decoration: underline; cursor: pointer; }

@media (max-width: 760px) {
  .buddy-pop { right: 0; width: min(320px, calc(100vw - 24px)); }
  .buddy { right: 6px; width: 110px; bottom: -22px; }
  .buddy-dog { width: 110px; }
  .reset { right: 130px; }
}


/* ===== お店カードの写真カルーセル ===== */
.gallery { position: relative; margin-top: 28px; }
.gallery-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  border: 3px solid var(--ink); border-radius: 16px; background: var(--panel);
  box-shadow: var(--pop-shadow);
  scrollbar-width: none;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide {
  flex: 0 0 100%; aspect-ratio: 4 / 3; margin: 0; scroll-snap-align: start;
  position: relative; overflow: hidden;
}
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 仮画像：種類の色の地に、ドット柄と大きなアイコン */
.gallery-slide.is-dummy {
  display: grid; place-items: center; align-content: center; gap: 10px;
  background:
    radial-gradient(rgba(255,255,255,.35) 2px, transparent 2.5px) 0 0 / 16px 16px,
    var(--c);
  color: #fff;
}
.gallery-dummy-icon { width: 72px; height: 72px; display: block; }
.gallery-dummy-icon svg { width: 100%; height: 100%; }
.gallery-slide figcaption {
  font-size: 15px; font-weight: 800; color: var(--ink);
  background: var(--panel); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 14px;
}
.gallery-nav {
  position: absolute; top: calc(50% - 32px); width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--ink); background: var(--lemon); color: var(--ink);
  font-size: 26px; font-weight: 800; line-height: 1; cursor: pointer;
  display: grid; place-items: center; padding-bottom: 4px;
  transition: transform .15s;
}
.gallery-nav:hover { transform: scale(1.1); }
.gallery-prev { left: -10px; }
.gallery-next { right: -6px; }
.gallery-dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.gallery-dot {
  width: 12px; height: 12px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 2px solid var(--ink); background: var(--panel); transition: transform .2s, background .2s;
}
.gallery-dot.is-active { background: var(--accent); transform: scale(1.25); }
