/* ==========================================================================
   TWXPicker — 2026 redesign prototype
   Design system built around the existing TWXPicker DNA:
   dark teal gradient (#0f2027 → #203a43 → #2c5364), near-black panels,
   emerald accent (#10b981), compact/technical tool personality.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* brand accent (unchanged from live product) */
  --accent: #10b981;
  --accent-hover: #34d399;
  --accent-strong: #059669;
  --accent-deep: #047857;
  --accent-soft: rgba(16, 185, 129, 0.12);
  --accent-soft-2: rgba(16, 185, 129, 0.22);
  --accent-glow: rgba(16, 185, 129, 0.45);
  --accent-ink: #04281c;            /* text on accent */
  --accent-gradient: linear-gradient(135deg, #5eead4 0%, #10b981 55%, #047857 100%);

  /* backgrounds */
  --bg: #0f2027;
  --bg-gradient: linear-gradient(135deg, #0f2027 0%, #1b3640 50%, #274b5c 100%);
  --bg-veil: radial-gradient(1200px 600px at 50% -10%, rgba(16, 185, 129, 0.16), transparent 60%);

  /* surfaces */
  --surface: #141f24;
  --surface-2: #1a272d;
  --surface-3: #22333b;
  --surface-glass: rgba(20, 31, 36, 0.86);
  --surface-nav: rgba(16, 26, 30, 0.86);

  /* borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-accent: rgba(16, 185, 129, 0.32);

  /* text */
  --text: #f1f6f7;
  --text-2: #b9c7cb;
  --text-3: #83969c;
  --text-4: #5f7177;

  /* states */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #38bdf8;
  --x-blue: #1d9bf0;

  --success-soft: rgba(16, 185, 129, 0.12);
  --warning-soft: rgba(245, 158, 11, 0.12);
  --danger-soft: rgba(239, 68, 68, 0.12);

  /* shape & depth */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, 0.65);

  /* layout */
  --nav-h: 60px;
  --container: 1200px;
  --gutter: 20px;

  /* motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.18s;

  /* participant card size */
  --card-w: 224px;
  --card-h: 284px;
}

[data-theme="light"] {
  --bg: #e9f5ee;
  --bg-gradient: linear-gradient(135deg, #f1fbf5 0%, #e3f4ea 50%, #d2ebde 100%);
  --bg-veil: radial-gradient(1200px 600px at 50% -10%, rgba(16, 185, 129, 0.18), transparent 60%);
  --surface: #ffffff;
  --surface-2: #f3faf6;
  --surface-3: #e6f3ec;
  --surface-glass: rgba(255, 255, 255, 0.9);
  --surface-nav: rgba(255, 255, 255, 0.86);
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.18);
  --border-accent: rgba(5, 150, 105, 0.4);
  --text: #0f1f24;
  --text-2: #24363d;
  --text-3: #465a62;
  --text-4: #66787f;
  --accent: #059669;
  --accent-hover: #10b981;
  --accent-strong: #047857;
  --accent-soft: rgba(5, 150, 105, 0.1);
  --accent-soft-2: rgba(5, 150, 105, 0.18);
  --accent-glow: rgba(5, 150, 105, 0.35);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
  --shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.25);
  --shadow-lg: 0 30px 70px -20px rgba(15, 23, 42, 0.3);
}

/* Light-theme contrast fixes for pastel state colours */
[data-theme="light"] .badge-warn { color: #92400e; background: rgba(245, 158, 11, 0.16); }
[data-theme="light"] .badge-danger { color: #b91c1c; }
[data-theme="light"] .badge-info { color: #0369a1; }
[data-theme="light"] .error-text { color: #b91c1c; }
[data-theme="light"] .alert-danger .icon, [data-theme="light"] .toast-danger .icon { color: #dc2626; }
[data-theme="light"] .alert-warn .icon, [data-theme="light"] .toast-warn .icon { color: #b45309; }
[data-theme="light"] .alert-info .icon, [data-theme="light"] .toast-info .icon { color: #0284c7; }
[data-theme="light"] .btn-danger { color: #b91c1c; }
[data-theme="light"] .entry-pill.is-dupe { color: #b45309; }
[data-theme="light"] .toggle-track::after { background: #ffffff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.35); }
[data-theme="light"] .step-visual b, [data-theme="light"] .kicker { color: var(--accent); }
[data-theme="light"] .select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f747b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
[data-theme="light"] .avatar.no-img { background: linear-gradient(135deg, #b8c6cc, #8fa1a8); color: #ffffff; }
:root { color-scheme: dark; }
[data-theme="light"] { color-scheme: light; --accent-gradient: linear-gradient(135deg, #0d9488 0%, #059669 55%, #047857 100%); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-repeat: no-repeat;
  min-height: 100vh;
  position: relative;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html { background: var(--bg); }
body::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0; height: 100vh;
  background: var(--bg-veil);
  pointer-events: none;
  z-index: 0;
}
body { overflow-x: hidden; }
body.is-locked { overflow: hidden; }
img, svg { display: block; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
code, kbd, .mono { font-family: var(--font-mono); }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft-2); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-xs); }
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 6px; font-weight: 700;
}
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); position: relative; }
main { position: relative; z-index: 1; }
.page { display: block; }
.page.is-enter { animation: pageIn 0.35s var(--ease-out); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.icon { width: 16px; height: 16px; flex: none; }
svg.icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Typography helpers ---------- */
.kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.hint { font-size: 12px; color: var(--text-3); line-height: 1.45; }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-accent { color: var(--accent); }
.gradient-text { background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  height: var(--nav-h);
  background: var(--surface-nav);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 12px; height: 100%; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 17px; letter-spacing: -0.02em; }
.brand-mark { width: 26px; height: 26px; }
.brand em { font-style: normal; color: var(--accent); }
.nav-links { display: flex; gap: 2px; margin: 0 auto; }
.nav-links a {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 11px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--text-2); text-decoration: none;
  transition: color var(--dur), background var(--dur);
}
.nav-links a .icon { width: 15px; height: 15px; opacity: 0.8; }
.nav-links a:hover { color: var(--text); background: var(--surface-3); }
.nav-links a.is-active { color: var(--accent); background: var(--accent-soft); }
.nav-links a.is-active .icon { opacity: 1; }
.nav-links a.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: -13px; width: 22px; height: 2px; transform: translateX(-50%);
  background: var(--accent); border-radius: 2px;
}
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-actions .nav-burger { display: none; }
.nav-mobile {
  display: none; position: absolute; left: 0; right: 0; top: var(--nav-h);
  background: var(--surface-glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border); padding: 10px var(--gutter) 16px;
  box-shadow: var(--shadow);
}
.nav-mobile.is-open { display: block; animation: pageIn 0.25s var(--ease-out); }
.nav-mobile a { display: flex; align-items: center; gap: 10px; padding: 11px 10px; border-radius: var(--radius-sm); color: var(--text-2); text-decoration: none; font-weight: 500; }
.nav-mobile a.is-active { color: var(--accent); background: var(--accent-soft); }
.nav-mobile .nav-mobile-actions { display: flex; gap: 8px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.nav-mobile .nav-mobile-actions .btn { flex: 1; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 14px; line-height: 1; cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none;
  transition: transform 0.12s var(--ease), background var(--dur), border-color var(--dur), box-shadow var(--dur), color var(--dur), opacity var(--dur);
}
.btn .icon { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary {
  background: linear-gradient(180deg, #1ccf92 0%, #0fb27b 100%);
  color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 20px -8px var(--accent-glow);
}
.btn-primary:hover { background: linear-gradient(180deg, #31dba0 0%, #14bd84 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 12px 26px -8px var(--accent-glow); }
.btn-secondary { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { background: var(--surface-3); border-color: var(--border-accent); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: #fca5a5; border-color: rgba(239, 68, 68, 0.3); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.22); }
.btn-outline { background: transparent; border-color: var(--border-accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.is-loading { pointer-events: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); cursor: pointer;
  transition: background var(--dur), color var(--dur), border-color var(--dur);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
.icon-btn .icon { width: 17px; height: 17px; }
.icon-btn.is-plain { border-color: transparent; background: transparent; }
/* Sound toggle: clearly lit when sounds are on */
#sound-toggle[aria-pressed="true"], #draw-sound-toggle[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: var(--border-accent); }
#sound-toggle[aria-pressed="true"]:hover, #draw-sound-toggle[aria-pressed="true"]:hover { background: var(--accent-soft-2); color: var(--accent-hover); }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; font-size: inherit; }
.link-btn:hover { text-decoration: underline; }

/* Primary "Pick a Winner" CTA */
.pick-btn {
  height: 54px; font-size: 16px; font-weight: 800; letter-spacing: 0.01em; border-radius: var(--radius); overflow: hidden;
}
.pick-btn .icon { width: 19px; height: 19px; }
.pick-btn::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%) skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transition: transform 0.7s var(--ease);
}
.pick-btn:hover::after { transform: translateX(120%) skewX(-20deg); }
.pick-btn.is-loading, .pick-btn.is-drawing { color: var(--accent-ink); pointer-events: none; }
.pick-btn.is-drawing { background: linear-gradient(180deg, #0fb27b, #059669); }
.pick-btn.is-success { background: linear-gradient(180deg, #34d399, #10b981); }

/* ---------- Inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  color: var(--text); font: inherit; font-size: 14px;
  transition: border-color var(--dur), box-shadow var(--dur), background var(--dur);
}
.textarea { height: auto; min-height: 120px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(16, 185, 129, 0.35); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft-2); }
.input.is-error, .textarea.is-error { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.input.is-valid { border-color: var(--accent); }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2383969c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.select option { background: var(--surface); color: var(--text); }
.input-wrap { position: relative; }
.input-wrap > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-wrap .input { padding-left: 36px; }
.input-wrap .input-prefix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-weight: 600; }
.input-wrap.has-prefix .input { padding-left: 28px; }
.error-text { font-size: 12px; color: #fca5a5; display: flex; align-items: center; gap: 6px; }
.error-text .icon { width: 13px; height: 13px; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

/* Stepper */
.stepper { display: inline-flex; align-items: stretch; height: 40px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; }
.stepper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft-2); }
.stepper button { width: 40px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; display: grid; place-items: center; transition: background var(--dur), color var(--dur); }
.stepper button:hover { background: var(--surface-3); color: var(--accent); }
.stepper button:disabled { opacity: 0.35; cursor: not-allowed; background: transparent; color: var(--text-2); }
.stepper input { width: 60px; text-align: center; border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-weight: 700; font-size: 15px; }
.stepper input:focus { outline: none; }

/* Toggle */
.toggle { position: relative; width: 40px; height: 22px; flex: none; }
.toggle input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.toggle-track { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); transition: background 0.2s var(--ease), border-color 0.2s var(--ease); }
.toggle-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #dfe7ea; transition: transform 0.22s var(--ease), background 0.2s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.toggle input:checked + .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-track::after { transform: translateX(18px); background: #ffffff; }
.toggle input:focus-visible + .toggle-track { box-shadow: 0 0 0 3px var(--accent-soft-2); }

/* Chips input */
.chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 40px; padding: 4px 6px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: text; transition: border-color var(--dur), box-shadow var(--dur); }
.chips:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft-2); }
.chips input { flex: 1; min-width: 100px; height: 30px; border: 0; background: transparent; color: var(--text); font: inherit; padding: 0 6px; }
.chips input:focus { outline: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 6px 0 9px; border-radius: 6px; background: var(--accent-soft); border: 1px solid var(--border-accent); color: var(--accent); font-size: 13px; font-weight: 600; animation: chipIn 0.2s var(--ease-out); }
.chip button { display: grid; place-items: center; width: 18px; height: 18px; border: 0; border-radius: 4px; background: transparent; color: inherit; cursor: pointer; opacity: 0.75; }
.chip button:hover { opacity: 1; background: var(--accent-soft-2); }
.chip button .icon { width: 12px; height: 12px; }
@keyframes chipIn { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }

/* ---------- Panels & cards ---------- */
.panel { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.panel-head .grow { flex: 1; min-width: 0; }
.panel-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-desc { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.panel-body { padding: 20px; }
.panel-body + .panel-body { border-top: 1px solid var(--border); }
.step-num { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--border-accent); border-radius: 4px; padding: 3px 6px; line-height: 1; flex: none; }
.card-hover { transition: transform 0.2s var(--ease), border-color var(--dur), box-shadow 0.2s var(--ease); }
.card-hover:hover { transform: translateY(-2px); border-color: var(--border-accent); box-shadow: var(--shadow); }
.divider { height: 1px; background: var(--border); margin: 18px 0; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1; white-space: nowrap; }
.badge-accent { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--border-accent); }
.badge-solid { background: var(--accent); color: var(--accent-ink); }
.badge-muted { background: var(--surface-3); color: var(--text-3); border: 1px solid var(--border); }
.badge-warn { background: var(--warning-soft); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: var(--danger-soft); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-info { background: rgba(56, 189, 248, 0.12); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.3); }
.badge .icon { width: 11px; height: 11px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent-glow); animation: pulse 2s infinite; display: inline-block; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--accent-glow); } 70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.alert .icon { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.alert strong { color: var(--text); }
.alert-success { background: var(--success-soft); border-color: var(--border-accent); color: var(--text); }
.alert-success .icon { color: var(--accent); }
.alert-danger { background: var(--danger-soft); border-color: rgba(239, 68, 68, 0.35); }
.alert-danger .icon { color: #f87171; }
.alert-warn { background: var(--warning-soft); border-color: rgba(245, 158, 11, 0.35); }
.alert-warn .icon { color: #fbbf24; }
.alert-info { background: rgba(56, 189, 248, 0.1); border-color: rgba(56, 189, 248, 0.3); }
.alert-info .icon { color: #7dd3fc; }

/* ---------- Avatars ---------- */
.avatar {
  --size: 40px; --h: 170;
  width: var(--size); height: var(--size); border-radius: 50%; flex: none;
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, hsl(var(--h) 62% 48%), hsl(calc(var(--h) + 45) 58% 30%));
  color: #fff; font-weight: 700; font-size: calc(var(--size) * 0.36); letter-spacing: 0.02em; text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.avatar.no-img { background: linear-gradient(135deg, #4b5b62, #2e3a40); color: #9fb0b6; }
.avatar .icon { width: 55%; height: 55%; }
.avatar { position: relative; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { --size: 28px; margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); font-size: 10px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.verified { color: var(--x-blue); width: 15px; height: 15px; flex: none; }

/* ---------- Toasts ---------- */
.toast-root { position: fixed; right: 16px; bottom: 16px; z-index: 300; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface-glass); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--text); font-size: 13px; pointer-events: auto;
  border-left: 3px solid var(--accent);
  animation: toastIn 0.3s var(--ease-out);
}
.toast.is-leaving { animation: toastOut 0.25s var(--ease) forwards; }
.toast .icon { width: 16px; height: 16px; color: var(--accent); flex: none; margin-top: 1px; }
.toast-danger { border-left-color: var(--danger); } .toast-danger .icon { color: #f87171; }
.toast-warn { border-left-color: var(--warning); } .toast-warn .icon { color: #fbbf24; }
.toast-info { border-left-color: var(--info); } .toast-info .icon { color: #7dd3fc; }
.toast button { margin-left: auto; border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 0; display: grid; place-items: center; }
.toast button .icon { color: inherit; width: 14px; height: 14px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px); } }

/* ---------- Modals ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(6, 14, 17, 0.7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.2s var(--ease); }
.modal-backdrop.is-open { opacity: 1; }
.modal { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); transform: translateY(10px) scale(0.97); opacity: 0; transition: transform 0.25s var(--ease-out), opacity 0.2s; max-height: calc(100vh - 40px); overflow: auto; }
.modal-backdrop.is-open .modal { transform: none; opacity: 1; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 12px; }
.modal-head h3 { font-size: 17px; flex: 1; }
.modal-body { padding: 4px 20px 20px; color: var(--text-2); font-size: 14px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 20px 20px; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.share-preview { margin-top: 12px; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; background: #0f2027; box-shadow: var(--shadow); }
.share-preview img { display: block; width: 100%; height: auto; }

/* ---------- Accordion ---------- */
.acc { display: flex; flex-direction: column; gap: 8px; }
.acc-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; transition: border-color var(--dur); }
.acc-item.is-open { border-color: var(--border-accent); }
.acc-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 0; background: none; color: var(--text); font-weight: 600; font-size: 14px; text-align: left; cursor: pointer; }
.acc-btn:hover { background: var(--surface-2); }
.acc-btn .icon { margin-left: auto; color: var(--text-3); transition: transform 0.3s var(--ease); }
.acc-item.is-open .acc-btn .icon { transform: rotate(180deg); color: var(--accent); }
.acc-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.32s var(--ease); }
.acc-item.is-open .acc-panel { grid-template-rows: 1fr; }
.acc-panel > div { overflow: hidden; }
.acc-content { padding: 0 16px 16px; color: var(--text-2); font-size: 13.5px; line-height: 1.6; }

/* ---------- Skeleton ---------- */
.sk { height: 12px; border-radius: 4px; background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ==========================================================================
   Sections / Home
   ========================================================================== */
.section { padding: 64px 0; }
.section-tight { padding: 32px 0; }
.section-head { max-width: 640px; margin: 0 auto 32px; text-align: center; }
.section-head.is-left { margin-left: 0; text-align: left; }
.section-title { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin-top: 8px; }
.section-lead { margin-top: 10px; color: var(--text-2); font-size: 15px; }

/* Hero */
.hero { padding: 56px 0 36px; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px 0 10px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--border-accent); color: var(--accent); font-size: 12px; font-weight: 600; }
.hero h1 { margin: 18px 0 14px; font-size: clamp(30px, 4.3vw, 46px); line-height: 1.06; font-weight: 800; letter-spacing: -0.03em; text-transform: uppercase; }
.hero h1 span { display: block; }
.hero .lead { font-size: 16px; color: var(--text-2); max-width: 540px; line-height: 1.6; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; font-size: 12.5px; color: var(--text-3); }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta .icon { width: 14px; height: 14px; color: var(--accent); }

/* Hero visual: TWXPicker brand card (default) or the sponsor card (data-sponsor="on") */
.hero-visual { position: relative; height: 400px; display: grid; place-items: center; }
.hero-visual::before { content: ""; position: absolute; inset: 12% 18%; background: radial-gradient(ellipse, var(--accent-soft-2), transparent 65%); filter: blur(28px); pointer-events: none; }
.hero-visual[data-sponsor="off"] .sponsor-card { display: none; }
.hero-visual[data-sponsor="on"] .brand-card { display: none; }
.brand-card, .sponsor-card { --card-w: 290px; --card-h: 372px; position: relative; left: auto; top: auto; margin: 0; animation: floatCard 6.5s ease-in-out infinite; }
/* --- Brand card --- */
.brand-card .pcard-skin { justify-content: flex-start; padding: 16px 18px; gap: 0; border-color: var(--border-accent); background: linear-gradient(165deg, #17292f 0%, #0d171b 100%); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 30px 60px -24px rgba(0, 0, 0, 0.8), 0 0 70px -20px var(--accent-glow); }
.brand-card .brand-shine { position: absolute; inset: 0; z-index: 0; background: linear-gradient(115deg, transparent 42%, rgba(94, 234, 212, 0.1) 50%, transparent 58%); transform: translateX(-120%); animation: brandShine 7s ease-in-out infinite; pointer-events: none; }
@keyframes brandShine { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.brand-card .brand-card-top { display: flex; align-items: center; justify-content: space-between; width: 100%; font-family: var(--font-mono); font-size: 10px; color: var(--text-4); letter-spacing: 0.04em; }
.brand-card .brand-card-badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-sans); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.brand-card .brand-card-emblem { position: relative; width: 104px; height: 104px; margin: 30px auto 18px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, rgba(16, 185, 129, 0.28), rgba(16, 185, 129, 0.06) 70%); animation: emblemPulse 3.6s ease-in-out infinite; }
.brand-card .brand-card-emblem::before { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 1px dashed rgba(16, 185, 129, 0.4); animation: emblemSpin 20s linear infinite; }
@keyframes emblemSpin { to { transform: rotate(360deg); } }
@keyframes emblemPulse { 0%, 100% { box-shadow: 0 0 0 1px var(--border-accent), 0 0 0 8px rgba(16, 185, 129, 0.06), 0 20px 50px -20px var(--accent-glow); } 50% { box-shadow: 0 0 0 1px var(--accent), 0 0 0 12px rgba(16, 185, 129, 0.1), 0 24px 60px -18px var(--accent-glow); } }
.brand-card .brand-card-mark { width: 58px; height: 58px; filter: drop-shadow(0 10px 18px rgba(16, 185, 129, 0.4)); }
.brand-card .brand-card-name { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--text); text-align: center; }
.brand-card .brand-card-name em { font-style: normal; color: var(--accent); }
.brand-card .brand-card-tag { margin-top: 8px; font-size: 12.5px; color: var(--text-3); text-align: center; }
.brand-card .brand-card-pills { list-style: none; margin: 18px 0 0; padding: 0; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.brand-card .brand-card-pills li { font-size: 10.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--border-accent); color: var(--accent); }
.brand-card .brand-card-foot { position: absolute; left: 18px; right: 18px; bottom: 14px; display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10px; color: var(--text-4); padding-top: 10px; border-top: 1px solid var(--border); }
/* --- Sponsor card (kept for later) --- */
.sponsor-card .pcard-skin { justify-content: flex-start; padding: 14px; gap: 0; border-color: var(--border-accent); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 30px 60px -24px rgba(0, 0, 0, 0.8), 0 0 70px -20px var(--accent-glow); }
.sponsor-card .sponsor-card-head { display: flex; align-items: center; gap: 7px; width: 100%; }
.sponsor-card .sponsor-card-mark { width: 18px; height: 18px; flex: none; }
.sponsor-card .sponsor-card-name { font-size: 13px; font-weight: 800; letter-spacing: -0.01em; color: var(--text); line-height: 1; }
.sponsor-card .sponsor-card-name em { font-style: normal; color: var(--accent); }
.sponsor-card .sponsor-card-url { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--text-4); }
.sponsor-card .sponsor-slot { position: absolute; left: 14px; right: 14px; top: 46px; bottom: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 1px dashed var(--border-accent); border-radius: 12px; text-align: center; padding: 12px;
  background: repeating-linear-gradient(135deg, rgba(16, 185, 129, 0.055) 0 10px, rgba(16, 185, 129, 0.015) 10px 20px); }
.sponsor-card .sponsor-slot .icon { width: 34px; height: 34px; color: var(--accent); opacity: 0.85; margin-bottom: 8px; }
.sponsor-card .sponsor-slot .kicker { font-size: 12px; letter-spacing: 0.16em; }
.sponsor-card .sponsor-slot small { font-size: 13.5px; color: var(--text-2); font-weight: 600; }
.sponsor-card .sponsor-slot .sponsor-dim { font-size: 11px; color: var(--text-4); font-weight: 500; }
/* Light theme: the brand card follows the page theme (the sponsor card stays dark) */
[data-theme="light"] .brand-card, [data-theme="light"] .brand-card .pcard-skin {
  --text: #0f1f24; --text-2: #3b4f56; --text-3: #5f747b; --text-4: #8a9ba1;
  --border: rgba(15, 23, 42, 0.1); --border-strong: rgba(15, 23, 42, 0.18); --border-accent: rgba(5, 150, 105, 0.4);
  --accent: #059669; --accent-soft: rgba(5, 150, 105, 0.1); --accent-soft-2: rgba(5, 150, 105, 0.18); --accent-glow: rgba(5, 150, 105, 0.35);
  color: var(--text); color-scheme: light;
}
[data-theme="light"] .brand-card .pcard-skin { background: linear-gradient(165deg, #ffffff 0%, #e9f5ee 100%); border-color: rgba(5, 150, 105, 0.4); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 30px 60px -28px rgba(15, 23, 42, 0.35), 0 0 60px -20px rgba(5, 150, 105, 0.35); }
[data-theme="light"] .brand-card .pcard-skin::after { background-image: radial-gradient(rgba(15, 23, 42, 0.08) 1px, transparent 1px); }
[data-theme="light"] .brand-card .brand-shine { background: linear-gradient(115deg, transparent 42%, rgba(5, 150, 105, 0.08) 50%, transparent 58%); }
[data-theme="light"] .brand-card .brand-card-emblem { background: radial-gradient(circle at 50% 40%, rgba(5, 150, 105, 0.18), rgba(5, 150, 105, 0.04) 70%); }
[data-theme="light"] .brand-card .brand-card-mark { filter: drop-shadow(0 10px 18px rgba(5, 150, 105, 0.3)); }
@keyframes floatCard { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* Participant card */
.pcard-box { position: absolute; left: 50%; top: 50%; width: var(--card-w); height: var(--card-h); margin-left: calc(var(--card-w) / -2); margin-top: calc(var(--card-h) / -2); border-radius: 16px; }
.pcard-skin {
  position: absolute; inset: 0; border-radius: 16px; padding: 18px 16px 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px;
  background: linear-gradient(165deg, #1a2a30 0%, #10191d 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 20px 40px -18px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}
.pcard-skin::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--accent-gradient); opacity: 0.85; }
.pcard-skin::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px); background-size: 14px 14px; pointer-events: none; opacity: 0.6; }
.pcard-skin > * { position: relative; z-index: 1; }
.pcard-num { position: absolute; top: 12px; left: 14px; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); letter-spacing: 0.04em; }
.pcard-brand { position: absolute; top: 11px; right: 12px; width: 14px; height: 14px; opacity: 0.55; }
.pcard-skin .avatar { --size: 66px; margin-bottom: 8px; box-shadow: 0 0 0 3px #10191d, 0 0 0 4px rgba(255, 255, 255, 0.12); }
.pcard-handle { font-weight: 700; font-size: 14.5px; color: var(--text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; justify-content: center; }
.pcard-name { font-size: 12.5px; color: var(--text-3); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-foot { position: absolute; bottom: 12px; left: 0; right: 0; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-4); letter-spacing: 0.08em; text-transform: uppercase; }
.pcard-winner-tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 10.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; box-shadow: 0 6px 18px -6px var(--accent-glow); white-space: nowrap; }
.pcard-winner-tag .icon { width: 11px; height: 11px; stroke-width: 3; }
/* Card back — the deck is face-down; remaining cards flip from this side */
.pcard-back { justify-content: center; align-items: center; background: linear-gradient(165deg, #172a30 0%, #0b1418 100%); }
.pcard-back::before { content: ""; position: absolute; inset: 8px; height: auto; border-radius: 11px; border: 1px solid rgba(16, 185, 129, 0.28); background: none; opacity: 1; }
.pcard-back .back-ring { position: absolute; width: 62%; aspect-ratio: 1 / 1; border-radius: 50%; border: 1px dashed rgba(16, 185, 129, 0.35); }
.pcard-back .back-ring::before { content: ""; position: absolute; inset: 8%; border-radius: 50%; background: radial-gradient(circle, rgba(16, 185, 129, 0.24), rgba(16, 185, 129, 0) 70%); }
.pcard-back .back-mark { width: 40%; height: auto; aspect-ratio: 1 / 1; filter: drop-shadow(0 8px 16px rgba(16, 185, 129, 0.4)); }
.pcard-back .back-text { position: absolute; bottom: 14px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-4); }

/* Picker */
.picker { padding: 8px 0 56px; }
.picker-grid { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 20px; align-items: start; }
.picker-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.picker-aside { position: sticky; top: calc(var(--nav-h) + 16px); display: flex; flex-direction: column; gap: 16px; }

.url-field { position: relative; }
.url-field .input { height: 48px; padding-left: 42px; padding-right: 80px; font-size: 14.5px; }
.url-field > .url-icon { position: absolute; left: 12px; top: 50%; width: 22px; height: 22px; margin-top: -11px; transform-style: preserve-3d; transition: transform 0.55s var(--ease-out); pointer-events: none; }
.url-field > .url-icon .icon, .url-field > .url-icon .url-icon-back { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.url-field > .url-icon .icon { width: 22px; height: 22px; padding: 3px; color: var(--text-3); transition: color var(--dur); }
.url-field > .url-icon .url-icon-back { transform: rotateY(180deg); border-radius: 50%; display: grid; place-items: center; }
.url-field > .url-icon .url-icon-back .avatar { --size: 22px; box-shadow: 0 0 0 2px var(--accent); }
.url-field.is-caught > .url-icon { transform: rotateY(180deg); }
.url-field.is-error > .url-icon .icon { color: #f87171; }
.url-field.is-shake { animation: urlShake 0.36s var(--ease); }
@keyframes urlShake { 20%, 60% { transform: translateX(-2px); } 40%, 80% { transform: translateX(2px); } }
.url-field.is-catching .input { animation: urlCatch 0.9s var(--ease-out); }
@keyframes urlCatch { 0% { box-shadow: 0 0 0 0 var(--accent-glow); } 100% { box-shadow: 0 0 0 14px rgba(16, 185, 129, 0); } }
.url-field .url-tools { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 4px; }
.url-status { width: 20px; height: 20px; display: grid; place-items: center; color: var(--accent); }
.url-status .icon { width: 18px; height: 18px; }
.url-field.is-error .url-status { color: #f87171; }
.url-field .icon-btn { width: 28px; height: 28px; }
.url-field .icon-btn .icon { width: 14px; height: 14px; }
.url-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

.tweet-preview { margin-top: 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 18px; transition: border-color var(--dur), background var(--dur); }
.tweet-preview.is-loaded { border-style: solid; background: var(--surface-2); animation: previewDeal 0.45s var(--ease-out); }
@keyframes previewDeal { from { opacity: 0; transform: translateY(-14px) rotate(-1.2deg); } to { opacity: 1; transform: none; } }
.tweet-empty { display: flex; align-items: center; gap: 14px; color: var(--text-3); font-size: 13px; }
.tweet-empty .empty-icon { width: 42px; height: 42px; border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-3); flex: none; }
.tweet-empty strong { display: block; color: var(--text-2); font-size: 13.5px; }
.tweet-head { display: flex; align-items: center; gap: 10px; }
.tweet-author { flex: 1; min-width: 0; }
.tweet-author strong { display: flex; align-items: center; gap: 5px; font-size: 14px; }
.tweet-author span { font-size: 12.5px; color: var(--text-3); }
.tweet-date { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.tweet-x { color: var(--text-2); width: 18px; height: 18px; }
.tweet-text { margin: 12px 0; font-size: 14.5px; line-height: 1.55; color: var(--text); white-space: pre-line; }
.tweet-metrics { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12.5px; color: var(--text-3); }
.tweet-metrics span { display: inline-flex; align-items: center; gap: 6px; }
.tweet-metrics strong { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.tweet-metrics .icon { width: 14px; height: 14px; }
.tweet-detected { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid var(--border-accent); font-size: 12.5px; color: var(--text-2); }
.tweet-detected strong { color: var(--accent); font-family: var(--font-mono); }
.tweet-detected .avatar-stack { margin-left: 6px; }

/* Engagement type */
.seg-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.seg { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 12px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface-2); color: var(--text-2); cursor: pointer; text-align: left; transition: transform 0.15s var(--ease), border-color var(--dur), background var(--dur), box-shadow var(--dur); }
.seg .seg-icon { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); transition: background var(--dur), color var(--dur); }
.seg .seg-icon .icon { width: 16px; height: 16px; }
.seg strong { font-size: 12.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text); }
.seg small { font-size: 11.5px; color: var(--text-3); line-height: 1.35; }
.seg .seg-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); margin-top: 2px; }
.seg .seg-check { position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; transform: scale(0); transition: transform 0.2s var(--ease-out); }
.seg .seg-check .icon { width: 11px; height: 11px; stroke-width: 3; }
.seg .badge { position: absolute; top: 10px; right: 10px; }
.seg:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--border-accent); background: var(--surface-3); }
.seg[aria-pressed="true"] { background: linear-gradient(180deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.08)); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, 0 10px 24px -14px var(--accent-glow); }
.seg[aria-pressed="true"] .seg-icon { background: var(--accent); color: var(--accent-ink); }
.seg[aria-pressed="true"] .seg-check { transform: scale(1); }
.seg[aria-pressed="true"] .seg-count { color: var(--accent); }
.seg:disabled { opacity: 0.55; cursor: not-allowed; }

/* Rules builder */
.rule-group + .rule-group { margin-top: 22px; }
.rule-group-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.rule-group-title .icon { width: 14px; height: 14px; }
.rule-group-title small { margin-left: auto; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-3); font-size: 12px; }
.rule-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rule-tile { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; transition: border-color var(--dur), background var(--dur), transform 0.15s var(--ease); }
.rule-tile:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.rule-tile .rt-icon { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); transition: background var(--dur), color var(--dur); flex: none; }
.rule-tile .rt-icon .icon { width: 15px; height: 15px; }
.rule-tile .rt-label { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--text-2); }
.rule-tile.is-on { border-color: var(--border-accent); background: linear-gradient(180deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.02)); }
.rule-tile.is-on .rt-icon { background: var(--accent-soft); color: var(--accent); }
.rule-tile.is-on .rt-label { color: var(--text); }
.rule-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.rules-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); }
.rules-foot strong { color: var(--accent); font-family: var(--font-mono); }

/* Draw summary */
.summary-rows { display: flex; flex-direction: column; }
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.summary-row:first-child { padding-top: 0; }
.summary-row strong { font-family: var(--font-mono); font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.summary-row .muted { color: var(--text-4); font-weight: 400; }
.summary-cta { margin-top: 16px; }
.summary-foot { margin-top: 12px; font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.summary-foot .icon { width: 13px; height: 13px; color: var(--accent); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 20px 20px 18px; }
.stat-value { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-value small { font-size: 18px; color: var(--accent); font-weight: 700; }
.stat-label { margin-top: 6px; font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.stat-label .icon { width: 13px; height: 13px; color: var(--accent); }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.step { padding: 22px; }
.step-idx { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; background: var(--accent-soft); border: 1px solid var(--border-accent); color: var(--accent); font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.step h3 { margin-top: 16px; font-size: 16px; }
.step p { margin-top: 8px; color: var(--text-3); font-size: 13.5px; line-height: 1.55; }
.step .step-visual { margin-top: 16px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.step .step-visual b { color: var(--accent); font-weight: 600; }

/* Features */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.feature { padding: 20px; }
.feature-icon { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--border-accent); }
.feature-icon .icon { width: 18px; height: 18px; }
.feature h3 { margin-top: 14px; font-size: 15px; }
.feature p { margin-top: 6px; color: var(--text-3); font-size: 13px; line-height: 1.55; }

/* Showcase */
.showcase { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.showcase-visual { position: relative; height: 380px; perspective: 1400px; overflow: hidden; }
.showcase-visual::before { content: ""; position: absolute; inset: 18% 12%; background: radial-gradient(ellipse, var(--accent-soft-2), transparent 65%); filter: blur(24px); }
.showcase-visual .pcard-box { --card-w: 170px; --card-h: 214px; }
.showcase-visual .pcard-box .pcard-skin .avatar { --size: 50px; }
.showcase-visual .pcard-box.fly { animation: showcaseFly 5.5s var(--ease) infinite; animation-delay: var(--d); }
@keyframes showcaseFly {
  0%, 12% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
  30% { transform: translate(var(--fx), var(--fy)) rotate(var(--fr)) scale(0.9); opacity: 0; }
  100% { transform: translate(var(--fx), var(--fy)) rotate(var(--fr)) scale(0.9); opacity: 0; }
}
.timeline { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.timeline li { position: relative; display: flex; gap: 14px; padding: 0 0 18px 0; }
.timeline li::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 1px; background: var(--border-strong); }
.timeline li:last-child::before { display: none; }
.tl-dot { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border-accent); color: var(--accent); flex: none; font-family: var(--font-mono); font-size: 11px; font-weight: 700; }
.timeline strong { display: block; font-size: 14px; }
.timeline p { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.showcase-result { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; margin-top: 72px; }
.showcase-result .winner-card { margin: 0 auto; }

/* CTA banner */
.cta-banner { position: relative; overflow: hidden; padding: 44px 32px; text-align: center; border-color: var(--border-accent); background: linear-gradient(180deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.02)), var(--surface); }
.cta-banner::before { content: ""; position: absolute; inset: -40% 20% auto; height: 200px; background: radial-gradient(ellipse, var(--accent-soft-2), transparent 70%); filter: blur(20px); }
.cta-banner > * { position: relative; }
.cta-banner h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.cta-banner p { margin-top: 8px; color: var(--text-2); }
.cta-banner .hero-ctas { justify-content: center; }

/* Footer */
.footer { position: relative; z-index: 1; margin-top: 40px; border-top: 1px solid var(--border); background: linear-gradient(180deg, rgba(10, 18, 22, 0.2), rgba(10, 18, 22, 0.85)); padding: 48px 0 24px; }
[data-theme="light"] .footer { background: linear-gradient(180deg, rgba(223, 244, 231, 0.2), rgba(223, 244, 231, 0.95)); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.footer-brand p { margin-top: 12px; color: var(--text-3); font-size: 13px; max-width: 320px; line-height: 1.6; }
.footer h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer ul a { color: var(--text-2); text-decoration: none; font-size: 13.5px; transition: color var(--dur); }
.footer ul a:hover { color: var(--accent); }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); }
.footer-social { display: flex; gap: 8px; }
.footer-social .icon-btn { width: 32px; height: 32px; }

/* ==========================================================================
   Tool pages
   ========================================================================== */
.page-head { display: flex; align-items: flex-start; gap: 16px; padding: 44px 0 26px; }
.page-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); border: 1px solid var(--border-accent); color: var(--accent); flex: none; }
.page-icon .icon { width: 22px; height: 22px; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.page-head p { margin-top: 6px; color: var(--text-2); max-width: 640px; }
.tool-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.tool-narrow { max-width: 720px; margin: 0 auto; }
/* Narrow tool pages (Verify Draw, ID Finder): centre the header over the column */
.page-head--narrow { max-width: 720px; margin: 0 auto; flex-direction: column; align-items: center; text-align: center; }
.page-head--narrow p { margin-left: auto; margin-right: auto; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.entries-meta { display: flex; gap: 14px; font-size: 12px; color: var(--text-3); font-family: var(--font-mono); }
.entries-meta b { color: var(--accent); font-weight: 600; }
.entry-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 160px; overflow: auto; }
.entry-pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px 0 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.entry-pill .avatar { --size: 18px; font-size: 8px; }
.entry-pill.is-dupe { border-color: rgba(245, 158, 11, 0.4); color: #fbbf24; }

/* ID finder */
.id-result { animation: pageIn 0.3s var(--ease-out); }
.winner-card.id-card { width: min(400px, 100%); margin: 0 auto; padding-top: 22px; }
.id-card .wc-avatar { margin-top: 14px; }
.id-card .id-card-id { margin-top: 14px; padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); border: 1px solid var(--border-accent); }
.id-card .id-value-label { display: block; margin-bottom: 2px; }
.id-card .id-value { display: block; font-size: 20px; line-height: 1.2; }
.id-card .wc-meta { flex-wrap: wrap; gap: 10px 18px; }
.id-card .wc-meta span { min-width: 64px; }
.id-user { display: flex; align-items: center; gap: 14px; }
.id-user strong { display: flex; align-items: center; gap: 6px; font-size: 16px; }
.id-user span { color: var(--text-3); font-size: 13px; }
.id-value-wrap { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border-accent); }
.id-value { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 22px; font-weight: 600; letter-spacing: 0.03em; color: var(--accent); word-break: break-all; }
.id-value-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 4px; }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.kv { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.kv dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.kv dd { margin: 4px 0 0; font-size: 14px; font-weight: 600; color: var(--text); word-break: break-word; }
.kv dd.mono { font-family: var(--font-mono); font-weight: 500; font-size: 13px; }
.recent { display: flex; flex-wrap: wrap; gap: 6px; }
.recent button { height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: 12px; cursor: pointer; }
.recent button:hover { border-color: var(--border-accent); color: var(--accent); }

/* Verify */
.verify-hero { text-align: center; padding: 8px 0 20px; }
.verify-status { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--radius-lg); border: 1px solid var(--border-accent); background: linear-gradient(180deg, rgba(16, 185, 129, 0.14), rgba(16, 185, 129, 0.04)); animation: pageIn 0.3s var(--ease-out); }
.verify-status.is-bad { border-color: rgba(239, 68, 68, 0.4); background: linear-gradient(180deg, rgba(239, 68, 68, 0.14), rgba(239, 68, 68, 0.04)); }
.verify-status .vs-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex: none; }
.verify-status.is-bad .vs-icon { background: var(--danger); color: #fff; }
.verify-status .vs-icon .icon { width: 22px; height: 22px; stroke-width: 2.5; }
.verify-status strong { font-size: 16px; display: block; }
.verify-status p { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.winner-list { display: flex; flex-direction: column; gap: 8px; }
.winner-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.winner-row .wr-idx { font-family: var(--font-mono); font-size: 11px; color: var(--accent); width: 24px; }
.winner-row .wr-name { flex: 1; min-width: 0; }
.winner-row .wr-name strong { display: flex; align-items: center; gap: 5px; font-size: 13.5px; }
.winner-row .wr-name span { font-size: 12px; color: var(--text-3); }
.hash-box { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-family: var(--font-mono); font-size: 12px; color: var(--text-3); word-break: break-all; }
.hash-box b { color: var(--text-2); font-weight: 500; }

/* About */
.about-hero { max-width: 760px; padding: 48px 0 20px; }
.about-hero h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.about-hero p { margin-top: 16px; font-size: 16px; color: var(--text-2); line-height: 1.65; }
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 32px; }
.prose { max-width: 760px; color: var(--text-2); font-size: 15px; line-height: 1.7; }
.prose h2 { font-size: 20px; margin: 32px 0 10px; color: var(--text); }
.prose p + p { margin-top: 12px; }
.prose-panel { margin-top: 28px; padding: 4px 32px 28px; max-width: 900px; }
.prose-panel .prose { max-width: none; }
.prose-panel .prose h2:first-child { margin-top: 24px; }
.verified { display: none !important; }

/* FAQ page */
.faq-groups { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
.faq-nav { position: sticky; top: calc(var(--nav-h) + 20px); display: flex; flex-direction: column; gap: 4px; }
.faq-nav button { text-align: left; padding: 9px 12px; border: 0; background: none; color: var(--text-2); border-radius: var(--radius-sm); font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.faq-nav button:hover { background: var(--surface-3); color: var(--text); }
.faq-nav button.is-active { background: var(--accent-soft); color: var(--accent); }
.faq-group { scroll-margin-top: calc(var(--nav-h) + 20px); }
.faq-group + .faq-group { margin-top: 28px; }
.faq-group h2 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.faq-group h2 .icon { color: var(--accent); }
.faq-empty { padding: 30px; text-align: center; color: var(--text-3); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.contact-card { display: flex; gap: 12px; align-items: flex-start; padding: 16px; }
.contact-card .feature-icon { width: 34px; height: 34px; }
.contact-card strong { display: block; font-size: 13.5px; }
.contact-card span { font-size: 12.5px; color: var(--text-3); }
.contact-card a { font-size: 13px; }

/* 404 */
.notfound { text-align: center; padding: 100px 0; }
.notfound h1 { font-size: 72px; font-weight: 800; letter-spacing: -0.04em; }

/* ==========================================================================
   Winner card (result / showcase / verify)
   ========================================================================== */
.winner-card {
  position: relative; width: 300px; padding: 24px 22px 18px; border-radius: 18px; text-align: center; overflow: hidden;
  background: linear-gradient(165deg, #182a30 0%, #0f1b20 100%);
  border: 1px solid rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.12), 0 30px 70px -30px var(--accent-glow), var(--shadow);
}
.winner-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% -10%, rgba(16, 185, 129, 0.28), transparent 55%); pointer-events: none; }
.winner-card::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px); background-size: 14px 14px; pointer-events: none; }
.winner-card > * { position: relative; z-index: 1; }
.winner-card { min-width: 0; }
.wc-top { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); letter-spacing: 0.06em; }
.wc-tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 11px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; margin-top: 18px; box-shadow: 0 8px 20px -8px var(--accent-glow); }
.wc-tag .icon { width: 12px; height: 12px; stroke-width: 3; }
.wc-avatar { margin: 18px auto 12px; --size: 84px; box-shadow: 0 0 0 4px #0f1b20, 0 0 0 6px var(--accent); }
.wc-handle { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; display: flex; align-items: center; justify-content: center; gap: 6px; }
.wc-handle .verified { width: 17px; height: 17px; }
.wc-name { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.wc-giveaway { margin-top: 12px; font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; justify-content: center; gap: 6px; }
.wc-giveaway .wc-host { --size: 16px; flex: none; }
.wc-giveaway b { color: var(--text-2); font-weight: 600; }
a.wc-giveaway { text-decoration: none; color: var(--text-3); cursor: pointer; transition: color var(--dur); }
a.wc-giveaway:hover, a.wc-giveaway:focus-visible { color: var(--accent); outline: none; }
a.wc-giveaway:hover b, a.wc-giveaway:focus-visible b { color: var(--accent); text-decoration: underline; }
.wc-meta { display: flex; justify-content: center; gap: 18px; margin-top: 14px; font-size: 11.5px; color: var(--text-3); }
.wc-meta b { display: block; font-family: var(--font-mono); font-size: 13px; color: var(--text); font-weight: 600; }
.wc-foot { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); }
.wc-foot .brand-mark { width: 14px; height: 14px; opacity: 0.8; }
.winner-card.is-in { animation: winnerIn 0.6s var(--ease-out) both; }
.winner-card.is-medium { width: 212px; padding: 18px 16px 14px; }
.winner-card.is-medium .wc-tag { margin-top: 12px; height: 22px; font-size: 10px; }
.winner-card.is-medium .wc-avatar { --size: 62px; margin: 14px auto 10px; }
.winner-card.is-medium .wc-handle { font-size: 15px; }
.winner-card.is-medium .wc-name { font-size: 12.5px; }
.winner-card.is-medium .wc-foot { margin-top: 12px; padding-top: 10px; font-size: 9.5px; }
.winner-card.is-medium .wc-meta { gap: 12px; margin-top: 10px; font-size: 10.5px; }
.winner-card.is-medium .wc-meta b { font-size: 12px; }
/* Viewport-fitted result cards (pickResultLayout): zoom keeps layout + text in step */
.result-winners.is-scaled .winner-card { zoom: var(--rs, 1); }
.winner-card.is-compact { width: 158px; padding: 12px 10px; border-radius: 14px; }
.winner-card.is-compact .wc-top { font-size: 9.5px; }
.winner-card.is-compact .wc-top span:first-child { color: var(--accent); font-weight: 700; }
.winner-card.is-compact .wc-avatar { --size: 48px; margin: 10px auto 8px; box-shadow: 0 0 0 3px #0f1b20, 0 0 0 4px var(--accent); }
.winner-card.is-compact .wc-handle { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.winner-card.is-compact .wc-handle .verified { display: inline-block; width: 13px; height: 13px; vertical-align: -2px; }
.winner-card.is-compact .wc-name { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-winners.is-dense { gap: 10px; margin: 18px 0 20px; max-width: 1260px; }
.result-head.is-dense h2 { font-size: 24px; margin-top: 8px; }
@keyframes winnerIn { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: none; } }
/* Holographic foil + tilt (pointer / device orientation) */
.winner-card { --rx: 0; --ry: 0; --mx: 50%; --my: 50%; }
.winner-card.is-settled { animation: none; transition: transform 0.35s ease-out, box-shadow 0.35s ease-out; }
.winner-card.is-holo { transform: perspective(900px) rotateX(calc(var(--ry) * -4deg)) rotateY(calc(var(--rx) * 5deg)); box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25), 0 30px 60px -30px var(--accent-glow), var(--shadow-lg); }
.winner-card .holo { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 0.35s; z-index: 3; mix-blend-mode: screen;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.1), transparent 38%),
    linear-gradient(calc(var(--rx) * 35deg + 115deg), transparent 34%, rgba(94, 234, 212, 0.13) 44%, rgba(255, 255, 255, 0.07) 50%, rgba(16, 185, 129, 0.13) 56%, transparent 66%),
    repeating-linear-gradient(calc(var(--rx) * 60deg + 100deg), rgba(255, 255, 255, 0.018) 0 3px, transparent 3px 11px);
  background-size: 100% 100%, 200% 100%, 100% 100%; background-position: 0 0, calc(100% - var(--mx)) 0, 0 0; }
.winner-card.is-holo .holo { opacity: 1; }
[data-theme="light"] .winner-card .holo { mix-blend-mode: multiply;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(5, 150, 105, 0.07), transparent 38%),
    linear-gradient(calc(var(--rx) * 35deg + 115deg), transparent 34%, rgba(5, 150, 105, 0.1) 44%, rgba(15, 23, 42, 0.03) 50%, rgba(5, 150, 105, 0.1) 56%, transparent 66%);
  background-size: 100% 100%, 200% 100%; background-position: 0 0, calc(100% - var(--mx)) 0; }

/* ==========================================================================
   Vault lock (single-winner reveal)
   ========================================================================== */
.verify-status .grow { flex: 1; min-width: 0; }
/* Verify: draw information */
.vi-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.vi-head .avatar { --size: 44px; flex: none; }
.vi-head .vi-mark { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border-accent); flex: none; }
.vi-head .vi-mark svg { width: 24px; height: 24px; }
.vi-head strong { display: block; font-size: 15px; }
.vi-head span { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.vi-head code { font-family: var(--font-mono); color: var(--accent); font-size: 12px; }
.vi-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0 6px; }
.vi-stats div { text-align: center; padding: 12px 8px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.vi-stats b { display: block; font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.1; }
.vi-stats span { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.vi-list { margin: 0; }
.vi-list > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--border); }
.vi-list > div:first-child { border-top: 0; margin-top: 4px; }
.vi-list dt { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.vi-list dd { margin: 0; font-size: 13.5px; color: var(--text); word-break: break-word; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip-sm { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--border-accent); }
.chip-sm.chip-muted { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }
@media (max-width: 480px) { .vi-list > div { grid-template-columns: 1fr; gap: 4px; } .vi-stats b { font-size: 18px; } }

.final-card .back-ring { transition: border-color 0.3s, box-shadow 0.3s; }
.final-card .lock-notch { position: absolute; left: 50%; top: -13px; width: 0; height: 0; border: 5px solid transparent; border-top: 8px solid var(--accent); transform: translateX(-50%); opacity: 0; transition: opacity 0.3s; }
.final-card.is-locking .lock-notch { opacity: 1; }
.final-card.is-locking .back-ring { border-style: solid; border-color: rgba(16, 185, 129, 0.6); }
.final-card.is-locking .back-ring::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; background: repeating-conic-gradient(var(--accent) 0 1.4deg, transparent 1.4deg 12deg); -webkit-mask: radial-gradient(circle, transparent 78%, #000 79%, #000 86%, transparent 87%); mask: radial-gradient(circle, transparent 78%, #000 79%, #000 86%, transparent 87%); opacity: 0.9; animation: dialTurn 1.98s cubic-bezier(0.55, 0, 0.2, 1) forwards; }
@keyframes dialTurn { 0% { transform: rotate(0deg); } 21% { transform: rotate(135deg); } 31% { transform: rotate(135deg); } 55% { transform: rotate(-100deg); } 65% { transform: rotate(-100deg); } 86% { transform: rotate(45deg); } 100% { transform: rotate(45deg); } }
.final-card.is-clicking { animation: lockNudge 0.2s ease-out; }
@keyframes lockNudge { 50% { transform: translate(var(--px), var(--py)) rotate(var(--rz)) scale(1.03); } }
.final-card.is-unlocked .back-ring { border-color: var(--accent); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.18), 0 0 46px -4px var(--accent-glow); }
.final-card.is-unlocked .back-ring::after { animation: none; opacity: 0; transition: opacity 0.25s; }
.final-card.is-unlocked .back-ring::before { background: radial-gradient(circle, rgba(16, 185, 129, 0.45), rgba(16, 185, 129, 0) 70%); }
.final-card.is-unlocked .back-mark { filter: drop-shadow(0 0 18px rgba(16, 185, 129, 0.8)); }

/* ==========================================================================
   Draw overlay — the signature interaction
   ========================================================================== */
.draw-overlay { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; opacity: 0; transition: opacity 0.45s var(--ease); }
.draw-overlay.is-open { opacity: 1; }
.draw-backdrop { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(16, 40, 46, 0.97), rgba(5, 12, 15, 0.985)); }
.draw-topbar { position: relative; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; }
.draw-audio-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.draw-overlay.has-result .draw-topbar { background: linear-gradient(180deg, rgba(6, 14, 17, 0.96) 0%, rgba(6, 14, 17, 0.7) 70%, rgba(6, 14, 17, 0)); }
.draw-overlay.has-result .draw-progress { color: var(--accent); border-color: var(--border-accent); }
.draw-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.draw-title .kicker { font-size: 10.5px; }
.draw-host { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); min-height: 20px; }
.draw-host .host-avatar { --size: 20px; flex: none; }
.draw-host .host-mark { width: 18px; height: 18px; flex: none; }
.draw-host .host-name { font-weight: 700; color: var(--accent); }
.draw-host em { font-style: normal; color: var(--text-3); }
.draw-host .is-dealing { animation: hostDeal 0.22s ease-out; }
@keyframes hostDeal { 50% { transform: translateY(2px) scale(0.9); } }
/* Dealer: host avatar above the deck; shuffles with the riffle, flicks with every dealt card */
.dealer { position: absolute; left: 50%; top: -86px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 4; transition: transform 0.5s var(--ease), opacity 0.4s; }
.dealer .dealer-avatar { --size: 60px; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent), 0 16px 30px -10px rgba(0, 0, 0, 0.55); }
.dealer .dealer-brand { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(165deg, #172a30, #0b1418); }
.dealer .dealer-brand svg { width: 34px; height: 34px; }
.dealer-name { font-size: 12px; font-weight: 700; color: var(--accent); background: var(--surface-glass); border: 1px solid var(--border); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.dealer-name::after { content: " · dealing"; font-weight: 500; color: var(--text-3); }
.dealer.is-shuffling .dealer-avatar { animation: dealerShuffle 0.72s ease-in-out 2; }
@keyframes dealerShuffle { 0%, 100% { transform: translate(0, 0) rotate(0); } 26% { transform: translate(-16px, 3px) rotate(-7deg); } 50% { transform: translate(0, -2px); } 76% { transform: translate(16px, 3px) rotate(7deg); } }
.dealer.flick-l .dealer-avatar { animation: dealerFlickL 0.24s ease-out; }
.dealer.flick-r .dealer-avatar { animation: dealerFlickR 0.24s ease-out; }
@keyframes dealerFlickL { 40% { transform: translate(-8px, 4px) rotate(-7deg); } }
@keyframes dealerFlickR { 40% { transform: translate(8px, 4px) rotate(7deg); } }
.dealer.is-focus { transform: translateX(-50%) translateY(8px) scale(1.06); }
.dealer.is-away { transform: translateX(-50%) translateY(-16px) scale(0.88); opacity: 0.5; }
.dealer.is-away .dealer-name::after { content: " · dealt"; }
[data-theme="light"] .dealer .dealer-brand { background: linear-gradient(165deg, #ffffff, #e3f3ea); border: 1px solid var(--border-accent); }
.draw-title strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draw-progress { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--text-2); padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); }
.draw-progress .dot { animation: none; }

.draw-stage { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; overflow: hidden; transform: scale(0.9); opacity: 0; transition: transform 0.75s var(--ease-out), opacity 0.5s var(--ease); }
.draw-overlay.is-open .draw-stage { transform: scale(1); opacity: 1; }
.draw-overlay.is-open .draw-stage.is-out { opacity: 0; transform: scale(0.96); pointer-events: none; }

.deck-area { position: relative; width: calc(var(--card-w) + 120px); height: calc(var(--card-h) + 80px); perspective: 1500px; }
.deck-glow { position: absolute; inset: -30%; background: radial-gradient(circle, rgba(16, 185, 129, 0.32), transparent 62%); filter: blur(14px); opacity: 0; transition: opacity 0.9s var(--ease); pointer-events: none; }
.draw-overlay.is-open .deck-glow { opacity: 1; }
.deck-glow.is-hot { animation: glowPulse 1.2s ease-in-out infinite; }
@keyframes glowPulse { 0%, 100% { opacity: 0.75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
.deck { position: absolute; inset: 0; }
.deck-stack { position: absolute; inset: 0; transition: opacity 0.4s var(--ease), transform 0.4s var(--ease); }
.deck-stack.is-gone { opacity: 0; transform: scale(0.94); pointer-events: none; }
.deck-stack .pcard-box { --i: 0; z-index: calc(10 - var(--i)); transform: translate(calc(var(--i) * 2px), calc(var(--i) * -3px)) rotate(calc(var(--i) * -1.4deg)); filter: brightness(calc(1 - var(--i) * 0.07)); }
.deck-stack .pcard-box:first-child { filter: none; }
.deck-pool .pcard-box { z-index: 20; visibility: hidden; will-change: transform, opacity; }
.deck-pool .pcard-box.is-flying { visibility: visible; }
.deck-pool .pcard-box.is-candidate .pcard-skin { border-color: var(--border-accent); }
/* Mobil: kart atarken repaint jank'ini azaltmak icin ucan kartlari sadelestir (masaustu etkilenmez). */
@media (max-width: 760px) {
  .deck-pool .pcard-box.is-flying .pcard-skin { box-shadow: 0 10px 22px -12px rgba(0, 0, 0, 0.6); }
  .deck-pool .pcard-box.is-flying .pcard-skin::after { display: none; }
  .deck-pool .pcard-box.is-flying .back-mark { filter: none; }
}

.final-cards { position: absolute; inset: 0; }
.final-card { --tx: 0px; --ty: 0px; --px: 0px; --py: 0px; --rz: 0deg; --d: 0s; z-index: 5; perspective: 1200px; opacity: 0;
  transform: translate(var(--px), var(--py)) rotate(var(--rz));
  transition: opacity 0.35s var(--ease), transform 0.8s var(--ease-out); transition-delay: 0s, var(--d); }
.final-card.is-visible { opacity: 1; }
.final-card.is-spread { transform: translate(var(--tx), var(--ty)) rotate(0deg); }
.final-card.is-instant { transition: opacity 0.3s; }
.final-inner { position: absolute; inset: 0; -webkit-transform-style: preserve-3d; transform-style: preserve-3d; border-radius: 16px; }
.final-card.is-flipped .final-inner { transform: rotateY(180deg); }
.final-card.is-flipped:not(.is-instant) .final-inner { animation: flipPop 0.8s cubic-bezier(0.4, 0, 0.2, 1) both; }
@keyframes flipPop { 0% { transform: rotateY(0deg) scale(1); } 50% { transform: rotateY(90deg) scale(1.1); } 100% { transform: rotateY(180deg) scale(1); } }
.final-card.is-compact .pcard-skin { padding: 12px 8px 8px; gap: 2px; }
.final-card.is-compact .pcard-skin .avatar, .final-card.is-compact .face-back .avatar { --size: 40px; margin-bottom: 4px; }
.final-card.is-compact .pcard-handle { font-size: 12px; }
.final-card.is-compact .pcard-name { font-size: 11px; }
.final-card.is-compact .pcard-foot, .final-card.is-compact .pcard-num { display: none; }
.final-card.is-compact .back-text { font-size: 8px; bottom: 8px; }
.final-card.is-compact .pcard-winner-tag { height: 18px; font-size: 9px; padding: 0 7px; margin-bottom: 6px; }
.final-card.is-tiny .pcard-skin { padding: 6px 4px 4px; gap: 1px; }
.final-card.is-tiny .pcard-skin::before { height: 2px; }
.final-card.is-tiny .pcard-skin .avatar, .final-card.is-tiny .face-back .avatar { --size: 26px; margin-bottom: 2px; box-shadow: 0 0 0 2px #0f1b20, 0 0 0 3px var(--accent); }
.final-card.is-tiny .pcard-handle { font-size: 8.5px; gap: 2px; }
.final-card.is-tiny .pcard-handle .verified { width: 9px; height: 9px; }
.final-card.is-tiny .pcard-name { display: none; }
.final-card.is-tiny .pcard-winner-tag { height: 13px; font-size: 7px; padding: 0 5px; margin-bottom: 3px; letter-spacing: 0.06em; }
.final-card.is-tiny .pcard-winner-tag .icon { display: none; }
.final-card.is-tiny .back-text { display: none; }
.final-card.is-tiny .pcard-back::before { inset: 4px; border-radius: 8px; }
.pcard-face { -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.pcard-face.face-back { transform: rotateY(180deg); }
.final-card.is-tense .face-front { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 50px -10px var(--accent-glow); }
.face-back { background: linear-gradient(165deg, #16302f 0%, #0f1b20 100%); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 40px 90px -30px var(--accent-glow); }
.face-back::before { background: var(--accent-gradient); opacity: 1; height: 4px; }
.face-back .pcard-winner-tag { margin-bottom: 14px; }
.face-back .avatar { --size: 74px; box-shadow: 0 0 0 3px #0f1b20, 0 0 0 5px var(--accent); }
.face-back .reveal-item { opacity: 0; transform: translateY(8px); transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out); }
.final-card.is-revealed .reveal-item { opacity: 1; transform: none; }
.final-card.is-revealed .reveal-item:nth-child(1) { transition-delay: 0.05s; }
.final-card.is-revealed .reveal-item:nth-child(2) { transition-delay: 0.15s; }
.final-card.is-revealed .reveal-item:nth-child(3) { transition-delay: 0.25s; }
.final-card.is-revealed .reveal-item:nth-child(4) { transition-delay: 0.33s; }
.final-card.is-revealed .reveal-item:nth-child(5) { transition-delay: 0.45s; }
.face-back .pcard-foot { color: var(--accent); }

.deck-rings { position: absolute; inset: 0; pointer-events: none; }
.deck-rings .ring { position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; margin: -110px 0 0 -110px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; }
.deck-rings.is-active .ring { animation: ringOut 1.5s var(--ease-out) both; }
.deck-rings.is-active .ring:nth-child(2) { animation-delay: 0.18s; }
.deck-rings.is-active .ring:nth-child(3) { animation-delay: 0.36s; }
@keyframes ringOut { 0% { transform: scale(0.55); opacity: 0.75; } 100% { transform: scale(3.2); opacity: 0; } }

.draw-status { display: flex; align-items: center; gap: 14px; min-height: 26px; font-size: 14px; color: var(--text-2); }
.status-label { transition: opacity 0.25s; }
.status-count { font-family: var(--font-mono); font-size: 13px; color: var(--accent); font-variant-numeric: tabular-nums; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--border-accent); }
.draw-tools { display: flex; gap: 8px; min-height: 34px; }
.draw-bar { width: 220px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.draw-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 1.2s linear; }

.draw-result { position: absolute; inset: 0; z-index: 3; overflow: auto; padding: 76px 20px 40px; display: flex; flex-direction: column; align-items: center; opacity: 0; transition: opacity 0.5s var(--ease); }
.draw-result.is-in { opacity: 1; }
.result-head { text-align: center; max-width: 760px; }
.result-head h2 { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin-top: 12px; }
.result-head p { color: var(--text-2); margin-top: 8px; font-size: 14px; }
.result-head code { color: var(--accent); font-size: 13px; }
.result-winners { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin: 26px 0; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.result-note { margin-top: 18px; font-size: 12.5px; color: var(--text-3); text-align: center; max-width: 520px; }
/* Sponsor placement (temporary; see SPONSOR in script.js) */
.sponsor-pill { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px; background: var(--surface-glass); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); text-decoration: none; z-index: 5; backdrop-filter: blur(8px); transition: border-color var(--dur), color var(--dur); }
.sponsor-pill:hover { border-color: rgba(0, 224, 125, 0.5); color: var(--text); }
.sponsor-pill svg { width: 18px; height: 22px; }
.sponsor-pill b { color: #00e07d; }
.pcard-brand.is-sponsor { width: 16px; height: 20px; }
.pcard-back .back-mark.is-sponsor { width: 34%; aspect-ratio: 34 / 43; filter: drop-shadow(0 8px 16px rgba(0, 224, 125, 0.4)); }
.result-sponsor { margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 11px; color: var(--text-4); }
.result-sponsor svg { width: 12px; height: 15px; opacity: 0.85; }
.confetti { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }

/* Mobile sticky CTA */
.mobile-cta { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--surface-glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--border); transform: translateY(110%); transition: transform 0.3s var(--ease); }
.mobile-cta.is-visible { transform: none; }
body.is-locked .mobile-cta { display: none; }
.mobile-cta .btn { width: 100%; }

/* ==========================================================================
   Light theme: participant cards, winner cards and the draw overlay follow the theme
   ========================================================================== */
[data-theme="light"] .pcard-skin { background: linear-gradient(165deg, #ffffff 0%, #e9f4ee 100%); border-color: rgba(15, 23, 42, 0.12); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 20px 40px -18px rgba(15, 23, 42, 0.35); }
[data-theme="light"] .pcard-skin::after { background-image: radial-gradient(rgba(15, 23, 42, 0.07) 1px, transparent 1px); }
[data-theme="light"] .pcard-skin .avatar { box-shadow: 0 0 0 3px #ffffff, 0 0 0 4px rgba(15, 23, 42, 0.12); }
[data-theme="light"] .pcard-back { background: linear-gradient(165deg, #f6fbf8 0%, #dcece3 100%); }
[data-theme="light"] .pcard-back::before { border-color: rgba(5, 150, 105, 0.35); }
[data-theme="light"] .face-back { background: linear-gradient(165deg, #ffffff 0%, #e3f3ea 100%); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 40px 90px -30px var(--accent-glow); }
[data-theme="light"] .face-back .avatar { box-shadow: 0 0 0 3px #ffffff, 0 0 0 5px var(--accent); }
[data-theme="light"] .final-card.is-tiny .pcard-skin .avatar, [data-theme="light"] .final-card.is-tiny .face-back .avatar { box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px var(--accent); }
[data-theme="light"] .winner-card { background: linear-gradient(165deg, #ffffff 0%, #e6f3ec 100%); border-color: rgba(5, 150, 105, 0.45); box-shadow: 0 0 0 1px rgba(5, 150, 105, 0.12), 0 30px 70px -30px var(--accent-glow), var(--shadow); }
[data-theme="light"] .winner-card::after { background-image: radial-gradient(rgba(15, 23, 42, 0.07) 1px, transparent 1px); }
[data-theme="light"] .wc-avatar { box-shadow: 0 0 0 4px #ffffff, 0 0 0 6px var(--accent); }
[data-theme="light"] .winner-card.is-compact .wc-avatar { box-shadow: 0 0 0 3px #ffffff, 0 0 0 4px var(--accent); }
[data-theme="light"] .draw-backdrop { background: radial-gradient(ellipse at 50% 45%, rgba(238, 248, 243, 0.97), rgba(214, 235, 225, 0.985)); }
[data-theme="light"] .draw-progress { background: rgba(15, 23, 42, 0.05); }
[data-theme="light"] .draw-overlay.has-result .draw-topbar { background: linear-gradient(180deg, rgba(238, 248, 243, 0.97) 0%, rgba(238, 248, 243, 0.75) 70%, rgba(238, 248, 243, 0)); }
[data-theme="light"] .deck-glow { background: radial-gradient(circle, rgba(5, 150, 105, 0.22), transparent 62%); }
[data-theme="light"] .share-preview { background: #0f2027; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .picker-grid { grid-template-columns: minmax(0, 1fr) 340px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 24px; padding-top: 40px; }
  .hero-visual { height: 350px; }
  .brand-card, .sponsor-card { --card-w: 250px; --card-h: 320px; }
  .picker-grid, .tool-grid, .contact-grid, .showcase, .showcase-result { grid-template-columns: 1fr; }
  .picker-aside { position: static; }
  .steps, .features, .principles { grid-template-columns: 1fr 1fr; }
  .faq-groups { grid-template-columns: 1fr; }
  .faq-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .showcase-visual { height: 300px; }
  .mobile-cta { display: block; }
}
@media (max-width: 760px) {
  :root { --card-w: 176px; --card-h: 224px; --gutter: 16px; }
  .nav-links { display: none; }
  .nav-actions .nav-burger { display: inline-flex; }
  .nav-actions .nav-desktop-only { display: none; }
  .hero h1 { font-size: clamp(28px, 8vw, 36px); }
  .hero .lead { font-size: 15px; }
  .section { padding: 48px 0; }
  .section-title { font-size: 24px; }
  .seg-grid { grid-template-columns: 1fr 1fr; }
  .rule-tiles { grid-template-columns: 1fr 1fr; }
  .rule-fields { grid-template-columns: 1fr; }
  .steps, .features, .principles, .grid-2, .grid-3, .kv-grid { grid-template-columns: 1fr; }
  .panel-body, .panel-head { padding-left: 16px; padding-right: 16px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-brand { grid-column: 1 / -1; }
  .draw-topbar { padding: 12px 14px; }
  .draw-progress { font-size: 11px; padding: 5px 9px; }
  .draw-title strong { max-width: 40vw; }
  .pcard-skin .avatar { --size: 54px; }
  .face-back .avatar { --size: 60px; }
  .deck-area { width: calc(var(--card-w) + 60px); height: calc(var(--card-h) + 50px); }
  .result-head h2 { font-size: 24px; }
  .draw-result { padding: 60px 14px 30px; }
  .winner-card { width: min(300px, 100%); }
  .winner-card.is-medium { width: calc(50% - 6px); padding: 14px 10px 12px; }
  .winner-card.is-medium .wc-meta { gap: 8px; font-size: 10px; }
  .wc-top { gap: 6px; }
  .wc-top span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .winner-card.is-medium .wc-top { font-size: 9px; }
  .winner-card.is-medium .wc-meta { flex-wrap: wrap; gap: 6px 10px; }
  .winner-card.is-compact { width: calc(33.333% - 6px); padding: 8px 6px 9px; border-radius: 12px; }
  .winner-card.is-compact .wc-top { font-size: 8px; gap: 4px; }
  .winner-card.is-compact .wc-avatar { --size: 40px; margin: 8px auto 6px; }
  .winner-card.is-compact .wc-handle { font-size: 11px; }
  .winner-card.is-compact .wc-name { font-size: 10px; }
  .result-winners.is-dense { gap: 8px; }
  .result-actions .btn { flex: 1 1 45%; }
  .hero-ctas .btn { flex: 1 1 auto; }
  .toast-root { left: 16px; right: 16px; max-width: none; }
  .stat-value { font-size: 26px; }
  .page-head { padding: 32px 0 20px; }
  .page-head h1 { font-size: 22px; }
}
@media (max-width: 480px) {
  /* Modals (incl. Share result): tighter margins and full-width, tap-friendly buttons */
  .modal-backdrop { padding: 10px; }
  .modal { max-width: 100%; border-radius: var(--radius-lg); }
  .share-actions { gap: 8px; }
  .share-actions .btn { flex: 1 1 100%; justify-content: center; }
  .modal-foot { flex-direction: column; }
  .modal-foot .btn { width: 100%; justify-content: center; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 22px; }
  .hero-visual { height: 310px; }
  .brand-card, .sponsor-card { --card-w: 224px; --card-h: 288px; }
  .brand-card .brand-card-emblem { width: 84px; height: 84px; margin: 14px auto 12px; }
  .brand-card .brand-card-mark { width: 46px; height: 46px; }
  .brand-card .brand-card-name { font-size: 24px; }
  .brand-card .brand-card-tag { font-size: 11.5px; }
  .brand-card .brand-card-pills { gap: 4px; flex-wrap: nowrap; margin-top: 10px; }
  .brand-card .brand-card-pills li { font-size: 9px; padding: 3px 6px; }
  .brand-card .brand-card-foot { left: 14px; right: 14px; font-size: 8.5px; white-space: nowrap; gap: 8px; }
  .hero-meta { gap: 6px 12px; }
  .seg-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .seg { padding: 10px; }
  .tweet-metrics { gap: 10px; }
  .picker-main, .picker-aside { gap: 12px; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .brand-card, .sponsor-card, .brand-shine, .brand-card-emblem, .brand-card-emblem::before, .showcase-visual .pcard-box.fly, .dot, .deck-glow.is-hot, .sk { animation: none !important; }
  .deck-rings.is-active .ring { animation: none; opacity: 0; }
  .final-card, .final-inner { transition: none; }
  .final-card.is-flipped .final-inner { animation: none; }
  .final-card.is-locking .back-ring::after, .final-card.is-clicking { animation: none; }
  .winner-card.is-holo { transform: none; }
  .winner-card .holo { display: none; }
  .dealer .dealer-avatar { animation: none !important; }
  .pick-btn::after { display: none; }
  .page.is-enter, .tweet-preview.is-loaded, .winner-card.is-in, .toast, .chip, .revealed-chip { animation-duration: 0.01ms !important; }
  .draw-stage { transition: opacity 0.3s; transform: none; }
  .card-hover:hover, .seg:hover:not(:disabled), .rule-tile:hover { transform: none; }
}

/* Winner card profile links (result / verify) */
.wc-link:hover, .wc-link:focus-visible { text-decoration: underline !important; }

/* ==========================================================================
   Round 14 (2026-09-07): ideas 20, 23, 28, 29 (22 lives with the URL field above)
   ========================================================================== */
/* #20 Card leaves the table and lands on the result card (shared-element flight) */
.draw-stage.is-morphing { overflow: visible; z-index: 4; }
.draw-stage.is-morphing > :not(.deck-area), .draw-stage.is-morphing .deck-area > :not(.deck), .draw-stage.is-morphing .deck-stack, .draw-stage.is-morphing .deck-pool { opacity: 0 !important; transition: opacity 0.25s var(--ease); }
.draw-stage.is-morphing .final-card { transition: none; z-index: 6; }
/* the picked-up card casts a deeper shadow while it is in the air */
.final-card.is-lifting .face-back { box-shadow: 0 0 0 1px var(--accent), 0 60px 90px -30px rgba(0, 0, 0, 0.75), 0 30px 70px -30px var(--accent-glow); transition: box-shadow 0.5s var(--ease); }
[data-theme="light"] .final-card.is-lifting .face-back { box-shadow: 0 0 0 1px var(--accent), 0 60px 90px -30px rgba(15, 23, 42, 0.45), 0 30px 70px -30px var(--accent-glow); }
.draw-result.is-morph { transition: none; }
.draw-result.is-morph .winner-card { animation: none; }
.draw-result.is-morph:not(.is-landed) .winner-card { opacity: 0; }
.draw-result.is-morph .result-head, .draw-result.is-morph .result-actions, .draw-result.is-morph .result-note, .draw-result.is-morph .result-sponsor { opacity: 0; transition: opacity 0.45s var(--ease) 0.3s; }
.draw-result.is-morph.is-in .result-head, .draw-result.is-morph.is-in .result-actions, .draw-result.is-morph.is-in .result-note, .draw-result.is-morph.is-in .result-sponsor { opacity: 1; }
.draw-result.is-morph.is-landed .winner-card { transition: opacity 0.2s var(--ease), transform 0.35s ease-out, box-shadow 0.35s ease-out; }

@media (prefers-reduced-motion: reduce) {
  .url-field.is-shake, .url-field.is-catching .input { animation: none !important; }
  .url-field > .url-icon { transition: none; }
}

/* ==========================================================================
   Light theme: form controls and selectable tiles sit on white (owner request,
   2026-09-07). Active states (pressed engagement card, enabled rule) keep
   their green tint; hover uses the faint green surface for feedback.
   ========================================================================== */
[data-theme="light"] .input, [data-theme="light"] .select, [data-theme="light"] .textarea,
[data-theme="light"] .stepper, [data-theme="light"] .chips { background-color: #ffffff; }
[data-theme="light"] .seg:not([aria-pressed="true"]) { background: #ffffff; }
[data-theme="light"] .seg:not([aria-pressed="true"]):hover:not(:disabled) { background: var(--surface-2); }
[data-theme="light"] .rule-tile:not(.is-on) { background: #ffffff; }
[data-theme="light"] .rule-tile:not(.is-on):hover { background: var(--surface-2); }
[data-theme="light"] .tweet-preview:not(.is-loaded) { background: #ffffff; }
[data-theme="light"] .tweet-preview.is-loaded { background: #ffffff; }

/* Draw ID in the result head links to the verification page */
.draw-id-link { color: var(--accent); text-decoration: none; border-bottom: 1px dashed var(--border-accent); transition: border-color var(--dur); }
.draw-id-link:hover { border-bottom-style: solid; border-bottom-color: var(--accent); }
/* Light theme: the remaining tinted strips go white too (owner request) */
[data-theme="light"] .step .step-visual { background: #ffffff; }
[data-theme="light"] .tweet-detected { background: #ffffff; }
