@font-face {
  font-family: Fredoka;
  src: url("/static/fonts/fredoka-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: Fredoka;
  src: url("/static/fonts/fredoka-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: Nunito;
  src: url("/static/fonts/nunito-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Nunito;
  src: url("/static/fonts/nunito-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #160b2e;
  --ink: #fff6e8;
  --muted: #e4d6f6;
  --gold: #ffd166;
  --pink: #ff5d8f;
  --cyan: #3dfff3;
  --orange: #ff7a18;
  --card: rgba(22, 10, 48, 0.94);
  --line: rgba(255, 209, 102, 0.5);
  --shadow: 0 18px 50px rgba(8, 2, 20, 0.45);
  --radius: 1.4rem;
  --focus: #ffd166;
  --hub-mid: #ff5d8f;
  --hub-edge: #7b21ff;
  --ghost-fill: rgba(16, 6, 36, 0.92);
  --inset: rgba(8, 2, 24, 0.55);
  --on-fill: color-mix(in srgb, var(--gold) 16%, transparent);
  --danger: #5a1230;
  --danger-ink: #ffd6e4;
  --ok: var(--cyan);
  --panel: #1c0b3a;
}

html[data-theme="readable"] {
  --bg: #0b1220;
  --ink: #ffffff;
  --muted: #e8edf4;
  --gold: #f0e442;
  --pink: #d55e00;
  --cyan: #56b4e9;
  --orange: #e69f00;
  --card: rgba(11, 18, 32, 0.96);
  --line: rgba(240, 228, 66, 0.65);
  --shadow: 0 18px 50px rgba(4, 8, 16, 0.55);
  --focus: #f0e442;
  --hub-mid: #0072b2;
  --hub-edge: #0b1220;
  --ghost-fill: rgba(11, 18, 32, 0.94);
  --inset: rgba(4, 8, 16, 0.7);
  --panel: #0b1220;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { font-size: 100%; scroll-padding-top: 4.5rem; }
[hidden] { display: none !important; }
body {
  font-family: Nunito, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 1.125rem;
  line-height: 1.55;
}
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 100;
  padding: 0.55rem 0.9rem;
  background: var(--gold);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  transform: translateY(-160%);
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
  color: var(--bg);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.main:focus-visible,
.modal:focus-visible,
.mode-card > input[type="radio"]:focus-visible {
  outline: none;
}
img { max-width: 100%; height: auto; }
a { color: var(--gold); }
.main a:not(.btn):not(.list-card-hit) {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
h1, h2, h3, .brand span, .winner-name {
  font-family: Fredoka, Nunito, sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.15;
}
h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0 0 0.4em; }
h2 { font-size: 1.5rem; }

.sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(180deg, rgba(22, 11, 46, 0.28), rgba(22, 11, 46, 0.7)),
    url("/static/img/festival-street.jpg");
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat;
}
.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 10%, rgba(255, 93, 143, 0.22), transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(61, 255, 243, 0.12), transparent 35%);
  pointer-events: none;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.2rem;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(16, 6, 36, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.15rem;
}
.brand img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
}
.nav {
  display: flex;
  gap: 1.65rem;
  align-items: center;
  flex-wrap: wrap;
}
.nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  min-height: 2.75rem;
  padding: 0.4rem 0.35rem;
  display: inline-flex;
  align-items: center;
}
.nav a:not(.nav-account) + a:not(.nav-account) {
  position: relative;
}
.nav a:not(.nav-account) + a:not(.nav-account)::before {
  content: "";
  position: absolute;
  left: -0.9rem;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background: rgba(255, 209, 102, 0.35);
}
.nav a:hover { color: var(--gold); }
.nav a.nav-account,
.nav a.nav-admin,
.nav a.nav-mod {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 1.25rem;
  border-radius: 999px;
  line-height: 1.2;
}
.nav a[aria-current="page"]:not(.nav-account):not(.nav-admin):not(.nav-mod) {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 0.28em;
}
.nav a.nav-account {
  background: var(--pink);
  color: var(--bg) !important;
}
html[data-theme="readable"] .nav a.nav-account {
  background: var(--cyan);
}
.nav a.nav-admin {
  color: var(--gold) !important;
  border: 1px solid var(--gold);
}
.nav a.nav-mod {
  color: var(--cyan) !important;
  border: 1px solid var(--cyan);
}
.nav a.nav-account[aria-current="page"],
.nav a.nav-admin[aria-current="page"],
.nav a.nav-mod[aria-current="page"] {
  box-shadow: 0 0 0 2px var(--ink);
}
.site-banner {
  text-align: center;
  font-weight: 700;
  color: var(--gold);
  background: linear-gradient(90deg, rgba(255, 93, 143, 0.28), rgba(255, 209, 102, 0.18), rgba(61, 255, 243, 0.16));
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 1rem;
}
.main { width: min(1120px, calc(100% - 1.6rem)); margin: 1.4rem auto 3rem; }
.foot { text-align: center; color: var(--muted); padding: 1rem 0 2rem; }
.foot a { color: var(--gold); text-decoration: underline; text-underline-offset: 0.18em; font-weight: 700; }
.foot a:hover { color: var(--ink); }
.foot-legal { margin: 0.35rem 0 0; font-size: 0.95rem; }
.ver { color: var(--gold); }
.settings-heading,
.mode-picker legend,
.mod-subgroup h3 {
  font-family: Fredoka, Nunito, sans-serif;
  font-weight: 600;
  color: var(--gold);
}
.settings-heading {
  font-size: 1.05rem;
  margin: 0.85rem 0 0.45rem;
}
.mode-picker legend { padding: 0 0 0.65rem; }
.mod-subgroup h3 {
  margin: 0;
  font-size: 1.08rem;
}

.split,
.hero,
.admin-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.4rem;
  align-items: start;
}
.hero {
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.eyebrow {
  color: var(--gold);
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}
.lead { font-size: 1.12rem; color: var(--muted); }
.hero-art { position: relative; min-height: 280px; }
.hero-wheel {
  width: min(100%, 420px);
  border-radius: 50%;
  box-shadow: var(--shadow), 0 0 0 8px rgba(255, 209, 102, 0.35);
  animation: floaty 6s ease-in-out infinite;
}
.hero-booth {
  position: absolute;
  width: 42%;
  right: 0;
  bottom: -8%;
  border-radius: 1rem;
  box-shadow: var(--shadow);
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  min-height: 2.75rem;
  padding: 0.7rem 1.15rem;
  font: 700 1rem Nunito, sans-serif;
  cursor: pointer;
  text-decoration: none;
}
.btn.primary { background: linear-gradient(90deg, var(--pink), var(--orange)); color: var(--bg); }
html[data-theme="readable"] .btn.primary {
  background: linear-gradient(90deg, var(--orange), var(--pink));
}
.btn.ghost { background: var(--ghost-fill); color: var(--gold); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); color: var(--danger-ink); }
.btn.add-slice {
  background: linear-gradient(90deg, #06d6a0, var(--cyan));
  color: var(--bg);
  gap: 0.35rem;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--cyan) 28%, transparent);
  margin-top: 0.85rem;
}
.btn.add-slice .add-icon { font-size: 1.25em; line-height: 1; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.nav-toggle { display: none; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }

.band h2 { margin-bottom: 1rem; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1.2rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: visible;
}
.list-card {
  cursor: pointer;
  overflow: hidden;
}
.list-card:hover,
.list-card:focus-within {
  border-color: color-mix(in srgb, var(--gold) 70%, transparent);
}
.list-card-hit {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
}
.list-card .btn,
.list-card .row-actions {
  position: relative;
  z-index: 1;
}
.list-card h2,
.list-card h3 { margin: 0 0 0.4rem; font-size: 1.25rem; }
.list-card p { color: var(--muted); }
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.82rem;
}
.meta span, .pill {
  background: rgba(255, 209, 102, 0.12);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}
.pill { color: var(--cyan); }
.pill.danger,
.rating-pill.rating-explicit {
  color: var(--danger-ink);
  background: color-mix(in srgb, var(--pink) 28%, transparent);
}
.rating-pill.rating-family {
  color: #b8ffe8;
  background: rgba(6, 214, 160, 0.22);
}
.rating-pill.rating-moderate {
  color: var(--gold);
  background: rgba(255, 209, 102, 0.2);
}
.rating-pill.rating-mature {
  color: #ffd0a8;
  background: rgba(255, 122, 24, 0.28);
}
html[data-theme="readable"] .rating-pill.rating-family {
  color: #003c30;
  background: #009e73;
}
html[data-theme="readable"] .rating-pill.rating-moderate {
  color: #111;
  background: #f0e442;
}
html[data-theme="readable"] .rating-pill.rating-mature {
  color: #111;
  background: #e69f00;
}
html[data-theme="readable"] .rating-pill.rating-explicit {
  color: #fff;
  background: #d55e00;
}
.list-tools {
  display: grid;
  gap: 0.85rem 1.2rem;
  margin: 0 0 1.1rem;
  align-items: end;
}
.list-search { min-width: 0; }
.search-field,
.field-flag-wrap {
  position: relative;
  display: block;
}
.search-field input {
  width: 100%;
  padding-right: 2.75rem;
}
.search-field input[type="search"]::-webkit-search-cancel-button {
  appearance: none;
}
.search-clear {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.search-clear:hover { background: var(--on-fill); }
.list-ratings {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
@media (min-width: 820px) {
  .list-tools {
    grid-template-columns: minmax(14rem, 1fr) auto;
  }
}
.list-ratings legend {
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.rating-filters { align-items: center; }
.rating-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  cursor: pointer;
}
.rating-filter input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--gold);
}
.mode-card.is-blocked {
  opacity: 0.45;
  cursor: not-allowed;
}
.mode-card.is-blocked input { pointer-events: none; }
.field-flag-wrap input,
.field-flag-wrap textarea {
  width: 100%;
  padding-right: 2.6rem;
}
.field-flag {
  position: absolute;
  right: 0.55rem;
  top: 0.65rem;
  font-size: 1.15rem;
  line-height: 1;
  pointer-events: none;
}
.list-card.is-disabled {
  opacity: 0.92;
}
.list-card.is-disabled .list-card-hit { display: none; }
.warning-card {
  border: 1px solid rgba(255, 93, 143, 0.55);
  background: rgba(255, 45, 85, 0.16);
  display: grid;
  gap: 0.6rem;
  cursor: pointer;
}
.warning-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.warning-head .quiet {
  margin: 0;
  flex: 1 1 12rem;
}
.warning-count {
  appearance: none;
  border: 0;
  background: #c0392b;
  color: #fff;
  font: inherit;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  width: fit-content;
  pointer-events: none;
}
.warning-card:hover .warning-count { filter: brightness(1.08); }
.warning-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.warning-list li {
  border-top: 1px solid rgba(255, 93, 143, 0.28);
  padding-top: 0.65rem;
}
.disabled-list-card { max-width: 40rem; }
.card-spark {
  position: absolute;
  width: 120px;
  height: 120px;
  right: -30px;
  top: -40px;
  background: url("/static/img/starburst.png") center / contain no-repeat;
  opacity: 0.28;
  pointer-events: none;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.2rem;
}
.empty { text-align: center; padding: 2rem 1rem; }
.empty img { width: min(280px, 70vw); border-radius: 1.2rem; margin-bottom: 1rem; }

.form-card, .stack { display: grid; gap: 0.85rem; }
label, .with-tip { display: grid; gap: 0.35rem; font-weight: 700; }
input, textarea, select {
  font: inherit;
  color: var(--ink);
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.65rem 0.75rem;
}
textarea { resize: vertical; }
.form-msg { color: var(--danger-ink); margin: 0; }
.form-msg.ok { color: var(--ok); }
.field-error {
  color: var(--danger-ink);
  font-size: 0.82rem;
  font-weight: 400;
  margin: 0;
}
input:user-invalid,
textarea:user-invalid,
select:user-invalid {
  border-color: var(--danger-ink);
}
.account-page,
.editor,
.admin-panel { display: grid; gap: 1rem; }
.account-body { align-items: start; }
.account-body > .card {
  display: grid;
  align-content: start;
  gap: 0.85rem;
}
.account-body > .card h2,
.account-body > .card p {
  margin: 0;
}
.add-slice-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}
.add-slice-row .btn.add-slice { margin-top: 0; }
.add-slice-row #slice-cap-note { margin: 0; }
.tabs { display: flex; gap: 0.4rem; }
.tab {
  flex: 1;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.5rem;
  font: inherit;
  cursor: pointer;
}
.tab.on,
.filter-row button.on {
  color: var(--ink);
  border-color: var(--gold);
  background: var(--on-fill);
}
.aside-art img { border-radius: var(--radius); box-shadow: var(--shadow); }

.toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.15rem;
}
.toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.toggle-ui {
  width: 2.7rem;
  height: 1.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border: 1px solid var(--line);
  position: relative;
  flex: 0 0 auto;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.35);
}
.toggle-ui::after {
  content: "";
  position: absolute;
  top: 0.12rem;
  left: 0.14rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.18s ease, background 0.18s ease;
}
.toggle input:checked + .toggle-ui {
  background: linear-gradient(90deg, var(--pink), var(--orange));
  border-color: var(--gold);
}
.toggle input:checked + .toggle-ui::after {
  transform: translateX(1.15rem);
  background: #fff6e8;
}
.toggle input:focus-visible + .toggle-ui {
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.55);
}
.toggle-text { color: var(--ink); }
.toggle-note {
  color: var(--muted);
  font-weight: 400;
  margin-left: auto;
}

.with-tip { position: relative; }
.with-tip-head {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.info-dot {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: rgba(255, 209, 102, 0.15);
  color: var(--gold);
  font: 700 0.75rem Fredoka, Nunito, sans-serif;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}
.info-bubble {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 0.35rem);
  z-index: 8;
  width: min(16rem, 70vw);
  padding: 0.65rem 0.75rem;
  border-radius: 0.8rem;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-weight: 400;
  font-size: 0.86rem;
  box-shadow: var(--shadow);
}
.with-tip:hover .info-bubble,
.with-tip:focus-within .info-bubble,
.info-dot[aria-expanded="true"] + .info-bubble {
  display: block;
}

.mode-picker {
  border: 0;
  margin: 0.2rem 0 0;
  padding: 0;
  min-width: 0;
}
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.vis-grid {
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}
.mode-card {
  position: relative;
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--inset);
  cursor: pointer;
  min-width: 0;
  box-shadow: 0 8px 18px rgba(8, 2, 20, 0.25);
}
.mode-card > input[type="radio"] {
  appearance: none;
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.mode-title {
  font-family: Fredoka, Nunito, sans-serif;
  font-weight: 600;
  color: var(--ink);
}
.mode-blurb {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 400;
}
.mode-card:hover {
  border-color: color-mix(in srgb, var(--gold) 70%, transparent);
}
.mode-card:focus-within,
.mode-card:has(input:checked) {
  border-color: var(--gold);
  background: linear-gradient(165deg, rgba(255, 93, 143, 0.32), rgba(255, 209, 102, 0.14) 55%, rgba(61, 255, 243, 0.08));
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.35), 0 10px 22px rgba(255, 93, 143, 0.22);
}
.mode-card:has(input:checked) .mode-title { color: var(--gold); }

.spin-page { display: grid; gap: 1.4rem; }
.spin-head { min-width: 0; max-width: 42rem; }
.spin-head h1 { overflow-wrap: anywhere; word-break: break-word; }
.stage {
  position: relative;
  display: grid;
  justify-items: center;
  grid-template-rows: 2.2rem auto 3rem 1.5rem;
  gap: 1.35rem;
  padding: 0.4rem 0 2rem;
}
.hint {
  grid-row: 1;
  margin: 0;
  color: var(--gold);
  font-weight: 700;
  min-height: 2.2rem;
  line-height: 2.2rem;
}
.wheel-frame {
  position: relative;
  width: 100%;
}
.stage .hint[hidden],
.stage .form-msg[hidden] {
  display: block !important;
  visibility: hidden;
}
.stage-action {
  grid-row: 3;
  min-height: 3rem;
  display: grid;
  place-items: center;
}
.stage .form-msg { grid-row: 4; min-height: 1.5rem; }
.wheel-stack {
  grid-row: 2;
  display: grid;
  justify-items: center;
  width: min(520px, 92vw);
}
.wheel-wrap {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: transparent;
  filter: drop-shadow(0 18px 28px rgba(0,0,0,0.45));
  cursor: pointer;
  border-radius: 50%;
}
.wheel-wrap:disabled {
  cursor: default;
}
.wheel-wrap.busy { cursor: wait; }
.wheel-wrap.faded canvas { filter: blur(3px) saturate(0.7) brightness(0.55); }
#wheel { width: 100%; height: 100%; border-radius: 50%; }
.pointer {
  width: 12%;
  margin-bottom: -5%;
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,0.4));
}
.hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18%;
  height: 18%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--hub-mid) 45%, var(--hub-edge));
  border: 4px solid var(--gold);
  box-shadow: 0 0 24px color-mix(in srgb, var(--pink) 80%, transparent);
  z-index: 2;
  pointer-events: none;
}
.winner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  justify-items: center;
  text-align: center;
  z-index: 4;
  pointer-events: auto;
  padding: 12%;
  box-sizing: border-box;
  overflow: visible;
}
.winner-card {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  background: rgba(8, 2, 20, 0.92);
  border-radius: 1.25rem;
  padding: 0.7rem 1rem 0.85rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  justify-self: center;
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  box-sizing: border-box;
  overflow: visible;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55), 0 0 0 2px var(--gold);
  transform-origin: center center;
  animation: pulse 0.9s ease-in-out infinite;
}
.winner-icon {
  font-size: clamp(2.6rem, 10vw, 5.2rem);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.85));
}
.winner-name {
  display: block;
  width: 100%;
  font-size: clamp(1.05rem, 3.8vw, 1.85rem);
  max-width: 100%;
  min-width: 0;
  color: #fff;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  text-shadow: 0 1px 2px rgba(8, 2, 20, 1), 0 0 12px rgba(8, 2, 20, 0.9);
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.fx {
  position: absolute;
  inset: 0;
  grid-area: 1 / 1 / -1 / -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}
.spin-again { min-width: 12rem; min-height: 2.9rem; }
.spin-tools {
  display: flex;
  justify-content: center;
  margin-top: -0.4rem;
}
.spin-tools[hidden] { display: none !important; }
.history,
.log-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}
.history li,
.log-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.55rem 0.85rem;
}
.history .dot,
.log-list .dot {
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.history .dot {
  width: 2.4rem;
  height: 2.4rem;
  font-size: 1.2rem;
}
.log-list .dot {
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
  background: var(--inset);
}
.quiet { color: var(--muted); }

.slice-stack,
.stat-stack { display: grid; gap: 0.8rem; }
.slice-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: start;
  padding: 0.7rem;
  border: 1px dashed var(--line);
  border-radius: 1rem;
}
.slice-main { display: grid; gap: 0.5rem; }
.slice-extras {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.5rem;
  align-items: end;
}
.wait-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  min-width: 0;
}
.wait-pair input,
.wait-pair select { width: 100%; min-width: 0; }
.sitting-out-toggle { width: 100%; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: var(--inset);
  font-size: 1.5rem;
  cursor: pointer;
  text-align: center;
  line-height: 1;
  padding: 0;
}
.icon-btn.empty {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 2, 20, 0.7);
  display: grid;
  place-items: center;
  z-index: 40;
  padding: 1rem;
}
.modal[hidden] { display: none; }
.modal-card {
  width: min(640px, 100%);
  max-height: 80vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}
.icon-none {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin-bottom: 0.7rem;
  background: var(--inset);
  border: 1px dashed var(--line);
  color: var(--ink);
  font: 700 1rem Nunito, sans-serif;
  border-radius: 0.85rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
}
.icon-none:hover { border-color: var(--gold); color: var(--gold); }
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.6rem, 1fr));
  gap: 0.3rem;
}
.icon-grid button {
  font-size: 1.4rem;
  background: transparent;
  border: 0;
  cursor: pointer;
  border-radius: 0.6rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.25rem;
}
.icon-grid button:hover { background: var(--on-fill); }

.guide {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1rem, 3vw, 2rem);
  box-shadow: var(--shadow);
  width: 100%;
}
.guide > :first-child { margin-top: 0; }
.guide h2 { color: var(--gold); margin-top: 1.6rem; }
.guide h3 { font-size: 1.1rem; margin: 1rem 0 0.35rem; }
.guide dt { font-weight: 700; margin-top: 0.8rem; }
.guide dd { margin: 0.2rem 0 0.4rem; color: var(--muted); }
.guide.legal p, .guide.legal li { color: var(--ink); }
.legal-address { white-space: pre-line; }
.danger-zone {
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid color-mix(in srgb, var(--pink) 35%, transparent);
  display: grid;
  gap: 0.75rem;
}

.burst {
  position: absolute;
  width: 180px;
  height: 180px;
  margin: -90px 0 0 -90px;
  background: url("/static/img/starburst.png") center / contain no-repeat;
  pointer-events: none;
  z-index: 6;
  animation: burst 0.7s ease-out forwards;
}
@keyframes burst {
  0% { transform: scale(0.2) rotate(0deg); opacity: 1; }
  100% { transform: scale(1.4) rotate(40deg); opacity: 0; }
}

.page-admin .main,
.page-moderator .main {
  width: min(1240px, calc(100% - 1.6rem));
  margin-top: 0;
  padding-top: 0.5rem;
}
.admin {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
}
.admin-side {
  position: sticky;
  top: calc(1.7rem + 45px + 0.5rem);
  align-self: start;
  overflow-anchor: none;
  display: grid;
  gap: 0.35rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 0.75rem 1rem;
  box-shadow: var(--shadow);
}
.admin-side .eyebrow { margin-bottom: 0.35rem; }
.admin-side a {
  display: grid;
  grid-template-columns: 2.45rem 1fr;
  gap: 0.65rem;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  padding: 0.4rem 0.45rem;
  border-radius: 0.95rem;
}
.admin-side a:hover { color: var(--gold); }
.admin-side img {
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  background: var(--panel);
}
.confirm-banner a { color: inherit; margin-left: 0.4rem; }
.mod-access-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.btn-spinner {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}
button[aria-busy="true"] { min-width: 2.75rem; }
.admin-head .lead,
.admin-tools .lead { margin: 0; }
.admin-head .btn { margin-top: 0.35rem; justify-self: start; }
.admin-tools {
  display: grid;
  gap: 0.85rem;
  align-content: start;
}
.admin-tools .admin-toolbar { margin: 0; }
.admin-tools .admin-toolbar input { width: 100%; }
.admin-head .btn,
.admin-tools > .btn { justify-self: start; }
.rating-control {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}
button.rating-pill {
  font: inherit;
  line-height: inherit;
  cursor: pointer;
  border: 0;
}
.rating-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.rating-edit:hover,
.rating-edit:focus-visible {
  color: var(--gold);
  background: var(--on-fill);
}
.rating-edit svg {
  width: 1rem;
  height: 1rem;
  display: block;
}
.admin-hero {
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.1rem;
  align-items: center;
}
.admin-hero.account-hero {
  grid-template-areas:
    "copy art"
    "copy actions";
  align-items: stretch;
}
.account-hero > :first-child { grid-area: copy; }
.account-hero img { grid-area: art; }
.account-hero-actions {
  grid-area: actions;
  justify-self: end;
  align-self: end;
  margin-top: 0.75rem;
}
.admin-hero img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.console-hero {
  align-items: start;
}
.console-hero .stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.2rem;
}
.console-hero .stat {
  background: var(--inset);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.8rem;
}
.stat-grid.row-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-grid.row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-grid.row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
}
.stat .n {
  font-family: Fredoka, Nunito, sans-serif;
  font-size: 1.85rem;
  color: var(--gold);
  line-height: 1.1;
}
.stat .k { color: var(--muted); font-size: 0.86rem; font-weight: 700; }
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: end;
}
.admin-toolbar .grow { flex: 1 1 16rem; }
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.admin-table th {
  color: var(--gold);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.admin-table th.sortable {
  cursor: pointer;
  user-select: none;
}
.admin-table th.sortable:hover { color: var(--ink); }
.admin-table th.sortable.asc::after { content: " ▲"; font-size: 0.7em; }
.admin-table th.sortable.desc::after { content: " ▼"; font-size: 0.7em; }
.field-hint { color: var(--muted); font-size: 0.82rem; margin: 0.25rem 0 0; }
.narrow-field .compact-input,
.days-input,
.pager-goto input {
  padding: 0.35rem 0.4rem;
  text-align: center;
  justify-self: start;
}
.narrow-field .compact-input,
.days-input {
  width: 4.6rem;
  max-width: 4.6rem;
}
.mode-card .days-input {
  position: relative;
  z-index: 1;
  margin-top: 0.35rem;
}
.admin-table .row-actions { margin-top: 0; }
.chart-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 1rem;
}
.chart-grid.even { grid-template-columns: 1fr 1fr; }
.chart-card h2 { margin: 0 0 0.6rem; font-size: 1.15rem; }
.chart-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg .chart-axis { fill: var(--muted); }
.chart-svg .chart-gridline { stroke: var(--line); }
.chart-svg .chart-label { fill: var(--ink); }
.chart-svg .chart-value { fill: var(--gold); }
.chart-svg .chart-hole { fill: var(--bg); }
.chart-svg-donut { max-width: 16rem; }
.chart-svg-donut .chart-label {
  fill: #fff6e8;
  stroke: #0b1220;
  stroke-width: 3px;
  paint-order: stroke fill;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
  gap: 0.45rem 0.8rem;
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.86rem;
  width: 100%;
}
.chart-tooltip {
  position: fixed;
  z-index: 30;
  pointer-events: none;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0.35rem 0.55rem;
  border-radius: 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.chart-tooltip[hidden] { display: none; }
.list-title-link {
  color: inherit;
  text-decoration: none;
}
.list-title-link:hover { color: var(--gold); }
.detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 1.2rem;
}
.detail-meta div {
  display: grid;
  gap: 0.15rem;
}
.detail-meta dt { color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.detail-meta dd,
.runtime-list dd { margin: 0; font-weight: 700; }
.slice-color,
.legend-swatch {
  display: inline-block;
  border-radius: 50%;
  margin-right: 0.35rem;
}
.slice-color {
  width: 0.9rem;
  height: 0.9rem;
  vertical-align: -0.1rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.legend-swatch {
  width: 0.7rem;
  height: 0.7rem;
  vertical-align: -0.05rem;
}
.log-kind {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cyan);
}
.runtime-list { margin: 0; display: grid; gap: 0.45rem; }
.runtime-list div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 0.35rem;
}
.runtime-list dt { color: var(--muted); }
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.pager-goto {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}
.pager-goto input { width: 3.6rem; }
.pager-goto .btn {
  padding: 0.35rem 0.7rem;
}
.pager-size {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}
.pager-size select {
  min-width: 4.5rem;
}
.mod-general {
  display: grid;
  gap: 0.35rem;
}
.mod-subgroup {
  display: grid;
  gap: 0.85rem;
  padding: 1.15rem 0 0.55rem;
  border-top: 1px solid var(--line);
}
.mod-general > .mod-subgroup:first-of-type {
  border-top: 0;
  padding-top: 0.45rem;
}
.mod-subgroup .narrow-field {
  max-width: 14rem;
}
.filter-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.admin-side a.on,
.admin-side a[aria-current="page"] {
  background: var(--on-fill);
  color: var(--gold);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 35%, transparent);
}
html[data-theme="readable"] .sky::after {
  background: radial-gradient(circle at 20% 10%, rgba(230, 159, 0, 0.22), transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(86, 180, 233, 0.16), transparent 35%);
}
html[data-theme="readable"] .form-msg,
html[data-theme="readable"] .field-error {
  color: var(--gold);
}
html[data-theme="readable"] input:user-invalid,
html[data-theme="readable"] textarea:user-invalid,
html[data-theme="readable"] select:user-invalid {
  border-color: var(--gold);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-wheel, .winner-card, .winner-icon, .winner-name { animation: none; }
  .btn-spinner { animation: none; border-right-color: currentColor; }
}

@media (max-width: 820px) {
  .sky {
    background-image:
      linear-gradient(180deg, rgba(22, 11, 46, 0.28), rgba(22, 11, 46, 0.7)),
      url("/static/img/festival-street.jpg");
  }
  .hero,
  .split,
  .admin-hero,
  .chart-grid,
  .chart-grid.even { grid-template-columns: 1fr; }
  .hero-booth { position: static; width: 55%; margin-top: 0.8rem; }
  .btn.nav-toggle { display: inline-flex; }
  .slice-extras { grid-template-columns: 1fr; }
  .vis-grid,
  .mod-access-grid { grid-template-columns: 1fr; }
  .nav {
    display: none;
    position: absolute;
    top: 64px;
    right: 0.8rem;
    left: 0.8rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: 0.8rem;
    flex-direction: column;
    align-items: stretch;
  }
  .nav.open { display: flex; gap: 0.75rem; }
  .nav a { display: flex; }
  .nav a:not(.nav-account) + a:not(.nav-account)::before { display: none; }
  .slice-row { grid-template-columns: 1fr; }
  .admin { grid-template-columns: 1fr; }
  .admin-side {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(7.2rem, 1fr));
  }
  .admin-hero.account-hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "art"
      "actions";
  }
  .stat-grid.row-5,
  .stat-grid.row-4,
  .stat-grid.row-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-meta { grid-template-columns: 1fr; }
  .log-list li { grid-template-columns: 1fr; }
}

@media (prefers-contrast: more) {
  :root {
    --muted: #fff6e8;
    --card: #160b2e;
    --line: #ffd166;
    --ghost-fill: #160b2e;
    --panel: #160b2e;
    --inset: #160b2e;
  }
  html[data-theme="readable"] {
    --muted: #ffffff;
    --card: #0b1220;
    --line: #f0e442;
    --ghost-fill: #0b1220;
    --panel: #0b1220;
    --inset: #0b1220;
  }
  .sky {
    background-image: none;
    background-color: var(--bg);
  }
  .sky::after { display: none; }
  .top { background: var(--bg); backdrop-filter: none; }
  .card,
  .stat,
  .history li,
  .log-list li,
  .admin-side { background: var(--card); }
}

@media (max-height: 540px) {
  .top { position: static; }
  .admin-side { position: static; }
}

.bingo-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr));
  gap: 0.4rem;
  margin: 1rem 0;
}
.bingo-cell {
  min-height: 5.5rem;
  border: 2px solid var(--line);
  border-radius: 0.7rem;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
  cursor: pointer;
  text-align: center;
}
.bingo-cell .cell-kind {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bingo-cell .cell-name { font-weight: 700; line-height: 1.2; }
.bingo-cell.claimed {
  background: color-mix(in srgb, var(--pink) 35%, var(--card));
  outline: 3px solid var(--gold);
}
.win-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 2, 20, 0.72);
  display: grid;
  place-items: center;
  z-index: 40;
  padding: 1rem;
}
.win-overlay[hidden] { display: none !important; }
.win-dialog {
  background: var(--card);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.4rem;
  max-width: 28rem;
  text-align: center;
}
.win-mascots { height: 7rem; width: auto; }
.cue-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.cue-list li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.7rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.brand img {
  object-fit: contain;
  background: transparent;
}
.hero-art { position: relative; }
.mascot-pair { max-height: 8rem; width: auto; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: end;
  margin: 1rem 0;
}
