/* ========================================
   食迹 · 全局样式 — Mythology Map 级视觉
   ======================================== */

/* Cinzel font loaded in index.html via fonts.loli.net */

/* ── 移动端 PC 提示横幅 ────────────────────────────────────────── */
#mobile-hint {
  display: none;
}
@media (max-width: 768px) {
  #mobile-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    background: rgba(10,12,22,0.96);
    border-bottom: 1px solid rgba(212,162,78,0.25);
    padding: 10px 16px;
    font-size: 13px;
    color: #d4a24e;
    backdrop-filter: blur(12px);
    font-family: "Noto Sans SC","Microsoft YaHei",sans-serif;
    gap: 12px;
  }
  #mobile-hint span {
    flex: 1;
    line-height: 1.5;
  }
  #mobile-hint button {
    flex-shrink: 0;
    background: none;
    border: 1px solid rgba(212,162,78,0.3);
    color: #d4a24e;
    font-size: 16px;
    width: 26px; height: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
  }
}

/* 定位按钮 */
#locate-btn {
  position: fixed;
  bottom: 52px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(212,162,78,0.2);
  background: rgba(10,12,22,0.9);
  color: #d4a24e;
  font-size: 20px;
  cursor: pointer;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

#locate-btn:hover {
  border-color: var(--accent);
  background: rgba(212,162,78,0.1);
  box-shadow: 0 0 20px rgba(212,162,78,0.15);
  transform: scale(1.08);
}

:root {
  --bg: #06070e;
  --bg-deep: #030408;
  --card-bg: rgba(12, 10, 8, 0.94);
  --card-bg-solid: #0c0a08;
  --accent: #d4a24e;
  --accent-bright: #f0c060;
  --accent-glow: rgba(212, 162, 78, 0.35);
  --accent-glow-strong: rgba(212, 162, 78, 0.6);
  --arc-color: #e8943a;
  --unusual-color: #e04848;
  --text-primary: #ece4d4;
  --text-secondary: #988a72;
  --text-dim: #5a4e3e;
  --border: rgba(212, 162, 78, 0.12);
  --border-strong: rgba(212, 162, 78, 0.3);
  --card-width: 420px;
  --nav-height: 52px;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.35s cubic-bezier(.4,0,.2,1);
  --font-title: 'Cinzel', 'Noto Serif SC', 'Georgia', serif;
  --font-body: 'Noto Sans SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Ambient Particles Canvas
   ======================================== */

#particles-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  pointer-events: none;
  opacity: 0.6;
}

/* ========================================
   Vignette Overlay
   ======================================== */

#vignette {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(3,4,8,0.7) 100%);
}

/* ========================================
   Loading Screen
   ======================================== */

#loading-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-ring {
  position: relative;
  width: 80px;
  height: 80px;
}

.loading-ring::before,
.loading-ring::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
}

.loading-ring::before {
  border-top-color: var(--accent);
  animation: spin 1.2s linear infinite;
}

.loading-ring::after {
  border-bottom-color: rgba(212, 162, 78, 0.3);
  animation: spin 1.8s linear infinite reverse;
}

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

.loading-title {
  margin-top: 32px;
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 6px;
  text-transform: uppercase;
}

.loading-subtitle {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 3px;
}

#loading-screen.hidden {
  display: none;
}

/* ========================================
   WebGL Fallback
   ======================================== */

#webgl-fallback {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

#webgl-fallback.hidden {
  display: none;
}

.fallback-content {
  text-align: center;
  color: var(--text-secondary);
}

.fallback-content h2 {
  font-size: 64px;
  margin-bottom: 20px;
}

/* ========================================
   Globe Container
   ======================================== */

#globe-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

/* ========================================
   Layer Toast
   ======================================== */

#layer-toast {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 12, 22, 0.92);
  border: 1px solid var(--border-strong);
  padding: 14px 32px;
  border-radius: 40px;
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 1px;
  z-index: 200;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 30px rgba(0,0,0,0.5), inset 0 1px 0 rgba(212,162,78,0.08);
}

#layer-toast.hidden {
  display: none;
}

/* ========================================
   Scrollbar
   ======================================== */

::-webkit-scrollbar {
  width: 3px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-dim);
  border-radius: 2px;
}

/* ========================================
   Globe.gl html elements — 允许美食城市标签可点击
   ======================================== */

.scene-container .globe-html-element {
  pointer-events: none;
}

.food-city-label {
  pointer-events: none !important;
}

/* ========================================
   Globe.gl tooltip override
   ======================================== */

.scene-tooltip {
  background: rgba(10, 12, 22, 0.94) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: 10px !important;
  padding: 10px 16px !important;
  font-family: var(--font-body) !important;
  font-size: 13px !important;
  color: var(--text-primary) !important;
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6) !important;
}

/* ========================================
   城市美食选择浮窗
   ======================================== */

#city-picker {
  position: fixed;
  top: calc(var(--nav-height) + 16px);
  right: 20px;
  width: 280px;
  max-height: calc(100vh - var(--nav-height) - 32px);
  background: rgba(10, 12, 22, 0.95);
  border: 1px solid var(--border);
  border-radius: 18px;
  z-index: 250;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(20px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.6),
    0 0 60px rgba(212,162,78,0.04);
}

#city-picker.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

@media (max-width: 768px) {
  #city-picker {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 50vh;
    border-radius: 24px 24px 0 0;
    transform: translateY(20px);
  }
  #city-picker.visible {
    transform: translateY(0);
  }
}

.cp-header {
  display: flex;
  align-items: center;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}

.cp-city {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 1px;
  flex: 1;
}

.cp-count {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 1px;
  margin-right: 10px;
}

.cp-close {
  width: 24px;
  height: 24px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.cp-close:hover {
  color: var(--accent);
  border-color: var(--accent-glow);
}

.cp-list {
  padding: 8px 10px 12px;
  overflow-y: auto;
  max-height: 320px;
}

.cp-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.cp-item:hover {
  background: rgba(212, 162, 78, 0.06);
}

.cp-emoji {
  font-size: 22px;
  flex-shrink: 0;
}

.cp-info {
  flex: 1;
  min-width: 0;
}

.cp-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.cp-sub {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
