/* ============================================================
   時を超える山口まちあるき / Yamaguchi History Walks - スタイル
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Yuji+Syuku&family=Noto+Serif+JP:wght@400;500;700&family=Cormorant+Garamond:wght@400;500;700&family=Crimson+Text:wght@400;600&display=swap');

:root {
  /* 山口オレンジ：山口県のイメージカラー */
  --color-primary: #E87E04;
  --color-primary-dark: #C46A03;
  --color-bg: #FAF6EC;
  --color-bg-card: #FFFFFF;
  --color-text: #2C2C2C;
  --color-text-inverse: #FFFFFF;
  /* 夏みかんのアクセント */
  --color-accent: #F8B500;
  /* 大内文化を象徴する深緑（補色） */
  --color-secondary: #2D5A3D;
  --color-muted: #6B6B6B;
  --color-border: #E0D6BE;
  --color-overlay: rgba(44, 44, 44, 0.55);

  --era-kofun: #8B6F47;
  --era-nara: #7B4F6F;
  --era-heian: #7B5B92;
  --era-kamakura: #2D5A3D;
  --era-muromachi: #4A6B7C;
  --era-edo: #1F3A5F;
  /* bakumatsu はかつてプライマリ朱色と同色だったが、テーマ色変更で衝突するため
     幕末を象徴する別系統の色（鉄錆色）に独立させる */
  --era-bakumatsu: #8B2C2C;
  --era-meiji-taisho: #B8860B;
  --era-showa: #5C5C5C;
  --era-modern: #888888;

  --font-heading: 'Yuji Syuku', 'Noto Serif JP', serif;
  --font-body: 'Noto Serif JP', serif;
  --font-heading-en: 'Cormorant Garamond', 'Yuji Syuku', serif;
  --font-body-en: 'Crimson Text', 'Noto Serif JP', serif;
  --font-size-base: 16px;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.18);

  --header-height: 56px;
  --tap-min: 44px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: normal;
  letter-spacing: 0.02em;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ------------------------------------------------------------
   App Header（共通）
------------------------------------------------------------ */
.app-header {
  height: var(--header-height);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  box-shadow: var(--shadow-sm);
  z-index: 10;
  flex-shrink: 0;
}
.app-header__title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  letter-spacing: 0.05em;
}
.app-header__title a { color: inherit; text-decoration: none; }

.icon-button {
  width: var(--tap-min);
  height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-inverse);
  font-size: 1.4rem;
  background: transparent;
}
.icon-button:hover { background: rgba(255, 255, 255, 0.12); }
.icon-button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ------------------------------------------------------------
   Hamburger Drawer
------------------------------------------------------------ */
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 80%;
  max-width: 320px;
  background: var(--color-bg);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.drawer[data-open="true"] { transform: translateX(0); }
.drawer__head {
  height: var(--header-height);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 var(--space-md);
}
.drawer__nav {
  padding: var(--space-md) 0;
}
.drawer__nav a {
  display: flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: var(--space-md) var(--space-lg);
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  font-size: 1rem;
}
.drawer__nav a:hover { background: rgba(0, 0, 0, 0.04); text-decoration: none; }
.drawer__nav-reset {
  margin-top: var(--space-lg);
  border-top: 2px solid var(--color-border) !important;
  color: var(--color-muted) !important;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start !important;
  padding-top: var(--space-md) !important;
  padding-bottom: var(--space-md) !important;
}
.drawer__nav-reset small {
  font-size: 0.7rem;
  color: var(--color-muted);
  margin-top: 2px;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.drawer-overlay[data-open="true"] {
  opacity: 1;
  visibility: visible;
}

/* ------------------------------------------------------------
   Map Page
------------------------------------------------------------ */
.map-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}
.map-container {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
}
#map { position: absolute; inset: 0; }

.map-control {
  position: absolute;
  width: var(--tap-min);
  height: var(--tap-min);
  border-radius: 50%;
  background: var(--color-bg-card);
  box-shadow: var(--shadow-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  font-size: 1.3rem;
  z-index: 5;
}
.map-control--locate {
  right: var(--space-md);
  bottom: calc(var(--space-md) + 64px);
}
.map-control--compass {
  right: var(--space-md);
  bottom: calc(var(--space-md) + 64px + var(--tap-min) + var(--space-sm));
}
.map-control--camera {
  right: var(--space-md);
  bottom: calc(var(--space-md) + 64px + (var(--tap-min) + var(--space-sm)) * 2);
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.map-control--camera:hover { background: var(--color-primary-dark); }
.map-control:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* マップピン（絵文字ベース） */
.map-pin {
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  user-select: none;
  -webkit-user-select: none;
  transform-origin: center bottom;
  transition: transform 0.15s ease;
}
.map-pin:hover, .map-pin:focus { transform: scale(1.18); outline: none; }
.map-pin[data-visited="true"] {
  filter: drop-shadow(0 0 4px rgba(184, 134, 11, 0.6));
}

/* 時代フィルタ（マップ上部の横スクロールタブ） */
.era-filter {
  display: flex;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
  z-index: 5;
}
.era-filter::-webkit-scrollbar { display: none; }
.era-filter__btn {
  flex-shrink: 0;
  min-height: var(--tap-min);
  padding: 0 var(--space-md);
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--color-muted);
  background: transparent;
  border: 1px solid var(--color-border);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.era-filter__btn[data-active="true"] {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}
.era-filter__btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* 現在地（青ドット） */
.user-location {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2A82E0;
  border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(42, 130, 224, 0.25);
}

/* ------------------------------------------------------------
   Notification Banner
------------------------------------------------------------ */
.notify-banner {
  position: fixed;
  left: var(--space-md);
  right: var(--space-md);
  top: calc(var(--header-height) + var(--space-md));
  background: var(--color-bg-card);
  color: var(--color-text);
  border-left: 6px solid var(--color-accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-md);
  z-index: 50;
  display: none;
  align-items: center;
  gap: var(--space-md);
  cursor: pointer;
  animation: slide-down 0.3s ease;
}
.notify-banner[data-visible="true"] { display: flex; }
.notify-banner__icon { font-size: 1.6rem; }
.notify-banner__body { flex: 1; }
.notify-banner__title { font-family: var(--font-heading); font-size: 1.05rem; margin-bottom: 2px; }
.notify-banner__text { font-size: 0.85rem; color: var(--color-muted); }
.notify-banner__close {
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  color: var(--color-muted);
}
.notify-banner__close:hover { background: rgba(0, 0, 0, 0.06); }

@keyframes slide-down {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* ------------------------------------------------------------
   Spot Detail Page
------------------------------------------------------------ */
.spot-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.spot-page__main {
  flex: 1;
  padding-bottom: var(--space-xl);
}
.spot-hero {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--color-border);
  position: relative;
  overflow: hidden;
}
.spot-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.spot-hero__caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55), transparent);
  color: #fff;
  padding: var(--space-md);
  font-size: 0.8rem;
}
.spot-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: var(--space-sm) 0;
}
.spot-carousel-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-border);
}
.spot-carousel-dot[data-active="true"] { background: var(--color-primary); }

.spot-header {
  padding: var(--space-md) var(--space-lg);
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
}
.spot-header__name {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  letter-spacing: 0.05em;
}
.spot-header__kana {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 2px;
}
.cultural-badge {
  display: inline-block;
  margin-top: var(--space-sm);
  padding: 2px 10px;
  background: var(--color-accent);
  color: #fff;
  border-radius: 999px;
  font-size: 0.75rem;
}

.era-tabs {
  display: flex;
  overflow-x: auto;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
  scrollbar-width: none;
}
.era-tabs::-webkit-scrollbar { display: none; }
.era-tab {
  flex-shrink: 0;
  min-width: 80px;
  min-height: var(--tap-min);
  padding: 0 var(--space-md);
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--color-muted);
  border: 1px solid transparent;
  background: transparent;
  white-space: nowrap;
}
.era-tab[data-active="true"] {
  color: var(--color-text-inverse);
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.era-content {
  padding: var(--space-lg);
  background: var(--color-bg-card);
}
.era-content__year {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-bottom: var(--space-xs);
}
.era-content__title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin-bottom: var(--space-md);
  color: var(--color-primary-dark);
}
.era-content__desc {
  font-size: 1rem;
  white-space: pre-wrap;
  line-height: 1.9;
}
.era-content__meta {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px dashed var(--color-border);
  font-size: 0.85rem;
  color: var(--color-muted);
}

/* 音声読み上げコントロール */
.audio-controls {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.audio-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: var(--tap-min);
  padding: 0 var(--space-md);
  border-radius: var(--radius-sm);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 0.9rem;
  font-family: var(--font-body);
}
.audio-btn:hover { background: rgba(0,0,0,0.04); }
.audio-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.audio-btn[data-audio-action="play"] {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}
.audio-btn[data-audio-action="play"]:hover { background: var(--color-primary-dark); }
.audio-btn__label { font-family: var(--font-heading); }
.era-content__meta dt {
  font-weight: 700;
  color: var(--color-text);
  margin-top: var(--space-sm);
}
.era-content__meta dd { margin-left: 0; }

.spot-actions {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.btn {
  min-height: var(--tap-min);
  padding: 0 var(--space-lg);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  border: 1px solid transparent;
  text-decoration: none;
}
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-dark); text-decoration: none; }
.btn--secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn--secondary:hover { background: rgba(0,0,0,0.04); text-decoration: none; }
.btn[disabled] { opacity: 0.7; cursor: default; }
.btn--visited {
  background: var(--color-accent);
  color: #fff;
}

/* ------------------------------------------------------------
   Spots List Page
------------------------------------------------------------ */
.spots-list-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.spots-list-main {
  padding: var(--space-lg);
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}
.spots-list__title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-bottom: var(--space-xs);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-primary);
}
.spots-list__summary {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: var(--space-lg);
}
.spots-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.spots-list__item {
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}
.spots-list__item:hover { box-shadow: var(--shadow-md); }
.spots-list__item a {
  display: flex;
  align-items: stretch;
  text-decoration: none;
  color: var(--color-text);
  min-height: 72px;
}
.spots-list__era {
  flex-shrink: 0;
  width: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: #fff;
  text-align: center;
  letter-spacing: 0.02em;
}
.spots-list__era[data-era="kofun"]        { background: var(--era-kofun); }
.spots-list__era[data-era="nara"]         { background: var(--era-nara); }
.spots-list__era[data-era="heian"]        { background: var(--era-heian); }
.spots-list__era[data-era="kamakura"]     { background: var(--era-kamakura); }
.spots-list__era[data-era="muromachi"]    { background: var(--era-muromachi); }
.spots-list__era[data-era="edo"]          { background: var(--era-edo); }
.spots-list__era[data-era="bakumatsu"]    { background: var(--era-bakumatsu); }
.spots-list__era[data-era="meiji-taisho"] { background: var(--era-meiji-taisho); }
.spots-list__era[data-era="showa"]        { background: var(--era-showa); }
.spots-list__era[data-era="modern"]       { background: var(--era-modern); }
.spots-list__body {
  flex: 1;
  padding: var(--space-md);
  min-width: 0;
}
.spots-list__name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  letter-spacing: 0.02em;
}
.spots-list__visited {
  color: var(--color-accent);
  font-size: 1rem;
  flex-shrink: 0;
}
.spots-list__kana {
  font-size: 0.78rem;
  color: var(--color-muted);
  margin-top: 2px;
}
.spots-list__meta {
  font-size: 0.75rem;
  color: var(--color-accent);
  margin-top: 4px;
  font-weight: 500;
}
.spots-list__chevron {
  display: flex;
  align-items: center;
  padding-right: var(--space-md);
  color: var(--color-muted);
  font-size: 1.4rem;
}

/* ------------------------------------------------------------
   Records Page
------------------------------------------------------------ */
.records-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.records-main {
  padding: var(--space-lg);
  flex: 1;
}
.records-progress {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  background: var(--color-bg-card);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-lg);
}
.circular-progress {
  --pct: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background:
    conic-gradient(var(--color-accent) calc(var(--pct) * 1%), var(--color-border) 0);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.circular-progress::before {
  content: '';
  width: 76px;
  height: 76px;
  background: var(--color-bg-card);
  border-radius: 50%;
  grid-area: 1/1;
}
.circular-progress__text {
  grid-area: 1/1;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  text-align: center;
  z-index: 1;
}
.records-progress__label {
  flex: 1;
}
.records-progress__title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-bottom: var(--space-xs);
}
.records-progress__sub {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin: var(--space-lg) 0 var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--color-primary);
}

.badge-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-md);
  list-style: none;
}
.badge-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
  opacity: 0.4;
  transition: opacity 0.2s;
}
.badge-card[data-earned="true"] { opacity: 1; }
.badge-card__icon {
  font-size: 2.2rem;
  margin-bottom: var(--space-xs);
}
.badge-card__name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  margin-bottom: var(--space-xs);
}
.badge-card__desc {
  font-size: 0.75rem;
  color: var(--color-muted);
}

.visited-list {
  list-style: none;
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.visited-list__item {
  border-bottom: 1px solid var(--color-border);
}
.visited-list__item:last-child { border-bottom: none; }
.visited-list__item a {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  min-height: var(--tap-min);
  color: var(--color-text);
}
.visited-list__item a:hover { background: rgba(0,0,0,0.03); text-decoration: none; }
.visited-list__name { flex: 1; font-family: var(--font-heading); }
.visited-list__date { font-size: 0.8rem; color: var(--color-muted); }
.empty-message {
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  color: var(--color-muted);
}

.records-reset {
  margin-top: var(--space-xl);
  text-align: center;
}

/* ------------------------------------------------------------
   About Page
------------------------------------------------------------ */
.about-main {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-lg);
}
.about-main h1 {
  font-size: 1.8rem;
  margin-bottom: var(--space-md);
  color: var(--color-primary-dark);
}
.about-main h2 {
  font-size: 1.2rem;
  margin: var(--space-xl) 0 var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--color-border);
}
.about-main p {
  margin-bottom: var(--space-md);
}
.about-main ul {
  margin: 0 0 var(--space-md) var(--space-lg);
}

/* ------------------------------------------------------------
   Common
------------------------------------------------------------ */
.loading {
  text-align: center;
  padding: var(--space-xl);
  color: var(--color-muted);
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* カメラモーダル */
.camera-modal {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 150;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.camera-modal[hidden] { display: none; }
.camera-modal__head {
  height: var(--header-height);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  flex-shrink: 0;
}
.camera-modal__title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}
.camera-modal__head .icon-button { color: var(--color-text-inverse); }

.camera-modal__section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}
.camera-modal__section[hidden] { display: none; }

.camera-modal__view {
  flex: 1;
  background: #000;
  position: relative;
  min-height: 0;
}
.camera-modal__view video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.camera-modal__controls {
  padding: var(--space-lg);
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}
.camera-shutter {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 1.4rem;
  border: 4px solid var(--color-bg-card);
  box-shadow: 0 0 0 3px var(--color-primary), var(--shadow-md);
}
.camera-shutter:hover { background: var(--color-primary-dark); }
.camera-shutter:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 4px; }
.camera-modal__hint {
  font-size: 0.85rem;
  color: var(--color-muted);
  text-align: center;
}

.camera-modal__preview {
  width: 100%;
  max-height: 50vh;
  object-fit: contain;
  background: #000;
  display: block;
}
.camera-modal__preview--small {
  max-height: 30vh;
}

.camera-modal__actions {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
  justify-content: center;
}
.camera-modal__actions .btn { flex: 1; min-width: 120px; }

.camera-modal__loading {
  padding: var(--space-lg);
  text-align: center;
  color: var(--color-muted);
}
.camera-modal__result-text {
  padding: var(--space-lg);
  font-size: 1rem;
  line-height: 1.9;
  white-space: pre-wrap;
  flex: 1;
}

@media (min-width: 768px) {
  .camera-modal {
    inset: 5vh 5vw;
    border-radius: var(--radius-lg);
    max-width: 720px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
  }
}

/* トースト通知 */
.toast-host {
  position: fixed;
  left: var(--space-md);
  right: var(--space-md);
  bottom: calc(var(--space-md) + 56px);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  z-index: 200;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--color-bg-card);
  color: var(--color-text);
  padding: var(--space-md) var(--space-lg);
  padding-right: 40px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
  border-left: 4px solid var(--color-muted);
  animation: toast-in 0.25s ease;
}
.toast--info  { border-left-color: var(--color-accent); }
.toast--warn  { border-left-color: #D9890A; background: #FFF8E5; }
.toast--error { border-left-color: var(--color-primary); background: #FCE8E9; }
.toast[data-leaving="true"] { opacity: 0; transition: opacity 0.2s ease; }
.toast__close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  color: var(--color-muted);
  background: transparent;
}
.toast__close:hover { background: rgba(0,0,0,0.06); }

@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

/* SW 更新バナー（画面下にスティッキー表示） */
/* PWA standalone モードではブラウザUIがないためセーフエリアを尊重 */
.update-banner {
  position: fixed;
  left: var(--space-md);
  right: var(--space-md);
  bottom: calc(var(--space-md) + env(safe-area-inset-bottom, 0px));
  background: var(--color-accent);
  color: #fff;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  z-index: 220;
  animation: toast-in 0.25s ease;
}
/* 通常ブラウザではアドレスバーや進捗バーを避けるため少し上 */
@media (display-mode: browser) {
  .update-banner {
    bottom: calc(var(--space-md) + 56px);
  }
}
.update-banner__text {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
}
.update-banner__btn {
  min-height: var(--tap-min);
  padding: 0 var(--space-md);
  background: #fff;
  color: var(--color-accent);
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
}
.update-banner__btn:hover { background: rgba(255,255,255,0.85); }
.update-banner__close {
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  color: rgba(255,255,255,0.85);
  background: transparent;
}
.update-banner__close:hover { background: rgba(255,255,255,0.15); }

/* ------------------------------------------------------------
   Tablet以上
------------------------------------------------------------ */
@media (min-width: 768px) {
  .spot-page__main, .records-main {
    max-width: 720px;
    margin: 0 auto;
  }
}

/* ------------------------------------------------------------
   ヘッダーのツール群（市プルダウン + ハンバーガー）
------------------------------------------------------------ */
.app-header__tools {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.city-select {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-sm);
  padding: 0 6px 0 12px;
  height: 36px;
  color: var(--color-text-inverse);
}
.city-select select {
  background: transparent;
  color: var(--color-text-inverse);
  border: none;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  padding-right: 8px;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
}
.city-select select:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
/* select の option は背景色を指定しないと OS デフォルト（白）になり読みにくいので
   ヘッダー色と同系統に寄せる */
.city-select select option {
  color: var(--color-text);
  background: var(--color-bg-card);
}

/* 英語 locale 時のフォント切替（見出しのみ。本文は和文混じりのため日本語フォント） */
body[data-locale="en"] {
  font-family: var(--font-body-en);
}
body[data-locale="en"] h1,
body[data-locale="en"] h2,
body[data-locale="en"] h3,
body[data-locale="en"] h4,
body[data-locale="en"] .app-header__title,
body[data-locale="en"] .spot-header__name,
body[data-locale="en"] .era-content__title,
body[data-locale="en"] .spots-list__title {
  font-family: var(--font-heading-en);
  letter-spacing: 0.01em;
}
/* city select は和英ともセリフ系を維持（落ち着き優先） */
body[data-locale="en"] .city-select select {
  font-family: var(--font-heading-en);
}

/* locale ごとに表示／非表示を切り替えるセクション（about ページ等） */
[data-locale-only] { display: none; }
body[data-locale="ja"] [data-locale-only="ja"],
body[data-locale="en"] [data-locale-only="en"] { display: block; }
/* 初期化前（locale 未確定時）は ja を見せておく */
body:not([data-locale]) [data-locale-only="ja"] { display: block; }

/* ------------------------------------------------------------
   言語選択スプラッシュ
------------------------------------------------------------ */
.lang-splash {
  position: fixed;
  inset: 0;
  background: rgba(44, 44, 44, 0.7);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  animation: lang-splash-in 0.25s ease;
}
.lang-splash--leaving { opacity: 0; transition: opacity 0.2s ease; }
body.lang-splash-open { overflow: hidden; }

.lang-splash__panel {
  background: var(--color-bg-card);
  color: var(--color-text);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.lang-splash__title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  line-height: 1.4;
  margin-bottom: var(--space-md);
  color: var(--color-primary-dark);
}
.lang-splash__title-en {
  font-family: var(--font-heading-en);
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  display: inline-block;
  margin-top: 4px;
}
.lang-splash__lead {
  font-size: 0.95rem;
  color: var(--color-muted);
  margin-bottom: var(--space-lg);
  line-height: 1.7;
}
.lang-splash__buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.lang-splash__btn {
  min-width: 280px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
}
.lang-splash__btn--en {
  font-family: var(--font-heading-en);
}
.lang-splash__btn:hover {
  background: var(--color-bg);
  border-color: var(--color-primary);
}
.lang-splash__btn:active {
  transform: scale(0.98);
}
.lang-splash__btn[data-recommended="true"] {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(232, 126, 4, 0.18);
  background: linear-gradient(180deg, #fff, #fff8ee);
}
.lang-splash__hint {
  font-family: var(--font-body-en);
  font-size: 0.7rem;
  color: var(--color-primary-dark);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes lang-splash-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ------------------------------------------------------------
   トーストのアクションボタン（市境跨ぎ提案などで使用）
------------------------------------------------------------ */
.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.toast__text {
  flex: 1;
}
.toast__action {
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 var(--space-md);
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
}
.toast__action:hover { background: var(--color-primary-dark); }
body[data-locale="en"] .toast__action {
  font-family: var(--font-heading-en);
}

