/* ════════════════════════════════════════════════════════════════
   SKMVP 前台共用樣式  static/css/skmvp.css
   來源:templates/base.html 原 inline <style>(逐字搬移,視覺不變)
   + 各前台 template 重複樣式逐步收斂於檔尾「Shared components」區
   載入順序:base.html <head> 先載本檔,再載各頁 extra_style,
   故各頁同名規則仍可覆蓋本檔。
   ════════════════════════════════════════════════════════════════ */

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

:root {
  --bg:        #0b0c10;
  --surface:   #111318;
  --card:      #181a22;
  --card2:     #1e2130;
  --border:    #252833;
  --border2:   #2e3245;

  --gold:      #c9a84c;
  --gold-lt:   #e8c96d;
  --gold-dk:   #a8892f;
  --gold-bg:   rgba(201,168,76,.10);
  --gold-bg2:  rgba(201,168,76,.06);

  --text:      #eeeae3;
  --text2:     #bbb8b0;
  --muted:     #7a7880;

  --green:     #4ade80;
  --green-bg:  rgba(74,222,128,.10);
  --red:       #f87171;
  --red-bg:    rgba(248,113,113,.10);
  --amber:     #fbbf24;
  --amber-bg:  rgba(251,191,36,.10);
  --blue:      #60a5fa;
  --blue-bg:   rgba(96,165,250,.10);

  --nba:       #c9a22a;
  --mlb:       #e05c3a;

  --radius:    10px;
  --radius-sm: 6px;
  --shadow:    0 4px 24px rgba(0,0,0,.35);

  --mob-nav-h: 64px;
}

body {
  background: var(--bg);
  color: var(--text);
  /* 2026-06-12 第一刀:補中文字型棧(零 webfont 成本),
     數字欄位 tabular-nums 等寬對齊(賠率/比分/戰績) */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               "Noto Sans TC", "PingFang TC", "Microsoft JhengHei",
               "Helvetica Neue", sans-serif;
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Header ── */
header {
  background: #010204;
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 0 14px;
  display: flex;
  align-items: center;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
/* Logo — absolutely centred in the full header width */
.logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  gap: 8px;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: .06em;
  z-index: 2;
}
.logo-icon { color: var(--gold); font-size: 1.2rem; }
.logo-text { color: var(--text); }
.logo-text span { color: var(--gold); }
/* picture logo */
.logo-img { display: block; height: 50px; width: auto; max-width: 250px; object-fit: contain; }
@media (max-width: 480px) { .logo-img { height: 46px; max-width: 230px; } }
@media (min-width: 768px) { .logo-img { height: 54px; max-width: 270px; } }
.logo-fallback { display: inline-flex; align-items: center; justify-content: center; gap: 8px; line-height: 1; }

/* Right nav — stays at far right, above logo layer */
header nav {
  margin-left: auto;
  display: flex;
  gap: 4px;
  position: relative;
  z-index: 3;
}
header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all .18s;
}
header nav a:hover { color: var(--text); background: rgba(255,255,255,.05); }
header nav a.active { color: var(--gold); background: var(--gold-bg2); }

/* ── Main ── */
main { max-width: 980px; margin: 0 auto; padding: 36px 16px 60px; }

/* ── Utility ── */
.badge {
  display: inline-block;
  font-size: .72rem; font-weight: 700;
  padding: 2px 9px; border-radius: 20px;
}
.badge-gold   { background: var(--gold-bg);  color: var(--gold-lt); border: 1px solid rgba(201,168,76,.3); }
.badge-green  { background: var(--green-bg); color: var(--green); }
.badge-red    { background: var(--red-bg);   color: var(--red); }
.badge-amber  { background: var(--amber-bg); color: var(--amber); }
.badge-blue   { background: var(--blue-bg);  color: var(--blue); }
.badge-muted  { background: rgba(122,120,128,.12); color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.card + .card { margin-top: 14px; }

.section-label {
  font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); margin-bottom: 14px;
}

.gold-bar {
  width: 32px; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-lt));
  border-radius: 2px; margin-bottom: 10px;
}

/* ── Mobile bottom nav ───────────────────────────────────── */
.mob-nav {
  display: none;
}

@media (max-width: 768px) {
  /* 桌面 header nav 隱藏（品牌 logo 保留） */
  header nav { display: none; }

  /* 主內容底部留出 nav 高度 */
  main { padding-bottom: calc(var(--mob-nav-h) + 20px); }
  body  { padding-bottom: 0; }

  /* Bottom nav */
  .mob-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--mob-nav-h);
    background: rgba(17, 19, 24, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    z-index: 200;
    align-items: stretch;
    /* safe area for notch phones */
    padding-bottom: env(safe-area-inset-bottom);
  }

  .mob-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: var(--muted);
    font-size: .64rem;
    font-weight: 600;
    letter-spacing: .03em;
    transition: color .15s;
    padding: 0 4px;
    -webkit-tap-highlight-color: transparent;
  }

  /* pack icon img — inactive: 降低 opacity，active: 全亮 */
  .mob-nav-icon {
    display: block;
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    opacity: 0.42;
    transition: opacity .15s;
    object-fit: contain;
  }

  .mob-nav-item.active .mob-nav-icon {
    opacity: 1;
  }

  .mob-nav-item.active {
    color: var(--gold);
  }

  /* Access item — 與其它項目等高，只有 active 才高亮 */
  .mob-nav-item.nav-access .mob-nav-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ── Responsive (small mobile) ── */
@media (max-width: 600px) {
  main { padding: 20px 12px calc(var(--mob-nav-h) + 24px); }
}

/* ── UI Icon system ─────────────────────────────────────────── */
.ui-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  object-fit: contain;
}
.ui-icon-sm  { width: 14px; height: 14px; }
.ui-icon-md  { width: 18px; height: 18px; }
.ui-icon-lg  { width: 22px; height: 22px; }
.ui-icon-xl  { width: 28px; height: 28px; }

/* ── League logo system ─────────────────────────────────────── */
.league-logo {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  border-radius: 4px;
  object-fit: contain;
}
.league-logo-sm  { width: 20px; height: 20px; }
.league-logo-md  { width: 28px; height: 28px; }
.league-logo-lg  { width: 36px; height: 36px; }

/* Chip: logo + text side by side */
.logo-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text2);
}

/* ════════════════════════════════════════════════════════════════
   Shared components(自各 template 收斂的重複樣式)
   ════════════════════════════════════════════════════════════════ */

/* ── Error pages(403 / 404 / 500 共用)──
   註:403/404 的 .btn-home 另有 margin-right:10px,留在各頁 extra_style */
.err-wrap {
  max-width: 480px;
  margin: 64px auto 0;
  text-align: center;
}
.err-code {
  font-size: 5rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: -.02em;
  line-height: 1;
}
.err-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin: 14px 0 10px;
}
.err-desc {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 30px;
}
.btn-home {
  display: inline-block;
  padding: 10px 26px;
  background: var(--gold-bg);
  border: 1px solid rgba(201,168,76,.3);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s;
}
.btn-home:hover { background: var(--gold-bg2); }
.btn-back, .btn-login {
  display: inline-block;
  padding: 10px 26px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s;
}
.btn-back:hover, .btn-login:hover { background: rgba(255,255,255,.07); }

/* ── 導航載入進度條(冷快取等待回饋,JS 在 base.html)── */
#nav-progress {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-lt));
  z-index: 9999; opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
#nav-progress.active {
  opacity: 1;
  animation: navprog 8s cubic-bezier(.1,.7,.2,1) forwards;
}
@keyframes navprog {
  0%   { width: 0; }
  10%  { width: 35%; }
  50%  { width: 70%; }
  100% { width: 92%; }
}
@media (prefers-reduced-motion: reduce) { #nav-progress { display: none; } }
/* ════════════════════════════════════════════════════════════════
   P1 視覺強化  (2026-06-13 第三刀)
   — Hero 金色光暈 pulse
   — MVP CORE stagger scroll-reveal
   — prefers-reduced-motion 保護
   ════════════════════════════════════════════════════════════════ */

/* keyframes — 只在允許動態時定義，供 home.html extra_style 引用 */
@media (prefers-reduced-motion: no-preference) {
  @keyframes heroGlowPulse {
    0%, 100% { opacity: 0; }
    50%       { opacity: 1; }
  }
  @keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Scroll-reveal core-card 已遷移至 skmvp-motion.css data-stagger 系統 */

  /* ── P1.5 追加 keyframes (2026-06-13 動效升級) ── */

  /* H1 gold text shimmer sweep */
  @keyframes textShimmer {
    0%   { background-position: -200% center; }
    100% { background-position:  200% center; }
  }

  /* CTA 按鈕白光掃過 */
  @keyframes btnShimmer {
    0%, 55%, 100% { left: -130%; }
    28%            { left: 170%;  }
  }

  /* Hero 雷達掃描線 */
  @keyframes heroScan {
    0%          { transform: translateY(-120%); opacity: 0; }
    6%          { opacity: 1; }
    44%         { transform: translateY(120%); opacity: 1; }
    50%, 100%   { transform: translateY(-120%); opacity: 0; }
  }

  /* Official 推薦卡片金色呼吸光 */
  @keyframes cardGlow {
    0%, 100% { box-shadow: 0 0 0 1px rgba(201,168,76,.18),
                            0 4px 18px rgba(201,168,76,.07); }
    50%       { box-shadow: 0 0 0 1px rgba(201,168,76,.38),
                            0 6px 24px rgba(201,168,76,.18),
                            0 0 36px rgba(201,168,76,.08); }
  }
}
/* ── end of skmvp.css ── */
