/* =========================================================
   Prize widgets — announcement bar + weekly prize card
   Every rule is scoped with .pw-* so it never touches the site.
   Colors fall back to the site palette (--accent, --surface…)
   when those variables exist, so it also works standalone.
   ========================================================= */

/* ---------- Announcement bar ---------- */
.pw-bar {
  background: linear-gradient(100deg, var(--accent, #8b5cf6), #22d3ee);
  color: #fff;
}
.pw-bar[hidden] { display: none; }
.pw-bar.is-dark {
  background: var(--bg, #0b1020);
  color: var(--text, #f5f7ff);
  border-bottom: 1px solid var(--border, rgba(255,255,255,.14));
}
.pw-bar.is-light {
  background: #eef2f9;
  color: #111827;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.pw-bar.is-light .pw-bar-flag { background: rgba(0,0,0,.06); border-color: rgba(0,0,0,.12); }

.pw-bar-inner {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 8px 16px; padding: 9px 42px; position: relative;
  text-align: center; font-size: .88rem; line-height: 1.4;
}
.pw-bar-flag {
  font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .68rem;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.32);
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.pw-bar-text strong { font-weight: 800; }
.pw-sep { opacity: .6; }
.pw-bar-link {
  color: inherit; font-weight: 750; text-decoration: underline;
  text-underline-offset: 3px; white-space: nowrap;
}
.pw-bar-close {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: inherit; opacity: .8;
  font-size: 1rem; line-height: 1; padding: 6px; border-radius: 8px; cursor: pointer;
}
.pw-bar-close:hover { opacity: 1; }
.pw-bar.is-done {
  background: var(--surface-2, #1a2540);
  color: var(--muted, #aab5ce);
  border-bottom: 1px solid var(--border, rgba(255,255,255,.12));
}
.pw-bar.is-done .pw-bar-flag { background: transparent; border-color: var(--border, rgba(255,255,255,.12)); }

/* ---------- Weekly prize card ---------- */
.pw-card-root[hidden] { display: none; }
.pw-card {
  margin: 0 0 32px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid color-mix(in srgb, var(--accent, #8b5cf6) 38%, var(--border, rgba(127,127,127,.25)));
  border-radius: 26px;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent, #8b5cf6) 22%, transparent), transparent 62%),
    var(--surface, #131b30);
  box-shadow: var(--shadow, 0 18px 60px rgba(0,0,0,.25));
  color: var(--text, inherit);
  text-align: left;
  font-family: inherit;
}
.pw-card-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 16px 28px;
}
.pw-card-head-main { min-width: 0; }
.pw-card-badge {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px;
  font-size: .68rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--accent, #8b5cf6);
  background: color-mix(in srgb, var(--accent, #8b5cf6) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, #8b5cf6) 35%, transparent);
  padding: 4px 10px; border-radius: 999px;
}
.pw-card-title {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  letter-spacing: -.03em; line-height: 1.15;
}
.pw-card-summary { margin: 6px 0 0; color: var(--muted, #aab5ce); font-size: .9rem; }

.pw-countdown { display: flex; gap: 10px; flex-wrap: wrap; }
.pw-unit {
  min-width: 62px; text-align: center; padding: 8px 10px;
  border: 1px solid var(--border, rgba(127,127,127,.25));
  border-radius: 12px; background: var(--surface-2, #1a2540);
}
.pw-unit strong {
  display: block; font-size: 1.15rem; line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.pw-unit small {
  color: var(--muted, #aab5ce); font-size: .66rem;
  text-transform: uppercase; letter-spacing: .08em;
}
.pw-done { margin: 0; font-weight: 700; color: var(--muted, #aab5ce); }

.pw-prizes { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.pw-prize {
  display: grid; grid-template-columns: 46px 58px minmax(0, 1fr) auto;
  align-items: center; gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--border, rgba(127,127,127,.25));
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-2, #1a2540) 72%, transparent);
}
.pw-place {
  font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent, #8b5cf6); text-align: center;
}
.pw-thumb {
  width: 58px; height: 58px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--surface, #131b30); overflow: hidden;
  font-weight: 900; font-size: .8rem; color: var(--accent, #8b5cf6);
}
.pw-thumb img { width: 82%; height: 82%; object-fit: contain; }
.pw-prize-body { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.pw-amount { font-weight: 800; font-size: 1.02rem; }
.pw-coin { color: var(--muted, #aab5ce); font-size: .88rem; }
.pw-desc { flex-basis: 100%; color: var(--muted, #aab5ce); font-size: .82rem; }
.pw-meta { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.pw-winners { font-weight: 700; font-size: .84rem; }
.pw-value { color: var(--muted, #aab5ce); font-size: .76rem; }

.pw-card-foot {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 14px 18px; margin-top: 20px;
}
.pw-note { margin: 0; color: var(--muted, #aab5ce); font-size: .82rem; flex: 1 1 220px; }
.pw-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px; border-radius: 13px; border: 0;
  background: var(--accent, #8b5cf6); color: #fff;
  font-weight: 800; font-size: .95rem; text-decoration: none;
  box-shadow: 0 10px 26px color-mix(in srgb, var(--accent, #8b5cf6) 30%, transparent);
  transition: transform .2s, background .2s;
}
.pw-cta:hover { transform: translateY(-2px); background: var(--accent-hover, #7544e8); }

@media (max-width: 760px) {
  .pw-bar-inner { padding: 10px 36px; font-size: .84rem; }
  .pw-card-head { justify-content: flex-start; }
  .pw-countdown { gap: 8px; }
  .pw-unit { min-width: 54px; padding: 7px 8px; }
  .pw-prize { grid-template-columns: 40px 48px minmax(0, 1fr); }
  .pw-thumb { width: 48px; height: 48px; }
  .pw-meta {
    grid-column: 2 / -1; text-align: left;
    flex-direction: row; align-items: baseline; gap: 10px;
  }
  .pw-note { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .pw-cta { transition: none; }
  .pw-cta:hover { transform: none; }
}
