/* 柳川村一夜村民 — 紙マップの世界観。ライトモード固定。 */
:root {
  color-scheme: light only;
  --bg: #f3e9da;        /* ベージュ（地） */
  --surface: #fffaf1;
  --cream: #fff6dc;     /* お願いカード */
  --ink: #3b2416;       /* 焦げ茶（文字・見出し） */
  --ink-2: #6b4a33;
  --line: #dccab0;
  --lantern: #f0a35e;   /* 提灯の橙（装飾・濃い文字と組む） */
  --accent: #b14a12;    /* 強調ボタン（白文字 5.4:1） */
  --accent-press: #8f3a0c;
  --paper: #1f5f8b;     /* 紙地圖資訊 */
  --web: #2e6b3a;       /* 網路資訊 */
  --unsure: #9a3412;    /* 未確認 */
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font-zh: system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --font-ja: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-zh); font-size: 16px; line-height: 1.6;
  overflow-x: hidden;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b));
}
:lang(ja) { font-family: var(--font-ja); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 2000; background: var(--surface); padding: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.view { min-height: calc(100vh - var(--tabbar-h)); }
.wrap { padding: 16px; max-width: 640px; margin: 0 auto; }
h1, h2, h3 { color: var(--ink); line-height: 1.35; margin: 0 0 8px; }
h2 { font-size: 20px; }
.muted { color: var(--ink-2); }
.small { font-size: 16px; }   /* 補足のみに使用 */
.pre { white-space: pre-line; }

/* ボタン */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 10px 16px; border-radius: 12px;
  border: 2px solid var(--ink); background: var(--surface); color: var(--ink);
  font-size: 17px; font-weight: 700; text-decoration: none; text-align: center; cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:active { background: var(--accent-press); }
.btn-quiet { border-width: 1px; font-weight: 600; min-height: 48px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn svg { width: 22px; height: 22px; fill: currentColor; flex: none; }

/* 下の固定メニュー */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--ink); box-shadow: 0 -2px 8px rgba(0,0,0,.15);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #f3e9da; text-decoration: none; font-size: 15px; font-weight: 600; min-height: 48px; gap: 2px;
}
.tabbar .ti svg { width: 24px; height: 24px; fill: currentColor; }
.tabbar a[aria-current="page"] { color: #fff; background: #5a3820; box-shadow: inset 0 3px 0 var(--lantern); }

/* トップ（夕暮れのグラデーションはここだけ） */
.hero { background: linear-gradient(180deg, #2a1730 0%, #4a2230 45%, #7a3418 100%); color: #fff; }
.hero-img { width: 100%; height: auto; aspect-ratio: 900 / 763; max-height: 52vh; object-fit: cover; object-position: 55% 45%; }
.hero-text { padding: 20px 16px 28px; }
.hero .concept { font-size: 32px; font-weight: 800; letter-spacing: .06em; color: #fff; margin: 0 0 12px; }
.hero .copy { font-size: 22px; font-weight: 700; margin: 0; color: #fff; }
.hero .copy-ja { font-size: 15px; margin: 2px 0 14px; color: #f6dcc4; }
.hero .lead { margin: 0; color: #fbeee0; }
.welcome { background: var(--lantern); color: var(--ink); font-weight: 700; padding: 12px 16px; }
.features { display: grid; gap: 12px; }
.feature { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-decoration: none; color: var(--ink); min-height: 88px; }
.feature img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.feature .ficon { width: 72px; height: 72px; border-radius: 10px; background: var(--lantern); display: grid; place-items: center; font-size: 30px; font-weight: 800; }
.feature h3 { font-size: 18px; margin: 0 0 2px; }
.feature p { margin: 0; color: var(--ink-2); }
.section-b { margin-top: 24px; padding: 16px; border-radius: 14px; background: var(--cream); border: 2px dashed var(--lantern); }
.section-b h2 { font-size: 22px; }
.book { margin-top: 24px; }
.book .note { margin: 8px 0 0; color: var(--ink-2); font-size: 15px; text-align: center; }
html[data-entry="hotel"] .book .btn { background: var(--surface); color: var(--ink); border: 1px solid var(--line); font-weight: 600; font-size: 16px; min-height: 48px; }
.foot { margin-top: 24px; color: var(--ink-2); font-size: 16px; }
.foot p { margin: 0 0 8px; }
.src-link { display: inline-flex; align-items: center; min-height: 48px; padding: 0 6px; }

/* 地図 */
.view-map { position: relative; height: calc(100vh - var(--tabbar-h) - var(--safe-b)); height: calc(100dvh - var(--tabbar-h) - var(--safe-b)); min-height: 0; }
.map { position: absolute; inset: 0; background: #efe6d8; }
.leaflet-container { font-family: var(--font-zh); background: #efe6d8; }
.lantern-icon { background: none; border: 0; }
.lantern {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: max(48px, var(--lsz, 48px)); height: max(48px, var(--lsz, 48px));
  display: grid; place-items: center; padding: 0; border: 0; background: none; cursor: pointer;
}
.lantern span {
  display: grid; place-items: center;
  width: var(--lvis, 30px); height: calc(var(--lvis, 30px) * 1.08);
  border-radius: 42% / 36%; background: radial-gradient(circle at 50% 40%, #ffd08a 0, #f0a35e 55%, #d9712c 100%);
  border: 2px solid #5a3110; box-shadow: 0 2px 3px rgba(0,0,0,.35);
  color: #2a1608; font-weight: 800; font-size: var(--lfs, 14px); line-height: 1;
}
.map-hint { transition: opacity .4s; }
.map-hint.is-hidden { opacity: 0; }
/* 地図の通り名・目印名（言語に合わせて重ねる文字） */
.map-label {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  white-space: nowrap; text-align: center; pointer-events: none;
  font-size: 13px; font-weight: 700; line-height: 1.25; color: #4a2c14;
  text-shadow: 0 0 3px #fbf3e4, 0 0 3px #fbf3e4, 0 0 6px #fbf3e4;
}
.map-label.is-street { font-size: 14px; letter-spacing: .08em; color: #6b4a2c; }
#map.map-far .map-label { font-size: 9px; }
#map.map-far .map-label:not(.is-street) { display: none; }
/* 全体表示：提灯を小さく（タップ範囲は28px。拡大すると通常サイズに戻る） */
#map.map-far .lantern { width: 30px; height: 30px; }
#map.map-far .lantern span { width: 21px; height: 22px; font-size: 11px; border-width: 1.5px; }
.lantern.is-closed span { filter: grayscale(.85); opacity: .5; }
.lantern.is-active span { outline: 3px solid var(--accent); outline-offset: 2px; }
.map-hint {
  position: absolute; top: 10px; left: 10px; right: 66px; z-index: 500; pointer-events: none;
  background: rgba(255,250,241,.94); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 15px;
}
.leaflet-control-zoom a { width: 44px !important; height: 44px !important; line-height: 44px !important; font-size: 22px !important; color: var(--ink) !important; }
.map-legend { position: absolute; left: 10px; bottom: 70px; z-index: 500; background: rgba(255,250,241,.94); border-radius: 8px; padding: 4px 8px; font-size: 14px; pointer-events: none; }

/* 下から出る店のカード */
.sheet {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b)); z-index: 900;
  background: var(--surface); border-radius: 18px 18px 0 0; box-shadow: 0 -6px 18px rgba(0,0,0,.25);
  padding: 14px 16px 16px; animation: up .18s ease-out;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: grid; grid-template-columns: 96px 1fr 48px; gap: 12px; align-items: start; }
.sheet-head img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; }
.sheet-close { width: 48px; height: 48px; border: 0; background: none; font-size: 26px; cursor: pointer; color: var(--ink); }
.shop-name { font-size: 22px; font-weight: 800; margin: 0; line-height: 1.3; }
.shop-romaji { margin: 0; color: var(--ink-2); font-size: 16px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.speak {
  display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; margin: -6px 0;
  border: 1.5px solid var(--line); border-radius: 22px; background: #fffaf1; font-size: 20px; line-height: 1; cursor: pointer;
}
.speak:active { background: #f6e3c4; }
.shop-genre { margin: 0; font-size: 16px; }
.today { display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 999px; font-size: 15px; font-weight: 700; border: 1px solid currentColor; }
.today.closed { color: #fff; background: #6b4a33; border-color: #6b4a33; }
.today.open { color: var(--web); }
.today.unknown, .today.irregular { color: var(--ink-2); }
.sheet .btn-row { margin-top: 12px; }

/* 絞り込みチップ（画面下側） */
.chips {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b)); z-index: 800;
  display: flex; gap: 8px; overflow-x: auto; padding: 8px 12px; background: rgba(243,233,218,.96);
  border-top: 1px solid var(--line); scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 48px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--ink-2);
  background: var(--surface); color: var(--ink); font-size: 16px; font-weight: 600; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* 料理一覧 */
.food-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 8px 80px; }
.food-item { position: relative; display: block; text-decoration: none; color: var(--ink); background: var(--surface); border-radius: 10px; overflow: hidden; }
.food-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.food-item .no { position: absolute; top: 6px; left: 6px; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 16px; background: var(--lantern); color: var(--ink); font-weight: 800; display: grid; place-items: center; border: 2px solid #5a3110; }
.food-item .nm { padding: 6px 8px 8px; font-size: 16px; font-weight: 700; line-height: 1.3; }
/* 今日が定休日の店：写真は薄くせず、右上に札を出す */
.food-item .closed-tag { position: absolute; top: 8px; right: 6px; padding: 4px 8px; border-radius: 6px; background: #6b4a33; color: #fff; font-size: 13px; font-weight: 700; line-height: 1.2; }
.page-head { padding: 16px 16px 8px; }
.page-head h1 { font-size: 24px; }
.page-head p { margin: 0; color: var(--ink-2); }

/* 店舗詳細 */
.detail-photo { width: 100%; aspect-ratio: 1; object-fit: cover; max-height: 42vh; }
.detail-top { position: relative; }
.back-btn { position: absolute; top: 10px; left: 10px; min-height: 48px; min-width: 48px; border-radius: 24px; border: 0; background: rgba(255,250,241,.95); color: var(--ink); font-weight: 700; padding: 0 14px; box-shadow: 0 2px 6px rgba(0,0,0,.25); cursor: pointer; }
.detail-title .shop-name { font-size: 28px; }
.info { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px; }
.info-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.info-row:last-child { border-bottom: 0; }
.info-row h2 { font-size: 16px; color: var(--ink-2); margin: 0 0 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.info-row .val { font-size: 18px; font-weight: 600; margin: 0; }
.badge { font-size: 15px; font-weight: 700; padding: 1px 8px; border-radius: 6px; color: #fff; }
.badge.paper { background: var(--paper); }
.badge.web { background: var(--web); }
.badge.checked { background: var(--web); }
.badge.unsure { background: var(--unsure); }
.addr { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.addr .btn { min-height: 48px; min-width: 76px; padding: 0 12px; font-size: 16px; }
.ask-store { margin-top: 16px; padding: 14px; border-radius: 14px; background: var(--cream); border: 1px solid var(--line); }
.ask-store p { margin: 0 0 10px; }
.stack { display: grid; gap: 10px; margin-top: 16px; }
.notice { margin-top: 12px; padding: 10px 12px; border-left: 4px solid var(--unsure); background: #fde9dc; }

/* お願いカード */
.view-card { background: var(--cream); display: flex; flex-direction: column; height: calc(100vh - var(--tabbar-h) - var(--safe-b)); height: calc(100dvh - var(--tabbar-h) - var(--safe-b)); min-height: 0; }
.cards { flex: 1; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.cards::-webkit-scrollbar { display: none; }
.acard { flex: 0 0 100%; width: 100%; scroll-snap-align: center; scroll-snap-stop: always; overflow-y: auto; padding: 20px 18px 12px; display: flex; flex-direction: column; }
.acard .say { font-size: clamp(40px, 11vw, 56px); font-weight: 800; line-height: 1.3; color: #22140a; margin: 8px 0 10px; white-space: pre-line; letter-spacing: .02em; }
.acard .zh { font-size: 17px; color: var(--ink-2); margin: 0 0 12px; }
.acard .shopfor { font-size: 15px; color: var(--ink-2); margin: 0; }
.acard .photo { width: min(70vw, 260px); aspect-ratio: 1; object-fit: cover; border-radius: 12px; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.2); margin: 4px 0 8px; }
.acard .controls { margin-top: auto; padding-top: 12px; display: grid; gap: 10px; }
.stepper { display: grid; grid-template-columns: 64px 1fr 64px; gap: 10px; align-items: center; }
.stepper button { height: 64px; border-radius: 16px; border: 2px solid var(--ink); background: var(--surface); font-size: 32px; font-weight: 800; cursor: pointer; }
.stepper output { text-align: center; font-size: 22px; font-weight: 800; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { min-height: 48px; padding: 6px 14px; border-radius: 12px; border: 1px solid var(--ink-2); background: var(--surface); font-size: 16px; cursor: pointer; text-align: left; }
.opt[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.card-nav { display: grid; grid-template-columns: 56px 1fr 56px; gap: 6px; align-items: center; padding: 6px 8px 8px; border-top: 1px solid var(--line); background: var(--cream); }
.card-nav > button { height: 52px; border-radius: 12px; border: 1px solid var(--ink-2); background: var(--surface); font-size: 22px; cursor: pointer; }
.card-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.card-tabs::-webkit-scrollbar { display: none; }
.card-tabs button { flex: none; min-height: 48px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 15px; cursor: pointer; }
.card-tabs button[aria-current="true"] { background: var(--ink); color: #fff; }

/* 帰る */
.taxi { background: var(--cream); border: 2px solid var(--ink); border-radius: 16px; padding: 18px 16px; margin-top: 16px; }
.taxi .say { font-size: 26px; font-weight: 800; margin: 14px 0 0; }
.taxi .hotel { font-size: 34px; font-weight: 800; line-height: 1.25; margin: 0 0 10px; color: #22140a; }
.taxi .address { font-size: 24px; font-weight: 700; margin: 0; }
.taxi .tel { font-size: 20px; margin: 8px 0 0; }
.taxi .zh { color: var(--ink-2); margin: 12px 0 0; }
.help { display: grid; gap: 10px; }
.help a { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; min-height: 60px; padding: 8px 16px; border-radius: 12px; background: var(--surface); border: 2px solid var(--ink); color: var(--ink); text-decoration: none; }
.help a strong { font-size: 26px; }
.help a span { font-size: 17px; font-weight: 700; }
.manners { display: grid; gap: 10px; }
.manners article { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.manners h3 { font-size: 18px; }
.manners p { margin: 0; }
.manners .ja-say { font-size: 22px; font-weight: 800; margin-top: 6px; }
.sec { margin-top: 28px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 80px); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 1500; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; }

/* 言語の切り替え（繁中／日本語）：右上に小さく。ページと一緒にスクロールして消える。
   見た目は高さ34pxの小さな札、ボタン（タップ範囲）は44px×44px以上 */
.langsw {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 9px); right: 6px; z-index: 1100;
  display: flex; align-items: center; height: 34px; border-radius: 999px;
  background: rgba(255,250,241,.82); border: 1px solid var(--line);
}
.langsw button {
  min-width: 44px; min-height: 44px; margin: -5px 0; padding: 0 8px; border: 0; background: none; cursor: pointer;
  font-size: 13px; font-weight: 600; line-height: 1; color: var(--ink-2);
}
.langsw button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
/* 切り替えと重ならないよう、地図の説明と拡大ボタン・カードの上を少し下げる */
.map-hint { top: 54px; }
.view-map .leaflet-top.leaflet-right { top: 44px; }
.acard { padding-top: 52px; }
/* お願いカード・タクシー：日本語表示のときだけ出る「旅行者向けの訳」の注記 */
.acard .zh-note { font-size: 13px; color: var(--ink-2); margin: -8px 0 12px; }
.taxi .zh-note { font-size: 13px; color: var(--ink-2); margin: 2px 0 0; }
/* 日本語表示のタブは文字が長いので少し小さく */
html[lang="ja"] .tabbar a { font-size: 13px; }
