/* ============================================
   🌞 台南 500 碗 2026 — 陽光古都美食風格
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;600;700;900&family=Noto+Serif+TC:wght@600;700;900&display=swap');

/* --- CSS Variables --- */
:root {
  /* Warm Backgrounds */
  --bg-primary: #FFF9F2;
  --bg-secondary: #FFF3E6;
  --bg-tertiary: #FFE8D0;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FFFAF5;
  --bg-warm-tint: rgba(196, 75, 26, 0.04);

  /* Tainan Ancient City Colors */
  --primary: #C24B1A;
  --primary-light: #E06030;
  --primary-dark: #9A3510;
  --secondary: #E8A317;
  --secondary-light: #F2C862;
  --accent: #8B4513;
  --gold: #D4A017;
  --gold-bright: #F2C04E;
  --temple-red: #B8251A;
  --brick: #A0522D;

  /* Text */
  --text-primary: #2C1810;
  --text-secondary: #6B5344;
  --text-muted: #A0907E;

  /* Borders & Shadows */
  --border: rgba(139, 69, 19, 0.10);
  --border-hover: rgba(139, 69, 19, 0.22);
  --shadow-sm: 0 2px 8px rgba(139, 69, 19, 0.06);
  --shadow-md: 0 4px 20px rgba(139, 69, 19, 0.10);
  --shadow-lg: 0 8px 40px rgba(139, 69, 19, 0.13);
  --shadow-warm: 0 4px 24px rgba(196, 75, 26, 0.12);
  --shadow-gold: 0 4px 20px rgba(212, 160, 23, 0.20);

  /* Radius */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--bg-secondary);
}

body {
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

::selection {
  background: var(--secondary);
  color: var(--text-primary);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ============================================
   HERO SECTION — 陽光古都
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 2rem 6rem;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 25% 15%, rgba(242, 200, 98, 0.28) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 25%, rgba(232, 163, 23, 0.18) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 85%, rgba(196, 75, 26, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 15% 75%, rgba(255, 180, 100, 0.12) 0%, transparent 40%),
    linear-gradient(180deg, #FFF9F2 0%, #FFE8D0 40%, #FFDAB9 70%, #FFD0A0 100%);
}

/* Subtle traditional pattern overlay */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%238B4513' fill-opacity='0.03'%3E%3Ccircle cx='40' cy='40' r='2'/%3E%3Ccircle cx='0' cy='0' r='2'/%3E%3Ccircle cx='80' cy='0' r='2'/%3E%3Ccircle cx='0' cy='80' r='2'/%3E%3Ccircle cx='80' cy='80' r='2'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

/* Warm wave bottom separator */
.hero::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: -5%;
  width: 110%;
  height: 80px;
  background: var(--bg-primary);
  border-radius: 50% 50% 0 0;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 22px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(196, 75, 26, 0.15);
  border-radius: 50px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
  animation: fadeInDown 0.8s ease-out;
  box-shadow: var(--shadow-sm);
}

.hero__badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--secondary);
  animation: pulse-dot 2s infinite;
}

.hero__title {
  font-family: 'Noto Serif TC', 'Noto Sans TC', serif;
  font-size: clamp(2.8rem, 9vw, 6rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--temple-red) 0%, var(--primary) 35%, var(--accent) 65%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fadeInUp 0.8s ease-out;
  filter: drop-shadow(0 2px 4px rgba(139, 69, 19, 0.15));
}

.hero__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 0.3rem;
  animation: fadeInUp 0.8s ease-out 0.1s both;
}

.hero__year {
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 3rem;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Hero Stats */
.hero-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.hero-stat {
  background: rgba(255, 255, 255, 0.70);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(196, 75, 26, 0.12);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2.5rem;
  text-align: center;
  min-width: 150px;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-sm);
}

.hero-stat:hover {
  border-color: var(--primary);
  transform: translateY(-6px);
  box-shadow: var(--shadow-warm);
  background: rgba(255, 255, 255, 0.85);
}

.hero-stat__number {
  font-family: 'Noto Serif TC', serif;
  font-size: 2.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.hero-stat__label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
}

/* Scroll Indicator */
.hero__scroll {
  position: absolute;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  animation: fadeInUp 0.8s ease-out 0.5s both;
  transition: color var(--transition-fast);
  z-index: 2;
}

.hero__scroll:hover { color: var(--primary); }

.hero__scroll-arrow {
  font-size: 1.2rem;
  animation: bounce 2s infinite;
}

/* ============================================
   FILTER BAR — 篩選列
   ============================================ */
.filter-bar {
  position: sticky;
  top: 0;
  z-index: 1100; /* above Leaflet map controls (z-index 1000) so the map's
                    attribution doesn't bleed over the sticky bar when scrolling */
  background: rgba(255, 249, 242, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 1.5rem;
  box-shadow: 0 2px 12px rgba(139, 69, 19, 0.06);
}

.filter-bar__inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Search Box */
.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.search-box__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
}

.search-box__input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.search-box__input::placeholder { color: var(--text-muted); }

.search-box__input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(194, 75, 26, 0.12);
}

/* Filter Buttons */
.filter-group {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-group::-webkit-scrollbar { display: none; }

.filter-bowl-btn,
.filter-cat-btn {
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: white;
  border: 1.5px solid var(--border);
  white-space: nowrap;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.filter-bowl-btn:hover,
.filter-cat-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: #FFF5EE;
}

.filter-bowl-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--temple-red));
  color: white;
  border-color: transparent;
  box-shadow: 0 3px 14px rgba(194, 75, 26, 0.28);
}

.filter-cat-btn.active {
  background: #FFF5EE;
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
}

/* Random Button */
.random-btn {
  padding: 10px 22px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  border: none;
  white-space: nowrap;
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
  box-shadow: 0 3px 14px rgba(232, 163, 23, 0.30);
}

.random-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary), var(--temple-red));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.random-btn:hover::before { opacity: 1; }

.random-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 24px rgba(194, 75, 26, 0.35);
}

.random-btn span { position: relative; z-index: 1; }

/* Find Nearest Button */
.nearest-btn {
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  background: white;
  border: 1.5px solid var(--border);
  white-space: nowrap;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: var(--shadow-sm);
}

.nearest-btn:hover {
  transform: scale(1.04);
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(194, 75, 26, 0.2);
}

.nearest-btn.active {
  color: white;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  border-color: transparent;
  box-shadow: 0 3px 14px rgba(232, 163, 23, 0.3);
}

.nearest-btn__spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(194, 75, 26, 0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.nearest-btn.loading .nearest-btn__spinner { display: inline-block; }
.nearest-btn.loading .nearest-btn__label { opacity: 0.6; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Result Count */
.result-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: auto;
  font-weight: 500;
}

.result-count.no-results { color: var(--temple-red); }

/* ============================================
   🕒 營業狀態徽章 / 距離 (Open Status & Distance)
   ============================================ */
.open-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.open-badge--open {
  color: #1E7D45;
  background: rgba(46, 158, 91, 0.12);
  border: 1px solid rgba(46, 158, 91, 0.3);
}

.open-badge--closed {
  color: #B8251A;
  background: rgba(184, 37, 26, 0.1);
  border: 1px solid rgba(184, 37, 26, 0.28);
}

.open-badge--unknown {
  color: #9E7B18;
  background: rgba(212, 160, 23, 0.12);
  border: 1px solid rgba(212, 160, 23, 0.32);
}

/* User location marker (找最近) */
.user-loc-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2563EB;
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.3), 0 2px 6px rgba(0, 0, 0, 0.3);
  animation: userPulse 1.8s ease-out infinite;
}

@keyframes userPulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3); }
  70% { box-shadow: 0 0 0 12px rgba(37, 99, 235, 0), 0 2px 6px rgba(0, 0, 0, 0.3); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0), 0 2px 6px rgba(0, 0, 0, 0.3); }
}

/* Section reminder note */
.section-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: -0.5rem 0 1.5rem;
  padding: 10px 14px;
  background: rgba(212, 160, 23, 0.08);
  border-left: 3px solid rgba(212, 160, 23, 0.5);
  border-radius: var(--radius-sm);
}

/* ============================================
   MAP SECTION — 地圖
   ============================================ */
.map-section {
  padding: 0 1.5rem;
  max-width: 1400px;
  margin: 1.5rem auto;
}

.map-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-lg);
  position: relative;
}

#map {
  height: 75vh;
  min-height: 600px;
  width: 100%;
  background: var(--bg-secondary);
}

/* Custom Map Popup */
.custom-popup .leaflet-popup-content-wrapper {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border: 1.5px solid var(--border-hover);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  padding: 0;
}

.custom-popup .leaflet-popup-tip {
  background: rgba(255, 255, 255, 0.97);
  border: 1.5px solid var(--border-hover);
  border-top: none;
  border-left: none;
}

.custom-popup .leaflet-popup-close-button {
  color: var(--text-muted) !important;
  font-size: 20px !important;
  top: 8px !important;
  right: 10px !important;
}

.custom-popup .leaflet-popup-close-button:hover {
  color: var(--primary) !important;
}

.map-popup { padding: 16px 18px; }

.map-popup__bowls {
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.map-popup__name {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
  color: var(--text-primary);
}

.map-popup__category {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.map-popup__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.map-popup__closed {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.map-popup__distance {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--secondary);
  background: rgba(232, 163, 23, 0.12);
  padding: 2px 8px;
  border-radius: 20px;
}

.map-popup__phone {
  margin-bottom: 8px;
}

.map-popup__note {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

.map-popup__address {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.map-popup__desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.map-popup__nav,
.leaflet-popup-content .map-popup__nav,
.leaflet-container a.map-popup__nav {
  display: inline-block;
  padding: 9px 20px;
  background: linear-gradient(135deg, var(--primary), var(--temple-red));
  color: white !important;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: var(--transition-fast);
  box-shadow: 0 2px 8px rgba(194, 75, 26, 0.25);
  text-decoration: none;
}

.map-popup__nav:hover,
.leaflet-container a.map-popup__nav:hover {
  color: white !important;
  transform: scale(1.05);
  box-shadow: 0 3px 14px rgba(194, 75, 26, 0.4);
}

/* Custom Marker Hover */
.custom-marker div:hover {
  transform: scale(1.25) !important;
}

/* ============================================
   RESTAURANT CARDS — 店家卡片
   ============================================ */
.restaurant-section {
  padding: 2.5rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-title span {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Card Grid */
#restaurant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.3rem;
}

/* Card */
.card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition-smooth);
  animation: cardFadeIn 0.5s ease-out both;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.card__accent {
  height: 5px;
  width: 100%;
}

.card__content {
  padding: 1.2rem 1.4rem 1.4rem;
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card__bowls { font-size: 1.2rem; }

.card__district {
  font-size: 0.75rem;
  color: var(--accent);
  background: rgba(139, 69, 19, 0.06);
  padding: 3px 12px;
  border-radius: 20px;
  border: 1px solid rgba(139, 69, 19, 0.10);
  font-weight: 500;
}

.card__name {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.card:hover .card__name {
  color: var(--primary);
}

.card__category {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 500;
  margin-bottom: 10px;
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.card__closed {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.card__distance {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--secondary);
  background: rgba(232, 163, 23, 0.12);
  padding: 2px 9px;
  border-radius: 20px;
}

.card__phone-row {
  margin-bottom: 12px;
}

/* Phone chip (cards + popup) */
.phone-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #1E7D72;
  background: rgba(30, 125, 114, 0.1);
  border: 1px solid rgba(30, 125, 114, 0.25);
  padding: 4px 12px;
  border-radius: 20px;
  text-decoration: none;
  transition: var(--transition-fast);
}

.phone-chip:hover {
  background: #1E7D72;
  color: #fff;
}

.phone-chip--none {
  color: var(--text-muted);
  background: transparent;
  border: 1px dashed var(--border);
  font-weight: 500;
  cursor: default;
}

.phone-chip--none:hover {
  background: transparent;
  color: var(--text-muted);
}

.card__address {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

/* On-demand machine translation of the (Chinese) description — shown only for
   non-Chinese UI languages. Opens the free Google Translate web page. */
.card__translate {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--secondary);
  margin: -4px 0 12px;
  transition: var(--transition-fast);
}
.card__translate:hover { color: var(--primary); text-decoration: underline; }

.card__desc {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2 columns × 2 rows of rectangular buttons */
  gap: 8px;
}

.card__btn {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.card__btn--map {
  background: white;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}

.card__btn--map:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 10px rgba(194, 75, 26, 0.25);
}

.card__btn--nav {
  background: linear-gradient(135deg, var(--primary), var(--temple-red));
  color: white;
  border: none;
  box-shadow: 0 2px 8px rgba(194, 75, 26, 0.2);
}

.card__btn--nav:hover {
  box-shadow: 0 3px 14px rgba(194, 75, 26, 0.35);
  transform: translateY(-1px);
}

/* No Results */
.no-results-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.no-results-emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

.no-results-msg h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* ============================================
   STATS SECTION — 統計
   ============================================ */
.stats-section {
  padding: 3rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.stats-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.stats-card__title {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* District Bars */
.stat-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.stat-bar__label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  min-width: 55px;
  text-align: right;
  font-weight: 500;
}

.stat-bar__track {
  flex: 1;
  height: 30px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.stat-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding: 0 10px;
  min-width: fit-content;
  transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.stat-bar__value {
  font-size: 0.72rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* Category Donut */
.donut-wrapper {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

#category-donut {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
}

#category-donut::after {
  content: attr(data-total);
  position: absolute;
  inset: 22%;
  background: var(--bg-card);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Serif TC', serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary);
  box-shadow: inset 0 2px 8px rgba(139, 69, 19, 0.08);
}

.stat-category {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.82rem;
}

.stat-category__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stat-category__name {
  color: var(--text-secondary);
  flex: 1;
}

.stat-category__count {
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
}

/* ============================================
   MODAL — 隨機推薦彈窗
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 24, 16, 0.45);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--bg-card);
  border: 1.5px solid var(--border-hover);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  position: relative;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-bounce);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
  line-height: 1;
}

.modal-close:hover { color: var(--primary); }

.modal-dice {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  display: inline-block;
}

.modal-dice.spin {
  animation: diceRoll 0.6s ease-out;
}

.modal-label {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-restaurant {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.modal-bowls { font-size: 1.4rem; margin-bottom: 6px; }

.modal-name {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.modal-category-text {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.modal-district {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.modal-address {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.modal-btn {
  flex: 1;
  padding: 10px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: var(--transition-fast);
  cursor: pointer;
}

.modal-btn--nav {
  background: linear-gradient(135deg, var(--primary), var(--temple-red));
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 2px 10px rgba(194, 75, 26, 0.25);
}

.modal-btn--nav:hover {
  box-shadow: 0 3px 16px rgba(194, 75, 26, 0.4);
}

.modal-btn--map {
  background: white;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}

.modal-btn--map:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.modal-retry {
  width: 100%;
  padding: 13px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: white;
  transition: var(--transition-fast);
  box-shadow: 0 3px 14px rgba(232, 163, 23, 0.30);
}

.modal-retry:hover {
  transform: scale(1.03);
  box-shadow: 0 5px 24px rgba(232, 163, 23, 0.45);
}

/* ============================================
   FOOTER — 頁尾
   ============================================ */
.footer {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.8;
}

.footer a {
  color: var(--primary);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.footer a:hover { color: var(--temple-red); }

.footer__mail { font-weight: 700; white-space: nowrap; }

.footer__studio {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================
   BACK TO TOP
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--temple-red));
  color: white;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(194, 75, 26, 0.30);
  z-index: 999;
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition-smooth);
  pointer-events: none;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.back-to-top:hover {
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 6px 24px rgba(194, 75, 26, 0.45);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

@keyframes diceRoll {
  0%   { transform: rotate(0deg) scale(1); }
  25%  { transform: rotate(90deg) scale(1.2); }
  50%  { transform: rotate(180deg) scale(0.9); }
  75%  { transform: rotate(270deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Scroll Animate */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-animate.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: 1fr; }
  .donut-wrapper { justify-content: center; }
}

@media (max-width: 768px) {
  .hero {
    min-height: 90vh;
    padding: 1.5rem 1.5rem 5rem;
  }

  .hero-stats { gap: 1rem; }

  .hero-stat {
    padding: 1rem 1.5rem;
    min-width: 110px;
  }

  .hero-stat__number { font-size: 2rem; }

  .filter-bar__inner { gap: 0.6rem; }

  .search-box {
    min-width: 100%;
    max-width: 100%;
    order: -1;
  }

  .random-btn {
    padding: 8px 16px;
    font-size: 0.82rem;
  }

  #restaurant-grid { grid-template-columns: 1fr; }

  #map {
    height: 45vh;
    min-height: 300px;
  }

  .stats-card { padding: 1.5rem; }
  .modal-content { padding: 2rem 1.5rem; }
}

@media (max-width: 480px) {
  .hero-stats {
    flex-direction: column;
    align-items: center;
  }

  .hero-stat { width: 80%; }

  .filter-bowl-btn,
  .filter-cat-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  .modal-actions { flex-direction: column; }
}

/* ============================================
   LEAFLET OVERRIDES — 暖色系
   ============================================ */
.leaflet-control-zoom a {
  background: rgba(255, 255, 255, 0.95) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
  backdrop-filter: blur(8px);
}

.leaflet-control-zoom a:hover {
  background: var(--primary) !important;
  color: white !important;
}

.leaflet-control-attribution {
  background: rgba(255, 249, 242, 0.90) !important;
  color: var(--text-muted) !important;
  font-size: 0.65rem !important;
}

.leaflet-control-attribution a {
  color: var(--text-secondary) !important;
}

/* ============================================
   🏆 吃貨成就面板 (Achievement Panel)
   ============================================ */
.achievement-panel {
  padding: 1.5rem 1.5rem 0;
  max-width: 1400px;
  margin: 0 auto;
}

.achievement-panel__inner {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.achievement-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFF5EE;
  border: 1.5px solid rgba(196, 75, 26, 0.18);
  padding: 8px 18px;
  border-radius: 50px;
  box-shadow: var(--shadow-sm);
}

.achievement-badge__emoji {
  font-size: 1.3rem;
  line-height: 1;
}

.achievement-badge__title {
  font-family: 'Noto Serif TC', serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
}

.achievement-info-btn {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1.5px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.achievement-info-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* Achievement levels modal */
.levels-modal__content {
  max-width: 420px;
  text-align: left;
}
.levels-modal__title {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  text-align: center;
  margin-bottom: 4px;
}
.levels-modal__sub {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.levels-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.levels-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}
.levels-row__range {
  flex: 0 0 auto;
  min-width: 64px;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.levels-row__title {
  flex: 1;
  font-family: 'Noto Serif TC', serif;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}
.levels-row__badge {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  padding: 2px 8px;
  border-radius: 20px;
}
.levels-row--current {
  background: #FFF5EE;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.achievement-progress {
  flex: 1;
  min-width: 250px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.achievement-progress__text {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.achievement-progress__count {
  color: var(--primary);
}

.achievement-progress__track {
  height: 12px;
  background: var(--bg-secondary);
  border-radius: 50px;
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.achievement-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  border-radius: 50px;
  width: 0%;
  transition: width var(--transition-smooth);
}

.achievement-share-btn {
  padding: 10px 20px;
  border-radius: 50px;
  background: white;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.achievement-share-btn:hover {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(196, 75, 26, 0.20);
}

/* ============================================
   我吃過卡片樣式與打勾狀態 (Visited Cards)
   ============================================ */
.card.card--visited {
  border-color: rgba(212, 160, 23, 0.35);
  background: #FFFDF9;
}

/* 今日公休的店家卡片：整張轉灰，與營業中區隔 */
.card.card--closed-today {
  background: #ECEAE7;
  border-color: #D6D2CD;
}
.card.card--closed-today .card__accent {
  filter: grayscale(0.55) opacity(0.7);
}
.card.card--closed-today .card__desc {
  color: var(--text-muted);
}

/* Visited Stamp Indicator */
.card::after {
  content: '✓ 吃過';
  position: absolute;
  top: 14px;
  right: 14px;
  background: linear-gradient(135deg, var(--secondary), var(--gold));
  color: #2C1810;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity var(--transition-bounce), transform var(--transition-bounce);
  pointer-events: none;
  z-index: 5;
}

.card.card--visited::after {
  opacity: 1;
  transform: scale(1);
}

.card__btn--check {
  background: white;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}

.card__btn--check:hover {
  background: #FFF5EE;
  color: var(--primary);
  border-color: var(--primary);
}

.card.card--visited .card__btn--check {
  background: #FFF5EE;
  border-color: var(--secondary);
  color: var(--primary);
  font-weight: 700;
}

.card__check-box {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--text-secondary);
  border-radius: 3px;
  background: white;
  position: relative;
  transition: var(--transition-fast);
  margin-right: 4px;
}

.card__btn--check:hover .card__check-box {
  border-color: var(--primary);
}

.card.card--visited .card__check-box {
  border-color: var(--primary);
  background: var(--secondary);
}

.card.card--visited .card__check-box::after {
  content: '';
  position: absolute;
  left: 2px;
  top: -1px;
  width: 3px;
  height: 6px;
  border: solid #2C1810;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

/* ============================================
   👤 頁尾造訪計數器 (Footer Visitor Counter)
   ============================================ */
.footer-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.4);
  border: 1.5px solid var(--border);
  padding: 6px 16px;
  border-radius: 50px;
  margin: 1rem auto;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  width: fit-content;
}

.footer-counter__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2E6E8E;
  animation: pulse-dot 2s infinite;
}

@media (max-width: 768px) {
  .achievement-panel__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
  }
  .achievement-share-btn {
    justify-content: center;
  }
}

/* ============================================
   Language Switcher (語言切換器)
   ============================================ */
.lang-switch {
  position: absolute;   /* anchored to the hero, scrolls away with it */
  top: 14px;
  right: 14px;
  z-index: 20;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 50px;
  box-shadow: var(--shadow-sm);
}

.lang-switch__btn {
  padding: 5px 11px;
  border: none;
  background: transparent;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.lang-switch__btn:hover {
  color: var(--primary);
}

.lang-switch__btn.active {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--temple-red));
  box-shadow: 0 2px 8px rgba(194, 75, 26, 0.25);
}

/* ============================================
   Open-Now Toggle (只看營業中)
   ============================================ */
.opennow-btn {
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  background: white;
  border: 1.5px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.opennow-btn:hover {
  transform: scale(1.04);
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(194, 75, 26, 0.2);
}

.opennow-btn.active {
  color: white;
  background: linear-gradient(135deg, #2E8B57, #3CB371);
  border-color: transparent;
  box-shadow: 0 3px 14px rgba(46, 139, 87, 0.3);
}

/* ============================================
   Backup / Restore mini buttons + share card btn
   ============================================ */
.achievement-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.achievement-mini-btn {
  padding: 9px 14px;
  border-radius: 50px;
  background: white;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.achievement-mini-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: #FFF5EE;
}

.card__btn--share {
  background: white;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}

.card__btn--share:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 10px rgba(194, 75, 26, 0.25);
}

@media (max-width: 768px) {
  .achievement-actions {
    justify-content: center;
  }
  /* On mobile the absolute switcher overlapped the hero badge — put it back in
     the normal flow as a centered row at the top of the hero content instead. */
  .lang-switch {
    position: static;
    top: auto;
    right: auto;
    align-self: center;
    margin-bottom: 1.2rem;
  }
  .lang-switch__btn {
    padding: 5px 9px;
    font-size: 0.74rem;
  }
  /* Hide the "scroll down" hint on mobile: with stacked hero stats it overlapped
     the bottom stat card. Mobile users scroll naturally. */
  .hero__scroll {
    display: none;
  }
}
