/* ═══════════════════════════════════════════════════════════════════════
   泊樂娛樂城 · allfootball 點球 PK 射門彈窗  (prefix: pen-)
   配色：球場夜戰 — 深綠草皮 + 夜空藍 + 金色點綴
   self-contained · 與其他站不共用 class / 配色 / 機制
   ═══════════════════════════════════════════════════════════════════════ */

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

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

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

.pen-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;
}
.pen-footer-badge {
  padding: 2px 8px; border-radius: 999px; background: #2ea44f;
  color: #fff; font-size: 12px; font-weight: 800;
}
.pen-footer-cta-pill {
  padding: 4px 12px; border-radius: 999px;
  background: linear-gradient(180deg, #ffe790, #ff9e2c);
  color: #160d05; font-size: 13px; font-weight: 900; white-space: nowrap;
}

.pen-footer-close,
.pen-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;
}
.pen-footer-close { top: 6px; right: 6px; }

/* ── Backdrop ─────────────────────────────────────────────────────── */
.pen-backdrop {
  position: fixed; inset: 0; z-index: 2147483001;
  display: grid; place-items: center; padding: 18px;
  background: rgba(3, 12, 22, 0.7);
  opacity: 0; transition: opacity 180ms ease;
}
.pen-backdrop.is-visible { opacity: 1; }

/* ── Card ─────────────────────────────────────────────────────────── */
.pen-card {
  position: relative;
  width: min(94vw, 420px);
  max-height: min(92vh, 760px);
  display: flex;
  flex-direction: column;
  color: #fff;
  border: 1px solid rgba(245, 210, 100, 0.42);
  border-radius: 16px;
  background:
    radial-gradient(circle at 82% 6%, rgba(245, 210, 100, 0.22), transparent 32%),
    linear-gradient(165deg, #0a2a4a 0%, #0d3b2a 54%, #06160f 100%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  transform: translateY(14px) scale(0.985);
  transition: transform 180ms ease;
}
.pen-backdrop.is-visible .pen-card { transform: translateY(0) scale(1); }
.pen-close { top: 10px; right: 10px; }

/* ── Sticky header ────────────────────────────────────────────────── */
.pen-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);
}
.pen-brand { font-size: 18px; font-weight: 900; letter-spacing: 0.5px; color: #ffe89b; }
.pen-sub   { margin-top: 4px; font-size: 12.5px; color: rgba(255, 255, 255, 0.78); }

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

/* ── Penalty stage ────────────────────────────────────────────────── */
.pen-stage { position: relative; display: block; }

/* The pitch — a green field with a goal at top, keeper, and ball on the spot.
   Sized with vw/clamp + aspect-ratio so it scales on a 390px phone. */
.pen-pitch {
  position: relative;
  width: min(86vw, 320px);
  margin: 0 auto;
  aspect-ratio: 5 / 4;
  border-radius: 14px;
  overflow: hidden;
  container-type: size;
  background:
    radial-gradient(ellipse at 50% 4%, rgba(255,255,255,0.08), transparent 40%),
    repeating-linear-gradient(180deg, #115c34 0 11%, #0e5230 11% 22%);
  border: 1px solid rgba(245, 210, 100, 0.3);
  box-shadow: inset 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Goal frame across the top */
.pen-goal {
  position: absolute; top: 6%; left: 50%; transform: translateX(-50%);
  width: 74%; height: 30%;
  border: clamp(3px, 1.2vw, 5px) solid #f2f6ff;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.pen-net {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,0.22) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,0.22) 1px, transparent 1px);
  background-size: 11px 11px;
  opacity: 0.55;
}
.pen-keeper {
  position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%);
  font-size: clamp(26px, 9cqw, 40px); line-height: 1;
  transition: transform 0.95s cubic-bezier(.34,1.4,.5,1);
  will-change: transform;
}
.pen-keeper-body { filter: drop-shadow(0 3px 5px rgba(0,0,0,0.45)); }

/* Penalty spot */
.pen-spot {
  position: absolute; bottom: 16%; left: 50%; transform: translate(-50%, 50%);
  width: clamp(5px, 1.6cqw, 8px); aspect-ratio: 1; border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}

/* The ball, parked on the spot, flies into the goal via CSS transform */
.pen-ball {
  position: absolute; bottom: 13%; left: 50%;
  transform: translate(-50%, 0);
  font-size: clamp(22px, 8cqw, 34px); line-height: 1; z-index: 4;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
  will-change: transform;
}
.pen-ball-fly { transition: transform 1.18s cubic-bezier(.22,.7,.3,1); }

.pen-flash {
  position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) scale(0.6);
  z-index: 6; padding: 6px 16px; border-radius: 999px;
  font-size: clamp(20px, 7cqw, 30px); font-weight: 900; letter-spacing: 0.5px;
  color: #06160f; background: linear-gradient(180deg, #ffe790, #ffb52c);
  box-shadow: 0 8px 22px rgba(255, 181, 44, 0.55);
  opacity: 0; pointer-events: none;
  transition: opacity 180ms ease, transform 220ms cubic-bezier(.34,1.6,.5,1);
}
.pen-flash.pen-flash-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* Direction buttons */
.pen-aim {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  width: min(86vw, 320px); margin: 12px auto 0;
  transition: opacity 220ms ease;
}
.pen-aim.pen-aim-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.pen-shoot-btn {
  padding: 10px 4px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(245, 210, 100, 0.45);
  background: rgba(17, 92, 52, 0.6);
  color: #fff7df; font-size: clamp(12px, 3.6vw, 14px); font-weight: 800;
  transition: transform 120ms ease, background 160ms ease;
}
.pen-shoot-btn:hover { transform: translateY(-2px); background: rgba(46, 164, 79, 0.55); }
.pen-shoot-btn:active { transform: translateY(0); }

.pen-hint {
  margin-top: 8px; text-align: center;
  font-size: 12.5px; color: rgba(255, 255, 255, 0.6);
  transition: opacity 200ms ease;
}

/* ── Prize reveal ─────────────────────────────────────────────────── */
.pen-prize {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%) scale(0.9);
  width: min(86vw, 320px); aspect-ratio: 5 / 4;
  display: grid; place-content: center; text-align: center; gap: 4px;
  background: radial-gradient(circle at 50% 42%, rgba(13, 59, 42, 0.97), rgba(6, 22, 15, 0.98));
  border-radius: 14px; border: 1px solid rgba(245, 210, 100, 0.4);
  opacity: 0; visibility: hidden;
  transition: opacity 240ms ease, transform 240ms ease, visibility 240ms;
  z-index: 7;
}
.pen-prize.pen-shown { opacity: 1; visibility: visible; transform: translateX(-50%) scale(1); }
.pen-congrats { font-size: clamp(14px, 4.4vw, 16px); font-weight: 800; color: #ffe89b; }
.pen-amount {
  font-size: clamp(48px, 15vw, 64px); font-weight: 900; line-height: 1; color: #ffd84f;
  text-shadow: 0 4px 16px rgba(255, 216, 79, 0.4);
}
.pen-amount small { font-size: 22px; margin-left: 4px; }
.pen-prize-tag { margin-top: 6px; font-size: 13px; color: rgba(255, 255, 255, 0.82); }

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

/* ── 活動總覽 ─────────────────────────────────────────────────────── */
.pen-list-title {
  margin: 18px 0 10px; text-align: center; font-size: 13px; font-weight: 800;
  color: rgba(255, 255, 255, 0.7); letter-spacing: 0.04em;
}
.pen-acts { display: grid; gap: 8px; }
.pen-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);
}
.pen-act.pen-feat { border-color: rgba(245, 210, 100, 0.5); background: rgba(245, 210, 100, 0.08); }
.pen-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: #ffe89b;
}
.pen-act-main { flex: 1 1 auto; min-width: 0; }
.pen-act-label { font-size: 13.5px; font-weight: 800; }
.pen-tag {
  display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 999px;
  background: #f5d264; color: #3a2400; font-size: 10.5px; font-weight: 800;
}
.pen-act-desc { margin-top: 2px; font-size: 12px; color: rgba(255, 255, 255, 0.66); }
.pen-act-reward { flex: none; font-size: 22px; font-weight: 900; color: #ffd84f; }
.pen-act-reward small { font-size: 11px; color: rgba(255, 255, 255, 0.6); margin-left: 2px; }

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

.pen-cta {
  display: flex; align-items: center; justify-content: center;
  min-height: 50px; border-radius: 10px;
  color: #160d05; text-decoration: none;
  background: linear-gradient(180deg, #ffe790, #ff9e2c);
  box-shadow: 0 10px 24px rgba(255, 157, 43, 0.3);
  font-size: 17px; font-weight: 900;
}
.pen-pulse { animation: penPulse 1.1s ease-in-out 3; }
@keyframes penPulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 10px 24px rgba(255, 157, 43, 0.3); }
  50%      { transform: scale(1.03); box-shadow: 0 14px 32px rgba(255, 157, 43, 0.55); }
}

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

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

@media (prefers-reduced-motion: reduce) {
  .pen-footer-promo, .pen-backdrop, .pen-card, .pen-prize, .pen-pulse, .pen-conf,
  .pen-ball, .pen-keeper, .pen-flash { transition: none; animation: none; }
}
