/* ───────────────────────────────────────────────
   PitchLab 球場實驗室 — 量化終端美學 (dark / acid-green)
─────────────────────────────────────────────── */
:root {
  --bg: #060806;
  --bg-2: #0b0f0a;
  --panel: #0e130d;
  --panel-2: #121810;
  --line: rgba(94, 243, 140, 0.14);
  --line-soft: rgba(255, 255, 255, 0.06);
  --text: #e7ece4;
  --muted: #78857a;
  --dim: #4d574e;
  --accent: #5ef38c;
  --accent-2: #2f9d5c;
  --glow: rgba(94, 243, 140, 0.45);
  --neg: #ff6b6b;
  --gold: #e8c45f;

  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Noto Sans TC", "Bricolage Grotesque", system-ui, sans-serif;
  --display: "Bricolage Grotesque", "Noto Sans TC", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; }
.accent { color: var(--accent); }
.dim { color: var(--dim); }

/* ── 背景氛圍:噪點 + 綠輝光 ── */
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 45% at 50% -8%, rgba(94, 243, 140, 0.14), transparent 70%),
    radial-gradient(40% 30% at 88% 8%, rgba(47, 157, 92, 0.10), transparent 70%);
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px),
                    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 80%);
}

main, .topbar, .foot { position: relative; z-index: 1; }

/* ── 終端狀態列 ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(20px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(6, 8, 6, 0.7);
  backdrop-filter: blur(10px);
  position: sticky; top: 0;
}
.brand { display: flex; align-items: baseline; gap: 0; letter-spacing: 0.02em; }
.brand-mark { font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--text); }
.brand-sep { color: var(--accent); }
.brand-gaia {
  font-family: var(--mono); font-weight: 700; font-size: 14px;
  letter-spacing: 0.34em; color: var(--accent);
}
/* 導覽列(五頁共用) */
.topnav { display: flex; gap: 20px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; }
.topnav a { color: var(--muted); text-decoration: none; padding: 5px 2px; border-bottom: 1px solid transparent; transition: color 0.2s; }
.topnav a:hover { color: var(--text); }
.topnav a.on { color: var(--accent); border-bottom-color: var(--accent); }
/* topbar 共用 RWD(五頁共用):窄幅換行、品牌不直排、手機隱藏 status */
.topbar { flex-wrap: wrap; gap: 8px 16px; z-index: 10; }
.topbar .brand { text-decoration: none; white-space: nowrap; }
@media (max-width: 560px) { .topbar .status { display: none; } }
.status {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  letter-spacing: 0.04em;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--glow); animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--glow); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ── Hero ── */
main { max-width: 1080px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 64px); }
.hero { padding: clamp(56px, 9vw, 110px) 0 clamp(36px, 5vw, 56px); }
.hero-tag {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.42em;
  color: var(--accent-2); margin-bottom: 22px;
  opacity: 0; animation: rise 0.7s 0.05s forwards;
}
.hero-title {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(44px, 8.5vw, 92px); line-height: 0.98; letter-spacing: -0.02em;
  opacity: 0; animation: rise 0.8s 0.12s forwards;
}
.hero-title .accent {
  text-shadow: 0 0 38px rgba(94, 243, 140, 0.4);
}
.hero-sub {
  margin-top: 26px; max-width: 620px; color: var(--muted); font-size: clamp(15px, 2vw, 18px);
  opacity: 0; animation: rise 0.8s 0.22s forwards;
}
.hero-sub strong { color: var(--text); font-weight: 700; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ── footer ── */
.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 34px clamp(20px, 5vw, 64px) 56px; max-width: 1080px; margin-inline: auto; }
.foot-line { margin-bottom: 18px; font-size: 11.5px; }
.disclaimer { font-size: 12px; color: var(--muted); line-height: 1.7; }
.disclaimer a, .foot a { color: var(--accent-2); text-decoration: none; }
.disclaimer a:hover, .foot a:hover { text-decoration: underline; }

/* ── RWD ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
  .hero-tag, .hero-title, .hero-sub { opacity: 1; transform: none; }
}

/* 比賽設定卡:賽事 + 主客隊(+ 開賽)收進同一張卡,讓選賽事與選隊明確是同一組 */
.setup-card {
  display: flex; flex-direction: column; align-items: center;
  max-width: 620px; margin: clamp(26px, 4vw, 44px) auto 0;
  padding: clamp(24px, 3.5vw, 34px) clamp(18px, 3vw, 30px);
  border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
}
.setup-card .pick-grid { margin: 0; max-width: none; width: 100%; }
.setup-card .kickoff-btn { margin-top: clamp(22px, 3vw, 30px); }

/* 賽事選擇列(標籤 + 切換),作為設定卡的第一個欄位,與主隊/客隊同款標籤 */
.comp-pick {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  margin-bottom: clamp(20px, 3vw, 26px);
}
.comp-pick > label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--muted);
}
.comp-tog {
  display: flex; width: fit-content; gap: 2px; margin: 0;
  padding: 3px; border: 1px solid var(--line); border-radius: 11px;
  background: rgba(0, 0, 0, 0.22);
}
.comp-opt {
  appearance: none; border: none; background: transparent; color: var(--muted);
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em;
  padding: 7px 20px; border-radius: 8px; cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.comp-opt:hover { color: var(--text); }
.comp-opt.on { background: var(--accent); color: #06210f; font-weight: 700; }

/* 語言切換器(三頁共用) */
.lang-sel {
  margin-left: auto; appearance: none; -webkit-appearance: none;
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em;
  padding: 5px 22px 5px 10px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%2379857a'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  transition: border-color 0.2s, color 0.2s;
}
.lang-sel:hover { border-color: rgba(94, 243, 140, 0.35); color: var(--text); }
.lang-sel:focus { outline: none; border-color: rgba(94, 243, 140, 0.45); }
.lang-sel option { background: #0c120d; color: #e7ebe4; }
.topbar .status { margin-left: 0; }

/* header 常駐頻道鈕(五頁共用) */
.tg-header {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em;
  color: var(--accent); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; transition: border-color 0.2s, background 0.2s;
}
.tg-header:hover { border-color: var(--accent); background: rgba(94, 243, 140, 0.08); }

/* 分享按鈕列(sim / cup 共用) */
.share-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 28px auto 8px; }
.share-btn {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.03em;
  color: var(--bg); background: var(--accent); border: 1px solid var(--accent);
  border-radius: 10px; padding: 10px 18px; cursor: pointer;
  transition: filter 0.2s, background 0.2s, color 0.2s;
}
.share-btn:hover { filter: brightness(1.08); }
.share-btn.ghost { background: transparent; color: var(--accent); }
.share-btn.ghost:hover { background: rgba(94, 243, 140, 0.08); }

/* 分享成功後的頻道引流提示(右下浮出,4 秒自動收) */
.share-hint {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.03em;
  color: var(--bg); background: var(--accent); text-decoration: none;
  border-radius: 12px; padding: 12px 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45), 0 0 22px var(--glow);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.share-hint.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
@media (max-width: 560px) { .share-hint { right: 12px; left: 12px; bottom: 12px; text-align: center; } }

/* 自訂捲軸(內捲區域:賽程清單、對戰樹)— 細、暗、品牌綠 */
.fx-list, .bk-scroll { scrollbar-width: thin; scrollbar-color: rgba(94, 243, 140, 0.3) transparent; }
.fx-list::-webkit-scrollbar, .bk-scroll::-webkit-scrollbar { width: 7px; height: 7px; }
.fx-list::-webkit-scrollbar-track, .bk-scroll::-webkit-scrollbar-track { background: transparent; }
.fx-list::-webkit-scrollbar-thumb, .bk-scroll::-webkit-scrollbar-thumb {
  background: rgba(94, 243, 140, 0.25); border-radius: 4px; border: 2px solid transparent; background-clip: padding-box;
}
.fx-list::-webkit-scrollbar-thumb:hover, .bk-scroll::-webkit-scrollbar-thumb:hover { background: rgba(94, 243, 140, 0.5); background-clip: padding-box; }
