/* =========================================================================
   Yaypick — design system
   A friendly live-voting look: bright surfaces, navy ink, one warm brand red,
   and a colour per answer (A/B/C/D tiles). Rounded, tactile, game-show buttons.
   Tokens are scoped so any element can carry its own poll theme
   (data-theme-mode / data-font / data-radius / data-bg + --accent).
   ========================================================================= */

:root,
[data-theme-mode="light"] {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f2f0ea;
  --surface-3: #e7e4dc;
  --border: #e3dfd5;
  --border-strong: #c7c2b5;
  --text: #1d1f3b;
  --text-2: #484b67;
  --muted: #777a92;
  --danger: #c62f22;
  --success: #12825c;
  --warning: #a86800;
  --gold: #ffc21a;
  --on-gold: #1d1f3b;
  --shadow: 0 1px 2px rgba(29, 31, 59, .04);
  --shadow-lg: 0 2px 4px rgba(29, 31, 59, .06), 0 24px 48px -16px rgba(29, 31, 59, .22);
  --dot: rgba(29, 31, 59, .13);
  --grid: rgba(29, 31, 59, .06);
  color-scheme: light;
}

[data-theme-mode="dark"] {
  --bg: #12142a;
  --surface: #1a1c33;
  --surface-2: #22253f;
  --surface-3: #2d3050;
  --border: #2f3252;
  --border-strong: #4a4e74;
  --text: #f1f1f8;
  --text-2: #c5c7dc;
  --muted: #8f92ad;
  --danger: #ff7a6b;
  --success: #4fd1a1;
  --warning: #f2b544;
  --shadow: 0 1px 2px rgba(29, 31, 59, .04);
  --shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, .7);
  --dot: rgba(241, 241, 248, .12);
  --grid: rgba(241, 241, 248, .05);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme-mode="light"]),
  [data-theme-mode="auto"] {
    --bg: #12142a;
    --surface: #1a1c33;
    --surface-2: #22253f;
    --surface-3: #2d3050;
    --border: #2f3252;
    --border-strong: #4a4e74;
    --text: #f1f1f8;
    --text-2: #c5c7dc;
    --muted: #8f92ad;
    --danger: #ff7a6b;
    --success: #4fd1a1;
    --warning: #f2b544;
    --shadow: 0 1px 2px rgba(29, 31, 59, .04);
    --shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, .7);
    --dot: rgba(241, 241, 248, .12);
    --grid: rgba(241, 241, 248, .05);
    color-scheme: dark;
  }
}

:root {
  --accent: #d93a2b;
  --on-accent: #ffffff;
  /* Answer colours, fixed order (validated for colour-blind separation). */
  --c1: #e5412f; --c2: #2f6fe8; --c3: #bf8400; --c4: #119e72;
  --font: "Rubik", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: var(--font);
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 12px;
  --radius-btn: 8px;
}

[data-theme-mode] { color: var(--text); }

/* Accent-derived tokens recompute wherever --accent is overridden. */
:root, [data-theme-mode], [style*="--accent"] {
  --accent-soft: color-mix(in srgb, var(--accent) 13%, transparent);
  --accent-softer: color-mix(in srgb, var(--accent) 6%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 45%, transparent);
  --accent-text: color-mix(in srgb, var(--accent) 85%, var(--text));
  --accent-lip: color-mix(in srgb, var(--accent) 68%, #000);
}

[data-font="sans"] { --font-display: var(--font); }
[data-font="serif"] { --font-display: "Newsreader", Georgia, serif; }
[data-font="mono"] { --font: "IBM Plex Mono", ui-monospace, monospace; --font-display: var(--font); }
[data-font="rounded"] { --font: "Nunito", "Rubik", system-ui, sans-serif; --font-display: var(--font); }
[data-font] { font-family: var(--font); }

[data-radius="sharp"] { --radius-sm: 3px; --radius: 4px; --radius-lg: 6px; --radius-btn: 4px; }
[data-radius="soft"] { --radius-sm: 10px; --radius: 14px; --radius-lg: 20px; --radius-btn: 12px; }
[data-radius="round"] { --radius-sm: 16px; --radius: 22px; --radius-lg: 28px; --radius-btn: 999px; }

[data-bg] { background-color: var(--bg); }
[data-bg="grid"] {
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--bg);
}
[data-bg="dots"] { background: radial-gradient(var(--dot) 1.2px, transparent 1.4px) 0 0 / 18px 18px, var(--bg); }
/* A solid accent band behind the top of the page. */
[data-bg="band"] { background: linear-gradient(var(--accent) 0 250px, var(--bg) 250px) no-repeat, var(--bg); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
html[data-bg] body { background: transparent; }
html[data-bg] { min-height: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; margin: 0; letter-spacing: -0.015em; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--gold) 60%, transparent); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.tiny { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Small label above headings */
.kicker, .section-title {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0.01em;
}
.kicker b { color: var(--accent); font-weight: 700; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 720px; }

.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 92%, transparent); border-bottom: 1px solid var(--border); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.topbar .container { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; font-family: var(--font); font-weight: 800; font-size: 22px; letter-spacing: -0.03em; }
.brand-mark { width: 30px; height: 30px; display: block; flex-shrink: 0; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a.navlink, .nav button.navlink {
  color: var(--text-2); padding: 8px 12px; border-radius: 8px; font-size: 14.5px; font-weight: 500;
  text-decoration: none; border: 0; background: none; cursor: pointer; display: inline-flex; align-items: center;
}
.nav a.navlink:hover, .nav button.navlink:hover { background: var(--surface-2); color: var(--text); }
.nav a.navlink[aria-current="page"] { background: var(--surface-2); color: var(--text); font-weight: 600; }
.plan-chip { font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); text-decoration: none !important; border: 1px solid var(--border); }
.plan-chip.paid { background: color-mix(in srgb, var(--gold) 28%, var(--surface)); color: var(--text); border-color: color-mix(in srgb, var(--gold) 60%, transparent); }

.footer { margin-top: 72px; background: #12142a; color: rgba(255,255,255,.66); font-size: 14px; }
.footer a { color: rgba(255,255,255,.78); text-decoration: none; }
.footer a:hover { color: #fff; }
.footer .brand { color: #fff; font-size: 22px; }
.footer-top { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 32px; padding-top: 56px; padding-bottom: 40px; }
.footer-brand p { margin-top: 14px; max-width: 320px; line-height: 1.55; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 { color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 4px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 20px; padding-bottom: 28px; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; }
.footer-bottom .powered b { color: #fff; font-weight: 700; }
@media (max-width: 760px) {
  .footer-top { grid-template-columns: 1fr 1fr; padding-top: 40px; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---------- Buttons ---------- */
.btn {
  --lip: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: var(--radius-btn);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap;
  box-shadow: none;
  transition: transform .06s, box-shadow .06s, background .12s, border-color .12s;
  text-decoration: none !important; position: relative; top: 0;
}
.btn:hover { border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { --lip: var(--accent-lip); background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ink { --lip: #000; background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.gold { --lip: #b38600; background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.ghost:active { transform: none; }
.btn.danger { color: var(--danger); --lip: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); --lip: #8f1f16; }
.btn.lg { height: 54px; padding: 0 28px; font-size: 16.5px; }
.btn.sm { height: 34px; padding: 0 13px; font-size: 13.5px; }
.btn.sm:active { box-shadow: none; }
.btn.icon { width: 40px; padding: 0; height: 40px; }
.btn.icon.sm { width: 30px; height: 30px; }
.btn.ghost.icon, .btn.ghost.sm { box-shadow: none; }
.btn.block { width: 100%; }
.btn .spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: 13.5px; color: var(--text-2); }
.hint { font-size: 13px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: var(--radius-sm); padding: 10px 13px; font-size: 15px; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input.invalid, .textarea.invalid { border-color: var(--danger); }
.input.title-input { font-size: 24px; font-weight: 700; font-family: var(--font-display); padding: 11px 15px; letter-spacing: -0.015em; }
.select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
input[type="color"].swatch-input { width: 30px; height: 30px; border: 1.5px solid var(--border); border-radius: 9px; padding: 0; background: none; cursor: pointer; flex-shrink: 0; }
input[type="color"].swatch-input::-webkit-color-swatch-wrapper { padding: 2px; }
input[type="color"].swatch-input::-webkit-color-swatch { border: none; border-radius: 6px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3); position: relative; transition: background .15s; flex-shrink: 0; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .track { background: var(--c4); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid var(--accent-line); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .45; }

.segmented { display: inline-flex; padding: 4px; background: var(--surface-2); border-radius: 8px; gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; padding: 7px 14px; border-radius: 6px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(29,31,59,.15); }

.choice-cards { display: grid; gap: 8px; }
.choice-card { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: left; width: 100%; }
.choice-card:hover { border-color: var(--border-strong); }
.choice-card[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-softer); }
.choice-card .t { font-weight: 600; font-size: 14.5px; }
.choice-card .d { font-size: 13px; color: var(--muted); }
.choice-card .radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); flex-shrink: 0; margin-top: 2px; }
.choice-card[aria-pressed="true"] .radio { border: 6px solid var(--accent); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: none; }
.card.ruled { border: 1px solid var(--border); }
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 16px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.open { color: var(--success); background: color-mix(in srgb, var(--success) 13%, var(--surface)); }
.badge.closed { color: var(--muted); }
.badge.live .dot { animation: pulse-dot 1.4s ease-in-out infinite; }
.badge.accent { color: var(--accent-text); background: var(--accent-soft); }
.badge.ink { background: var(--text); color: var(--bg); }
.badge.warn { color: var(--warning); background: color-mix(in srgb, var(--gold) 22%, var(--surface)); }
@keyframes pulse-dot { 50% { opacity: .3; } }

.lock-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--gold); color: var(--on-gold); text-decoration: none !important; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 12px 14px; font-weight: 600; font-size: 14.5px; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- Toasts & dialogs ---------- */
#toasts { position: fixed; z-index: 100; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { pointer-events: auto; background: #1d1f3b; color: #fff; padding: 11px 18px; border-radius: 8px; font-size: 14.5px; font-weight: 500; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; animation: toastIn .2s ease-out; }
.toast.error { background: #b3261b; }
.toast.success svg { color: #4fd1a1; }
.toast a { color: var(--gold); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

dialog.modal { border: 0; padding: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); width: min(500px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
dialog.modal.wide { width: min(760px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(18, 20, 42, .45); backdrop-filter: blur(2px); }
dialog.modal .modal-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
dialog.modal .modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface-2); }
dialog.modal h3 { font-size: 20px; }

/* ---------- Answer tiles (A/B/C/D) — the signature element ---------- */
.letter { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0; background: var(--tile, var(--c1)); }

/* ---------- Landing ---------- */
.hero { padding: 56px 0 64px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(42px, 6.2vw, 76px); font-weight: 800; line-height: 1.02; letter-spacing: -0.04em; margin: 16px 0 20px; }
.hero h1 .hl { position: relative; white-space: nowrap; z-index: 0; }
.hero h1 .hl::after { content: ""; position: absolute; left: -4px; right: -4px; bottom: .06em; height: .32em; border-radius: 8px; background: var(--hl, var(--gold)); z-index: -1; opacity: .9; }
.hero p.lead { font-size: 19px; color: var(--text-2); max-width: 540px; margin: 0 0 30px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { margin-top: 16px; display: flex; gap: 16px; flex-wrap: wrap; }
.hero-note span { display: inline-flex; gap: 6px; align-items: center; }
.hero-note svg { color: var(--c4); }

/* Hero illustration: phone voting + big-screen results */
.showcase { position: relative; min-height: 470px; }
.phone { position: absolute; left: 0; top: 10px; width: 250px; background: #1d1f3b; border-radius: 36px; padding: 12px; box-shadow: var(--shadow-lg); z-index: 2; }
.phone-screen { background: #fff; color: #1d1f3b; border-radius: 26px; padding: 22px 16px 18px; display: flex; flex-direction: column; gap: 9px; min-height: 420px; }
.phone-screen .q { font-weight: 700; font-size: 16px; line-height: 1.3; margin-bottom: 6px; display: block; }
.phone-opt { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; border: 1.5px solid #e3dfd5; font-size: 14px; font-weight: 500; }
.phone-opt.on { border-color: var(--tile); background: color-mix(in srgb, var(--tile) 10%, #fff); }
.phone-opt .letter { width: 26px; height: 26px; font-size: 13px; border-radius: 8px; }
.phone-btn { margin-top: auto; background: var(--accent); color: #fff; text-align: center; font-weight: 600; padding: 11px; border-radius: 8px; box-shadow: 0 3px 0 var(--accent-lip); }
.screen { position: absolute; left: 228px; right: 0; top: 56px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 22px 22px 18px; box-shadow: var(--shadow-lg); }
.screen .row.top { justify-content: space-between; margin-bottom: 14px; }
.screen-bar { display: grid; grid-template-columns: 26px 1fr 42px; gap: 10px; align-items: center; margin-top: 10px; font-size: 13.5px; }
.screen-bar .tr { height: 14px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.screen-bar .tr i { display: block; height: 100%; border-radius: 999px; background: var(--tile); }
.screen-bar b { text-align: right; font-variant-numeric: tabular-nums; }
.winner-chip { position: absolute; right: 24px; bottom: -6px; z-index: 3; background: var(--gold); color: var(--on-gold); border-radius: 18px; padding: 12px 16px; box-shadow: var(--shadow-lg); display: flex; gap: 12px; align-items: center; transform: rotate(-2deg); }
.winner-chip b { display: block; font-size: 18px; line-height: 1.1; }
.winner-chip span { font-size: 12.5px; font-weight: 500; }
.winner-chip .ico { width: 38px; height: 38px; border-radius: 12px; background: #1d1f3b; color: var(--gold); display: grid; place-items: center; }

.logos { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); }
.logos .container { display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; color: var(--text-2); font-weight: 600; font-size: 14.5px; }
.logos span { display: inline-flex; gap: 8px; align-items: center; }
.logos i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.features { padding: 72px 0 24px; }
.features > .container > .head { text-align: center; max-width: 680px; margin: 0 auto 36px; }
.features h2 { font-size: clamp(30px, 3.6vw, 44px); letter-spacing: -0.03em; margin: 8px 0 12px; }
.features .head p { color: var(--text-2); font-size: 17px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.feature-card .ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: var(--tile); }
.feature-card h3 { font-size: 22px; letter-spacing: -0.02em; }
.feature-card p { color: var(--text-2); }
.feature-card ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; font-size: 14.5px; }
.feature-card li { display: flex; gap: 9px; align-items: flex-start; }
.feature-card li svg { color: var(--tile); flex-shrink: 0; margin-top: 3px; }

/* Kept for pages that still use the spec list (pricing FAQ). */
.spec-list { margin-top: 28px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.spec { padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.spec h4 { font-size: 15.5px; margin-bottom: 6px; }
.spec p { font-size: 14px; color: var(--muted); }

.section { padding: 48px 0; }
.section > .container > .head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.section h2 { font-size: 30px; letter-spacing: -0.025em; }

.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

.template { padding: 20px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.template:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.template .ix { display: flex; gap: 4px; }
.template .ix i { width: 22px; height: 8px; border-radius: 999px; display: block; }
.template h3 { font-size: 17px; }
.template p { font-size: 14px; color: var(--muted); }

/* ---------- Pricing ---------- */
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.price-col { padding: 26px 22px; display: flex; flex-direction: column; gap: 14px; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); }
.price-col.hl { border: 2px solid var(--accent); box-shadow: 0 0 0 5px var(--accent-softer), var(--shadow-lg); }
.price-col .flag { position: absolute; top: -13px; left: 22px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px; }
.price-col h3 { font-size: 22px; }
.price-col h3.aud { font-size: 21px; margin-top: 4px; }
.price { display: flex; align-items: baseline; gap: 6px; }
.price b { font-size: 46px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.price span { font-size: 14px; color: var(--muted); }
.price-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.price-col li { display: flex; gap: 8px; align-items: flex-start; }
.price-col li svg { flex-shrink: 0; margin-top: 3px; color: var(--c4); }
.price-col li.off { color: var(--muted); }
.price-col li.off svg { color: var(--muted); }
.price-col .btn { margin-top: auto; }
.segmented button .save { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--gold); color: var(--on-gold); }
.included { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 22px 24px; display: grid; gap: 14px; box-shadow: var(--shadow); }
.included-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 20px; }
.included-grid > div { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.included-grid svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.included-grid b { display: block; font-size: 14.5px; }
.included-grid span { color: var(--muted); }
.plan-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.strip-item { display: flex; gap: 16px; align-items: center; padding: 20px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); }
.strip-item h4 { font-size: 18px; letter-spacing: -0.01em; margin: 4px 0; }

/* Prepaid passes (billing) */
.pass-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.pass-row { display: flex; gap: 16px; align-items: center; padding: 15px 18px; border-top: 1px solid var(--border); }
.pass-row:first-child { border-top: 0; }
.pass-row .ticket-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex-shrink: 0; }
.pass-row.live .ticket-ico { background: var(--accent); color: var(--on-accent); }
.pass-row .t { font-weight: 600; }
.pass-row .count { font-size: 30px; font-weight: 800; line-height: 1; min-width: 36px; text-align: center; color: var(--accent); }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side { background: #1d1f3b; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; position: relative; overflow: hidden; }
.auth-side h2 { font-size: clamp(36px, 4.2vw, 56px); font-weight: 800; line-height: 1.04; letter-spacing: -0.035em; position: relative; }
.auth-side h2 em { font-style: normal; color: var(--gold); }
.auth-side .kicker { color: #a8abc6; }
.auth-side .tiles { display: flex; gap: 10px; }
.auth-side .tiles .letter { width: 46px; height: 46px; font-size: 20px; border-radius: 14px; }
.auth-form { padding: 56px; display: flex; align-items: center; justify-content: center; }
.auth-form form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 16px; }
.auth-form h1 { font-size: 34px; letter-spacing: -0.03em; }
.demo-creds { border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 12px 14px; font-size: 13.5px; display: grid; gap: 6px; }
.demo-creds button { all: unset; cursor: pointer; font-size: 13.5px; color: var(--accent-text); }
.demo-creds button:hover { text-decoration: underline; }

/* ---------- App shell (dashboard, billing, reports, admin) ---------- */
.page-head { padding: 34px 0 22px; display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 8px; }
.page-head h1 { font-size: clamp(30px, 3.8vw, 42px); letter-spacing: -0.035em; margin-top: 4px; }
.page-head .grow p { margin-top: 6px; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.stat { padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.stat .k { font-size: 13px; color: var(--muted); font-weight: 500; display: flex; gap: 7px; align-items: center; }
.stat .v { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.05; }
.stat .v.sm { font-size: 18px; font-weight: 700; margin-top: 8px; letter-spacing: -0.01em; }
.stat .sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); margin-top: 12px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; background: var(--c4); }
.meter.full i { background: var(--danger); }
.spark { height: 46px; margin-top: 8px; display: flex; align-items: flex-end; gap: 2px; }
.spark i { flex: 1; background: var(--accent); min-height: 2px; border-radius: 3px 3px 0 0; }

.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: none; overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 15px 18px; border-top: 1px solid var(--border); }
.list-row:first-child { border-top: 0; }
.list-row:hover { background: var(--surface-2); }
.list-row .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.list-row .sw { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; color: #fff; }
.list-row .metric { font-size: 15px; font-weight: 700; text-align: right; min-width: 70px; font-variant-numeric: tabular-nums; }
.list-row .metric .tiny { font-weight: 400; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--text); font-size: 20px; margin-bottom: 6px; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.upsell { border-radius: var(--radius-lg); background: color-mix(in srgb, var(--gold) 26%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--gold) 70%, transparent); padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.upsell h3 { font-size: 19px; }
.upsell .btn { align-self: flex-start; }

/* Column chart (single series, daily) */
.chart { position: relative; }
.chart-plot { display: flex; align-items: flex-end; gap: 3px; height: 190px; border-bottom: 1.5px solid var(--border-strong); position: relative; }
.chart-plot::before { content: ""; position: absolute; inset: 0; background: linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 100% 25%; pointer-events: none; }
.chart-col { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; cursor: default; }
.chart-col i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; transition: height .5s cubic-bezier(.2, .8, .2, 1); }
.chart-col:hover i, .chart-col:focus i { background: var(--text); }
.chart-col:focus { outline: none; }
.chart-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.chart-max { position: absolute; top: -2px; left: 0; font-size: 12px; color: var(--muted); background: var(--surface); padding-right: 6px; }
.chart-tip { position: absolute; pointer-events: none; transform: translate(-50%, -100%); background: #1d1f3b; color: #fff; font-size: 12.5px; padding: 6px 10px; border-radius: 10px; white-space: nowrap; z-index: 5; }

.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: 120px 1fr 48px; gap: 10px; align-items: center; font-size: 14px; }
.hbar .tr { height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.hbar .tr i { display: block; height: 100%; background: var(--c2); border-radius: 999px; }
.hbar span:last-child { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Builder ---------- */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 28px; align-items: start; padding: 20px 0 64px; }
.builder .preview-col { position: sticky; top: 86px; }
.builder-head { display: flex; align-items: flex-end; gap: 12px; padding: 30px 0 18px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.builder-head h1 { font-size: 34px; letter-spacing: -0.03em; }
.panel { display: flex; flex-direction: column; gap: 16px; padding-top: 20px; }

.qcard { padding: 20px; display: flex; flex-direction: column; gap: 14px; position: relative; }
.qcard.section { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); border-color: var(--accent-line); }
.qcard.section .qnum { background: var(--accent); color: var(--on-accent); }
.qcard.has-error { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }
.qcard-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qnum { min-width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--text); color: var(--bg); font-weight: 700; font-size: 14px; flex-shrink: 0; padding: 0 6px; }
.qcard-head .select { width: auto; min-width: 160px; height: 38px; padding-top: 6px; padding-bottom: 6px; font-size: 14px; font-weight: 600; }
.opt-row { display: flex; gap: 8px; align-items: center; }
.opt-row .input { padding: 8px 11px; }
.opt-row .handle { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; background: var(--surface-2); color: var(--text-2); }
.opt-extra { padding-left: 76px; }
.opt-tools { display: flex; gap: 2px; }
.qcard-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 12px; border-top: 1px dashed var(--border); }
.add-q { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.add-q button { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 14px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: transparent; cursor: pointer; text-align: left; font-weight: 600; font-size: 14px; color: var(--text); }
.add-q button:hover { border-style: solid; border-color: var(--accent); background: var(--accent-softer); }
.add-q button svg { color: var(--accent); }

.settings-group { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.settings-group h3 { font-size: 17px; }
.setting { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.setting .s-text { display: flex; flex-direction: column; gap: 2px; }
.setting .s-text .t { font-weight: 600; font-size: 14.5px; display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.setting .s-text .d { font-size: 13px; color: var(--muted); }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--text); }

.font-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.font-card { padding: 12px 8px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: center; }
.font-card .aa { font-size: 24px; font-weight: 700; }
.font-card .n { font-size: 12.5px; color: var(--muted); }
.font-card[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-softer); }

.preview-frame { border-radius: 26px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.preview-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.preview-bar .dots { display: flex; gap: 6px; }
.preview-bar .dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.preview-bar .dots i:nth-child(1) { background: var(--c1); }
.preview-bar .dots i:nth-child(2) { background: var(--gold); }
.preview-bar .dots i:nth-child(3) { background: var(--c4); }
.preview-bar .url { flex: 1; text-align: center; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-body { max-height: calc(100vh - 220px); overflow: auto; padding: 24px 16px; }

/* ---------- Poll page ---------- */
.poll-page { min-height: 100vh; display: flex; flex-direction: column; }
.poll-wrap { width: 100%; max-width: 680px; margin: 0 auto; padding: 44px 16px 24px; flex: 1; }
.poll-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.poll-cover { aspect-ratio: 3 / 1; width: 100%; object-fit: cover; background: var(--surface-2); }
.poll-head { padding: 30px 30px 8px; display: flex; flex-direction: column; gap: 10px; }
.poll-head .emoji { font-size: 40px; line-height: 1; }
.poll-head h1 { font-size: clamp(26px, 4.4vw, 34px); font-weight: 800; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.poll-head .desc { color: var(--text-2); }
.poll-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.poll-meta span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--surface-2); border-radius: 999px; }
.poll-body { padding: 18px 30px 30px; display: flex; flex-direction: column; gap: 30px; }
.poll-foot { padding: 16px 30px; border-top: 1px solid var(--border); background: var(--surface-2); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.q { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 24px; }
.q-title { font-weight: 700; font-size: 18.5px; display: flex; gap: 8px; overflow-wrap: anywhere; line-height: 1.3; letter-spacing: -0.01em; }
.q-title .muted { font-weight: 600; white-space: nowrap; }
.q-title .req { color: var(--accent); }
.q-help { font-size: 14px; color: var(--muted); margin-top: -6px; }
.q-error { color: var(--danger); font-size: 13.5px; font-weight: 600; }
.q.invalid .choice, .q.invalid .input, .q.invalid .textarea { border-color: color-mix(in srgb, var(--danger) 60%, var(--border)); }

.choices { display: flex; flex-direction: column; gap: 10px; }
.choices.has-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.choice {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 14px 11px 11px; border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; text-align: left; font-size: 15.5px; font-weight: 500;
  box-shadow: 0 2px 0 var(--border);
  transition: border-color .1s, background .1s, transform .06s, box-shadow .06s;
}
.choice:hover { border-color: var(--tile, var(--accent-line)); }
.choice:active { transform: translateY(2px); box-shadow: none; }
.choice[aria-checked="true"] { border-color: var(--tile, var(--accent)); background: color-mix(in srgb, var(--tile, var(--accent)) 10%, var(--surface)); box-shadow: 0 2px 0 var(--tile, var(--accent)); }
.choice .mark { width: 22px; height: 22px; border: 2px solid var(--border-strong); border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; color: #fff; margin-left: auto; }
.choice.checkbox .mark { border-radius: 7px; }
.choice[aria-checked="true"] .mark { background: var(--tile, var(--accent)); border-color: var(--tile, var(--accent)); }
.choice .mark svg { opacity: 0; transform: scale(.6); transition: all .12s; }
.choice[aria-checked="true"] .mark svg { opacity: 1; transform: none; }
.choice .cdot { display: none; }
.choice .clabel { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.choice.img { flex-direction: column; align-items: stretch; padding: 8px; gap: 8px; }
.choice.img .cimg { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: calc(var(--radius) - 5px); background: var(--surface-2); }
.choice.img .crow { display: flex; gap: 10px; align-items: center; padding: 0 4px 4px; }
.choice.img .mark { margin-left: auto; }
.other-input { margin-top: -2px; }

.rating { display: flex; gap: 6px; flex-wrap: wrap; }
.rating.stars button { border: 0; background: none; padding: 2px; cursor: pointer; color: var(--surface-3); transition: transform .1s, color .1s; }
.rating.stars button:hover { transform: scale(1.12); }
.rating.stars button.on { color: #f5b301; }
.rating.numbers button { min-width: 46px; height: 46px; border: 2px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-weight: 700; font-size: 16px; box-shadow: 0 2px 0 var(--border); }
.rating.numbers button:hover { border-color: var(--accent-line); }
.rating.numbers button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 2px 0 var(--accent-lip); }
.rating-labels { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); max-width: 520px; }

.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-item { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: grab; user-select: none; box-shadow: 0 2px 0 var(--border); }
.rank-item.dragging { opacity: .5; border-style: dashed; border-color: var(--accent); }
.rank-item .pos { width: 28px; height: 28px; border-radius: 9px; background: var(--text); color: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: 13.5px; flex-shrink: 0; }
.rank-item .grip { color: var(--muted); }

.name-field { padding: 16px; border-radius: var(--radius); background: var(--surface-2); }

.state-banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2); font-size: 14.5px; }
.state-banner.success { background: color-mix(in srgb, var(--success) 11%, var(--surface)); }
.state-banner.success > svg { color: var(--success); }
.state-banner.warn { background: color-mix(in srgb, var(--gold) 24%, var(--surface)); }
.state-banner > svg { flex-shrink: 0; margin-top: 2px; }
.state-banner .t { font-weight: 700; }

.branding { text-align: center; padding: 20px 16px 32px; font-size: 13px; color: var(--muted); }
.branding a { color: var(--text-2); font-weight: 600; }

/* ---------- Results ---------- */
.results { display: flex; flex-direction: column; gap: 30px; }
.r-q { display: flex; flex-direction: column; gap: 12px; }
.r-q-head { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; }
.r-q-head h3 { font-size: 16.5px; font-family: var(--font); font-weight: 700; overflow-wrap: anywhere; letter-spacing: -0.01em; }
.r-q-head .muted { white-space: nowrap; font-size: 13px; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar { position: relative; display: flex; flex-direction: column; gap: 6px; }
.bar-top { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.bar-top .lbl { flex: 1; min-width: 0; font-weight: 500; overflow-wrap: anywhere; display: flex; align-items: center; gap: 10px; }
.bar-top .lbl .letter { width: 26px; height: 26px; font-size: 13px; border-radius: 8px; }
.bar-top .val { font-variant-numeric: tabular-nums; font-weight: 700; }
.bar-top .cnt { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; min-width: 48px; text-align: right; }
.bar-track { height: 14px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--accent); width: 0; transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.bar.lead .lbl::after { content: "Leading"; font-size: 11.5px; font-weight: 700; color: var(--on-gold); background: var(--gold); padding: 2px 8px; border-radius: 999px; }
.bar-thumb { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2) center / cover; flex-shrink: 0; }

.donut-wrap { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.donut { width: 180px; height: 180px; flex-shrink: 0; position: relative; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { transition: stroke-dasharray .7s cubic-bezier(.2, .8, .2, 1), stroke-dashoffset .7s cubic-bezier(.2, .8, .2, 1); }
.donut .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut .center b { font-size: 28px; font-weight: 800; display: block; line-height: 1; }
.legend { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 180px; }
.legend-item { display: flex; gap: 10px; align-items: center; font-size: 14.5px; }
.legend-item .sw { width: 14px; height: 14px; border-radius: 5px; flex-shrink: 0; }
.legend-item .lbl { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.legend-item .val { font-weight: 700; font-variant-numeric: tabular-nums; }

.rating-summary { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.rating-avg { text-align: center; min-width: 110px; }
.rating-avg b { font-size: 50px; line-height: 1; display: block; font-weight: 800; letter-spacing: -0.03em; }
.rating-avg .stars-row { display: flex; gap: 2px; justify-content: center; color: #f5b301; margin: 6px 0 2px; }
.rating-dist { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 6px; }
.rating-dist .row { font-size: 13px; }
.rating-dist .row .k { width: 22px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.rating-dist .row .bar-track { flex: 1; height: 9px; }
.rating-dist .row .n { width: 36px; color: var(--muted); font-variant-numeric: tabular-nums; }

.rank-results { display: flex; flex-direction: column; gap: 8px; }
.rank-result { display: flex; gap: 12px; align-items: center; padding: 11px 13px; border-radius: var(--radius); background: var(--surface-2); }
.rank-result:first-child { background: color-mix(in srgb, var(--gold) 24%, var(--surface)); }
.rank-result .pos { font-weight: 800; font-size: 20px; width: 30px; text-align: center; color: var(--text-2); }
.rank-result .lbl { flex: 1; font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.rank-result .meta { font-size: 12.5px; color: var(--muted); text-align: right; white-space: nowrap; }

.text-responses { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow: auto; }
.text-response { padding: 11px 14px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14.5px; }
.text-response .at { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------- Manage ---------- */
.manage-head { padding: 28px 0 0; display: flex; flex-direction: column; gap: 16px; }
.manage-head .titlerow { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.manage-head h1 { font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -0.03em; overflow-wrap: anywhere; }
.manage-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; padding: 20px 0 64px; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; max-width: 320px; overflow-wrap: anywhere; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.dim td { color: var(--muted); text-decoration: line-through; }
.share-box { display: flex; gap: 8px; }
.share-box .input { font-size: 13px; }
.qr { width: 180px; height: 180px; padding: 10px; background: #fff; border-radius: 16px; margin: 0 auto; border: 1px solid var(--border); }
.qr img, .qr canvas { width: 100% !important; height: 100% !important; }
code.block { display: block; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-family: var(--font-mono); white-space: pre-wrap; word-break: break-all; }

/* ---------- Present (poll results on a projector) ---------- */
.present { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 48px; padding: 48px clamp(20px, 5vw, 80px); align-items: start; }
.present h1 { font-size: clamp(34px, 4.6vw, 64px); font-weight: 800; letter-spacing: -0.035em; }
.present .q-label { font-size: 16px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.present .results { margin-top: 40px; }
.present .bar-top { font-size: clamp(18px, 2vw, 26px); }
.present .bar-top .lbl .letter { width: 40px; height: 40px; font-size: 20px; border-radius: 12px; }
.present .bar-track { height: 28px; }
.present .r-q-head { display: none; }
.present-side { position: sticky; top: 48px; display: flex; flex-direction: column; gap: 16px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 26px; padding: 26px; box-shadow: var(--shadow-lg); }
.present-side .join { font-size: 15px; font-weight: 600; color: var(--muted); }
.present-side .url { font-size: 22px; font-weight: 800; word-break: break-all; }
.present-side .count b { font-size: 64px; font-weight: 800; display: block; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.present .qr { width: 240px; height: 240px; }
.present-nav { display: flex; gap: 8px; justify-content: center; }

/* ---------- Draws: manage ---------- */
.draw-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; padding-bottom: 64px; }
.prize-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) 90px auto; gap: 8px; align-items: center; }
.prize-row .ix { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: color-mix(in srgb, var(--gold) 35%, var(--surface)); }
.control-panel {
  background: #1d1f3b; color: #fff; border-radius: 24px; padding: 22px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 86px; box-shadow: var(--shadow-lg);
  --surface: #262947; --border: #383c63; --border-strong: #4a4e74; --text-2: #c5c7dc; --muted: #a8abc6;
}
.control-panel .kicker { color: var(--gold); }
.control-panel .select, .control-panel .input { background: #262947; color: #fff; border-color: #383c63; }
.control-panel h3 { font-size: 20px; }
.control-panel .btn:not(.primary) { background: transparent; color: #fff; border-color: #4a4e74; --lip: #0f1124; }
.control-panel .last { font-weight: 800; font-size: 26px; line-height: 1.15; color: var(--gold); overflow-wrap: anywhere; letter-spacing: -0.02em; }
.winner-list { display: flex; flex-direction: column; }
.winner-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; padding: 11px 16px; border-top: 1px solid var(--border); align-items: center; }
.winner-item:first-child { border-top: 0; }
.winner-item .r { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.winner-item .n { font-weight: 700; }
.winner-item.revoked .n { text-decoration: line-through; color: var(--muted); }

/* ---------- Draws: stage (projector) ---------- */
.stage {
  --s-bg: #12142a; --s-ink: #ffffff; --s-dim: #8f92ad; --s-line: #2a2d4a;
  position: fixed; inset: 0; background: var(--s-bg); color: var(--s-ink); display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; font-family: var(--font);
}
.stage-top { display: flex; align-items: center; gap: 24px; padding: 22px clamp(20px, 3vw, 48px); border-bottom: 1px solid var(--s-line); }
.stage-top h1 { font-size: clamp(22px, 2.4vw, 38px); font-weight: 800; letter-spacing: -0.02em; }
.stage-top .sub { color: var(--s-dim); font-size: 15px; margin-top: 4px; }
.stage-count { margin-left: auto; text-align: right; color: var(--s-dim); font-size: 14px; font-weight: 500; }
.stage-count b { display: block; color: var(--s-ink); font-size: clamp(28px, 3vw, 46px); font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stage-main { display: grid; grid-template-columns: minmax(0, 1fr) clamp(260px, 24vw, 380px); min-height: 0; }
.stage-center { display: flex; flex-direction: column; justify-content: center; padding: 24px clamp(20px, 4vw, 72px); min-width: 0; position: relative; }
.stage-prize { font-size: clamp(16px, 1.6vw, 24px); font-weight: 700; display: flex; gap: 14px; align-items: center; color: var(--gold); }
.stage-prize .left { color: var(--s-dim); font-weight: 500; }
.stage-name {
  font-weight: 800; font-size: clamp(56px, 9.5vw, 172px); line-height: .98; letter-spacing: -0.04em; margin: 18px 0 14px;
  overflow-wrap: anywhere; min-height: 1.9em; display: flex; align-items: center;
}
.stage-name.rolling { color: var(--s-dim); }
.stage-name.landed { color: var(--s-ink); animation: land .5s cubic-bezier(.2, 1.4, .3, 1); }
.stage-name.idle { color: #2f3354; }
.stage-detail { color: var(--s-dim); font-size: clamp(15px, 1.4vw, 22px); min-height: 1.5em; }
.stage-underline { height: 12px; border-radius: 999px; background: linear-gradient(90deg, var(--c1) 0 25%, var(--c2) 25% 50%, var(--gold) 50% 75%, var(--c4) 75%); width: 0; transition: width .6s cubic-bezier(.2, .8, .2, 1); margin-top: 8px; }
.stage-underline.on { width: min(520px, 60%); }
@keyframes land { 0% { transform: scale(.92); opacity: .4; } 100% { transform: none; opacity: 1; } }
.stage-bulk { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(160px, 15vw, 240px), 1fr)); gap: 12px; margin-top: 22px; max-height: 58vh; overflow: hidden; align-content: start; }
.stage-tile { border-radius: 16px; background: #1d2040; border: 1.5px solid var(--s-line); padding: 13px 15px; opacity: 0; transform: translateY(10px) scale(.97); transition: opacity .3s, transform .3s, border-color .3s; }
.stage-tile.on { opacity: 1; transform: none; border-color: var(--gold); }
.stage-tile b { display: block; font-weight: 800; font-size: clamp(18px, 1.7vw, 26px); line-height: 1.1; overflow-wrap: anywhere; letter-spacing: -0.02em; }
.stage-tile span { font-size: 13px; color: var(--s-dim); }
.stage-side { border-left: 1px solid var(--s-line); display: flex; flex-direction: column; min-height: 0; background: #161834; }
.stage-side h4 { font-weight: 600; font-size: 13.5px; color: var(--s-dim); padding: 18px 22px 10px; }
.stage-prizes { padding: 0 22px 14px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--s-line); }
.stage-prizes div { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.stage-prizes div.cur { color: var(--gold); font-weight: 700; }
.stage-prizes div.done { color: var(--s-dim); text-decoration: line-through; }
.stage-prizes span:last-child { font-variant-numeric: tabular-nums; }
.stage-winners { overflow: hidden; flex: 1; padding: 0 22px 18px; display: flex; flex-direction: column; }
.stage-winners div { padding: 9px 0; border-bottom: 1px solid var(--s-line); }
.stage-winners b { display: block; font-size: 16px; font-weight: 700; }
.stage-winners span { font-size: 12.5px; color: var(--s-dim); }
.stage-join { display: flex; gap: 14px; align-items: center; padding: 16px 22px; border-top: 1px solid var(--s-line); }
.stage-join .qr { width: 112px; height: 112px; padding: 6px; margin: 0; border: 0; border-radius: 12px; flex-shrink: 0; }
.stage-join b { display: block; font-size: 22px; font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; }
.stage-join span { font-size: 12.5px; color: var(--s-dim); word-break: break-all; }
.stage-bar { display: flex; gap: 10px; align-items: center; padding: 12px clamp(20px, 3vw, 48px); border-top: 1px solid var(--s-line); background: #0d0f22; flex-wrap: wrap; }
.stage-bar .select, .stage-bar .input { background: #1d2040; color: #fff; border-color: #2f3354; height: 40px; padding-top: 6px; padding-bottom: 6px; }
.stage-bar .btn { border-color: #3a3e63; background: transparent; color: #fff; height: 40px; --lip: #05060f; }
.stage-bar .btn.primary { background: var(--accent); border-color: var(--accent); --lip: var(--accent-lip); }
.stage-bar .keys { font-size: 12.5px; color: var(--s-dim); margin-left: auto; }
.stage-bar .keys kbd { border: 1px solid #3a3e63; border-radius: 6px; padding: 0 6px; margin: 0 2px; font-family: inherit; }
.stage.no-bar .stage-bar { display: none; }
.stage canvas.confetti { position: absolute; inset: 0; pointer-events: none; z-index: 4; }

/* Attendee check-in page */
.join-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.join-band { background: #1d1f3b; color: #fff; padding: 40px 20px 76px; text-align: center; }
.join-band h1 { font-size: clamp(32px, 8vw, 48px); font-weight: 800; line-height: 1.05; letter-spacing: -0.035em; max-width: 520px; margin: 12px auto 0; }
.join-band .kicker { color: var(--gold); }
.join-card { max-width: 520px; width: calc(100% - 32px); margin: -46px auto 32px; }

/* ---------- Avatars (contest candidates) ---------- */
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; display: block; background: var(--surface-2); }
.avatar.initials { display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.xl { width: 96px; height: 96px; font-size: 32px; border: 4px solid var(--surface); box-shadow: var(--shadow); }
.avatar.fill { width: 100%; height: 100%; border-radius: 0; font-size: clamp(28px, 6vw, 56px); }

/* ---------- Contest voting page (guests) ---------- */
.vote-page { min-height: 100vh; background: var(--bg); padding-bottom: 110px; }
.vote-band { background: var(--accent); color: var(--on-accent); padding: 34px 18px 70px; text-align: center; }
.vote-band-inner { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.vote-band .kicker { color: inherit; opacity: .9; background: rgba(255,255,255,.18); padding: 4px 12px; border-radius: 999px; }
.vote-band h1 { font-size: clamp(28px, 7vw, 42px); font-weight: 800; letter-spacing: -0.035em; }
.vote-band p { opacity: .9; }
.vote-band.branded { padding-top: 28px; }
.vote-band .brand-logo { margin-bottom: 6px; max-width: 70%; }
.vote-band .brand-logo.large { height: 64px; } .vote-band .brand-logo.medium { height: 44px; } .vote-band .brand-logo.small { height: 30px; }
.vote-band h1 { font-family: inherit; }
.vote-main { max-width: 680px; margin: -46px auto 0; padding: 0 14px; position: relative; }
.vote-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--border); z-index: 20; display: flex; justify-content: center; }
.vote-bar .btn { max-width: 640px; }
.cat-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); margin-bottom: 16px; scrollbar-width: none; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tabs button { border: 0; background: none; padding: 9px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--text-2); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.cat-tabs button[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
.cat-tabs .done { width: 18px; height: 18px; border-radius: 50%; background: var(--c4); color: #fff; display: grid; place-items: center; }
.phone-timer { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--border); margin: -4px 0 14px; font-weight: 600; font-size: 14px; color: var(--text-2); }
.phone-timer b { margin-left: auto; font-size: 22px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.phone-timer.warn { border-color: var(--danger); color: var(--danger); animation: pulse-dot 1s ease-in-out infinite; }
.phone-timer.warn b { color: var(--danger); }
.phone-timer.paused b { color: var(--muted); }
.timer-box { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.timer-box .timer-readout { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; color: #fff; }
.timer-box .timer-readout.warn { color: #ff7a6b; }
.cand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cand { position: relative; border: 2px solid var(--border); border-radius: 20px; background: var(--surface); padding: 8px 8px 12px; cursor: pointer; text-align: center; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 3px 0 var(--border); transition: transform .08s, box-shadow .08s, border-color .12s; overflow: visible; }
.cand:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--border); }
.cand:disabled { cursor: default; opacity: .85; }
.cand.on { border-color: var(--accent); box-shadow: 0 3px 0 var(--accent-lip), 0 0 0 4px var(--accent-soft); }
.cand-photo { position: relative; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: var(--surface-2); display: block; }
.cand-check { position: absolute; top: 8px; right: 8px; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 800; box-shadow: 0 2px 6px rgba(0,0,0,.25); animation: pop .3s cubic-bezier(.2, 1.6, .4, 1); }
.cand-name { font-weight: 700; font-size: 15px; margin-top: 4px; line-height: 1.2; }
.cand-sub { font-size: 12.5px; color: var(--muted); }
@keyframes pop { from { transform: scale(.3); } }
.burst { position: absolute; left: 50%; top: 40%; font-size: 26px; pointer-events: none; z-index: 5; animation: burst 1.1s ease-out forwards; }
@keyframes burst { from { transform: translate(-50%, 0) scale(.4); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), var(--dy)) rotate(var(--r)) scale(1.2); opacity: 0; } }
.id-card { max-width: 460px; margin: 0 auto; text-align: center; align-items: center; }
.id-card h2 { font-size: 24px; }
.id-card .input, .id-card .btn, .id-card form { width: 100%; }
.id-card form { display: flex; flex-direction: column; gap: 14px; align-items: stretch; text-align: left; }
.id-ico { width: 56px; height: 56px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.input.lg { height: 54px; font-size: 18px; text-align: center; }
.voted-card { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 30px; overflow: visible; }
.voted-card h2 { font-size: 28px; letter-spacing: -0.03em; }
.voted-photos { display: flex; gap: -10px; }
.voted-photos .avatar + .avatar { margin-left: -18px; }
.res-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) 90px 34px; gap: 10px; align-items: center; font-size: 14px; }
.res-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.res-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.res-row b { text-align: right; font-variant-numeric: tabular-nums; }
.selfie { width: 100%; aspect-ratio: 4 / 5; max-width: 260px; margin: 0 auto; border: 2px dashed var(--border-strong); border-radius: 20px; display: grid; place-items: center; align-content: center; gap: 6px; color: var(--muted); cursor: pointer; background: var(--surface-2); overflow: hidden; position: relative; font-weight: 600; }
.selfie.has { border-style: solid; padding: 0; }
.selfie img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.selfie .retake { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.6); color: #fff; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; display: inline-flex; gap: 5px; align-items: center; }
.selfie.sm { width: 92px; height: 112px; max-width: none; aspect-ratio: auto; margin: 0; font-size: 12px; }

/* ---------- Contest admin ---------- */
.add-cand { display: flex; gap: 14px; align-items: flex-start; }
.cand-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cand-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 8px 8px 10px; display: flex; flex-direction: column; gap: 3px; box-shadow: var(--shadow); text-align: center; align-items: center; }
.cand-tile .cand-photo { width: 100%; }
.cand-tile.pending { border: 2px dashed var(--warning); }
.cand-tile .votes { position: absolute; bottom: 8px; right: 8px; background: rgba(29,31,59,.82); color: #fff; font-weight: 700; font-size: 13px; padding: 2px 9px; border-radius: 999px; }
.cand-tile .pend { position: absolute; top: 8px; left: 8px; }
.id-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.id-grid .choice-card { align-items: center; }
.id-grid .choice-card > svg { color: var(--accent); flex-shrink: 0; }
.view-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.view-grid .btn:last-child:nth-child(odd) { grid-column: span 2; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; max-height: 320px; overflow: auto; }
.codes span { font-family: var(--font-mono); font-weight: 500; letter-spacing: .12em; text-align: center; padding: 6px; border: 1px dashed var(--border-strong); border-radius: 8px; }

/* ---------- Contest stage (big screen) ---------- */
/* Branding (brand.js) sets --s-bg-paint, --s-ink, --s-card, --s-card-ink, --s-font. */
.cstage { --s-card: rgba(12, 14, 32, .72); --s-card-2: rgba(255,255,255,.08); --s-card-ink: var(--s-ink); background: var(--s-bg-paint, #12142a); font-family: var(--s-font, var(--font)); }
.cstage h1, .cstage h2, .cstage b, .cstage .stage-count b { font-family: var(--s-font, var(--font)); }
.cstage .stage-top { border-color: var(--s-line); }
.cs-row, .cs-card, .cs-place, .cs-mini, .cs-board-row, .cs-rest span, .cs-qr { color: var(--s-card-ink); backdrop-filter: blur(6px); }
.cs-row .cs-who > span, .cs-cap span, .cs-qr span, .cs-rest em { color: color-mix(in srgb, var(--s-card-ink) 60%, transparent); }
.brand-logo { display: block; object-fit: contain; }
.brand-logo.small { height: 36px; } .brand-logo.medium { height: 56px; } .brand-logo.large { height: 84px; }
.cstage .stage-top.logo-center { justify-content: center; text-align: center; }
.cstage .stage-top.logo-center .cs-logo-wrap { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.cstage .stage-top.logo-right .cs-logo-wrap { order: 3; }
.cstage .stage-top h1 { font-size: clamp(24px, 2.6vw, 42px); }
.cs-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-height: 0; position: relative; }
.cs-main { min-height: 0; padding: 22px clamp(20px, 3.5vw, 64px); display: flex; flex-direction: column; justify-content: safe center; overflow: hidden; }
.cs-qr { align-self: end; margin: 0 24px 24px 0; background: var(--s-card); border: 1px solid var(--s-line); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; width: 190px; }
.cs-qr .qr { width: 160px; height: 160px; padding: 8px; margin: 0; border: 0; border-radius: 12px; }
.cs-qr b { display: block; font-size: 20px; font-weight: 800; }
.cs-qr span { font-size: 12px; color: var(--s-dim); word-break: break-all; }
.cs-dim { color: var(--s-dim); }
.cs-title { font-size: 40px; font-weight: 800; }
.cs-race { display: flex; flex-direction: column; gap: clamp(8px, 1.2vh, 14px); }
.cs-row { display: grid; grid-template-columns: 56px auto minmax(0, 1fr) auto; gap: 18px; align-items: center; background: var(--s-card); border: 1.5px solid var(--s-line); border-radius: 22px; padding: 10px 22px 10px 14px; will-change: transform; }
.cs-row.lead { border-color: var(--gold); background: linear-gradient(90deg, rgba(255,194,26,.18), var(--s-card) 60%); }
.cs-rank { font-size: clamp(22px, 2.2vw, 34px); font-weight: 800; text-align: center; color: var(--s-dim); }
.cs-row.lead .cs-rank { color: var(--gold); }
.cs-ava .avatar { width: clamp(52px, 5.6vw, 84px); height: clamp(52px, 5.6vw, 84px); border: 3px solid var(--s-line); }
.cs-row.lead .cs-ava .avatar { border-color: var(--gold); }
.cs-who b { font-size: clamp(20px, 2.1vw, 32px); font-weight: 800; letter-spacing: -0.02em; display: block; line-height: 1.15; }
.cs-who > span { font-size: 14px; color: var(--s-dim); }
.cs-track { height: 12px; border-radius: 999px; background: var(--s-card-2); margin-top: 8px; overflow: hidden; }
.cs-track i { display: block; height: 100%; border-radius: 999px; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.cs-count { font-size: clamp(18px, 1.9vw, 28px); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cs-row.bump, .cs-card.bump { animation: bump .45s ease-out; }
@keyframes bump { 40% { transform: scale(1.03); } }
.cs-wall { display: grid; grid-template-columns: repeat(auto-fit, minmax(clamp(140px, 13vw, 220px), 1fr)); gap: 16px; align-content: center; }
.cs-wall.dense { grid-template-columns: repeat(auto-fit, minmax(clamp(110px, 10vw, 160px), 1fr)); gap: 12px; }
.cs-card { background: var(--s-card); border: 2px solid var(--s-line); border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; }
.cs-card.lead { border-color: var(--gold); }
.cs-card .cs-photo { aspect-ratio: 1; background: var(--s-card-2); overflow: hidden; }
.cs-cap { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cs-cap b { font-size: clamp(16px, 1.5vw, 22px); font-weight: 800; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-cap span { color: var(--s-dim); font-size: 14px; white-space: nowrap; }
.cs-card .cs-count { color: var(--gold); font-size: clamp(16px, 1.5vw, 22px); }
.cs-hidden-head { text-align: center; margin-bottom: 18px; }
.cs-hidden-head h2 { font-size: clamp(30px, 3.4vw, 56px); font-weight: 800; letter-spacing: -0.035em; }
.cs-hidden-head .kicker { color: var(--gold); font-size: 16px; }
.cs-hidden-head p { color: var(--s-dim); font-size: 18px; }
.cs-pop { position: absolute; font-size: clamp(34px, 3.2vw, 54px); pointer-events: none; z-index: 6; animation: floatup 1.5s ease-out forwards; transform: translate(-50%, -50%); }
@keyframes floatup { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), -260%) scale(.9); } }
.cs-reveal { display: grid; grid-template-columns: minmax(0, 1fr) clamp(240px, 22vw, 340px); gap: 28px; align-items: center; height: 100%; }
.cs-reveal-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.cs-reveal-stage .kicker { color: var(--gold); font-size: clamp(18px, 2vw, 30px); font-weight: 700; }
.cs-big { font-size: clamp(60px, 9vw, 160px); font-weight: 800; letter-spacing: -0.05em; line-height: 1; }
.cs-count-down { font-size: clamp(120px, 18vw, 300px); font-weight: 800; line-height: 1; color: #fff; }
.cs-count-down.tick { animation: tick .9s ease-out; }
@keyframes tick { from { transform: scale(1.6); opacity: 0; } 30% { opacity: 1; } to { transform: scale(.9); opacity: .2; } }
.cs-place { background: var(--s-card); border: 2px solid var(--s-line); border-radius: 26px; overflow: hidden; width: clamp(200px, 22vw, 340px); position: relative; }
.cs-place.big { width: clamp(240px, 24vw, 380px); }
.cs-place.big .cs-photo { aspect-ratio: 1; }
.cs-place.first { border-color: var(--gold); box-shadow: 0 0 0 6px rgba(255,194,26,.18), 0 30px 80px -10px rgba(255,194,26,.35); }
.cs-place .cs-photo { aspect-ratio: 4 / 5; background: var(--s-card-2); }
.cs-place .cs-cap { flex-direction: column; align-items: center; text-align: center; padding: 14px 16px 18px; }
.cs-place .cs-cap b { font-size: clamp(22px, 2.4vw, 40px); white-space: normal; }
.cs-place .cs-cap span { white-space: normal; font-size: clamp(14px, 1.2vw, 18px); }
.cs-medal { position: absolute; top: 12px; left: 12px; z-index: 2; background: rgba(18,20,42,.85); border-radius: 999px; padding: 4px 12px; font-size: clamp(18px, 1.8vw, 28px); font-weight: 800; }
.cs-place.pop { animation: reveal .8s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes reveal { from { transform: rotateY(90deg) scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.cs-reveal-list { display: flex; flex-direction: column; gap: 8px; }
.cs-reveal-list .kicker { color: var(--s-dim); margin-bottom: 4px; }
.cs-mini { display: grid; grid-template-columns: 40px 32px minmax(0, 1fr); gap: 10px; align-items: center; background: var(--s-card); border-radius: 14px; padding: 8px 12px; font-size: 16px; }
.cs-mini > span:first-child { font-weight: 800; color: var(--gold); }
.cs-mini b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-mini.ghost { opacity: .35; }
.cs-mini .initials { background: var(--s-card-2); color: var(--s-dim); }
.stage.spot::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3; background: radial-gradient(circle at 38% 52%, transparent 0 22%, rgba(5, 6, 16, .78) 40%); animation: spotin 1s ease-out; }
@keyframes spotin { from { opacity: 0; } }
.cs-podium-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.cs-podium-wrap .kicker { color: var(--gold); font-size: 20px; }
.cs-podium { display: flex; align-items: flex-end; justify-content: center; gap: clamp(14px, 2vw, 32px); }
.cs-podium-col { display: flex; flex-direction: column; align-items: center; }
.cs-podium-col .cs-place { width: clamp(160px, 15vw, 240px); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.cs-podium-col .cs-photo { aspect-ratio: 1; }
.cs-podium-col.p1 .cs-place { width: clamp(190px, 18vw, 290px); border-color: var(--gold); }
.cs-step { width: 100%; display: grid; place-items: center; font-size: clamp(26px, 2.6vw, 44px); line-height: 1; font-weight: 800; color: #12142a; border-radius: 0 0 18px 18px; }
.p1 .cs-step { height: clamp(72px, 10vh, 120px); background: var(--gold); }
.p2 .cs-step { height: clamp(54px, 7vh, 88px); background: #c5c7dc; }
.p3 .cs-step { height: clamp(42px, 5vh, 64px); background: #d9a066; }
.cs-rest { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.cs-rest span { background: var(--s-card); border-radius: 999px; padding: 6px 14px; font-weight: 600; }
.cs-rest em { font-style: normal; color: var(--s-dim); margin-left: 8px; }
.cs-board { display: flex; flex-direction: column; gap: 10px; max-width: 1000px; width: 100%; margin: 0 auto; }
.cs-board .kicker { color: var(--gold); font-size: 18px; margin-bottom: 6px; }
.cs-board-row { display: grid; grid-template-columns: 60px 56px minmax(0, 1fr) auto auto; gap: 16px; align-items: center; background: var(--s-card); border-radius: 18px; padding: 10px 20px; font-size: clamp(18px, 1.8vw, 26px); }
.cs-board-row.first { border: 2px solid var(--gold); }
.cs-board-row .avatar { width: 52px; height: 52px; }
.cs-timer { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-left: auto; font-variant-numeric: tabular-nums; }
.cs-timer.compact:not(.hidden) + .stage-count { margin-left: 32px; }
.cs-timer.large + .stage-count, .cs-timer.hidden + .stage-count { margin-left: auto; }
.cs-timer-label { font-size: 13px; font-weight: 600; color: var(--s-dim); text-transform: uppercase; letter-spacing: .08em; }
.cs-timer b { font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.cs-timer.large { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: var(--s-card); border: 2px solid var(--s-line); border-radius: 24px; padding: 8px 28px 10px; z-index: 5; margin: 0; }
.cs-timer.large b { font-size: clamp(44px, 5vw, 84px); }
.cs-timer.compact b { font-size: clamp(26px, 2.6vw, 40px); }
.cs-timer.warn { border-color: #ff5a4a; color: #ff6b5b; animation: warnpulse 1s ease-in-out infinite; }
.cs-timer.warn .cs-timer-label { color: #ff8b7e; }
.cs-timer.paused b { color: var(--s-dim); }
.cs-timer.up { border-color: var(--gold); }
.cs-timer.up .cs-timer-label { color: var(--gold); font-size: clamp(18px, 2vw, 30px); font-weight: 800; letter-spacing: 0; text-transform: none; }
@keyframes warnpulse { 50% { transform: translateX(-50%) scale(1.06); } }
.cs-timer.compact.warn { animation: warnpulse-c 1s ease-in-out infinite; }
@keyframes warnpulse-c { 50% { transform: scale(1.06); } }
.stage-top { position: relative; }
/* Motion levels chosen by the organiser */
.stage[data-motion="none"] .cs-track i, .stage[data-motion="none"] .cs-row, .stage[data-motion="none"] .cs-card { transition: none !important; animation: none !important; }
.stage[data-motion="calm"] .cs-row, .stage[data-motion="calm"] .cs-card { animation: none !important; }

.cs-sound { position: absolute; top: 90px; right: 24px; z-index: 8; background: var(--gold); color: #1d1f3b; border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.cs-views { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.cs-views .btn.sm { height: 34px; }

/* ---------- Admin console ---------- */
.admin-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; padding-bottom: 64px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 86px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 8px; box-shadow: var(--shadow); }
.side-nav button { all: unset; cursor: pointer; padding: 10px 12px; border-radius: 12px; font-size: 14.5px; font-weight: 500; display: flex; gap: 10px; align-items: center; color: var(--text-2); }
.side-nav button:hover { background: var(--surface-2); color: var(--text); }
.side-nav button[aria-current="true"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.side-nav button .count { margin-left: auto; font-size: 11.5px; font-weight: 700; background: var(--gold); color: var(--on-gold); padding: 0 7px; border-radius: 999px; }
.module-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.module-group { padding: 11px 18px; background: var(--surface-2); border-top: 1px solid var(--border); }
.module-group:first-child { border-top: 0; }
.module { display: flex; gap: 16px; align-items: center; padding: 15px 18px; border-top: 1px solid var(--border); }
.module .s-text { flex: 1; min-width: 0; }
.module .t { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.module .d { font-size: 13.5px; color: var(--muted); }
.module code { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.matrix { width: 100%; border-collapse: collapse; font-size: 14px; }
.matrix th, .matrix td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix thead th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.matrix input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--c4); cursor: pointer; }
.matrix .input { padding: 6px 9px; font-size: 14px; text-align: right; }

/* ---------- Loading ---------- */
.loading { display: grid; place-items: center; min-height: 60vh; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--surface-3); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
.skeleton { background: var(--surface-2); border-radius: 10px; animation: pulse-bg 1.2s ease-in-out infinite; }
@keyframes pulse-bg { 50% { background: var(--surface-3); } }

.fade-in { animation: fadeIn .25s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } }

/* ---------- Print (reports → PDF) ---------- */
@media print {
  .topbar, .footer, .no-print, #toasts { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .list, .stats, .stat { break-inside: avoid; box-shadow: none; }
  .container { max-width: none; padding: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid, .auth-wrap, .dash-grid, .draw-grid, .admin-grid, .feature-grid { grid-template-columns: minmax(0, 1fr); }
  .showcase { min-height: 480px; max-width: 520px; margin: 0 auto; width: 100%; }
  .auth-side { padding: 36px 24px; }
  .auth-form { padding: 36px 24px; }
  .builder { grid-template-columns: minmax(0, 1fr); }
  .builder .preview-col { position: static; }
  .preview-body { max-height: none; }
  .manage-grid { grid-template-columns: minmax(0, 1fr); }
  .present { grid-template-columns: minmax(0, 1fr); }
  .present-side, .control-panel, .side-nav { position: static; }
  .side-nav { flex-direction: row; overflow-x: auto; }
  .side-nav button { white-space: nowrap; }
  .stage-main { grid-template-columns: minmax(0, 1fr); }
  .cs-body { grid-template-columns: minmax(0, 1fr); }
  .cs-qr { display: none; }
  .cs-reveal { grid-template-columns: minmax(0, 1fr); }
  .cs-reveal-list { display: none; }
  .stage-side { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 15px; }
  .container { padding: 0 16px; }
  .topbar .container { gap: 8px; height: 58px; }
  .brand { font-size: 19px; gap: 8px; }
  .brand-mark { width: 26px; height: 26px; }
  .nav a.navlink.hide-sm { display: none; }
  .nav a.navlink, .nav button.navlink { padding: 8px 8px; white-space: nowrap; }
  .plan-chip { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-head > .grow { flex-basis: 100%; }
  .poll-wrap { padding: 16px 12px; }
  .poll-head { padding: 22px 18px 6px; }
  .poll-body { padding: 14px 18px 22px; }
  .poll-foot { padding: 14px 18px; }
  .card-pad { padding: 18px; }
  .font-cards { grid-template-columns: repeat(2, 1fr); }
  .opt-extra { padding-left: 0; }
  .hero { padding: 32px 0 40px; }
  .showcase { min-height: 470px; }
  .showcase { min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 16px; }
  .phone, .screen, .winner-chip { position: static; }
  .phone { width: min(270px, 100%); }
  .screen { display: none; }
  .winner-chip { transform: none; }
  .rating.numbers button { min-width: 40px; height: 42px; }
  .hbar { grid-template-columns: 90px 1fr 40px; }
  .prize-row { grid-template-columns: 26px minmax(0, 1fr) 70px auto; }
  .stage-bar .keys { display: none; }
  .feature-card { padding: 22px; }
  .cand-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .add-cand { flex-direction: column; align-items: stretch; }
  .add-cand .selfie.sm { margin: 0 auto; }
  .cs-row { grid-template-columns: 40px auto minmax(0, 1fr) auto; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Questionnaire extras: sections, pages, NPS, numbers ---------- */
.q-section { padding: 6px 0 2px; border-bottom: 2px solid var(--accent-line); }
.q-section h2 { font-size: 22px; letter-spacing: -0.02em; }
.q-section p { color: var(--text-2); margin-top: 4px; font-size: 14.5px; }
.r-section { margin-top: 6px; }
.q-progress { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.q-progress-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.q-progress-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }
.q-nav { display: flex; gap: 10px; }
.q-nav .btn.block { flex: 1; }
.nps { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 5px; }
.nps button { height: 44px; border: 2px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-weight: 700; font-size: 15px; cursor: pointer; box-shadow: 0 2px 0 var(--border); }
.nps button.on.nps-low { background: var(--danger); border-color: var(--danger); color: #fff; }
.nps button.on.nps-mid { background: #bf8400; border-color: #bf8400; color: #fff; }
.nps button.on.nps-high { background: var(--success); border-color: var(--success); color: #fff; }
.nps-summary { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.nps-split { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 6px; }
.nps-split > div { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.nps-split .sw { width: 12px; height: 12px; border-radius: 4px; }
.nps-dist { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; height: 110px; align-items: end; }
.nps-dist > div { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 4px; font-size: 12px; color: var(--muted); }
.nps-dist i { display: block; width: 100%; border-radius: 4px 4px 0 0; min-height: 2px; }
.num-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.num-stats > div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; }
.num-stats b { font-size: 22px; font-weight: 800; }
@media (max-width: 600px) {
  .nps { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .num-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.cat-row > .stack { min-width: 0; }
.cat-row { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.cat-desc { color: var(--text-2); margin: -6px 2px 14px; font-size: 14.5px; }

/* ---------- Event pass card ---------- */
.pass-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.pass-card.has { border: 2px solid var(--c4); }
.pass-card.none { border: 2px dashed var(--border-strong); }
.pass-card .pass-head { display: flex; gap: 14px; align-items: flex-start; }
.pass-card .ticket-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-2); color: var(--text-2); }
.pass-card.has .ticket-ico { background: var(--c4); color: #fff; }
.pass-card h3 { font-size: 19px; display: flex; align-items: center; flex-wrap: wrap; }
.pass-window { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; background: var(--surface-2); padding: 8px 12px; border-radius: 10px; align-self: flex-start; }

/* ---------- Screen design panel ---------- */
.design-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 28px; margin-top: 18px; align-items: start; }
.design-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 8px; }
.design-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.design-preview { aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); container-type: inline-size; }
.cstage.mini { position: relative; inset: auto; width: 100%; height: 100%; grid-template-rows: auto 1fr; font-size: 10px; }
.cstage.mini .stage-top { padding: 10px 14px; gap: 10px; position: relative; min-height: 44px; }
.cstage.mini .stage-top h1 { font-size: 15px; }
.cstage.mini .stage-top .sub { font-size: 10px; margin: 0; }
.cstage.mini .stage-count { font-size: 9px; }
.cstage.mini .stage-count b { font-size: 16px; }
.cstage.mini .brand-logo.small { height: 16px; } .cstage.mini .brand-logo.medium { height: 24px; } .cstage.mini .brand-logo.large { height: 34px; }
.cstage.mini .mini-body { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px 14px; align-items: center; min-height: 0; }
.cstage.mini .mini-rows { display: flex; flex-direction: column; gap: 6px; }
.cstage.mini .cs-row { grid-template-columns: 18px auto 1fr auto; gap: 8px; padding: 5px 10px 5px 6px; border-radius: 10px; border-width: 1px; }
.cstage.mini .cs-rank { font-size: 11px; }
.cstage.mini .cs-ava .avatar { width: 24px; height: 24px; border-width: 1.5px; font-size: 10px; }
.cstage.mini .cs-who b { font-size: 11px; }
.cstage.mini .cs-track { height: 4px; margin-top: 3px; }
.cstage.mini .cs-count { font-size: 11px; }
.cstage.mini .cs-qr { margin: 0; width: 76px; padding: 6px; border-radius: 10px; gap: 4px; }
.cstage.mini .cs-qr b { font-size: 9px; }
.mini-qr { width: 60px; height: 60px; border-radius: 6px; background: repeating-conic-gradient(#1d1f3b 0 25%, #fff 0 50%) 0 0 / 12px 12px; border: 4px solid #fff; }
.preset-row { display: flex; gap: 10px; flex-wrap: wrap; }
.preset { display: flex; flex-direction: column; gap: 6px; align-items: center; background: none; border: 0; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2); padding: 0; }
.swatch-big { width: 72px; height: 44px; border-radius: 10px; border: 1px solid var(--border); display: flex; align-items: flex-end; justify-content: flex-end; padding: 6px; }
.swatch-big i { width: 14px; height: 14px; border-radius: 50%; }
.preset:hover .swatch-big { outline: 2px solid var(--text); outline-offset: 2px; }
.color-field { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; color: var(--text-2); }
.color-field input[type=color] { width: 34px; height: 34px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: none; cursor: pointer; }
.check-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
@media (max-width: 900px) { .design-layout { grid-template-columns: 1fr; } .design-side { position: static; } }

/* ---------- Minimal dashboard ---------- */
.narrow-dash { max-width: 860px; }
.section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.link-row { color: inherit; text-decoration: none !important; }
.link-row > svg { color: var(--muted); flex-shrink: 0; }
.kind-label { font-size: 12px; font-weight: 600; color: var(--text-2); width: 78px; flex-shrink: 0; }

/* ---------- Landing: motion ---------- */
.hero { position: relative; overflow: hidden; }
.hero > .container { position: relative; z-index: 1; }
.hero-glow { position: absolute; inset: 0; pointer-events: none; }
.hero-glow i { position: absolute; width: 520px; height: 520px; border-radius: 50%; filter: blur(90px); opacity: .22; animation: drift 18s ease-in-out infinite alternate; }
.hero-glow i:nth-child(1) { background: var(--c1); top: -200px; right: 8%; }
.hero-glow i:nth-child(2) { background: var(--gold); bottom: -260px; right: 30%; animation-delay: -6s; opacity: .26; }
.hero-glow i:nth-child(3) { background: var(--c2); top: 20%; left: -260px; animation-delay: -12s; opacity: .14; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.12); } }

.hero-copy > * { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.hero-copy > :nth-child(2) { animation-delay: .08s; }
.hero-copy > :nth-child(3) { animation-delay: .16s; }
.hero-copy > :nth-child(4) { animation-delay: .24s; }
.hero-copy > :nth-child(5) { animation-delay: .32s; }
.hero h1 .hl::after { transform-origin: left; animation: sweep .8s .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes sweep { from { transform: scaleX(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.showcase .phone { animation: rise .8s .2s cubic-bezier(.2, .8, .2, 1) both, bob 6s 1s ease-in-out infinite; }
.showcase .screen { animation: rise .8s .35s cubic-bezier(.2, .8, .2, 1) both; overflow: hidden; }
.showcase .winner-chip { animation: rise .8s .5s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.phone-opt { position: relative; overflow: hidden; transition: border-color .25s, background .25s; }
.phone-opt .tap { position: absolute; left: 22px; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: var(--tile); opacity: .35; animation: tap .6s ease-out forwards; }
@keyframes tap { to { transform: scale(9); opacity: 0; } }
.phone-btn { transition: transform .12s, filter .12s; box-shadow: none; }
.phone-btn.press { transform: scale(.95); filter: brightness(.92); }
.screen-bar .tr i { transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.screen-bar b { transition: color .3s; }
.vote-pop { position: absolute; right: 64px; font-weight: 800; color: var(--tile); font-size: 15px; animation: votepop 1.1s ease-out forwards; pointer-events: none; }
@keyframes votepop { from { opacity: 0; transform: translateY(6px) scale(.6); } 20% { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-26px); } }
.winner-chip .roll { min-width: 130px; }
.winner-chip.rolling .roll { opacity: .55; filter: blur(.4px); }
.winner-chip.landed { animation: chipland .6s cubic-bezier(.2, 1.5, .3, 1); }
@keyframes chipland { 40% { transform: rotate(-2deg) scale(1.1); } }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.2, .8, .2, 1) var(--d, 0ms), transform .7s cubic-bezier(.2, .8, .2, 1) var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
.feature-card { transition: opacity .7s cubic-bezier(.2, .8, .2, 1) var(--d, 0ms), transform .7s cubic-bezier(.2, .8, .2, 1) var(--d, 0ms), border-color .2s; }
.feature-card.in:hover { transform: translateY(-4px); border-color: var(--tile); transition-delay: 0ms; }
.feature-card .ico { transition: transform .3s cubic-bezier(.2, 1.5, .3, 1); }
.feature-card:hover .ico { transform: rotate(-8deg) scale(1.08); }
.template.reveal.in:hover { transform: translateY(-3px); transition-delay: 0ms; }

/* Occasions strip */
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-set { display: flex; gap: 40px; padding: 18px 20px; color: var(--text-2); font-weight: 600; font-size: 15px; white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Big-screen showcase */
.stage-show { padding: 88px 0 40px; }
.stage-show .head, .how .head { text-align: center; max-width: 660px; margin: 0 auto 32px; }
.stage-show h2, .how h2 { font-size: clamp(30px, 3.6vw, 44px); letter-spacing: -0.03em; margin: 8px 0 12px; }
.stage-show .head p { color: var(--text-2); font-size: 17px; }
.ls-frame { max-width: 1040px; margin: 0 auto; }
.ls-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; }
.ls-tab { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 8px; padding: 9px 18px; font-weight: 600; font-size: 14.5px; cursor: pointer; }
.ls-tab.on { color: var(--text); border-color: var(--text); }
.ls-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.ls-progress i { display: block; height: 100%; width: 0; background: var(--accent); }
.ls-screen { position: relative; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden; color: #fff; display: grid; grid-template-rows: auto 1fr;
  background: radial-gradient(120% 80% at 80% 0%, #2a2f6b 0%, transparent 60%), radial-gradient(80% 60% at 0% 100%, #4a1d3f 0%, transparent 60%), #12142a;
  box-shadow: 0 30px 80px -30px rgba(18, 20, 42, .55); border: 10px solid #1d1f3b; }
.ls-top { display: flex; justify-content: space-between; align-items: center; padding: 18px 28px; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 14px; color: rgba(255,255,255,.65); }
.ls-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 16px; }
.ls-brand i { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, var(--c1), var(--gold)); }
.ls-count b { color: #fff; font-size: 20px; }
.ls-main { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 24px; padding: 22px 28px 26px; min-height: 0; }
.ls-body { position: relative; min-height: 0; display: flex; }
.ls-scene { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; min-width: 0; }
.ls-scene.enter { animation: rise .5s cubic-bezier(.2, .8, .2, 1); }
.ls-q { font-size: clamp(18px, 2.4vw, 28px); font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: center; gap: 12px; }
.ls-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(17, 158, 114, .2); color: #4fe0ae; letter-spacing: 0; }
.ls-live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse-dot 1.4s infinite; }
.ls-bars { display: flex; flex-direction: column; gap: 12px; }
.ls-bar { display: grid; grid-template-columns: 32px 1fr 52px; gap: 14px; align-items: center; }
.ls-letter { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; }
.ls-bar-body span { font-size: 14px; color: rgba(255,255,255,.75); }
.ls-track { height: 12px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 5px; }
.ls-track i { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.ls-bar > b { font-size: 20px; text-align: right; font-variant-numeric: tabular-nums; }
.ls-rows { display: flex; flex-direction: column; gap: 8px; }
.ls-row { position: relative; display: grid; grid-template-columns: 28px 38px 1fr 44px; gap: 12px; align-items: center; padding: 7px 14px 7px 10px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.ls-row.lead { border-color: var(--gold); background: linear-gradient(90deg, rgba(255,194,26,.16), rgba(255,255,255,.04) 60%); }
.ls-rank { text-align: center; font-weight: 800; color: rgba(255,255,255,.55); }
.ls-ava { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; border: 2px solid rgba(255,255,255,.2); }
.ls-who span { font-weight: 700; font-size: 15px; display: flex; gap: 8px; align-items: baseline; }
.ls-who em { font-style: normal; font-weight: 500; font-size: 12px; color: rgba(255,255,255,.5); }
.ls-who .ls-track { height: 6px; margin-top: 4px; }
.ls-row .ls-count { font-size: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.ls-pop { position: absolute; right: 60px; top: 50%; font-size: 20px; animation: emoji 0.9s ease-out forwards; pointer-events: none; }
@keyframes emoji { from { opacity: 0; transform: translateY(-50%) scale(.4); } 25% { opacity: 1; transform: translateY(-80%) scale(1.15); } to { opacity: 0; transform: translateY(-260%) scale(.9); } }
.ls-draw { align-items: flex-start; }
.ls-prize { display: inline-flex; align-items: center; gap: 10px; color: var(--gold); font-weight: 700; font-size: clamp(14px, 1.6vw, 19px); }
.ls-name { font-size: clamp(40px, 7vw, 86px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.ls-name.rolling { color: rgba(255,255,255,.45); }
.ls-name.landed { color: #fff; animation: land .5s cubic-bezier(.2, 1.4, .3, 1); }
.ls-name.landed::after { content: ""; display: block; height: 8px; width: 60%; margin-top: 14px; border-radius: 999px; background: var(--gold); animation: sweep .6s .1s cubic-bezier(.2, .8, .2, 1) both; transform-origin: left; }
.ls-detail { color: rgba(255,255,255,.6); font-size: clamp(14px, 1.6vw, 20px); }
.ls-qr { align-self: end; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); border-radius: 16px; padding: 12px; text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.ls-qr-code { width: 100%; aspect-ratio: 1; border-radius: 10px; border: 7px solid #fff; background: #fff repeating-conic-gradient(#1d1f3b 0 25%, #fff 0 50%) 0 0 / 14px 14px; }
.ls-qr b { font-size: 14px; }
.ls-qr span { font-size: 11px; color: rgba(255,255,255,.55); }
.l-confetti { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.l-confetti i { position: absolute; top: 45%; width: 9px; height: 14px; border-radius: 2px; animation: lconf 1.6s cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes lconf { from { transform: translate(0, 0) rotate(0); opacity: 1; } 70% { opacity: 1; } to { transform: translate(var(--dx), calc(var(--dy) + 160px)) rotate(var(--r)); opacity: 0; } }

/* How it works */
.how { padding: 72px 0 24px; }
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; counter-reset: s; }
.how-steps li { position: relative; padding: 26px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); }
.how-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--text); color: var(--bg); margin-bottom: 16px; }
.how-n { position: absolute; top: 22px; right: 24px; font-size: 40px; font-weight: 800; letter-spacing: -0.04em; color: var(--surface-2); line-height: 1; }
.how-steps h3 { font-size: 20px; margin-bottom: 6px; letter-spacing: -0.02em; }
.how-steps p { color: var(--text-2); font-size: 15px; }

/* Closing band */
.final-cta { padding: 40px 0 88px; }
.final-cta .container { text-align: center; padding: 64px 24px; border-radius: 16px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(120deg, #1d1f3b, #3a1d5c, #1d1f3b); background-size: 200% 200%; animation: shift 12s ease-in-out infinite alternate; }
.final-cta .container.reveal { transition-property: opacity, transform; }
.final-cta h2 { font-size: clamp(28px, 3.6vw, 46px); letter-spacing: -0.03em; max-width: 720px; margin: 0 auto 12px; }
.final-cta p { color: rgba(255,255,255,.7); font-size: 17px; margin-bottom: 26px; }
@keyframes shift { to { background-position: 100% 50%; } }

@media (max-width: 760px) {
  .how-steps { grid-template-columns: 1fr; }
  .ls-screen { aspect-ratio: auto; min-height: 440px; border-width: 6px; }
  .ls-main { grid-template-columns: 1fr; padding: 16px; }
  .ls-qr { display: none; }
  .ls-top { padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
}

/* Environment badge (dev / uat / local) */
.env-badge { font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 3px 8px; border-radius: 6px; margin-left: 10px; color: #fff; background: #6b7a2a; }
.env-badge.env-uat { background: #bf8400; }
.env-badge.env-dev { background: #2f6fe8; }
.env-badge.env-local { background: #777a92; }

/* ---------- Responsive fixes (from the device test suite) ---------- */
/* Touch-friendly links: footer, back links and small text links get a real tap area. */
.footer-col a { display: inline-block; padding: 3px 0; }
.footer-bottom span { line-height: 1.8; }
a.small:not(.btn), .page-head a:not(.btn), .back-link { display: inline-block; padding-block: 3px; }
.list-row a.t { padding-block: 2px; }
.link-button, button.link { padding-block: 4px; min-height: 28px; }
@media (max-width: 420px) {
  .topbar .container { gap: 6px; padding: 0 12px; }
  .brand { font-size: 18px; }
  .nav { gap: 0; }
  .nav a.navlink, .nav button.navlink { padding: 8px 7px; }
  .plan-chip { max-width: 84px; padding: 5px 8px; }
  .env-badge { margin-left: 4px; padding: 2px 5px; }
}
@media (max-width: 600px) {
  .section-title { white-space: normal; }
  .page-head h1 { overflow-wrap: anywhere; }
  /* Lucky-draw prizes: name on its own line, quantity + actions below. */
  .prize-row { grid-template-columns: 30px minmax(0, 1fr) 70px; grid-auto-rows: auto; }
  .prize-row > :last-child { grid-column: 2 / -1; justify-self: end; }
  /* Contest categories stack their fields. */
}
/* Grid and flex children may shrink; long links and names wrap instead of widening the page. */
.draw-grid > *, .dash-grid > *, .manage-grid > *, .builder > *, .hero-grid > *, .cand-admin > * { min-width: 0; }
.mono, .tiny.mono, .share-url, .link-box { overflow-wrap: anywhere; }
.demo-creds button { min-height: 32px; padding: 6px 0; text-align: left; display: block; box-sizing: border-box; }
/* Headings keep their natural width; the controls beside them wrap instead. */
.row > h1.grow, .row > h2.grow, .row > h3.grow { flex: 1 0 auto; max-width: 100%; }
.builder-head > .grow, .page-head > .grow { min-width: min(100%, 220px); }
@media (max-width: 600px) {
  /* Stat tiles two per row instead of one tall column. */
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat .v { font-size: 26px; }
  /* Forms first on sign-in pages: the welcome panel shrinks to a header. */
  .auth-side { padding: 22px 16px !important; }
  .auth-side .tiles { display: none; }
  .auth-side h1, .auth-side h2 { font-size: 24px !important; }
  .auth-side p, .auth-side ul { display: none; }
  /* Contestant photo picker */
  .selfie { max-width: 180px; }
}
/* Inline validation */
.field-error { color: var(--danger); font-size: 13px; font-weight: 500; min-height: 0; }
.field-error:empty { display: none; }
.field-hint { color: var(--muted); font-size: 12.5px; }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 18%, transparent); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 13px; font-weight: 600; color: var(--text-2); padding: 6px 8px; min-height: 30px; cursor: pointer; border-radius: 6px; }
.pw-toggle:hover { background: var(--surface-2); }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.strength i { height: 4px; border-radius: 2px; background: var(--surface-3, #e3dfd5); }
.strength[data-score="1"] i:nth-child(-n+1) { background: var(--danger); }
.strength[data-score="2"] i:nth-child(-n+2) { background: var(--warning); }
.strength[data-score="3"] i:nth-child(-n+3) { background: var(--c4); }
.strength[data-score="4"] i { background: var(--c4); }
.strength-label { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.email-suggest { font-size: 13px; color: var(--text-2); }
.email-suggest button { border: 0; background: none; color: var(--accent-text); font-weight: 600; cursor: pointer; padding: 2px 0; text-decoration: underline; }

/* Testimonials */
.quotes .head { margin-bottom: 22px; }
.quote-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.quote-card { margin: 0; position: relative; display: flex; flex-direction: column; gap: 18px; padding: 26px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.quote-card blockquote { margin: 0; font-size: 17px; line-height: 1.55; color: var(--text); flex: 1; }
.quote-card blockquote::before { content: "\201C"; display: block; font-size: 54px; line-height: .6; font-weight: 800; color: var(--accent); margin-bottom: 10px; font-family: Georgia, serif; }
.quote-card figcaption { display: flex; align-items: center; gap: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.quote-card figcaption b { display: block; font-size: 15px; }
.quote-card figcaption span span { font-size: 13px; color: var(--muted); }
.quote-ava { width: 40px; height: 40px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; flex-shrink: 0; }
.sample-tag { position: absolute; top: 14px; right: 14px; }
.quote-card.moment h3 { font-size: 19px; letter-spacing: -0.02em; }
.quote-card.moment p { color: var(--text-2); }
.moment-ico { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
@media (max-width: 900px) {
  /* Swipe through the cards on phones and tablets. */
  .quote-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(280px, 82%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; }
  .quote-card { scroll-snap-align: start; }
}
