/* ═══════════════════════════════════════════════
   Giveaways — v1.1.582
   Inherits all tokens from shell (www surface)
   No hardcoded dark fallbacks — uses var() only
═══════════════════════════════════════════════ */

#giveaways-root {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Section spacing ── */
.gw-page-head  { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.gw-statusbar  { margin-bottom: 10px; }
.gw-modes      { margin-bottom: 14px; }

/* ── Page title — match /t tPageTitle ── */
.gw-page-title { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.3px; line-height: 1.1; margin: 0 0 3px; }
.gw-page-sub   { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.6; }

/* ── Status bar ── */
.gw-statusbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: background .3s, border-color .3s;
}
.gw-statusbar.is-live {
  background: var(--ok-bg);
  border-color: var(--ok-border);
}
.gw-statusbar-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.gw-statusbar-dot.live {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
  animation: gwpulse 1.8s ease-in-out infinite;
}
@keyframes gwpulse {
  0%,100% { box-shadow: 0 0 0 3px var(--accent-bg); }
  50%      { box-shadow: 0 0 0 7px transparent; }
}
.gw-statusbar-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.1px;
}
.gw-statusbar-meta {
  font-size: 13px;
  color: var(--text2);
  font-weight: 600;
}
.gw-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
}
.gw-pill.live {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  color: var(--accent-text);
}

/* ── Mode cards ── */
.gw-modes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap: 8px;
}
.gw-mode-btn {
  all: unset;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .14s, background .14s, transform .1s;
  color: var(--text2);
}
.gw-mode-btn:hover {
  border-color: var(--border2);
  background: var(--surface2);
  transform: translateY(-1px);
}
.gw-mode-btn.active {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--text);
}
.gw-mode-icon  { font-size: 18px; line-height: 1; }
.gw-mode-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.gw-mode-btn.active .gw-mode-label { color: var(--accent-text); }
.gw-mode-title { font-size: 12px; font-weight: 700; color: inherit; line-height: 1.2; }
.gw-mode-desc  { font-size: 10px; color: var(--muted); line-height: 1.4; }

/* ── Layout grid ── */
.gw-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,320px);
  gap: 14px;
  align-items: start;
}
.gw-col { display: flex; flex-direction: column; gap: 14px; }

/* ── Cards — match /t tCard ── */
.gw-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
}
.gw-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.gw-card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
}
.gw-card-title h3, .gw-card-title h4 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.2px; color: var(--text); line-height: 1.2; }
.gw-card-sub {
  font-size: 13px;
  color: var(--text2);
  margin-top: 3px;
  line-height: 1.6;
}

/* ── Buttons — match /t btn ── */
.gw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color .12s, background .12s;
  font-family: inherit;
  letter-spacing: -.1px;
}
.gw-btn:hover { border-color: var(--accent); background: var(--surface2); }
.gw-btn.primary {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
  font-weight: 800;
}
.gw-btn.primary:hover { opacity: .88; }
.gw-btn.danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: #dc2626;
  font-weight: 700;
}
.gw-btn.danger:hover { opacity: .85; }
.gw-btn.full    { width: 100%; }
.gw-btn:disabled { opacity: .35; cursor: not-allowed; }
.gw-btn.small   { padding: 7px 13px; font-size: 12px; }

/* ── Form fields — match /t tForm input ── */
.gw-form { display: grid; gap: 10px; }
.gw-label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
}
.gw-input, .gw-select, .gw-textarea {
  border-radius: var(--r);
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.gw-input:focus, .gw-select:focus, .gw-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-bg);
}
.gw-input::placeholder, .gw-textarea::placeholder { color: var(--muted); opacity: .6; }
.gw-row-2   { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Chat delays — 2 per row with generous vertical breathing room */
.gw-delays-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
.gw-delay-row   { display: flex; flex-direction: column; }
.gw-row-3   { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.gw-inline  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gw-help    { font-size: 11px; color: var(--muted); line-height: 1.5; }
.gw-entrant-help { font-size: 13px; color: var(--text2); line-height: 1.55; font-family: inherit; margin-bottom: 2px; }
.gw-divider { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

/* ── Entrant list ── */
.gw-entrant-list {
  display: grid;
  gap: 5px;
  max-height: 260px;
  overflow-y: auto;
  margin-top: 8px;
  padding-right: 2px;
  overflow-anchor: none;
}
.gw-entrant {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg3);
  font-size: 12px;
}
.gw-entrant-name    { font-weight: 700; color: var(--text); }
.gw-entrant-tickets { font-size: 11px; color: var(--muted); margin-top: 2px; }
.gw-entrant-actions { display: flex; gap: 4px; flex-shrink: 0; }
.gw-entrant-btn {
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .1s;
}
.gw-entrant-btn:hover { background: var(--surface); border-color: var(--accent); }
.gw-entrant-btn.remove { border-color: var(--danger-border); color: #dc2626; }
.gw-entrant-btn.remove:hover { background: var(--danger-bg); }

/* ── Winners ── */
.gw-winner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r);
  border: 1px solid var(--ok-border);
  background: var(--ok-bg);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-text);
  margin-bottom: 6px;
}

/* ── Mode overlay card ── */
.gw-source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg3);
  margin-bottom: 6px;
}
.gw-source-name    { font-size: 12px; font-weight: 700; color: var(--text); }
.gw-source-actions { display: flex; gap: 5px; flex-shrink: 0; }

/* ── Secondary tabs ── */
.gw-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.gw-tab-btn {
  padding: 9px 16px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: color .12s, border-color .12s;
  margin-bottom: -1px;
  white-space: nowrap;
}
.gw-tab-btn:hover  { color: var(--text); }
.gw-tab-btn.active { color: var(--accent-text); border-bottom-color: var(--accent); }

/* ── Commands panel ── */
.gw-cmd-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg3);
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 12px;
  margin-bottom: 5px;
  color: var(--text2);
}
.gw-cmd-copy {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  transition: border-color .12s;
}
.gw-cmd-copy:hover { border-color: var(--accent); }

/* ── Misc ── */
.gw-empty {
  padding: 14px 16px;
  border-radius: var(--r);
  border: 1px dashed var(--border);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.gw-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.gw-badge.ok {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  color: var(--accent-text);
}
.gw-section-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

/* ── Error banner ── */
.gw-error-banner {
  padding: 12px 16px;
  border-radius: var(--r);
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  font-size: 13px;
  color: #dc2626;
  line-height: 1.6;
}
.gw-error-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── Backward compat aliases ── */
.ps-tabs { display:flex; gap:2px; border-bottom:1px solid var(--border); margin-bottom:16px; }
.ps-tabs button { padding:9px 16px; border:none; border-bottom:2px solid transparent; background:none; color:var(--muted); font:inherit; font-size:13px; font-weight:700; cursor:pointer; margin-bottom:-1px; transition:color .12s,border-color .12s; }
.ps-tabs button:hover { color:var(--text); }
.ps-tabs button.active { color:var(--accent-text); border-bottom-color:var(--accent); }
.ps-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--r-lg); padding:16px; }
.ps-form { display:grid; gap:10px; }
.ps-label { display:grid; gap:5px; font-size:12px; font-weight:700; color:var(--text2); }
.ps-input,.ps-select,.ps-textarea { border-radius:var(--r); border:1px solid var(--border2); background:var(--surface2); color:var(--text); padding:10px 12px; font:inherit; font-size:13px; outline:none; width:100%; box-sizing:border-box; }
.ps-input:focus,.ps-select:focus { border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-bg); }
.ps-input::placeholder,.ps-textarea::placeholder { color:var(--muted); opacity:.6; }
.ps-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.ps-actions button { border-radius:999px; padding:9px 16px; border:1px solid var(--border2); background:var(--surface); color:var(--text); cursor:pointer; font-weight:600; font:inherit; font-size:13px; transition:border-color .12s,background .12s; }
.ps-actions button:hover { border-color:var(--accent); background:var(--surface2); }
.ps-actions button.primary { background:var(--text); border-color:var(--text); color:var(--bg); font-weight:800; }
.ps-actions button.primary:hover { opacity:.88; }
.ps-actions button.danger { background:var(--danger-bg); border-color:var(--danger-border); color:#dc2626; }
.ps-actions button.danger:hover { opacity:.85; }
.ps-list { margin:0; padding:0; list-style:none; display:grid; gap:8px; }
.ps-li { display:flex; justify-content:space-between; gap:10px; padding:10px; border-radius:var(--r); border:1px solid var(--border); background:var(--surface); align-items:center; }
.ps-btn-mini { padding:6px 10px; border-radius:8px; border:1px solid var(--border2); background:var(--surface2); cursor:pointer; font-weight:700; font-size:12px; color:var(--text); font-family:inherit; transition:border-color .12s; }
.ps-btn-mini:hover { border-color:var(--accent); }
.ps-name  { font-weight:800; color:var(--text); font-size:13px; }
.ps-muted { color:var(--muted); font-size:12px; }
.ps-inline  { display:flex; align-items:center; gap:8px; font-size:13px; }
.ps-row-2   { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.ps-vstack  { display:flex; flex-direction:column; gap:14px; }
.ps-grid-2  { display:grid; grid-template-columns:1.15fr .85fr; gap:14px; }
.ps-challenge-wrap { display:grid; gap:14px; }
.ps-challenge-grid { display:grid; grid-template-columns:1.35fr .65fr; gap:14px; }
.ps-cats { display:flex; flex-wrap:wrap; gap:10px 14px; align-items:center; }
.ps-source-row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 12px; border-radius:var(--r); border:1px solid var(--border); background:var(--bg3); margin-bottom:6px; }
.ps-source-name { font-size:12px; font-weight:700; color:var(--text); }
.ps-source-url  { font-family:ui-monospace,monospace; font-size:11px; color:var(--text2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ps-preview-viewport { position:relative; overflow:hidden; max-width:100%; border-radius:14px; border:1px solid var(--border); background:var(--surface2); }
.ps-preview-frame { display:block; }
.ps-table { width:100%; border-collapse:separate; border-spacing:0 10px; }
.ps-panel-editor-grid { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(260px,.8fr); gap:14px; align-items:start; }
.ps-panel-editor-preview { display:flex; justify-content:center; align-items:center; min-width:0; }
.ps-panel-editor-controls { min-width:0; }
.ps-panel-editor-preview > * { max-width:100%; }
.gw-help-text,.gw-card-note { font-size:12px; line-height:1.55; color:var(--muted); }
.gw-mini-pill,.ps-action-pill { display:inline-flex; align-items:center; gap:5px; padding:4px 10px; border-radius:999px; font-size:11px; font-weight:700; background:var(--surface2); border:1px solid var(--border); color:var(--text2); }
.gw-stat { padding:14px 16px; min-height:80px; position:relative; overflow:hidden; }
.gw-stat::before { content:""; position:absolute; inset:0 auto 0 0; width:4px; background:var(--accent); }
.gw-stat-label { font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:var(--muted); font-weight:800; }
.gw-stat-value { font-size:28px; font-weight:900; margin-top:8px; line-height:1; color:var(--text); }
.gw-stat-help  { margin-top:6px; font-size:12px; line-height:1.45; color:var(--muted); }
.gw-split  { display:grid; grid-template-columns:1.08fr .92fr; gap:14px; align-items:start; }
.gw-stack  { display:grid; gap:14px; }
.gw-command-grid,.gw-source-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.gw-preview-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; align-items:start; }
.gw-preview-grid .full { grid-column:1 / -1; }
.gw-tab-shell   { display:grid; gap:14px; }
.gw-tab-intro   { padding:14px 16px; display:flex; justify-content:space-between; gap:14px; align-items:flex-start; flex-wrap:wrap; }
.gw-tab-intro h4 { margin:0 0 6px; font-size:18px; }
.gw-tab-intro p  { margin:0; line-height:1.65; color:var(--muted); max-width:72ch; }
.gw-tab-actions  { display:flex; gap:10px; flex-wrap:wrap; }
.gw-control-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.gw-overview     { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.ps-command { display:grid; grid-template-columns:1fr auto; gap:10px; align-items:center; padding:9px 12px; border-radius:var(--r); border:1px solid var(--border); background:var(--bg3); font-family:ui-monospace,monospace; font-size:12px; margin-bottom:5px; color:var(--text2); }
.ps-copy { width:30px; height:30px; border-radius:8px; border:1px solid var(--border2); background:var(--surface2); cursor:pointer; font-weight:700; color:var(--text); display:flex; align-items:center; justify-content:center; font-size:13px; flex-shrink:0; transition:border-color .12s; }
.ps-copy:hover { border-color:var(--accent); }

/* Chest */
.chest-metrics-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-bottom:12px; }
.chest-metric-card  { position:relative; overflow:hidden; border-color:var(--border); background:var(--surface); }
.chest-metric-card::before { content:""; position:absolute; inset:0 auto 0 0; width:5px; background:var(--chest-metric-accent,var(--accent)); }
.chest-metric-label { font-size:12px; font-weight:900; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); }
.chest-metric-value { font-size:32px; font-weight:900; line-height:1.05; margin-top:6px; color:var(--text); }
.chest-metric-hint  { margin-top:6px; line-height:1.5; font-size:12px; color:var(--muted); }
.chest-help-card,.chest-side-note { margin-bottom:12px; }
.chest-help-title   { font-size:13px; font-weight:800; margin-bottom:6px; color:var(--text); }
.chest-row-list     { gap:12px; display:grid; }
.chest-reward-card  { position:relative; overflow:hidden; border-color:var(--accent-border); background:var(--surface); }
.chest-reward-card::after { content:""; position:absolute; inset:0 auto 0 0; width:4px; background:var(--chest-row-accent,var(--accent)); }
.chest-reward-top   { display:grid; grid-template-columns:140px 1fr; gap:14px; align-items:start; }
.chest-preview-panel { position:relative; min-height:160px; border-radius:18px; border:1px solid var(--border2); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; }
.chest-preview-panel::after { content:""; position:absolute; inset:10px; border-radius:12px; border:1px solid var(--border); }
.chest-preview-slot,.chest-preview-rarity { position:relative; z-index:1; font-size:11px; font-weight:900; letter-spacing:.08em; text-transform:uppercase; }
.chest-preview-face   { position:relative; z-index:1; font-size:56px; font-weight:900; line-height:1; }
.chest-preview-rarity { text-transform:capitalize; }
.chest-reward-main  { display:grid; gap:10px; }
.chest-reward-grid  { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.chest-reward-footer { display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:space-between; margin-top:4px; }
.chest-inline-check  { font-weight:700; line-height:1.4; max-width:700px; font-size:13px; }
.chest-reward-stats  { font-size:12px; color:var(--muted); font-weight:700; }

/* ── Responsive ── */
@media (max-width:1100px) {
  .gw-modes  { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .gw-layout { grid-template-columns:1fr; }
}
@media (max-width:760px) {
  .gw-modes { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .gw-overview,.gw-control-grid,.gw-row-2,.ps-row-2,.gw-row-3,.gw-delays-grid { grid-template-columns:1fr; }
  .gw-split,.ps-grid-2,.gw-source-grid,.gw-command-grid,.gw-preview-grid,.ps-challenge-grid,.ps-panel-editor-grid { grid-template-columns:1fr; }
  .chest-metrics-grid,.chest-reward-grid,.chest-reward-top { grid-template-columns:1fr; }
}
