:root {
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --viz-grid: #e4e1ea;
  --viz-axis: #c3c2b7;
  --viz-tick: #6f6c78;
  --brand: #6d28d9;
  --accent: var(--brand);
  --bg: #f6f5f8;
  --panel: #ffffff;
  --text: #1c1a24;
  --muted: #676472;
  --line: #e4e1ea;
  --good: #0f7a4f;
  --good-bg: #dcf5e9;
  --bad: #b3261e;
  --bad-bg: #fbe5e3;
  --warn-bg: #fff4d6;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14121a;
    --panel: #1e1b27;
    --text: #f1eff6;
    --muted: #a5a1b2;
    --line: #322e3f;
    --good: #5edba5;
    --good-bg: #123626;
    --bad: #ff9a92;
    --bad-bg: #40191a;
    --warn-bg: #3a2f10;
    --series-1: #3987e5;
    --series-2: #d95926;
    --viz-grid: #2f2b3b;
    --viz-axis: #454053;
    --viz-tick: #a5a1b2;
    /* a dark brand color is unreadable as text on the dark background */
    --accent: color-mix(in srgb, var(--brand) 55%, white);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin: 0 0 .5rem; }
h2.sec { margin-top: 1.5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
p { margin: .4rem 0; }
a { color: var(--accent); }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em; overflow-wrap: anywhere; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.break { overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.good-text { color: var(--good); }
.warn-text { background: var(--warn-bg); padding: .6rem .8rem; border-radius: 10px; }
.form-error { color: var(--bad); margin: .4rem 0; min-height: 0; }
.form-error:empty { display: none; }

/* layout */
.layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 100vh; }
.side {
  display: flex; flex-direction: column; gap: 2px; padding: 20px 12px; background: var(--panel);
  border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh;
}
.side a { padding: 9px 12px; border-radius: 10px; color: var(--text); text-decoration: none; }
.side a:hover { background: var(--bg); }
.side a.active { background: var(--brand); color: #fff; }
.side .logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.05rem; margin-bottom: 14px; color: var(--text); }
.side .logo:hover { background: none; }
.content { padding: 28px 32px 64px; max-width: 1020px; width: 100%; display: flex; flex-direction: column; gap: 14px; }
.content > * { min-width: 0; }
.tab-body { display: flex; flex-direction: column; gap: 14px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card.warn { background: var(--warn-bg); }
details.card summary { cursor: pointer; font-weight: 600; }
details.card[open] summary { margin-bottom: 12px; }
.page-head .back { text-decoration: none; font-size: .9rem; }

/* forms */
label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 8px; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); font: inherit; margin-top: 4px;
}
input[type=color] { height: 42px; padding: 3px; }
input[type=file] { padding: 7px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; margin-bottom: 8px; }
.span-2 { grid-column: span 2; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input { flex: 1 1 260px; margin: 0; width: auto; }
.inline-form select { flex: 0 0 auto; width: auto; margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 15px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover:not(:disabled) { border-color: var(--brand); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.12); }
.btn.small { min-height: 34px; padding: 4px 11px; font-size: .88rem; }
.btn.wide { width: 100%; margin-top: 8px; }
.btn.huge { font-size: 1.2rem; padding: 15px 34px; }
.danger-text { color: var(--bad); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }

.chip {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: var(--bg); border: 1px solid var(--line); white-space: nowrap;
}
.chip.good { background: var(--good-bg); color: var(--good); border-color: transparent; }
.chip.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.chip.busy { background: var(--warn-bg); border-color: transparent; }

/* activation switches */
.switch {
  flex: 0 0 auto; position: relative; width: 50px; height: 28px; padding: 0; border-radius: 999px; cursor: pointer;
  background: #8b8797; border: 0; transition: background .15s;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.switch[aria-checked=true] { background: var(--brand); }
.switch[aria-checked=true]::after { transform: translateX(22px); }
.rules { display: flex; flex-direction: column; }
.rule { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.rules .rule:first-child { border-top: 0; }
.rule-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; align-items: flex-start; }
.rule-value { width: 100%; max-width: 420px; margin-top: 6px; }
.rule-summary {
  position: sticky; top: 0; z-index: 5; margin: 0; padding: 10px 14px; border-radius: 10px;
  background: var(--brand); color: #fff; font-weight: 600;
}

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; }
.tabs a.active { color: var(--accent); border-color: var(--accent); }

/* giveaway list */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(380px, 100%); }
.giveaways { display: flex; flex-direction: column; gap: 8px; }
.giveaway-row { display: flex; gap: 12px; justify-content: space-between; align-items: center; text-decoration: none; color: inherit; flex-wrap: wrap; }
.giveaway-row:hover { border-color: var(--brand); }
.gw-main { display: flex; flex-direction: column; min-width: 0; }
.gw-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .9rem; }

/* sources */
.sources { display: flex; flex-direction: column; gap: 8px; }
.source-main { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.source-url { overflow-wrap: anywhere; flex: 1 1 200px; min-width: 0; }
.source .actions { margin-top: 8px; }

/* participants */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; }
.tile strong { font-size: 1.6rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.reasons { display: flex; gap: 6px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar input { flex: 1 1 220px; width: auto; margin: 0; }
.toolbar select { flex: 0 0 auto; width: auto; margin: 0; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.card .table-wrap { border: 0; background: none; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th { text-align: left; font-size: .78rem; color: var(--muted); font-weight: 600; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.comment { min-width: 220px; overflow-wrap: anywhere; }
tr.excluded td:not(:nth-child(4)) { opacity: .6; }
.empty { padding: 18px; text-align: center; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; }
.settings-table td.switch-cell { width: 110px; }
.settings-table .rule-value { display: block; }

/* draw */
.draw-card { display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.draw-card .huge { align-self: center; }
.stage {
  position: fixed; inset: 0; z-index: 50; background: radial-gradient(circle at 50% 0, var(--brand), #12101a 65%);
  color: #fff; display: flex; flex-direction: column; gap: 18px; align-items: center; justify-content: center;
  padding: 24px 16px; text-align: center; overflow-y: auto;
}
.stage-title { font-size: clamp(1.1rem, 3vw, 1.7rem); font-weight: 600; opacity: .85; margin: 0; }
.stage-name { font-size: clamp(2rem, 8vw, 5.5rem); font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; min-height: 1.2em; }
.stage-count { font-size: clamp(3rem, 12vw, 8rem); font-weight: 800; font-variant-numeric: tabular-nums; opacity: .9; }
.stage-winners { display: flex; flex-direction: column; gap: 10px; width: min(760px, 100%); }
.stage-winner { background: rgba(255,255,255,.12); border-radius: 16px; padding: 14px 20px; display: flex; flex-direction: column; animation: pop .35s ease-out; }
.stage-winner strong { font-size: clamp(1.5rem, 5vw, 3rem); overflow-wrap: anywhere; line-height: 1.15; }
.stage-winner em { opacity: .8; overflow-wrap: anywhere; }
.stage-subs { opacity: .85; overflow-wrap: anywhere; }
.stage-btn { background: #fff; color: #1c1a24; border: 0; }
.confetti { position: fixed; inset: 0; pointer-events: none; }
@keyframes pop { from { transform: scale(.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .stage-winner { animation: none; } }

/* results */
.results { display: flex; flex-direction: column; gap: 10px; }
.result.rejected { opacity: .65; }
.result.approved { border-color: var(--good); }
.result-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.result-head > div { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.result-name { font-size: 1.3rem; overflow-wrap: anywhere; }
.result-text { color: var(--muted); overflow-wrap: anywhere; }
.checks { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.checks li { display: flex; gap: 10px; align-items: center; }
.review { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.review input { flex: 1 1 200px; margin: 0; width: auto; }
.events { display: flex; flex-direction: column; gap: 8px; }
.events li { display: flex; flex-direction: column; }
.brand-preview { max-height: 90px; max-width: 100%; margin: 8px 0; border-radius: 8px; }
.ig-card p { margin: 4px 0; }
.ig-safe { list-style: disc; padding-left: 1.2rem; color: var(--muted); font-size: .9rem; margin: 8px 0; }
.ig-media { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ig-media li { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 8px; }
.ig-media span { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.uri-list { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 10px; }
.import-review { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.import-review:empty { display: none; }
.connection .rule { border-top: 0; padding-top: 0; }
.connection .inline-form { margin-top: 6px; }

.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; max-width: calc(100vw - 32px);
  background: #1c1a24; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: 0 6px 22px rgba(0,0,0,.3);
}
.toast.bad { background: #b3261e; }

/* public page */
.public-wrap { max-width: 760px; margin: 0 auto; padding: 32px 16px 56px; display: flex; flex-direction: column; gap: 14px; }
.public-head { text-align: center; padding-bottom: 6px; }
.brand-logo { max-height: 72px; max-width: 70%; margin-bottom: 12px; }
.brand-name { display: block; color: var(--accent); font-size: 1.1rem; margin-bottom: 8px; }
.prize { font-size: 1.1rem; }
.winners { display: flex; flex-direction: column; gap: 8px; }
.winner { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--bg); flex-wrap: wrap; }
.winner-pos { font-weight: 800; color: var(--accent); }
.winner-name { font-weight: 700; font-size: 1.15rem; flex: 1 1 120px; overflow-wrap: anywhere; min-width: 0; }
.subs .winner-name { font-size: 1rem; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.plain { display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.proof dt { font-size: .85rem; color: var(--muted); margin-top: 8px; }
.proof dd { margin: 0; }
.verify-status { font-weight: 600; margin-top: 10px; }
.verify-status:empty { display: none; }
.verify-status.good { color: var(--good); }
.verify-status.bad { color: var(--bad); }
.public-foot { text-align: center; font-size: .85rem; }

/* public site */
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; max-width: 1080px; margin: 0 auto; padding: 14px 16px; }
.site-logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.2rem; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.site-head nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: .95rem; }
.site-head nav a:not(.btn) { color: var(--text); text-decoration: none; }
.site-head nav a:not(.btn):hover { text-decoration: underline; }
.site-main { max-width: 1080px; margin: 0 auto; padding: 12px 16px 56px; display: flex; flex-direction: column; gap: 28px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: start; padding-top: 18px; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); line-height: 1.08; letter-spacing: -.02em; font-weight: 800; }
.lead { font-size: 1.12rem; color: var(--muted); margin: 14px 0 18px; }
.network-chips { margin-bottom: 18px; }
.my-giveaways { margin-top: 12px; }
.my-giveaways h2 { font-size: 1rem; }
.section { scroll-margin-top: 16px; }
.section > h2 { font-size: 1.5rem; margin-bottom: 14px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; counter-reset: step; }
.steps li { counter-increment: step; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.steps li::before { content: counter(step); font-weight: 800; color: var(--accent); font-size: 1.4rem; }
.steps span { color: var(--muted); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.grid-3 h3 { margin-top: 0; }
.faq { display: flex; flex-direction: column; gap: 8px; }
.faq p { margin: 0; color: var(--muted); }
.verify-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.verify-form label { flex: 1 1 240px; margin: 0; }
.prose { max-width: 720px; }
.prose h1 { font-size: 2rem; }
.prose h2 { margin-top: 1.5rem; }
.prose ul { list-style: disc; padding-left: 1.3rem; display: flex; flex-direction: column; gap: 4px; }
.donate-card { max-width: 720px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.donate-card label { width: 100%; }
.pix-qr { width: 220px; height: 220px; background: #fff; border-radius: 12px; padding: 6px; align-self: center; }
.donate-links { display: flex; gap: 8px; flex-wrap: wrap; }
.donate-dialog { width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border: 0; border-radius: 18px; padding: 22px; background: var(--panel); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.donate-dialog[open] { display: flex; flex-direction: column; gap: 10px; }
.donate-dialog::backdrop { background: rgba(10,8,16,.6); }
.donate-dialog h2 { margin: 0; font-size: 1.25rem; }
.donate-dialog p { margin: 0; }
.donate-dialog textarea { margin: 0; font-size: .78rem; }
.pix-key { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--bg); border-radius: 10px; padding: 8px 12px; }
.pix-key div { display: flex; flex-direction: column; min-width: 0; }
.pix-key strong { overflow-wrap: anywhere; }
.keep-link { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--warn-bg); padding: 10px 14px; border-radius: 12px; }
.keep-link span { flex: 1 1 260px; }
.content.narrow { max-width: 1020px; margin: 0 auto; padding-top: 8px; }
.tool-ad { max-width: 1020px; margin: 0 auto; padding: 0 16px; }
.ad-slot { min-height: 100px; }
.ad-label { display: block; font-size: .72rem; color: var(--muted); text-align: center; }
.site-foot { border-top: 1px solid var(--line); background: var(--panel); margin-top: 24px; padding: 32px 16px 20px; }
.foot-grid { max-width: 1048px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 24px; }
.foot-grid h2 { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.foot-grid ul { display: flex; flex-direction: column; gap: 6px; }
.foot-grid a { color: var(--text); text-decoration: none; }
.foot-grid a:hover { text-decoration: underline; }
.foot-brand p { color: var(--muted); }
.foot-mark { display: block; margin-bottom: 8px; }
.login-logo { display: block; margin-bottom: 10px; }
.foot-legal { max-width: 1048px; margin: 22px auto 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 40; max-width: 560px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: 0 10px 34px rgba(0,0,0,.3); }
.consent p { margin: 0; }
.side-out { margin-top: auto; color: var(--muted) !important; }
.toolbar.spread { justify-content: space-between; }
.toolbar.spread h1 { margin: 0; }
.log-cell { white-space: nowrap; max-width: 340px; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }

/* charts */
.viz h2 { margin-bottom: 4px; }
.viz-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin: 6px 0; }
.viz-legend li { display: flex; align-items: center; gap: 6px; }
.viz-key { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.viz-legend .viz-key { margin-right: 0; }
.viz-key-visitors { background: var(--series-1); }
.viz-key-pageviews { background: var(--series-2); }
.viz-plot { position: relative; }
.viz-svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-axis { stroke: var(--viz-axis); stroke-width: 1; }
.viz-cross { stroke: var(--viz-axis); stroke-width: 1; }
.viz-tick { fill: var(--viz-tick); font-size: 12px; font-variant-numeric: tabular-nums; }
.viz-tip { position: absolute; display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: .82rem; pointer-events: none; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.viz-table { margin-top: 8px; font-size: .9rem; }
.viz-table summary { cursor: pointer; color: var(--muted); }
td.num { font-variant-numeric: tabular-nums; }
.viz-bars { display: flex; flex-direction: column; gap: 10px; }
.viz-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; font-size: .92rem; }
.viz-bar-label { overflow-wrap: anywhere; }
.viz-bar-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.viz-bar-track { grid-column: 1 / -1; height: 6px; }
.viz-bar { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }

@media (max-width: 760px) {
  .hero, .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .layout { display: block; }
  .side {
    position: sticky; z-index: 10; flex-direction: row; height: auto; padding: 8px 12px; overflow-x: auto;
    border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none;
  }
  .side a { white-space: nowrap; padding: 7px 10px; }
  .side .logo { display: none; }
  .content { padding: 18px 16px 48px; }
  .form-grid, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .card { padding: 15px; }
  .inline-form .btn, .inline-form select { flex: 1 1 auto; }
  .rule-summary { top: 53px; }
  .settings-table thead { display: none; }
  .settings-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .settings-table td { display: block; border: 0; padding: 4px 0; width: auto !important; }
  .settings-table td.rule-text { display: flex; }
  .side-out { margin-top: 0; }
  .settings-table td.switch-cell { display: flex; justify-content: space-between; align-items: center; }
  .settings-table td.switch-cell::before { content: attr(data-label); font-size: .85rem; color: var(--muted); }
}
