:root {
  color-scheme: dark;
  --bg: #0b0b12;
  --panel: #151522;
  --line: #2a2a3d;
  --text: #f4f3fb;
  --muted: #9a98b3;
  --hot: linear-gradient(100deg, #ff4d8d, #ff8a3d 55%, #ffd23d);
  --radius: 18px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
a { color: inherit; }
code, pre { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.eyebrow { margin: 0 0 12px; font-weight: 700; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.hint { color: var(--muted); font-size: 14px; margin: 8px 0 20px; }
.error { color: #ff6b8b; margin: 0; }
.error:empty { display: none; }

/* ── landing ───────────────────────────── */
.landing main { width: min(980px, 100% - 40px); margin: 0 auto; padding: 12vh 0 80px; position: relative; }
.hero h1 { font-size: clamp(44px, 8vw, 92px); line-height: 0.95; font-weight: 850; }
.hero em { font-style: normal; background: var(--hot); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { max-width: 580px; font-size: 19px; line-height: 1.5; color: var(--muted); margin: 24px 0 48px; }
.card { background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
form.card { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
form.card > label { flex: 1 1 200px; }
form.card > label:first-child { flex: 2 1 280px; }
#palette-field, #exclude-field { flex: 3 1 360px; }
#palette, #exclude { font-size: 20px; letter-spacing: 0.08em; }
.mode { border: 0; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.mode legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 6px; }
.mode label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; cursor: pointer; }
.mode label:has(:checked) { border-color: #ff8a3d; background: #ff8a3d1a; }
.mode input { accent-color: #ff8a3d; margin: 0; }
.emoji-rule { margin: 6px 0 0; font-size: 18px; }
form.card .error { flex-basis: 100%; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
input, select { font: inherit; font-size: 16px; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; min-width: 0; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid #ff8a3d; outline-offset: 2px; }
button, .actions a, .field a { font: inherit; font-weight: 650; font-size: 14px; color: var(--text); background: #232336;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.primary { background: var(--hot) !important; color: #1a0a12 !important; border: 0 !important; padding: 12px 20px !important; }
[data-copied]::after { content: " ✓"; }

.result { margin-top: 28px; display: grid; grid-template-columns: 300px 1fr; gap: 32px; scroll-margin-top: 20px; }
@media (max-width: 820px) { .result { grid-template-columns: 1fr; } }
.qr-col { display: grid; gap: 12px; justify-items: center; align-content: start; }
.qr { background: #fff; border-radius: 16px; padding: 10px; width: 100%; aspect-ratio: 1; }
.qr svg { display: block; width: 100%; height: 100%; }
.subtle { color: var(--muted); font-size: 14px; }
.details h2 { font-size: 30px; }
.details h3 { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 28px 0 12px; }
.field { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; margin-bottom: 14px; }
.field > span { grid-column: 1 / -1; font-size: 13px; font-weight: 600; color: var(--muted); }
.field code, .field pre { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  margin: 0; overflow-x: auto; white-space: nowrap; min-width: 0; }
.field pre { white-space: pre; }
.actions, .row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.row label { flex: 1; }
.recent { margin-top: 40px; }
.recent h3 { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.recent ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.recent li { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.recent button { background: none; border: 0; padding: 6px 0; text-align: left; }
.recent button:hover { text-decoration: underline; }
.recent time { color: var(--muted); font-size: 13px; }

/* ── audience ──────────────────────────── */
.audience { display: grid; grid-template-rows: auto 1fr auto auto; height: 100dvh; overflow: hidden;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.audience header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 4px 16px; }
.audience h1 { font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 99px; background: #232336; color: var(--muted); flex: none; }
.status[data-status="open"] { color: #7dffb0; }
.status[data-status="open"]::before { content: "● "; }
.pad { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 12px; align-content: center; }
.pad button { font-size: clamp(36px, 10vw, 64px); aspect-ratio: 1; padding: 0; border-radius: 24px; background: var(--panel);
  border: 1px solid var(--line); font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.pad button:active { background: #232336; }
.any { padding-top: 14px; }
.any input { width: 100%; text-align: center; font-size: 20px; border-radius: 16px; padding: 14px; }
.audience footer { text-align: center; color: var(--muted); font-size: 13px; padding-top: 12px; }

/* ── display overlay (OBS) ─────────────── */
html:has(.display), .display { background: transparent; color-scheme: normal; }

/* ── QR slide ──────────────────────────── */
.qr-slide { display: grid; place-items: center; height: 100dvh; overflow: hidden;
  background: radial-gradient(80vw 60vh at 85% 110%, #ff4d8d33, transparent), var(--bg); }
.qr-slide main { display: flex; align-items: center; gap: 6vw; padding: 5vw; }
.qr-slide .qr { width: min(42vw, 72vh); border-radius: 2vw; padding: 1.5vw; }
.qr-slide .eyebrow { font-size: 1.6vw; }
.qr-slide h1 { font-size: 5vw; line-height: 1; font-weight: 850; max-width: 40vw; }
.qr-slide .palette { font-size: 3.4vw; margin: 3vw 0; letter-spacing: 0.1em; }
.qr-slide .link { font: 1.2vw/1.4 ui-monospace, Menlo, monospace; color: var(--muted); word-break: break-all; max-width: 40vw; }
@media (orientation: portrait) { .qr-slide main { flex-direction: column; text-align: center; }
  .qr-slide .qr { width: 70vw; } .qr-slide h1, .qr-slide .link { max-width: none; } }
.qr-slide live-reactions { z-index: 0; }
.qr-slide main { position: relative; z-index: 1; }
.field code, .field pre { scrollbar-width: thin; }
