/* ═══════════════════════════════════════════════════════════════════════
   泊樂娛樂城 · mvpcup 冠軍預測彈窗  (prefix: pk-)
   機制:Pick the Winner 選冠軍隊 → 解鎖加碼級距 → 送出預測
   配色:冠軍金 + 深藍球場 · self-contained,與其他站不共用 class
   ═══════════════════════════════════════════════════════════════════════ */

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

.pk-footer-promo,
.pk-backdrop {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "Microsoft JhengHei", "Segoe UI", sans-serif;
}
.pk-footer-promo *,
.pk-backdrop * { box-sizing: border-box; }

/* ── Footer banner ────────────────────────────────────────────────── */
.pk-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, 213, 74, 0.45);
  border-radius: 10px;
  background: #050b16;
  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;
}
.pk-footer-promo.is-visible { transform: translateY(0); opacity: 1; }
.pk-footer-promo a { display: block; min-height: 64px; }
.pk-footer-promo img { display: block; width: 100%; height: auto; }

.pk-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;
}
.pk-footer-badge {
  padding: 2px 8px; border-radius: 999px; background: #ff4444;
  color: #fff; font-size: 12px; font-weight: 800;
}
.pk-footer-cta-pill {
  padding: 4px 12px; border-radius: 999px;
  background: linear-gradient(180deg, #ffe27a, #e3ad1f);
  color: #241a05; font-size: 13px; font-weight: 900; white-space: nowrap;
}

.pk-footer-close,
.pk-close {
  position: absolute; z-index: 2; display: grid; place-items: center;
  width: 34px; height: 34px; border: 0; border-radius: 999px;
  color: #fff; background: rgba(0, 0, 0, 0.62); cursor: pointer;
  font-size: 22px; line-height: 1;
}
.pk-footer-close { top: 6px; right: 6px; }

/* ── Backdrop ─────────────────────────────────────────────────────── */
.pk-backdrop {
  position: fixed; inset: 0; z-index: 2147483001;
  display: grid; place-items: center; padding: 18px;
  background: rgba(4, 9, 20, 0.68);
  opacity: 0; transition: opacity 180ms ease;
}
.pk-backdrop.is-visible { opacity: 1; }

/* ── Card ─────────────────────────────────────────────────────────── */
.pk-card {
  position: relative;
  width: min(94vw, 440px);
  max-height: min(92vh, 780px);
  display: flex;
  flex-direction: column;
  color: #e9eff8;
  border: 1px solid rgba(255, 213, 74, 0.42);
  border-radius: 16px;
  background:
    radial-gradient(circle at 82% 6%, rgba(255, 213, 74, 0.24), transparent 32%),
    linear-gradient(165deg, #102544 0%, #0a1c38 52%, #06101f 100%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  transform: translateY(14px) scale(0.985);
  transition: transform 180ms ease;
}
.pk-backdrop.is-visible .pk-card { transform: translateY(0) scale(1); }
.pk-close { top: 10px; right: 10px; }

/* ── Sticky header ────────────────────────────────────────────────── */
.pk-head {
  flex: none;
  padding: 16px 18px 12px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}
.pk-brand { font-size: 18px; font-weight: 900; letter-spacing: 0.5px; color: #ffe27a; }
.pk-sub   { margin-top: 4px; font-size: 12.5px; color: rgba(233, 239, 248, 0.78); }

/* ── Scrollable body ──────────────────────────────────────────────── */
.pk-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 18px 8px;
}
.pk-cap {
  text-align: center; font-size: 13px; line-height: 1.6;
  color: rgba(233, 239, 248, 0.82); margin-bottom: 12px;
}
.pk-cap b { color: #ffd54a; font-weight: 900; }
.pk-cap strong { color: #ffe27a; }

/* ── Predict stage ────────────────────────────────────────────────── */
.pk-stage { position: relative; }

.pk-step {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 800; color: #ffe27a;
  letter-spacing: 0.4px; margin: 6px 0 12px;
}
.pk-dot {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: #ffd54a; color: #1a1407;
  font-size: 13px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}

/* team chips — interactive centerpiece */
.pk-teams { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.pk-chip {
  appearance: none; cursor: pointer;
  background: linear-gradient(180deg, #16345c, #0e2240);
  border: 2px solid rgba(255, 255, 255, 0.12);
  color: #e9eff8; border-radius: 14px;
  padding: 11px 4px; font-size: 14.5px; font-weight: 800;
  font-family: inherit; min-height: 62px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  transition: transform .16s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.pk-chip .pk-flag { font-size: 24px; line-height: 1; }
.pk-chip:hover { transform: translateY(-2px); border-color: rgba(255, 213, 74, 0.6); }
.pk-chip:active { transform: scale(.97); }
.pk-chip.pk-sel {
  background: linear-gradient(180deg, #ffe27a, #e9b62a);
  border-color: #fff; color: #241a05;
  box-shadow: 0 0 0 3px rgba(255, 213, 74, 0.45), 0 10px 24px rgba(212, 160, 23, 0.5);
  transform: translateY(-2px);
  animation: pkPop .4s ease;
}
@keyframes pkPop { 0%{transform:scale(.9)} 55%{transform:scale(1.08)} 100%{transform:scale(1) translateY(-2px)} }

/* confirmation */
.pk-confirm {
  margin: 14px 0 4px; text-align: center; font-weight: 900; font-size: 16px;
  color: #fff;
  background: linear-gradient(90deg, rgba(255,213,74,.12), rgba(255,213,74,.22), rgba(255,213,74,.12));
  border: 1px dashed rgba(255, 213, 74, 0.5); border-radius: 12px; padding: 12px;
  opacity: 0; transform: translateY(8px); max-height: 0; overflow: hidden;
  transition: opacity .35s ease, transform .35s ease, max-height .35s ease, padding .35s ease, margin .35s ease;
}
.pk-confirm.pk-show { opacity: 1; transform: translateY(0); max-height: 120px; }
.pk-confirm .pk-big { color: #ffd54a; }

/* tier reward table */
.pk-tiers {
  margin-top: 4px; display: grid; gap: 9px;
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height .5s ease, opacity .4s ease;
}
.pk-tiers.pk-show { max-height: 520px; opacity: 1; }
.pk-tier {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: linear-gradient(180deg, #143055, #0c2140);
  border: 1px solid rgba(255, 213, 74, 0.18); border-radius: 12px; padding: 11px 14px;
  opacity: 0; transform: translateX(-14px);
}
.pk-tiers.pk-show .pk-tier { animation: pkSlide .5s forwards; }
.pk-tiers.pk-show .pk-tier:nth-child(1) { animation-delay: .05s; }
.pk-tiers.pk-show .pk-tier:nth-child(2) { animation-delay: .22s; }
.pk-tiers.pk-show .pk-tier:nth-child(3) { animation-delay: .39s; }
@keyframes pkSlide { to { opacity: 1; transform: translateX(0); } }
.pk-bet { font-size: 14px; color: #e9eff8; }
.pk-bet b { color: #fff; font-size: 16px; }
.pk-arrow { color: #ffd54a; font-weight: 900; font-size: 17px; }
.pk-bonus {
  font-size: 14px; font-weight: 900; color: #241a05;
  background: linear-gradient(180deg, #ffe27a, #e9b62a); border-radius: 999px;
  padding: 6px 13px; white-space: nowrap;
}
.pk-tier.pk-top { border-color: rgba(255, 213, 74, 0.6); box-shadow: 0 0 0 1px rgba(255, 213, 74, 0.3) inset; }
.pk-tier.pk-top .pk-bestlbl { font-size: 11px; color: #ffd54a; font-weight: 900; letter-spacing: 1px; }

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

/* ── 活動總覽 ─────────────────────────────────────────────────────── */
.pk-list-title {
  margin: 18px 0 10px; text-align: center; font-size: 13px; font-weight: 800;
  color: rgba(233, 239, 248, 0.7); letter-spacing: 0.04em;
}
.pk-acts { display: grid; gap: 8px; }
.pk-act {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
}
.pk-act.pk-feat { border-color: rgba(255, 213, 74, 0.5); background: rgba(255, 213, 74, 0.08); }
.pk-badge {
  flex: none; width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 999px; background: rgba(255, 255, 255, 0.12);
  font-size: 13px; font-weight: 800; color: #ffe27a;
}
.pk-act-main { flex: 1 1 auto; min-width: 0; }
.pk-act-label { font-size: 13.5px; font-weight: 800; }
.pk-tag {
  display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 999px;
  background: #ffd54a; color: #241a05; font-size: 10.5px; font-weight: 800;
}
.pk-act-desc { margin-top: 2px; font-size: 12px; color: rgba(233, 239, 248, 0.66); }
.pk-act-reward { flex: none; font-size: 22px; font-weight: 900; color: #ffd54a; }
.pk-act-reward small { font-size: 11px; color: rgba(233, 239, 248, 0.6); margin-left: 2px; }

/* ── Sticky footer ────────────────────────────────────────────────── */
.pk-foot {
  flex: none;
  padding: 12px 18px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.3);
}
.pk-timer-wrap { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 10px; }
.pk-timer-label { font-size: 12px; color: rgba(233, 239, 248, 0.66); }
.pk-timer { display: flex; gap: 6px; }
.pk-tunit {
  min-width: 38px; padding: 4px 0; border-radius: 8px; text-align: center;
  background: rgba(255, 213, 74, 0.14); border: 1px solid rgba(255, 213, 74, 0.3);
}
.pk-tnum { font-size: 17px; font-weight: 900; color: #ffe27a; line-height: 1.1; }
.pk-tlbl { font-size: 10px; color: rgba(233, 239, 248, 0.6); }
.pk-timer-done { font-size: 14px; font-weight: 800; color: #ff8a8a; }

.pk-cta {
  display: flex; align-items: center; justify-content: center;
  min-height: 50px; border-radius: 10px;
  color: #241a05; text-decoration: none;
  border: 0; width: 100%; cursor: pointer; font-family: inherit;
  background: linear-gradient(180deg, #ffe27a, #e3ad1f);
  box-shadow: 0 10px 24px rgba(212, 160, 23, 0.3);
  font-size: 17px; font-weight: 900;
  transition: filter .2s ease, box-shadow .2s ease, transform .15s ease;
}
.pk-cta.pk-muted { filter: grayscale(.35) brightness(.9); opacity: .92; }
.pk-cta:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(212, 160, 23, 0.45); }
.pk-cta.pk-armed { animation: pkPulse 1.1s ease-in-out 3; }
@keyframes pkPulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 10px 24px rgba(212, 160, 23, 0.3); }
  50%      { transform: scale(1.03); box-shadow: 0 14px 32px rgba(255, 213, 74, 0.6); }
}

.pk-terms { margin: 10px 0 0; font-size: 12px; color: rgba(233, 239, 248, 0.66); }
.pk-terms summary { cursor: pointer; color: rgba(233, 239, 248, 0.78); }
.pk-terms p { margin: 6px 0 0; line-height: 1.55; }
.pk-compliance { margin-top: 8px; text-align: center; font-size: 11.5px; color: rgba(233, 239, 248, 0.6); }

/* ── Mobile: bottom drawer ────────────────────────────────────────── */
@media (max-width: 520px) {
  .pk-promo-active { padding-bottom: clamp(72px, 23vw, 106px); }
  .pk-footer-promo { right: 8px; bottom: 8px; left: 8px; }
  .pk-backdrop { place-items: end center; padding: 0; }
  .pk-card {
    width: 100%;
    max-height: 94vh;
    border-radius: 18px 18px 0 0;
    transform: translateY(100%);
  }
  .pk-backdrop.is-visible .pk-card { transform: translateY(0); }
  .pk-teams { grid-template-columns: 1fr 1fr; }
  .pk-chip { min-height: 64px; }
}

/* ── Narrow phones (down to 320px) ───────────────────────────────── */
@media (max-width: 360px) {
  .pk-body { padding: 14px 14px 8px; }
  .pk-foot { padding: 12px 14px 14px; }
  .pk-teams { gap: 8px; }
  .pk-chip { font-size: 13.5px; min-height: 60px; }
  .pk-chip .pk-flag { font-size: 22px; }
  .pk-tier { padding: 10px 12px; }
  .pk-bet { font-size: 13px; }
  .pk-tunit { min-width: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .pk-footer-promo, .pk-backdrop, .pk-card, .pk-confirm, .pk-tiers, .pk-tier, .pk-cta, .pk-conf, .pk-chip { transition: none; animation: none; }
}
