* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
}

#map {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

/* 現在地ボタン */
#locate-btn {
  position: fixed;
  right: 12px;
  bottom: calc(90px + env(safe-area-inset-bottom));
  z-index: 500;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#locate-btn:active {
  background: #e0e0e0;
}

/* 検索パネル */
#search-panel {
  position: fixed;
  top: env(safe-area-inset-top);
  left: 8px;
  right: 8px;
  z-index: 600;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px;
  margin-top: 8px;
}

#search-panel.hidden {
  display: none;
}

#search-input {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
}

#search-results {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 0;
}

#search-results li {
  padding: 10px 8px;
  border-bottom: 1px solid #eee;
  font-size: 15px;
}

#search-results li .spot-pref {
  color: #888;
  font-size: 13px;
  margin-left: 6px;
}

#search-results li:active {
  background: #f0f0f0;
}

/* ジャンル(カテゴリ)・都道府県パネル */
#category-panel,
#pref-panel {
  position: fixed;
  top: env(safe-area-inset-top);
  left: 8px;
  right: 8px;
  z-index: 600;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  max-height: 70vh;
  overflow-y: auto;
  padding: 10px;
  margin-top: 8px;
}

#category-panel.hidden,
#pref-panel.hidden {
  display: none;
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-chips .chip-btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 14px;
  border: none;
  border-radius: 20px;
  background: #f0d9d6;
  color: #b23a2f;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.category-chips .chip-btn.active {
  background: #b23a2f;
  color: #ffffff;
}

/* フィルタバー */
#filter-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  background: rgba(178, 58, 47, 0.95);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom)) 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

#search-toggle-btn,
#pref-toggle-btn,
#category-toggle-btn {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 4px;
  border: none;
  border-radius: 8px;
  background: #d9776c;
  color: #fff5f3;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

#search-toggle-btn {
  flex: 0 0 48px;
}

/* Leafletポップアップ内 */
.spot-popup h3 {
  margin: 0 0 4px 0;
  font-size: 16px;
}

.spot-popup .spot-type {
  color: #666;
  font-size: 13px;
  margin-bottom: 6px;
}

.spot-popup .spot-address,
.spot-popup .spot-hours,
.spot-popup .spot-phone {
  font-size: 13px;
  color: #444;
  margin-bottom: 4px;
}

.spot-popup .spot-links a {
  display: inline-block;
  margin-right: 10px;
  color: #b23a2f;
  text-decoration: none;
  font-size: 14px;
}

.leaflet-popup-content {
  min-width: 200px;
}

/* カスタムマーカー */
.spot-marker-wrapper {
  background: transparent;
  border: none;
}

.spot-marker {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  border: 2px solid #ffffff;
  font-size: 15px;
  color: #ffffff;
}

.spot-marker > * {
  transform: rotate(-45deg);
}
