/* ============================================================
   StrikeBoard – Main Stylesheet  (~6000 行)
   Covers: index.html, games.html, members.html,
           customers.html, scorer.html, dashboard.html

   SECTIONS(行號 approx,±20 內;v0.53.1 起維護)
   ──────────────────────────────────────────────────────────
    §1.  CUSTOM PROPERTIES (CSS vars / theme)         ≈   45
    §2.  RESET & BASE                                  ≈   90
    §3.  LAYOUT HELPERS                                ≈  120
    §4.  NAVBAR                                         ≈  140
    §5.  HERO                                            ≈  225
    §6.  SECTION + Announcements                        ≈  340
    §7.  CARDS                                           ≈  395
    §8.  BUTTONS                                         ≈  430
    §9.  FORMS                                           ≈  510
    §10. TABLES                                          ≈  680
    §11. TABS (page-level tabs + ia-modes / ia-subtab)   ≈  755
    §12. BADGES                                          ≈  860
    §13. FOOTER                                          ≈  890
    §14. AUTH CARDS                                      ≈  975
    §15. SEARCH BAR                                      ≈ 1085
    §16. TOOLBAR                                         ≈ 1110
    §17. TRACKER PAGE (games.html 觀眾)                  ≈ 1140
    §18. SCORER PAGE                                     ≈ 1215
    §19. DASHBOARD (TV 大螢幕)                            ≈ 1310
    §20. WS STATUS BAR                                    ≈ 1580
    §21. QR MODAL                                         ≈ 1595
    §22. TOAST / NOTIFICATIONS                            ≈ 1665
    §23. LOADING SPINNER                                  ≈ 1705
    §24. FEATURES GRID + Index page nav cards            ≈ 1740
    §25. MEMBER GRID                                      ≈ 1935
    §26. PROFILE + Member profile card + per-plan        ≈ 1995
    §27. PAGINATION                                       ≈ 2115
    §28. PODIUM                                            ≈ 2125
    §29. RESPONSIVE                                        ≈ 2135
    §30. Active game banner / Award mode / Game filter   ≈ 2185
    §31. Share modals / Hero medals / OG card            ≈ 2700+
    §32. Stats / IA modes / settings panels              ≈ 4200+
   ────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Chakra Petch';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/ChakraPetch-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Chakra Petch';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/ChakraPetch-Bold.ttf') format('truetype');
}

/* ── 1. CUSTOM PROPERTIES ─────────────────────────────────── */
:root {
  --color-primary:       #1a237e;
  --color-primary-dark:  #0d1257;
  --color-primary-light: #3949ab;
  --color-accent:        #ffa000;
  --color-accent-dark:   #c67600;
  --color-accent-light:  #ffd740;
  /* v0.59.9 第三 accent — 跳脫深藍+金 sport cliché,給 strike 撞瓶能量感 */
  --color-pop:           #ec4899;
  --color-pop-dark:      #be185d;
  --color-pop-light:     #f9a8d4;
  --color-danger:        #d32f2f;
  --color-success:       #388e3c;
  --color-warning:       #f57c00;
  --color-info:          #0288d1;

  --color-bg:            #f5f6fa;
  --color-surface:       #ffffff;
  --color-border:        #dde1f0;
  --color-text:          #1c1f3b;
  --color-text-muted:    #6b7280;
  --color-text-light:    #9ca3af;

  /* dark theme (dashboard) */
  --db-bg:               #0a0c1a;
  --db-surface:          #111428;
  --db-surface-2:        #1a1e35;
  --db-border:           #252a48;
  --db-text:             #e8eaf6;
  --db-text-muted:       #9fa8da;

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.10);
  --shadow-md: 0 4px 12px rgba(0,0,0,.12);
  --shadow-lg: 0 8px 28px rgba(0,0,0,.16);
  --shadow-accent: 0 4px 18px rgba(255,160,0,.30);

  --font-sans: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Consolas', 'Fira Code', monospace;

  --transition: 180ms ease;
  --nav-h: 62px;
}

/* ── 2. RESET & BASE ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

/* 大螢幕自動放大根字級 — 字級 / 間距皆 rem-based,改 root 一處即等比放大整個 UI。
   16px 是為手機近距離調的;平板(客戶操作)/ 桌機看更遠 → 放大更好讀。
   ≥768px 用 clamp() 流體縮放:768px→19px、1440px+→26px,中間平滑無跳階。
   手機(<768px)維持 16px;電視牆 / 計分板走 viewport sizing,不受影響。 */
@media (min-width: 768px) {
  html { font-size: clamp(19px, calc(19px + (100vw - 768px) * 7 / 672), 26px); }
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Heading hierarchy uses Chakra Petch — display font for brand consistency */
h1, h2, h3,
.nav-card__title,
.feature-item__title,
.hero__subtitle,
.dashboard-title-gradient {
  font-family: 'Chakra Petch', var(--font-sans);
  letter-spacing: .01em;
}
/* Numeric content everywhere gets tabular-nums so scores line up */
.stat-num, .score-num, .hero__stat-number, .gs-score-val,
[data-number], .tabular {
  font-variant-numeric: tabular-nums;
}

/* ── v0.59.8 quick-win polish ──────────────────────────────────────
   W1: 統一 Chakra Petch 用於所有「分數 / 排名 / 統計大字」— 球員看到立即記住的數字
   W2: input focus 升級成琥珀金 glow,取代瀏覽器預設 outline(a11y 仍 visible via box-shadow)
   W4: button press tactile feedback — scale 0.97 + 100ms ease-out
   ────────────────────────────────────────────────────────────────── */

/* W1 — display numerals: Chakra Petch + tabular-nums + 700 weight */
.font-display-num,
.stat-num, .score-num, .hero__stat-number, .gs-score-val,
[data-display-num] {
  font-family: 'Chakra Petch', var(--font-sans);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: .005em;
}

/* W2 — input focus glow (premium feel,a11y-compliant ring 用 box-shadow) */
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.form-field__input:focus,
.form-field__textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255, 160, 0, .15);
}

/* W4 — button tactile press feedback (transition fast 不影響 hover transform) */
.btn:active,
button:not(:disabled):active {
  transform: scale(0.97);
  transition: transform 100ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .btn:active, button:not(:disabled):active { transform: none; }
}

/* ── v0.59.9 SIGNATURE UTILITIES ───────────────────────────────────
   5 個保齡球品牌 DNA pattern,推廣到全頁面用,讓 6 頁視覺一致。
   Welcome / Customers admin / Members / Games / Customer-public 各頁
   至少加 2 個 utility(W1 .font-display-num 已算第 5 個 signature)。
   ────────────────────────────────────────────────────────────────── */

/* Signature #1 — 對角球道斜紋背景(球道 inspired,bowling DNA 核心)
   .bs-stripes 套淺色容器(amber 微透);.bs-stripes--dark 套深色容器
   推薦:已結束賽事卡 / 完賽 award / member home hero card 背景 */
.bs-stripes {
  position: relative;
  isolation: isolate;
}
.bs-stripes::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    -42deg,
    transparent 0 18px,
    rgba(255, 215, 64, .07) 18px 19px
  );
  pointer-events: none;
  z-index: -1;
}
.bs-stripes--dark::before {
  background: repeating-linear-gradient(
    -42deg,
    transparent 0 18px,
    rgba(255, 215, 64, .12) 18px 19px
  );
}
.bs-stripes--strong::before {
  background: repeating-linear-gradient(
    -42deg,
    transparent 0 18px,
    rgba(255, 215, 64, .15) 18px 19px
  );
}

/* Signature #2 — Corner accent triangle(navy → amber 對角小三角)
   .bs-corner 加在 card 容器,decoration only;支援 .bs-corner--pop(熱粉版) */
.bs-corner {
  position: relative;
  overflow: hidden;
}
.bs-corner::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 28px; height: 28px;
  background: linear-gradient(225deg,
    var(--color-accent) 0% 50%,
    transparent 50%);
  pointer-events: none;
}
.bs-corner--alt::after {
  background: linear-gradient(225deg,
    var(--color-accent-dark) 0% 50%,
    transparent 50%);
}
.bs-corner--pop::after {
  background: linear-gradient(225deg,
    var(--color-pop) 0% 50%,
    transparent 50%);
}

/* Signature #3 — Radial dual-source glow(雙光源氛圍)
   .bs-glow 加在 section / hero;兩個光源在 20%/80% 位置,層次感 */
.bs-glow {
  position: relative;
  isolation: isolate;
}
.bs-glow::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(255, 160, 0, .10), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 70%, rgba(26, 35, 126, .08), transparent 60%);
  pointer-events: none;
  z-index: -1;
}
.bs-glow--dark::before {
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(255, 160, 0, .25), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 70%, rgba(0, 212, 255, .18), transparent 60%);
}
.bs-glow--pop::before {
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(255, 160, 0, .12), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 70%, rgba(236, 72, 153, .10), transparent 60%);
}

/* Signature #4 — Live pulse dot(generic 版,extracted from .ws-status__dot)
   .bs-pulse-dot 8px 圓點 + 2.4s pulse;支援 success / pop / accent 變色 */
.bs-pulse-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  animation: bs-pulse-live 2.4s ease-in-out infinite;
}
.bs-pulse-dot--pop { background: var(--color-pop); }
.bs-pulse-dot--accent { background: var(--color-accent); }
.bs-pulse-dot--info { background: var(--color-info); }
@keyframes bs-pulse-live {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  50%      { box-shadow: 0 0 0 6px transparent; opacity: .65; }
}
@media (prefers-reduced-motion: reduce) {
  .bs-pulse-dot { animation: none; }
}

/* Signature #5 — .font-display-num(W1 已定義,在此 section 重述為 DNA 一員) */

img { max-width: 100%; display: block; }
a { color: var(--color-primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

/* ── 3. LAYOUT HELPERS ────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── 4. NAVBAR ────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-h);
  background: var(--color-primary);
  box-shadow: 0 2px 10px rgba(0,0,0,.30);
  display: flex;
  align-items: center;
}

.navbar .container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 100%;
  padding-inline: 1rem;
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: #fff;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-decoration: none;
  flex-shrink: 0;
}

.navbar__brand svg,
.navbar__brand img { width: 32px; height: 32px; }

.navbar nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-left: auto;
}

.navbar__link {
  color: rgba(255,255,255,.80);
  padding: .4rem .8rem;
  border-radius: var(--radius-sm);
  font-size: .92rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}

.navbar__link:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.navbar__link--active { background: var(--color-accent); color: var(--color-primary); font-weight: 700; }
.navbar__link--active:hover { background: var(--color-accent-light); }

.navbar .navbar__logout-btn {
  color: #fff;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.4);
  flex-shrink: 0;
  padding: .2rem .7rem;
  font-size: .75rem;
  min-height: 0;
}
.navbar .navbar__logout-btn:hover { background: rgba(255,255,255,.25); border-color: rgba(255,255,255,.7); }

.navbar__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  padding: .4rem;
  border-radius: var(--radius-sm);
}

#mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--color-primary-dark);
  padding: .5rem 1rem 1rem;
}

#mobile-nav .navbar__link { display: block; padding: .6rem .8rem; }
#mobile-nav.is-open { display: flex; }
/* 2.2.0 — 手機漢堡實際上從沒動過:上面這段等的是 .is-open 與 .navbar__link,
   但 7 頁(index/games/members/badges/customers/welcome/organizer-guide)的 JS 切的是 `hidden` 屬性、
   連結是 .navbar__mobile-link,且 <span> 三條線零樣式(實測 420px:鈕 14×14 透明、選單 display:none)。
   使用者選「全站統一修」。⚠️ 用 :not([hidden]) 而不是無條件 display:flex —— 否則會壓掉 hidden 屬性。 */
#mobile-nav:not([hidden]) {
  display: flex;
  /* .navbar 是固定高度 flex row,選單直接放進去會變成同列一條窄欄壓在 hero 上(第二次截圖);
     改成絕對定位貼在 bar 下方整寬(.navbar 是 sticky ⇒ 可當定位參考),並抵消 `.navbar nav{margin-left:auto}` */
  position: absolute; top: 100%; left: 0; right: 0; margin-left: 0;
  align-items: stretch; /* 抵消 .navbar nav{align-items:center},連結靠左撐滿 */
  box-shadow: 0 8px 16px rgba(0,0,0,.25);
}
#mobile-nav .navbar__mobile-link { display: block; padding: .6rem .8rem; color: #fff; text-decoration: none; border-radius: var(--radius-sm); }
#mobile-nav .navbar__mobile-link:hover { background: rgba(255,255,255,.12); text-decoration: none; }
/* 2.2.0 navbar 右側「身分鈕」(index 的 主辦方登入/會員登入、games 的 會員/名字):白底反白。
   原本住在 home.css(首頁專用),使用者要 games.html 用同一款 ⇒ 搬進來給全站用。 */
.navbar__nav .hm-nav-btn { border: 1px solid rgba(255,255,255,.45); border-radius: 8px; padding: .35rem .9rem; margin-left: .35rem; }
.navbar__nav .hm-nav-btn--solid { background: #fff; color: var(--color-primary-dark); border-color: #fff; font-weight: 700; }
.navbar__nav .hm-nav-btn--solid:hover { background: var(--color-accent-light); color: var(--color-primary-dark); }
.navbar__toggle { flex-direction: column; } /* ≤768 是 display:flex,不指定方向三條線會排成一橫排 */
.navbar__toggle span { display: block; width: 22px; height: 2px; margin: 2px 0; background: currentColor; border-radius: 1px; }

/* ── 5. HERO ──────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff;
  padding: 4rem 1rem 3.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* 背景光暈層 — 增加深度 */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 80%, rgba(255,160,0,.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 20%, rgba(57,73,171,.25) 0%, transparent 70%),
    radial-gradient(ellipse 80% 60% at 50% 120%, rgba(13,18,87,.40) 0%, transparent 60%);
  pointer-events: none;
}

/* 微妙幾何紋理 */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero__content { position: relative; z-index: 1; }

.hero__logo {
  max-width: 480px;
  width: 100%;
  display: block;
  margin: 0 auto 1rem;
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: .75rem;
  text-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.hero__title span { color: var(--color-accent-light); }

.hero__badge {
  display: inline-block;
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-full);
  padding: .4rem 1.5rem;
  margin-bottom: 1.5rem;
  font-size: .95rem;
  letter-spacing: .08em;
}

.hero__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: rgba(255,255,255,.85);
  max-width: 560px;
  margin: 0 auto 2rem;
}

/* Hero 統計數字 */
.hero__stats {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-lg);
  padding: 1rem 2rem;
  margin-top: .5rem;
  /* Hero stats 改成 <a> 連到賽事列表 — 抑制 anchor 預設樣式並加 hover affordance */
  color: inherit;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
a.hero__stats:hover {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,215,64,.4);
  transform: translateY(-1px);
}

.hero__stat { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.hero__stat-number {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--color-accent-light);
  line-height: 1;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 18px rgba(255,215,64,.45);
}
.hero__stat-label {
  font-size: .72rem;
  color: rgba(255,255,255,.72);
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 600;
}
.hero__stat-divider { width: 1px; height: 2.6rem; background: linear-gradient(180deg, transparent, rgba(255,215,64,.4), transparent); }

/* ── 6. SECTION ───────────────────────────────────────────── */
.section {
  padding: 3rem 1rem;
}

.section--alt { background: #eef0fb; }
.section--cards { background: var(--color-bg); }
.section--features { }

/* ── Announcements ── */
.announcements-section { padding-top: 1.5rem; padding-bottom: 1.5rem; background: linear-gradient(180deg, #fff 0%, #fef9f0 100%); }
.announcements-list { display: flex; flex-direction: column; gap: .75rem; max-width: 800px; margin: 1rem auto 0; }
.announcement-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left: 4px solid var(--color-primary);
  border-radius: .5rem;
  padding: .85rem 1rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
  transition: box-shadow .15s, transform .15s;
}
.announcement-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); transform: translateY(-1px); }
.announcement-card--pinned { border-left-color: #f59e0b; background: #fffbeb; }
.announcement-card__header { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .35rem; }
.announcement-card__title { font-size: 1rem; font-weight: 700; margin: 0; color: var(--color-text); }
.announcement-card__date { font-size: .75rem; color: #9ca3af; white-space: nowrap; }
.announcement-card__body { font-size: .88rem; color: #4b5563; line-height: 1.55; }

.section__title {
  font-family: 'Chakra Petch', var(--font-sans);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: .5rem;
  position: relative;
  display: inline-block;
  letter-spacing: .01em;
}

/* 標題底部裝飾線 — 漸層金帶 */
.section__title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
  border-radius: 2px;
  margin-top: .55rem;
  box-shadow: 0 2px 6px rgba(255,160,0,.3);
}

.section__title--sm { font-size: 1.25rem; }

.section__subtitle {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

/* ── 7. CARDS ─────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.card__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
  padding: 1rem 1.25rem .5rem;
  border-bottom: 1px solid var(--color-border);
}

.card__body { padding: 1rem 1.25rem 1.25rem; }

/* card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.card-grid--screens { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

/* ── 8. BUTTONS ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .55rem 1.25rem;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  font-family: var(--font-sans);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition),
              color var(--transition), box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* Sheen sweep on hover — sports feel without distraction */
.btn--primary::before,
.btn--secondary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform .55s ease;
  pointer-events: none;
}
.btn--primary:hover:not(:disabled)::before,
.btn--secondary:hover:not(:disabled)::before { transform: translateX(120%); }

.btn--primary {
  background: var(--color-accent);
  color: var(--color-primary-dark);
  border-color: var(--color-accent);
}
.btn--primary:hover:not(:disabled) {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  box-shadow: var(--shadow-accent);
  text-decoration: none;
}

.btn--secondary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn--secondary:hover:not(:disabled) { background: var(--color-primary-dark); border-color: var(--color-primary-dark); text-decoration: none; }

.btn--danger {
  background: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}
.btn--danger:hover:not(:disabled) { background: #b71c1c; border-color: #b71c1c; text-decoration: none; }

.btn--outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn--outline:hover:not(:disabled) { background: var(--color-primary); color: #fff; text-decoration: none; }

.btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
}
.btn--ghost:hover:not(:disabled) { background: var(--color-border); color: var(--color-text); text-decoration: none; }

.btn--sm { padding: .35rem .8rem; font-size: .82rem; }
.btn--lg { padding: .75rem 1.75rem; font-size: 1.05rem; }
.btn--full { width: 100%; }

/* ── 9. FORMS ─────────────────────────────────────────────── */
.form-group,
.form-field {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-bottom: 1rem;
}

.form-field--col-2,
.form-field--inline { flex-direction: row; align-items: center; gap: .75rem; }

.form-field--row { flex-direction: row; align-items: flex-start; gap: .75rem; }

.form-field--toggle {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 0;
  border-top: 1px solid var(--color-border);
}

.form-fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.form-fieldset legend,
.form-field--col-full { grid-column: 1 / -1; }

.form-label,
.form-field__label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--color-text);
}

.form-field__required { color: var(--color-danger); margin-left: 2px; }
.form-field__hint { font-size: .8rem; color: var(--color-text-muted); }

.form-input,
.form-field__input,
.form-field__textarea {
  padding: .55rem .85rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: .95rem;
  color: var(--color-text);
  background: var(--color-surface);
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-field__input:focus,
.form-field__textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255,160,0,.22), 0 2px 8px rgba(255,160,0,.1);
}

.form-field__textarea { resize: vertical; min-height: 80px; }

.form-field__input-wrap { position: relative; display: flex; align-items: center; }
.form-field__prefix-icon {
  position: absolute;
  left: .75rem;
  width: 1.1rem;
  height: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
}
.form-field__input--with-prefix { padding-left: 2.25rem; }

/* 數值 +/- stepper(派獎「取前 N 名 / 備選」用,v0.74.0)*/
.num-stepper { display: inline-flex; align-items: stretch; }
.num-stepper__btn {
  width: 2rem; flex: 0 0 auto;
  border: 1px solid var(--color-border); background: #f1f5f9;
  color: var(--color-text); font-size: 1.2rem; font-weight: 700; line-height: 1;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
.num-stepper__btn:active { background: #cbd5e1; }
.num-stepper__btn:first-child { border-radius: 6px 0 0 6px; border-right: none; }
.num-stepper__btn:last-child { border-radius: 0 6px 6px 0; border-left: none; }
.num-stepper__input {
  width: 3rem !important; text-align: center; border-radius: 0 !important;
}

.form-error,
.form-field__error {
  font-size: .8rem;
  color: var(--color-danger);
  font-weight: 500;
}

.form-field__error--block { display: block; margin-top: .25rem; }
.form-field__link { font-size: .85rem; color: var(--color-primary-light); }

.form-actions {
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

/* toggle switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle-switch__thumb {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition);
}

.toggle-switch__thumb::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
}

.toggle-switch input:checked + .toggle-switch__thumb { background: var(--color-primary-light); }
.toggle-switch input:checked + .toggle-switch__thumb::before { transform: translateX(20px); }
.toggle-switch--on .toggle-switch__thumb { background: var(--color-primary-light); }
.toggle-switch--on .toggle-switch__thumb::before { transform: translateX(20px); }

.form-field__toggle-label { font-weight: 600; font-size: .9rem; }
.form-field__toggle-desc { font-size: .8rem; color: var(--color-text-muted); }
.form-field__toggle-vis { display: flex; align-items: center; background: none; border: none; cursor: pointer; padding: 0.25rem; }
.form-field__toggle-vis svg { width: 1.2rem; height: 1.2rem; }

/* checkbox */
.form-field__checkbox-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  font-size: .9rem;
}

.form-field__checkbox { width: 16px; height: 16px; accent-color: var(--color-primary); cursor: pointer; }

/* copy field */
.copy-field { display: flex; gap: .5rem; align-items: center; }
.copy-field__input { flex: 1; font-size: .85rem; font-family: var(--font-mono); }
.copy-field__feedback { font-size: .8rem; color: var(--color-success); font-weight: 600; }

/* collapsible form */
.collapsible-form { border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 1.5rem; }
.collapsible-form__title {
  background: var(--color-primary);
  color: #fff;
  padding: .85rem 1.25rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ── 10. TABLES ───────────────────────────────────────────── */
.table-scroll-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table,
.score-table,
.db-score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}

.table th,
.table td,
.score-table th,
.score-table td,
.db-score-table th,
.db-score-table td {
  padding: .6rem .9rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.table thead th,
.score-table thead th,
.db-score-table thead th {
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.table__header { /* synonym */ }

.table tbody tr:nth-child(even),
.score-table tbody tr:nth-child(even) { background: #f0f2fb; }

.table tbody tr:hover,
.score-table tbody tr:hover { background: #e3e7f5; }

.table__row--top1 td,
.score-table tbody tr:nth-child(1) td { background: #fff8e1; font-weight: 700; }
.score-table tbody tr:nth-child(2) td { background: #f3f4f9; }
.score-table tbody tr:nth-child(3) td { background: #faf8f0; }

/* 參賽紀錄是「按時間排的清單」非排名 → 取消 score-table 預設的前三列獎牌底色/粗體
   (含桌面)。獎牌色只屬於英雄榜 / 成績排名那類真正有名次的表。 */
#mp-games-table tbody tr:nth-child(1) td,
#mp-games-table tbody tr:nth-child(2) td,
#mp-games-table tbody tr:nth-child(3) td { background: transparent; font-weight: 400; }

.score-table__th--rank   { width: 50px; text-align: center; }
.score-table__th--player { min-width: 120px; }
.score-table__th--lane   { width: 70px; text-align: center; }
.score-table__th--total  { width: 80px; text-align: right; }
.score-table__th--frames { font-size: .75rem; }
.score-table__th--status { width: 90px; }
.score-table__th--actions { width: 110px; text-align: right; }

.score-table__placeholder-row td { text-align: center; color: var(--color-text-muted); padding: 2rem; }
.score-val--high { color: var(--color-accent-dark); font-weight: 800; }
.score-table__td--rank { font-family: 'Chakra Petch', var(--font-sans); font-weight: 700; text-align: center; }
.score-table__td--total { font-family: 'Chakra Petch', var(--font-sans); font-weight: 700; text-align: right; }

/* 手機卡片化:窄螢幕原本要左右滑動才看得完 → 每列轉標籤式卡片,
   每欄一行、前置 data-label 當欄名(對齊後台 .adm-table--cards)。
   套用於 #mp-games-table(會員參賽紀錄)+ #hero-board-table(英雄榜甲組冠軍榜)。
   需對應 JS render 時每個 td 帶 data-label。 */
@media (max-width: 640px) {
  #mp-games-table thead, #hero-board-table thead { display: none; }
  #mp-games-table, #mp-games-table tbody, #mp-games-table tr, #mp-games-table td,
  #hero-board-table, #hero-board-table tbody, #hero-board-table tr, #hero-board-table td { display: block; width: 100%; }
  #mp-games-table tr,
  #mp-games-table tbody tr:nth-child(1) td,
  #mp-games-table tbody tr:nth-child(2) td,
  #mp-games-table tbody tr:nth-child(3) td,
  #hero-board-table tr,
  #hero-board-table tbody tr:nth-child(1) td,
  #hero-board-table tbody tr:nth-child(2) td,
  #hero-board-table tbody tr:nth-child(3) td { background: var(--color-surface); font-weight: 400; }
  #mp-games-table tr, #hero-board-table tr {
    border: 1px solid var(--color-border); border-radius: var(--radius-md);
    margin-bottom: .6rem; padding: .35rem .7rem;
  }
  #mp-games-table td, #hero-board-table td {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    border: none; padding: .3rem 0; text-align: right; word-break: break-word; font-size: 1.05rem;
  }
  #mp-games-table td::before, #hero-board-table td::before {
    content: attr(data-label); font-weight: 700; font-size: .9rem;
    color: var(--color-text-muted); text-align: left; white-space: nowrap; flex-shrink: 0;
  }
  /* 管理欄:整列、內容靠右、不顯示「管理」標籤 */
  #mp-games-table td[data-label="管理"] { justify-content: flex-end; flex-wrap: wrap; padding-top: .4rem; }
  #mp-games-table td[data-label="管理"]::before { content: ""; }
  /* placeholder(colspan,無 data-label):置中、不拆 flex */
  #mp-games-table td[colspan], #hero-board-table td[colspan] { display: block; text-align: center; }
  #mp-games-table td[colspan]::before, #hero-board-table td[colspan]::before { content: ""; }
}

/* column helpers for score grid */
.col-rank   { width: 48px; text-align: center; font-family: 'Chakra Petch', var(--font-sans); font-weight: 700; }
.col-player { min-width: 110px; }
.col-frame  { width: 52px; text-align: center; font-family: 'Chakra Petch', var(--font-sans); }
.col-total  { width: 72px; text-align: right; font-weight: 700; font-family: 'Chakra Petch', var(--font-sans); }

.frame-cell--locked { opacity: .45; }

/* ── 11. TABS ─────────────────────────────────────────────── */
.tabs-wrap {
  position: relative;
}
.tabs-wrap::before, .tabs-wrap::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 2rem;
  pointer-events: none; z-index: 1; opacity: 0; transition: opacity 0.3s;
}
.tabs-wrap::before { left: 0; background: linear-gradient(90deg, var(--color-surface, #fff), transparent); }
.tabs-wrap::after { right: 0; background: linear-gradient(-90deg, var(--color-surface, #fff), transparent); }
.tabs-wrap--scroll-left::before { opacity: 1; }
.tabs-wrap--scroll-right::after { opacity: 1; }

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: nowrap;
  align-items: flex-end;
}
.tabs::-webkit-scrollbar { display: none; }

/* Vertical separator between tab groups */
.tabs__sep {
  flex: 0 0 1px;
  width: 1px;
  align-self: stretch;
  margin: .35rem .65rem;
  background: var(--color-border);
  opacity: .6;
}

/* Plan-locked tab — 🔒 premium gated feature */
.tabs__tab--plan-locked {
  position: relative;
  color: var(--color-text-light) !important;
  cursor: not-allowed !important;
  opacity: .65;
}
.tabs__tab--plan-locked::after {
  content: '🔒';
  position: absolute;
  top: .15rem;
  right: .25rem;
  font-size: .7rem;
  filter: grayscale(.2);
  pointer-events: none;
}
.tabs__tab--plan-locked:hover {
  color: var(--color-text-light) !important;
  background: rgba(255,160,0,.06);
}
.tabs__tab--plan-locked:hover::after {
  filter: grayscale(0);
  transform: scale(1.15);
  transition: transform .2s ease, filter .2s ease;
}
/* Give the locked tab a tooltip via title attribute set in JS, but also a
   native CSS fallback hint — subtle gold underline on hover */
.tabs__tab--plan-locked:hover {
  border-bottom-color: var(--color-accent-light);
}

.tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .7rem 1.1rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-sans);
  transition: color var(--transition), border-color var(--transition);
}
.tabs__tab:hover { color: var(--color-primary); background: rgba(26,35,126,.04); }
.tabs__tab--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
  background: rgba(255,160,0,.06);
}
.tabs__tab--disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.tabs__tab--disabled:hover { color: inherit; border-bottom-color: transparent; }
.tabs__tab-icon { width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
.tabs__badge {
  background: var(--color-accent);
  color: var(--color-primary-dark);
  font-size: .72rem;
  font-weight: 800;
  border-radius: var(--radius-full);
  padding: 0 .45rem;
  min-width: 18px;
  text-align: center;
}

.tabs__panel { display: none; padding: 1.5rem 0; }
.tabs__panel--active { display: block; }

/* ── 12. BADGES ───────────────────────────────────────────── */
.badge,
.status-badge,
.rank-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: var(--radius-full);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.badge--live,
.status-badge[data-status="active"] {
  background: rgba(56,142,60,.15);
  color: var(--color-success);
  animation: pulse-live 2s infinite;
}

.badge--locked { background: rgba(107,114,128,.15); color: var(--color-text-muted); }

.rank-badge--1 { background: #ffd700; color: #5a3a00; }
.rank-badge--2 { background: #c0c0c0; color: #2a2a2a; }
.rank-badge--3 { background: #cd7f32; color: #fff; }

@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: .6; }
}

/* ── 13. FOOTER ───────────────────────────────────────────── */
.footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,.75);
  padding: 1.4rem 1rem 1.1rem;
  margin-top: auto;
  position: relative;
}

/* 頂部裝飾漸層線 */
.footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary-light), var(--color-accent), var(--color-primary-light));
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.footer__brand { display: flex; flex-direction: column; gap: .2rem; }
.footer__brand-name {
  color: #fff;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: .02em;
}
.footer__tagline { font-size: .82rem; color: rgba(255,255,255,.5); }
.footer__nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer__link {
  color: rgba(255,255,255,.65);
  font-size: .85rem;
  transition: color var(--transition);
  position: relative;
}
.footer__link:hover { color: var(--color-accent); text-decoration: none; }
.footer__link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 1px;
  background: var(--color-accent);
  transform: scaleX(0);
  transition: transform .25s ease;
}
.footer__link:hover::after { transform: scaleX(1); }
.footer__copy {
  font-size: .8rem;
  width: 100%;
  text-align: center;
  color: rgba(255,255,255,.35);
  padding-top: 1.25rem;
  margin-top: .5rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.footer__contact {
  width: 100%;
  text-align: center;
  font-size: .85rem;
  color: rgba(255,255,255,.55);
  margin-top: .5rem;
}
.footer__contact a {
  color: var(--color-accent-light);
  text-decoration: none;
  border-bottom: 1px dashed rgba(255,215,64,.4);
  transition: color .15s, border-color .15s;
}
.footer__contact a:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  text-decoration: none;
}

/* ── 14. AUTH CARDS ───────────────────────────────────────── */
#auth-section { max-width: 480px; margin: 3rem auto; padding: 0 1rem; }

.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
}
/* Bowling-lane pinstripe hint on card body */
.auth-card::before {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary) 25%, var(--color-accent) 25%, var(--color-accent) 50%, var(--color-primary) 50%, var(--color-primary) 75%, var(--color-accent) 75%, var(--color-accent) 100%);
  opacity: .85;
}

.auth-card--wide { max-width: 640px; margin-inline: auto; }
.auth-card__header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  padding: 2rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
/* 登入區背景紋理 — 對角光 + 散點紋理 */
.auth-card__header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle 2px at 10% 20%, rgba(255,255,255,.15), transparent 3px),
    radial-gradient(circle 2px at 80% 35%, rgba(255,255,255,.12), transparent 3px),
    radial-gradient(circle 2px at 30% 70%, rgba(255,255,255,.18), transparent 3px),
    radial-gradient(circle 2px at 65% 85%, rgba(255,255,255,.1), transparent 3px),
    radial-gradient(circle 2px at 90% 60%, rgba(255,255,255,.14), transparent 3px),
    radial-gradient(ellipse 50% 60% at 20% 80%, rgba(255,160,0,.14) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 20%, rgba(255,215,64,.12) 0%, transparent 70%);
  pointer-events: none;
}
/* Diagonal golden accent stripe — sports feeling */
.auth-card__header::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -15%;
  width: 40%;
  height: 180%;
  background: linear-gradient(90deg, transparent, rgba(255,215,64,.18), transparent);
  transform: rotate(22deg);
  pointer-events: none;
}
.auth-card__header > * { position: relative; z-index: 1; }
.auth-card__icon { width: 2.5rem; height: 2.5rem; margin-bottom: .5rem; }
.auth-card__title {
  font-family: 'Chakra Petch', var(--font-sans);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .03em;
}
.auth-card__subtitle { font-size: .9rem; color: rgba(255,255,255,.75); margin-top: .25rem; }
.auth-card__brand {
  font-family: 'Chakra Petch', var(--font-sans);
  font-size: .85rem;
  font-weight: 700;
  color: rgba(255,255,255,.45);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: .75rem;
}

.auth-form {
  padding: 1.5rem;
}

.auth-form--inline { display: flex; gap: .75rem; align-items: flex-end; }
.auth-form--inline .form-field { flex: 1; margin-bottom: 0; }

.form--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem 1rem;
}

.auth-divider {
  text-align: center;
  position: relative;
  color: var(--color-text-muted);
  font-size: .82rem;
  margin: .5rem 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--color-border);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

.auth-key-login { background: var(--color-bg); border-radius: var(--radius-md); padding: 1rem; margin: .5rem 0; }
.auth-key-login__desc { font-size: .88rem; margin-bottom: .5rem; }
.auth-key-login__hint { font-size: .78rem; color: var(--color-text-muted); margin-top: .4rem; }

/* ── 15. SEARCH BAR ───────────────────────────────────────── */
.search-bar { position: relative; display: flex; align-items: center; }
.search-bar__input-wrap { position: relative; flex: 1; }
.search-bar__icon {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: var(--color-text-muted);
  pointer-events: none;
}
.search-bar__input {
  width: 100%;
  padding: .6rem .85rem .6rem 2.25rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: .92rem;
  background: var(--color-surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-bar__input:focus {
  outline: none;
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(57,73,171,.18);
}

/* ── 16. TOOLBAR ──────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.toolbar--filter { justify-content: space-between; }
.toolbar--player-actions { justify-content: flex-end; }

/* sort select */
.sort-select, select.sort-select {
  padding: .5rem .8rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: .88rem;
  color: var(--color-text);
  cursor: pointer;
}

.sort-label { font-size: .88rem; color: var(--color-text-muted); }
.sort-icon { font-size: .85rem; }

/* ── 17. TRACKER PAGE ─────────────────────────────────────── */
.tracker-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff;
  position: sticky;
  top: var(--nav-h);
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  border-bottom: 2px solid var(--color-accent);
}

.tracker-header__inner { display: flex; align-items: center; gap: 1rem; padding-block: .75rem; flex-wrap: wrap; }
.tracker-header__meta { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.tracker-title { font-size: 1.2rem; font-weight: 700; }
.tracker-back-btn { color: rgba(255,255,255,.80); font-size: .9rem; text-decoration: none; }
.tracker-back-btn:hover { color: #fff; text-decoration: underline; }

/* LIVE 膠囊 badge */
.tracker-live-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .15rem .55rem;
  border-radius: var(--radius-full);
  background: rgba(255,160,0,.2);
  border: 1px solid rgba(255,160,0,.4);
  font-size: .72rem;
  font-weight: 700;
  color: var(--color-accent-light);
  letter-spacing: .06em;
  animation: live-glow 2s ease-in-out infinite;
}
.tracker-live-badge__dot {
  width: 7px; height: 7px;
  background: var(--color-accent);
  border-radius: 50%;
  animation: pulse-live 1.5s infinite;
}
@keyframes live-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,160,0,.2); }
  50%      { box-shadow: 0 0 8px 2px rgba(255,160,0,.15); }
}

/* 保留舊 class 相容 JS 顯示/隱藏 */
.tracker-live-dot { display: none; }
.tracker-live-label { display: none; }

.tracker-info-bar {
  background: var(--color-primary-dark);
  padding: .5rem 1rem;
}

.tracker-info-bar .container { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.tracker-info-bar__item { display: flex; align-items: center; gap: .4rem; }
.tracker-info-bar__icon { color: var(--color-accent); font-size: .9rem; }
.tracker-info-bar__label { font-size: .78rem; color: var(--color-text-muted); }
.tracker-info-bar__value { font-size: .88rem; color: var(--color-bg); font-weight: 600; }

.tracker-status-wrap { display: inline-flex; align-items: center; }
.tracker-body { padding: 1.5rem 1rem 3rem; }

.tracker-scores { }
.tracker-scores__title { font-size: 1.1rem; font-weight: 700; color: var(--color-primary); margin-bottom: .75rem; }
.tracker-scores__controls, .tracker-scores__toolbar { margin-bottom: 1rem; }

.tracker-ranking { margin-top: 2rem; }
.tracker-ranking__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.tracker-ranking__title { font-size: 1.05rem; font-weight: 700; color: var(--color-primary); }
.tracker-ranking__count { font-size: .85rem; color: var(--color-text-muted); }

.tracker-last-updated { font-size: .78rem; color: var(--color-text-muted); margin-top: .5rem; }

.ranking-list { display: flex; flex-direction: column; gap: .5rem; }
.ranking-list__placeholder { color: var(--color-text-muted); font-size: .9rem; text-align: center; padding: 1.5rem; }

/* ── 18. SCORER PAGE ──────────────────────────────────────── */
.scorer-header {
  background: var(--color-primary);
  color: #fff;
  padding: .75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.20);
}

.scorer-header__inner { display: flex; align-items: center; gap: 1rem; }
.scorer-header__title { font-size: 1.15rem; font-weight: 700; }
.scorer-header__meta { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-left: auto; }

.scorer-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: rgba(255,255,255,.12);
  border-radius: var(--radius-full);
  padding: .2rem .65rem;
  font-size: .78rem;
  color: rgba(255,255,255,.90);
}
.scorer-meta-chip--lock { background: rgba(255,160,0,.20); color: var(--color-accent-light); }

.scorer-body { padding: 1rem; max-width: 900px; margin: 0 auto; }

/* large touch-friendly score inputs */
.score-input {
  width: 100%;
  min-width: 50px;
  padding: .6rem .4rem;
  font-family: 'Chakra Petch', var(--font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
  touch-action: manipulation;
}

.score-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255,160,0,.25);
}

.score-input--locked {
  background: #f0f0f0;
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: .6;
}

.score-input-cell__spinner {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary-light);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}

.score-table__placeholder { padding: 2rem; text-align: center; color: var(--color-text-muted); }

.scorer-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  gap: 1rem;
}
.scorer-state__icon { font-size: 3rem; }
.scorer-state__title { font-size: 1.2rem; font-weight: 700; color: var(--color-primary); }
.scorer-state__desc { color: var(--color-text-muted); font-size: .95rem; max-width: 360px; }

.scorer-key-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.25rem; max-width: 480px; margin: 1.5rem auto; }

.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: .75rem; padding: 1rem; }
.qr-wrap__canvas { border: 3px solid var(--color-border); border-radius: var(--radius-md); }
.qr-wrap__icon { width: 3rem; height: 3rem; color: var(--color-text-muted); }
.qr-wrap__placeholder { font-size: .85rem; color: var(--color-text-muted); }

/* lane group */
.lane-group {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

/* ── 19. DASHBOARD (TV / FULL-SCREEN) ─────────────────────── */
body.db-page,
.db-layout {
  background: var(--db-bg);
  color: var(--db-text);
  font-family: var(--font-sans);
}

body.db-page { overflow: hidden; }

.db-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* top bar */
.db-topbar {
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  height: 56px;
  background: var(--db-surface);
  border-bottom: 1px solid var(--db-border);
  flex-shrink: 0;
  gap: 1rem;
}

.db-topbar__left  { display: flex; align-items: center; gap: .75rem; }
.db-topbar__center { flex: 1; text-align: center; }
.db-topbar__right { display: flex; align-items: center; gap: .75rem; margin-left: auto; }

.db-topbar__game-name { font-size: 1.1rem; font-weight: 700; color: var(--db-text); }

.db-topbar__status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--color-success);
  animation: pulse-live 1.5s infinite;
}
.db-topbar__status-dot--offline { background: var(--color-danger); animation: none; }

.db-clock {
  font-size: 1rem;
  font-weight: 600;
  color: var(--db-text-muted);
  font-variant-numeric: tabular-nums;
}

/* slides */
.db-slides {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.db-slide-area {
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--db-border) transparent;
  padding: 1rem 1.5rem;
}

.db-scoreboard {
  width: 100%;
}

.db-scoreboard__heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: .75rem;
}

.db-scoreboard__lane-label { font-size: 1rem; font-weight: 700; color: var(--color-accent); }
.db-scoreboard__lane-badge {
  background: var(--color-accent);
  color: var(--color-primary-dark);
  border-radius: var(--radius-sm);
  padding: .15rem .5rem;
  font-size: .82rem;
  font-weight: 800;
}

.db-score-table-wrap { overflow-x: auto; }

.db-score-table {
  background: var(--db-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.db-score-table thead th {
  background: var(--color-primary);
  color: #fff;
  padding: .5rem .75rem;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.db-score-table tbody tr { border-bottom: 1px solid var(--db-border); }
.db-score-table tbody td { padding: .55rem .75rem; color: var(--db-text); font-size: .9rem; }
.db-score-table tbody tr:nth-child(even) td { background: rgba(255,255,255,.03); }
/* first-child highlight disabled for full scoreboard */

/* slide indicator */
.db-slide-indicator {
  display: flex;
  justify-content: center;
  gap: .4rem;
  padding: .4rem 0;
  flex-shrink: 0;
}

.db-slide-label {
  text-align: center;
  font-size: .8rem;
  color: var(--db-text-muted);
  padding: .2rem 0;
  flex-shrink: 0;
}

/* marquee bar */
.db-marquee-bar {
  flex-shrink: 0;
  background: var(--color-primary);
  border-top: 2px solid var(--color-accent);
  height: 38px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.db-marquee-bar__track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: marquee 30s linear infinite;
  gap: 0;
}

.db-marquee-item {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: 0 2.5rem;
  font-size: .88rem;
  color: rgba(255,255,255,.90);
  border-right: 1px solid rgba(255,255,255,.15);
}

.db-marquee-item strong { color: var(--color-accent-light); }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* pairing overlay */
.db-pairing {
  position: absolute;
  inset: 0;
  background: rgba(10,12,26,.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.db-pairing__card {
  background: var(--db-surface-2);
  border: 1px solid var(--db-border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  max-width: 480px;
  width: 90%;
  text-align: center;
}

.db-pairing__logo { font-size: 3rem; margin-bottom: 1rem; }
.db-pairing__headline { font-size: 1.4rem; font-weight: 800; color: #fff; margin-bottom: .4rem; }
.db-pairing__subline { color: var(--db-text-muted); margin-bottom: 1.5rem; font-size: .95rem; }

.db-pairing__codes { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }

.db-code-block {
  background: var(--db-bg);
  border: 1px solid var(--db-border);
  border-radius: var(--radius-md);
  padding: .75rem 1.25rem;
  min-width: 140px;
}
.db-code-block__label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--db-text-muted); margin-bottom: .3rem; }
.db-code-block__value { font-size: 1.6rem; font-weight: 800; color: var(--color-accent); font-variant-numeric: tabular-nums; }
.db-code-block__value--pin { color: #fff; }
.db-code-divider { color: var(--db-text-muted); align-self: center; }

.db-pairing__progress { width: 100%; height: 4px; background: var(--db-border); border-radius: 2px; overflow: hidden; margin-top: .75rem; }
.db-pairing__progress::after {
  content: '';
  display: block;
  height: 100%;
  background: var(--color-accent);
  animation: progress-bar 20s linear infinite;
}
@keyframes progress-bar { from { width: 0; } to { width: 100%; } }

.db-pairing__hint { font-size: .8rem; color: var(--db-text-muted); margin-top: .75rem; }

.db-pairing__spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--db-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: .75rem auto 0;
}

/* reconnect overlay */
.db-reconnect-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.8);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: #fff;
}
.db-reconnect-overlay__spinner {
  width: 40px; height: 40px;
  border: 4px solid rgba(255,255,255,.2);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
.db-reconnect-overlay__text { font-size: 1.1rem; color: rgba(255,255,255,.80); }

/* dashboard admin panel tabs */
.dashboard-panel__title { font-size: 1rem; font-weight: 700; color: var(--color-primary); margin-bottom: .75rem; }
.dashboard-panel__toolbar { display: flex; gap: .75rem; margin-bottom: 1rem; align-items: center; flex-wrap: wrap; }

/* 操作分區卡片 — 用於獎項管理等密集操作區 */
.panel-section {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  overflow: hidden;
}
.panel-section__title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .75rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--color-border);
}

/* ── 20. WS STATUS BAR ────────────────────────────────────── */
.ws-status-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .75rem;
  background: rgba(0,0,0,.06);
  border-radius: var(--radius-full);
  font-size: .78rem;
  color: var(--color-text-muted);
}

.ws-status { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; }
.ws-status__dot, .ws-status-bar__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-success); }
.ws-status__dot--connecting, .ws-status-bar__dot--connecting { background: var(--color-warning); animation: pulse-live 1s infinite; }
.ws-status__text { color: var(--color-text-muted); }

/* ── 21. QR MODAL ─────────────────────────────────────────── */
.qr-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  align-items: center;
  justify-content: center;
}

.qr-modal.is-open { display: flex; }

.qr-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.60);
  cursor: pointer;
}

.qr-modal > div:not(.qr-modal-backdrop) {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  max-width: 360px;
  width: 90%;
  text-align: center;
  z-index: 1;
}

.qr-modal__title { font-size: 1.15rem; font-weight: 700; color: var(--color-primary); margin-bottom: .25rem; }
.qr-modal__subtitle { font-size: .85rem; color: var(--color-text-muted); margin-bottom: 1.25rem; }
.qr-modal__canvas-wrap { display: flex; justify-content: center; margin-bottom: 1rem; }
.qr-modal__url { font-size: .78rem; color: var(--color-text-muted); word-break: break-all; margin-bottom: 1rem; }
.qr-modal__close {
  position: absolute;
  top: .75rem; right: .75rem;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: .25rem;
  line-height: 1;
  border-radius: var(--radius-sm);
}
.qr-modal__close:hover { background: var(--color-border); color: var(--color-text); }

/* QR FAB */
.qr-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
}

#qr-fab-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-primary-dark);
  border: none;
  font-size: 1.35rem;
  cursor: pointer;
  box-shadow: var(--shadow-accent), var(--shadow-md);
  transition: transform var(--transition), background var(--transition);
  display: flex; align-items: center; justify-content: center;
}
#qr-fab-btn:hover { transform: scale(1.08); background: var(--color-accent-dark); }

/* ── 22. TOAST / NOTIFICATIONS ────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}

.toast {
  background: var(--color-primary-dark);
  color: #fff;
  padding: .7rem 1.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: .9rem;
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: .6rem;
  animation: toast-in .25s ease;
  min-width: 220px;
  max-width: 420px;
}

.toast--success { border-left: 4px solid var(--color-success); }
.toast--error   { border-left: 4px solid var(--color-danger); }
.toast--warning { border-left: 4px solid var(--color-warning); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 23. LOADING SPINNER ──────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 32px; height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary-light);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

.spinner--sm { width: 18px; height: 18px; border-width: 2px; }
.spinner--lg { width: 52px; height: 52px; border-width: 4px; }

#state-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 1rem;
  color: var(--color-text-muted);
}

#state-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: .75rem;
  color: var(--color-danger);
  text-align: center;
}

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

/* ── 24. FEATURES GRID (index.html) ───────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature-item {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.25rem;
  text-align: center;
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
  overflow: hidden;
}
/* Subtle top accent ribbon per item */
.feature-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  opacity: 0;
  transition: opacity .25s ease;
}
.feature-item:hover::before { opacity: 1; }

.feature-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--color-primary-light);
}

/* Filled icon tile — each feature gets a distinct accent */
.feature-item__icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto .9rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #fff;
  box-shadow: 0 6px 18px rgba(26,35,126,.22);
  transition: background .3s ease, box-shadow .3s ease, transform .3s ease;
}
.feature-item:hover .feature-item__icon {
  background: linear-gradient(135deg, var(--color-accent-dark), var(--color-accent));
  box-shadow: 0 8px 24px rgba(255,160,0,.35);
  transform: rotate(-5deg) scale(1.05);
}
/* Different color tints per item — nth-child gives each a character */
.feature-item:nth-child(1) .feature-item__icon { background: linear-gradient(135deg, #0288d1, #4fc3f7); box-shadow: 0 6px 18px rgba(2,136,209,.28); }
.feature-item:nth-child(2) .feature-item__icon { background: linear-gradient(135deg, #7b1fa2, #ba68c8); box-shadow: 0 6px 18px rgba(123,31,162,.28); }
.feature-item:nth-child(3) .feature-item__icon { background: linear-gradient(135deg, #388e3c, #81c784); box-shadow: 0 6px 18px rgba(56,142,60,.28); }
.feature-item:nth-child(4) .feature-item__icon { background: linear-gradient(135deg, #e53935, #ff7043); box-shadow: 0 6px 18px rgba(229,57,53,.28); }

.feature-item__icon svg { color: #fff; transition: transform .3s ease; }
.feature-item:hover .feature-item__icon svg { transform: scale(1.1); }
/* ── Index page nav cards ──────────────────────────────────── */
.nav-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--color-border);
  padding: 1.75rem 1.5rem;
  cursor: pointer;
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}
.nav-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-5px);
  border-color: var(--color-accent);
}
.nav-card:hover .nav-card__icon-wrap {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  box-shadow: 0 4px 16px rgba(255,160,0,.25);
}
.nav-card:hover .nav-card__cta { color: var(--color-accent-dark); }
.nav-card__icon-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 96px; height: 96px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  border-radius: var(--radius-xl);
  color: #fff;
  transition: background .3s ease, box-shadow .3s ease;
}
.nav-card__icon { width: 52px; height: 52px; }
.nav-card__body { flex: 1; }
.nav-card__title { font-size: 1.15rem; font-weight: 700; margin-bottom: .5rem; color: var(--color-text); }
.nav-card__desc { font-size: .88rem; color: var(--color-text-muted); line-height: 1.5; margin-bottom: .75rem; }
.nav-card__features { list-style: none; padding: 0; margin: 0; font-size: .82rem; color: var(--color-text-muted); }
.nav-card__features li::before { content: '✓ '; color: var(--color-success); font-weight: 700; }
.nav-card__features li { margin-bottom: .25rem; }
.nav-card__footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--color-border); }
.nav-card__cta {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .9rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: .02em;
  transition: color .25s ease, gap .25s ease;
}
.nav-card:hover .nav-card__cta {
  color: var(--color-accent-dark);
  gap: .55rem;
}

/* Gold shimmer that sweeps across the card on hover — sports-reel vibe */
.nav-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, transparent 30%, rgba(255,215,64,.18) 50%, transparent 70%);
  transform: translateX(-100%);
  pointer-events: none;
  transition: transform .65s ease;
}
.nav-card:hover::after { transform: translateX(100%); }
.nav-card { overflow: hidden; }

.feature-item__icon svg { width: 32px; height: 32px; }

@media (max-width: 640px) {
  .nav-card__icon-wrap { width: 80px; height: 80px; }
  .nav-card__icon { width: 44px; height: 44px; }
  .feature-item__icon { width: 56px; height: 56px; }
  .feature-item__icon svg { width: 28px; height: 28px; }
  .tabs__tab { padding: .55rem .8rem; font-size: .85rem; }
}
.feature-item__title { font-size: 1rem; font-weight: 700; color: var(--color-primary); margin-bottom: .4rem; letter-spacing: .01em; }
.feature-item__desc { font-size: .88rem; color: var(--color-text-muted); line-height: 1.55; }

/* ── Index page entrance animations ──────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.hero__badge   { animation: fadeIn .6s ease both; }
.hero__logo { animation: fadeInUp .7s ease .15s both; }
.hero__subtitle { animation: fadeInUp .7s ease .3s both; }
.hero__stats   { animation: fadeInUp .7s ease .45s both; }

.section--cards .section__title,
.section--cards .section__subtitle { animation: fadeInUp .6s ease .5s both; }

.nav-card:nth-child(1) { animation: fadeInUp .5s ease .6s both; }
.nav-card:nth-child(2) { animation: fadeInUp .5s ease .75s both; }
.nav-card:nth-child(3) { animation: fadeInUp .5s ease .9s both; }

.feature-item:nth-child(1) { animation: fadeInUp .5s ease .7s both; }
.feature-item:nth-child(2) { animation: fadeInUp .5s ease .82s both; }
.feature-item:nth-child(3) { animation: fadeInUp .5s ease .94s both; }
.feature-item:nth-child(4) { animation: fadeInUp .5s ease 1.06s both; }

/* 用戶偏好 reduced motion 時停用動畫 */
@media (prefers-reduced-motion: reduce) {
  .hero__badge, .hero__logo, .hero__subtitle, .hero__stats,
  .section--cards .section__title, .section--cards .section__subtitle,
  .nav-card, .feature-item {
    animation: none !important;
  }
}

/* hero scoreboard */
#hero-board-table { margin-top: 0.4rem; }
#hero-board-title { color: rgba(255,255,255,.85); font-size: 1rem; margin-bottom: .5rem; }

/* stats chips */
#stat-games, #stat-players, #stat-lanes {
  display: inline-block;
  padding: .2rem .65rem;
  background: rgba(255,255,255,.10);
  border-radius: var(--radius-full);
  font-weight: 700;
}

/* ── 25. MEMBER GRID ──────────────────────────────────────── */
#member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.member-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.member-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border-color: var(--color-primary-light);
  text-decoration: none;
}
.member-card__avatar {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.member-card__initial {
  width: 48px; height: 48px; border-radius: 50%; background: var(--color-border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 1.2rem; flex-shrink: 0;
}
.member-card__body { flex: 1; min-width: 0; }
.member-card__name { font-weight: 600; }
.member-card__bio { font-size: .8rem; color: var(--color-text-muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-card__badges {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-top: .35rem;
  flex-wrap: wrap;
}
.member-card__badge {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08);
  transition: transform .15s;
}
.member-card:hover .member-card__badge { transform: scale(1.1); }
.member-card__badges-more {
  font-size: .72rem;
  color: var(--color-text-muted);
  margin-left: .15rem;
}

/* ── 26. PROFILE ──────────────────────────────────────────── */
.profile-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  text-align: center;
}

.profile-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 3px solid var(--color-primary-light);
  object-fit: cover;
}

/* ── MEMBER PROFILE CARD ─────────────────────────────────── */
.member-profile {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: .75rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.member-profile__header {
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem;
  align-items: center;
  background: linear-gradient(135deg, rgba(26,35,126,.03) 0%, rgba(57,73,171,.06) 100%);
}
.member-profile__avatar-wrap { position: relative; flex-shrink: 0; }
.member-profile__info { flex: 1; min-width: 0; }
.member-profile__name { font-size: 1.25rem; font-weight: 700; margin: 0 0 .25rem; }
.member-profile__bio { color: var(--color-text-muted); font-size: .9rem; margin: 0 0 .5rem; }
.member-profile__social { display: flex; gap: .5rem; flex-wrap: wrap; }
.member-profile__social a {
  color: var(--color-text-muted); font-size: .8rem; text-decoration: none;
  padding: .15rem .5rem; border: 1px solid var(--color-border); border-radius: .25rem;
  transition: color var(--transition), border-color var(--transition);
}
.member-profile__social a:hover { color: var(--color-primary); border-color: var(--color-primary); }
/* v0.57.x — Action cluster (Follow + Share) wrapper.
   兩個 button 包在 actions 裡共享對齊,避免一個 align-self: flex-start
   一個沒設導致高度不一致。Self-view 兩個都隱藏走 JS,visitor 只看到應該看到的。 */
.member-profile__actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
  margin-left: auto;
  align-self: center;
}
.member-profile__follow,
.member-profile__share {
  flex-shrink: 0;
  white-space: nowrap;
}
.member-profile__stats {
  display: flex;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.member-profile__stat {
  flex: 1;
  text-align: center;
  padding: .75rem .5rem;
}
.member-profile__stat + .member-profile__stat { border-left: 1px solid var(--color-border); }
.member-profile__stat-value { display: block; font-family: 'Chakra Petch', var(--font-sans); font-size: 1.1rem; font-weight: 700; color: var(--color-primary); }
.member-profile__stat-label { display: block; font-size: .75rem; color: var(--color-text-light); margin-top: .15rem; }
.member-profile .tabs { padding: 0 1.5rem; }
.member-profile .tabs__panel { padding: 1rem 1.5rem; }

/* ── Per-plan breakdown (Event / Team / Friend) ── */
.mp-plan-breakdown {
  padding: .75rem 1.5rem 1rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.mp-plan-row {
  display: grid;
  grid-template-columns: minmax(7.5rem, 1.4fr) repeat(3, 1fr);
  align-items: center;
  gap: .5rem;
  padding: .45rem .6rem;
  border-radius: .5rem;
  font-size: .85rem;
  background: rgba(0,0,0,.015);
  border-left: 3px solid transparent;
}
.mp-plan-row--event    { border-left-color: #dc2626; background: linear-gradient(90deg, rgba(220,38,38,.08), transparent 60%); }
.mp-plan-row--team     { border-left-color: #2563eb; background: linear-gradient(90deg, rgba(37,99,235,.08), transparent 60%); }
.mp-plan-row--friend   { border-left-color: #059669; background: linear-gradient(90deg, rgba(5,150,105,.08), transparent 60%); }
.mp-plan-row--empty { opacity: .45; }
.mp-plan-row__label {
  font-weight: 600;
  color: var(--color-text, #1f2937);
  display: flex;
  align-items: center;
  gap: .4rem;
}
.mp-plan-row__icon { font-size: 1rem; }
.mp-plan-row__metric {
  color: var(--color-text-muted);
  font-size: .82rem;
  text-align: center;
}
.mp-plan-row__num {
  font-family: 'Chakra Petch', var(--font-sans);
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1rem;
  margin: 0 .1rem;
}

@media (max-width: 480px) {
  .member-profile__header { flex-direction: column; text-align: center; }
  .member-profile__social { justify-content: center; }
  .member-profile__actions { margin-left: 0; align-self: center; }
  .member-profile__stat-value { font-size: .95rem; }
  .mp-plan-breakdown { padding: .6rem 1rem .8rem; }
  .mp-plan-row { grid-template-columns: minmax(6rem, 1.2fr) repeat(3, 1fr); padding: .4rem .5rem; font-size: .78rem; gap: .3rem; }
  .mp-plan-row__num { font-size: .88rem; }
  .mp-plan-row__metric { font-size: .72rem; }
}

/* ── 27. PAGINATION ───────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: .5rem;
  justify-content: center;
  margin-top: 1.5rem;
}

/* ── 28. PODIUM ───────────────────────────────────────────── */
#podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1rem;
  padding: 1.5rem 0 0;
}

/* ── 29. RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 768px) {
  html { font-size: 18px; }
  :root { --nav-h: 56px; }

  .container { padding-inline: 0.15rem; }

  .navbar nav { display: none; }
  .navbar__toggle { display: flex; margin-left: auto; }
  .navbar .container { flex-wrap: wrap; }

  .hero { padding: 2.5rem 1rem 2rem; }

  .card-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr 1fr; }

  .form--grid { grid-template-columns: 1fr; }
  .auth-form--inline { flex-direction: column; }

  .toolbar--filter { flex-direction: column; align-items: stretch; }

  .db-topbar { padding: 0 .75rem; }
  .db-slide-area { padding: .5rem .75rem; }
  .db-pairing__card { padding: 1.5rem 1rem; }
  .db-pairing__codes { gap: .75rem; }

  .score-input { font-size: 1rem; padding: .5rem .3rem; }

  .footer__inner { flex-direction: column; text-align: center; gap: .5rem; }
  .footer__nav { justify-content: center; }

  /* 40+ 用戶友善：過小文字拉到可讀最低值 */
  .btn--sm { font-size: .88rem; }
  .form-field__hint,
  .form-field__toggle-desc,
  .copy-field__feedback { font-size: .85rem; }
  .auth-key-login__hint { font-size: .85rem; }

  /* 按鈕/輸入框最小觸控區域 44px */
  .btn, .form-field__input, .form-field__select { min-height: 2.75rem; }
}

@media (max-width: 480px) {
  .features-grid { grid-template-columns: 1fr; }
  .tabs__tab { padding: .6rem .85rem; font-size: .85rem; }
  .btn--lg { padding: .7rem 1.25rem; font-size: 1rem; }
}

@media (min-width: 1200px) {
  .scorer-body { padding: 1.5rem 2rem; }
  .db-slide-area { padding: 1.25rem 2rem; }
}

/* ── Active game banner ───────────────────────────────────── */
.game-banner {
  display: flex; flex-direction: column; gap: 0.5rem;
  background: linear-gradient(135deg, rgba(255,160,0,0.08), rgba(255,160,0,0.18));
  border: 1px solid rgba(255,160,0,0.3);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.game-banner__title {
  display: flex; align-items: center; gap: 0.4rem;
  margin-bottom: 0.2rem;
}
.game-banner__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-accent); flex-shrink: 0;
}
.game-banner__dot--live {
  background: #16a34a;
  animation: banner-pulse 1.5s ease-in-out infinite;
}
@keyframes banner-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(22,163,74,0.5); }
  50% { opacity: .7; box-shadow: 0 0 0 4px rgba(22,163,74,0); }
}
.game-banner__label {
  font-size: 0.8rem; font-weight: 700; color: #92400e;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.game-banner__label--reconnecting {
  color: #b45309;
  animation: banner-label-blink 1.4s ease-in-out infinite;
}
@keyframes banner-label-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}
.game-banner__name {
  font-size: 1.05rem; font-weight: 700; color: var(--color-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.game-banner__details {
  font-size: 0.85rem; color: var(--color-text-muted);
}
.game-banner__actions {
  display: flex; gap: 0.4rem; flex-shrink: 0; flex-wrap: wrap;
}
.game-banner__stats {
  display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem;
}
.game-banner__chip {
  display: inline-flex; align-items: center; gap: .2rem;
  font-size: .72rem; font-weight: 600; padding: .12rem .4rem;
  border-radius: var(--radius-full); background: rgba(26,35,126,.08); color: var(--color-primary);
}
.game-banner__chip--bonus { background: #fef3c7; color: #92400e; }
.game-banner__chip--jp0 { background: rgba(56,189,248,.15); color: #0ea5e9; }
.game-banner__chip--jp1 { background: rgba(52,211,153,.15); color: #10b981; }
.game-banner__chip--jp2 { background: rgba(251,146,60,.15); color: #ea580c; }
.game-banner__chip--jp3 { background: rgba(167,139,250,.15); color: #7c3aed; }
.game-banner__chip--jp4 { background: rgba(251,113,133,.15); color: #e11d48; }
.game-banner__chip--jp5 { background: rgba(250,204,21,.15); color: #ca8a04; }
.game-banner__chip--jp6 { background: rgba(45,212,191,.15); color: #0d9488; }
.game-banner__chip--jp7 { background: rgba(244,114,182,.15); color: #db2777; }
.game-banner__chip--jp8 { background: rgba(129,140,248,.15); color: #4f46e5; }
.game-banner__chip--jp9 { background: rgba(163,230,53,.15); color: #65a30d; }

/* ── Award mode buttons ──────────────────────────────────── */
.award-mode-btn--active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ── Dashboard title (單色 — 三 mode 標題視覺一致) ─────────── */
.dashboard-title-gradient {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  margin: 0 0 0.5rem;
  color: var(--color-primary);
}

/* ── Game filter tabs ──────────────────────────────────────── */
.game-filter-tabs { display: flex; gap: 0; margin-bottom: 1rem; border-bottom: 2px solid #e2e8f0; }
.game-filter-tab {
  padding: 0.5rem 1.2rem; border: none; background: none; cursor: pointer;
  font-size: 0.9rem; color: #64748b; border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}
.game-filter-tab:hover { color: #1a237e; }
.game-filter-tab--active { color: #1a237e; border-bottom-color: #ffa000; font-weight: 600; }

/* ── Game list: active row highlight ───────────────────────── */
.game-row--active {
  background: linear-gradient(90deg, rgba(255,160,0,0.15) 0%, rgba(255,160,0,0.04) 100%);
  border-left: 5px solid #ffa000;
  box-shadow: 0 2px 8px rgba(255,160,0,0.12);
  border-radius: 0 0.5rem 0.5rem 0;
  position: relative;
}
.game-row--active td:first-child { padding-left: 0.75rem; }
.game-active-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #b45309;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(255,160,0,0.18);
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  margin-bottom: 0.2rem;
  animation: pulse-indicator 1.5s ease-in-out infinite;
}
.game-active-indicator::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #f59e0b;
  border-radius: 50%;
  animation: blink-dot 1s ease-in-out infinite;
}
@keyframes pulse-indicator {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
@keyframes blink-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.6); }
}

/* ── Game list: responsive cells ───────────────────────────── */
.game-cell-main { font-weight: 600; }
.game-cell-sub { font-size: 0.8em; color: #64748b; margin-top: 2px; }
.game-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }

@media (max-width: 640px) {
  .td-hide-mobile { display: none; }
  .game-actions { flex-direction: column; }
  .game-actions .btn { width: 100%; text-align: center; }
}

/* ── Lane Manager ─────────────────────────────────────────── */
.lm-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.lm-total { color: #64748b; font-size: 0.9rem; margin-left: auto; }
.lm-empty { color: #94a3b8; text-align: center; padding: 2rem; }

/* Lock bar */
.lm-lock-bar {
  display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
  padding: 0.6rem 0.8rem; margin-bottom: 1rem;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 0.5rem;
}
.lm-lock-bar__label { font-size: 0.85rem; font-weight: 600; color: #92400e; margin-right: 0.3rem; }
.lm-lock-btn {
  padding: 0.3rem 0.6rem; font-size: 0.8rem; border: 1px solid #cbd5e1;
  border-radius: 0.3rem; background: #fff; cursor: pointer;
  transition: all 0.15s;
}
.lm-lock-btn:hover { background: #f1f5f9; }
.lm-lock-btn--locked {
  background: #fef3c7; border-color: #f59e0b; color: #92400e; font-weight: 600;
}

.lm-lane {
  border: 1px solid #e2e8f0; border-radius: 0.5rem; margin-bottom: 1rem;
  overflow: hidden; background: #fff;
}
.lm-lane-header {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.75rem; background: #f1f5f9; border-bottom: 1px solid #e2e8f0;
  font-weight: 600; cursor: pointer; user-select: none;
  transition: background 0.15s;
}
.lm-lane-header:hover { background: #e2e8f0; }
.lm-lane-arrow {
  font-size: 0.7rem; color: #64748b; width: 1rem; text-align: center; flex-shrink: 0;
  transition: transform 0.2s;
}
.lm-lane-title { font-size: 0.95rem; color: #1a237e; }
.lm-lane-count { font-size: 0.8rem; color: #64748b; margin-left: auto; }
.lm-del-lane-btn { font-size: 0.7rem; padding: 0.15rem 0.35rem; line-height: 1; min-height: 0; }

.lm-players { padding: 0.5rem; }

.lm-player {
  display: flex; flex-direction: column; gap: 0.3rem;
  padding: 0.5rem; border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}
.lm-player:last-child { border-bottom: none; }
.lm-player:hover { background: #f8fafc; }
.lm-player--withdrawn { opacity: 0.45; }

.lm-player-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.lm-player-info {
  display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; flex: 1; min-width: 0;
}
.lm-player-idx {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: #e2e8f0; font-size: 0.75rem; font-weight: 700; color: #475569;
  flex-shrink: 0;
}
.lm-player-name { font-weight: 600; font-size: 0.95rem; }
.lm-player-tag {
  font-size: 0.7rem; padding: 0.1rem 0.35rem; border-radius: 0.2rem;
  background: #e2e8f0; color: #475569;
}
.lm-player-tag--bonus { background: #fef3c7; color: #92400e; }
.lm-player-tag--note { background: #e5e7eb; color: #374151; }
.lm-player-tag--jp0 { background: rgba(56,189,248,.2); color: #0ea5e9; }
.lm-player-tag--jp1 { background: rgba(52,211,153,.2); color: #10b981; }
.lm-player-tag--jp2 { background: rgba(251,146,60,.2); color: #f97316; }
.lm-player-tag--jp3 { background: rgba(167,139,250,.2); color: #8b5cf6; }
.lm-player-tag--jp4 { background: rgba(251,113,133,.2); color: #f43f5e; }
.lm-player-tag--jp5 { background: rgba(250,204,21,.2); color: #ca8a04; }
.lm-player-tag--jp6 { background: rgba(45,212,191,.2); color: #14b8a6; }
.lm-player-tag--jp7 { background: rgba(244,114,182,.2); color: #ec4899; }
.lm-player-tag--jp8 { background: rgba(129,140,248,.2); color: #6366f1; }
.lm-player-tag--jp9 { background: rgba(163,230,53,.2); color: #65a30d; }
.lm-player-tag--withdrawn { background: #fee2e2; color: #991b1b; }

/* Edit icon (pen) before player name */
.lm-edit-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; flex-shrink: 0;
  border: none; background: none; cursor: pointer;
  color: #64748b; font-size: 0.85rem;
  border-radius: 0.25rem; transition: background 0.15s, color 0.15s;
  padding: 0;
}
.lm-edit-icon:hover { background: #e2e8f0; color: #1a237e; }

.lm-player-actions {
  display: flex; gap: 0.25rem; flex-wrap: nowrap; flex-shrink: 0;
}
.lm-btn {
  border: 1px solid #cbd5e1; background: #fff; color: #475569;
  padding: 0.15rem 0.4rem; border-radius: 0.25rem; font-size: 0.75rem;
  cursor: pointer; transition: background 0.15s;
}
.lm-btn:hover { background: #f1f5f9; }
.lm-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.lm-btn-remove, .lm-btn-withdraw { color: #dc2626; border-color: #fca5a5; }
.lm-btn-remove:hover, .lm-btn-withdraw:hover { background: #fef2f2; }

/* Move-to-lane picker */
.lm-move-picker {
  display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap;
  padding: 0.4rem 0; margin-top: 0.2rem;
}
.lm-move-picker__label {
  font-size: 0.8rem; color: #64748b; font-weight: 600; margin-right: 0.1rem;
}
.lm-move-picker__btn {
  padding: 0.3rem 0.6rem; font-size: 0.8rem; border: 1px solid #3b82f6;
  border-radius: 0.25rem; background: #eff6ff; color: #1d4ed8;
  cursor: pointer; transition: background 0.15s;
}
.lm-move-picker__btn:hover { background: #dbeafe; }
.lm-move-picker__cancel {
  padding: 0.3rem 0.6rem; font-size: 0.8rem; border: 1px solid #cbd5e1;
  border-radius: 0.25rem; background: #fff; color: #64748b;
  cursor: pointer;
}
.lm-move-picker__cancel:hover { background: #f1f5f9; }

/* Lane toolbar (expand/collapse all) */
.lm-lane-toolbar {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.lm-lane-toolbar .lm-zoom-btn { margin-right: auto; }
.lm-lane-toolbar__btn {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.3rem;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s;
}
.lm-lane-toolbar__btn:hover { background: #f1f5f9; }

.lm-add-player-btn { margin: 0.5rem; }

/* Add/Edit forms */
.lm-add-form, .lm-edit-form {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.4rem;
  padding: 0.75rem; margin: 0.5rem;
}
.lm-form-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem; margin-bottom: 0.5rem;
}
.lm-form-field label {
  display: block; font-size: 0.7rem; color: #64748b; margin-bottom: 0.15rem;
}
.lm-input {
  width: 100%; padding: 0.35rem 0.5rem; font-size: 0.85rem;
  border: 1px solid #cbd5e1; border-radius: 0.25rem;
}
.lm-input:focus { border-color: #1a237e; outline: none; box-shadow: 0 0 0 2px rgba(26,35,126,0.15); }
.lm-form-actions { display: flex; gap: 0.4rem; }

/* Score row */
.lm-score-row {
  display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap;
  margin-top: 0.2rem; padding-left: 1.9rem;
}
.lm-score-cell { display: flex; flex-direction: column; align-items: center; }
.lm-score-label { font-family: 'Chakra Petch', var(--font-sans); font-size: 0.6rem; color: #94a3b8; text-align: center; line-height: 1.1; }
/* 環狀輪道:該局實際球道,顯示在 Gn 下方一行(小字、藍調) */
.lm-score-lane { display: block; font-size: 0.9em; font-weight: 700; color: var(--color-primary, #1a237e); }
.lm-score-input {
  width: 3.5rem; padding: 0.4rem; text-align: center; font-family: 'Chakra Petch', var(--font-sans); font-size: 1rem; font-weight: 600;
  border: 1px solid #cbd5e1; border-radius: 0.25rem;
  transition: border-color 0.2s, background 0.3s;
  -moz-appearance: textfield;
  appearance: textfield;
}
/* Hide native spinner arrows on score inputs — they steal visual space */
.lm-score-input::-webkit-inner-spin-button,
.lm-score-input::-webkit-outer-spin-button,
.lm-quick-input::-webkit-inner-spin-button,
.lm-quick-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.lm-quick-input { -moz-appearance: textfield; appearance: textfield; }
.lm-score-input:focus { border-color: #1a237e; outline: none; box-shadow: 0 0 0 2px rgba(26,35,126,0.15); }
.lm-score-input--locked { background: #f1f5f9; color: #94a3b8; }
.lm-score-val {
  display: inline-block; width: 3rem; text-align: center;
  font-family: 'Chakra Petch', var(--font-sans); font-size: 0.85rem; color: #334155; font-weight: 500;
}
.lm-score-total {
  display: flex; flex-direction: column; align-items: center;
  margin-left: 0.5rem; padding-left: 0.5rem; border-left: 2px solid #e2e8f0;
}
.lm-score-total-label { font-size: 0.6rem; color: #94a3b8; }
.lm-score-total-val { font-family: 'Chakra Petch', var(--font-sans); font-size: 1rem; font-weight: 700; color: #1a237e; }
.lm-score-total-bonus { font-family: 'Chakra Petch', var(--font-sans); font-size: 0.7rem; color: #92400e; }

/* Zoom mode (toggled by JS) — ~190% size, wraps to 2 rows */
.lm--zoom .lm-score-row { flex-wrap: wrap; gap: 0.4rem; }
.lm--zoom .lm-score-input { width: 5.5rem; padding: 0.7rem; font-size: 1.6rem; }
.lm--zoom .lm-score-label { font-size: 0.9rem; }
.lm--zoom .lm-player-name { font-size: 1.3rem; }
.lm--zoom .lm-player-idx { width: 2rem; height: 2rem; font-size: 1rem; }
.lm--zoom .lm-player-tag { font-size: 0.85rem; }
.lm--zoom .lm-score-cell { flex: 0 0 auto; }

/* Zoom toggle button */
.lm-zoom-btn {
  font-size: 0.8rem; padding: 0.3rem 0.7rem; border: 1px solid #cbd5e1;
  border-radius: 0.3rem; background: #fff; cursor: pointer;
}
.lm-zoom-btn--active { background: #dbeafe; border-color: #3b82f6; color: #1d4ed8; }

/* ── Quick scoring mode ──────────────────────────────────────────── */

/* Quick mode toggle button */
.lm-quick-btn {
  font-size: 0.8rem; padding: 0.3rem 0.7rem; border: 1px solid #cbd5e1;
  border-radius: 0.3rem; background: #fff; cursor: pointer; margin-left: 0.3rem;
}
.lm-quick-btn--active { background: #fef3c7; border-color: #f59e0b; color: #92400e; font-weight: 600; }

/* Lane selector */
.lm-quick-lanes {
  display: flex; gap: 0.4rem; padding: 0.5rem 0; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.lm-quick-lanes::-webkit-scrollbar { display: none; }
.lm-quick-lane-pill {
  flex: 0 0 auto; padding: 0.45rem 0.9rem; border-radius: 1rem;
  border: 1.5px solid #cbd5e1; background: #fff; font-size: 0.9rem;
  font-weight: 600; cursor: pointer; white-space: nowrap; color: #475569;
}
.lm-quick-lane-pill--active {
  background: #1a237e; color: #fff; border-color: #1a237e;
}

/* Frame selector */
.lm-quick-frames {
  display: flex; align-items: center; gap: 0.25rem; padding: 0.4rem 0;
  overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap;
}
.lm-quick-frames::-webkit-scrollbar { display: none; }
.lm-quick-frame-pill {
  flex: 0 0 auto; padding: 0.35rem 0.6rem; border-radius: 0.5rem;
  border: 1.5px solid #e2e8f0; background: #f8fafc; font-family: 'Chakra Petch', var(--font-sans); font-size: 0.82rem;
  font-weight: 600; cursor: pointer; white-space: nowrap; color: #475569;
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  min-width: 2.5rem; text-align: center;
}
.lm-quick-frame-pill--active {
  background: #1a237e; color: #fff; border-color: #1a237e;
}
.lm-quick-frame-pill--locked {
  opacity: 0.5; background: #f1f5f9;
}
.lm-quick-frame-pill--active.lm-quick-frame-pill--locked {
  opacity: 0.8; background: #64748b; border-color: #64748b;
}
.lm-quick-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #e2e8f0;
}
.lm-quick-dot--partial { background: #fbbf24; }
.lm-quick-dot--done { background: #22c55e; }
.lm-quick-arrow {
  flex: 0 0 auto; width: 2rem; height: 2rem; border-radius: 50%;
  border: 1px solid #cbd5e1; background: #fff; font-size: 0.8rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #475569;
}
.lm-quick-arrow:active { background: #e2e8f0; }

/* Locked banner */
.lm-quick-locked-banner {
  background: #fef3c7; border: 1px solid #fde68a; border-radius: 0.5rem;
  padding: 0.5rem 0.75rem; font-size: 0.85rem; color: #92400e;
  text-align: center; margin: 0.4rem 0;
}

/* Player cards */
.lm-quick-players { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.3rem 0; }
.lm-quick-player {
  padding: 0.6rem 0; border-bottom: 1px solid #f1f5f9;
  scroll-margin-bottom: 4rem;
}
.lm-quick-player:last-child { border-bottom: none; }
.lm-quick-player-info {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.4rem;
}
.lm-quick-player-left { display: flex; align-items: center; gap: 0.4rem; flex: 1; min-width: 0; }
.lm-quick-player-idx {
  width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #e2e8f0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: #475569; flex-shrink: 0;
}
.lm-quick-player-name {
  font-size: 1.15rem; font-weight: 600; color: #1e293b;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lm-quick-player-total {
  font-family: 'Chakra Petch', var(--font-sans); font-size: 0.85rem; color: #64748b; white-space: nowrap; margin-left: 0.5rem;
}
.lm-quick-input {
  display: block; width: 100%; height: 3rem; padding: 0.5rem;
  text-align: center; font-family: 'Chakra Petch', var(--font-sans); font-size: 2rem; font-weight: 700;
  border: 2px solid #cbd5e1; border-radius: 0.5rem;
  background: #fff; color: #1e293b;
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
}
.lm-quick-input:focus {
  border-color: #1a237e; outline: none;
  box-shadow: 0 0 0 3px rgba(26,35,126,0.15);
}
.lm-quick-input--locked {
  background: #f1f5f9; color: #94a3b8; border-color: #e2e8f0;
}
.lm-quick-input::placeholder { color: #cbd5e1; font-weight: 400; font-size: 1rem; }
/* Hide number spinner on quick input */
.lm-quick-input::-webkit-inner-spin-button,
.lm-quick-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.lm-quick-input[type=number] { -moz-appearance: textfield; }

/* Floating next button */
.lm-quick-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9000;
  padding: 0.4rem 1rem;
  background: #1e293b;
  border-top: 1px solid #334155;
}
.lm-quick-nav__btn {
  display: block;
  width: 100%;
  height: 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  background: #3b82f6;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.lm-quick-nav__btn:active { background: #2563eb; }

/* Desktop: quick mode 佔滿父容器 */

/* Mobile */
@media (max-width: 640px) {
  .lm-score-row { padding-left: 0; }
  .lm-score-input { width: 3rem; font-size: 0.95rem; }
  .lm--zoom .lm-score-input { width: 5rem; padding: 0.6rem; font-size: 1.4rem; }
  .lm-player-actions { gap: 0.15rem; }
  .lm-btn { padding: 0.3rem 0.5rem; font-size: 0.78rem; min-height: 2rem; }
  .lm-score-label,
  .lm-score-total-label { font-size: 0.7rem; }
  .lm-player-idx { font-size: 0.78rem; }
  .lm-del-lane-btn { font-size: 0.78rem; padding: 0.2rem 0.5rem; }
}

/* ── Share Modal ──────────────────────────────────────────── */
.share-modal {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: share-modal-in .25s ease;
}
@keyframes share-modal-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.share-modal__card {
  background: #fff; border-radius: 1rem; max-width: 560px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,.25), 0 0 0 1px rgba(0,0,0,.05);
  animation: share-card-in .3s ease;
}
@keyframes share-card-in {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.share-modal__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1.25rem;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff;
  border-radius: 1rem 1rem 0 0;
}
.share-modal__header h3 { color: #fff; font-size: 1.05rem; }
.share-modal__close {
  background: rgba(255,255,255,.15); border: none; font-size: 1.2rem;
  cursor: pointer; color: #fff; line-height: 1;
  width: 2rem; height: 2rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.share-modal__close:hover { background: rgba(255,255,255,.25); }
.share-modal__body { padding: 1.25rem; }
.share-tpl-btn { flex-shrink: 0; transition: all .2s; }
.share-tpl-btn--active { background: var(--color-primary) !important; color: #fff !important; border-color: var(--color-primary) !important; }
/* Canvas 預覽區 */
.share-modal #share-canvas { border: 1px solid var(--color-border); border-radius: var(--radius-md); }
/* 底部按鈕區 */
.share-modal__actions {
  display: flex; gap: .5rem; margin-top: 1rem;
}
.share-modal__actions .btn { flex: 1; }

/* ── 30. ACCOUNTING TAB ─────────────────────────────────── */
.acct-section { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1rem; margin-bottom: 1rem; }
.acct-section__title { font-size: .95rem; font-weight: 700; color: var(--color-primary); margin: 0 0 .75rem; }
.acct-section--balance { background: var(--color-bg); }
.acct-row { display: flex; justify-content: space-between; align-items: center; padding: .35rem 0; }
.acct-row__main { display: flex; align-items: center; gap: .5rem; }
.acct-row__amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acct-row__detail { padding: 0 0 .5rem 2.2rem; font-size: .85rem; line-height: 1.6; }
.acct-toggle { background: none; border: 1px solid var(--color-border); border-radius: 4px; width: 1.4rem; height: 1.4rem; cursor: pointer; font-size: .65rem; color: var(--color-text-muted); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.acct-total { display: flex; justify-content: space-between; align-items: center; border-top: 2px solid var(--color-border); margin-top: .75rem; padding-top: .75rem; font-weight: 700; font-size: .95rem; }
.acct-total span { font-variant-numeric: tabular-nums; }
.acct-total--expense span { color: var(--color-danger); }

/* ── 31. HERO BOARD MEDALS (members.html) ─────────────────── */
.hero-medal {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: 1.3rem;
  line-height: 1;
  padding: .15rem .5rem .15rem .35rem;
  border-radius: var(--radius-full);
  position: relative;
  font-weight: 700;
}
.hero-medal__num {
  font-family: 'Chakra Petch', sans-serif;
  font-size: .85rem;
  font-weight: 700;
  color: rgba(0,0,0,.7);
}
.hero-medal--1 { background: linear-gradient(135deg, #fff4c1, #ffd54f); box-shadow: 0 2px 10px rgba(255,193,7,.35); }
.hero-medal--2 { background: linear-gradient(135deg, #f5f5f5, #c0c0c0); box-shadow: 0 2px 10px rgba(140,140,140,.35); }
.hero-medal--3 { background: linear-gradient(135deg, #ffdcb6, #cd8547); box-shadow: 0 2px 10px rgba(205,133,71,.35); }
/* champion: 英雄榜統一使用 — 每列都是各場甲組冠軍,無 shine 動畫,避免整表狂閃 */
.hero-medal--champion { background: linear-gradient(135deg, #fff4c1, #ffd54f); box-shadow: 0 1px 4px rgba(255,193,7,.25); }
.hero-medal--1::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(120deg, transparent 40%, rgba(255,255,255,.6) 50%, transparent 60%); animation: hero-medal-shine 3s ease-in-out infinite; pointer-events: none; }
@keyframes hero-medal-shine { 0%, 100% { transform: translateX(-100%); } 50% { transform: translateX(100%); } }

.hero-rank-plain {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  color: var(--color-text-muted);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

/* Subtle tint on top-3 rows */
.hero-row--1 { background: linear-gradient(90deg, rgba(255,193,7,.08), transparent 60%); }
.hero-row--2 { background: linear-gradient(90deg, rgba(158,158,158,.08), transparent 60%); }
.hero-row--3 { background: linear-gradient(90deg, rgba(205,133,71,.08), transparent 60%); }

/* ── 32. PAGE TABS — members.html (icon + gold active bar) ── */
#page-tabs.tabs {
  gap: .2rem;
  border-bottom: 2px solid var(--color-border);
}
#page-tabs .tabs__tab {
  position: relative;
  padding: .75rem 1.2rem;
  font-weight: 700;
  letter-spacing: .02em;
  transition: color .2s ease;
}
#page-tabs .tabs__tab::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 15%;
  right: 15%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform .25s ease;
}
#page-tabs .tabs__tab--active {
  color: var(--color-primary);
}
#page-tabs .tabs__tab--active::before { transform: scaleX(1); }
#page-tabs .tabs__tab:hover:not(.tabs__tab--active) {
  color: var(--color-accent-dark);
}

/* ── 33. PRINT ────────────────────────────────────────────── */
@media print {
  .navbar, .footer, .qr-fab, .toast-container, .ws-status-bar { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* ── Features Section CTA (index.html) ── */
.section__subtitle-link {
  color: var(--color-accent-dark);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 1px dashed var(--color-accent);
  transition: color .15s, border-color .15s;
}
.section__subtitle-link:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent-dark);
  text-decoration: none;
}
.features-cta {
  margin-top: 2.5rem;
  text-align: center;
}
.features-cta__btn {
  font-size: 1rem;
  padding: .85rem 1.75rem;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
  color: #1a1a1a;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(255,160,0,.35);
}
.features-cta__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(255,160,0,.5);
  color: #1a1a1a;
  text-decoration: none;
}
.features-cta__hint {
  margin-top: .85rem;
  font-size: .85rem;
  color: var(--color-text-muted);
}

/* ============================================================
   34. WELCOME PAGE (welcome.html)
   一頁式滾動介紹，兼任新手導覽 + 行銷頁
   ============================================================ */

.wc-body { background: #fff; }

/* ── Skip bar (only first-visit) ── */
.wc-skipbar {
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
  color: #1a1a1a;
  font-weight: 600;
  position: sticky;
  top: var(--nav-h);
  z-index: 90;
  box-shadow: 0 2px 12px rgba(255,160,0,.25);
}
.wc-skipbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem 1rem;
}
.wc-skipbar__hint { font-size: .9rem; }
.wc-skipbar__btn {
  background: rgba(0,0,0,.85);
  color: #ffd740;
  border: none;
  padding: .35rem 1rem;
  border-radius: var(--radius-full);
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.wc-skipbar__btn:hover { background: #000; transform: translateX(2px); }
/* 用戶滾到 §2 後主動收掉 — 透明度 + 高度雙 transition，避免 reflow 突兀 */
.wc-skipbar {
  overflow: hidden;
  max-height: 80px;
  transition: max-height .35s ease, opacity .3s ease, padding .35s ease;
}
.wc-skipbar--dismiss {
  max-height: 0 !important;
  opacity: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  pointer-events: none;
}

/* ── Section base ── */
.wc-section {
  padding: 4.5rem 1rem;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .8s ease, transform .8s ease;
  scroll-margin-top: var(--nav-h); /* 貼齊 navbar 下緣，無 buffer */
}
.wc-section.wc-in-view { opacity: 1; transform: none; }
.wc-section--alt { background: #f5f6fa; }
.wc-cta { scroll-margin-top: var(--nav-h); }
/* 第一次訪問顯示 skipbar 時，補償其高度以免錨點跳轉內容被遮 */
/* :not([data-dismissed]) — 用戶滾到 §2 觸發收起後，scroll-margin 立即回到 navH */
body:has(.wc-skipbar:not([hidden]):not([data-dismissed])) .wc-section,
body:has(.wc-skipbar:not([hidden]):not([data-dismissed])) .wc-cta {
  scroll-margin-top: calc(var(--nav-h) + 40px);
}

@media (prefers-reduced-motion: reduce) {
  .wc-section { opacity: 1; transform: none; transition: none; }
}

.wc-section__head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem;
}
.wc-section__kicker {
  display: inline-block;
  font-family: 'Chakra Petch', sans-serif;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .25em;
  color: var(--color-accent-dark);
  background: rgba(255,160,0,.1);
  padding: .35rem .9rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}
.wc-section__kicker--light {
  color: var(--color-accent-light);
  background: rgba(255,215,64,.15);
}
.wc-section__title {
  font-family: 'Chakra Petch', var(--font-sans);
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: .75rem;
  line-height: 1.25;
}
.wc-section__subtitle {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* ── Image placeholder（補圖框）── */
.wc-imgbox {
  width: 100%;
  background: linear-gradient(135deg, #f0f2fa 0%, #e4e8f6 100%);
  border: 2px dashed #b8c0db;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  transition: border-color .2s, background .2s;
}
.wc-imgbox:hover {
  border-color: var(--color-accent);
  background: linear-gradient(135deg, #fff8e8 0%, #ffeec4 100%);
}
.wc-imgbox--16x9 { aspect-ratio: 16 / 9; }
.wc-imgbox--4x3  { aspect-ratio: 4 / 3; }
.wc-imgbox--banner { aspect-ratio: 4 / 1; margin-top: 2.5rem; }

.wc-imgbox__inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  gap: .4rem;
}
/* 真圖：載入成功時蓋住下面的 placeholder；onerror 會把 <img> 從 DOM 移除，自動退回 placeholder */
.wc-imgbox__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
}
/* 有圖時 imgbox 可點擊放大 — placeholder 模式不需要 cursor */
.wc-imgbox:has(.wc-imgbox__img) {
  cursor: zoom-in;
  /* P1 — 真圖載入後拿掉 dashed-placeholder 樣式 (dashed = 待補圖視覺慣例) */
  border: 1px solid var(--color-border);
  background: transparent;
}
/* P1 Lane Score DNA — ticket-stub editorial top strip on real images
   (indigo + amber dashed segment, 同 .day-detail__head 風格) */
.wc-imgbox:has(.wc-imgbox__img)::before,
.og-imgbox::before {
  content: '';
  position: absolute;
  left: 12px; right: 12px;
  top: 0;
  height: 3px;
  background-image: linear-gradient(
    90deg,
    var(--color-primary) 0 6px,
    transparent          6px 14px,
    var(--color-accent)  14px 20px,
    transparent          20px 28px
  );
  background-size: 28px 3px;
  background-repeat: repeat-x;
  z-index: 2;
  pointer-events: none;
}
.og-imgbox { position: relative; }
.wc-imgbox__icon { font-size: 2.6rem; opacity: .55; line-height: 1; }
.wc-imgbox__label {
  font-family: 'Chakra Petch', var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: .02em;
}
.wc-imgbox__hint {
  font-size: .78rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  max-width: 420px;
}

/* ── Section 1: HERO ── */
.wc-hero {
  position: relative;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  padding: 5rem 1rem 6rem;
  overflow: hidden;
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
}
.wc-hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 80%, rgba(255,160,0,.18) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 20%, rgba(57,73,171,.30) 0%, transparent 70%);
  pointer-events: none;
}
/* P1 Lane Score DNA — diagonal lane stripes (recycled from .home-card__lanes pattern, amber-tinted for hero dark bg) */
.wc-hero::after {
  content: '';
  position: absolute;
  right: -120px; bottom: -120px;
  width: 480px; height: 480px;
  background: repeating-linear-gradient(
    -42deg,
    rgba(255, 215, 64, .07) 0 14px,
    transparent              14px 32px
  );
  border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle at 30% 30%, transparent 0, #000 65%);
          mask-image: radial-gradient(circle at 30% 30%, transparent 0, #000 65%);
  pointer-events: none;
  z-index: 0;
}
.wc-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
/* v0.59.11 — welcome hero brand logo(large_logo.png 引入 hero,從擱置到主視覺) */
.wc-hero__brand-logo {
  display: block;
  max-width: 360px;
  width: 100%;
  height: auto;
  margin: 0 0 1.25rem;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .35));
}
@media (max-width: 768px) {
  .wc-hero__brand-logo { max-width: 280px; margin-inline: auto; }
}

.wc-hero__badge {
  display: inline-block;
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-full);
  padding: .35rem 1rem;
  font-size: .8rem;
  letter-spacing: .15em;
  color: var(--color-accent-light);
  font-weight: 600;
  margin-bottom: 1.25rem;
}
.wc-hero__title {
  font-family: 'Chakra Petch', var(--font-sans);
  font-size: clamp(2rem, 4.4vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  text-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.wc-hero__title span {
  display: block;
  background: linear-gradient(90deg, var(--color-accent-light), var(--color-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-top: .35rem;
}
.wc-hero__lede {
  font-size: 1.05rem;
  color: rgba(255,255,255,.88);
  line-height: 1.75;
  margin-bottom: 1.75rem;
  max-width: 540px;
}
.wc-hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}
.wc-hero .btn--secondary {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-color: rgba(255,255,255,.3);
}
.wc-hero .btn--secondary:hover {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.5);
}

/* Scroll cue */
.wc-scrollcue {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid rgba(255,215,64,.6);
  border-radius: 14px;
  z-index: 2;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}
.wc-scrollcue span {
  width: 4px;
  height: 8px;
  background: var(--color-accent-light);
  border-radius: 2px;
  animation: wc-scroll-bounce 1.6s ease-in-out infinite;
}
@keyframes wc-scroll-bounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%      { transform: translateY(12px); opacity: .3; }
}

/* ── Section 2: SCENARIOS ── */
.wc-scenarios {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.wc-scenario {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.wc-scenario:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}
.wc-scenario__plan {
  align-self: flex-start;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  color: #fff;
  font-family: 'Chakra Petch', sans-serif;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  padding: .35rem .85rem;
  border-radius: var(--radius-full);
}
.wc-scenario__plan--free {
  background: linear-gradient(90deg, var(--color-success), #66bb6a);
}
.wc-scenario__title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}
.wc-scenario__desc {
  font-size: .92rem;
  color: var(--color-text);
  line-height: 1.7;
}
.wc-scenario__feats {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: .85rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
}
.wc-scenario__feats li {
  padding: .3rem 0;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.wc-scenario__feats li::before {
  content: '✓';
  color: var(--color-success);
  font-weight: 700;
}

/* ── Sections 3 / 5 / 6: feature side-by-side ── */
.wc-feature {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 3rem;
  align-items: center;
}
.wc-feature--reverse .wc-feature__media { order: 2; }
.wc-feature__title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 1rem;
}
.wc-feature__desc {
  font-size: 1rem;
  color: var(--color-text);
  line-height: 1.75;
  margin-bottom: 1.25rem;
}
.wc-feature__bullets {
  list-style: none;
  padding: 0;
  margin: 0;
}
.wc-feature__bullets li {
  padding: .55rem 0 .55rem 1.6rem;
  position: relative;
  border-bottom: 1px solid var(--color-border);
  font-size: .92rem;
  line-height: 1.6;
  color: var(--color-text);
}
.wc-feature__bullets li:last-child { border-bottom: none; }
.wc-feature__bullets li::before {
  /* P1 — `/` is the canonical bowling-scoring spare mark; replaces generic ▸ */
  content: '/';
  font-family: 'Chakra Petch', sans-serif;
  position: absolute;
  left: 0;
  top: .45rem;
  color: var(--color-accent);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.05em;
}
.wc-feature__bullets strong { color: var(--color-primary); }

/* P1b welcome rewrite — extras for §3 §4 §5 (note / cta / planlist / inline link) */
.wc-feature__note {
  font-size: .82rem;
  color: var(--color-text-muted);
  font-style: italic;
  line-height: 1.55;
  margin: 1rem 0 0;
  padding: .65rem .85rem;
  background: rgba(26, 35, 126, .04);
  border-left: 3px solid var(--color-border);
  border-radius: 0 6px 6px 0;
}
.wc-feature__cta {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: 1.25rem;
}
.wc-inlink {
  display: inline-block;
  margin-left: .35rem;
  color: var(--color-accent-dark);
  font-weight: 600;
  text-decoration: none;
  font-size: .88rem;
}
.wc-inlink:hover { text-decoration: underline; }

/* §5 plan list — 3 plan rows with color label */
.wc-planlist {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.wc-planlist li {
  display: flex; align-items: center; gap: .9rem;
  padding: .6rem .85rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
.wc-plan__label {
  flex-shrink: 0;
  font-family: 'Chakra Petch', sans-serif;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  padding: .25rem .65rem;
  border-radius: 999px;
  white-space: nowrap;
}
.wc-plan__label--friend { background: rgba(107, 114, 128, .12); color: #4b5563; }
.wc-plan__label--team   { background: rgba(26, 35, 126, .12);  color: var(--color-primary); }
.wc-plan__label--event  { background: linear-gradient(90deg, var(--color-accent-light), var(--color-accent)); color: #1a1a1a; }
.wc-plan__desc {
  font-size: .9rem;
  color: var(--color-text);
}

/* ── Section 4: STEPS (4-step comic) ── */
.wc-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  position: relative;
}
/* 2-card variant — §3 SOCIAL 用 (動態 + 分享卡) */
.wc-steps--duo { grid-template-columns: repeat(2, 1fr); }
.wc-step {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform .2s, box-shadow .2s;
}
.wc-step:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
/* P1 Lane Score DNA — diagonal lane stripes from bottom-right corner. inset+mask
   approach (vs outside-positioned) avoids clipping the top __num badge. */
.wc-step::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -42deg,
    rgba(26, 35, 126, .04) 0 9px,
    transparent              9px 22px
  );
  border-radius: var(--radius-lg);
  -webkit-mask-image: radial-gradient(circle at 100% 100%, #000 0, transparent 50%);
          mask-image: radial-gradient(circle at 100% 100%, #000 0, transparent 50%);
  pointer-events: none;
  z-index: 0;
}
.wc-step > * { position: relative; z-index: 1; }
.wc-step__num {
  position: absolute;
  top: -.7rem;
  left: 1rem;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-light));
  color: #1a1a1a;
  font-family: 'Chakra Petch', sans-serif;
  font-size: .9rem;
  font-weight: 800;
  padding: .25rem .7rem;
  border-radius: var(--radius-full);
  letter-spacing: .08em;
  box-shadow: 0 2px 8px rgba(255,160,0,.4);
}
.wc-step__title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
}
.wc-step__desc {
  font-size: .85rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ── Section 7: PLAN TABLE ── */
.wc-plans {
  max-width: 920px;
  margin: 0 auto;
}
.wc-plans__table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.wc-plans__table thead th {
  padding: 2rem .75rem 1.25rem; /* top 加大為 ★ 完整功能 標記預留空間 */
  text-align: center;
  background: #f5f6fa;
  border-bottom: 2px solid var(--color-border);
  vertical-align: top;
}
.wc-plans__feat {
  text-align: left !important;
  background: #fff !important;
  font-family: 'Chakra Petch', sans-serif;
  color: var(--color-primary);
  font-size: .85rem;
  letter-spacing: .1em;
}
.wc-plans__col--free { background: linear-gradient(180deg, #e8f5e9, #f5f6fa) !important; }
.wc-plans__col--top {
  background: linear-gradient(180deg, var(--color-accent-light), #f5f6fa) !important;
  position: relative; /* 給 ::before 的 ★ 完整功能 定位用 */
}
.wc-plans__col--top::before {
  content: '★ 完整功能';
  position: absolute;
  top: .5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: .65rem;
  letter-spacing: .15em;
  color: var(--color-accent-dark);
  font-weight: 700;
  white-space: nowrap;
}
.wc-plans__plan {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .15em;
  color: var(--color-primary);
  margin-bottom: .25rem;
}
.wc-plans__price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: .25rem;
}
.wc-plans__sub {
  font-size: .75rem;
  color: var(--color-text-muted);
  letter-spacing: .05em;
}
.wc-plans__table tbody td {
  padding: .85rem .75rem;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
  font-size: .92rem;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}
/* P1 — promote ✓/— to scoreboard glyphs (size + color + weight) */
.wc-plans__yes { color: var(--color-success); font-size: 1.1rem; font-weight: 700; }
.wc-plans__no  { color: var(--color-text-light); font-size: 1.1rem; }
/* Sticky thead so plan column headers stay visible while scrolling tall page */
.wc-plans__table thead th { position: sticky; top: var(--nav-h); z-index: 2; }
@media (max-width: 640px) {
  .wc-plans__table thead th { position: static; }
}
.wc-plans__table tbody td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--color-primary);
  background: #fafbfd;
}
.wc-plans__table tbody tr:last-child td { border-bottom: none; }
.wc-plans__table tbody tr:hover td { background: #fffaf0; }
.wc-plans__table tbody tr:hover td:first-child { background: #fff5e0; }
.wc-plans__note {
  text-align: center;
  font-size: .82rem;
  color: var(--color-text-muted);
  margin-top: 1.25rem;
}

/* ── Section 8: CTA ── */
.wc-cta {
  position: relative;
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 60%, #2c3e9c 100%);
  color: #fff;
  padding: 5rem 1rem 4rem;
  text-align: center;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .8s ease, transform .8s ease;
}
.wc-cta.wc-in-view { opacity: 1; transform: none; }
.wc-cta__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 30%, rgba(255,160,0,.2) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(255,215,64,.15) 0%, transparent 60%);
  pointer-events: none;
}
.wc-cta__inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }
.wc-cta__title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: clamp(1.7rem, 3.8vw, 2.5rem);
  font-weight: 800;
  line-height: 1.35;
  margin: 1rem 0 1.25rem;
  text-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.wc-cta__lede {
  font-size: 1.05rem;
  color: rgba(255,255,255,.85);
  line-height: 1.75;
  margin-bottom: 2rem;
}
.wc-cta__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: center;
}
.wc-cta__primary {
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light)) !important;
  color: #1a1a1a !important;
  border: none !important;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(255,160,0,.4);
}
.wc-cta__primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255,160,0,.55);
}
.wc-cta .btn--secondary {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-color: rgba(255,255,255,.3);
}
.wc-cta .btn--secondary:hover {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.5);
}
.wc-cta .btn--ghost {
  background: transparent;
  color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.15);
}
.wc-cta .btn--ghost:hover {
  color: #fff;
  border-color: rgba(255,255,255,.4);
  background: rgba(255,255,255,.05);
  text-decoration: none;
}
.wc-cta__contact {
  margin-top: 1.5rem;
  font-size: .9rem;
  color: rgba(255,255,255,.7);
}
.wc-cta__contact a {
  color: var(--color-accent-light);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed rgba(255,215,64,.5);
  transition: color .15s, border-color .15s;
}
.wc-cta__contact a:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  text-decoration: none;
}

/* ── Lightbox（圖片預覽 overlay） ── */
.wc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, .92);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  cursor: zoom-out;
  animation: wc-lightbox-in .2s ease;
}
@keyframes wc-lightbox-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.wc-lightbox.is-grabbing { cursor: grabbing; }
.wc-lightbox__img {
  max-width: 95vw;
  max-height: 95vh;
  user-select: none;
  -webkit-user-drag: none;
  cursor: grab;
  transform-origin: center center;
  transition: transform .15s ease;
  will-change: transform;
}
.wc-lightbox.is-grabbing .wc-lightbox__img {
  cursor: grabbing;
  transition: none;
}
.wc-lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 300;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background .15s, color .15s, transform .15s;
}
.wc-lightbox__close:hover {
  background: var(--color-accent);
  color: #1a1a1a;
  transform: scale(1.08);
}
.wc-lightbox__hint {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .65);
  font-size: .78rem;
  letter-spacing: .05em;
  pointer-events: none;
  background: rgba(0, 0, 0, .45);
  padding: .4rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, .08);
  white-space: nowrap;
  max-width: calc(100vw - 2rem);
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 480px) {
  .wc-lightbox__close { width: 38px; height: 38px; font-size: 1.4rem; top: .75rem; right: .75rem; }
  .wc-lightbox__hint { font-size: .7rem; padding: .3rem .75rem; bottom: .75rem; }
}

/* ── Floating Pager ──
   桌機：右下角浮動橫條，含 ← 1/8 → + 進度條 + 8 點導覽
   手機：底部中央，縮小 + 隱藏進度條 + 隱藏點，只留 ← 1/8 → */
.wc-pager {
  position: fixed;
  z-index: 95;
  right: 1.5rem;
  bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  background: rgba(10, 12, 26, .88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 215, 64, .25);
  border-radius: var(--radius-full);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .35), 0 0 0 1px rgba(0,0,0,.2);
  color: #fff;
  user-select: none;
  transition: opacity .25s, transform .25s;
}
.wc-pager.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}
.wc-pager__arrow {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  transition: background .15s, color .15s, transform .15s;
  flex-shrink: 0;
}
.wc-pager__arrow:hover:not(:disabled) {
  background: var(--color-accent);
  color: #1a1a1a;
  transform: scale(1.08);
}
.wc-pager__arrow:disabled {
  opacity: .3;
  cursor: not-allowed;
}
.wc-pager__center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  min-width: 130px;
  padding: 0 .35rem;
}
.wc-pager__counter {
  font-family: 'Chakra Petch', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .08em;
  display: flex;
  align-items: baseline;
  gap: .15rem;
  line-height: 1;
}
.wc-pager__cur {
  color: var(--color-accent-light);
  font-size: 1.15rem;
  text-shadow: 0 0 12px rgba(255, 215, 64, .6);
  min-width: .9em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.wc-pager__sep {
  color: rgba(255, 255, 255, .35);
  margin: 0 .15rem;
}
.wc-pager__total {
  color: rgba(255, 255, 255, .65);
}
.wc-pager__bar {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, .1);
  border-radius: 2px;
  overflow: hidden;
}
.wc-pager__bar-fill {
  height: 100%;
  width: 12.5%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
  border-radius: 2px;
  transition: width .35s ease;
  box-shadow: 0 0 8px rgba(255, 215, 64, .5);
}
.wc-pager__dots {
  display: flex;
  gap: .35rem;
  margin-top: .1rem;
}
.wc-pager__dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .25);
  cursor: pointer;
  transition: background .2s, transform .2s, width .2s;
}
.wc-pager__dot:hover {
  background: rgba(255, 215, 64, .6);
  transform: scale(1.3);
}
.wc-pager__dot.is-active {
  background: var(--color-accent-light);
  width: 18px;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(255, 215, 64, .6);
}

/* 平板 / 手機：移到底部中央，更緊湊 */
@media (max-width: 768px) {
  .wc-pager {
    right: 50%;
    bottom: 1rem;
    transform: translateX(50%);
    padding: .4rem .55rem;
    gap: .35rem;
    max-width: calc(100vw - 2rem);
  }
  .wc-pager.is-hidden { transform: translateX(50%) translateY(20px); }
  .wc-pager__arrow {
    width: 32px;
    height: 32px;
  }
  .wc-pager__center {
    min-width: 100px;
    padding: 0 .25rem;
    gap: .3rem;
  }
  .wc-pager__counter { font-size: .85rem; }
  .wc-pager__cur { font-size: 1rem; }
  /* 手機隱藏 8 點導覽（畫面不夠），只留進度條 + 數字 */
  .wc-pager__dots { display: none; }
}

/* 極窄螢幕（< 360px）：再簡化 */
@media (max-width: 360px) {
  .wc-pager__bar { display: none; }
  .wc-pager__center { min-width: 70px; gap: 0; }
}

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .wc-hero__inner { grid-template-columns: 1fr; gap: 2rem; }
  .wc-hero__media { order: -1; }
  .wc-feature, .wc-feature--reverse { grid-template-columns: 1fr; gap: 1.5rem; }
  .wc-feature--reverse .wc-feature__media { order: -1; }
  .wc-scenarios { grid-template-columns: 1fr; }
  .wc-steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .wc-section { padding: 3rem 1rem; }
  .wc-hero { padding: 3rem 1rem 4rem; }
  .wc-cta { padding: 3.5rem 1rem 3rem; }
  .wc-steps { grid-template-columns: 1fr; }
  .wc-plans__table { font-size: .82rem; }
  .wc-plans__table thead th { padding: .85rem .35rem; }
  .wc-plans__plan { font-size: .8rem; letter-spacing: .08em; }
  .wc-plans__price { font-size: 1rem; }
  .wc-plans__table tbody td { padding: .65rem .35rem; font-size: .82rem; }
  /* P1 — EVENT 欄位含「200 人」/「3 場」較長字串, 給多 5% width 避免擠壓 */
  .wc-plans__col--top, .wc-plans__table tbody td:last-child { width: 32%; }
  .wc-plans__col, .wc-plans__table tbody td:nth-child(2),
  .wc-plans__table tbody td:nth-child(3) { width: 24%; }
  .wc-imgbox__icon { font-size: 2rem; }
  .wc-imgbox__hint { font-size: .72rem; }
  .wc-skipbar__inner { flex-direction: column; gap: .5rem; padding: .6rem .8rem; }
  .wc-skipbar__hint { font-size: .82rem; text-align: center; }
}

/* ============================================================
   35. USER GUIDE TOUR (in-app onboarding)
   半透明背景 + spotlight 鏤空 + popover 跟隨 target
   prototype：先在 customers.html 試用 6 步驟
   ============================================================ */

.ug-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 26, .55);
  z-index: 9000;
  pointer-events: auto;
  animation: ug-fade-in .25s ease;
}
@keyframes ug-fade-in { from { opacity: 0; } to { opacity: 1; } }

.ug-spotlight {
  position: fixed;
  border-radius: 10px;
  pointer-events: none;
  z-index: 9001;
  border: 2px solid var(--color-accent-light);
  box-shadow:
    0 0 0 9999px rgba(10, 12, 26, .68),
    0 0 0 4px rgba(255, 215, 64, .25),
    0 0 24px rgba(255, 160, 0, .5);
  transition: top .35s cubic-bezier(.4,0,.2,1),
              left .35s cubic-bezier(.4,0,.2,1),
              width .35s cubic-bezier(.4,0,.2,1),
              height .35s cubic-bezier(.4,0,.2,1);
  animation: ug-pulse 2.4s ease-in-out infinite;
}
@keyframes ug-pulse {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(10,12,26,.68), 0 0 0 4px rgba(255,215,64,.25), 0 0 18px rgba(255,160,0,.4); }
  50%      { box-shadow: 0 0 0 9999px rgba(10,12,26,.68), 0 0 0 8px rgba(255,215,64,.18), 0 0 28px rgba(255,160,0,.6); }
}
.ug-spotlight--center {
  /* 中央 popover（無 target）時隱藏 spotlight */
  display: none;
}

.ug-popover {
  position: fixed;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem 1rem;
  max-width: min(440px, calc(100vw - 2rem)); /* 2.6.0 360→440(使用者:不夠寬);窄螢幕以視窗為準 */
  min-width: 260px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(255,160,0,.2);
  z-index: 9002;
  font-size: .9rem;
  line-height: 1.6;
  color: var(--color-text);
  transition: top .35s cubic-bezier(.4,0,.2,1), left .35s cubic-bezier(.4,0,.2,1);
}

.ug-popover__step {
  display: inline-block;
  font-family: 'Chakra Petch', sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--color-accent-dark);
  background: rgba(255,160,0,.12);
  padding: .2rem .55rem;
  border-radius: var(--radius-full);
  margin-bottom: .55rem;
}
.ug-popover__title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: .35rem;
}
.ug-popover__body {
  color: var(--color-text);
  margin-bottom: 1rem;
}
.ug-popover__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.ug-popover__skip {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: .82rem;
  cursor: pointer;
  padding: .35rem 0;
  text-decoration: underline;
}
.ug-popover__skip:hover { color: var(--color-text); }
.ug-popover__nav {
  display: flex;
  gap: .5rem;
}
.ug-popover__btn {
  border: none;
  background: var(--color-accent);
  color: var(--color-primary-dark);
  padding: .45rem 1rem;
  border-radius: var(--radius-md);
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.ug-popover__btn:hover { background: var(--color-accent-dark); color: #fff; transform: translateY(-1px); }
.ug-popover__btn--prev {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.ug-popover__btn--prev:hover { background: var(--color-bg); color: var(--color-text); transform: none; }

/* 小箭頭（指向 target） */
.ug-popover::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 1px solid var(--color-border);
  transform: rotate(45deg);
  z-index: -1;
}
.ug-popover[data-placement="bottom"]::before { top: -8px; left: 24px; border-right: none; border-bottom: none; }
.ug-popover[data-placement="top"]::before    { bottom: -8px; left: 24px; border-left: none; border-top: none; }
.ug-popover[data-placement="left"]::before   { right: -8px; top: 24px; border-left: none; border-bottom: none; }
.ug-popover[data-placement="right"]::before  { left: -8px; top: 24px; border-right: none; border-top: none; }
.ug-popover[data-placement="center"]::before { display: none; }

@media (max-width: 640px) {
  .ug-popover { max-width: calc(100vw - 2rem); padding: .9rem 1rem .85rem; }
  .ug-popover__title { font-size: .98rem; }
  .ug-popover__body { font-size: .85rem; }
}

/* 重看教學 浮動按鈕（角落小圖示） */
.ug-replay-btn {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 290;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: .4rem .85rem;
  font-size: .8rem;
  color: var(--color-text-muted);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: .35rem;
  transition: background .15s, color .15s;
}
.ug-replay-btn:hover { background: #fff; color: var(--color-primary); border-color: var(--color-accent); }

/* ============================================================
   36. QR SHARE FAB（通用「QR 分享」浮動按鈕 + modal）
   用於 customers.html / 未來其他需要「快速分享觀看連結」的頁面
   staff.html 已有自己的 .staff-fab（不動，避免影響）
   ============================================================ */

.qr-share-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(0,0,0,.30), 0 0 0 4px rgba(255,160,0,.12);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.qr-share-fab:hover { background: var(--color-accent); color: #1a1a1a; transform: scale(1.06); }
.qr-share-fab:active { transform: scale(.94); }
.qr-share-fab svg { width: 1.5rem; height: 1.5rem; }

.qr-share-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.qr-share-modal__card {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.5rem 1.25rem;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,.32);
  position: relative;
}
.qr-share-modal__title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: .25rem;
}
.qr-share-modal__sub {
  font-size: .8rem;
  color: var(--color-text-muted);
  margin-bottom: .75rem;
}
.qr-share-modal__img {
  display: block;
  margin: .75rem auto;
  border: 4px solid var(--color-bg);
  border-radius: .5rem;
}
.qr-share-modal__url {
  font-size: .72rem;
  color: var(--color-text-light);
  word-break: break-all;
  margin: .5rem 0 .85rem;
  font-family: var(--font-mono);
}
.qr-share-modal__actions {
  display: flex;
  gap: .5rem;
  justify-content: center;
}

/* 沒選賽事時自動隱藏 */
.qr-share-fab[hidden] { display: none; }

/* ============================================================
   37. MEMBER BADGES（成就徽章 v1，8 枚）
   用於 members.html 個人檔案「成就徽章」tab
   namespace: .mbadge-* 避免與既有 .badge 衝突
   ============================================================ */

.mbadge-tab-count {
  font-size: .78rem;
  opacity: .7;
  margin-left: .2rem;
}

.mbadge-summary {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  padding: .75rem 0 1rem;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  margin-bottom: 1rem;
}
.mbadge-summary__main {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--color-primary);
}
.mbadge-summary__sub {
  font-size: .85rem;
  color: var(--color-text-muted);
}

.mbadge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 1.2rem .6rem;
  padding: .75rem 0 1.25rem;
}

.mbadge-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .3rem;
  padding: .75rem .3rem .6rem;
  border-radius: .8rem;
  transition: transform .18s ease-out, background .18s;
  cursor: pointer;
  position: relative;
}

.mbadge-cell__img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 50%;
  padding: 3px;
  transition: transform .25s ease-out, filter .18s, box-shadow .25s;
  will-change: transform;
}
.mbadge-cell__name {
  font-size: .88rem;
  font-weight: 600;
  color: var(--color-text, #1f2937);
  line-height: 1.2;
}
.mbadge-cell__points {
  font-size: .72rem;
  color: var(--color-text-muted);
  letter-spacing: .02em;
}

/* ── Hover: lift + scale + slight rotate (only unlocked) ── */
.mbadge-cell:not(.mbadge-cell--locked):hover { transform: translateY(-3px); }
.mbadge-cell:not(.mbadge-cell--locked):hover .mbadge-cell__img {
  transform: scale(1.10) rotate(-4deg);
}

/* ── Unlocked: bold halo background by rarity ── */
.mbadge-cell--common:not(.mbadge-cell--locked) {
  background: radial-gradient(circle at 50% 45%, rgba(156,163,175,.25), transparent 70%);
}
.mbadge-cell--rare:not(.mbadge-cell--locked) {
  background: radial-gradient(circle at 50% 45%, rgba(59,130,246,.28), transparent 70%);
}
.mbadge-cell--epic:not(.mbadge-cell--locked) {
  background: radial-gradient(circle at 50% 45%, rgba(139,92,246,.32), transparent 70%);
}
.mbadge-cell--legendary:not(.mbadge-cell--locked) {
  background: radial-gradient(circle at 50% 45%, rgba(251,191,36,.38), transparent 70%);
}

/* ── Rarity rings (base, unlocked) ── */
.mbadge-cell--common:not(.mbadge-cell--locked)    .mbadge-cell__img { box-shadow: 0 0 0 3px #9ca3af, 0 0 10px rgba(156,163,175,.5); }
.mbadge-cell--rare:not(.mbadge-cell--locked)      .mbadge-cell__img { box-shadow: 0 0 0 3px #3b82f6, 0 0 14px rgba(59,130,246,.7); }
.mbadge-cell--epic:not(.mbadge-cell--locked)      .mbadge-cell__img { box-shadow: 0 0 0 3px #8b5cf6, 0 0 16px rgba(139,92,246,.75); }
.mbadge-cell--legendary:not(.mbadge-cell--locked) .mbadge-cell__img { box-shadow: 0 0 0 3px #f59e0b, 0 0 20px #fbbf24, 0 0 40px rgba(245,158,11,.6); }

/* ── Legendary: breathing gold pulse ── */
@keyframes mbadge-legendary-pulse {
  0%, 100% { box-shadow: 0 0 0 3px #f59e0b, 0 0 20px #fbbf24, 0 0 40px rgba(245,158,11,.55); }
  50%      { box-shadow: 0 0 0 4px #fbbf24, 0 0 32px #fcd34d, 0 0 60px rgba(251,191,36,.85); }
}
.mbadge-cell--legendary:not(.mbadge-cell--locked) .mbadge-cell__img {
  animation: mbadge-legendary-pulse 2.4s ease-in-out infinite;
}

/* ── Epic: slow purple pulse ── */
@keyframes mbadge-epic-pulse {
  0%, 100% { box-shadow: 0 0 0 3px #8b5cf6, 0 0 16px rgba(139,92,246,.7); }
  50%      { box-shadow: 0 0 0 3px #a78bfa, 0 0 26px rgba(167,139,250,.95); }
}
.mbadge-cell--epic:not(.mbadge-cell--locked) .mbadge-cell__img {
  animation: mbadge-epic-pulse 3.2s ease-in-out infinite;
}

/* ── Locked — fully desaturated + no halo ── */
.mbadge-cell--locked { cursor: default; opacity: .7; }
.mbadge-cell--locked .mbadge-cell__img {
  filter: grayscale(1) opacity(.28);
  box-shadow: 0 0 0 1px rgba(156,163,175,.35);
}
.mbadge-cell--locked .mbadge-cell__name { color: var(--color-text-muted); }

/* ── Tap modal (click a badge to enlarge) ── */
.mbadge-modal {
  position: fixed; inset: 0; z-index: 220;
  background: rgba(0,0,0,.72);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  animation: mbadge-fade-in .2s ease-out;
}
@keyframes mbadge-fade-in { from { opacity: 0; } to { opacity: 1; } }
.mbadge-modal__card {
  background: var(--color-surface, #fff);
  border-radius: 1.2rem;
  padding: 2rem 1.5rem 1.5rem;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,.45);
  animation: mbadge-pop-in .28s cubic-bezier(.18,1.2,.4,1);
}
@keyframes mbadge-pop-in {
  from { transform: scale(.7); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}
.mbadge-modal__img {
  width: 160px; height: 160px; object-fit: contain;
  border-radius: 50%;
  margin: 0 auto 1rem;
}
.mbadge-modal__img--common    { box-shadow: 0 0 0 4px #9ca3af, 0 0 30px rgba(156,163,175,.5); }
.mbadge-modal__img--rare      { box-shadow: 0 0 0 4px #3b82f6, 0 0 36px rgba(59,130,246,.75); }
.mbadge-modal__img--epic      { box-shadow: 0 0 0 4px #8b5cf6, 0 0 40px rgba(139,92,246,.8);  animation: mbadge-epic-pulse 3.2s ease-in-out infinite; }
.mbadge-modal__img--legendary { box-shadow: 0 0 0 4px #f59e0b, 0 0 50px #fbbf24, 0 0 100px rgba(245,158,11,.7); animation: mbadge-legendary-pulse 2.4s ease-in-out infinite; }
.mbadge-modal__img--locked { filter: grayscale(1) opacity(.45); box-shadow: 0 0 0 2px rgba(156,163,175,.4); animation: none; }
.mbadge-modal__name {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--color-primary);
  margin: 0 0 .25rem;
}
.mbadge-modal__rarity {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  padding: .15rem .6rem;
  border-radius: 999px;
  margin-bottom: .75rem;
  text-transform: uppercase;
}
.mbadge-modal__rarity--common    { background: rgba(156,163,175,.2); color: #6b7280; }
.mbadge-modal__rarity--rare      { background: rgba(59,130,246,.18);  color: #2563eb; }
.mbadge-modal__rarity--epic      { background: rgba(139,92,246,.22);  color: #7c3aed; }
.mbadge-modal__rarity--legendary { background: rgba(245,158,11,.22);  color: #b45309; }
.mbadge-modal__desc {
  font-size: .95rem;
  color: var(--color-text, #374151);
  line-height: 1.5;
  margin-bottom: .5rem;
}
.mbadge-modal__earned {
  font-size: .82rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}
.mbadge-modal__locked {
  font-size: .85rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: 1rem;
}
.mbadge-modal__close {
  width: 100%;
  padding: .6rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: .5rem;
  font-weight: 600;
  cursor: pointer;
  font-size: .95rem;
}
.mbadge-modal__close:hover { filter: brightness(1.08); }

/* Mobile tighter */
@media (max-width: 480px) {
  .mbadge-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 1rem .4rem; }
  .mbadge-cell__img { width: 64px; height: 64px; }
  .mbadge-cell__name { font-size: .8rem; }
  .mbadge-modal__img { width: 128px; height: 128px; }
  .mbadge-modal__name { font-size: 1.25rem; }
}

/* members.html top tab bar — nowrap row so 登入/登出 stays right of tabs.
   Tabs container scrolls horizontally if too many tabs to fit. */
.page-tabbar {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: nowrap;
  margin-bottom: 1rem;
  min-width: 0;
}
@media (max-width: 600px) {
  /* 手機:縮小 tab padding + 字體, 4 個 tab 較容易單行擠下 */
  .page-tabbar .tabs__tab { padding: .55rem .65rem; font-size: .82rem; }
}
@media (max-width: 380px) {
  .page-tabbar .tabs__tab { padding: .5rem .5rem; font-size: .78rem; gap: .25rem; }
  .page-tabbar #page-auth-btns .btn { padding: .35rem .65rem; font-size: .78rem; }
}

/* ============================================================================
 * "LANE SCORE" — bowling-themed editorial design system (v0.33.0)
 *
 * Aesthetic: modern sports magazine × vintage bowling alley scoreboard.
 * Three pillars:
 *   1. Numbers as architecture — Chakra Petch hero scale, tabular nums
 *   2. Lane & Pin DNA — diagonal stripe motif, pin-triangle dots
 *   3. Indigo + amber dichotomy — light cards / dark trend scoreboard
 *
 * Used on: Member home cards (P0), Calendar (P0), Trend chart (P1).
 * ============================================================================
 */

/* ---- Lane stripe pattern (reusable corner ornament) ---- */
@keyframes ls-shine {
  0%, 100% { opacity: .55; }
  50%      { opacity: .9;  }
}
@keyframes ls-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(217, 119, 6, .55); }
  70%  { box-shadow: 0 0 0 8px rgba(217, 119, 6, 0);    }
  100% { box-shadow: 0 0 0 0   rgba(217, 119, 6, 0);    }
}
@keyframes ls-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ========================================================================== */
/* Home Cards — editorial sports cards with hero numerics                     */
/* ========================================================================== */
.home-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 1.5rem 1.6rem 1.4rem;
  margin-bottom: 1.1rem;
  box-shadow: 0 1px 2px rgba(13, 18, 87, .04), 0 4px 16px -8px rgba(13, 18, 87, .12);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease;
  animation: ls-fade-up .5s cubic-bezier(.2,.8,.2,1) both;
}
.home-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(13, 18, 87, .06), 0 16px 36px -16px rgba(13, 18, 87, .25);
}

/* Diagonal lane stripes — bottom-right ornament. Indigo on latest card. */
.home-card__lanes {
  position: absolute;
  right: -40px; bottom: -40px;
  width: 220px; height: 220px;
  background:
    repeating-linear-gradient(
      -42deg,
      rgba(26, 35, 126, 0.045) 0 12px,
      transparent           12px 28px
    );
  pointer-events: none;
  border-radius: 50%;
  mask-image: radial-gradient(circle at 30% 30%, transparent 0, #000 65%);
}
.home-card__lanes--alt {
  background:
    repeating-linear-gradient(
      -42deg,
      rgba(217, 119, 6, 0.07) 0 10px,
      transparent          10px 24px
    );
}

/* Top-left corner mark (◤ glyph as a tiny editorial detail) */
.home-card__corner {
  position: absolute;
  top: 0; left: 0;
  width: 22px; height: 22px;
  background: linear-gradient(135deg, var(--color-primary) 0% 50%, transparent 50%);
  border-top-left-radius: 14px;
  pointer-events: none;
}
.home-card__corner--alt { background: linear-gradient(135deg, #d97706 0% 50%, transparent 50%); }

/* Header row: eyebrow with pin triangle + date stamp */
.home-card__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; margin-bottom: .65rem;
  position: relative; z-index: 1;
}
.home-card__eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .14em;
  color: var(--color-primary);
}
/* Pin-triangle dot cluster: 4 dots arranged 1-2-1 (compressed pin formation) */
.home-card__pins {
  display: inline-grid;
  grid-template-columns: repeat(2, 5px);
  grid-template-rows: repeat(3, 5px);
  gap: 2px;
  align-items: center;
}
.home-card__pins i {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--color-primary);
}
.home-card__pins i:nth-child(1) { grid-column: 1 / span 2; justify-self: center; }
.home-card__pins i:nth-child(2) { grid-column: 1; grid-row: 2; }
.home-card__pins i:nth-child(3) { grid-column: 2; grid-row: 2; }
.home-card__pins i:nth-child(4) { grid-column: 1 / span 2; grid-row: 3; justify-self: center; }
.home-card--month .home-card__pins i,
.home-card__corner--alt ~ * .home-card__pins i { background: #d97706; }
.home-card--month .home-card__eyebrow { color: #b45309; }

/* Date stamp — monospace editorial timestamp */
.home-card__stamp {
  font-family: 'Chakra Petch', ui-monospace, 'Consolas', monospace;
  font-size: .72rem;
  font-weight: 600;
  color: var(--color-text-light);
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}

/* Game name as a real headline */
.home-card__game {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 .15rem;
  letter-spacing: -.01em;
  position: relative; z-index: 1;
}
.home-card__game a {
  color: var(--color-primary-dark);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size .3s ease;
}
.home-card__game a:hover { background-size: 100% 1px; text-decoration: none; }

.home-card__place {
  color: var(--color-text-muted);
  font-size: .8rem;
  margin-bottom: 1.4rem;
  position: relative; z-index: 1;
}

/* Hero metric block — split into two: big number + medal/rank ring */
.home-card__hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1.5rem;
  position: relative; z-index: 1;
}
.home-card__hero--month {
  grid-template-columns: 1fr;
  margin-bottom: .9rem;
}
.home-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.home-hero__num {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 4.4rem;
  font-weight: 700;
  line-height: .92;
  letter-spacing: -.04em;
  color: var(--color-primary-dark);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}
.home-hero__num--month { color: var(--color-primary); }
.home-hero__lbl {
  margin-top: .55rem;
  display: flex; flex-direction: column;
  font-size: .7rem;
  line-height: 1.35;
  font-family: 'Chakra Petch', system-ui, sans-serif;
}
.home-hero__lbl b {
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--color-primary);
}
.home-hero__lbl i {
  font-style: normal;
  font-weight: 500;
  color: var(--color-text-light);
  font-size: .72rem;
}

/* Rank medal — circular ring with number, top-3 get gold/silver/bronze */
.home-rank {
  display: flex; flex-direction: column; align-items: center;
  gap: .55rem;
}
.home-rank__ring {
  position: relative;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: conic-gradient(var(--color-primary) calc(var(--pct, 50) * 1%), rgba(13, 18, 87, .08) 0);
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.06);
}
.home-rank__ring::before {
  content: '';
  position: absolute; inset: 6px;
  border-radius: 50%;
  background: #fff;
}
.home-rank__num {
  position: relative;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.home-rank__lbl {
  display: flex; flex-direction: column; align-items: center;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: .68rem;
}
.home-rank__lbl b { font-weight: 700; letter-spacing: .14em; color: var(--color-primary); }
.home-rank__lbl i { font-style: normal; color: var(--color-text-light); font-size: .68rem; margin-top: 2px; }

.home-rank--gold .home-rank__ring   { background: conic-gradient(#f59e0b, #fcd34d, #f59e0b); }
.home-rank--gold .home-rank__num    { color: #b45309; }
.home-rank--silver .home-rank__ring { background: conic-gradient(#9ca3af, #e5e7eb, #9ca3af); }
.home-rank--silver .home-rank__num  { color: #4b5563; }
.home-rank--bronze .home-rank__ring { background: conic-gradient(#cd8547, #ffdcb6, #cd8547); }
.home-rank--bronze .home-rank__num  { color: #92400e; }
.home-rank--gold .home-rank__ring::after,
.home-rank--silver .home-rank__ring::after,
.home-rank--bronze .home-rank__ring::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: linear-gradient(120deg, transparent 40%, rgba(255,255,255,.55) 50%, transparent 60%);
  animation: hero-medal-shine 4s ease-in-out infinite;
  pointer-events: none;
}

/* Diff chip — big arrow with delta */
.home-diff {
  margin-top: .65rem;
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: .82rem;
  font-weight: 700;
  padding: .25rem .6rem;
  border-radius: 999px;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}
.home-diff small {
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .08em;
  opacity: .7;
}
.home-diff--up   { background: rgba(21, 128, 61, .1);  color: #15803d; }
.home-diff--down { background: rgba(185, 28, 28, .1);  color: #b91c1c; }
.home-diff--flat { background: rgba(107, 114, 128, .12); color: #6b7280; }

/* Mini stats — 2-column row for month card secondary metrics */
.home-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .9rem;
  margin-top: .5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}
.home-mini__cell {
  display: flex; flex-direction: column;
}
.home-mini__num {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.home-mini__num a { color: inherit; }
.home-mini__num a:hover { color: #d97706; }
.home-mini__num--accent { color: #d97706; }
.home-mini__num--strike {
  color: #b45309;
  text-shadow: 0 0 18px rgba(245, 158, 11, .4);
}
.home-mini__lbl {
  margin-top: .4rem;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: .68rem;
  font-weight: 600;
  color: var(--color-text-light);
  letter-spacing: .12em;
}

/* Footer line */
.home-card__sub {
  margin-top: 1rem;
  padding: .55rem .75rem;
  background: rgba(26, 35, 126, .03);
  border-radius: 6px;
  display: flex; align-items: baseline; justify-content: space-between;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  position: relative; z-index: 1;
}
.home-card__sub-lbl {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--color-text-light);
}
.home-card__sub-val {
  font-size: .82rem;
  font-weight: 600;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* Loading + empty states */
.home-card__loading { text-align: center; padding: 2rem 0; }
.home-card__empty {
  text-align: center; padding: 1.5rem 0;
  color: var(--color-text-muted);
}
/* Flex per-row layout: rows auto-center via align-items, no transform conflicts */
.home-card__empty-pins {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: .35rem auto 1rem;
}
.home-card__empty-pins-row {
  display: flex;
  gap: 4px;
}
.home-card__empty-pins span {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: rgba(26, 35, 126, .15);
}
.home-card__empty-title { font-weight: 700; color: var(--color-text); margin-bottom: .35rem; }
.home-card__empty-hint { font-size: .85rem; max-width: 28em; margin: 0 auto; }

/* Tablet & mobile — scale numbers down, restack hero block */
@media (max-width: 600px) {
  .home-card { padding: 1.2rem 1.2rem 1.1rem; }
  .home-hero__num { font-size: 3.4rem; }
  .home-card__game { font-size: 1.05rem; }
  .home-card__hero { gap: 1rem; }
  .home-rank__ring { width: 64px; height: 64px; }
  .home-rank__num { font-size: 1.45rem; }
  .home-mini__num { font-size: 1.5rem; }
}
@media (max-width: 380px) {
  .home-card__hero { grid-template-columns: 1fr; }
  .home-rank { flex-direction: row; justify-content: flex-start; gap: .9rem; }
  .home-rank__lbl { align-items: flex-start; }
}

/* ========================================================================== */
/* Calendar — score plates with strike-zone tiering                           */
/* ========================================================================== */
.calendar {
  padding: 1.25rem 1.5rem 1.4rem;
  background: linear-gradient(180deg, #fafbff 0%, #f5f6fa 100%);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}
.calendar::before {
  /* subtle lane-stripe top accent */
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-primary) 25%, var(--color-primary) 75%, transparent);
}

.calendar__header {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; margin-bottom: 1rem;
}
.calendar__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  color: var(--color-primary-dark);
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
/* nav buttons override (override generic .btn--outline) */
#cal-prev, #cal-next {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .2s cubic-bezier(.2,.8,.2,1);
}
#cal-prev:hover, #cal-next:hover {
  background: var(--color-primary);
  color: #fff;
  transform: scale(1.06);
  border-color: var(--color-primary);
}

.calendar__weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--color-text-muted);
  padding-bottom: .5rem; margin-bottom: .5rem;
  border-bottom: 1px solid var(--color-border);
}
.calendar__weekdays span:first-child,
.calendar__weekdays span:last-child { color: var(--color-primary); }

.calendar__grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar__day {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 8px;
  padding: 5px 6px 4px;
  display: flex; flex-direction: column; align-items: stretch;
  font-size: .78rem;
  cursor: pointer;
  overflow: hidden;
  transition:
    transform .25s cubic-bezier(.2,.8,.2,1),
    background .25s ease,
    border-color .25s ease,
    box-shadow .25s ease;
}
.calendar__day--empty {
  border: none; background: transparent; cursor: default; box-shadow: none;
}
.calendar__day:disabled { cursor: default; }

/* Has-game: subtle indigo gradient + tactile feel */
.calendar__day--has-game {
  background: linear-gradient(155deg, #ffffff 0%, #eef0fb 100%);
  border-color: rgba(26, 35, 126, .14);
  box-shadow: inset 0 -1px 0 rgba(26, 35, 126, .06);
}
.calendar__day--has-game:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: var(--color-primary);
  box-shadow: 0 6px 14px -6px rgba(26, 35, 126, .35);
  z-index: 2;
}

/* Accent: 200+ amber tint */
.calendar__day--accent {
  background: linear-gradient(155deg, #fffbf0 0%, #fef3c7 100%);
  border-color: rgba(217, 119, 6, .25);
}
.calendar__day--accent:hover { border-color: #d97706; box-shadow: 0 6px 14px -6px rgba(217, 119, 6, .4); }

/* Strike zone: 250+ — full amber gradient, the rare moment */
.calendar__day--strike {
  background: linear-gradient(155deg, #fef3c7 0%, #fcd34d 100%);
  border-color: #d97706;
  box-shadow: 0 0 0 1px rgba(217, 119, 6, .35), inset 0 -1px 0 rgba(180, 83, 9, .25);
}
.calendar__day--strike .calendar__day-num { color: #92400e; }
.calendar__day--strike .calendar__day-high { color: #78350f; text-shadow: 0 1px 0 rgba(255,255,255,.5); }
.calendar__day--strike .calendar__day-stripe {
  background: linear-gradient(90deg, transparent, #b45309 50%, transparent);
}

/* Today: amber ring + pulse */
.calendar__day--today {
  border: 2px solid #d97706;
  animation: ls-pulse 2.4s ease-out infinite;
}
.calendar__day--today .calendar__day-num {
  color: #b45309;
  font-weight: 800;
}

.calendar__day-num {
  font-weight: 600;
  color: var(--color-text-muted);
  text-align: left;
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.calendar__day-high {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  text-align: center;
  margin-top: auto;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.calendar__day-count {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 16px;
  padding: 1px 4px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: .58rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.calendar__day--strike .calendar__day-count,
.calendar__day--accent .calendar__day-count { background: #d97706; }

/* Bottom lane stripe — bowling lane mark */
.calendar__day-stripe {
  position: absolute;
  left: 18%; right: 18%;
  bottom: 3px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(26, 35, 126, .35) 50%, transparent);
  border-radius: 2px;
}

/* Desktop-only per-game rows (CSS @media >=601px 顯示; mobile 段藏掉走 legacy day-high)
   每場一組: 賽事名 (小字 ellipsis) + 高分/總分 (Chakra Petch tabular)。多場時 cell
   自然垂直增高, CSS Grid 同 row 對齊。aspect-ratio:1 在桌面解除避免擠壓。 */
.calendar__day-game {
  padding: 3px 0 2px;
  border-top: 1px dashed rgba(26, 35, 126, .14);
  display: flex; flex-direction: column; gap: 0;
}
.calendar__day-game:first-of-type { border-top: none; padding-top: 4px; margin-top: 2px; }
.calendar__day-game-name {
  font-size: .65rem; font-weight: 600;
  color: var(--color-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -.01em; line-height: 1.15;
}
.calendar__day-game-score {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: .82rem; font-weight: 700;
  color: var(--color-primary-dark);
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1.05;
}
.calendar__day-game-score i {
  font-style: normal;
  color: var(--color-text-muted);
  font-weight: 400;
  margin: 0 .15rem;
}
.calendar__day--strike .calendar__day-game-score { color: #78350f; }
.calendar__day--accent .calendar__day-game-score { color: #92400e; }

/* Desktop: per-game rows 顯示時, hide legacy 單一大字 day-high; 解除 aspect-ratio
   讓 cell 隨內容增高 (同 row CSS Grid 自動對齊到最高那個)。用 sibling combinator
   `~` 而非 :has() 兼容性更穩 — day-game 在 DOM 出現於 day-high 之前, 所以
   只要該 day 有 game (即 has-game class) 就會 match。 */
@media (min-width: 601px) {
  .calendar__day-game ~ .calendar__day-high { display: none; }
  .calendar__day { aspect-ratio: auto; min-height: 88px; }
}

.calendar__loading, .calendar__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 0;
  color: var(--color-text-light);
}

/* Day detail — light ticket-stub list (matches members page palette) */
.calendar__day-detail {
  margin-top: 1.4rem;
  background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem 1.2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(13, 18, 87, .04), 0 4px 14px -10px rgba(13, 18, 87, .15);
  animation: ls-fade-up .35s cubic-bezier(.2,.8,.2,1) both;
}
.calendar__day-detail::before {
  /* perforated edge feel — dotted top edge over indigo→amber gradient */
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background:
    radial-gradient(circle at 6px 50%, transparent 2px, #ffffff 2.5px) 0 0 / 12px 4px,
    linear-gradient(90deg, var(--color-primary) 0%, #d97706 100%);
}

.day-detail__head {
  display: flex; align-items: baseline; gap: .65rem;
  margin-bottom: 1rem;
  padding-bottom: .9rem;
  border-bottom: 1px dashed var(--color-border);
}
.day-detail__date {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #b45309;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.day-detail__year {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: .82rem;
  font-weight: 600;
  color: var(--color-text-light);
  letter-spacing: .08em;
}
.day-detail__count {
  margin-left: auto;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--color-primary);
  padding: .25rem .6rem;
  border: 1px solid rgba(26, 35, 126, .2);
  background: rgba(26, 35, 126, .04);
  border-radius: 999px;
}

.day-detail__list { display: flex; flex-direction: column; gap: .55rem; }

.day-detail__item {
  display: grid;
  grid-template-columns: 4px 1fr auto;
  align-items: center;
  gap: 0 .9rem;
  padding: .7rem .9rem .7rem .55rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.day-detail__item:hover {
  background: #fafbff;
  border-color: rgba(217, 119, 6, .35);
  transform: translateX(2px);
  box-shadow: 0 4px 10px -6px rgba(13, 18, 87, .15);
  text-decoration: none;
}
.day-detail__perf {
  width: 4px; height: 30px;
  background: linear-gradient(180deg, var(--color-primary), #d97706);
  border-radius: 2px;
  align-self: center;
}
.day-detail__body { min-width: 0; }
.day-detail__name {
  font-weight: 600;
  color: var(--color-primary-dark);
  font-size: .94rem;
  margin-bottom: .15rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.day-detail__meta {
  font-size: .72rem;
  color: var(--color-text-muted);
  letter-spacing: .02em;
}
.day-detail__nums {
  display: grid;
  grid-template-columns: auto;
  text-align: right;
  align-items: baseline;
  row-gap: 1px;
}
.day-detail__hs {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.day-detail__hs--accent { color: #d97706; }
.day-detail__hs--strike {
  color: #b45309;
  text-shadow: 0 0 14px rgba(245, 158, 11, .35);
}
.day-detail__hs-lbl {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--color-text-light);
  margin-top: 1px;
}
.day-detail__total {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: .72rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  margin-top: 5px;
}

/* Mobile calendar — give the 7-col grid maximum horizontal room.
   Multiple wrappers were stealing space: .container > .container > .tabs__panel
   (1.5rem) > .calendar (1.5rem) = ~6rem of side padding before the grid even
   starts. On 360px viewport the day cells were squeezed to ~32px. */
@media (max-width: 600px) {
  /* Tighten ALL profile sub-tab padding so 月曆 / 趨勢 / 參賽紀錄 / 徽章 all get breathing room */
  .member-profile .tabs        { padding: 0 .6rem; }
  .member-profile .tabs__panel { padding: 1rem .55rem; }
  .mp-plan-breakdown           { padding-left: .8rem; padding-right: .8rem; }

  .calendar { padding: .9rem .55rem 1.1rem; border-radius: 10px; }
  .calendar__header { margin-bottom: .8rem; }
  .calendar__weekdays {
    font-size: .68rem; letter-spacing: .08em;
    padding-bottom: .4rem; margin-bottom: .4rem;
  }
  .calendar__grid { gap: 4px; }
  .calendar__day {
    padding: 3px 2px 2px; border-radius: 5px;
  }
  .calendar__day-num {
    font-size: .6rem; line-height: 1;
    letter-spacing: 0;
  }
  .calendar__day-high {
    font-size: .95rem; letter-spacing: -.03em;
  }
  /* Count badge hidden on mobile — too tight; click opens抽屜 with full list anyway */
  .calendar__day-count { display: none; }
  /* Per-game rows 桌面才顯示, 手機格子塞不下 — fallback 走 legacy day-high 大字 */
  .calendar__day-game { display: none; }
  .calendar__day-stripe { left: 14%; right: 14%; bottom: 2px; }
  .day-detail__date { font-size: 1.3rem; }
  .day-detail__hs { font-size: 1.3rem; }
}
@media (max-width: 380px) {
  .calendar { padding: .8rem .35rem 1rem; }
  .calendar__grid { gap: 3px; }
  .calendar__day { padding: 2px 1px; }
  .calendar__day-num { font-size: .55rem; }
  .calendar__day-high { font-size: .85rem; }
  .calendar__day-stripe { display: none; }
}

/* ========================================================================== */
/* Trend Chart — light editorial (matches members page palette)               */
/* ========================================================================== */
.trend {
  background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 1.4rem 1.5rem 1.5rem;
  color: var(--color-text);
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(13, 18, 87, .04), 0 4px 14px -10px rgba(13, 18, 87, .15);
}
.trend::before {
  /* indigo→amber hairline top accent */
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-primary) 30%, #d97706 70%, transparent);
}

.trend__header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: .75rem; margin-bottom: 1.2rem; flex-wrap: wrap;
}
.trend__title { display: flex; flex-direction: column; gap: 2px; }
.trend__title-eyebrow {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .18em;
  color: #b45309;
}
.trend__title-main {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--color-primary-dark);
}

/* Range buttons — pill group on light bg */
.trend__range {
  display: inline-flex; gap: 0;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 3px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(13, 18, 87, .04);
}
.trend__range-btn {
  padding: .4rem .85rem;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: .78rem;
  font-weight: 600;
  background: transparent;
  color: var(--color-text-muted);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease;
  letter-spacing: .04em;
  position: relative;
}
.trend__range-btn span {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: .9rem;
  margin-right: 2px;
}
.trend__range-btn:hover:not(.trend__range-btn--active) {
  color: var(--color-primary-dark);
  background: rgba(26, 35, 126, .05);
}
.trend__range-btn--active {
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgba(26, 35, 126, .3), inset 0 1px 0 rgba(255, 255, 255, .12);
}

/* Stat strip ABOVE chart — gives chart context */
.trend__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.1rem;
  padding: 1rem 1.1rem;
  background: rgba(26, 35, 126, .03);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}
.trend-stat {
  display: flex; flex-direction: column; gap: .25rem;
  position: relative;
}
.trend-stat + .trend-stat::before {
  content: '';
  position: absolute;
  left: -.5rem; top: 50%; transform: translateY(-50%);
  width: 1px; height: 70%;
  background: var(--color-border);
}
.trend-stat__lbl {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--color-text-light);
}
.trend-stat__num {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.trend-stat--accent .trend-stat__num {
  color: #b45309;
  text-shadow: 0 0 14px rgba(245, 158, 11, .35);
}
.trend-stat__sub {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: .7rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.trend-stat__sub--up   { color: #15803d; }
.trend-stat__sub--down { color: #b91c1c; }

.trend__canvas-wrap {
  position: relative;
  height: 360px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: .9rem .75rem .55rem;
  overflow: hidden;
}
/* Vertical lane lines under canvas — adds subtle depth */
.trend__lanes {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0 calc(20% - 1px),
    rgba(26, 35, 126, .035) calc(20% - 1px) 20%
  );
  pointer-events: none;
}
.trend__canvas-wrap canvas { width: 100% !important; height: 100% !important; position: relative; z-index: 1; }

.trend__loading, .trend__empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .9);
  color: var(--color-text-muted);
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: .9rem;
  letter-spacing: .04em;
  z-index: 2;
}

.trend__hint {
  margin: .85rem 0 0;
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-size: .72rem;
  color: var(--color-text-light);
  text-align: center;
  letter-spacing: .04em;
}
.trend__hint span { color: #d97706; margin-right: .25rem; }

@media (max-width: 600px) {
  .trend { padding: 1.1rem 1rem 1.2rem; border-radius: 12px; }
  .trend__title-main { font-size: 1.15rem; }
  .trend__stats { grid-template-columns: repeat(3, 1fr); gap: .5rem; padding: .8rem .7rem; }
  .trend-stat__num { font-size: 1.45rem; }
  .trend-stat__lbl { font-size: .55rem; letter-spacing: .12em; }
  .trend-stat__sub { font-size: .62rem; }
  .trend-stat + .trend-stat::before { left: -.3rem; }
  .trend__canvas-wrap { height: 280px; padding: .6rem .4rem .3rem; }
  .trend__range-btn { padding: .35rem .65rem; font-size: .72rem; }
  .trend__range-btn span { font-size: .82rem; }
}
@media (max-width: 380px) {
  .trend__stats { grid-template-columns: 1fr 1fr; }
  .trend-stat:nth-child(3) { display: none; }
}

/* ── Home Feed (P1b F4) ──────────────────────────────────── */
/* 沿用 Lane Score 亮調 + indigo/amber 雙色, 跟 home-card / trend 同語彙。 */
.home-feed {
  background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 1.2rem 1.5rem 1.5rem;
  margin-top: 1.25rem;
  box-shadow: 0 1px 2px rgba(13, 18, 87, .04), 0 6px 20px -10px rgba(13, 18, 87, .12);
}
.home-feed__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: .75rem; margin-bottom: 1rem;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: .65rem;
}
.home-feed__title {
  margin: 0; font-size: 1.05rem; font-weight: 800;
  color: var(--color-primary); letter-spacing: .02em;
}
.home-feed__sub {
  font-size: .75rem; color: var(--color-text-muted);
  letter-spacing: .04em; text-transform: uppercase;
}
.home-feed__list { display: flex; flex-direction: column; gap: .75rem; }

/* Source tabs (Batch 3) — 全部 / 會員 / 主辦方 — pill row */
.home-feed__tabs {
  display: flex; gap: .35rem;
  margin: 0 0 .85rem;
  padding-bottom: .65rem;
  border-bottom: 1px dashed var(--color-border);
  flex-wrap: wrap;
}
.home-feed__tab {
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text-muted);
  font-size: .78rem; font-weight: 600;
  padding: .3rem .85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition);
}
.home-feed__tab:hover { color: var(--color-primary); border-color: rgba(26, 35, 126, .35); }
.home-feed__tab--active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.home-feed__tab--active:hover { color: #fff; }

.home-feed__item {
  display: flex; gap: .85rem;
  padding: .85rem 1rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.home-feed__item:hover {
  transform: translateY(-1px);
  border-color: rgba(26, 35, 126, .25);
  box-shadow: 0 1px 2px rgba(13, 18, 87, .04), 0 8px 20px -10px rgba(13, 18, 87, .18);
}
.home-feed__avatar-link { flex-shrink: 0; line-height: 0; }
.home-feed__avatar {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; background: #f3f4f6;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--color-border);
}
.home-feed__body { flex: 1; min-width: 0; }
.home-feed__line1 {
  display: flex; align-items: baseline; gap: .35rem;
  font-size: .9rem; margin-bottom: .15rem;
}
.home-feed__actor { font-weight: 700; color: var(--color-primary); text-decoration: none; }
.home-feed__actor:hover { text-decoration: underline; }
.home-feed__verb { color: var(--color-text-muted); font-size: .82rem; }
.home-feed__game {
  display: block; font-size: 1rem; font-weight: 700;
  color: var(--color-text); text-decoration: none;
  margin: .1rem 0 .05rem;
}
.home-feed__game:hover { color: var(--color-primary); text-decoration: underline; }
.home-feed__place { font-size: .78rem; color: var(--color-text-muted); margin-bottom: .5rem; }
.home-feed__stats {
  display: flex; gap: .9rem; flex-wrap: wrap;
  padding-top: .35rem;
  border-top: 1px dashed var(--color-border);
}
.home-feed__stat {
  display: inline-flex; align-items: baseline; gap: .25rem;
  font-size: .82rem;
}
.home-feed__stat b {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700; font-size: 1.1rem;
  color: var(--color-text);
}
.home-feed__stat i { font-style: normal; color: var(--color-text-muted); font-size: .72rem; }
.home-feed__stat--rank b { color: var(--color-text-muted); }
.home-feed__stat--rank.home-feed__rank--gold b { color: #d97706; }
.home-feed__stat--rank.home-feed__rank--silver b { color: #6b7280; }
.home-feed__stat--rank.home-feed__rank--bronze b { color: #92400e; }

.home-feed__when {
  display: block; font-size: .72rem; color: var(--color-text-muted);
  margin-top: .45rem;
}

/* Badge variant — 不放 stats grid, 用 badge row */
.home-feed__item--badge .home-feed__body { display: flex; flex-direction: column; }
.home-feed__badge-row {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .75rem; margin-top: .25rem;
  background: linear-gradient(135deg, rgba(255, 160, 0, .06), rgba(26, 35, 126, .03));
  border-radius: 8px;
  border-left: 3px solid var(--color-accent);
}
.home-feed__badge-img { width: 36px; height: 36px; flex-shrink: 0; }
.home-feed__badge-name { font-weight: 700; color: var(--color-text); flex: 1; }
.home-feed__badge-rarity {
  font-size: .68rem; padding: .15rem .45rem; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .04em; font-weight: 700;
}
.home-feed__badge-rarity--common    { background: rgba(107, 114, 128, .15); color: #4b5563; }
.home-feed__badge-rarity--rare      { background: rgba(26, 35, 126, .12);  color: var(--color-primary); }
.home-feed__badge-rarity--epic      { background: rgba(124, 58, 237, .15); color: #6d28d9; }
.home-feed__badge-rarity--legendary { background: linear-gradient(90deg, #fbbf24, #f59e0b); color: #fff; }

/* Customer event cards (Batch 3) — 🏆 圖示代頭像, indigo→amber 漸層 strip 區隔 member 視覺 */
/* v0.59.9 — customer feed events 套熱粉 pop 第三 accent 做 visual hook
   (區分會員事件 vs 主辦方事件,2 種 feed type 一眼分清) */
.home-feed__item--customer {
  border-left: 3px solid var(--color-pop);
  background: linear-gradient(135deg, #fff 0%, rgba(236, 72, 153, .04) 100%);
}
.home-feed__avatar--customer {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-pop));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--color-border);
  flex-shrink: 0;
}
.home-feed__actor--customer {
  font-weight: 700; color: var(--color-pop-dark);
}
/* v0.59.10 — customer logo 取代原本 🏆 emoji avatar(有設 logo 才用,fallback 仍 🏆) */
.home-feed__avatar--customer-logo {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--color-border), 0 0 0 3px rgba(236, 72, 153, .12);
  flex-shrink: 0;
  background: #fff;
}
.home-feed__sub-info {
  font-size: .82rem; color: var(--color-text);
  margin: .2rem 0 .35rem;
  padding: .25rem 0;
  border-top: 1px dashed var(--color-border);
}

/* Empty + load-more */
.home-feed__empty {
  text-align: center; padding: 2rem 1rem;
  color: var(--color-text-muted);
}
.home-feed__empty-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.home-feed__empty-title { font-weight: 700; color: var(--color-text); margin-bottom: .35rem; }
.home-feed__empty-hint { font-size: .85rem; max-width: 28em; margin: 0 auto .9rem; }
.home-feed__more { text-align: center; margin-top: 1rem; }

/* Mobile */
@media (max-width: 600px) {
  .home-feed { padding: 1rem 1rem 1.2rem; }
  .home-feed__head { flex-direction: column; align-items: flex-start; gap: .15rem; }
  .home-feed__sub { font-size: .68rem; }
  .home-feed__item { padding: .7rem .8rem; gap: .65rem; }
  .home-feed__avatar { width: 38px; height: 38px; }
  .home-feed__avatar--customer { width: 38px; height: 38px; font-size: 1.2rem; }
  .home-feed__stats { gap: .65rem; }
  .home-feed__stat b { font-size: .98rem; }
  .home-feed__tab { font-size: .72rem; padding: .25rem .65rem; }
}

/* ── Follows management panel (P1b F7) ─────────────────────── */
.follows-summary {
  font-size: .9rem; color: var(--color-text-muted);
  padding: .65rem 0 1rem;
  border-bottom: 1px dashed var(--color-border);
  margin-bottom: 1rem;
}
.follows-section-title {
  font-size: .9rem; font-weight: 700;
  color: var(--color-primary);
  margin: 1.2rem 0 .55rem;
  letter-spacing: .02em;
}
.follows-section-title:first-of-type { margin-top: 0; }
.follows-section-count {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: .85rem;
  margin-left: .25rem;
}
.follows-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: .45rem;
}
.follows-list__item {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .75rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: border-color var(--transition);
}
.follows-list__item:hover { border-color: rgba(26, 35, 126, .25); }
.follows-list__link {
  display: flex; align-items: center; gap: .65rem;
  flex: 1; min-width: 0;
  text-decoration: none; color: var(--color-text);
}
.follows-list__link:hover { color: var(--color-primary); text-decoration: none; }
.follows-list__link--customer { cursor: default; color: var(--color-text); }
.follows-list__avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #f3f4f6;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}
.follows-list__avatar--customer {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff; font-size: 1.2rem; border: none;
}
.follows-list__name {
  font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0;
}
.follows-list__unfollow { flex-shrink: 0; white-space: nowrap; }
.follows-list__empty,
.follows-list__loading {
  font-size: .85rem;
  color: var(--color-text-muted);
  text-align: center;
  padding: 1.2rem;
  background: rgba(26, 35, 126, .03);
  border-radius: 8px;
  font-style: italic;
}
@media (max-width: 600px) {
  .follows-list__item { padding: .5rem .6rem; gap: .5rem; }
  .follows-list__avatar { width: 34px; height: 34px; }
  .follows-list__avatar--customer { width: 34px; height: 34px; font-size: 1rem; }
}

/* ========================================================================== */
/*  ORGANIZER GUIDE (organizer-guide.html) — sticky sidebar + chapter content */
/* ========================================================================== */
.og-body { background: #fafbff; }

/* Page header */
.og-pagehead {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff;
  padding: 2.5rem 0 2rem;
  border-bottom: 4px solid var(--color-accent);
}
/* P1 Lane Score DNA — diagonal lane stripes top-right ornament */
.og-pagehead::after {
  content: '';
  position: absolute;
  right: -100px; top: -50px;
  width: 380px; height: 380px;
  background: repeating-linear-gradient(
    -42deg,
    rgba(255, 215, 64, .08) 0 12px,
    transparent              12px 28px
  );
  border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle at 30% 30%, transparent 0, #000 65%);
          mask-image: radial-gradient(circle at 30% 30%, transparent 0, #000 65%);
  pointer-events: none;
}
.og-pagehead > * { position: relative; z-index: 1; }
.og-pagehead__kicker {
  font-family: 'Chakra Petch', sans-serif;
  font-size: .75rem;
  letter-spacing: .18em;
  font-weight: 800;
  color: var(--color-accent-light);
  margin-bottom: .35rem;
}
.og-pagehead__title {
  font-family: 'Chakra Petch', var(--font-sans);
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  font-weight: 800;
  margin: 0 0 .5rem;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.og-pagehead__lede {
  font-size: .95rem; color: rgba(255,255,255,.85);
  max-width: 50em; margin: 0;
  line-height: 1.6;
}

/* Mobile TOC toggle (hidden on desktop) */
.og-toc-toggle {
  display: none;
  position: fixed;
  bottom: 1.2rem; right: 1.2rem;
  /* 280: 高過 navbar (200) 以免被遮; 低過 og-sidebar drawer (300) */
  z-index: 280;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: .65rem 1.1rem;
  font-size: .85rem; font-weight: 700;
  align-items: center; gap: .4rem;
  cursor: pointer;
  box-shadow: 0 6px 20px -6px rgba(13, 18, 87, .5);
}
.og-toc-toggle:hover { background: var(--color-primary-dark); }

/* Shell — flex sidebar + content */
.og-shell {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  padding-top: 2rem;
  padding-bottom: 4rem;
}

/* Sidebar — sticky on desktop */
.og-sidebar {
  flex-shrink: 0;
  width: 240px;
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  align-self: flex-start;
  max-height: calc(100vh - var(--nav-h) - 2rem);
  overflow-y: auto;
}
.og-toc {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 1rem .75rem;
  box-shadow: 0 1px 2px rgba(13, 18, 87, .04), 0 6px 20px -10px rgba(13, 18, 87, .1);
}
.og-toc__list {
  list-style: none; padding: 0; margin: 0 0 .85rem;
  display: flex; flex-direction: column; gap: .15rem;
}
.og-toc__chapter {
  display: flex;
  align-items: baseline;
  gap: .65rem;
  padding: .55rem .75rem;
  font-size: .85rem; font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  border-radius: 6px;
  border-left: 3px solid transparent;
  transition: all .15s ease;
}
.og-toc__chapter:hover {
  background: rgba(26, 35, 126, .05);
  color: var(--color-primary);
  text-decoration: none;
}
.og-toc__chapter--active {
  background: rgba(26, 35, 126, .08);
  color: var(--color-primary);
  border-left-color: var(--color-accent);
  font-weight: 700;
}
/* P1 Lane Score DNA — scoreboard bracket numerals (TOC chapter index chip) */
.og-toc__num {
  flex-shrink: 0;
  font-family: 'Chakra Petch', monospace;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--color-text-light);
  background: rgba(26, 35, 126, .06);
  padding: .15rem .4rem;
  border-radius: 3px;
  min-width: 26px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  transition: all .15s ease;
}
.og-toc__chapter:hover .og-toc__num {
  background: rgba(255, 160, 0, .15);
  color: var(--color-accent-dark);
}
.og-toc__chapter--active .og-toc__num {
  background: var(--color-accent);
  color: var(--color-primary-dark);
  box-shadow: 0 0 0 1px var(--color-accent-dark);
}
.og-toc__name { flex: 1; min-width: 0; }
.og-toc__progress {
  height: 3px;
  background: var(--color-border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: .65rem;
}
.og-toc__progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 999px;
  transition: width .3s ease;
}

/* Content area */
.og-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* Chapter section */
.og-chapter {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 2rem 2.25rem 1.5rem;
  scroll-margin-top: calc(var(--nav-h) + 1rem);
  box-shadow: 0 1px 2px rgba(13, 18, 87, .04);
  /* P1 — fade-in entrance (parallel to .wc-section behavior, JS 觀察器加 .og-in-view) */
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s ease, transform .55s ease;
}
.og-chapter.og-in-view {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .og-chapter { opacity: 1; transform: none; transition: none; }
}
.og-chapter__kicker {
  font-family: 'Chakra Petch', sans-serif;
  font-size: .72rem; letter-spacing: .14em;
  font-weight: 800;
  color: var(--color-accent-dark);
  margin-bottom: .4rem;
}
.og-chapter__title {
  font-size: 1.55rem; font-weight: 800;
  color: var(--color-primary);
  margin: 0 0 .65rem;
  letter-spacing: -.005em;
}
.og-chapter__lede {
  font-size: 1rem; color: var(--color-text);
  margin: 0 0 1.25rem;
  line-height: 1.7;
}
.og-chapter__sec {
  font-size: 1.05rem; font-weight: 700;
  color: var(--color-primary);
  margin: 2rem 0 .55rem;
  padding-left: .65rem;
  padding-top: 1rem;
  border-left: 3px solid var(--color-accent);
  position: relative;
}
/* P1 — perforated newspaper-style section break above each h3 (asymmetric, editorial) */
.og-chapter__sec::before {
  content: '';
  position: absolute;
  left: 0; right: 30%;
  top: 0;
  border-top: 1px dashed var(--color-border);
}
/* First sec after lede or imgbox: no divider (already separated visually) */
.og-chapter__lede + .og-chapter__sec,
.og-imgbox + .og-chapter__sec { padding-top: 0; margin-top: 1.2rem; }
.og-chapter__lede + .og-chapter__sec::before,
.og-imgbox + .og-chapter__sec::before { display: none; }

/* Image box */
.og-imgbox {
  margin: 1rem 0 .5rem;
  border-radius: 10px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid var(--color-border);
  max-width: 720px;
}
.og-imgbox img { display: block; width: 100%; height: auto; }

/* Lists */
.og-list,
.og-flowlist {
  margin: .5rem 0 1rem;
  padding-left: 1.4rem;
  line-height: 1.7;
  color: var(--color-text);
}
.og-list { list-style: disc; }
.og-flowlist { list-style: decimal; }
.og-list li,
.og-flowlist li { margin-bottom: .35rem; font-size: .92rem; }
.og-list strong,
.og-flowlist strong { color: var(--color-primary); }
.og-list code,
.og-flowlist code,
.og-chapter__lede code {
  background: rgba(26, 35, 126, .08);
  padding: .1rem .4rem;
  border-radius: 4px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: .88em;
  color: var(--color-primary-dark);
}

/* Callout */
.og-callout {
  display: flex; gap: .85rem;
  padding: 1rem 1.2rem;
  background: linear-gradient(135deg, rgba(255, 160, 0, .08), rgba(26, 35, 126, .04));
  border-left: 3px solid var(--color-accent);
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0 .5rem;
}
.og-callout__icon { font-size: 1.5rem; flex-shrink: 0; }
.og-callout__body strong {
  color: var(--color-primary);
  display: block;
  margin-bottom: .35rem;
}
.og-callout__body p {
  margin: 0;
  font-size: .9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Prev/Next nav at chapter bottom */
.og-chapter__nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem; padding-top: 1.25rem;
  border-top: 1px dashed var(--color-border);
}
.og-chapter__nav-spacer { flex: 1; }
.og-chapter__nav-btn {
  font-size: .85rem; font-weight: 600;
  padding: .6rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  text-decoration: none;
  transition: all .15s ease;
  white-space: nowrap;
}
.og-chapter__nav-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  text-decoration: none;
  background: rgba(26, 35, 126, .03);
}
.og-chapter__nav-btn--next {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.og-chapter__nav-btn--next:hover {
  background: var(--color-primary-dark);
  color: #fff;
  border-color: var(--color-primary-dark);
}

/* Mobile: sidebar becomes drawer */
@media (max-width: 960px) {
  .og-shell { flex-direction: column; gap: 0; padding-top: 1.25rem; }
  .og-toc-toggle { display: inline-flex; }
  .og-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    max-height: 100vh;
    /* P1 bug fix: navbar 是 z-index 200, drawer 必須蓋過去 (含 navbar 上半部),
       否則 mobile drawer 上面會被 navbar 遮一截看不到頂部 chapter list */
    z-index: 300;
    transform: translateX(-100%);
    transition: transform .25s ease;
    background: #fff;
    box-shadow: 4px 0 20px rgba(13, 18, 87, .15);
    padding: 1rem;
  }
  .og-sidebar--open { transform: translateX(0); }
  .og-toc {
    border: none;
    box-shadow: none;
    padding: 0;
    margin-top: 1rem;
  }
  .og-content { gap: 1.5rem; }
  .og-chapter { padding: 1.5rem 1.4rem 1rem; }
  .og-pagehead { padding: 2rem 0 1.5rem; }
  .og-pagehead__title { font-size: 1.5rem; }
}
@media (max-width: 600px) {
  .og-chapter { padding: 1.25rem 1.1rem .9rem; }
  .og-chapter__title { font-size: 1.3rem; }
  .og-chapter__sec { font-size: .98rem; }
  .og-chapter__nav { flex-direction: column; align-items: stretch; gap: .55rem; }
  .og-chapter__nav-btn { text-align: center; }
  .og-toc-toggle {
    bottom: .85rem; right: .85rem;
    padding: .55rem .9rem; font-size: .78rem;
  }
}

/* ── Dashboard title bar with 「使用指南」link (customers.html) ── */
.dashboard-titlebar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.dashboard-guide-link {
  color: var(--color-primary);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
  padding: .35rem .85rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #fff;
  transition: all .15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.dashboard-guide-link:hover {
  border-color: var(--color-primary);
  background: rgba(26, 35, 126, .04);
  color: var(--color-primary-dark);
  text-decoration: none;
}
@media (max-width: 600px) {
  .dashboard-guide-link { font-size: .78rem; padding: .3rem .65rem; }
}

/* ── §33. STAT HERO CARD (v0.58.2) ─────────────────────────────
   共用「dark navy + 琥珀金 sportsbook hero」card token,
   給 customer-public.html highlights + customers.html stats mode
   (ladder / MVP / progress / newcomer)+ 未來 matchup pair card 用。

   保留既有 .stats-card 給 utility 淺色卡(5 ranking / chip / 未認領)。
   兩個 card 系統:hero (dark) = 可截圖、bragable;utility (light) = 輔助 list。
*/
.stat-hero {
  background: linear-gradient(135deg, #0f1631 0%, #1a237e 100%);
  color: #fff;
  border-radius: 14px;
  padding: 1.1rem 1.35rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(15, 22, 49, .18);
  animation: ls-fade-up .5s cubic-bezier(.2,.8,.2,1) both;
}
.stat-hero::after {
  content: "★";
  position: absolute;
  top: -.5rem;
  right: -.25rem;
  font-size: 4.5rem;
  color: rgba(255, 209, 102, .07);
  font-family: 'Chakra Petch', sans-serif;
  pointer-events: none;
  line-height: 1;
}

.stat-hero__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .9rem;
}
.stat-hero__title-block { min-width: 0; flex: 1; }
.stat-hero__title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: #fff;
  margin: 0 0 .2rem;
  line-height: 1.2;
}
.stat-hero__sub {
  font-size: .78rem;
  color: rgba(255, 255, 255, .58);
  margin: 0;
  line-height: 1.5;
  font-weight: 400;
}

/* Chip(右上角)— 顯示 INNER · N 之類 metadata */
.stat-hero__chip {
  font-family: 'Chakra Petch', sans-serif;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: #ffd166;
  padding: .25rem .55rem;
  border: 1px solid rgba(255, 209, 102, .35);
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 內含 table 的 hero(ladder / MVP / progress / newcomer 用) */
.stat-hero__table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.stat-hero__table th {
  font-family: 'Chakra Petch', sans-serif;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 209, 102, .75);
  text-align: left;
  padding: .55rem .55rem;
  border-bottom: 1px solid rgba(255, 209, 102, .15);
  user-select: none;
}
.stat-hero__table th.is-sortable {
  cursor: pointer;
  transition: color .15s;
}
.stat-hero__table th.is-sortable:hover { color: #ffd166; }
.stat-hero__table th.is-num { text-align: right; }
.stat-hero__table td {
  padding: .6rem .55rem;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  vertical-align: middle;
  color: #fff;
}
.stat-hero__table tr:last-child td { border-bottom: 0; }
.stat-hero__table tr:hover td { background: rgba(255, 209, 102, .04); }
.stat-hero__table a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: border-color .15s;
}
.stat-hero__table a:hover { border-bottom-color: rgba(255, 255, 255, .5); }

.stat-hero__rank {
  width: 28px;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 209, 102, .45);
  text-align: center;
}
/* Top 3 medal-ish glow on rank number */
.stat-hero__table tr:nth-child(1) .stat-hero__rank { color: #ffd166; font-size: 1.05rem; }
.stat-hero__table tr:nth-child(2) .stat-hero__rank { color: rgba(255, 209, 102, .85); }
.stat-hero__table tr:nth-child(3) .stat-hero__rank { color: rgba(255, 209, 102, .65); }

.stat-hero__num {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
/* Top-1 row 整 row 微亮 + 主數值放大 */
.stat-hero__table tr.is-top1 td { background: rgba(255, 209, 102, .07); }
.stat-hero__table tr.is-top1 .stat-hero__num--primary {
  color: #ffd166;
  font-size: 1.05rem;
}

/* Sort indicator */
.stat-hero__sort-ind {
  display: inline-block;
  margin-left: .2rem;
  opacity: .65;
  font-size: .6rem;
}

/* Delta colors — 在深底上要更亮 */
.stat-hero .delta--up   { color: #4ade80; }
.stat-hero .delta--down { color: #f87171; }

/* Share button 改 amber solid(在深底上 outline 看不清) */
.stat-hero__share {
  background: #ffd166;
  color: #1a237e;
  border: 1px solid #ffd166;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .03em;
  padding: .35rem .8rem;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .1s;
}
.stat-hero__share:hover {
  background: #ffc94d;
  box-shadow: 0 4px 12px rgba(255, 209, 102, .35);
}
.stat-hero__share:active { transform: scale(.97); }

/* Empty state inside dark hero */
.stat-hero__empty {
  padding: 1rem;
  text-align: center;
  color: rgba(255, 255, 255, .4);
  font-size: .88rem;
  font-style: italic;
}
