* {
  box-sizing: border-box;
}

.public-footer {
  position: fixed;
  z-index: 900;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.public-footer a { color: #1b3a4b; }

.info-page {
  overflow: auto;
  background: #f5f7f8;
  color: #263238;
  line-height: 1.7;
}

.info-page main {
  max-width: 720px;
  margin: 32px auto;
  padding: 24px;
  border-radius: 12px;
  background: #fff;
}

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(120px + 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;
}

/* フィルタバー */
#filter-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  background: rgba(27, 58, 75, 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;
}

.toggle-btn,
.rating-btn,
#search-toggle-btn {
  flex: 1;
  min-width: 0;
  padding: 10px 4px;
  border: none;
  border-radius: 8px;
  background: #345a70;
  color: #cfd8dc;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.toggle-btn.active {
  background: #ffffff;
  color: #1b3a4b;
}

.rating-btn.active {
  background: #ffcc66;
  color: #1b3a4b;
}

#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-rating {
  color: #d9820a;
  font-weight: 600;
  margin-bottom: 6px;
}

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

.spot-popup .nearby-onsen {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eee;
}

.spot-popup .nearby-onsen h4 {
  margin: 0 0 4px 0;
  font-size: 13px;
  color: #666;
}

.spot-popup .nearby-onsen ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.spot-popup .nearby-onsen li {
  font-size: 13px;
  padding: 3px 0;
}

.spot-popup .nearby-onsen a {
  color: #1a73e8;
  text-decoration: none;
}

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

.spot-popup .spot-parking-large {
  color: #2e7d32;
  font-weight: 600;
}

.spot-popup .spot-parking-unknown {
  color: #999;
}

.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;
}

.spot-marker::before {
  content: "";
}

.spot-marker {
  color: #ffffff;
}

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

.spot-marker-large-parking {
  width: 34px;
  height: 34px;
  box-shadow: 0 0 0 2px #ffcc00, 0 1px 4px rgba(0, 0, 0, 0.5);
}

.spot-marker .parking-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: #ffcc00;
  color: #1b3a4b;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  padding: 2px 3px;
  border-radius: 50%;
  border: 1px solid #ffffff;
  transform: rotate(-45deg);
}
