/* Fair Spinner Wheel — styles */
@font-face {
  font-family: "Bricolage";
  src: url("fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --surface-2: #ece7dc;
  --ink: #18161f;
  --ink-2: #625d6e;
  --ink-3: #8e889a;
  --line: #e0d9cb;
  --accent: #f2542d;
  --accent-ink: #ffffff;
  --link: #3346d3;
  --danger: #c8283d;
  --focus: #3346d3;
  --wheel-track: #fffdf8;
  --radius: 24px;
  --radius-sm: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Bricolage", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --max: 1200px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131218; --surface: #1c1a23; --surface-2: #26232f; --ink: #f3f0f7; --ink-2: #aaa4b6; --ink-3: #7b7588;
    --line: #2f2c39; --accent: #ff6b45; --link: #9aa6ff; --danger: #ff6b7d; --focus: #9aa6ff; --wheel-track: #1c1a23;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131218; --surface: #1c1a23; --surface-2: #26232f; --ink: #f3f0f7; --ink-2: #aaa4b6; --ink-3: #7b7588;
  --line: #2f2c39; --accent: #ff6b45; --link: #9aa6ff; --danger: #ff6b7d; --focus: #9aa6ff; --wheel-track: #1c1a23;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--font); min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -48px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 12px; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
kbd { font: 600 .78em var(--font); padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink-2); }
code { font: .88em var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
[hidden] { display: none !important; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(18px, env(safe-area-inset-top)) 24px 10px; max-width: var(--max); margin: 0 auto;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 28px; height: 28px; }
.brand-name { font: 700 1.2rem/1 var(--display); letter-spacing: -.025em; }
.topbar-actions { display: flex; gap: 2px; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  border: 0; background: transparent; color: var(--ink-2); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg .fill { fill: currentColor; stroke: none; }

/* ---------- Layout ---------- */
.layout {
  display: grid; gap: 28px; padding: 8px 24px 40px; max-width: var(--max); margin: 0 auto;
  grid-template-columns: 1fr;
}
@media (min-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr) 400px; gap: 48px; align-items: start; padding-top: 16px; }
  .panel { position: sticky; top: 20px; max-height: calc(100dvh - 40px); }
}

/* ---------- Stage ---------- */
.stage { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.stage-head { width: 100%; text-align: center; }
.page-h1 { margin: 0 0 4px; font: 600 .8rem/1.3 var(--font); letter-spacing: .02em; color: var(--ink-3); }
.wheel-title {
  width: 100%; max-width: 640px; text-align: center; border: 0; background: transparent; padding: 4px 10px; border-radius: 12px;
  font: 700 clamp(1.6rem, 4.2vw, 2.6rem)/1.15 var(--display); letter-spacing: -.035em; color: var(--ink);
}
.wheel-title:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.wheel-title:focus { background: var(--surface); outline: none; box-shadow: 0 0 0 1px var(--line); }
.wheel-title::placeholder { color: var(--ink-3); }
.wheel-wrap {
  position: relative; width: min(100%, 600px); aspect-ratio: 1; margin: 22px auto 8px;
  touch-action: manipulation;
}
.wheel-wrap canvas { width: 100%; height: 100%; display: block; border-radius: 50%; }
#wheel { cursor: pointer; }
.pointer {
  position: absolute; left: 50%; top: -14px; width: 30px; height: 40px; transform: translateX(-50%);
  transform-origin: 50% 25%; pointer-events: none; z-index: 2;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.18));
}
.pointer::before {
  content: ""; position: absolute; inset: 0; background: var(--ink);
  clip-path: path("M15 40 L3 13 A13 13 0 1 1 27 13 Z");
}
.pointer::after {
  content: ""; position: absolute; left: 10px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
}
.pointer.tick { animation: tick .12s ease-out; }
@keyframes tick { 40% { transform: translateX(-50%) rotate(-16deg); } }
.hub {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 20%; aspect-ratio: 1; border-radius: 50%; border: 0;
  background: var(--ink); color: var(--bg); font: 700 clamp(.95rem, 2.4vw, 1.2rem)/1 var(--display);
  letter-spacing: -.01em; box-shadow: 0 0 0 6px var(--wheel-track), 0 6px 20px rgba(0,0,0,.18);
  transition: transform .15s, background .2s;
}
.hub:hover { transform: translate(-50%, -50%) scale(1.04); background: var(--accent); color: #fff; }
.hub:active { transform: translate(-50%, -50%) scale(.97); }
.hub[disabled] { cursor: progress; background: var(--ink); color: var(--bg); transform: translate(-50%, -50%); }
.hint { margin: 10px 0 0; color: var(--ink-3); font-size: .875rem; text-align: center; }
.fair-link {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; padding: 8px 16px 8px 12px;
  border-radius: 99px; background: var(--surface); box-shadow: 0 0 0 1px var(--line) inset;
  color: var(--ink-2); text-decoration: none; font-size: .9rem; text-align: left;
  transition: box-shadow .15s, color .15s;
}
.fair-link svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fair-link u { color: var(--ink); text-decoration: none; font-weight: 600; }
.fair-link:hover { box-shadow: 0 0 0 1px var(--ink) inset; color: var(--ink); }

/* Full screen */
.stage:fullscreen { justify-content: center; background: var(--bg); }
.stage:fullscreen .wheel-wrap { width: min(90vw, 80vh); }
.stage.pseudo-full { position: fixed; inset: 0; z-index: 40; justify-content: center; background: var(--bg); padding: 16px; }
.stage.pseudo-full .wheel-wrap { width: min(90vw, 76dvh); }
.stage:fullscreen .fair-link, .stage.pseudo-full .fair-link { display: none; }

/* ---------- Panel ---------- */
.panel {
  background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line);
  display: flex; flex-direction: column; overflow: hidden; min-height: 440px; min-width: 0;
}
.tabs {
  flex: none; display: flex; gap: 22px; padding: 0 24px; border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs [role="tab"] {
  flex: none; white-space: nowrap; border: 0; background: transparent; padding: 18px 0 14px;
  font-weight: 600; font-size: .95rem; color: var(--ink-3); position: relative;
  display: inline-flex; align-items: center; gap: 6px;
}
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); border-radius: 2px;
}
.count { font-size: .78rem; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tabpanel { padding: 20px 24px 24px; overflow-y: auto; flex: 1; }

/* Inputs + buttons */
.add-row { display: flex; gap: 6px; padding: 5px; border-radius: 99px; background: var(--bg); box-shadow: 0 0 0 1px var(--line) inset; }
.add-row:focus-within { box-shadow: 0 0 0 1.5px var(--ink) inset; }
.add-row input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 8px 6px 8px 14px; outline: none; }
.add-row input::placeholder { color: var(--ink-3); }
.bulk textarea, .range-form input, .teams-controls input, .draw-form input, .draw-form textarea, .draw-form select {
  border: 0; box-shadow: 0 0 0 1px var(--line) inset; background: var(--bg); border-radius: var(--radius-sm);
  padding: 11px 14px; min-width: 0; width: 100%;
}
.bulk textarea:focus, .range-form input:focus, .teams-controls input:focus, .draw-form input:focus, .draw-form textarea:focus, .draw-form select:focus {
  outline: none; box-shadow: 0 0 0 1.5px var(--ink) inset;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; box-shadow: 0 0 0 1px var(--line) inset; background: transparent; color: var(--ink);
  padding: 10px 20px; border-radius: 99px; font-weight: 600; font-size: .95rem; line-height: 1.3;
  transition: background .15s, box-shadow .15s, transform .1s;
}
.btn:hover { box-shadow: 0 0 0 1px var(--ink) inset; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); color: var(--bg); box-shadow: none; }
.btn.primary:hover { background: var(--accent); color: #fff; }
.add-row .btn { padding: 8px 18px; }
a.btn { text-decoration: none; }
.btn.big { padding: 14px 26px; font-size: 1.05rem; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; margin: 12px 0 10px; }
.chip {
  border: 0; background: transparent; border-radius: 99px; padding: 6px 12px; font-size: .875rem; font-weight: 500; color: var(--ink-2);
  transition: background .15s, color .15s;
}
.chip:hover { background: var(--surface-2); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.chip.danger { color: var(--danger); }
.toolbar > .chip:first-child { margin-left: -12px; }
.link-btn { border: 0; background: none; padding: 4px 0; color: var(--link); font-size: .875rem; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }

/* More menu */
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); margin-left: 4px; }
.menu[open] summary { background: var(--surface-2); color: var(--ink); }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 200px; padding: 6px;
  background: var(--surface); border-radius: 16px; box-shadow: 0 0 0 1px var(--line), 0 12px 32px rgba(0,0,0,.12);
  display: grid;
}
.menu-pop button { text-align: left; border: 0; background: transparent; padding: 9px 12px; border-radius: 10px; font-size: .9rem; }
.menu-pop button:hover { background: var(--surface-2); }
.menu-pop .danger { color: var(--danger); }

/* ---------- Entries ---------- */
.entries { list-style: none; margin: 0 -10px; padding: 0; display: grid; gap: 0; }
.entry {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 4px; align-items: center;
  padding: 2px 4px 2px 10px; border-radius: 12px; min-height: 44px;
}
.entry:hover, .entry:focus-within { background: var(--bg); }
.entry input[type="text"] {
  width: 100%; border: 0; background: transparent; padding: 8px 6px; border-radius: 8px; outline: none;
}
.entry input[type="text"]:focus { background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.entry.off input[type="text"] { color: var(--ink-3); text-decoration: line-through; }
.entry.off .dot { opacity: .35; }
.dot {
  --c: var(--ink-3);
  width: 14px; height: 14px; border-radius: 50%; background: var(--c); position: relative; overflow: hidden; cursor: pointer; margin: 0 4px 0 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08) inset; transition: transform .15s;
}
.dot:hover { transform: scale(1.25); }
.dot input { position: absolute; inset: -10px; width: 40px; height: 40px; opacity: 0; cursor: pointer; }
.w { display: none; align-items: center; gap: 2px; color: var(--ink-3); font-size: .8rem; }
.w input {
  width: 46px; border: 0; background: var(--surface-2); border-radius: 8px; padding: 5px 4px; text-align: center; font-size: .85rem;
  -moz-appearance: textfield;
}
.w input::-webkit-inner-spin-button, .w input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.entries.advanced .w, .entry.weighted .w { display: inline-flex; }
.ic {
  width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 8px;
  color: var(--ink-3); opacity: 0; transition: opacity .12s, background .12s, color .12s;
}
.ic svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.entry:hover .ic, .entry:focus-within .ic, .entry.off .ic[data-f="on"] { opacity: 1; }
.ic:hover { background: var(--surface-2); color: var(--ink); }
.ic.del:hover { color: var(--danger); }
@media (hover: none) { .ic { opacity: 1; } }
.empty { color: var(--ink-3); text-align: center; padding: 32px 8px; list-style: none; }
.entries .row-end { padding: 6px 10px 0; justify-content: flex-start; }

.bulk textarea { resize: vertical; font: .9rem/1.6 var(--mono); }
.row-end { display: flex; justify-content: flex-end; margin-top: 10px; }
.field-label { display: block; font-weight: 600; margin-bottom: 8px; font-size: .95rem; }

.presets { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; }
.presets summary { cursor: pointer; font-weight: 600; font-size: .95rem; padding: 4px 0; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.presets summary::-webkit-details-marker { display: none; }
.presets summary::after { content: "+"; font: 400 1.3rem/1 var(--font); color: var(--ink-3); }
.presets[open] summary::after { content: "−"; }
.preset-grid { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 18px; }
.preset {
  border: 0; box-shadow: 0 0 0 1px var(--line) inset; background: transparent; border-radius: 99px; padding: 7px 14px;
  font-size: .875rem; text-align: left; transition: box-shadow .15s;
}
.preset:hover { box-shadow: 0 0 0 1px var(--ink) inset; }
.preset b { font-weight: 600; }
.preset span { display: none; }
.range-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.range-form .field-label { width: 100%; margin: 0; font-size: .875rem; color: var(--ink-2); font-weight: 500; }
.range-form label { display: grid; font-size: .8rem; color: var(--ink-3); gap: 4px; }
.range-form input { width: 92px; padding: 9px 12px; }

/* ---------- Results ---------- */
.sub { font: 600 .75rem/1.3 var(--font); text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3); margin: 22px 0 10px; }
.tabpanel .sub:first-of-type { margin-top: 8px; }
.tally { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tally li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: .925rem; }
.tally .bar { grid-column: 1 / -1; height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.tally .bar i { display: block; height: 100%; background: var(--ink); border-radius: inherit; }
.tally .name, .history .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history { margin: 0; padding: 0; list-style: none; display: grid; }
.history li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.history li:last-child { border-bottom: 0; }
.history time { color: var(--ink-3); font-size: .8rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Saved ---------- */
.saved { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.saved li { display: flex; align-items: center; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.saved li:last-child { border-bottom: 0; }
.saved .meta { flex: 1; min-width: 0; }
.saved .meta b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved .meta span { font-size: .8rem; color: var(--ink-3); }
.saved .chip { flex: none; }

/* ---------- Settings ---------- */
.field { margin: 0 0 24px; border: 0; padding: 0; }
.field input[type="range"] { width: 100%; accent-color: var(--ink); }
.field output { float: right; color: var(--ink-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.radio { display: flex; gap: 10px; align-items: center; padding: 6px 0; font-size: .95rem; }
.radio input { accent-color: var(--ink); width: 18px; height: 18px; margin: 0; }
.switch { display: flex; align-items: center; justify-content: space-between; flex-direction: row-reverse; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: .95rem; }
.switch span { flex: 1; }
.switch input { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: 99px; background: var(--line); position: relative; transition: background .2s; flex: none; margin: 0; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked { background: var(--ink); }
.switch input:checked::after { transform: translateX(16px); background: var(--bg); }
.palettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.palette { border: 0; box-shadow: 0 0 0 1px var(--line) inset; background: transparent; border-radius: 14px; padding: 10px 12px; text-align: left; }
.palette:hover { box-shadow: 0 0 0 1px var(--ink-3) inset; }
.palette[aria-checked="true"] { box-shadow: 0 0 0 2px var(--ink) inset; }
.palette .dots { display: flex; margin-bottom: 6px; }
.palette .dots i { width: 16px; height: 16px; border-radius: 50%; margin-right: -3px; box-shadow: 0 0 0 2px var(--surface); }
.palette span { font-size: .85rem; font-weight: 500; }

/* ---------- About / landing content ---------- */
.about { max-width: var(--max); margin: 40px auto 0; padding: 56px 24px 24px; border-top: 1px solid var(--line); }
.about h2 { font: 700 clamp(1.6rem, 3.4vw, 2.3rem)/1.15 var(--display); letter-spacing: -.035em; margin: 72px 0 20px; max-width: 24ch; }
.about > h2:first-child { margin-top: 0; }
.about .lead { font-size: 1.15rem; line-height: 1.6; color: var(--ink-2); max-width: 62ch; margin: 0 0 40px; }
.about-grid { display: grid; gap: 32px 40px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); counter-reset: f; }
.about article { counter-increment: f; border-top: 2px solid var(--ink); padding-top: 16px; }
.about article::before { content: counter(f, decimal-leading-zero); display: block; font: 600 .78rem/1 var(--font); color: var(--accent); letter-spacing: .06em; margin-bottom: 14px; }
.about h3 { margin: 0 0 8px; font: 650 1.1rem/1.3 var(--display); letter-spacing: -.015em; }
.about p { margin: 0; color: var(--ink-2); }
.about .sub { margin: 56px 0 14px; }
.about p a, .faq a { color: var(--link); }
.steps { color: var(--ink-2); max-width: 70ch; padding: 0; margin: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; }
.steps li::before { content: counter(s); font: 650 .95rem/1.6 var(--display); color: var(--ink); }
.entry-cloud { color: var(--ink-2); line-height: 1.9; max-width: 90ch; font-size: .95rem; margin: 0; }

.faq { border-bottom: 1px solid var(--line); max-width: 820px; }
.about h2 + .faq { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; padding: 18px 40px 18px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font: 300 1.6rem/1 var(--font); color: var(--ink-3); transition: transform .2s; }
.faq[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq p { margin: -4px 0 20px; color: var(--ink-2); max-width: 70ch; }

.gear { margin-top: 8px; }
.gear-grid { display: grid; gap: 0 40px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.gear-card { display: grid; gap: 2px; padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.gear-card b { font-weight: 600; }
.gear-card:hover b { text-decoration: underline; text-underline-offset: .18em; }
.gear-card span { color: var(--ink-2); font-size: .925rem; }
.gear-card em { font-style: normal; color: var(--accent); font-weight: 600; font-size: .875rem; margin-top: 4px; }
.gear p { margin-top: 14px; }

.tool-links { columns: 3 220px; column-gap: 40px; }
.tool-links a { display: block; break-inside: avoid; padding: 7px 0; color: var(--ink); text-decoration: none; font-size: .95rem; }
.tool-links a:hover { color: var(--accent); }
.tool-links a[aria-current="page"] { color: var(--ink-3); }

/* ---------- Footer ---------- */
.footer {
  display: grid; gap: 28px 40px; grid-template-columns: 1.2fr 1fr 1fr; max-width: var(--max); margin: 72px auto 0;
  padding: 40px 24px max(40px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: .9rem;
}
.footer > div strong { font: 700 1.1rem/1.2 var(--display); letter-spacing: -.02em; display: block; margin-bottom: 4px; }
.footer > div .muted { color: var(--ink-3); }
.footer nav { display: grid; gap: 8px; align-content: start; }
.footer a { color: var(--ink-2); text-decoration: none; }
.footer a:hover { color: var(--ink); }
@media (max-width: 720px) { .footer { grid-template-columns: 1fr 1fr; } .footer > div { grid-column: 1 / -1; } }

/* ---------- Dialogs ---------- */
.dialog {
  border: 0; border-radius: 28px; padding: 36px 32px 28px; width: min(92vw, 460px); background: var(--surface); color: var(--ink);
  box-shadow: 0 24px 80px rgba(0,0,0,.28); text-align: center;
}
.dialog.wide { width: min(94vw, 720px); text-align: left; }
.dialog::backdrop { background: rgba(19, 18, 24, .5); backdrop-filter: blur(4px); }
.dialog[open] { animation: pop .3s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes pop { from { transform: translateY(8px) scale(.96); opacity: 0; } }
.dialog-kicker { margin: 0; color: var(--ink-3); font-weight: 600; font-size: .875rem; }
.winner { font: 700 clamp(2rem, 8vw, 3.4rem)/1.05 var(--display); letter-spacing: -.04em; margin: 12px 0 28px; overflow-wrap: anywhere; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.dialog.wide .dialog-actions { justify-content: flex-end; margin-top: 20px; }
.dialog.wide .dialog-kicker { font: 700 1.4rem/1.2 var(--display); color: var(--ink); letter-spacing: -.02em; }
.teams-controls { display: flex; gap: 10px; align-items: end; margin: 16px 0; flex-wrap: wrap; }
.teams-controls label { display: grid; gap: 4px; font-size: .85rem; color: var(--ink-2); }
.teams-controls input { width: 110px; }
.teams { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); max-height: 50vh; overflow: auto; }
.team { border-radius: 16px; padding: 14px; background: var(--bg); box-shadow: inset 3px 0 0 var(--c, var(--accent)); }
.team h4 { margin: 0 0 6px; font-family: var(--display); }
.team ul { margin: 0; padding-left: 18px; color: var(--ink-2); }

/* ---------- Toast + confetti ---------- */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translate(-50%, calc(100% + 48px)); visibility: hidden;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-weight: 500; font-size: .925rem; z-index: 60;
  transition: transform .25s ease, visibility 0s .25s; pointer-events: none; max-width: calc(100vw - 32px);
}
.toast.show { transform: translate(-50%, 0); visibility: visible; transition: transform .25s ease; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 70; }
.noscript { text-align: center; padding: 16px; }

/* ---------- Ads ---------- */
.ad-slot { display: block; margin: 32px auto; min-height: 280px; width: 100%; max-width: 970px; text-align: center; }
.ad-slot::before { content: "Advertisement"; display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.ad-wide { padding: 0 24px; }
@media (min-width: 728px) { .ad-wide { min-height: 120px; } }

/* ---------- Docs, guides, hubs ---------- */
.doc { max-width: 720px; margin: 0 auto; padding: 24px 24px 40px; }
.doc h1 { font: 700 clamp(2rem, 5.5vw, 3.2rem)/1.08 var(--display); letter-spacing: -.04em; margin: 24px 0 16px; }
.doc h2 { font: 700 1.45rem/1.25 var(--display); letter-spacing: -.025em; margin: 48px 0 10px; }
.doc h2 a { color: inherit; text-decoration: none; }
.doc h2 a:hover { color: var(--accent); }
.doc p, .doc li { color: var(--ink-2); }
.doc li { margin: 6px 0; }
.doc .cta { display: inline-flex; margin-top: 12px; color: var(--bg); }
.doc .cta:hover { color: #fff; }
.doc .updated { font-size: .875rem; color: var(--ink-3); }
.doc:has(.hub-list) { max-width: 1100px; }
.hub-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 0 32px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.hub-list li { margin: 0; }
.hub-list a { display: grid; gap: 2px; height: 100%; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.hub-list a:hover b { color: var(--accent); }
.hub-list b { font-weight: 600; }
.hub-list span { color: var(--ink-2); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Fair draw ---------- */
.draw { max-width: 760px; margin: 0 auto; padding: 16px 24px 40px; }
.kicker { margin: 24px 0 0; font-weight: 600; color: var(--accent); font-size: .875rem; }
.draw h1 { font: 700 clamp(2rem, 6vw, 3.2rem)/1.06 var(--display); letter-spacing: -.04em; margin: 10px 0 16px; }
.draw .lead { font-size: 1.12rem; color: var(--ink-2); max-width: 60ch; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); padding: 28px; margin: 28px 0; }
.draw-form { display: grid; gap: 8px; }
.draw-form textarea { font: .9rem/1.6 var(--mono); resize: vertical; }
.draw-form .field-label { margin: 12px 0 0; }
.draw-form .field-label:first-child { margin-top: 0; }
.draw-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 12px 0; }
.draw-grid label { display: grid; gap: 6px; font-weight: 600; font-size: .925rem; }
.draw-form .switch { border-top: 0; }
.row-start { display: flex; margin-top: 12px; }
.my-draws { list-style: none; padding: 0; margin: 0; display: grid; }
.my-draws a { display: grid; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.my-draws a:hover { color: var(--accent); }
.my-draws span { font-size: .85rem; color: var(--ink-3); }
.cert-title { font: 700 clamp(2rem, 6vw, 3.2rem)/1.06 var(--display); letter-spacing: -.04em; margin: 14px 0 16px; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; background: var(--surface-2); font-weight: 600; font-size: .8rem; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .6; }
.badge.sealed { background: #fdebc4; color: #6b4600; }
.badge.done { background: #cdeee3; color: #0d4a3b; }
.facts { display: grid; gap: 0 32px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 20px 0 24px; border-top: 1px solid var(--line); }
.facts div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-size: .8rem; color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.mono { font-family: var(--mono); font-size: .9em; }
.wrap { word-break: break-all; }
.countdown { font: 700 clamp(3rem, 14vw, 5.5rem)/1 var(--display); letter-spacing: -.04em; margin: 12px 0 0; font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.draw-stage { text-align: center; }
.small-wheel { width: min(100%, 420px); }
.stage-winner { font: 700 clamp(1.6rem, 6vw, 2.4rem)/1.15 var(--display); letter-spacing: -.03em; min-height: 1.2em; overflow-wrap: anywhere; }
.winners { font: 700 1.5rem/1.5 var(--display); letter-spacing: -.02em; padding-left: 30px; overflow-wrap: anywhere; }
.winners li::marker { color: var(--accent); font-size: .9em; }
.verify { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.verify summary, .entrants-box summary { cursor: pointer; font-weight: 600; }
.verify li { margin: 10px 0; color: var(--ink-2); }
.verify a { color: var(--link); }
.entrants-box pre { max-height: 280px; overflow: auto; background: var(--bg); padding: 14px; border-radius: 14px; white-space: pre-wrap; font: .85rem/1.6 var(--mono); }
.about-draw { margin-top: 40px; }
.about-draw h2 { font: 700 1.5rem/1.2 var(--display); letter-spacing: -.025em; margin: 48px 0 10px; }
.about-draw p, .about-draw li { color: var(--ink-2); }
.about-draw a { color: var(--link); }
.about-draw .faq summary { font-size: 1rem; }

/* ---------- Small screens ---------- */
@media (max-width: 520px) {
  .topbar { padding-left: 16px; padding-right: 12px; }
  .layout { padding: 4px 16px 32px; gap: 24px; }
  .wheel-wrap { margin-top: 18px; }
  .tabs { padding: 0 18px; gap: 18px; }
  .tabpanel { padding: 18px 18px 22px; }
  .about, .doc, .draw { padding-left: 16px; padding-right: 16px; }
  .about { padding-top: 40px; }
  .about h2 { margin-top: 56px; }
  .footer { padding-left: 16px; padding-right: 16px; }
  .card { padding: 20px; }
  .dialog { padding: 28px 20px 22px; }
  .ad-wide { padding: 0 16px; }
}
@media (max-width: 380px) {
  .brand-name { font-size: 1.05rem; white-space: nowrap; }
  .icon-btn { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
@media (max-width: 520px) {
  .chip { padding: 6px 9px; }
  .toolbar > .chip:first-child { margin-left: -9px; }
  .fair-link { font-size: .85rem; white-space: nowrap; }
}

/* ---------- Share dialog ---------- */
.copy-row { display: flex; gap: 6px; margin: 14px 0 4px; flex-wrap: wrap; }
.copy-row input, .code-box {
  flex: 1; min-width: 0; border: 0; box-shadow: 0 0 0 1px var(--line) inset; background: var(--bg);
  border-radius: var(--radius-sm); padding: 10px 14px; font: .85rem/1.5 var(--mono); color: var(--ink-2);
}
.copy-row input { border-radius: 99px; min-width: 200px; }
.code-box { width: 100%; resize: vertical; }
.copy-row input:focus, .code-box:focus { outline: none; box-shadow: 0 0 0 1.5px var(--ink) inset; }

/* ---------- Draw credit ---------- */
.made-with { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 16px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .875rem; color: var(--ink-3); }
.made-with b { color: var(--ink); font-weight: 600; }
.made-with a { color: var(--ink); font-weight: 600; text-decoration: none; }
.made-with a:hover { color: var(--accent); }

/* ---------- Embedded wheel ---------- */
.embed-body { background: transparent; min-height: 0; }
.embed { display: flex; flex-direction: column; align-items: center; padding: 14px 12px 6px; max-width: 520px; margin: 0 auto; }
.embed .wheel-title { font-size: clamp(1.1rem, 5vw, 1.5rem); pointer-events: none; }
.embed .wheel-wrap { margin: 18px auto 6px; width: min(100%, 440px, calc(100vh - 210px)); }
.embed-result { min-height: 1.6em; margin: 6px 0 0; font: 700 1.3rem/1.3 var(--display); letter-spacing: -.02em; text-align: center; overflow-wrap: anywhere; }
.embed-credit { margin: 8px 0 0; font-size: .8rem; color: var(--ink-3); }
.embed-credit a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.embed-credit a:hover { color: var(--accent); }
.sound-unlock { display: block; width: 100%; margin-top: 8px; padding: 12px 16px; border: 0; border-radius: var(--radius-sm); background: #fdebc4; color: #6b4600; font-weight: 600; text-align: left; }
.sound-unlock:hover { filter: brightness(.97); }

/* =====================================================================
   Vivid theme: deep stage behind the wheel, bright accents, warm page.
   (Overrides the base styles above.)
   ===================================================================== */
:root {
  --bg: #fff7ec; --surface: #ffffff; --surface-2: #f7eee1; --ink: #1b1235; --ink-2: #57506d; --ink-3: #69627f;
  --line: #ecdfcc; --accent: #d93d1a; --accent-bright: #ff5a36; --link: #4a3cff; --focus: #4a3cff; --danger: #d92d4a;
  --sun: #ffc83d; --mint: #19c39a; --sky: #4a6cff; --pink: #ff4f9a; --grape: #7b5cff;
  --stage: #26145f; --stage-2: #3a1f94; --on-stage: #ffffff;
  --wheel-rim: #ffc83d; --wheel-track: #ffffff;
  --shadow-lg: 0 2px 4px rgba(27,18,53,.06), 0 24px 60px rgba(27,18,53,.18);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #110c20; --surface: #1c1533; --surface-2: #281f45; --ink: #f6f2ff; --ink-2: #b8afd4; --ink-3: #847ba3;
    --line: #322853; --accent: #ff6a45; --link: #a99bff; --focus: #a99bff; --danger: #ff6b7d;
    --stage: #1a0e45; --stage-2: #2c1880; --wheel-rim: #ffc83d; --wheel-track: #ffffff;
    --shadow-lg: 0 2px 4px rgba(0,0,0,.3), 0 24px 60px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  --bg: #110c20; --surface: #1c1533; --surface-2: #281f45; --ink: #f6f2ff; --ink-2: #b8afd4; --ink-3: #847ba3;
  --line: #322853; --accent: #ff6a45; --link: #a99bff; --focus: #a99bff; --danger: #ff6b7d;
  --stage: #1a0e45; --stage-2: #2c1880; --wheel-rim: #ffc83d; --wheel-track: #ffffff;
  --shadow-lg: 0 2px 4px rgba(0,0,0,.3), 0 24px 60px rgba(0,0,0,.5);
}
body { overflow-x: clip; }

/* ---- Hero stage ---- */
.hero {
  position: relative; color: var(--on-stage); isolation: isolate;
  background:
    radial-gradient(circle at 28% 58%, rgba(255, 200, 61, .22), transparent 34%),
    radial-gradient(circle at 92% 8%, rgba(255, 79, 154, .35), transparent 30%),
    radial-gradient(circle at 4% 96%, rgba(25, 195, 154, .28), transparent 28%),
    linear-gradient(160deg, var(--stage-2), var(--stage) 60%);
  border-radius: 0 0 36px 36px;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.09) 1.2px, transparent 1.6px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%); mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
/* Confetti shapes floating on the stage */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; border-radius: inherit;
  background:
    radial-gradient(circle, var(--sun) 5px, transparent 5.5px) 6% 22% / 40px 40px no-repeat,
    radial-gradient(circle, var(--pink) 4px, transparent 4.5px) 92% 30% / 40px 40px no-repeat,
    radial-gradient(circle, var(--mint) 6px, transparent 6.5px) 94% 92% / 40px 40px no-repeat,
    radial-gradient(circle, var(--sky) 4px, transparent 4.5px) 3% 70% / 40px 40px no-repeat,
    radial-gradient(circle, var(--accent-bright, var(--accent)) 5px, transparent 5.5px) 97% 55% / 40px 40px no-repeat;
}
.hero-slim { border-radius: 0 0 28px 28px; margin-bottom: 8px; }
.hero-slim::after { display: none; }

.hero .topbar { position: relative; z-index: 3; }
.hero .brand, .hero .brand-name { color: #fff; }
.hero .icon-btn { color: rgba(255,255,255,.85); }
.hero .icon-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
.hero .btn { color: #fff; box-shadow: 0 0 0 1.5px rgba(255,255,255,.4) inset; }
.hero .btn:hover { box-shadow: 0 0 0 1.5px #fff inset; }
.hero .layout { padding-bottom: 56px; }

.hero .page-h1 {
  display: inline-block; margin: 0 0 10px; padding: 5px 12px; border-radius: 99px;
  background: var(--sun); color: #1b1235; font: 700 .78rem/1.2 var(--font); letter-spacing: .01em;
  transform: rotate(-2deg);
}
.hero .wheel-title { color: #fff; font-size: clamp(1.9rem, 4.8vw, 3.1rem); }
.hero .wheel-title::placeholder { color: rgba(255,255,255,.55); }
.hero .wheel-title:hover { background: rgba(255,255,255,.08); }
.hero .wheel-title:focus { background: rgba(255,255,255,.12); box-shadow: 0 0 0 1.5px rgba(255,255,255,.5); }
.hero .hint { color: rgba(255,255,255,.7); }
.hero kbd { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }

.wheel-wrap canvas { filter: drop-shadow(0 18px 30px rgba(10, 4, 40, .45)); }
.hero .wheel-wrap { margin-top: 34px; }
@media (max-width: 520px) { .hero .wheel-wrap { margin-top: 30px; } }
.pointer { top: -18px; width: 36px; height: 48px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.35)); }
.pointer::before { background: var(--sun); clip-path: path("M18 48 L3 17 A15 15 0 1 1 33 17 Z"); }
.pointer::after { left: 12px; top: 11px; width: 12px; height: 12px; background: #1b1235; }
.hub {
  background: var(--sun); color: #1b1235; font-weight: 800; font-size: clamp(1rem, 2.6vw, 1.35rem); letter-spacing: .02em;
  text-transform: uppercase; box-shadow: 0 0 0 7px #fff, 0 10px 24px rgba(0,0,0,.35), inset 0 -5px 0 rgba(0,0,0,.12);
}
.hub:hover { background: #ffd45f; color: #1b1235; }
.hub[disabled] { background: var(--sun); color: #1b1235; }
.hero .fair-link { background: rgba(255,255,255,.1); box-shadow: 0 0 0 1px rgba(255,255,255,.22) inset; color: rgba(255,255,255,.8); backdrop-filter: blur(6px); }
.hero .fair-link u { color: #fff; }
.hero .fair-link svg { stroke: var(--sun); }
.hero .fair-link:hover { background: rgba(255,255,255,.18); color: #fff; box-shadow: 0 0 0 1px rgba(255,255,255,.5) inset; }
.stage:fullscreen, .stage.pseudo-full { background: linear-gradient(160deg, var(--stage-2), var(--stage) 60%); }

/* ---- Panel ---- */
.panel { border-radius: 28px; box-shadow: var(--shadow-lg); }
.tabs { gap: 4px; padding: 10px; border-bottom: 0; }
.tabs [role="tab"] { padding: 9px 14px; border-radius: 99px; color: var(--ink-2); }
.tabs [role="tab"]:hover { background: var(--surface-2); }
.tabs [role="tab"][aria-selected="true"] { background: var(--ink); color: var(--surface); }
.tabs [role="tab"][aria-selected="true"]::after { display: none; }
.tabs [role="tab"][aria-selected="true"] .count { background: var(--sun); color: #1b1235; }
.count { background: var(--surface-2); color: var(--ink-2); padding: 1px 7px; border-radius: 99px; font-size: .72rem; }
.tabpanel { padding-top: 8px; }
.btn.primary { background: var(--accent-strong, #d93d1a); color: #fff; box-shadow: 0 2px 0 rgba(0,0,0,.12); }
.btn.primary:hover { background: #c2330f; color: #fff; }
.add-row { background: var(--surface-2); box-shadow: none; }
.add-row:focus-within { box-shadow: 0 0 0 2px var(--accent) inset; }
.dot { width: 18px; height: 18px; border-radius: 6px; transform: rotate(0); }
.dot:hover { transform: scale(1.15) rotate(8deg); }
.entry { border-radius: 14px; }
.entry:hover, .entry:focus-within { background: var(--surface-2); }
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--accent-strong, #d93d1a); color: #fff; }
.switch input:checked { background: var(--mint); }
.switch input:checked::after { background: #fff; }
.palette[aria-checked="true"] { box-shadow: 0 0 0 2px var(--accent) inset; }
.tally .bar i { background: linear-gradient(90deg, var(--accent-bright, var(--accent)), var(--sun)); }
.preset:hover { box-shadow: 0 0 0 1.5px var(--accent) inset; color: var(--accent); }
.field input[type="range"], .radio input { accent-color: var(--accent); }

/* ---- Content sections ---- */
.about { border-top: 0; margin-top: 16px; padding-top: 64px; }
.about h2 { font-weight: 800; }
.about-grid { gap: 16px; }
.about article {
  border-top: 0; padding: 26px 24px 24px; border-radius: 24px; background: var(--surface); box-shadow: 0 0 0 1px var(--line);
  position: relative; overflow: hidden;
}
.about article::before {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 18px;
  font: 800 1rem/1 var(--display); color: #1b1235; background: var(--sun); letter-spacing: 0;
}
.about article:nth-child(4n+2)::before { background: var(--mint); color: #fff; }
.about article:nth-child(4n+3)::before { background: var(--pink); color: #fff; }
.about article:nth-child(4n+4)::before { background: var(--sky); color: #fff; }
.about article:nth-child(4n+1) { background: color-mix(in srgb, var(--sun) 10%, var(--surface)); }
.about article:nth-child(4n+2) { background: color-mix(in srgb, var(--mint) 9%, var(--surface)); }
.about article:nth-child(4n+3) { background: color-mix(in srgb, var(--pink) 8%, var(--surface)); }
.about article:nth-child(4n+4) { background: color-mix(in srgb, var(--sky) 8%, var(--surface)); }
.about .lead { color: var(--ink-2); }
.steps li::before {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem;
  background: var(--ink); color: var(--surface);
}
.steps li { grid-template-columns: 38px 1fr; align-items: start; }
.faq { background: var(--surface); border: 0; box-shadow: 0 0 0 1px var(--line); border-radius: 18px; margin-bottom: 10px; padding: 0 20px; }
.about h2 + .faq { border-top: 0; }
.faq summary::after { color: var(--accent); font-weight: 500; }
.faq[open] { box-shadow: 0 0 0 2px var(--ink); }
.gear-card { background: var(--surface); border: 0; border-radius: 20px; padding: 20px; box-shadow: 0 0 0 1px var(--line); margin-bottom: 14px; transition: transform .15s, box-shadow .15s; }
.gear-card:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--line), 0 12px 28px rgba(27,18,53,.1); }
.gear-grid { gap: 0 16px; }
.tool-links { columns: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.tool-links a { display: inline-block; padding: 9px 16px; border-radius: 99px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); font-weight: 500; font-size: .92rem; transition: background .15s, color .15s, box-shadow .15s; }
.tool-links a:hover { background: var(--ink); color: var(--surface); box-shadow: none; }
.tool-links a:nth-child(5n+1):hover { background: var(--accent); color: #fff; }
.tool-links a:nth-child(5n+2):hover { background: var(--mint); color: #fff; }
.tool-links a:nth-child(5n+3):hover { background: var(--sky); color: #fff; }
.tool-links a:nth-child(5n+4):hover { background: var(--pink); color: #fff; }
.tool-links a:nth-child(5n+5):hover { background: var(--sun); color: #1b1235; }

/* ---- Footer ---- */
.footer {
  max-width: none; margin: 80px 0 0; border-top: 0; border-radius: 36px 36px 0 0;
  background: linear-gradient(160deg, var(--stage-2), var(--stage) 70%); color: rgba(255,255,255,.75);
  padding-left: max(24px, calc((100vw - var(--max)) / 2 + 24px)); padding-right: max(24px, calc((100vw - var(--max)) / 2 + 24px));
}
.footer > div strong { color: #fff; }
.footer > div .muted { color: rgba(255,255,255,.6); }
.footer a { color: rgba(255,255,255,.75); }
.footer a:hover { color: var(--sun); }

/* ---- Dialogs ---- */
.dialog { box-shadow: 0 30px 90px rgba(10,4,40,.45); }
.dialog::backdrop { background: rgba(26, 14, 69, .6); }
.winner { background: linear-gradient(90deg, var(--accent), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 4px; }
.dialog-kicker { color: var(--ink-2); }

/* ---- Doc + hub pages ---- */
.hub-list { gap: 12px; }
.hub-list a { background: var(--surface); border: 0; border-radius: 18px; padding: 16px 18px; box-shadow: 0 0 0 1px var(--line); transition: transform .15s, box-shadow .15s; }
.hub-list a:hover { transform: translateY(-2px); box-shadow: 0 0 0 1.5px var(--accent); }
.hub-list a:hover b { color: var(--accent); }
.doc h1, .draw h1 { font-weight: 800; }
.kicker { display: inline-block; padding: 5px 12px; border-radius: 99px; background: var(--sun); color: #1b1235; font-weight: 700; transform: rotate(-2deg); }
.card { border-radius: 28px; box-shadow: var(--shadow-lg); }
.badge.done { background: var(--mint); color: #fff; }
.badge.sealed { background: var(--sun); color: #1b1235; }

@media (max-width: 520px) {
  .hero { border-radius: 0 0 28px 28px; }
  .hero .layout { padding-bottom: 32px; }
  .tabs { padding: 8px; }
  .tabs [role="tab"] { padding: 8px 11px; font-size: .9rem; }
  .footer { border-radius: 28px 28px 0 0; }
}
.hero .panel { color: var(--ink); }
.hero-slim { background: radial-gradient(circle at 95% 0%, rgba(255, 79, 154, .35), transparent 40%), linear-gradient(100deg, var(--stage-2), var(--stage)); }

/* ---- Entry pictures ---- */
.ic.pic { position: relative; overflow: hidden; cursor: pointer; }
.ic.pic input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.ic.pic.has { opacity: 1; }
.ic.pic img { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; display: block; }
.winner-img { display: block; width: 120px; height: 120px; border-radius: 24px; object-fit: cover; margin: 14px auto 0; box-shadow: 0 8px 24px rgba(0,0,0,.18); }

/* ---- Fairness test ---- */
.fair-table { display: grid; gap: 10px; max-height: 52vh; overflow: auto; margin-top: 14px; }
.fair-row { display: grid; grid-template-columns: minmax(80px, 1fr) 2fr auto; gap: 12px; align-items: center; font-size: .9rem; }
.fair-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.fair-row .bars { position: relative; height: 14px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.fair-row .bars i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.fair-row .bars .got { background: linear-gradient(90deg, var(--accent), var(--sun)); top: 3px; bottom: 3px; }
.fair-row .bars .exp { background: transparent; border-right: 2px solid var(--ink); border-radius: 0; z-index: 1; }
.fair-row .num { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.fair-row .num small { display: block; font-weight: 400; color: var(--ink-3); font-size: .75rem; }

/* ---- Stream overlay (OBS / Streamlabs) ---- */
.stream, .stream body { background: transparent !important; }
.stream .embed .wheel-title { color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.stream .embed-result { color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.7); font-size: 2rem; }
.stream .embed-credit { color: rgba(255,255,255,.8); text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.stream .embed-credit a { color: #fff; }
.entry { grid-template-columns: auto minmax(0, 1fr) auto auto auto auto; }
.compare { width: 100%; border-collapse: collapse; margin: 12px 0 8px; font-size: .9rem; display: block; overflow-x: auto; }
.compare th, .compare td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare th { font-weight: 700; color: var(--ink); white-space: nowrap; }
.compare td:first-child { color: var(--ink); font-weight: 600; }
.compare td:last-child, .compare th:last-child { background: color-mix(in srgb, var(--mint) 12%, transparent); color: var(--ink); font-weight: 600; }
.compare tbody th { white-space: normal; font-weight: 600; }
.embed h1.wheel-title { margin: 0; font-weight: 800; }
/* Very small phones (320–380px wide): keep everything inside the screen */
@media (max-width: 380px) {
  .topbar { padding-left: 12px; padding-right: 8px; gap: 6px; }
  .brand { gap: 7px; min-width: 0; }
  .brand-name { font-size: .95rem; }
  .icon-btn { width: 34px; height: 34px; }
  .fair-link .fl-q { display: none; }
  .tabs { padding: 0 6px; gap: 0; justify-content: space-between; }
  .tabs [role="tab"] { font-size: .82rem; padding: 8px 7px; }
  .tabs .count { margin-left: -2px; }
}
