/* Campaigns: home banner (#campaign) and /campaign (leaderboard, rules, live draw). Loaded by both pages. */
:root {
  --cmp-pink: #ff4fa3;
  --cmp-orange: #ffb35c;
  --cmp-violet: #7c4dff;
  --cmp-night: #160c26;
  --cmp-night-2: #22123a;
  --cmp-ink: #fff7fb;
  --cmp-ink-2: rgba(255, 240, 250, .74);
  --cmp-line: rgba(255, 255, 255, .14);
  --cmp-grad: linear-gradient(100deg, #ffb35c 0%, #ff4fa3 48%, #a25cff 100%);
}

/* ---------- shared bits ---------- */
.cmp-grad-text { background: var(--cmp-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cmp-live { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 4px 12px; border-radius: 999px; background: rgba(255, 79, 163, .16); border: 1px solid rgba(255, 79, 163, .4); color: var(--cmp-ink); width: max-content; }
.cmp-live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cmp-pink); box-shadow: 0 0 0 0 rgba(255, 79, 163, .7); animation: cmpPing 1.8s infinite; }
.cmp-live.done .dot { animation: none; background: var(--cmp-orange); }
@keyframes cmpPing { 0% { box-shadow: 0 0 0 0 rgba(255, 79, 163, .65); } 80%, 100% { box-shadow: 0 0 0 9px rgba(255, 79, 163, 0); } }

.cmp-count { display: flex; gap: 10px; direction: rtl; }
.cmp-count .u { min-width: 70px; padding: 10px 8px 8px; border-radius: 14px; background: rgba(10, 4, 22, .5); border: 1px solid var(--cmp-line); text-align: center; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.cmp-count b { display: block; font-size: clamp(24px, 4vw, 34px); line-height: 1.05; font-weight: 800; color: var(--cmp-ink); font-variant-numeric: tabular-nums; }
.cmp-count span { display: block; font-size: 11.5px; color: var(--cmp-ink-2); margin-top: 3px; }
.cmp-count-lbl { font-size: 12.5px; color: var(--cmp-ink-2); margin-bottom: 8px; }

.cmp-rules { display: flex; flex-wrap: wrap; gap: 8px; }
.cmp-rule { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 12px 6px 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid var(--cmp-line); color: var(--cmp-ink); }
.cmp-rule b { min-width: 30px; height: 26px; padding: 0 8px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 13px; background: var(--cmp-grad); color: #1b0b23; font-weight: 800; }

/* ---------- home banner ---------- */
.cmp-banner { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; overflow: hidden; border-radius: calc(var(--radius) + 6px); background: var(--cmp-night); color: var(--cmp-ink); border: 1px solid rgba(255, 79, 163, .28); box-shadow: 0 30px 80px -40px rgba(255, 79, 163, .55), var(--shadow); isolation: isolate; transition: transform .25s, box-shadow .25s; }
.cmp-banner:hover { transform: translateY(-2px); box-shadow: 0 36px 90px -40px rgba(255, 79, 163, .7), var(--shadow); }
.cmp-banner::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(90% 120% at 100% 0%, rgba(162, 92, 255, .35), transparent 60%), radial-gradient(70% 90% at 70% 100%, rgba(255, 79, 163, .25), transparent 60%); }
.cmp-in { padding: clamp(22px, 3.4vw, 38px); display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cmp-in h3 { margin: 0; font-size: clamp(26px, 3.8vw, 40px); line-height: 1.2; letter-spacing: -.01em; }
.cmp-in h3 .en { white-space: nowrap; font-family: var(--mono); direction: ltr; unicode-bidi: isolate; }
.cmp-in p { margin: 0; color: var(--cmp-ink-2); font-size: 15px; }
.cmp-art { position: relative; min-height: 320px; }
.cmp-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; }
.cmp-art img { -webkit-mask-image: linear-gradient(to left, transparent 0%, #000 38%); mask-image: linear-gradient(to left, transparent 0%, #000 38%); }
.cmp-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--cmp-ink-2); }
.cmp-meta b { color: var(--cmp-ink); font-weight: 700; }
.cmp-cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cmp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 12px; font-weight: 800; background: var(--cmp-grad); color: #1b0b23; border: 0; box-shadow: 0 10px 30px -12px rgba(255, 79, 163, .9); }
.cmp-btn:hover { filter: brightness(1.06); }
.cmp-btn.ghost { background: rgba(255, 255, 255, .08); color: var(--cmp-ink); border: 1px solid var(--cmp-line); box-shadow: none; font-weight: 700; }
@media (max-width: 820px) {
  .cmp-banner { grid-template-columns: 1fr; }
  .cmp-art { min-height: 0; aspect-ratio: 16 / 9; order: -1; }
  .cmp-art img { object-position: 50% 40%; }
  .cmp-art img { -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 45%); mask-image: linear-gradient(to top, transparent 0%, #000 45%); }
  .cmp-in { margin-top: -40px; position: relative; }
  .cmp-count .u { min-width: 0; flex: 1; }
}

/* ---------- /campaign page ---------- */
.cmp-page { background: var(--bg); }
.cmp-hero { position: relative; overflow: hidden; color: var(--cmp-ink); background: var(--cmp-night); isolation: isolate; }
.cmp-hero-img { position: absolute; inset: 0; z-index: -2; }
.cmp-hero-img img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 40%; transform: scale(1.04); animation: cmpDrift 22s ease-in-out infinite alternate; }
@keyframes cmpDrift { to { transform: scale(1.12) translateX(-1.5%); } }
.cmp-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(270deg, rgba(22, 12, 38, .96) 0%, rgba(22, 12, 38, .82) 40%, rgba(22, 12, 38, .25) 75%, rgba(22, 12, 38, .1) 100%), linear-gradient(0deg, var(--bg) 0%, transparent 22%); }
.cmp-hero .wrap { padding-top: clamp(40px, 7vw, 86px); padding-bottom: clamp(70px, 9vw, 120px); }
.cmp-hero-in { max-width: 560px; display: flex; flex-direction: column; gap: 18px; }
.cmp-hero h1 { margin: 0; font-size: clamp(34px, 6vw, 60px); line-height: 1.1; letter-spacing: -.02em; }
.cmp-hero h1 .en { display: block; font-family: var(--mono); direction: ltr; text-align: right; font-size: 1.15em; letter-spacing: -.04em; }
.cmp-hero p.lede { margin: 0; font-size: 17px; color: var(--cmp-ink-2); }
.cmp-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 520px; }
.cmp-kpi { padding: 12px 14px; border-radius: 14px; background: rgba(10, 4, 22, .5); border: 1px solid var(--cmp-line); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.cmp-kpi b { display: block; font-size: 22px; font-weight: 800; line-height: 1.2; }
.cmp-kpi span { font-size: 12px; color: var(--cmp-ink-2); }
@media (max-width: 720px) {
  .cmp-hero::before { background: linear-gradient(0deg, var(--bg) 0%, rgba(22, 12, 38, .92) 30%, rgba(22, 12, 38, .65) 70%, rgba(22, 12, 38, .35) 100%); }
  .cmp-hero-img img { object-position: 40% 30%; }
  .cmp-count .u { min-width: 0; flex: 1; }
}

.cmp-sec { padding: 40px 0; }
.cmp-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 860px) { .cmp-grid { grid-template-columns: 1fr; } }
.cmp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(18px, 2.6vw, 26px); min-width: 0; }
.cmp-card h2, .cmp-card h3 { margin: 0 0 6px; font-size: 20px; line-height: 1.35; }
.cmp-card .sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }

/* my card */
.cmp-me { position: relative; overflow: hidden; border-color: rgba(255, 79, 163, .35); }
.cmp-me::before { content: ""; position: absolute; inset: -1px; z-index: 0; pointer-events: none; background: radial-gradient(80% 60% at 0% 0%, rgba(255, 79, 163, .14), transparent 60%), radial-gradient(70% 60% at 100% 100%, rgba(162, 92, 255, .12), transparent 60%); }
.cmp-me > * { position: relative; }
.cmp-me-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cmp-tag { font-family: var(--mono); direction: ltr; font-size: 13px; padding: 3px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); white-space: nowrap; }
.cmp-me-big { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.cmp-me-big div { padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.cmp-me-big b { display: block; font-size: 26px; line-height: 1.15; font-weight: 800; }
.cmp-me-big span { font-size: 12px; color: var(--muted); }
.cmp-me-big .hot b { background: var(--cmp-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cmp-break { display: grid; gap: 8px; margin-bottom: 16px; }
.cmp-break-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; padding: 9px 12px; border-radius: 12px; border: 1px dashed var(--line-strong); }
.cmp-break-row span:last-child { font-weight: 800; white-space: nowrap; }
.cmp-break-row small { color: var(--muted); font-size: 12px; }
.cmp-ref { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 16px; }
.cmp-ref code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: left; font-family: var(--mono); font-size: 13px; }
.cmp-handles { display: grid; gap: 8px; }
.cmp-handle { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 10px; }
.cmp-handle label { font-size: 13px; color: var(--muted); }
.cmp-handle input { height: 42px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); padding: 0 12px; font: inherit; font-size: 14px; direction: ltr; text-align: left; min-width: 0; width: 100%; }
.cmp-handle input:focus { outline: 2px solid var(--cmp-pink); outline-offset: 1px; border-color: transparent; }
.cmp-note { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.cmp-guest { text-align: center; padding: 10px 0; }
.cmp-guest p { color: var(--muted); }

/* rules */
.cmp-pts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.cmp-pt { padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.cmp-pt b { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; font-weight: 900; background: var(--cmp-grad); color: #1b0b23; box-shadow: 0 10px 24px -14px rgba(255, 79, 163, .9); }
.cmp-pt div { font-size: 14px; line-height: 1.6; }
.cmp-pt small { display: block; color: var(--muted); font-size: 12px; }
.cmp-steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 0; }
.cmp-steps li { position: relative; padding: 0 30px 18px 0; font-size: 14px; }
.cmp-steps li::before { content: ""; position: absolute; right: 7px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--cmp-pink); }
.cmp-steps li::after { content: ""; position: absolute; right: 11px; top: 22px; bottom: -4px; width: 2px; background: var(--line-strong); }
.cmp-steps li:last-child::after { display: none; }
.cmp-steps li.on::before { background: var(--cmp-pink); box-shadow: 0 0 0 4px rgba(255, 79, 163, .2); }
.cmp-steps li.past { color: var(--muted); }
.cmp-steps li.past::before { background: var(--cmp-pink); }
.cmp-steps b { display: block; }
.cmp-steps small { color: var(--muted); }
.cmp-fine { margin: 16px 0 0; padding: 0 18px 0 0; color: var(--muted); font-size: 13px; display: grid; gap: 4px; }

/* leaderboard */
.cmp-board-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.cmp-board-head h2 { margin: 0; font-size: clamp(24px, 3.6vw, 32px); }
.cmp-board-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.cmp-search { height: 42px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); padding: 0 14px; font: inherit; font-size: 14px; width: min(100%, 280px); }
.cmp-podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 12px; align-items: end; margin-bottom: 14px; }
.cmp-pod { position: relative; overflow: hidden; border-radius: var(--radius); padding: 18px 14px 16px; text-align: center; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.cmp-pod .medal { width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 18px; color: #1b0b23; }
.cmp-pod.r1 { padding-top: 28px; border-color: rgba(255, 179, 92, .55); background: linear-gradient(180deg, rgba(255, 179, 92, .14), var(--surface) 70%); }
.cmp-pod.r1 .medal { width: 58px; height: 58px; font-size: 22px; background: linear-gradient(135deg, #ffe08a, #ffb35c); box-shadow: 0 0 0 6px rgba(255, 179, 92, .18); }
.cmp-pod.r2 .medal { background: linear-gradient(135deg, #f2f4f8, #b9c0cc); }
.cmp-pod.r3 .medal { background: linear-gradient(135deg, #f3c39b, #c9814f); }
.cmp-pod .nm { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-pod .pts { font-size: 26px; font-weight: 900; line-height: 1.2; margin-top: 6px; }
.cmp-pod .ch { font-size: 12.5px; color: var(--muted); }
.cmp-pod .cmp-tag { display: inline-block; margin-top: 6px; font-size: 11.5px; }
@media (max-width: 620px) {
  .cmp-podium { grid-template-columns: 1fr; }
  .cmp-pod.r1 { order: -1; }
}
.cmp-rows { display: grid; gap: 6px; }
.cmp-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 120px 74px; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.cmp-row.me { border-color: var(--cmp-pink); box-shadow: 0 0 0 3px rgba(255, 79, 163, .14); }
.cmp-row .rk { font-weight: 800; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.cmp-row .who { min-width: 0; display: flex; flex-direction: column; }
.cmp-row .who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.cmp-row .who small { color: var(--faint); font-size: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.cmp-row .who small .h { direction: ltr; unicode-bidi: isolate; }
.cmp-row .bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.cmp-row .bar i { display: block; height: 100%; border-radius: inherit; background: var(--cmp-grad); }
.cmp-row .pt { text-align: left; font-weight: 800; white-space: nowrap; }
.cmp-row .pt small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.cmp-you { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: var(--cmp-pink); color: #fff; font-weight: 700; }
@media (max-width: 560px) {
  .cmp-row { grid-template-columns: 34px minmax(0, 1fr) 70px; }
  .cmp-row .bar { display: none; }
}
.cmp-more { display: flex; justify-content: center; margin-top: 14px; }
.cmp-empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* live draw */
.cmp-draw { position: relative; overflow: hidden; border-radius: calc(var(--radius) + 6px); background: radial-gradient(120% 140% at 100% 0%, #3a1763 0%, var(--cmp-night) 55%), var(--cmp-night); color: var(--cmp-ink); border: 1px solid rgba(255, 79, 163, .3); padding: clamp(20px, 3.6vw, 40px); }
.cmp-draw h2 { margin: 0; font-size: clamp(24px, 3.6vw, 34px); }
.cmp-draw > p { color: var(--cmp-ink-2); margin: 6px 0 20px; }
.cmp-stage { position: relative; height: 210px; border-radius: 20px; background: rgba(0, 0, 0, .35); border: 1px solid var(--cmp-line); overflow: hidden; }
.cmp-stage::before, .cmp-stage::after { content: ""; position: absolute; left: 0; right: 0; height: 70px; z-index: 2; pointer-events: none; }
.cmp-stage::before { top: 0; background: linear-gradient(180deg, rgba(14, 6, 26, .95), transparent); }
.cmp-stage::after { bottom: 0; background: linear-gradient(0deg, rgba(14, 6, 26, .95), transparent); }
.cmp-window { position: absolute; left: 14px; right: 14px; top: 50%; height: 70px; margin-top: -35px; border-radius: 14px; border: 2px solid var(--cmp-pink); box-shadow: 0 0 40px -6px rgba(255, 79, 163, .8), inset 0 0 30px -10px rgba(255, 79, 163, .6); z-index: 3; pointer-events: none; }
.cmp-reel { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.cmp-reel div { height: 70px; display: flex; align-items: center; justify-content: center; gap: 14px; font-size: clamp(20px, 3.2vw, 30px); font-weight: 800; white-space: nowrap; }
.cmp-reel div .cmp-tag { background: rgba(255, 255, 255, .08); border-color: var(--cmp-line); color: var(--cmp-ink); font-size: 14px; }
.cmp-stage-idle { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 18px; z-index: 1; color: var(--cmp-ink-2); }
.cmp-stage.idle { height: auto; min-height: 210px; }
.cmp-stage.idle .cmp-window, .cmp-stage.idle .cmp-reel { display: none; }
.cmp-stage.idle .cmp-stage-idle { position: relative; min-height: 210px; }
.cmp-stage-idle b { display: block; color: var(--cmp-ink); font-size: 20px; margin-bottom: 4px; }
.cmp-ticket { display: flex; justify-content: center; gap: 10px; align-items: baseline; margin-top: 14px; color: var(--cmp-ink-2); font-size: 14px; }
.cmp-ticket b { font-family: var(--mono); font-size: 22px; color: var(--cmp-ink); font-variant-numeric: tabular-nums; }
.cmp-winners { display: grid; gap: 10px; margin-top: 18px; }
.cmp-winner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, .06); border: 1px solid var(--cmp-line); }
.cmp-winner.main { background: linear-gradient(90deg, rgba(255, 179, 92, .18), rgba(255, 79, 163, .18)); border-color: rgba(255, 179, 92, .5); }
.cmp-winner .crown { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--cmp-grad); color: #1b0b23; font-weight: 900; }
.cmp-winner b { font-size: 18px; }
.cmp-winner small { display: block; color: var(--cmp-ink-2); }
.cmp-proof { margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: rgba(0, 0, 0, .28); border: 1px solid var(--cmp-line); font-size: 13px; color: var(--cmp-ink-2); }
.cmp-proof code { font-family: var(--mono); direction: ltr; unicode-bidi: isolate; word-break: break-all; color: var(--cmp-ink); font-size: 12px; }
.cmp-proof .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.cmp-proof .ok { color: #7cf2a8; font-weight: 700; }
.cmp-proof .bad { color: #ff8a8a; font-weight: 700; }
.cmp-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 9999; }

/* ?live=1: full-screen stage for the stream */
body.cmp-live-mode { background: var(--cmp-night); }
body.cmp-live-mode > header, body.cmp-live-mode footer, body.cmp-live-mode .cmp-hide-live, body.cmp-live-mode #xoSupport, body.cmp-live-mode .xo-support { display: none !important; }
body.cmp-live-mode .cmp-live-sec { padding: 3vh 0; min-height: 100vh; display: flex; align-items: center; }
body.cmp-live-mode .cmp-live-sec .wrap { max-width: 1100px; }
body.cmp-live-mode .cmp-stage { height: 300px; }
body.cmp-live-mode .cmp-window { height: 96px; margin-top: -48px; }
body.cmp-live-mode .cmp-reel div { height: 96px; font-size: clamp(28px, 4.4vw, 46px); }
body.cmp-live-mode .cmp-draw h2 { font-size: clamp(30px, 4.6vw, 52px); }

@media (prefers-reduced-motion: reduce) {
  .cmp-hero-img img, .cmp-live .dot { animation: none; }
}
