/* App styles. Brand colors live in :root below. */
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&family=Big+Shoulders+Display:wght@600;800;900&display=swap');

:root {
  /* Brand palette: violet, eclipse black, deep gold. Change these to rebrand the whole app. */
  --violet: #6b3fd4;
  --violet-deep: #4a2a9a;
  --violet-soft: #ebe4fb;
  --eclipse: #17121f;
  --bleacher: #f1eef8;      /* page background */
  --bleacher-2: #f7f5fc;    /* subtle fills */
  --ink: #17121f;           /* text and dark UI */
  --ink-2: #3b3350;
  --muted: #625b73;
  --line: #d3cce3;
  --chalk: #ffffff;
  --gold: #c9a227;
  --gold-ink: #17121f;
  --turf: #1d7a4c;          /* paid */
  --turf-soft: #dcf1e5;
  --flag: #c8102e;          /* unpaid / errors */
  --flag-soft: #fbe3e6;
  --display: 'Big Shoulders Display', 'Arial Narrow', Impact, sans-serif;
  --body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-sm: 6px;
  --r-md: 10px;
  --shadow: 0 1px 0 rgba(23, 18, 31, 0.06), 0 10px 26px -14px rgba(74, 42, 154, 0.45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bleacher);
}
img { max-width: 100%; }
a { color: var(--ink); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.02; margin: 0 0 0.5rem; letter-spacing: 0.005em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 900; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); font-weight: 800; }
h3 { font-size: 1.45rem; font-weight: 800; }
p { margin: 0 0 1rem; max-width: 68ch; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- layout ---------- */
.wrap { width: min(1180px, 100% - 2rem); margin-inline: auto; }
.topbar { background: var(--eclipse); color: var(--chalk); border-bottom: 4px solid var(--violet); }
.topbar .wrap { display: flex; align-items: center; gap: 1rem; min-height: 60px; flex-wrap: wrap; }
.brand { font-family: var(--display); font-weight: 900; font-size: 1.6rem; color: var(--chalk); text-decoration: none; display: flex; align-items: center; gap: 0.5rem; }
.brand-mark { display: inline-grid; grid-template-columns: repeat(3, 7px); gap: 2px; }
.brand-mark i { width: 7px; height: 7px; background: var(--chalk); opacity: 0.35; }
.brand-mark i { background: var(--violet) !important; opacity: 1 !important; }
.brand-mark i:nth-child(5) { background: var(--gold) !important; }
.topbar nav { margin-left: auto; display: flex; gap: 0.25rem; align-items: center; flex-wrap: wrap; }
.topbar nav a, .topbar nav button { color: var(--chalk); text-decoration: none; padding: 0.4rem 0.7rem; border-radius: var(--r-sm); background: none; border: 0; font: inherit; cursor: pointer; }
.topbar nav a:hover, .topbar nav button:hover { background: rgba(255, 255, 255, 0.1); }
.topbar nav a.credit-chip, .credit-chip { background: var(--gold); color: var(--gold-ink); font-weight: 700; }
.topbar nav a.credit-chip:hover { background: #dcb535; }
main { padding: 2rem 0 4rem; }
footer.site { border-top: 1px solid var(--line); padding: 1.5rem 0 2.5rem; font-size: 0.875rem; color: var(--muted); }
footer.site .wrap { display: flex; gap: 1.25rem; flex-wrap: wrap; }

.panel { background: var(--chalk); border-radius: var(--r-md); padding: 1.25rem; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 1rem; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: end; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.25rem; align-items: start; }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } }

/* ---------- controls ---------- */
label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 0.25rem; }
.field { margin-bottom: 0.9rem; min-width: 0; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 0.85rem; margin-top: 0.25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=tel], input[type=search], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--chalk);
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.55rem 0.7rem;
  min-height: 44px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 3px rgba(107, 63, 212, 0.3); }
input[type=color] { width: 48px; height: 44px; border: 2px solid var(--line); border-radius: var(--r-sm); padding: 2px; background: var(--chalk); cursor: pointer; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; }
.check input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--violet); flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 44px; padding: 0.5rem 1rem;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  border-radius: var(--r-sm); border: 2px solid var(--ink);
  background: var(--chalk); color: var(--ink);
}
.btn:hover { background: var(--bleacher-2); }
.btn-primary { background: var(--violet); border-color: var(--violet); color: #fff; }
.btn-primary:hover { background: var(--violet-deep); border-color: var(--violet-deep); }
.btn-dark { background: var(--eclipse); border-color: var(--eclipse); color: var(--chalk); }
.btn-dark:hover { background: var(--violet-deep); border-color: var(--violet-deep); }
.btn-danger { border-color: var(--flag); color: var(--flag); }
.btn-danger:hover { background: var(--flag-soft); }
.btn-turf { background: var(--turf); border-color: var(--turf); color: var(--chalk); }
.btn-turf:hover { background: #185a3c; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 36px; padding: 0.3rem 0.7rem; font-size: 0.9rem; }
.btn[disabled], .btn[aria-busy=true] { opacity: 0.55; cursor: not-allowed; }

.pill { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; background: var(--bleacher-2); color: var(--ink-2); white-space: nowrap; }
.pill-live { background: var(--flag); color: var(--chalk); }
.pill-ok { background: var(--turf-soft); color: var(--turf); }
.pill-warn { background: #f6ebc4; color: #5a4600; }
.pill-bad { background: var(--flag-soft); color: var(--flag); }

.notice { border-left: 6px solid var(--gold); background: #fbf5e1; padding: 0.75rem 1rem; border-radius: var(--r-sm); margin-bottom: 1rem; }
.notice p:last-child { margin-bottom: 0; }
.notice-bad { border-color: var(--flag); background: var(--flag-soft); }
.notice-ok { border-color: var(--turf); background: var(--turf-soft); }
.notice-info { border-color: var(--violet); background: var(--violet-soft); }

table.data { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.data th { text-align: left; font-size: 0.85rem; color: var(--muted); font-weight: 700; padding: 0.5rem; border-bottom: 2px solid var(--line); }
table.data td { padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--bleacher); vertical-align: middle; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

/* ---------- toast + dialog ---------- */
#toasts { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); display: grid; gap: 0.5rem; z-index: 100; width: min(460px, calc(100% - 2rem)); }
.toast { background: var(--ink); color: var(--chalk); padding: 0.75rem 1rem; border-radius: var(--r-sm); box-shadow: var(--shadow); animation: toast-in 0.18s ease-out; }
.toast-bad { background: var(--flag); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
dialog { border: 0; border-radius: var(--r-md); padding: 1.5rem; max-width: min(480px, calc(100% - 2rem)); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(20, 33, 61, 0.55); }
dialog .row { justify-content: flex-end; margin-top: 1.25rem; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 0.25rem; border-bottom: 3px solid var(--violet); margin-bottom: 1.25rem; overflow-x: auto; scrollbar-width: thin; }
.tabs button { font: inherit; font-weight: 700; padding: 0.6rem 1rem; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; border-radius: var(--r-sm) var(--r-sm) 0 0; white-space: nowrap; min-height: 44px; }
.tabs button[aria-selected=true] { background: var(--violet); color: var(--chalk); }

/* ---------- the squares board ---------- */
.board-wrap { --b-primary: var(--violet-deep); --b-accent: var(--gold); --b-bg: #fff; --b-text: var(--ink); --b-head: var(--display); --b-body: var(--body); }
.board-teams { display: grid; grid-template-columns: 2.4rem 1fr; }
.board-top-team { grid-column: 2; text-align: center; font-family: var(--b-head); font-weight: 800; font-size: 1.35rem; color: var(--b-primary); padding-bottom: 0.25rem; overflow-wrap: anywhere; }
.board-side-team { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-family: var(--b-head); font-weight: 800; font-size: 1.35rem; color: var(--b-primary); padding-left: 0.4rem; overflow-wrap: anywhere; }
.board {
  display: grid;
  grid-template-columns: minmax(28px, 0.7fr) repeat(10, minmax(0, 1fr));
  border: 3px solid var(--b-primary);
  background: var(--b-primary);
  gap: 2px;
  font-family: var(--b-body);
  user-select: none;
  -webkit-user-select: none;
}
.board .h {
  background: var(--b-primary); color: #fff;
  display: grid; place-items: center;
  font-family: var(--b-head); font-weight: 900; font-size: clamp(1rem, 2.6vw, 1.6rem);
  aspect-ratio: 1 / 1; min-height: 28px;
}
.board .h.corner { font-size: 0.65rem; font-family: var(--b-body); font-weight: 700; opacity: 0.85; text-align: center; line-height: 1.1; }
.board .h.hot { background: var(--b-accent); color: #111; }
.sq {
  position: relative; aspect-ratio: 1 / 1; background: var(--b-bg); color: var(--b-text);
  display: grid; place-items: center; text-align: center;
  font-size: clamp(0.5rem, 1.25vw, 0.82rem); line-height: 1.05; padding: 2px;
  overflow: hidden; border: 0; font-family: inherit; min-width: 0;
}
button.sq { cursor: pointer; }
button.sq:hover { filter: brightness(0.95); }
.sq .ini { display: none; font-weight: 700; }
@media (max-width: 600px) {
  .sq .nm { display: none !important; }
  .sq .ini { display: block; font-size: 0.7rem; letter-spacing: 0; }
  .sq.unpaid::after, .sq.paid::after { display: none; }
  .sq.unpaid { box-shadow: inset 0 -4px 0 var(--flag); }
  .sq.paid { box-shadow: inset 0 -4px 0 var(--turf); }
  .board-side-team, .board-top-team { font-size: 1.1rem; }
  .board-teams { grid-template-columns: 1.8rem 1fr; }
  .sq .no { display: none; }
  .sq.open .ini { opacity: 0.35; font-weight: 400; }
}
.sq .nm { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-weight: 700; }
.sq .no { position: absolute; top: 1px; left: 3px; font-size: 0.6em; opacity: 0.45; }
.sq.open .nm { font-weight: 400; opacity: 0.4; }
.sq.unpaid::after { content: ''; position: absolute; right: 3px; top: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--flag); }
.sq.paid::after { content: ''; position: absolute; right: 3px; top: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--turf); }
.sq.sel { outline: 3px solid var(--b-accent); outline-offset: -3px; background: color-mix(in srgb, var(--b-accent) 28%, var(--b-bg)); }
.sq.mine { background: color-mix(in srgb, var(--b-accent) 35%, var(--b-bg)); }
.sq.winner { background: var(--b-accent); color: #111; }
.sq.winner .trophy { position: absolute; bottom: 1px; right: 3px; font-size: 0.7em; font-weight: 700; }
.sq.current { box-shadow: inset 0 0 0 3px var(--flag); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: inset 0 0 0 5px var(--flag); } }
.legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.85rem; color: var(--muted); margin-top: 0.6rem; }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 0.35rem; vertical-align: -1px; }
.legend .l-paid::before { background: var(--turf); }
.legend .l-unpaid::before { background: var(--flag); }
.legend .l-win::before { background: var(--gold); border-radius: 2px; }
.legend .l-now::before { background: none; border: 2px solid var(--flag); border-radius: 2px; }

/* ---------- scoreboard panel ---------- */
.scoreboard { background: var(--eclipse); border-top: 5px solid var(--violet); color: #fff; border-radius: var(--r-md); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.scoreboard .sb-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.scoreboard .sb-status { font-weight: 700; }
.scoreboard .sb-teams { display: grid; gap: 0.35rem; }
.scoreboard .sb-team { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 0.6rem; }
.scoreboard .sb-team img { width: 30px; height: 30px; object-fit: contain; background: #fff; border-radius: 4px; padding: 2px; }
.scoreboard .sb-team .ph { width: 30px; height: 30px; border-radius: 4px; background: rgba(255,255,255,0.15); display: grid; place-items: center; font-family: var(--display); font-weight: 800; }
.scoreboard .sb-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scoreboard .sb-name small { font-weight: 400; opacity: 0.7; }
.scoreboard .sb-score { font-family: var(--display); font-weight: 900; font-size: 2.6rem; line-height: 1; min-width: 2ch; text-align: right; color: var(--gold); font-variant-numeric: tabular-nums; }
.scoreboard .sb-lines { width: 100%; margin-top: 0.75rem; border-collapse: collapse; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.scoreboard .sb-lines th, .scoreboard .sb-lines td { padding: 0.15rem 0.3rem; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.12); }
.scoreboard .sb-lines th:first-child, .scoreboard .sb-lines td:first-child { text-align: left; }
.scoreboard .sb-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.8rem; font-size: 0.85rem; opacity: 0.95; }
.scoreboard .btn { border-color: rgba(255,255,255,0.6); background: transparent; color: #fff; }
.scoreboard .btn:hover { background: rgba(255,255,255,0.12); }
.scoreboard .sb-note { background: rgba(255,255,255,0.1); border-left: 4px solid var(--gold); padding: 0.5rem 0.7rem; border-radius: 4px; font-size: 0.875rem; margin-top: 0.75rem; }
.scoreboard .sb-note.bad { border-color: var(--flag); }
.scoreboard .sb-toggle { display: flex; align-items: center; gap: 0.4rem; font-weight: 400; margin: 0; }
.scoreboard .sb-toggle input { width: 18px; height: 18px; accent-color: var(--gold); }

/* payouts list */
.payouts { list-style: none; margin: 0; padding: 0; }
.payouts li { display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 0.75rem; padding: 0.7rem 0; border-bottom: 1px solid var(--bleacher); }
.payouts li:last-child { border-bottom: 0; }
.payouts .p-label { font-weight: 700; }
.payouts .p-amt { font-family: var(--display); font-weight: 800; font-size: 1.35rem; text-align: right; }
.payouts .p-detail { grid-column: 1 / -1; font-size: 0.9rem; color: var(--muted); }
.payouts .p-detail strong { color: var(--ink); }

/* ---------- landing ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; padding: 1.5rem 0 3rem; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.hero h1 { max-width: 12ch; }
.hero .lede { font-size: 1.2rem; max-width: 46ch; }
.hero-board { background: var(--chalk); padding: 1rem; border-radius: var(--r-md); box-shadow: var(--shadow); transform: rotate(-1.2deg); }
.hero-board .sq .nm { display: none; }
.hero-board .sq .ini { display: block; font-size: 0.72rem; }
.hero-board .board .h.drawing { animation: flicker 0.09s steps(2) 10; }
@keyframes flicker { 50% { color: var(--gold); } }
.price-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.ticket { background: var(--chalk); border-radius: var(--r-md); padding: 1.4rem 1.4rem 1.2rem; position: relative; box-shadow: var(--shadow); border-top: 8px solid var(--violet); }
.ticket.best { border-top-color: var(--gold); }
.ticket .price { font-family: var(--display); font-weight: 900; font-size: 3.4rem; line-height: 1; }
.ticket .per { color: var(--muted); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; counter-reset: step; }
.steps li { counter-increment: step; background: var(--chalk); border-radius: var(--r-md); padding: 1rem; box-shadow: var(--shadow); }
.steps li::before { content: counter(step); font-family: var(--display); font-weight: 900; font-size: 2.2rem; color: var(--violet); display: block; line-height: 1; margin-bottom: 0.3rem; }
section.block { padding: 2.5rem 0; }

/* ---------- dashboard ---------- */
.sheet-list { display: grid; gap: 0.75rem; }
.sheet-card { background: var(--chalk); border-radius: var(--r-md); padding: 1rem 1.1rem; box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 1rem; align-items: center; text-decoration: none; color: inherit; border-left: 8px solid var(--line); }
.sheet-card.active { border-left-color: var(--turf); }
.sheet-card:hover { outline: 2px solid var(--violet); }
.sheet-card h3 { margin: 0; }
.meter { height: 8px; background: var(--bleacher); border-radius: 4px; overflow: hidden; margin-top: 0.4rem; }
.meter i { display: block; height: 100%; background: var(--turf); }
.empty { text-align: center; padding: 2.5rem 1rem; }

/* ---------- manager ---------- */
.action-bar { position: sticky; bottom: 0; z-index: 5; }
.sel-count { font-family: var(--display); font-weight: 800; font-size: 1.4rem; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.75rem; }
.stat { background: var(--bleacher-2); border-radius: var(--r-sm); padding: 0.6rem 0.75rem; }
.stat b { display: block; font-family: var(--display); font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.stat span { font-size: 0.85rem; color: var(--muted); }
.payout-editor .pe-row { display: grid; grid-template-columns: 1fr 120px 90px 44px; gap: 0.5rem; align-items: end; margin-bottom: 0.5rem; }
@media (max-width: 520px) { .payout-editor .pe-row { grid-template-columns: 1fr 1fr; } }
.game-list { display: grid; gap: 0.5rem; max-height: 420px; overflow: auto; padding-right: 4px; }
.game-opt { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; align-items: center; padding: 0.6rem 0.75rem; border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--chalk); text-align: left; font: inherit; color: inherit; cursor: pointer; }
.game-opt:hover { border-color: var(--violet); }
.game-opt.on { border-color: var(--turf); background: var(--turf-soft); }
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; }
.swatch { display: flex; gap: 0.6rem; align-items: center; }
.swatch label { margin: 0; }
.img-preview { max-height: 160px; border-radius: var(--r-sm); border: 2px solid var(--line); background: var(--bleacher-2); }
.qr-box { display: grid; grid-template-columns: 200px 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 560px) { .qr-box { grid-template-columns: 1fr; } }
.qr-box img { width: 200px; height: 200px; background: #fff; border-radius: var(--r-sm); border: 2px solid var(--line); }
.copy-field { display: flex; gap: 0.5rem; }
.copy-field input { flex: 1; }

/* ---------- public board ---------- */
.board-page { min-height: 100vh; background: var(--b-page, var(--bleacher)); font-family: var(--b-body, var(--body)); color: var(--ink); }
.board-page h1, .board-page h2, .board-page h3 { font-family: var(--b-head, var(--display)); }
.mobile-sel { display: none; }
@media (max-width: 960px) {
  .mobile-sel:not(.hidden) { display: flex; gap: 0.5rem; align-items: center; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom)); background: var(--eclipse); color: #fff; border-top: 4px solid var(--violet); }
  .mobile-sel span { flex: 1; font-weight: 700; }
}
.sb-mobile { display: none; margin-bottom: 1rem; }
@media (max-width: 960px) {
  .sb-mobile { display: block; }
  .sb-desktop { display: none; }
}
.board-header { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; margin-bottom: 1.25rem; }
.board-header img { max-height: 110px; max-width: 220px; border-radius: var(--r-sm); object-fit: contain; }
.board-header h1 { font-size: clamp(2rem, 5vw, 3.4rem); color: var(--b-primary, var(--ink)); margin: 0; }
.conn { font-size: 0.8rem; display: inline-flex; align-items: center; gap: 0.35rem; }
.conn::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--turf); }
.conn.off::before { background: var(--flag); }
.claim-bar { position: sticky; bottom: 0; background: var(--eclipse); border-top: 4px solid var(--violet); color: #fff; padding: 0.75rem 0; z-index: 10; box-shadow: 0 -6px 20px rgba(0,0,0,0.25); }
.claim-bar .wrap { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }

/* ---------- print poster ---------- */
.poster { background: #fff; max-width: 8.5in; margin: 0 auto; padding: 0.5in; min-height: 11in; display: flex; flex-direction: column; gap: 0.3in; text-align: center; }
.poster h1 { font-size: 0.75in; }
.poster .qr { width: 4.2in; height: 4.2in; margin: 0 auto; }
.poster .url { font-size: 18pt; font-weight: 700; word-break: break-all; }
@media print {
  .no-print { display: none !important; }
  body, .board-page { background: #fff !important; }
  .poster { padding: 0; min-height: auto; }
}

/* prose pages */
.prose { background: var(--chalk); border-radius: var(--r-md); padding: clamp(1.25rem, 4vw, 2.5rem); box-shadow: var(--shadow); max-width: 820px; }
.prose h2 { margin-top: 1.75rem; font-size: 1.7rem; }
.prose li { margin-bottom: 0.4rem; max-width: 68ch; }

/* stars */
.stars { display: flex; gap: 0.25rem; }
.star { font-size: 2rem; line-height: 1; width: 44px; height: 44px; border: 0; background: none; color: var(--line); cursor: pointer; border-radius: var(--r-sm); }
.star.on { color: var(--gold); -webkit-text-stroke: 1px var(--gold-ink); }
.stars-static { color: var(--gold); -webkit-text-stroke: 0.5px var(--gold-ink); font-size: 1.2rem; letter-spacing: 0.1em; }
.muted-on-dark { opacity: 0.75; }

/* directory */
.cause-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.cause-card { display: flex; flex-direction: column; background: var(--chalk); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: inherit; border-top: 6px solid var(--c, var(--ink)); }
.cause-card:hover { outline: 2px solid var(--violet); }
.cause-img { height: 140px; background: var(--c, var(--ink)); display: grid; place-items: center; overflow: hidden; }
.cause-img img { width: 100%; height: 100%; object-fit: cover; }
.cause-img span { font-family: var(--display); font-weight: 900; font-size: 4rem; color: var(--a, var(--gold)); }
.cause-body { padding: 1rem; }
.cause-body h3 { margin: 0.4rem 0 0.2rem; }
.cause-body p { margin: 0.5rem 0; }
.story { white-space: pre-line; }
.donor { padding: 0.5rem 0; border-bottom: 1px solid var(--bleacher); }
.donor:last-child { border-bottom: 0; }
.amount-pick { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.amount-pick button[aria-pressed=true] { background: var(--violet); border-color: var(--violet); color: var(--chalk); }
