/* ═══════════════════════════════════════════════════════
   LUCKY 539 — Professional Dark Theme
   ═══════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #060814;
  --bg2:        #0c1028;
  --card:       rgba(255,255,255,0.035);
  --card-hover: rgba(255,255,255,0.06);
  --border:     rgba(255,255,255,0.08);
  --purple:     #7c3aed;
  --purple2:    #9f67ff;
  --blue:       #2563eb;
  --cyan:       #06b6d4;
  --gold:       #f59e0b;
  --gold2:      #fbbf24;
  --red:        #ef4444;
  --green:      #22c55e;
  --text:       #e2e8f0;
  --sub:        #94a3b8;
  --muted:      #475569;
  --radius:     16px;
  --shadow:     0 8px 32px rgba(0,0,0,0.4);
  --glow-p:     0 0 30px rgba(124,58,237,0.3);
  --glow-g:     0 0 30px rgba(245,158,11,0.4);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;   /* 手機不要自動改字級 */
  text-size-adjust: 100%;
}

body {
  font-family: 'Noto Sans TC', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100%;
}

/* iOS Safari:輸入框字級 <16px 聚焦時會自動放大、且登入後不縮回→整頁超出視窗要手動縮。
   全部輸入框字級 ≥16px 即可根治(iOS 就不會放大)。 */
input, select, textarea { font-size: 16px; }
@media (max-width: 768px) {
  input, select, textarea { font-size: 16px !important; }
}

/* ── Background layer ──────────────────────────────────── */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

#particleCanvas {
  position: absolute;
  inset: 0;
  opacity: .4;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .12;
  animation: orbFloat 18s ease-in-out infinite alternate;
}
.orb1 { width:600px;height:600px;top:-200px;left:-100px; background:var(--purple); animation-delay:0s; }
.orb2 { width:500px;height:500px;bottom:-150px;right:-100px; background:var(--blue); animation-delay:-6s; }
.orb3 { width:400px;height:400px;top:40%;left:40%; background:var(--cyan); animation-delay:-12s; }

@keyframes orbFloat {
  0%   { transform: translate(0,0) scale(1); }
  50%  { transform: translate(40px,-40px) scale(1.1); }
  100% { transform: translate(-30px,30px) scale(0.95); }
}

/* ── Navbar ────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 64px;
  background: rgba(6,8,20,0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand-icon { font-size: 24px; }
.brand-text {
  font-family: 'Orbitron', monospace;
  font-size: 17px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold2), var(--purple2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-sub { font-size: 12px; opacity: .7; }

/* 桌面版頁籤 */
.nav-center {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: center;
}

.nav-tab {
  background: none;
  border: 1px solid transparent;
  color: var(--sub);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.nav-tab:hover  { background: var(--card); color: var(--text); }
.nav-tab.active {
  background: linear-gradient(135deg, rgba(124,58,237,.25), rgba(37,99,235,.25));
  color: var(--purple2);
  border-color: rgba(124,58,237,.3);
}

/* 彩券切換器 */
.lottery-switcher {
  display: flex;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.lottery-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--sub);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.lottery-btn:hover { color: var(--text); background: rgba(255,255,255,.06); }
.lottery-btn.active {
  background: linear-gradient(135deg, rgba(124,58,237,.35), rgba(37,99,235,.35));
  color: var(--purple2);
  border-color: rgba(124,58,237,.4);
}

.nav-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}
.desktop-only { }

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.update-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--sub);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
}

/* 手機版彩券切換列 (桌面隱藏) */
.mobile-sub-nav {
  display: none;
}

/* 手機版底部頁籤 (桌面隱藏) */
.bottom-nav {
  display: none;
}
.badge-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}
.badge-dot.loading { background: var(--gold); box-shadow: 0 0 8px var(--gold); }

@keyframes pulse { 0%,100%{opacity:1}50%{opacity:.4} }

.refresh-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--sub);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.refresh-btn:hover { background: var(--card-hover); color: var(--text); transform: rotate(90deg); }
.refresh-btn.spinning svg { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Sections ──────────────────────────────────────────── */
.section { display: none; padding: 28px max(28px, calc((100vw - 1400px)/2)); position: relative; z-index: 1; }
.section.active { display: block; }

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(12px);
  margin-bottom: 20px;
  transition: border-color .2s;
}
.card:hover { border-color: rgba(255,255,255,0.14); }
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  letter-spacing: .3px;
}
.card-label  { font-size: 12px; color: var(--sub); text-transform: uppercase; letter-spacing: 1px; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.card-sub    { font-size: 12px; color: var(--sub); margin-top: 2px; }

/* ── Hero row ──────────────────────────────────────────── */
.hero-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 820px) { .hero-row { grid-template-columns: 1fr; } }

.hero-card { background: var(--card); border: 1px solid var(--border); position: relative; overflow: hidden; }
.hero-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124,58,237,.06) 0%, transparent 60%);
  pointer-events: none;
}
.latest-card::before { background: linear-gradient(135deg, rgba(245,158,11,.07) 0%, transparent 60%); }

.live-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.25);
  border-radius: 20px;
  padding: 4px 10px;
  letter-spacing: .5px;
}
.live-dot span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse 1.5s infinite;
}

/* ── Lottery balls ─────────────────────────────────────── */
.balls-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.ball {
  width: 62px; height: 62px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  font-family: 'Orbitron', monospace;
  cursor: default;
  transition: transform .2s;
  animation: ballDrop .5s cubic-bezier(.34,1.56,.64,1) both;
}
.ball:hover { transform: scale(1.12); }

.ball.latest {
  background: radial-gradient(circle at 38% 32%, #fde68a, #d97706 80%);
  color: #1a0800;
  box-shadow: 0 4px 20px rgba(245,158,11,.45), inset 0 2px 6px rgba(255,255,255,.35);
}
.ball.pred {
  background: radial-gradient(circle at 38% 32%, #c4b5fd, #6d28d9 80%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(109,40,217,.45), inset 0 2px 6px rgba(255,255,255,.2);
}
.ball.hot-ball {
  background: radial-gradient(circle at 38% 32%, #fca5a5, #dc2626 80%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(220,38,38,.4);
}
.ball.cold-ball {
  background: radial-gradient(circle at 38% 32%, #93c5fd, #1d4ed8 80%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(29,78,216,.4);
}

/* 特別號:大樂透 / 六合彩 — 紅色球體,主號之後顯示 */
.ball.special {
  background: radial-gradient(circle at 38% 32%, #fecaca, #b91c1c 80%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(185,28,28,.5), inset 0 2px 6px rgba(255,255,255,.25);
}
.ball-separator,
.mini-ball-sep {
  display: inline-flex;
  align-items: center;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  color: var(--muted);
  margin: 0 4px;
  align-self: center;
  user-select: none;
}
.ball-separator { font-size: 28px; }
.mini-ball-sep  { font-size: 16px; }

.mini-ball.special {
  background: radial-gradient(circle at 38% 32%, #fecaca, #b91c1c 80%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(185,28,28,.4);
}

/* ── 特別號分析卡片 ────────────────────────────────────── */
.special-analysis-card {
  border-left: 3px solid #b91c1c;
  background: linear-gradient(135deg, rgba(185,28,28,0.04), rgba(185,28,28,0) 60%), var(--card-bg, rgba(255,255,255,0.02));
}
.special-analysis-card .card-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.special-title-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #fecaca, #b91c1c 80%);
  box-shadow: 0 0 12px rgba(185,28,28,0.6);
  flex-shrink: 0;
}
.special-analysis-card .card-title .card-sub {
  margin-left: auto;
  font-weight: 400;
  color: var(--muted);
  font-size: 13px;
}

.special-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  margin-top: 4px;
}
.special-chart-wrap {
  position: relative;
  height: 280px;
  min-width: 0;
}
.special-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.special-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.special-row-label {
  font-size: 13px;
  color: var(--sub);
  font-weight: 600;
  letter-spacing: .3px;
}
.special-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.special-pills .num-pill {
  background: linear-gradient(135deg, rgba(185,28,28,0.18), rgba(185,28,28,0.08));
  border: 1px solid rgba(185,28,28,0.35);
  color: #fecaca;
  min-width: 36px;
  text-align: center;
  padding: 6px 10px;
  border-radius: 20px;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 14px;
  transition: transform .15s, box-shadow .15s;
}
.special-pills .num-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(185,28,28,0.3);
}
.special-pills .num-pill.cold {
  background: linear-gradient(135deg, rgba(29,78,216,0.18), rgba(29,78,216,0.08));
  border-color: rgba(29,78,216,0.35);
  color: #bfdbfe;
}
.special-pills .num-pill.cold:hover {
  box-shadow: 0 4px 12px rgba(29,78,216,0.3);
}
.special-pills .num-pill.gap-warn {
  background: linear-gradient(135deg, rgba(245,158,11,0.18), rgba(245,158,11,0.08));
  border-color: rgba(245,158,11,0.4);
  color: #fcd34d;
}
.special-pills .num-pill .pill-sub {
  font-size: 11px;
  color: var(--muted);
  margin-left: 6px;
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 400;
}

@media (max-width: 768px) {
  .special-grid { grid-template-columns: 1fr; }
  .special-chart-wrap { height: 220px; }
}

/* ── 預測特別號詳細卡 ──────────────────────────────────── */
.special-detail-card {
  border-left: 3px solid #b91c1c;
}
.special-detail-body {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 8px 4px;
  flex-wrap: wrap;
}
.special-detail-ball {
  flex-shrink: 0;
}
.special-detail-info {
  flex: 1;
  min-width: 240px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px 24px;
}
.special-detail-info .detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--sub);
  padding: 6px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
}
.special-detail-info .detail-row span {
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  color: #fecaca;
}

/* ── 特別號統計表 (分析頁) ────────────────────────────── */
.special-stats-card {
  border-left: 3px solid #b91c1c;
}
.special-stats-card .stats-table tbody tr:hover {
  background: rgba(185,28,28,0.06);
}

/* ── 五不出牌 (反向預測) ──────────────────────────────── */
.not-out-card {
  border-left: 3px solid #2563eb;
  background: linear-gradient(135deg, rgba(37,99,235,0.04), rgba(37,99,235,0) 60%);
}
.not-out-card .card-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.not-out-card .card-title .card-sub {
  margin-left: auto;
  font-weight: 400;
  font-size: 13px;
  color: var(--muted);
}
.not-out-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #93c5fd, #1d4ed8 80%);
  box-shadow: 0 0 12px rgba(37,99,235,0.6);
  flex-shrink: 0;
}
.not-out-balls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding: 18px 4px 22px;
  justify-content: center;
}
.ball.not-out {
  background: radial-gradient(circle at 38% 32%, #bfdbfe, #1d4ed8 80%);
  color: #fff;
  box-shadow: 0 4px 18px rgba(29,78,216,.45), inset 0 2px 6px rgba(255,255,255,.25);
}
.ball.not-out.special {
  background: radial-gradient(circle at 38% 32%, #fecaca, #b91c1c 80%);
  box-shadow: 0 4px 20px rgba(185,28,28,.5), inset 0 2px 6px rgba(255,255,255,.25);
}
.not-out-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.not-out-detail-grid .detail-card {
  border-left: 2px solid rgba(37,99,235,.4);
  background: rgba(37,99,235,0.04);
}
.not-out-detail-grid .detail-card.special-out {
  border-left-color: rgba(185,28,28,.5);
  background: rgba(185,28,28,0.05);
}
.not-out-detail-grid .detail-num {
  color: #93c5fd;
}
.not-out-detail-grid .detail-card.special-out .detail-num {
  color: #fecaca;
}
.not-out-detail-grid .detail-score {
  background: linear-gradient(90deg, rgba(37,99,235,.5), rgba(37,99,235,.2));
}
.not-out-detail-grid .detail-card.special-out .detail-score {
  background: linear-gradient(90deg, rgba(185,28,28,.5), rgba(185,28,28,.2));
}

@keyframes ballDrop {
  0%   { transform: translateY(-30px) scale(.5); opacity: 0; }
  60%  { transform: translateY(4px)  scale(1.08); }
  80%  { transform: translateY(-2px) scale(.97); }
  100% { transform: translateY(0)   scale(1);  opacity: 1; }
}

.ball-skeleton {
  width: 62px; height: 62px;
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(255,255,255,.05) 0%, rgba(255,255,255,.1) 50%, rgba(255,255,255,.05) 100%);
  background-size: 200%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0%{background-position:200%}100%{background-position:-200%} }

.draw-sum {
  font-size: 13px;
  color: var(--sub);
  margin-top: 6px;
}

.confidence-badge {
  font-family: 'Orbitron', monospace;
  font-size: 22px;
  font-weight: 900;
  color: var(--purple2);
  background: rgba(124,58,237,.15);
  border: 1px solid rgba(124,58,237,.3);
  border-radius: 12px;
  padding: 6px 14px;
}

.pred-footer {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}

/* ── KPI grid ──────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px) { .kpi-grid { grid-template-columns: 1fr; } }

.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  backdrop-filter: blur(12px);
  transition: transform .2s, border-color .2s;
}
.kpi-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.15); }
.kpi-card.hot  { border-color: rgba(239,68,68,.25); }
.kpi-card.cold { border-color: rgba(37,99,235,.25); }
.kpi-icon  { font-size: 28px; margin-bottom: 8px; }
.kpi-value {
  font-family: 'Orbitron', monospace;
  font-size: 28px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold2), var(--purple2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: 6px;
}
.kpi-label { font-size: 12px; color: var(--sub); }

/* ── Chart row ─────────────────────────────────────────── */
.chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 820px) { .chart-row { grid-template-columns: 1fr; } }

.chart-row:has(.chart-card:nth-child(3)) {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 1100px) {
  .chart-row:has(.chart-card:nth-child(3)) { grid-template-columns: 1fr 1fr; }
}

.chart-wrap { position: relative; height: 280px; }
.chart-wrap.tall  { height: 420px; }
.chart-wrap.small { height: 220px; }

/* ── 比例型分析卡(大小比 / 質合比 / 連號)：環圖(上) + 全寬數字圖例(下) + 摘要 ── */
/* 直式排版：環圖置中在上，圖例整排在下，標籤才有足夠寬度顯示(側排會把標籤擠成 0 寬) */
.ratio-card .ratio-body { display: flex; flex-direction: column; align-items: stretch; gap: 14px; margin-top: 8px; }
.ratio-card .chart-wrap.ratio-chart { height: 158px; width: 100%; max-width: 210px; margin: 0 auto; }
.ratio-legend { width: 100%; display: flex; flex-direction: column; gap: 9px; }
.ratio-row { display: flex; align-items: center; gap: 10px; font-size: 16px; line-height: 1.2; padding: 7px 11px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.07); border-radius: 10px; }
.ratio-dot { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; box-shadow: 0 0 6px rgba(0,0,0,.35); }
.ratio-lbl { flex: 1 1 auto; min-width: 0; color: var(--text); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ratio-num { flex-shrink: 0; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ratio-num i { font-style: normal; font-size: .7em; color: var(--sub); margin-left: 2px; font-weight: 600; }
.ratio-pct { flex-shrink: 0; min-width: 58px; text-align: right; font-weight: 800; font-size: 17px; color: var(--gold2); font-variant-numeric: tabular-nums; }
.ratio-foot { margin-top: 4px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; color: var(--sub); text-align: center; letter-spacing: .3px; }

/* ── Heatmap ───────────────────────────────────────────── */
.heatmap {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));   /* minmax(0,..) 讓格子能縮小、不會撐爆溢出 */
  gap: 6px;
  padding: 4px 0;
  width: 100%;
}
.hm-cell {
  aspect-ratio: 1;
  min-width: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  cursor: default;
  transition: transform .15s;
  font-family: 'Orbitron', monospace;
}
.hm-cell:hover { transform: scale(1.15); z-index: 2; position: relative; }
.hm-empty { background: transparent !important; }

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--sub);
}
.legend-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #1e3a8a, #6d28d9, #ef4444);
}

/* ── Number pills ──────────────────────────────────────── */
.num-pills { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 0; }

.num-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px; height: 50px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 800;
  font-family: 'Orbitron', monospace;
  position: relative;
}
.num-pill.hot {
  background: radial-gradient(circle at 38% 32%, #fca5a5, #dc2626 80%);
  color: #fff;
  box-shadow: 0 3px 14px rgba(220,38,38,.4);
}
.num-pill.cold {
  background: radial-gradient(circle at 38% 32%, #93c5fd, #1d4ed8 80%);
  color: #fff;
  box-shadow: 0 3px 14px rgba(29,78,216,.4);
}
.num-pill .pill-rank {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 9px;
  padding: 1px 4px;
  color: var(--sub);
  font-family: inherit;
}

/* ── Stats table ───────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

.stats-table, .history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.stats-table th, .history-table th {
  background: rgba(255,255,255,.04);
  color: var(--sub);
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.stats-table td, .history-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .15s;
}
.stats-table tr:hover td, .history-table tr:hover td { background: rgba(255,255,255,.025); }

.heat-bar-wrap { display: flex; align-items: center; gap: 8px; }
.heat-bar {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--blue), var(--purple), var(--red));
  transition: width .4s;
}

.badge-hot  { background:rgba(239,68,68,.15);  color:#ef4444; border:1px solid rgba(239,68,68,.3);  border-radius:6px; padding:2px 8px; font-size:11px; }
.badge-warm { background:rgba(245,158,11,.12); color:#f59e0b; border:1px solid rgba(245,158,11,.25); border-radius:6px; padding:2px 8px; font-size:11px; }
.badge-cold { background:rgba(37,99,235,.12);  color:#60a5fa; border:1px solid rgba(37,99,235,.25); border-radius:6px; padding:2px 8px; font-size:11px; }

/* ── History section ───────────────────────────────────── */
.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.toolbar-right { display: flex; align-items: center; gap: 12px; }

.search-input {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 8px 14px;
  width: 260px;
  outline: none;
  transition: border-color .2s, background .2s;
}
.search-input:focus { border-color: rgba(124,58,237,.5); background: rgba(255,255,255,.07); }
.search-input::placeholder { color: var(--muted); }

.total-badge {
  font-size: 12px;
  color: var(--sub);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  white-space: nowrap;
}

.history-balls { display: flex; gap: 5px; flex-wrap: wrap; }
.mini-ball {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Orbitron', monospace;
  background: radial-gradient(circle at 38% 32%, #fde68a, #d97706 80%);
  color: #1a0800;
  box-shadow: 0 2px 8px rgba(245,158,11,.35);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-top: 20px;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--sub);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 0 8px;
  transition: all .15s;
}
.page-btn:hover   { background: var(--card-hover); color: var(--text); }
.page-btn.active  { background: linear-gradient(135deg, rgba(124,58,237,.3), rgba(37,99,235,.3)); color: var(--purple2); border-color: rgba(124,58,237,.4); font-weight: 700; }
.page-btn:disabled { opacity: .35; cursor: default; }

/* ── Prediction section ────────────────────────────────── */
.predict-hero {
  text-align: center;
  padding: 20px 20px 12px;
}
.ai-logo {
  display: inline-block;
  font-family: 'Orbitron', monospace;
  font-size: 24px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--purple2), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  border: 2px solid rgba(124,58,237,.3);
  border-radius: 12px;
  padding: 5px 16px;
  margin-bottom: 8px;
  position: relative;
}
.ai-logo::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(124,58,237,.15), rgba(6,182,212,.15));
  z-index: -1;
}
.predict-title {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #fff, var(--sub));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.predict-desc { font-size: 13px; color: var(--sub); max-width: 500px; margin: 0 auto; }
@media (max-width: 768px) {
  .predict-hero { padding: 12px 16px 8px; }
  .ai-logo { font-size: 19px; padding: 4px 13px; margin-bottom: 6px; }
  .predict-title { font-size: 17px; margin-bottom: 3px; }
  .predict-desc { font-size: 12px; }
}

/* 底部頁籤「AI預測」藍色發光 */
.bottom-nav .nav-tab-ai { color: #60a5fa; animation: aiTabPulse 1.5s ease-in-out infinite; will-change: transform; }
.bottom-nav .nav-tab-ai span { color: #60a5fa; font-weight: 800; animation: aiTextBlink 1.5s ease-in-out infinite; }
.bottom-nav .nav-tab-ai .tab-icon { color: #60a5fa; stroke: #60a5fa; animation: aiIconBlink 1.5s ease-in-out infinite; }
.bottom-nav .nav-tab-ai.active span { color: #93c5fd; }

/* AI預測 鈕：整顆會「閃爍發光 + 放大一點點」，吸引點擊 */
@keyframes aiTabPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.16); }
}
@keyframes aiTextBlink {
  0%, 100% { color:#3b82f6; text-shadow: 0 0 4px rgba(96,165,250,.4); }
  50%      { color:#93c5fd; text-shadow: 0 0 10px rgba(96,165,250,1), 0 0 22px rgba(96,165,250,.85), 0 0 34px rgba(96,165,250,.5); }
}
@keyframes aiIconBlink {
  0%, 100% { stroke:#3b82f6; filter: drop-shadow(0 0 2px rgba(96,165,250,.4)); }
  50%      { stroke:#bfdbfe; filter: drop-shadow(0 0 8px rgba(96,165,250,1)) drop-shadow(0 0 16px rgba(96,165,250,.7)); }
}
@media (prefers-reduced-motion: reduce) {
  .bottom-nav .nav-tab-ai, .bottom-nav .nav-tab-ai span, .bottom-nav .nav-tab-ai .tab-icon { animation: none; }
  .bottom-nav .nav-tab-ai span { text-shadow: 0 0 8px rgba(96,165,250,.85), 0 0 16px rgba(96,165,250,.5); }
  .bottom-nav .nav-tab-ai .tab-icon { filter: drop-shadow(0 0 5px rgba(96,165,250,.8)); }
}

.predict-main-card { text-align: center; }
.predict-balls-lg {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 0;
}
.predict-balls-lg .ball { width: 80px; height: 80px; font-size: 28px; }

.predict-conf-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
.conf-label { font-size: 13px; color: var(--sub); white-space: nowrap; }
.conf-bar-wrap {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,.08);
  border-radius: 4px;
  overflow: hidden;
}
.conf-bar {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(to right, var(--blue), var(--purple), var(--purple2));
  transition: width 1s cubic-bezier(.4,0,.2,1);
  width: 0%;
}
.conf-val {
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--purple2);
  min-width: 48px;
  text-align: right;
}

.predict-detail-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 900px) { .predict-detail-grid { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 560px) { .predict-detail-grid { grid-template-columns: repeat(2,1fr); } }

.detail-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 14px;
  text-align: center;
  backdrop-filter: blur(10px);
}
.detail-num {
  font-family: 'Orbitron', monospace;
  font-size: 32px;
  font-weight: 900;
  color: var(--purple2);
  margin-bottom: 10px;
}
.detail-row { font-size: 11px; color: var(--sub); margin: 4px 0; }
.detail-row span { color: var(--text); font-weight: 600; }
.detail-score {
  margin-top: 10px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--blue), var(--purple2));
}

.multi-pred { display: flex; flex-direction: column; gap: 12px; }
.multi-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: background .15s;
}
.multi-row:hover { background: rgba(255,255,255,.055); }
.multi-label { font-size: 12px; color: var(--sub); min-width: 60px; }
.multi-balls { display: flex; gap: 8px; flex-wrap: wrap; }
.multi-balls .ball { width: 44px; height: 44px; font-size: 16px; }

.btn-regen {
  display: block;
  margin: 16px auto 0;
  background: linear-gradient(135deg, rgba(124,58,237,.2), rgba(37,99,235,.2));
  border: 1px solid rgba(124,58,237,.4);
  border-radius: 12px;
  color: var(--purple2);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 28px;
  cursor: pointer;
  transition: all .2s;
}
.btn-regen:hover {
  background: linear-gradient(135deg, rgba(124,58,237,.35), rgba(37,99,235,.35));
  transform: translateY(-2px);
  box-shadow: var(--glow-p);
}

.disclaimer {
  border-color: rgba(245,158,11,.2);
  background: rgba(245,158,11,.04);
}
.disclaimer p { font-size: 13px; color: var(--sub); line-height: 1.7; margin-bottom: 6px; }
.disclaimer p:last-child { margin-bottom: 0; }

/* ── Loading overlay ───────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,8,20,.9);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .4s;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }

.loading-box { text-align: center; }
.loading-spinner {
  width: 56px; height: 56px;
  border: 3px solid rgba(124,58,237,.2);
  border-top-color: var(--purple);
  border-right-color: var(--purple2);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 20px;
}
.loading-text { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.loading-sub { font-size: 13px; color: var(--sub); }

/* ── Misc ──────────────────────────────────────────────── */
.error-state {
  text-align: center;
  padding: 40px;
  color: var(--sub);
  font-size: 14px;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }

/* ── 拖曳排序 (SortableJS) ───────────────────────────── */
.drag-handle {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--muted);
  cursor: grab;
  border-radius: 6px;
  user-select: none;
  opacity: .35;
  transition: opacity .2s, background .2s, color .2s;
  z-index: 3;
}
.drag-handle:hover {
  opacity: 1;
  background: rgba(124,58,237,.12);
  color: var(--purple2);
}
.drag-handle:active { cursor: grabbing; }
.drag-handle::before {
  content: '⋮⋮';
  letter-spacing: -2px;
  font-weight: 900;
}

/* 讓 .card / row 能夠定位 drag handle */
.card, .hero-row, .kpi-grid, .chart-row {
  position: relative;
}

/* 拖曳中的視覺 */
.sortable-ghost {
  opacity: .25;
  background: rgba(124,58,237,.15) !important;
}
.sortable-chosen { cursor: grabbing; }
.sortable-drag {
  opacity: .9;
  transform: rotate(.5deg);
  box-shadow: 0 16px 48px rgba(0,0,0,.6), 0 0 0 2px var(--purple);
}

/* ── Period setting card ──────────────────────────────── */
.period-setting-card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--purple);
}
.period-setting-header {
  margin-bottom: 16px;
}
.period-setting-hint {
  color: var(--sub);
  font-size: 13px;
  margin-top: 4px;
}
.period-setting-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Period mode sections (上下兩區塊互斥) ───────────── */
.period-mode-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.02);
  transition: opacity .2s, border-color .2s, background .2s;
}
.period-mode-section:last-child { margin-bottom: 0; }

.period-mode-section.active {
  border-color: var(--purple);
  background: rgba(124,58,237,0.06);
  box-shadow: 0 0 0 1px rgba(124,58,237,0.18) inset;
}

.period-mode-section:not(.active) {
  opacity: .42;
  cursor: pointer;
}
.period-mode-section:not(.active):hover {
  opacity: .65;
  border-color: rgba(124,58,237,0.4);
}
.period-mode-section:not(.active) .period-mode-body {
  pointer-events: none;
  user-select: none;
}

.period-mode-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--sub);
}
.period-mode-section.active .period-mode-title {
  color: var(--purple2);
}
.period-mode-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  flex-shrink: 0;
  transition: all .2s;
}
.period-mode-section.active .period-mode-dot {
  border-color: var(--purple);
  background: var(--purple);
  box-shadow: 0 0 8px rgba(124,58,237,0.5);
}

.period-mode-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.period-range-group { flex-wrap: wrap; }
.period-range-group .period-input { width: 140px; }
.period-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.period-label {
  color: var(--sub);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.period-input {
  width: 120px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-size: 16px;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color .2s;
}
.period-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
/* Hide number input spinner arrows */
.period-input::-webkit-outer-spin-button,
.period-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.period-input[type=number] { -moz-appearance: textfield; }

.period-apply-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
}
.period-apply-btn:hover {
  opacity: .9;
  transform: translateY(-1px);
}
.period-apply-btn:active {
  transform: translateY(0);
}

.period-slider-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.period-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  outline: none;
  cursor: pointer;
}
.period-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--purple2));
  box-shadow: 0 0 8px rgba(124,58,237,0.4);
  cursor: pointer;
  transition: transform .15s;
}
.period-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.period-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--purple2));
  box-shadow: 0 0 8px rgba(124,58,237,0.4);
  cursor: pointer;
}
.period-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  font-family: 'Orbitron', monospace;
}

.period-quick-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.period-quick-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--sub);
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}
.period-quick-btn:hover {
  border-color: var(--purple);
  color: var(--purple2);
}
.period-quick-btn.active {
  background: rgba(124,58,237,0.15);
  border-color: var(--purple);
  color: var(--purple2);
  font-weight: 600;
}

/* ── Mobile layout ─────────────────────────────────────── */
@media (max-width: 768px) {

  /* Navbar: 只留 brand + right */
  .navbar {
    padding: 0 16px;
    height: 56px;
  }
  .nav-center { display: none; }           /* 桌面頁籤隱藏 */
  .desktop-only { display: none !important; } /* 桌面彩券切換隱藏 */
  .brand-text { font-size: 15px; }
  .brand-sub { display: none; }
  .badge-label { display: none; }          /* badge 只保留圓點 */
  .update-badge { padding: 6px; border-radius: 50%; }

  /* 彩券切換列 */
  .mobile-sub-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: rgba(6,8,20,0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 56px;
    z-index: 99;
  }
  .mobile-sub-nav .lottery-switcher {
    width: 100%;
    max-width: 400px;
  }
  .mobile-sub-nav .lottery-switcher { padding: 4px; }
  .mobile-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }
  .mobile-sub-nav .lottery-btn {
    text-align: center;
    padding: 9px 8px;
    font-size: 13px;
    border-radius: 8px;
  }

  /* 內容區塊留出底部空間 */
  .section {
    padding: 16px 12px;
    padding-bottom: 80px;
  }

  /* 底部頁籤列 */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(6,8,20,0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    height: 64px;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom, 0px); /* iPhone notch */
  }
  .bottom-nav .nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 12px;
    padding: 6px 4px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    background: none;
    color: var(--muted);
    transition: color .2s;
    margin: 4px 2px;
  }
  .bottom-nav .nav-tab:hover,
  .bottom-nav .nav-tab.active {
    color: var(--purple2);
    background: rgba(124,58,237,.12);
  }
  .tab-icon {
    width: 22px;
    height: 22px;
    stroke-width: 2;
  }

  /* KPI & cards */
  .kpi-value { font-size: 22px; }
  .hero-row { grid-template-columns: 1fr; }
  .chart-row { grid-template-columns: 1fr; }
  .chart-row:has(.chart-card:nth-child(3)) { grid-template-columns: 1fr; }

  /* 期數設定手機適配 */
  .period-input-group { flex-wrap: wrap; }
  .period-input { width: 100px; }
  .period-range-group .period-input { width: 110px; }
  .period-quick-btns { gap: 6px; }
  .period-quick-btn { padding: 5px 10px; font-size: 12px; }
  .period-mode-section { padding: 12px; }

  /* 球縮小一點 */
  .ball { width: 50px; height: 50px; font-size: 18px; }
  .predict-balls-lg .ball { width: 60px; height: 60px; font-size: 22px; }
}

/* ── 極小螢幕 ───────────────────────────────────────────── */
@media (max-width: 360px) {
  .bottom-nav .nav-tab span { display: none; } /* 超小螢幕只顯示 icon */
  .bottom-nav .nav-tab { padding: 8px 4px; }
  .tab-icon { width: 26px; height: 26px; }
}

/* ═══════════════════════════════════════════════════════
   AUTH — 登入 / 鎖定模糊
   ═══════════════════════════════════════════════════════ */
.auth-box { display: flex; align-items: center; gap: 8px; }
.auth-btn {
  background: linear-gradient(135deg, rgba(124,58,237,.25), rgba(37,99,235,.25));
  border: 1px solid rgba(124,58,237,.4); color: #c4a6ff;
  font-family: inherit; font-size: 13px; font-weight: 700; letter-spacing: 1px;
  padding: 7px 16px; border-radius: 10px; cursor: pointer; transition: all .2s; white-space: nowrap;
}
.auth-btn:hover { background: linear-gradient(135deg, rgba(124,58,237,.4), rgba(37,99,235,.4)); }
.auth-user { font-size: 13px; color: #94a3b8; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.auth-user b { color: #e2e8f0; }
.auth-logout {
  background: none; border: 1px solid rgba(255,255,255,.15); color: #94a3b8;
  font-family: inherit; font-size: 12px; padding: 5px 12px; border-radius: 8px; cursor: pointer;
}
.auth-logout:hover { color: #e2e8f0; border-color: rgba(255,255,255,.3); }

/* ── 會員專區：同一份資料，用模糊 + 登入解鎖來展示「會員模式」 ── */
.member-intro {
  text-align: center; padding: 36px 24px 28px;
}
.member-intro .card-label { color: #c4a6ff; letter-spacing: 2px; margin-bottom: 6px; }
.member-intro .card-title { font-size: 1.3rem; margin-bottom: 6px; }
.member-intro p { color: #8a92c0; font-size: .85rem; }

.member-blur { transition: filter .3s ease; }
/* 未解鎖 / 次數用完：凡是「電腦幫忙算過、排序過」的都擋
   （AI 預測、頻率、遺漏值、冷熱號、熱力圖、各種統計圖表與統計表）。
   純公開事實不擋：官方開獎號碼、歷史開獎記錄、總期數、資料起始年份。
   哪些區塊要擋是靠 index.html 上的 member-blur class 決定，這裡只列「擋什麼元素」。 */
/* 【全遮罩】2類比例圖/環圖/熱力圖等：露一個就知道另一個，整塊擋住 */
.member-locked .member-blur .ball-skeleton,
.member-locked .member-blur .confidence-badge,
.member-locked .member-blur .conf-val,
.member-locked .member-blur .conf-bar,
.member-locked .member-blur .detail-num,
.member-locked .member-blur .detail-row span,
.member-locked .member-blur .detail-score,
.member-locked .member-blur .multi-balls,
.member-locked .member-blur .multi-conf,
.member-locked .member-blur .kpi-value,
.member-locked .member-blur .hm-cell,
.member-locked .member-blur .chart-wrap:not(.teaser-peek),
.member-locked .member-blur .special-chart-wrap,
.member-locked .member-blur .heatmap,
.member-locked .member-blur .ratio-legend,
.member-locked .member-blur .ratio-foot {
  filter: blur(6px);
  user-select: none;
  pointer-events: none;
}
/* 【露一點吊胃口】各版位露出最前面幾個，其餘模糊 */
.member-locked .member-blur .stats-table tbody tr:nth-child(n+3),   /* 詳細統計表：露前2列 */
.member-locked .member-blur .ht-rows .ht-row:nth-child(n+2),        /* 頭數/尾數：露第1列 */
.member-locked .member-blur .num-pills .num-pill:nth-child(n+3) {   /* 熱門/冷門Top10：各露前2個 */
  filter: blur(6px);
  user-select: none;
  pointer-events: none;
}
/* 首頁 AI 推薦：5 顆號碼「全部露出」，只遮「頭數(十位)」當吊胃口 →
   例如 01 02 03 04 05 顯示成 ▨1 ▨2 ▨3 ▨4 ▨5（個位露、十位遮住）。號碼是每日公版(見 app.js dailySeed)。
   做法：白色不透光遮罩底 + 強模糊把十位糊成看不清的一團，跟露出的個位明顯區隔。 */
.member-locked .member-blur #predictBalls .ball .ball-d1 {
  color: rgba(20, 12, 45, .4);                     /* 淡淡數字痕跡，被強模糊糊掉 */
  background: #fff;                                 /* 白色不透光遮罩底 */
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .18);
  filter: blur(6px);                               /* 強模糊 → 數字完全看不出來 */
  margin-right: 4px;                               /* 和露出的個位留縫，白霧不糊到它 */
  user-select: none;
}
/* 【頻率排行】露出最上面約 2 根，其餘用「實心」漸層蓋掉(不靠 backdrop-filter，縮圖也有效) */
.member-locked .member-blur .teaser-peek { position: relative; }
.member-locked .member-blur .teaser-peek::after {
  content: ''; position: absolute; left: 0; right: 0; top: 20%; bottom: 0; z-index: 6;
  background: linear-gradient(to bottom, rgba(11,16,34,0) 0%, rgba(11,16,34,.99) 16%, rgba(11,16,34,1) 100%);
  pointer-events: none; border-radius: 0 0 12px 12px;
}

.member-lock-cta { display: none; text-align: center; padding: 28px 24px; }
.member-locked .member-lock-cta { display: block; }
.member-lock-btn {
  background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff; border: none;
  font-family: inherit; font-weight: 700; font-size: 15px; letter-spacing: 1px;
  padding: 13px 34px; border-radius: 14px; cursor: pointer;
  box-shadow: 0 10px 30px rgba(124,58,237,.4);
}
.member-lock-btn:hover { box-shadow: 0 10px 40px rgba(124,58,237,.6); }

.auth-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.auth-modal-overlay.open { display: flex; }
.auth-modal {
  background: #0c1028; border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px; padding: 28px 26px; width: min(340px, 90vw);
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.auth-modal h3 { font-size: 1.1rem; color: #e2e8f0; margin-bottom: 6px; }
.auth-modal p { font-size: .8rem; color: #8a92c0; margin-bottom: 18px; }
.auth-modal input {
  width: 100%; padding: 10px 12px; margin-bottom: 10px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; color: #e2e8f0; font-size: 14px; font-family: inherit;
}
.auth-modal input:focus { outline: none; border-color: #7c3aed; }
.auth-modal-err { color: #f87171; font-size: .78rem; margin-bottom: 8px; min-height: 1em; }
.auth-modal-submit {
  width: 100%; padding: 11px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff;
  font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer; margin-bottom: 8px;
}
.auth-modal-close {
  width: 100%; padding: 9px; border: none; border-radius: 10px; background: none;
  color: #8a92c0; font-family: inherit; font-size: 13px; cursor: pointer;
}

/* ═══ Cloudflare 版新增：解鎖 CTA / 通行碼視窗 / 預測參數面板 ═══ */

/* 未解鎖浮動提示 */
.unlock-cta {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%) translateY(20px);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease, transform .35s ease;
  width: min(92vw, 420px);
}
.unlock-cta.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.unlock-box {
  background: rgba(13, 16, 38, .92);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(124, 58, 237, .45);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .55), 0 0 24px rgba(124, 58, 237, .25);
  padding: 18px 20px;
  text-align: center;
}
.unlock-title {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #e9e4ff;
}
.unlock-sub {
  font-size: 12px;
  color: #9aa3c7;
  margin: 6px 0 12px;
}
.unlock-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.unlock-line-btn {
  display: inline-block;
  background: linear-gradient(135deg, #06c755, #05a94a);
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  padding: 11px 22px;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(6, 199, 85, .4);
  transition: transform .15s ease, box-shadow .15s ease;
}
.unlock-line-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(6, 199, 85, .55);
}
.unlock-code-btn {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #c4b5fd;
  font-weight: 700;
  font-size: 13px;
  padding: 11px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s ease;
}
.unlock-code-btn:hover { border-color: #7c3aed; }
@media (min-width: 769px) {
  .unlock-cta { bottom: 32px; }
}

/* 通行碼視窗內的 LINE 連結 */
.auth-modal-line {
  display: block;
  margin: 4px 0 10px;
  font-size: 12.5px;
  color: #06c755;
  text-decoration: none;
  font-weight: 700;
}
.auth-modal-line:hover { text-decoration: underline; }

/* 預測參數面板 */
.param-card .period-setting-header { margin-bottom: 14px; }
.param-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.param-field label {
  display: block;
  font-size: 12px;
  color: #9aa3c7;
  margin-bottom: 6px;
  font-weight: 700;
}
.param-field .period-input { width: 100%; }
.param-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.param-hint {
  flex: 1;
  min-width: 220px;
  font-size: 11.5px;
  color: #6b7499;
  line-height: 1.7;
}
@media (max-width: 768px) {
  .param-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══ 手機版修正 v2：底部安全區 / 精簡切換列 / 表格壓縮 ═══ */
@media (max-width: 768px) {

  /* 1) 底部頁籤：高度包含手機安全區（手勢列），按鈕不再被瀏覽器介面蓋住 */
  .bottom-nav {
    height: auto;
    min-height: 58px;
    padding: 3px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    align-items: stretch;
  }
  .bottom-nav .nav-tab { margin: 2px; padding: 5px 4px; gap: 3px; }

  /* 2) 內容底部留白加大：捲到最底時內容不被頁籤列/解鎖卡蓋住 */
  .section { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  body.member-locked .section { padding-bottom: calc(215px + env(safe-area-inset-bottom, 0px)); }

  /* 3) 解鎖 CTA：壓縮體積，抬高到頁籤列正上方（含安全區） */
  .unlock-cta {
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    width: min(94vw, 400px);
  }
  .unlock-box { padding: 12px 14px; border-radius: 14px; }
  .unlock-title { font-size: 13.5px; }
  .unlock-sub { font-size: 11px; margin: 4px 0 9px; }
  .unlock-btns { gap: 8px; }
  .unlock-line-btn { padding: 9px 16px; font-size: 13px; }
  .unlock-code-btn { padding: 9px 12px; font-size: 12px; }

  /* 4) 彩券切換列：2欄大格 → 單列橫向滑動，高度省 2/3 */
  .mobile-sub-nav { padding: 6px 8px; }
  .mobile-sub-nav .lottery-switcher { max-width: none; }
  .mobile-grid {
    display: flex !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
  }
  .mobile-grid::-webkit-scrollbar { display: none; }
  .mobile-sub-nav .lottery-btn {
    flex: 0 0 auto;
    padding: 8px 14px;
    white-space: nowrap;
    font-size: 13px;
  }
  /* 讓最後一顆(加州天天樂)天生露一角，暗示可左右滑 */
  .mobile-grid { scroll-padding-right: 32px; padding-right: 30px; }
  /* 可再往右滑時：右緣淡出遮罩 + 會左右輕晃的箭頭，讓人知道「還有東西、可以滑」 */
  /* 注意：.mobile-sub-nav 已是 position:sticky(定位元素)，pseudo 直接錨定即可；
     千萬別再設 position:relative → 會覆蓋 sticky 且讓殘留的 top:56px 把整列往下推 56px(破版) */
  .mobile-sub-nav.scroll-more::before {
    content: ''; position: absolute; top: 6px; right: 8px; bottom: 6px; width: 52px;
    background: linear-gradient(90deg, rgba(6,8,20,0) 0%, rgba(6,8,20,.55) 45%, rgba(6,8,20,.9) 100%);
    pointer-events: none; z-index: 3; border-radius: 0 10px 10px 0;
  }
  .mobile-sub-nav.scroll-more::after {
    content: '›'; position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
    color: #c4b5fd; font-size: 24px; font-weight: 900; line-height: 1;
    pointer-events: none; z-index: 4; text-shadow: 0 0 8px rgba(124,58,237,.7);
    animation: scrollNudge 1.1s ease-in-out infinite;
  }
  @keyframes scrollNudge {
    0%, 100% { transform: translateY(-50%) translateX(0); opacity: .65; }
    50%      { transform: translateY(-50%) translateX(4px); opacity: 1; }
  }

  /* 5) 表格手機壓縮：歷史表隱藏流水號欄、整體縮小間距字級 */
  .history-table th:first-child,
  .history-table td:first-child { display: none; }
  .stats-table th, .stats-table td,
  .history-table th, .history-table td { padding: 8px 6px; font-size: 12px; }
  .mini-ball { width: 26px; height: 26px; font-size: 11px; }

  /* 6) 通行碼視窗：小螢幕留邊 */
  .auth-modal { width: min(92vw, 360px); padding: 22px 18px; }
}

/* 歷史表手機微調：日期不斷行、球列縮間距盡量單行排列 */
@media (max-width: 768px) {
  .history-table td:nth-child(3) { white-space: nowrap; font-size: 11px !important; }
  .history-table td:nth-child(2) { font-size: 11px !important; }
  .history-balls { gap: 3px; }
}

/* ═══ 頭數 / 尾數玩法分析 ═══ */
.ht-rows { margin-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.ht-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12.5px;
  background: rgba(255,255,255,.02);
}
.ht-row:hover { background: rgba(255,255,255,.045); }
.ht-name  { font-weight: 800; color: #e2e8f0; width: 46px; flex-shrink: 0; }
.ht-range {
  color: #6b7499; font-size: 10.5px; width: 92px; flex-shrink: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ht-bar-wrap { flex: 1; height: 6px; background: rgba(255,255,255,.05); border-radius: 3px; overflow: hidden; min-width: 40px; }
.ht-bar { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #7c3aed, #c084fc); }
.ht-freq { color: #c4b5fd; font-weight: 700; width: 52px; text-align: right; flex-shrink: 0; }
.ht-hit  { color: #94a3b8; width: 52px; text-align: right; flex-shrink: 0; }
.ht-gap  { font-weight: 700; width: 44px; text-align: right; flex-shrink: 0; }
.ht-row .badge-hot, .ht-row .badge-cold, .ht-row .badge-warm { flex-shrink: 0; }

/* 頭尾數明細列的模糊已併入上方主要 .member-locked .member-blur 清單 */

@media (max-width: 768px) {
  .ht-range { display: none; } /* 手機空間不夠，組員清單改看圖表 tooltip */
  .ht-row { gap: 6px; font-size: 12px; padding: 6px; }
  .ht-freq, .ht-hit { width: 46px; }
}

/* ═══ 生成額度提示（只有「有次數限制」的通行碼才會顯示）═══ */
.apply-wrap, .regen-wrap {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.regen-wrap { margin-top: 12px; }
.quota-hint {
  font-size: 13px; font-weight: 700; color: #5eead4;
  border: 1px solid rgba(45,212,191,.35); background: rgba(45,212,191,.08);
  border-radius: 8px; padding: 4px 10px; white-space: nowrap;
}
.quota-hint.low { color: #fbbf24; border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.08); }
.quota-hint.out { color: #f87171; border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.1); }

/* 尚未生成預測的提示卡 */
.predict-lock {
  color: #c4b5fd; font-size: 14px; line-height: 1.8;
  border: 1px dashed rgba(196,166,255,.4); background: rgba(124,58,237,.08);
}

@media (max-width: 768px) {
  .apply-wrap, .regen-wrap { flex-direction: column; align-items: stretch; gap: 8px; }
  .quota-hint { text-align: center; white-space: normal; }
}

/* ═══ 進階參數調整（收合面板）═══ */
.adv-block { margin-top: 14px; }
.adv-toggle {
  background: rgba(124,58,237,.12); border: 1px solid rgba(196,166,255,.3);
  color: #c4b5fd; border-radius: 10px; padding: 9px 14px; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 700;
}
.adv-toggle:hover { background: rgba(124,58,237,.2); }
.adv-arrow { display: inline-block; transition: transform .2s; }
.adv-toggle.open .adv-arrow { transform: rotate(180deg); }
.adv-panel { display: none; margin-top: 12px; padding: 14px; border-radius: 12px;
  background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.07); }
.adv-panel.open { display: block; }
.adv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.adv-checks { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.adv-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #cbd5e1; cursor: pointer; }
.adv-check input { width: 16px; height: 16px; accent-color: #7c3aed; cursor: pointer; }
.adv-hint { margin-top: 12px; font-size: 12px; line-height: 1.8; color: #94a3b8; }
select.period-input { cursor: pointer; }
select.period-input option { background: #0f1424; color: #e2e8f0; }

@media (max-width: 768px) {
  .adv-toggle { width: 100%; }
  .adv-grid { grid-template-columns: 1fr; }
}

/* ═══ 手機版 v3：號碼球一律排成一排 + 額度顯示 ═══ */
.quota-hero { display: inline-block; margin-top: 12px; }

@media (max-width: 768px) {
  /* 1) 導覽列擠不下時只留「剩 N 次」，沒有次數限制的才顯示「已解鎖」 */
  .auth-state:not(:only-child) { display: none; }
  .auth-left {
    font-size: 12px; font-weight: 700; color: #5eead4;
    border: 1px solid rgba(45,212,191,.35); background: rgba(45,212,191,.1);
    border-radius: 7px; padding: 3px 8px; white-space: nowrap;
  }
  .auth-logout { padding: 4px 8px; font-size: 11px; }

  /* 2) 號碼球：不管 5 顆還是 6 顆＋特別號，都自動縮到剛好一排，不換行 */
  .balls-row,
  .predict-balls-lg,
  .not-out-balls,
  .multi-balls {
    flex-wrap: nowrap;
    justify-content: center;
    gap: clamp(3px, 1.6vw, 10px);
    width: 100%;
  }
  .balls-row .ball,
  .predict-balls-lg .ball,
  .not-out-balls .ball,
  .multi-balls .ball {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    height: auto;
    aspect-ratio: 1 / 1;
    font-size: clamp(11px, 4.4vw, 22px);
  }
  /* 主推薦球可以大一點，其餘卡片內的球小一點 */
  .predict-balls-lg .ball { max-width: 64px; }
  .balls-row .ball, .not-out-balls .ball { max-width: 58px; }
  .multi-balls .ball { max-width: 44px; font-size: clamp(10px, 3.6vw, 16px); }
  .ball-separator { flex: 0 0 auto; font-size: 18px; margin: 0 1px; }
  .multi-sep { font-size: 14px; }

  /* 3) 多組推薦：標籤移到球上方，球才有整行寬度可用 */
  .multi-row { flex-wrap: wrap; gap: 6px 10px; padding: 10px; }
  .multi-label { min-width: 0; }
  .multi-balls { order: 3; width: 100%; }

  /* 4) 歷史紀錄的小球也不要換行 */
  .history-balls { flex-wrap: nowrap; }
}

/* 多組推薦的「+」分隔符（桌面版；原本寫在 JS 行內樣式，移到 CSS 才好做手機版縮放） */
.multi-sep { font-size: 20px; }

/* ═══ 手機版 v4：窄螢幕(iPhone 375px)導覽列不被擠爆，額度徽章一定看得到 ═══ */
@media (max-width: 768px) {
  .navbar { gap: 8px; }
  /* 品牌名可被壓縮／截斷，優先把空間讓給右側的額度徽章 */
  .nav-brand { min-width: 0; flex-shrink: 1; overflow: hidden; }
  .brand-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-right { flex-shrink: 0; gap: 6px; }
  .auth-box { gap: 6px; }
  .auth-left { flex-shrink: 0; }
}
/* 極窄螢幕：更新徽章讓位（資訊在別處看得到） */
@media (max-width: 400px) {
  .update-badge { display: none; }
  .brand-icon { display: none; }
}

/* 儀表板 AI 卡片內的額度小徽章 */
.pred-footer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.quota-mini { font-size: 11px; padding: 2px 8px; }

/* ═══════════════════════════════════════════════════════
   熱門頁：大卡 + 縮圖磚 + 彈窗（混合版；手機優先）
   ═══════════════════════════════════════════════════════ */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);   /* 手機：小卡一列兩欄(左右左右)；內容原生尺寸不縮小 */
  gap: 12px;
  align-items: start;
}
.dash-grid .dash-item[data-pres="card"] { grid-column: 1 / -1; }  /* 大卡整寬 */
.dash-grid .dash-tile { grid-column: span 1; }                    /* 小卡半寬、兩欄 */

/* 後台把某版位設成「大卡」→ 手機也不縮圖/不彈窗，內容完整直接呈現、整寬 */
.dash-tile[data-pres="card"] {
  grid-column: 1 / -1 !important;
  min-height: 0; background: transparent; border: none; padding: 0;
  cursor: default; overflow: visible; border-radius: 0;
}
.dash-tile[data-pres="card"]:hover { transform: none; box-shadow: none; border-color: transparent; }
.dash-tile[data-pres="card"] .tile-preview {
  position: static; height: auto; overflow: visible; pointer-events: auto;
  -webkit-mask-image: none; mask-image: none;
}
.dash-tile[data-pres="card"] .tile-preview > .dash-content {
  position: static; top: auto; left: auto; padding: 0;
  width: auto !important; transform: none !important;
}
.dash-tile[data-pres="card"] .tile-cap { display: none; }
/* 後台關閉的區塊 */
.dash-item[data-off="1"] { display: none !important; }
/* 通行碼權限未開放的版位：不是隱藏，而是半透明模糊遮罩擋住(讓會員知道有這功能→可洽詢開通) */
.dash-tile[data-noperm] { position: relative; cursor: pointer; }   /* 點了會跳版主 LINE */
.dash-tile[data-noperm] .tile-preview, .dash-tile[data-noperm] .tile-cap { pointer-events: none; }
.dash-tile[data-noperm] .tile-preview { filter: blur(4px); opacity: .55; }
.dash-tile[data-noperm] .tile-cap { opacity: .5; }
.dash-tile[data-noperm]::after {
  content: '🔒 私訊版主解鎖';
  position: absolute; inset: 0; z-index: 6;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: rgba(12,16,40,.5); backdrop-filter: blur(2px);
  border-radius: 16px; color: #c4b5fd; font-weight: 700; font-size: .9rem;
}

/* ≥769px 電腦版：取消縮圖磚/彈窗，回到「原本的完整卡片」版型 */
@media (min-width: 769px) {
  .dash-grid { grid-template-columns: repeat(6, 1fr); gap: 20px; }
  .dash-grid > .dash-item { grid-column: 1 / -1; }                 /* 預設整寬堆疊 */
  /* 熱門頁：最新開獎 + AI 預測 並排 2-up */
  #dashGrid > [data-block="latest"], #dashGrid > [data-block="predict"] { grid-column: span 3; }
  /* 號碼分析頁：奇偶/號碼段/總和 3-up；頭數/尾數 2-up（還原原本排列） */
  #analysisGrid > [data-block="oddeven"],
  #analysisGrid > [data-block="range"],
  #analysisGrid > [data-block="sum"] { grid-column: span 2; }
  #analysisGrid > [data-block="head"],
  #analysisGrid > [data-block="tail"] { grid-column: span 3; }

  /* 取消縮圖化：磚變透明容器、內容全尺寸正常呈現、不做遮罩/縮放 */
  .dash-tile {
    min-height: 0; background: transparent; border: none; padding: 0;
    cursor: default; overflow: visible; border-radius: 0;
  }
  .dash-tile:hover { transform: none; box-shadow: none; border-color: transparent; }
  .dash-tile:focus-visible { outline: none; }
  .tile-preview {
    position: static; overflow: visible; pointer-events: auto; flex: none; height: auto;
    -webkit-mask-image: none; mask-image: none;
  }
  .tile-preview > .dash-content {
    position: static; top: auto; left: auto; padding: 0;
    width: auto !important; transform: none !important;
  }
  .tile-cap { display: none; }
}

/* 縮圖磚 */
/* 縮圖磚：直接包住該區塊「真實內容」的縮小預覽 */
.dash-tile {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 160px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  transition: transform .15s, border-color .2s, box-shadow .2s;
}
.dash-tile:hover { transform: translateY(-3px); border-color: rgba(124,58,237,.5); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.dash-tile:active { transform: translateY(-1px); }
.dash-tile:focus-visible { outline: 2px solid var(--purple2); outline-offset: 2px; }

/* 預覽區：內容以「手機全寬(設計寬度)」渲染，再整體 scale 縮小塞進格子(＝完整畫面的迷你版，不是裁角落)。
   固定高度視窗 + 下方漸隱裁切。 */
.tile-preview {
  position: relative; height: 215px; overflow: hidden;
  pointer-events: none;                 /* 縮圖不可互動，點擊交給磚 */
  -webkit-mask-image: linear-gradient(180deg, #000 68%, transparent);
          mask-image: linear-gradient(180deg, #000 68%, transparent);
}
.tile-preview > .dash-content {
  position: absolute; top: 8px; left: 8px;
  width: var(--tile-dsgn-w, 375px);
  transform: scale(var(--tile-scale, .46));
  transform-origin: top left;
}
/* 縮圖預覽裡的內層卡片去背景/去邊框，讓內容直接融入磚(避免巢狀卡片的小圓角看起來像銳利直角) */
.tile-preview .card { margin: 0; background: transparent !important; border-color: transparent !important; box-shadow: none !important; }
.tile-cap {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 12px;
  font-size: .82rem; font-weight: 700; color: var(--text);
  border-top: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.18);
}
.tile-cap-ico { font-size: 1rem; }

/* 手機版：圖表比例縮小、字加大(全面提升可讀性) */
@media (max-width: 768px) {
  .block-modal-body .chart-wrap.small { min-height: 180px; }   /* 圓餅/小圖縮小一點 */
  .block-modal-body .ht-rows { font-size: 1rem; }              /* 頭尾數明細字加大 */
  .block-modal-body .ht-rows > div { padding: 9px 8px; }
  .block-modal-body .ht-rows .ht-label { font-size: 1.05rem; font-weight: 700; }
  .block-modal-body .num-pill { font-size: 1.05rem; padding: 8px 12px; }   /* 熱門/冷門號碼球加大 */
  .block-modal-body .stats-table { font-size: .92rem; }
  .block-modal-body .stats-table th, .block-modal-body .stats-table td { padding: 9px 6px; }
}

/* 維護中全站遮罩 */
.maint-overlay {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(circle at 50% 35%, #131a3a, #060814 70%);
}
.maint-overlay[hidden] { display: none; }
.maint-box {
  text-align: center; max-width: 460px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1);
  border-radius: 22px; padding: 44px 30px;
  box-shadow: 0 30px 90px rgba(0,0,0,.6);
}
.maint-icon { font-size: 62px; line-height: 1; margin-bottom: 14px; }
.maint-box h1 {
  font-size: 1.7rem; font-weight: 900; margin-bottom: 12px;
  background: linear-gradient(135deg, var(--gold2, #fbbf24), var(--purple2, #9f67ff));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.maint-box p { color: var(--muted, #94a3b8); font-size: 1rem; line-height: 1.7; }

/* 玩法輸入控制：五不出牌球數選擇器(在彈窗內操作) */
.notout-ctrl {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 10px 0 14px; font-size: .9rem; color: var(--text);
}
.step-btn {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 9px; border: 1px solid rgba(124,58,237,.5);
  background: rgba(124,58,237,.16); color: #c4b5fd;
  font-size: 20px; font-weight: 800; line-height: 1; cursor: pointer;
  transition: background .15s, transform .1s;
}
.step-btn:hover { background: rgba(124,58,237,.3); }
.step-btn:active { transform: scale(.92); }
.step-val { min-width: 56px; text-align: center; font-family: Orbitron, monospace; }
.step-val b { color: var(--purple2); font-size: 1.15rem; }

/* 碰數計算結果 */
.pong-result { text-align: center; padding: 14px 0 4px; }
.pong-big { font-family: Orbitron, monospace; font-weight: 900; font-size: clamp(2.4rem, 8vw, 3.4rem);
  line-height: 1; background: linear-gradient(135deg, #34d399, #60a5fa); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.pong-unit { font-size: 1.2rem; }
.pong-formula { color: var(--muted); font-size: .9rem; margin-top: 6px; }
.pong-cost-row { margin-top: 14px; font-size: .95rem; color: var(--text); display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.pong-price { width: 90px; margin: 0; text-align: center; }
.pong-cost-row b { color: #34d399; font-size: 1.1rem; }

/* 彈窗（縮圖點擊 → 從縮圖位置放大；FLIP 動畫由 JS 控制 transform） */
.block-modal { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.block-modal[hidden] { display: none; }
.block-modal-backdrop { position: absolute; inset: 0; background: rgba(4,6,15,.72); backdrop-filter: blur(4px); opacity: 0; transition: opacity .25s; }
.block-modal.show .block-modal-backdrop { opacity: 1; }
.block-modal-panel {
  position: relative; z-index: 1;
  width: min(880px, 100%);
  max-height: 88vh; overflow-x: hidden; overflow-y: auto;   /* 鎖橫向，只留直向捲動 */
  background: var(--bg2);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  transform-origin: top left;
  will-change: transform, opacity;
}
.block-modal-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px;
  background: var(--bg2);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.block-modal-title { font-size: 1.05rem; font-weight: 800; color: var(--text); }
.block-modal-close {
  width: 34px; height: 34px; border-radius: 9px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  color: var(--text); cursor: pointer; font-size: 15px; line-height: 1;
}
.block-modal-close:hover { background: rgba(239,68,68,.18); border-color: rgba(239,68,68,.5); color: #f87171; }
/* 玩法/區塊的詳細說明(彈窗最上方，介紹這個功能怎麼看) */
.block-modal-desc {
  padding: 13px 18px; font-size: .88rem; line-height: 1.8; color: var(--text);
  background: rgba(124,58,237,.09); border-left: 3px solid var(--purple2);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.block-modal-desc:empty { display: none; }

/* 玩法彈窗頂部的「近幾期」獨立範圍選擇器 */
.block-modal-range {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 11px 16px; border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
}
.block-modal-range .range-label { font-size: .82rem; color: var(--muted); margin-right: 2px; font-weight: 600; }
.range-btn {
  font-size: .82rem; padding: 6px 12px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04);
  color: #8a92c0; font-weight: 600; cursor: pointer; transition: background .15s, color .15s;
}
.range-btn:hover { background: rgba(124,58,237,.15); color: #c4b5fd; }
.range-btn.active { background: rgba(124,58,237,.28); border-color: rgba(196,166,255,.5); color: #ddd6fe; }
/* 自訂期數輸入 */
.range-custom { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; color: var(--muted); }
.range-custom.on { color: #ddd6fe; }
.range-input {
  width: 62px; padding: 5px 6px; margin: 0; text-align: center;
  border-radius: 8px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05); color: var(--text); font-size: .85rem;
}
.range-custom.on .range-input { border-color: rgba(196,166,255,.6); background: rgba(124,58,237,.15); }
.range-apply {
  font-size: .8rem; padding: 6px 11px; border-radius: 8px; margin-left: 2px;
  border: 1px solid rgba(124,58,237,.5); background: rgba(124,58,237,.2);
  color: #c4b5fd; font-weight: 700; cursor: pointer;
}
.range-apply:hover { background: rgba(124,58,237,.35); }

/* 彈窗內容：手機「原生寬度」呈現(不縮放)，內部區塊套用各自的手機版 CSS；
   面板只直向捲動、橫向鎖死(寬表格用自己的 .table-wrap 捲，不動到面板)。 */
.block-modal-body { padding: 16px 16px 22px; }
.block-modal-body > .dash-content { width: 100%; }
.block-modal-body .card { margin: 0; }
.block-modal-body .chart-row,
.block-modal-body .special-grid { grid-template-columns: 1fr; margin: 0; gap: 14px; }  /* 彈窗內一律單欄堆疊 */

/* 折疊卡:內容含 2 項以上時，收合只露一點內容+底部漸層(像首頁縮圖預覽)，點標題向下延展 */
.block-modal-body .acc-card > .card-title {
  cursor: pointer; display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
  user-select: none;
}
.block-modal-body .acc-card > .card-title::after {
  content: '▾'; margin-left: auto; color: var(--purple2); font-size: 1.05rem;
  transition: transform .25s; flex-shrink: 0;
}
.block-modal-body .acc-card.open > .card-title::after { transform: rotate(180deg); }

/* 收合狀態:露一點(max-height)+ 底部漸層淡出，跟首頁縮圖同一種質感 */
.block-modal-body .acc-card > .acc-body {
  max-height: 118px; overflow: hidden;
  transition: max-height .34s cubic-bezier(.25,.8,.3,1);
  -webkit-mask-image: linear-gradient(180deg, #000 58%, transparent);
          mask-image: linear-gradient(180deg, #000 58%, transparent);
}
.block-modal-body .acc-card.open > .acc-body {
  -webkit-mask-image: none; mask-image: none;
}
.block-modal-body .acc-card:hover { border-color: rgba(124,58,237,.4); }
.block-modal-body .chart-wrap { min-height: 220px; }
.block-modal-body .table-wrap { overflow-x: auto; }
body.modal-open { overflow: hidden; }

@media (max-width: 640px) {
  .block-modal { padding: 10px; }               /* 手機置中，四周留白讓邊界不貼螢幕 */
  .block-modal-panel { max-height: 92vh; border-radius: 18px; }
  .block-modal-desc { padding: 12px 14px; font-size: .85rem; }
  .block-modal-body { padding: 14px 12px 20px; }
}

/* ═══ 玩法計算器(對齊 WG 下注盤) ═══ */
.play-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.play-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(160deg, rgba(124,58,237,.16), rgba(37,99,235,.1)); border: 1px solid rgba(124,58,237,.3);
  border-radius: 14px; padding: 16px 8px; cursor: pointer; transition: .15s; text-align: center; }
.play-tile:active { transform: scale(.96); }
.play-tile .pt-ico { font-size: 26px; line-height: 1; }
.play-tile .pt-name { font-size: 14px; font-weight: 800; color: var(--text); }
.play-tile .pt-sub { font-size: 10.5px; color: var(--sub); }
.play-tile.soon { opacity: .5; }
.play-tile.soon .pt-sub { color: var(--gold2); }

/* 計算器彈窗(底部上滑 sheet) */
#playModal { position: fixed; inset: 0; z-index: 3000; display: none; }
#playModal.show { display: block; }
.pcalc-backdrop { position: absolute; inset: 0; background: rgba(4,6,15,.72); backdrop-filter: blur(2px); }
/* 手機瀏海/網址列：用 dvh(動態視窗)避免面板比可視區高、頂部被蓋住；上緣預留 safe-area */
.pcalc-panel { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column;
  max-height: 90vh;
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 12px);
  background: #0b1022; border-top: 1px solid rgba(124,58,237,.4); border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 40px rgba(0,0,0,.6); transform: translateY(100%); transition: transform .28s cubic-bezier(.22,1,.36,1); }
#playModal.show .pcalc-panel { transform: translateY(0); }
.pcalc-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.08);
  position: sticky; top: 0; z-index: 5; background: #0b1022; border-radius: 20px 20px 0 0; }
.pcalc-head .pc-ico { font-size: 22px; }
.pcalc-head .pc-title { flex: 1; font-size: 16px; font-weight: 800; }
.pcalc-x { width: 46px; height: 46px; flex-shrink: 0; border-radius: 12px; background: rgba(255,255,255,.08); border: 1px solid var(--line, rgba(255,255,255,.12)); color: var(--text); font-size: 24px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.pcalc-x:active { background: rgba(255,255,255,.16); transform: scale(.94); }
.pcalc-body { flex: 1 1 auto; min-height: 0; padding: 14px 16px 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pcalc-desc { font-size: 12.5px; color: var(--sub); line-height: 1.7; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06); border-radius: 10px; padding: 9px 11px; margin-bottom: 12px; }
.pcalc-quickbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.pcalc-qbtn { padding: 8px 12px; border-radius: 9px; background: rgba(59,130,246,.14); border: 1px solid rgba(59,130,246,.34); color: #bfdbfe; font-size: 13px; font-weight: 700; }
.pcalc-qbtn[data-quick="ai"] { background: linear-gradient(135deg,#3b82f6,#7c3aed); border-color: transparent; color: #fff; box-shadow: 0 3px 12px rgba(59,130,246,.4); }
.pcalc-selcount { margin-left: auto; font-size: 12px; color: var(--sub); }
.pcalc-selcount b { color: var(--gold2); font-size: 15px; }
/* 號碼盤 */
.pcalc-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }
.pcalc-ball { aspect-ratio: 1; border-radius: 50%; background: rgba(255,255,255,.06); border: 1.5px solid rgba(255,255,255,.14);
  color: var(--text); font-family: Orbitron, monospace; font-weight: 700; font-size: 16px; transition: .12s; }
.pcalc-ball.on { background: radial-gradient(circle at 38% 32%, #a78bfa, #6d28d9 82%); border-color: #c4b5fd; color: #fff; box-shadow: 0 0 12px rgba(124,58,237,.6); transform: scale(1.05); }
/* 下注區 */
.pcalc-bet { border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; }
.pcalc-betrow { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.pcalc-betrow.off { opacity: .4; }
.pcalc-star { width: 40px; font-weight: 800; font-size: 14px; }
.pcalc-comb { min-width: 62px; font-weight: 800; color: var(--gold2); font-variant-numeric: tabular-nums; }
.pcalc-comb i { font-style: normal; font-size: 11px; color: var(--sub); font-weight: 600; }
.pcalc-betrow .pcalc-x { all: unset; color: var(--sub); }
.pcalc-amt { flex: 1; }
.pcalc-input { width: 100%; padding: 9px 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); border-radius: 9px; color: var(--text); font-size: 16px; text-align: right; }
.pcalc-input:focus { outline: none; border-color: var(--purple); }
.pcalc-eq { min-width: 74px; text-align: right; font-size: 13px; font-weight: 700; color: var(--text); }
.pcalc-winhint { font-size: 12px; color: #86efac; padding: 2px 0 6px 48px; }
.pcalc-winhint.hide { display: none; }
.pcalc-winhint b { color: #4ade80; font-size: 13px; }
.pcalc-total { margin-top: 10px; padding: 12px; border-radius: 12px; background: rgba(124,58,237,.12); border: 1px solid rgba(124,58,237,.3); }
.pcalc-total-line { font-size: 14px; }
.pcalc-total-line .cost { color: var(--gold2); font-size: 17px; }
.pcalc-total-win { margin-top: 6px; font-size: 13px; color: #86efac; }
.pcalc-total-win b { color: #4ade80; font-size: 16px; }
/* 底部 AI 預測按鈕 */
.pcalc-foot { flex: 0 0 auto; padding: 12px 16px calc(14px + env(safe-area-inset-bottom,0px)); border-top: 1px solid rgba(255,255,255,.08); background: #0b1022; }
.pcalc-ai-btn { width: 100%; padding: 15px; border-radius: 13px; background: linear-gradient(135deg,#3b82f6,#7c3aed); color: #fff; font-size: 16px; font-weight: 800; animation: pcalcGlow 1.8s ease-in-out infinite; }
.pcalc-ai-btn:disabled { opacity: .6; animation: none; }
/* 固定大小、只有周圍光暈一明一暗，不放大縮小 */
@keyframes pcalcGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(59,130,246,.5), 0 0 20px rgba(124,58,237,.3); }
  50%      { box-shadow: 0 0 18px rgba(96,165,250,.9), 0 0 36px rgba(124,58,237,.7), 0 0 54px rgba(59,130,246,.4); }
}
.pcalc-foot .quota-hint { display: block; text-align: center; font-size: 12px; margin-top: 8px; color: var(--sub); }

/* 玩法計算器 v2：參數輸入 + AI出牌結果 + 投注試算表 */
.pcalc-param { margin-bottom: 14px; }
.pcalc-plabel { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.pcalc-stepper { display: flex; align-items: center; gap: 12px; }
.pc-step { width: 42px; height: 42px; border-radius: 11px; background: rgba(124,58,237,.18); border: 1px solid rgba(124,58,237,.4); color: #c4b5fd; font-size: 22px; font-weight: 800; line-height: 1; }
.pc-step:active { transform: scale(.92); }
.pcalc-stepper b { min-width: 46px; text-align: center; font-family: Orbitron, monospace; font-size: 26px; font-weight: 800; color: var(--gold2); }
.pcalc-shint { font-size: 12px; color: var(--sub); }
.pcalc-amtbox { margin-bottom: 14px; }
.pcalc-amt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pcalc-amt-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--sub); font-weight: 700; }
.pcalc-amt-grid .pcalc-input { text-align: center; }
/* 結果區 */
.pcalc-result { border-top: 1px dashed rgba(255,255,255,.12); padding-top: 14px; }
.pcalc-empty { text-align: center; color: var(--sub); font-size: 13px; padding: 20px 10px; line-height: 1.8; }
.pcalc-empty b { color: var(--gold2); }
.pcalc-outhead { font-size: 13px; color: var(--sub); margin-bottom: 10px; text-align: center; }
.pcalc-outhead b { color: var(--gold2); font-size: 16px; }
.pcalc-outballs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 16px; }
.pcalc-outball { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 38% 32%, #a78bfa, #6d28d9 82%); color: #fff; font-family: Orbitron, monospace; font-weight: 800; font-size: 17px; box-shadow: 0 3px 10px rgba(124,58,237,.5); }
.pcalc-tabletitle { font-size: 13px; font-weight: 800; color: var(--purple2, #c4b5fd); margin-bottom: 8px; }
.pcalc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pcalc-table th { background: rgba(124,58,237,.18); color: #ddd; font-weight: 700; padding: 8px 6px; text-align: center; font-size: 12px; }
.pcalc-table th:first-child { border-radius: 8px 0 0 0; }
.pcalc-table th:last-child { border-radius: 0 8px 0 0; }
.pcalc-table td { padding: 9px 6px; text-align: center; border-bottom: 1px solid rgba(255,255,255,.06); font-variant-numeric: tabular-nums; }
.pcalc-table .c-comb { color: var(--gold2); font-weight: 800; }
.pcalc-table .c-win { color: #4ade80; font-weight: 800; }

/* 玩法計算器 v3：單一金額框 / 分類推薦 / 立柱多注 / 淨賺 */
.pcalc-amt-one { width: 100%; text-align: center; }
.pcalc-hint2 { font-size: 13px; color: var(--sub); text-align: center; padding: 6px 0 2px; }
.pcalc-catbig { font-size: 20px; color: var(--gold2); }
.pcalc-catnote { text-align: center; font-size: 12px; color: var(--sub); margin: -6px 0 12px; }
.pcalc-line { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.pcalc-line-tag { flex-shrink: 0; font-size: 12px; font-weight: 800; color: var(--purple2, #c4b5fd); background: rgba(124,58,237,.18); padding: 4px 8px; border-radius: 7px; }
.pcalc-line .pcalc-outballs { margin-bottom: 0; }
.pcalc-line .pcalc-outball { width: 38px; height: 38px; font-size: 15px; }
.pcalc-total-win b.neg { color: #f87171; }
.pcalc-table .c-win.neg { color: #f87171; }

/* AI預測鈕：沒通行碼時，按鈕本體保持原樣但變灰(被鎖鏈罩住) */
.pcalc-ai-wrap { position: relative; }
.pcalc-ai-btn.locked { background: #3a4152; color: #7f889c; box-shadow: none; animation: none; filter: grayscale(.4) brightness(.8); }
/* 疊在按鈕上的鎖鏈 + 加入解鎖提示鈕 */
.pcalc-lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 13px; overflow: hidden; }
.pcalc-lock[hidden] { display: none; }
.pcalc-lock-chain { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; letter-spacing: 6px; opacity: .55; transform: rotate(-8deg) scale(1.3); pointer-events: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
/* 解鎖鈕：跟首頁綠色「免費加入解鎖」一致 */
.pcalc-lock-btn { position: relative; z-index: 2; display: inline-block; text-decoration: none; padding: 11px 20px; border-radius: 12px; background: linear-gradient(135deg,#06c755,#05a94a); color: #fff; font-size: 14.5px; font-weight: 900; box-shadow: 0 4px 16px rgba(6,199,85,.5); animation: greenGlow 1.8s ease-in-out infinite; }
.pcalc-lock-btn:active { transform: scale(.96); }
@keyframes greenGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(6,199,85,.5), 0 0 16px rgba(6,199,85,.3); }
  50%      { box-shadow: 0 0 16px rgba(6,199,85,.9), 0 0 30px rgba(6,199,85,.6); }
}

/* AI 本日推薦玩法 */
.daily-play-loading { text-align: center; color: var(--sub); padding: 18px; font-size: 14px; }
.daily-play-main { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(245,158,11,.14), rgba(124,58,237,.14)); border: 1px solid rgba(245,158,11,.35); cursor: pointer; transition: .15s; }
.daily-play-main:active { transform: scale(.98); }
.daily-play-main .dp-ico { font-size: 40px; line-height: 1; flex-shrink: 0; }
.daily-play-main .dp-info { flex: 1; min-width: 0; }
.daily-play-main .dp-name { font-size: 20px; font-weight: 900; color: var(--text); }
.daily-play-main .dp-sub { font-size: 12px; color: var(--gold2); margin-top: 3px; }
.daily-play-main .dp-go { flex-shrink: 0; padding: 10px 14px; border-radius: 10px; background: linear-gradient(135deg,#f59e0b,#7c3aed); color: #fff; font-size: 13px; font-weight: 800; box-shadow: 0 4px 14px rgba(245,158,11,.4); }

/* 加籌碼列(娛樂城式) */
.pcalc-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.pcalc-chip { padding: 8px 12px; border-radius: 20px; background: linear-gradient(160deg, #fde68a, #f59e0b); color: #4a2800; font-size: 13px; font-weight: 800; border: 2px solid rgba(255,255,255,.35); box-shadow: 0 2px 6px rgba(245,158,11,.35); }
.pcalc-chip:active { transform: scale(.92); }
.pcalc-chip.clear { background: rgba(255,255,255,.08); color: var(--sub); border-color: rgba(255,255,255,.15); box-shadow: none; }

/* 玩法計算器磚：權限未開放(點了跳版主 LINE) */
.play-tile[data-noperm] { position: relative; cursor: pointer; }
.play-tile[data-noperm] .pt-ico, .play-tile[data-noperm] .pt-name, .play-tile[data-noperm] .pt-sub { filter: blur(3px); opacity: .4; pointer-events: none; }
.play-tile[data-noperm]::after { content: '🔒'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 24px; background: rgba(12,16,40,.35); border-radius: 14px; }

/* 試算表下方：來嗨廣告(米黃底紅字) + 找版主申請鈕(變大變小+發光) */
.pcalc-promo { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  background: linear-gradient(160deg, #fdf6e3, #faf0d0); border: 1px solid #e9d9a8; }
/* 由左至右閃過的光(同 FK/大將軍落地頁按鈕) */
.pcalc-promo::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.85), transparent);
  transform: skewX(-20deg); pointer-events: none;
  animation: promoShine 2.6s ease-in-out infinite;
}
@keyframes promoShine {
  0%   { left: -60%; }
  55%  { left: 130%; }
  100% { left: 130%; }
}
.pcalc-promo-txt { flex: 1; min-width: 0; color: #c0392b; font-weight: 800; line-height: 1.6; font-size: 13.5px; }
.pcalc-promo-txt b { color: #b91c1c; font-size: 16px; }
.pcalc-promo-btn { flex-shrink: 0; text-align: center; text-decoration: none; padding: 11px 14px; border-radius: 12px;
  background: linear-gradient(135deg, #ef4444, #b91c1c); color: #fff; font-weight: 900; font-size: 13.5px; line-height: 1.25;
  animation: promoPulse 1.1s ease-in-out infinite; will-change: transform; }
@keyframes promoPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 8px rgba(239,68,68,.5); }
  50%      { transform: scale(1.1); box-shadow: 0 0 18px rgba(239,68,68,1), 0 0 30px rgba(239,68,68,.6); }
}

/* 首頁「AI 智能預測」下方：投注成本浮動框(沿用 .pcalc-promo 版型；整框輕微放大縮小浮動；文字用 canvas 防抓取) */
.cost-promo { grid-column: 1 / -1; width: 100%; margin-top: 12px; padding: 8px 12px; gap: 10px;
  animation: costFloat 1.7s ease-in-out infinite; will-change: transform; }
@keyframes costFloat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
.cost-promo .pcalc-promo-btn { animation: none; box-shadow: 0 0 10px rgba(239,68,68,.55); padding: 8px 13px; font-size: 12.5px; }   /* 整框已浮動→按鈕不再各自 pulse */
.cost-promo-txt { display: flex; align-items: center; flex-wrap: nowrap; column-gap: 34px; min-width: 0; flex: 1; }
canvas.costc { display: block; height: auto !important; }
/* 手機版：成本字維持「一整排不換行」，按鈕改放正下方(才有寬度容納三組) */
@media (max-width: 768px) {
  .cost-promo { flex-direction: column; align-items: center; gap: 8px; }
  .cost-promo-txt { width: 100%; flex: none; justify-content: center; column-gap: 12px; }
  .cost-promo .pcalc-promo-btn { width: 100%; }
}

/* 熱門頁的玩法精選卡(複製自玩法選單，點了開計算器) */
.dash-grid .play-promo { grid-column: span 1; }

/* AI 預測鈕：非會員出牌後變成綠色「免費加入解鎖」 */
.pcalc-ai-btn.gogreen { background: linear-gradient(135deg,#06c755,#05a94a); box-shadow: none; animation: greenGlow 1.8s ease-in-out infinite; }
/* 非會員 teaser：只把「AI 號碼」從第 3 個起模糊(投注試算表/可贏金額都照常顯示，讓人看到價值)；無來嗨廣告 */
.member-locked #pcBody.teaser .pcalc-outballs .pcalc-outball:nth-child(n+3) { filter: blur(6px); pointer-events: none; user-select: none; }
