/* 首页：泰国地图 · 像素风 */
@font-face {
  font-family: 'PixelZH';
  src: url('../fonts/fusion-pixel-12px-proportional-zh_hans.otf.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'PixelLatin';
  src: url('../fonts/fusion-pixel-12px-proportional-latin.otf.woff2') format('woff2');
  font-display: swap;
}

:root {
  --bg: #0b0c14;
  --panel: #1a1c2c;
  --panel2: #141522;
  --fg: #f4f4f4;
  --muted: #94a0c8;
  --accent: #41a6f6;
  --accent2: #ef7d9d;
  --gold: #ffcd75;
  --green: #38b764;
  --border: #f4f4f4;
  --shadow: #000000;
  font-size: 16px;
}

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

html, body { min-height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'PixelLatin', 'PixelZH', 'Courier New', monospace;
  -webkit-font-smoothing: none;
  overflow-x: hidden;
}

/* 星空背景 */
.stars {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12% 20%, #8fb8ff 50%, transparent 50%),
    radial-gradient(1px 1px at 68% 8%, #ffffff 50%, transparent 50%),
    radial-gradient(2px 2px at 85% 30%, #6a8fd8 50%, transparent 50%),
    radial-gradient(1px 1px at 35% 55%, #ffffff 50%, transparent 50%),
    radial-gradient(1px 1px at 55% 80%, #8fb8ff 50%, transparent 50%),
    radial-gradient(2px 2px at 8% 75%, #ffffff 50%, transparent 50%),
    radial-gradient(1px 1px at 92% 62%, #ef7d9d 50%, transparent 50%);
  opacity: 0.5;
}

.pixel-panel {
  background: var(--panel);
  border: 2px solid var(--border);
  box-shadow: 0 0 0 2px var(--shadow), 4px 4px 0 2px var(--shadow);
}

/* ---------- 头部 ---------- */
#home-header {
  position: relative; z-index: 1;
  text-align: center; padding: 34px 16px 20px;
}
#home-header h1 {
  font-size: 2.1rem; letter-spacing: 0.1em;
  text-shadow: 3px 3px 0 var(--shadow), 6px 6px 0 rgba(65, 166, 246, 0.35);
}
#home-header p {
  margin-top: 10px; color: var(--muted);
  font-size: 0.85rem; letter-spacing: 0.2em;
}

/* ---------- 主体 ---------- */
#home-main {
  position: relative; z-index: 1;
  display: flex; gap: 22px; justify-content: center; align-items: flex-start;
  padding: 14px 18px 30px; flex-wrap: wrap;
}

#map-wrap { padding: 14px; }
#map-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; gap: 10px;
}
#map-head h2 { font-size: 1rem; color: var(--gold); }
.pixel-btn.small { padding: 6px 12px; font-size: 0.85rem; }
#bkk-big { display: block; width: 420px; height: auto; background: #131523; border: 2px solid #2a2c44; cursor:grab; }
#bkk-big.is-zoomed { touch-action:none; }
#bkk-big.is-panning { cursor:grabbing; user-select:none; }

/* 曼谷大地图元素 */
.river-big { fill: none; stroke: #2f5a8a; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; vector-effect:non-scaling-stroke; }
.river-glow { fill: none; stroke: rgba(65, 166, 246, 0.25); stroke-width: 15; stroke-linecap: round; stroke-linejoin: round; vector-effect:non-scaling-stroke; }
.river-label { fill: #5a8ac8; font-size: 13px; font-family: inherit; letter-spacing: 0.2em; }
.road { fill: none; stroke: #3a3d52; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect:non-scaling-stroke; }
.park { fill: #274a35; stroke: #38b764; stroke-width: 1.5; }
.lm { fill: #94a0c8; stroke: #000; stroke-width: 1; }
.lm-label { fill: #a8b4d8; font-size: 13px; font-family: inherit; }
.dist-label { fill: rgba(148, 160, 200, 0.4); font-size: 16px; font-family: inherit; letter-spacing: 0.25em; }
.map-hint {
  text-align: center; color: var(--muted);
  font-size: 0.8rem; margin-top: 8px; letter-spacing: 0.12em;
}

#side-col {
  display: flex; flex-direction: column; gap: 22px;
  width: 380px;
}
#venue-list { padding: 14px; }
.list-title { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.list-title #venue-count { color:var(--muted); font-size:.76rem; }
#venue-list h2, #venue-card h2 {
  font-size: 1.05rem; margin-bottom: 10px;
  color: var(--gold);
}
#venue-list h2::before { content: '🎪 '; }
#venue-search {
  width:100%; margin-bottom:9px; padding:9px 10px;
  color:var(--fg); background:var(--panel2); border:2px solid #3a3d52;
  border-radius:0; outline:none; font:inherit; font-size:.82rem;
}
#venue-search:focus { border-color:var(--accent); }
.venue-filters { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px; }
.filter-btn {
  color:var(--muted); background:#202338; border:1px solid #3a3d52;
  padding:5px 8px; font:inherit; font-size:.72rem; cursor:pointer;
}
.filter-btn:hover, .filter-btn.active { color:#0b0c14; background:var(--gold); border-color:var(--gold); }
#vl { list-style:none; max-height:390px; overflow:auto; padding-right:4px; scrollbar-color:#465074 var(--panel2); }
.vl-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; margin-bottom: 6px;
  background: var(--panel2); border: 2px solid #2a2c44;
  cursor: pointer; font-size: 0.9rem;
}
.vl-item:hover { border-color: var(--accent); }
.vl-item.selected { border-color: var(--gold); }
.vl-rank { width:1.45rem; color:var(--gold); font-size:.7rem; text-align:right; flex:none; }
.vl-dot { width: 8px; height: 8px; background: #5a6a94; border: 1px solid #000; flex: none; }
.vl-item.ready .vl-dot { background: var(--green); }
.vl-item.selected .vl-dot { background: var(--gold); }
.vl-name { flex:1; min-width:0; }
.vl-name b { display:block; font-size:.84rem; font-weight:normal; }
.vl-address {
  display:block; margin-top:2px; color:var(--muted); font-size:.67rem;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-decoration:none;
}
.vl-address:hover { color:var(--accent); text-decoration:underline; }
.vl-cap { color: var(--muted); font-size: 0.66rem; white-space:nowrap; }

/* ---------- SVG 地图元素 ---------- */
.grid { stroke: rgba(148, 160, 200, 0.09); stroke-width: 1; vector-effect:non-scaling-stroke; }
.pin .pulse {
  fill: none; stroke: var(--gold); stroke-width: 2;
  animation: pulse 1.6s steps(6) infinite;
  transform-origin: center; transform-box: fill-box;
}
@keyframes pulse {
  0% { opacity: 1; transform: scale(0.4); }
  100% { opacity: 0; transform: scale(1.6); }
}

.pin { cursor: pointer; }
.pin .dot { fill: #5a6a94; stroke: #000; stroke-width: 2; }
.pin.ready .dot { fill: var(--green); }
.pin.selected .dot { fill: var(--gold); }
.pin .pulse { stroke: var(--green); }
.pin.selected .pulse { stroke: var(--gold); }
.pin-label { fill:var(--fg); font-size:13px; font-family:inherit; paint-order:stroke; stroke:#0b0c14; stroke-width:3px; pointer-events:none; }
.pin.map-only .pin-label { display:none; }
.pin.map-only:hover .pin-label, .pin.map-only.selected .pin-label { display:block; }
.pin:hover .dot { fill: var(--accent); }

/* ---------- 场馆卡 ---------- */
#venue-card { padding: 16px; }
.blink { animation: blink 1s steps(2) infinite; color: var(--muted); }
@keyframes blink { 50% { opacity: 0.25; } }
.vc-loc {
  display:block; color:var(--muted); font-size:0.82rem; line-height:1.45;
  margin-bottom:12px; text-decoration:none;
}
.vc-loc:hover { color:var(--accent); text-decoration:underline; }
.vc-stats { display: flex; gap: 10px; margin-bottom: 12px; }
.vc-stats > div {
  flex: 1; background: var(--panel2);
  border: 2px solid #2a2c44; padding: 8px 10px;
}
.vc-stats label { display: block; font-size: 0.72rem; color: var(--muted); }
.vc-stats b { font-size: 0.98rem; color: var(--gold); }
.vc-event { color: var(--accent2); font-size: 0.85rem; margin-bottom: 14px; min-height: 1em; }

.pixel-btn {
  display: inline-block;
  background: var(--accent); color: #0b0c14;
  border: 2px solid var(--border);
  box-shadow: 3px 3px 0 0 var(--shadow);
  padding: 10px 18px; font-size: 0.9rem;
  font-family: inherit; text-decoration: none;
  cursor: pointer;
}
.pixel-btn:hover { background: #5ab6ff; }
.pixel-btn:active { transform: translate(3px, 3px); box-shadow: none; }
.vc-soon { color: var(--muted); font-size: 0.9rem; }
.source-link { display:block; width:max-content; max-width:100%; margin-top:10px; color:var(--accent); font-size:.76rem; }

/* ---------- 底部 ---------- */
#home-footer {
  position: relative; z-index: 1;
  text-align: center; padding: 6px 16px 26px;
  color: var(--muted); font-size: 0.75rem; letter-spacing: 0.1em;
}
#home-footer > p { opacity: 0.7; }

/* SUDA 署名区 */
.suda-credit {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.suda-logo img {
  display: block; width: 52px; height: 52px;
  image-rendering: auto;
  filter: drop-shadow(0 0 10px rgba(244, 244, 244, 0.35));
  transition: filter 0.15s ease;
}
.suda-logo:hover img { filter: drop-shadow(0 0 14px rgba(65, 166, 246, 0.7)); }
.suda-links {
  display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap;
  justify-content: center;
}
.suda-links a {
  color: var(--muted); text-decoration: none; font-size: 0.78rem;
}
.suda-links a:hover { color: var(--accent); text-decoration: underline; }

@media (max-width: 780px) {
  :root { font-size: 15px; }
  #home-header { padding: max(22px, env(safe-area-inset-top)) 12px 12px; }
  #home-header h1 { font-size: clamp(1.35rem, 7vw, 1.8rem); letter-spacing: .05em; }
  #home-header p { font-size: .7rem; line-height: 1.6; letter-spacing: .08em; }
  #home-main { flex-direction: column; align-items: stretch; padding: 8px 8px 22px; gap: 14px; }
  #map-wrap, #side-col { width: 100%; }
  #map-wrap { padding: 9px; overflow: hidden; }
  #map-head { align-items: flex-start; }
  #map-head h2 { font-size: .85rem; line-height: 1.35; }
  #bkk-big { width: 100%; max-height: 66svh; }
  #side-col { gap: 14px; }
  #venue-card { order: -1; }
  #venue-list, #venue-card { padding: 12px; }
  #venue-search { min-height: 44px; font-size: 16px; }
  .filter-btn { min-height: 40px; flex: 1 1 auto; }
  #vl { max-height: 46svh; padding-right: 0; }
  .vl-item { min-height: 54px; padding: 8px; }
  .vl-address { white-space: normal; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .vc-stats { flex-direction: column; }
  .vc-loc { overflow-wrap: anywhere; }
  #vc-enter { width: 100%; min-height: 46px; text-align: center; }
  .source-link { width: 100%; line-height: 1.5; }
  #home-footer { padding-bottom: max(22px, env(safe-area-inset-bottom)); line-height: 1.6; }
}

@media (max-width: 380px) {
  #home-header p { font-size: .64rem; }
  .vc-stats b { font-size: .86rem; }
}
