/* ═══════════════════════════════════════════════════════════════════════
   泊樂娛樂城 · score-com-tw 世界盃計分板彈窗  (prefix: sb-)
   綠茵球場 + LED 紅/黃 + 金 · self-contained · 不與其他站共用 class / 配色 / 機制
   ═══════════════════════════════════════════════════════════════════════ */

.sb-footer-promo,
.sb-backdrop {
  --sky-1:#04111f; --sky-2:#072a14;
  --led-amber:#ffd24a; --led-gold:#ffb020; --led-white:#eafff0; --live-red:#ff3b3b;
  --ink:#0a1208; --line:rgba(255,255,255,.12);
  --card-top:#04111f; --card-bottom:#072a14;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "Microsoft JhengHei", "Segoe UI", sans-serif;
}
.sb-footer-promo *,
.sb-backdrop * { box-sizing: border-box; }
.sb-mono { font-family: "SFMono-Regular", Consolas, "Courier New", monospace; }

.sb-promo-active { padding-bottom: clamp(86px, 17vw, 128px); }

/* ── Footer banner ────────────────────────────────────────────────── */
.sb-footer-promo {
  position: fixed;
  z-index: 2147483000;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  max-width: 980px;
  margin: 0 auto;
  border: 1px solid rgba(255, 210, 74, 0.45);
  border-radius: 10px;
  background: #04111f;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.44);
  overflow: hidden;
  transform: translateY(18px);
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease;
}
.sb-footer-promo.is-visible { transform: translateY(0); opacity: 1; }
.sb-footer-promo a { display: block; min-height: 64px; }
.sb-footer-promo img { display: block; width: 100%; height: auto; }

.sb-footer-text {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 14px 46px 14px 16px;
  color: #fff; font-size: 15px; font-weight: 700; flex-wrap: wrap; text-decoration: none;
}
.sb-footer-badge {
  padding: 2px 8px; border-radius: 999px; background: var(--live-red);
  color: #fff; font-size: 12px; font-weight: 800;
}
.sb-footer-cta-pill {
  padding: 4px 12px; border-radius: 999px;
  background: linear-gradient(100deg, #ffd24a, #ffb020 60%, #22c55e);
  color: #0a1208; font-size: 13px; font-weight: 900; white-space: nowrap;
}

.sb-footer-close,
.sb-close {
  position: absolute; z-index: 8; display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 12px;
  color: #dbe7f0; background: rgba(8, 20, 30, 0.85); cursor: pointer;
  line-height: 1;
}
.sb-footer-close { top: 6px; right: 6px; width: 34px; height: 34px; border-radius: 999px; font-size: 22px; }

/* ── Backdrop ─────────────────────────────────────────────────────── */
.sb-backdrop {
  position: fixed; inset: 0; z-index: 2147483001;
  display: grid; place-items: center; padding: 18px;
  background: rgba(2, 8, 14, 0.82);
  opacity: 0; transition: opacity 180ms ease;
}
.sb-backdrop.is-visible { opacity: 1; }

/* ── Card = flex column, sticky three-section ─────────────────────── */
.sb-card {
  position: relative;
  width: min(94vw, 540px);
  max-height: min(92vh, 800px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #e8eef4;
  font-size: 16px; line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  border-radius: 22px;
  border: 1px solid rgba(120, 200, 150, 0.28);
  background: linear-gradient(180deg, var(--sky-1) 0%, #06182b 42%, var(--sky-2) 100%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 210, 74, 0.1), 0 0 70px rgba(22, 163, 74, 0.22);
  transform: translateY(14px) scale(0.985);
  transition: transform 180ms ease;
}
.sb-backdrop.is-visible .sb-card { transform: translateY(0) scale(1); }
.sb-close { top: 12px; right: 12px; width: 44px; height: 44px; font-size: 22px; transition: background .15s, transform .15s; }
.sb-close:hover { background: rgba(255, 59, 59, 0.9); color: #fff; transform: rotate(90deg); }

/* ── Stadium pitch (behind scroll zone only) ──────────────────────── */
.sb-stadium { position: absolute; inset: 0; overflow: hidden; border-radius: 22px; pointer-events: none; z-index: 0; }
.sb-stadium .sb-glow-top {
  position: absolute; top: -90px; left: 50%; width: 520px; height: 240px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(120, 200, 255, 0.28), transparent 70%); filter: blur(6px);
}
.sb-pitch { position: absolute; left: 0; right: 0; bottom: 0; height: 150px; }

/* ── Sticky header (× + LIVE always visible) ──────────────────────── */
.sb-head {
  position: relative; z-index: 6; flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 16px 58px 14px 22px;
  background: linear-gradient(180deg, var(--card-top) 70%, rgba(4, 17, 31, 0));
}
.sb-live {
  display: inline-flex; align-items: center; gap: 7px; background: rgba(255, 59, 59, 0.14);
  border: 1px solid rgba(255, 59, 59, 0.5); color: #ff9d9d; font-weight: 800; font-size: 14px;
  padding: 5px 12px; border-radius: 999px; letter-spacing: 0.06em;
}
.sb-live .sb-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--live-red);
  box-shadow: 0 0 10px var(--live-red); animation: sb-blink 1s steps(2, start) infinite; }
@keyframes sb-blink { 50% { opacity: 0.15; } }
.sb-htitle { font-size: 16px; font-weight: 900; color: #fff; letter-spacing: 0.02em; }
.sb-htitle b { color: var(--led-amber); }
.sb-brand { margin-left: auto; font-size: 13px; color: #aacdff; font-weight: 700; letter-spacing: 0.05em; }

/* ── Scrollable body (ONLY scroller) ──────────────────────────────── */
.sb-body {
  position: relative; z-index: 3; flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  padding: 4px 22px 20px;
}
.sb-header { margin: 4px 0 2px; text-align: center; }
.sb-sub { font-size: 15px; color: #cfe1ef; margin-top: 6px; line-height: 1.6; }
.sb-sub b { color: var(--led-amber); }

/* ── FEATURED LED scoreboard panel + reveal overlay ───────────────── */
.sb-board-wrap { position: relative; }
.sb-board {
  position: relative; margin: 14px auto 4px; border-radius: 14px;
  background: linear-gradient(180deg, #020a10, #04141d);
  border: 1px solid rgba(255, 210, 74, 0.25);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.7), 0 0 0 4px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.45);
  padding: 16px 14px 14px; overflow: hidden;
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}
.sb-board::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px, rgba(0,0,0,.32) 3px, rgba(0,0,0,.32) 4px);
  mix-blend-mode: multiply; border-radius: 14px;
}
.sb-board::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1; opacity: 0.5;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1.4px);
  background-size: 4px 4px; border-radius: 14px;
}
.sb-board.sb-board-charging { animation: sb-charge 0.24s steps(2, start) 5; }
@keyframes sb-charge { 50% { box-shadow: inset 0 0 30px rgba(0,0,0,.7), 0 0 0 4px rgba(0,0,0,.3), 0 0 40px rgba(255,210,74,.55); } }
.sb-board.sb-board-locked {
  border-color: rgba(255, 210, 74, 0.6);
  box-shadow: inset 0 0 30px rgba(0,0,0,.6), 0 0 0 4px rgba(0,0,0,.3), 0 0 46px rgba(255,200,60,.5);
}
.sb-board-inner { position: relative; z-index: 3; }

.sb-board-label {
  text-align: center; font-size: 11px; letter-spacing: 0.4em; color: #6cc287;
  text-transform: uppercase; margin-bottom: 4px; font-weight: 700;
}
.sb-feat-tag {
  display: inline-block; margin: 0 auto 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.1em;
  color: #04140b; background: linear-gradient(100deg, var(--led-amber), var(--led-gold));
  padding: 3px 10px; border-radius: 999px;
}
.sb-feat-tag-wrap { text-align: center; }
.sb-score-row { display: flex; align-items: center; justify-content: center; gap: 14px; }
.sb-score {
  font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
  font-size: clamp(48px, 16vw, 74px); line-height: 1; font-weight: 900; color: var(--led-amber);
  text-shadow: 0 0 6px rgba(255,210,74,.9), 0 0 18px rgba(255,170,40,.7), 0 0 40px rgba(255,150,20,.45);
  letter-spacing: 0.04em; animation: sb-flicker 4.5s infinite;
}
@keyframes sb-flicker { 0%, 96%, 100% { opacity: 1; } 97% { opacity: 0.72; } 98.5% { opacity: 0.9; } }
.sb-score-side { text-align: left; line-height: 1.2; }
.sb-score-side .sb-cur { font-size: 16px; color: #dff5e6; font-weight: 800; }
.sb-score-side .sb-unit { font-size: 13px; color: #9fcdb1; letter-spacing: 0.05em; }

.sb-board-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  margin-top: 10px; padding-top: 9px; border-top: 1px dashed rgba(120, 200, 150, 0.3);
  font-family: "SFMono-Regular", Consolas, "Courier New", monospace; font-size: 13px; color: #9fcdb1;
}
.sb-board-foot .sb-cond span { color: var(--led-white); font-weight: 800; }

/* ── Light-up action row ──────────────────────────────────────────── */
.sb-action { display: grid; place-items: center; gap: 6px; margin-top: 10px; }
.sb-lock {
  cursor: pointer; border: none; font-family: inherit;
  padding: 10px 22px; border-radius: 999px; font-size: clamp(14px, 4.4vw, 16px); font-weight: 900;
  color: #04140b; background: linear-gradient(100deg, var(--led-amber), var(--led-gold) 60%, #22c55e);
  box-shadow: 0 8px 20px rgba(255, 200, 60, 0.35);
  transition: transform 0.12s ease, filter 0.15s ease;
}
.sb-lock:hover:not(:disabled) { transform: translateY(-1px) scale(1.03); filter: brightness(1.05); }
.sb-lock:disabled { cursor: default; opacity: 0.92; }
.sb-hint { font-size: 12.5px; color: rgba(255, 255, 255, 0.6); transition: opacity 200ms ease; }

/* ── Reveal overlay (emotional peak) ──────────────────────────────── */
.sb-reveal {
  position: absolute; inset: 14px 0 4px; display: grid; place-content: center;
  text-align: center; gap: 4px; border-radius: 14px;
  background: radial-gradient(circle at 50% 45%, rgba(4, 20, 13, 0.96), rgba(2, 10, 16, 0.98));
  border: 1px solid rgba(255, 210, 74, 0.5);
  opacity: 0; visibility: hidden; transform: scale(0.9);
  transition: opacity 240ms ease, transform 240ms ease, visibility 240ms;
  z-index: 6;
}
.sb-reveal.sb-shown { opacity: 1; visibility: visible; transform: scale(1); }
.sb-reveal-congrats { font-size: 16px; font-weight: 800; color: var(--led-amber); letter-spacing: 0.02em; }
.sb-reveal-amount {
  font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
  font-size: clamp(52px, 18vw, 72px); font-weight: 900; line-height: 1; color: var(--led-white);
  text-shadow: 0 0 10px rgba(180, 255, 200, 0.8), 0 0 28px rgba(80, 220, 120, 0.5);
}
.sb-reveal-amount small { font-size: 22px; margin-left: 4px; }
.sb-reveal-tag { margin-top: 6px; font-size: 13px; color: rgba(255, 255, 255, 0.82); }

/* ── Confetti ─────────────────────────────────────────────────────── */
.sb-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 7; }
.sb-conf { position: absolute; top: -16px; border-radius: 2px; }
@keyframes sbFall {
  0%   { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(360px) rotate(540deg); opacity: 0; }
}

/* ── 今日活動看板 (three activities) ──────────────────────────────── */
.sb-list {
  margin: 16px 0 4px; border-radius: 14px;
  background: rgba(3, 14, 22, 0.82); border: 1px solid rgba(120, 200, 150, 0.22);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4); overflow: hidden;
}
.sb-list-head {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; border-bottom: 1px solid rgba(120, 200, 150, 0.18);
  background: rgba(7, 28, 18, 0.7);
}
.sb-list-head .sb-lh-t { font-size: 14px; font-weight: 900; color: #eafff0; letter-spacing: 0.04em; }
.sb-list-head .sb-lh-s { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--led-amber); letter-spacing: 0.04em; }
.sb-rows { display: flex; flex-direction: column; }
.sb-row {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 14px; border-bottom: 1px solid rgba(120, 200, 150, 0.12);
}
.sb-row:last-child { border-bottom: none; }
.sb-row.sb-row-feat { background: linear-gradient(90deg, rgba(255, 210, 74, 0.12), rgba(255, 176, 32, 0.05)); }
.sb-badge {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
  font-size: 16px; font-weight: 900; color: #04140b;
  background: linear-gradient(160deg, #bfe9cb, #7fb893);
}
.sb-row-feat .sb-badge { background: linear-gradient(160deg, var(--led-amber), var(--led-gold)); box-shadow: 0 0 12px rgba(255, 200, 60, 0.5); }
.sb-row-main { flex: 1 1 auto; min-width: 0; }
.sb-row-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sb-row-flag {
  font-size: 11px; font-weight: 800; letter-spacing: 0.04em; border-radius: 6px; padding: 2px 7px;
  color: #bfe9cb; background: rgba(34, 197, 94, 0.16); border: 1px solid rgba(120, 200, 150, 0.35);
}
.sb-row-flag.sb-flag-feat { color: #04140b; background: linear-gradient(100deg, var(--led-amber), var(--led-gold)); border: none; }
.sb-row-label { font-size: 16px; font-weight: 800; color: #fff; }
.sb-row-desc { font-size: 14px; color: #bcd2c5; line-height: 1.55; margin-top: 3px; }
.sb-row-reward {
  flex: 0 0 auto; text-align: right; align-self: center;
  font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
  font-size: 21px; font-weight: 900; color: var(--led-amber); line-height: 1.1;
  text-shadow: 0 0 8px rgba(255, 200, 60, 0.55);
}
.sb-row-reward .sb-rw-u { display: block; font-size: 11px; font-weight: 700; color: #9fcdb1; letter-spacing: 0.06em; text-shadow: none; margin-top: 2px; }
.sb-stack {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px; background: rgba(7, 28, 18, 0.55);
  font-size: 13.5px; font-weight: 700; color: #bfe9cb; border-top: 1px solid rgba(120, 200, 150, 0.16);
}
.sb-stack b { color: #eafff0; }

/* ── Match-clock countdown ────────────────────────────────────────── */
.sb-clock-wrap { margin: 16px 0 2px; text-align: center; }
.sb-clock-label {
  font-size: 13px; letter-spacing: 0.28em; color: #8fd4ad; font-weight: 800; text-transform: uppercase;
  margin-bottom: 9px; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.sb-clock-label .sb-ring { color: var(--live-red); animation: sb-blink 1s steps(2, start) infinite; }
.sb-flips { display: flex; justify-content: center; gap: 8px; }
.sb-flip { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 56px; flex: 1; max-width: 76px; }
.sb-flip-card {
  position: relative; width: 100%; border-radius: 9px;
  background: linear-gradient(180deg, #0c1f16 0%, #061410 50%, #0c1f16 50%, #061410 100%);
  border: 1px solid rgba(120, 200, 150, 0.3);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.7), 0 4px 10px rgba(0, 0, 0, 0.4);
  padding: 11px 4px; overflow: hidden;
}
.sb-flip-card::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 0, 0, 0.55); }
.sb-flip-num {
  font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
  font-size: clamp(22px, 7vw, 32px); font-weight: 900; color: var(--led-white); line-height: 1;
  text-shadow: 0 0 8px rgba(180, 255, 200, 0.8), 0 0 22px rgba(80, 220, 120, 0.5);
  display: block; text-align: center; transition: transform 0.08s;
}
.sb-flip-num.sb-tick { animation: sb-tickflip 0.35s ease; }
@keyframes sb-tickflip { 0% { transform: translateY(-6px) scaleY(0.78); opacity: 0.55; } 100% { transform: none; opacity: 1; } }
.sb-flip-cap { font-size: 12px; color: #9fcdb1; letter-spacing: 0.08em; font-weight: 700; }
.sb-ended {
  font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
  font-size: 24px; font-weight: 900; color: var(--live-red);
  text-shadow: 0 0 14px rgba(255, 59, 59, 0.6); letter-spacing: 0.1em;
}

/* ── Terms + RG ───────────────────────────────────────────────────── */
.sb-terms { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.sb-terms summary {
  cursor: pointer; font-size: 14px; font-weight: 700; color: #bfe9cb; list-style: none;
  display: flex; align-items: center; gap: 8px; outline: none;
}
.sb-terms summary::-webkit-details-marker { display: none; }
.sb-terms summary::before { content: "▸"; color: #46c06a; transition: transform 0.2s; display: inline-block; }
.sb-terms[open] summary::before { transform: rotate(90deg); }
.sb-terms p { font-size: 13px; color: #93acbc; line-height: 1.7; margin: 10px 0 0; }
.sb-rg { margin-top: 12px; text-align: center; font-size: 12.5px; color: #7e93a4; line-height: 1.6; }

/* ── Sticky footer (CTA always reachable) ─────────────────────────── */
.sb-foot {
  position: relative; z-index: 6; flex: 0 0 auto;
  padding: 14px 22px 16px;
  background: linear-gradient(0deg, var(--card-bottom) 72%, rgba(7, 42, 20, 0));
}
.sb-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 14px 18px;
  font-family: inherit; font-size: 19px; font-weight: 900; letter-spacing: 0.02em; text-decoration: none;
  color: var(--ink); border: none; cursor: pointer; border-radius: 14px;
  background: linear-gradient(100deg, #ffd24a 0%, #ffb020 45%, #22c55e 100%);
  box-shadow: 0 10px 26px rgba(34, 197, 94, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
  transition: transform 0.12s, box-shadow 0.2s;
}
.sb-cta:hover { transform: translateY(-2px) scale(1.015); }
.sb-cta:active { transform: translateY(0) scale(0.99); }
.sb-pulse { animation: sbPulse 1.1s ease-in-out 3; }
@keyframes sbPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 10px 26px rgba(34, 197, 94, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.2) inset; }
  50%      { transform: scale(1.03); box-shadow: 0 12px 34px rgba(255, 200, 60, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.35) inset; }
}
.sb-foot-note { text-align: center; font-size: 12.5px; color: #9fcdb1; font-weight: 700; margin-top: 8px; }

/* ── Mobile: bottom drawer ────────────────────────────────────────── */
@media (max-width: 520px) {
  .sb-promo-active { padding-bottom: clamp(72px, 23vw, 106px); }
  .sb-footer-promo { right: 8px; bottom: 8px; left: 8px; }
  .sb-backdrop { place-items: end center; padding: 0; }
  .sb-card {
    width: 100%;
    max-height: 94vh;
    border-radius: 22px 22px 0 0;
    transform: translateY(100%);
  }
  .sb-backdrop.is-visible .sb-card { transform: translateY(0); }
  .sb-head { padding: 14px 56px 12px 18px; }
  .sb-body { padding: 4px 16px 18px; }
  .sb-foot { padding: 12px 16px 16px; }
  .sb-flip { min-width: 0; }
  .sb-row-reward { font-size: 19px; }
}
/* very narrow (down to 320px): keep rows readable, no horizontal scroll */
@media (max-width: 360px) {
  .sb-head { flex-wrap: wrap; }
  .sb-brand { margin-left: 0; width: 100%; }
  .sb-row { gap: 9px; padding: 11px 12px; }
  .sb-badge { width: 26px; height: 26px; font-size: 14px; }
  .sb-row-label { font-size: 15px; }
  .sb-row-reward { font-size: 17px; }
  .sb-board-foot { font-size: 12px; }
  .sb-cta { font-size: 16.5px; padding: 13px 12px; white-space: nowrap; }
  .sb-foot-note { font-size: 11.5px; }
  .sb-flip { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sb-footer-promo, .sb-backdrop, .sb-card, .sb-reveal, .sb-pulse, .sb-conf,
  .sb-score, .sb-board, .sb-live .sb-dot, .sb-clock-label .sb-ring, .sb-flip-num { transition: none; animation: none; }
}
