/* Huntrez Revamp: chat giveaway page (/giveaway), for Kick hosts. Builds on site.css tokens.
   Same layout as the standalone giveaway tool: set-up on the left, the reel in the middle, entries and winners on the
   right. Every class starts with gw- so nothing here collides with site.css. */

.giveaway-page {
  --gw-bg-2: #090a1f;
  --gw-surface: #10112c;
  --gw-surface-2: #15173a;
  --gw-surface-3: #1b1d45;
  --gw-line: rgba(255, 255, 255, 0.07);
  --gw-line-2: rgba(255, 255, 255, 0.14);
  --gw-text-2: #c9ccef;
  --gw-text-3: var(--muted);
  --gw-r-sm: 8px;
  --gw-r: 12px;
  --gw-r-lg: 16px;
  --gw-mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.45;
  background-color: var(--bg);
  background-image: radial-gradient(1200px 600px at 50% -200px, rgba(0, 229, 245, 0.06), transparent 70%);
  background-repeat: no-repeat;
}
:where(.giveaway-page) :where(button, input) { font: inherit; color: inherit; }

/* ---------- Top bar ---------- */
.gw-top { position: sticky; top: 0; z-index: 5; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--gw-line); background: rgba(7, 7, 28, 0.8); backdrop-filter: blur(10px); }
.gw-brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 16px; letter-spacing: -0.01em; text-decoration: none; }
.gw-brand:hover { color: var(--text); }
.gw-brand small { display: block; margin-top: -2px; color: var(--gw-text-3); font-size: 11px; font-weight: 500; letter-spacing: 0.02em; }
.gw-mark { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.gw-spacer { flex: 1; }
.gw-tools { display: flex; align-items: center; gap: 12px; }
.gw-tools[hidden] { display: none; }
.gw-pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--gw-line-2); background: var(--gw-surface); color: var(--gw-text-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.gw-pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gw-text-3); }
.gw-pill.is-on { color: var(--live); border-color: rgba(111, 245, 166, 0.3); }
.gw-pill.is-on .gw-pill-dot { background: var(--live); box-shadow: 0 0 0 4px rgba(111, 245, 166, 0.15); animation: gw-pulse 2s infinite; }
.gw-pill.is-wait { color: var(--gold); border-color: rgba(255, 207, 90, 0.3); }
.gw-pill.is-wait .gw-pill-dot { background: var(--gold); }
.gw-pill.is-err { color: var(--error); border-color: rgba(255, 143, 163, 0.3); }
.gw-pill.is-err .gw-pill-dot { background: var(--error); }
@keyframes gw-pulse { 50% { box-shadow: 0 0 0 7px rgba(111, 245, 166, 0); } }
.gw-iconbtn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--gw-r-sm); border: 1px solid var(--gw-line-2); background: var(--gw-surface); color: var(--gw-text-2); cursor: pointer; transition: 0.15s; }
.gw-iconbtn:hover { color: var(--text); background: var(--gw-surface-2); }
.gw-iconbtn.is-active { color: var(--accent); border-color: rgba(0, 229, 245, 0.35); }
.gw-iconbtn svg[hidden] { display: none; }

/* ---------- Hosts only ---------- */
.gw-gate { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 24px; }
.gw-gate[hidden] { display: none; }
.gw-gate-card { width: min(100%, 440px); padding: 32px; border-radius: 22px; background: var(--gw-surface); border: 1px solid var(--gw-line); display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.gw-gate-card .skeleton { width: 100%; }
.gw-gate-card h1 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 34px; line-height: 1.1; }
.gw-gate-card p { margin: 0; color: var(--gw-text-2); font-size: 15px; }
.gw-gate-card .row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

/* ---------- Layout ---------- */
.gw-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr) 300px; gap: 20px; padding: 20px; min-height: calc(100vh - 60px); }
.gw-layout[hidden] { display: none; }
body.gw-focus .gw-layout { grid-template-columns: minmax(0, 1fr); }
body.gw-focus .gw-side, body.gw-focus #kick-auth { display: none; }
@media (max-width: 1180px) { .gw-layout { grid-template-columns: 1fr; } }
.gw-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.gw-card { padding: 16px; border-radius: var(--gw-r-lg); background: var(--gw-surface); border: 1px solid var(--gw-line); }
.gw-card-h { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; }
.gw-card-h h2 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.01em; }
.gw-card-h .gw-num { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--gw-surface-3); color: var(--gw-text-2); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gw-ic { color: var(--gw-text-3); }

.gw-field + .gw-field { margin-top: 12px; }
.gw-label { display: block; margin-bottom: 6px; color: var(--gw-text-2); font-size: 12px; font-weight: 600; }
.gw-input { width: 100%; height: 38px; padding: 0 12px; border-radius: var(--gw-r-sm); border: 1px solid var(--gw-line-2); background: var(--gw-bg-2); color: var(--text); outline: none; transition: 0.15s; }
.gw-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 229, 245, 0.15); }
.gw-input.gw-mono { font-family: var(--gw-mono); font-weight: 700; }
.gw-inline { display: flex; gap: 8px; }
.gw-inline .gw-input { flex: 1; min-width: 0; }

.gw-btn { height: 38px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--gw-r-sm); border: 1px solid var(--gw-line-2); background: var(--gw-surface-2); color: var(--text); font-weight: 600; font-size: 13px; white-space: nowrap; cursor: pointer; transition: 0.15s; }
.gw-btn:hover:not(:disabled) { background: var(--gw-surface-3); }
.gw-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.gw-btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.gw-btn-primary:hover:not(:disabled) { background: #5ff0fa; }
.gw-btn-ghost { background: transparent; }
.gw-btn-danger:hover:not(:disabled) { color: var(--error); border-color: rgba(255, 143, 163, 0.4); }
.gw-btn-block { width: 100%; }
.gw-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.gw-steps { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.gw-steps li { display: flex; gap: 10px; color: var(--gw-text-2); font-size: 12.5px; }
.gw-steps b { color: var(--text); }
.gw-n { flex: 0 0 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--gw-surface-3); color: var(--text); font-size: 11px; font-weight: 700; }
.gw-n.is-ok { background: var(--accent); color: var(--accent-ink); }
.gw-steps .gw-bm-row { padding-left: 30px; gap: 8px; }
.gw-bm { flex: 1; height: 38px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--gw-r-sm); border: 1px dashed rgba(0, 229, 245, 0.55); background: rgba(0, 229, 245, 0.06); color: var(--accent); font-weight: 700; font-size: 13px; text-decoration: none; cursor: grab; }
.gw-bm:hover { color: var(--accent); background: rgba(0, 229, 245, 0.11); }

.gw-seg { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: var(--gw-r-sm); border: 1px solid var(--gw-line-2); background: var(--gw-bg-2); }
.gw-seg button { height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--gw-text-2); font-weight: 600; font-size: 12.5px; cursor: pointer; }
.gw-seg button[aria-pressed='true'] { background: var(--gw-surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }

.gw-switch { position: relative; display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 13px; cursor: pointer; user-select: none; }
.gw-switch + .gw-switch { margin-top: 12px; }
.gw-switch input { position: absolute; opacity: 0; pointer-events: none; }
.gw-track { position: relative; flex: 0 0 34px; height: 20px; border-radius: 999px; border: 1px solid var(--gw-line-2); background: var(--gw-surface-3); transition: 0.2s; }
.gw-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--gw-text-2); transition: 0.2s; }
.gw-switch input:checked + .gw-track { background: var(--accent); border-color: var(--accent); }
.gw-switch input:checked + .gw-track::after { left: 16px; background: var(--accent-ink); }
.gw-switch input:focus-visible + .gw-track { box-shadow: 0 0 0 3px rgba(0, 229, 245, 0.25); }
.gw-divider { height: 1px; margin: 14px 0; background: var(--gw-line); }

.gw-feed summary { margin-top: 14px; color: var(--gw-text-3); font-size: 12px; cursor: pointer; }
#gw-feed { margin-top: 8px; padding: 8px 10px; max-height: 150px; overflow: auto; border-radius: var(--gw-r-sm); border: 1px solid var(--gw-line); background: var(--gw-bg-2); color: var(--gw-text-2); font: 12px/1.6 var(--gw-mono); word-break: break-all; }
#gw-feed:empty::before { content: 'Nothing received yet'; color: var(--gw-text-3); }

/* ---------- Stage ---------- */
.gw-stage { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 18px 0 10px; min-width: 0; }
.gw-eyebrow { margin: 0; color: var(--gw-text-3); font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }
.gw-headline { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.gw-kw { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.gw-chip { padding: 6px 16px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font: 700 26px var(--gw-mono); overflow-wrap: anywhere; box-shadow: 0 0 0 4px rgba(0, 229, 245, 0.12), 0 10px 30px rgba(0, 229, 245, 0.19); }
.gw-kw.is-closed { color: var(--error); }

.gw-reel { position: relative; width: 100%; max-width: 1040px; height: 300px; overflow: hidden; border-radius: 22px; border: 1px solid var(--gw-line); background: radial-gradient(50% 70% at 50% 35%, rgba(0, 229, 245, 0.06), transparent 70%), linear-gradient(180deg, #0e0f2c, #08091f); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.03); }
.gw-reel::before, .gw-reel::after { content: ''; position: absolute; top: 0; bottom: 0; z-index: 2; width: 22%; pointer-events: none; }
.gw-reel::before { left: 0; background: linear-gradient(90deg, #08091f 5%, transparent); }
.gw-reel::after { right: 0; background: linear-gradient(-90deg, #08091f 5%, transparent); }
.gw-strip { position: absolute; top: 40px; left: 0; display: flex; gap: 14px; will-change: transform; }
.gw-ncard {
  --c: var(--accent);
  position: relative; flex: 0 0 156px; height: 184px; padding: 16px 12px 20px; border-radius: 16px; overflow: hidden; transform-origin: 50% 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(120% 60% at 50% 120%, color-mix(in srgb, var(--c) 34%, transparent), transparent 70%), linear-gradient(180deg, #1b1d45, #12133a);
  border: 1px solid rgba(255, 255, 255, 0.09); box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.65);
  transition: filter 0.5s, border-color 0.4s, box-shadow 0.4s; will-change: transform;
}
.gw-ncard::before { content: ''; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), transparent 45%); pointer-events: none; }
.gw-ncard::after { content: ''; position: absolute; left: 18%; right: 18%; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--c); box-shadow: 0 0 16px var(--c); }
.gw-ncard .gw-nm { max-width: 100%; font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gw-ncard.is-win { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), 0 0 50px color-mix(in srgb, var(--c) 60%, transparent); }
.gw-strip.is-dim .gw-ncard:not(.is-win) { filter: grayscale(0.7) brightness(0.4); }
.gw-marker { position: absolute; left: 50%; top: 0; bottom: 0; z-index: 3; width: 2px; margin-left: -1px; pointer-events: none; background: linear-gradient(180deg, var(--accent) 0, var(--accent) 24px, transparent 32%, transparent 68%, var(--accent) calc(100% - 24px), var(--accent) 100%); }
.gw-marker::before, .gw-marker::after { content: ''; position: absolute; left: 50%; transform: translateX(-50%); border-left: 11px solid transparent; border-right: 11px solid transparent; filter: drop-shadow(0 0 8px rgba(0, 229, 245, 0.67)); }
.gw-marker::before { top: 0; border-top: 16px solid var(--accent); }
.gw-marker::after { bottom: 0; border-bottom: 16px solid var(--accent); }
.gw-reelempty { position: absolute; inset: 0; z-index: 1; padding: 0 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--gw-text-3); text-align: center; }
.gw-reelempty[hidden] { display: none; }
.gw-reelempty strong { color: var(--text); font-size: 18px; }

.gw-avatar {
  --c: var(--accent);
  flex: 0 0 auto; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center;
  color: #07071c; font-weight: 800; font-size: 24px; letter-spacing: -0.02em;
  background: linear-gradient(140deg, color-mix(in srgb, var(--c) 70%, #fff), color-mix(in srgb, var(--c) 75%, #000));
  box-shadow: 0 0 0 3px #0e0f2c, 0 0 0 5px color-mix(in srgb, var(--c) 45%, transparent);
}
.gw-avatar-sm { width: 28px; height: 28px; font-size: 11px; box-shadow: none; }
.gw-avatar-xl { width: 104px; height: 104px; font-size: 40px; box-shadow: 0 0 0 4px var(--gw-surface), 0 0 0 7px color-mix(in srgb, var(--c) 60%, transparent), 0 0 60px color-mix(in srgb, var(--c) 45%, transparent); }

.gw-spinrow { display: flex; align-items: center; gap: 12px; }
.gw-spin {
  height: 56px; padding: 0 56px; border: 0; border-radius: 14px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  background: var(--accent); color: var(--accent-ink); font-weight: 900; font-size: 17px; letter-spacing: 0.16em;
  box-shadow: 0 0 0 1px var(--accent), 0 14px 34px -8px rgba(0, 229, 245, 0.5); transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.gw-spin:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--accent), 0 18px 44px -8px rgba(0, 229, 245, 0.67); }
.gw-spin:active:not(:disabled) { transform: translateY(0); }
.gw-spin:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }
.gw-kbd { padding: 2px 6px; border: 1px solid var(--gw-line-2); border-bottom-width: 2px; border-radius: 6px; color: var(--gw-text-3); font: 600 11px var(--gw-mono); }

.gw-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 180px)); gap: 12px; }
.gw-stat { padding: 12px 16px; border-radius: var(--gw-r); background: var(--gw-surface); border: 1px solid var(--gw-line); }
.gw-stat .gw-v { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.gw-stat .gw-k { color: var(--gw-text-3); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.gw-stat .gw-v.is-green { color: var(--live); }
.gw-stat .gw-v.is-red { color: var(--error); }
.gw-stat .gw-v.is-busy { color: var(--accent); }

/* ---------- Lists ---------- */
.gw-list { display: flex; flex-direction: column; max-height: 380px; overflow: auto; margin: 0 -6px; }
.gw-list::-webkit-scrollbar { width: 8px; }
.gw-list::-webkit-scrollbar-thumb { background: var(--gw-line-2); border-radius: 8px; }
.gw-row { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--gw-r-sm); }
.gw-row:hover { background: var(--gw-surface-2); }
.gw-row .gw-nm { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gw-row .gw-meta { color: var(--gw-text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.gw-row .gw-x { width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--gw-text-3); cursor: pointer; opacity: 0; }
.gw-row:hover .gw-x, .gw-row .gw-x:focus-visible { opacity: 1; }
.gw-row .gw-x:hover { color: var(--error); background: rgba(255, 143, 163, 0.08); }
@media (hover: none) { .gw-row .gw-x { opacity: 1; } }
.gw-row .gw-rank { width: 24px; text-align: center; color: var(--link); font-size: 11px; font-weight: 800; }
.gw-empty { margin: 0; padding: 22px 6px; text-align: center; color: var(--gw-text-3); font-size: 12.5px; }
.gw-search { height: 34px; margin-bottom: 10px; }

/* ---------- Winner card: the dialog covers the screen so the confetti can fly over everything ---------- */
.gw-dialog { width: 100%; height: 100%; max-width: 100%; max-height: 100%; margin: 0; padding: 16px; border: 0; background: transparent; color: var(--text); }
.gw-dialog[open] { display: flex; align-items: center; justify-content: center; }
.gw-dialog::backdrop { background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(6px); }
.gw-wcard {
  position: relative; width: min(480px, 100%); padding: 38px 32px 28px; border-radius: 24px; overflow: hidden; text-align: center;
  background: radial-gradient(90% 60% at 50% 0%, color-mix(in srgb, var(--wc, var(--accent)) 22%, transparent), transparent 70%), var(--gw-surface);
  border: 1px solid var(--gw-line-2); box-shadow: 0 40px 80px rgba(0, 0, 0, 0.8); animation: gw-pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.gw-wcard .gw-avatar { margin: 0 auto; }
.gw-wcard .gw-eyebrow { margin-top: 22px; color: var(--accent); }
.gw-wn { margin: 6px 0 4px; font-family: var(--font-display); font-weight: 400; font-size: clamp(34px, 6vw, 52px); line-height: 1.05; overflow-wrap: anywhere; }
.gw-ws { margin: 0 0 26px; color: var(--gw-text-3); font-size: 13px; }
.gw-wcard .gw-grid2 .gw-btn { height: 44px; }
@keyframes gw-pop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.gw-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

@media (max-width: 640px) {
  .gw-top { padding: 0 12px; }
  .gw-layout { padding: 12px; }
  .gw-stats { grid-template-columns: repeat(3, 1fr); }
  .gw-spin { padding: 0 32px; }
  .gw-pill-text, .gw-brand small { display: none; }
}
