/* Lotus Leaderboard — crimson + gold brand, executed as a clean, modern
   dashboard rather than a poster/flyer: restrained accent color, a real
   typographic scale, and a proper data table. Light theme only, by design.
   Self-contained (shares only firebase.js / firebase-config.js with the
   rest of the hub, not any app UI). */

:root {
  --brand:      #b91c2b;
  --brand-hover:#9c1724;
  --accent:     #b91c2b;
  --accent-bg:  #fcebed; /* soft brand-red tint for highlights (was a cream/yellow) */
  --bg:         #f5f5f4;
  --card:       #ffffff;
  --ink:        #1c1a19;
  --ink-2:      #524c4a;
  --muted:      #6f6865; /* ≥4.5:1 on white, for small helper text */
  --line:       #e7e3e1;
  --field:      #faf9f8;
  --thead-bg:   #faf9f8;
  --shadow:     0 12px 28px rgba(28, 20, 20, .08);
  --shadow-sm:  0 1px 3px rgba(28, 20, 20, .06);
  --danger:     #b3261e;
  --gold:       #c8860d;
  --silver:     #6e7787; /* darkened from #8b93a0 so white numbers pass contrast */
  --bronze:     #a35d28;
  --zebra:      rgba(28, 20, 20, .015);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg);
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5; -webkit-text-size-adjust: 100%; letter-spacing: -.005em;
}
.glow {
  position: fixed; inset: 0 0 auto 0; height: 280px; z-index: 0; pointer-events: none;
  background:
    radial-gradient(560px 260px at 15% -25%, rgba(185,28,43,.10), transparent 70%),
    radial-gradient(440px 220px at 95% -15%, rgba(185,28,43,.07), transparent 70%);
}
.wrap { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; padding: 32px 16px 8px; }

.hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.hd-brand { display: flex; align-items: center; gap: 14px; }
.hd-logo {
  display: grid; place-items: center; width: 52px; height: 52px; flex: none; overflow: hidden;
  border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
}
.hd-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.hd-eyebrow { margin: 0 0 2px; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--brand); }
.hd h1 {
  margin: 0; font-size: 1.4rem; line-height: 1.2; font-weight: 800; letter-spacing: -.02em;
}
.hd-sub { margin: 3px 0 0; color: var(--muted); font-size: .78rem; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.countdown {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 800;
  letter-spacing: .01em; background: color-mix(in srgb, var(--brand), transparent 90%); color: var(--brand);
}
.countdown.before { background: var(--accent-bg); color: var(--brand); }
.countdown.ended { background: var(--field); color: var(--muted); border: 1px solid var(--line); }
.hd-actions { display: flex; gap: 8px; flex: none; position: relative; }
.share-wrap, .menu-wrap { position: relative; }
.icon-btn.share-btn { width: auto; padding: 0 16px; gap: 8px; display: inline-flex; align-items: center; font: inherit; font-weight: 700; font-size: .88rem; color: var(--ink); }
.icon-btn.share-btn svg { width: 17px; height: 17px; }
.menu a {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 8px;
  font-size: .9rem; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap;
}
.menu a svg { width: 17px; height: 17px; flex: none; color: var(--muted); }
.menu a:hover, .menu a:focus-visible { background: var(--field); outline: none; color: var(--brand); }
.story-card { text-align: center; }
.story-card .lock-copy { text-align: left; }
.story-preview { margin: 4px auto 14px; max-width: 260px; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--field); box-shadow: var(--shadow); }
.story-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.story-card .form-actions { justify-content: center; }
.btn[disabled] { opacity: .5; cursor: default; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 230px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.menu button {
  appearance: none; display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
  border: 0; border-radius: 8px; background: none; font: inherit; font-size: .9rem; font-weight: 600;
  color: var(--ink); text-align: left; cursor: pointer; white-space: nowrap;
}
.menu button svg { width: 17px; height: 17px; flex: none; color: var(--muted); }
.menu button:hover, .menu button:focus-visible { background: var(--field); outline: none; color: var(--brand); }
.menu button:hover svg, .menu button:focus-visible svg { color: var(--brand); }
.icon-btn {
  appearance: none; width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--card); border-radius: 11px; color: var(--ink-2);
  cursor: pointer; transition: border-color .15s, background .15s; box-shadow: var(--shadow-sm);
}
.icon-btn svg { width: 18px; height: 18px; display: block; }
.icon-btn:hover { border-color: var(--brand); background: var(--field); color: var(--brand); }

.banner {
  margin: 0 0 16px; padding: 11px 14px; border-radius: 10px; font-size: .86rem;
  background: var(--field); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  color: var(--ink-2);
}

/* Prize callout under the header: compact, with the actual paddle */
.prize {
  position: relative; display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 10px 22px 10px 12px;
  border-radius: 16px; border: 1px solid color-mix(in srgb, var(--brand), transparent 72%);
  background: linear-gradient(100deg, var(--accent-bg), #fff 85%);
  box-shadow: var(--shadow-sm);
}
/* The paddle button covers the whole banner (::after), so one tap anywhere
   opens the full-size photo; the shop link lives in that view. */
.prize-zoom {
  appearance: none; border: 0; background: none; padding: 0; margin: 0; flex: none;
  cursor: zoom-in; display: block; color: inherit;
}
.prize-zoom::after { content: ""; position: absolute; inset: 0; border-radius: 16px; z-index: 1; }
.prize-zoom:focus-visible { outline: none; }
.prize:has(.prize-zoom:focus-visible) { outline: 2px solid var(--brand); outline-offset: 3px; }
.prize:hover { border-color: var(--brand); }
.pz-wrap { position: relative; display: block; }
.pz-badge {
  position: absolute; right: -6px; bottom: 2px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(28, 20, 20, .25);
}
.pz-badge svg { width: 11px; height: 11px; }
.prize:hover .pz-badge { background: var(--brand); color: #fff; }
.prize-photo {
  flex: none; width: 36px; height: 72px; object-fit: contain;
  filter: drop-shadow(0 3px 5px rgba(28, 20, 20, .22)); /* transparent cut-out, so the shadow follows the paddle */
}
.prize-txt { min-width: 0; }
.prize-top { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.prize-origin { margin-top: 5px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.prize-sponsor { flex-basis: 100%; font-size: .62rem; font-weight: 600; color: var(--muted); line-height: 1.3; }
.prize-sponsor b { font-weight: 800; color: var(--ink-2); }
.prize-eyebrow {
  font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--brand);
}
.prize-main { font-size: 1.02rem; font-weight: 800; color: var(--ink); line-height: 1.3; margin-top: 1px; letter-spacing: -.01em; }
.prize-inc { margin-top: 2px; font-size: .8rem; font-weight: 600; color: var(--ink-2); line-height: 1.35; }
.prize-meta {
  margin-left: auto; padding-left: 16px; border-left: 1px solid color-mix(in srgb, var(--brand), transparent 72%);
  max-width: 230px; font-size: .84rem; font-weight: 600; color: var(--ink-2); line-height: 1.4; text-align: right;
}

.rank-none a { color: var(--brand); font-weight: 700; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px; box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.card h2 { margin: 0 0 4px; font-size: 1rem; font-weight: 800; }

/* Find-your-rank search + your standing, inside the leaderboard card */
.finder { padding: 14px 22px 4px; }
.finder-search { position: relative; }
.finder-search svg {
  position: absolute; left: 12px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
#rankSearch {
  font: inherit; width: 100%; padding: 10px 14px 10px 38px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--field); color: var(--ink); transition: border-color .15s;
}
#rankSearch:focus { border-color: var(--brand); outline: 3px solid color-mix(in srgb, var(--brand), transparent 85%); }
.rank-matches { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.rank-matches:empty { display: none; }
.rank-match {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: var(--ink);
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer;
}
.rank-match:hover, .rank-match:focus-visible { border-color: var(--brand); outline: none; }
.rank-match .rm-rank { flex: none; min-width: 30px; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.rank-match .rm-name { flex: 1; min-width: 0; font-weight: 700; }
.rank-match .rm-pts { flex: none; color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.rank-none { margin: 0; color: var(--muted); font-size: .84rem; }
.me-strip {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  background: var(--accent-bg); border: 1px solid color-mix(in srgb, var(--brand), transparent 75%);
}
.rank-big {
  flex: none; display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 8px;
  border-radius: 12px; background: var(--brand); color: #fff; font-weight: 800; font-size: 1.1rem;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.rank-big.gold { background: var(--gold); }
.rank-big.silver { background: var(--silver); }
.rank-big.bronze { background: var(--bronze); }
.rank-big.none { background: var(--card); color: var(--muted); border: 1px solid var(--line); }
.me-txt { flex: 1; min-width: 0; }
.me-name { font-weight: 800; font-size: .98rem; letter-spacing: -.01em; }
.me-pts { font-weight: 600; color: var(--ink-2); font-size: .86rem; }
.me-status { color: var(--ink-2); font-size: .82rem; font-weight: 600; margin-top: 1px; }
.me-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; flex: none; max-width: 190px; }
.me-actions .link-btn { flex-basis: 100%; text-align: right; }
.link-btn {
  appearance: none; border: 0; background: none; padding: 2px 0; font: inherit; font-size: .76rem;
  font-weight: 600; color: var(--muted); text-decoration: underline; cursor: pointer;
}
.link-btn:hover { color: var(--ink); }
.no-scores {
  margin: 12px 22px 0; padding: 10px 12px; border-radius: 10px; background: var(--field);
  border: 1px dashed var(--line); color: var(--ink-2); font-size: .84rem;
}
.dupr-warn {
  margin: 12px 22px 0; padding: 10px 12px; border-radius: 10px; font-size: .84rem; line-height: 1.45;
  background: #fff8e1; border: 1px solid #f0c040; color: #5c4400;
}
.dupr-warn .dw-why { display: block; }
.dw-names { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dw-name {
  font: inherit; font-weight: 700; font-size: .8rem; padding: 5px 10px; min-height: 32px; border-radius: 999px;
  background: #fff; border: 1px solid #e0b030; color: #5c4400; cursor: pointer;
}
.dw-name:hover { background: #fff1c2; }
.pod-unit { font-size: .6rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; margin-top: 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;
}

/* Forms */
.form-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.form-row label {
  display: flex; flex-direction: column; gap: 6px; font-size: .8rem; color: var(--ink-2);
  font-weight: 600; flex: 1; min-width: 140px; position: relative;
}
.form-row label.grow { flex: 2 1 260px; }
.lbl {
  display: inline-flex; align-items: center; gap: 6px; width: 100%;
  padding-right: 48px; box-sizing: border-box; /* leaves room for the absolutely-positioned .pt-tag corner */
}
.lbl svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.form-row input[type="text"], .form-row input[type="number"] {
  font: inherit; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--field); color: var(--ink); width: 100%; transition: border-color .15s;
}
.form-row input:focus { border-color: var(--brand); outline: 3px solid color-mix(in srgb, var(--brand), transparent 85%); }
.form-row input[readonly] {
  background: var(--field); color: var(--ink-2); font-weight: 700; cursor: default;
  border-style: dashed;
}
.form-row input[readonly]:focus { border-color: var(--line); outline: none; }
.form-row.counts label { min-width: 120px; }
.pt-tag {
  position: absolute; top: 0; right: 0; font-size: .68rem; font-weight: 700; color: var(--muted);
  background: var(--field); border: 1px solid var(--line); padding: 1px 6px; border-radius: 999px;
}

.section-lbl {
  margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted);
}
.section-lbl:first-of-type { margin-top: 4px; padding-top: 0; border-top: none; }
/* ...except inside the edit panel, where "Admin PIN" is a lone .section-lbl
   sitting below other fields, not the first thing in the card — it still
   needs its divider. */
.edit-panel .section-lbl { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

.preview { font-size: .86rem; color: var(--ink-2); background: var(--field); border-radius: 9px; padding: 10px 12px; margin: 6px 0 14px; }
.preview b { color: var(--brand); font-weight: 800; }

.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--ink-2); margin: 4px 0 0; cursor: pointer; }
.checkbox-row input { width: 16px; height: 16px; flex: none; }
.hint { color: var(--muted); font-size: .78rem; line-height: 1.5; margin: 10px 0 0; }

/* Admin-locked card — same accent language as the leader card, but in
   brand crimson rather than gold, to read as "attention" not "celebration" */
.lock-card { border-left: 3px solid var(--brand); }
.lock-card h2 { display: flex; align-items: center; gap: 8px; }
.lock-icon {
  color: var(--brand); display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 8px; background: var(--accent-bg); flex: none;
}
.lock-icon svg { width: 16px; height: 16px; display: block; }
.lock-copy { color: var(--ink-2); font-size: .88rem; margin: 6px 0 14px; }
.pw-signin { margin-top: 14px; }
.inapp-note {
  margin: 0 0 14px; padding: 12px 14px; border-radius: 10px; background: var(--accent-bg);
  border: 1px solid color-mix(in srgb, var(--brand), transparent 75%); font-size: .86rem; color: var(--ink-2);
}
.inapp-note p { margin: 0 0 10px; }
.pw-signin summary { cursor: pointer; font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.pw-signin[open] summary { margin-bottom: 12px; }
.form-row input[type="email"], .form-row input[type="password"] {
  font: inherit; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--field); color: var(--ink); width: 100%;
}

/* Player-link QR panel */
.qr-card { border-left: 3px solid var(--accent); text-align: center; }
.qr-card .lock-copy { text-align: left; }
.qr-wrap {
  display: inline-block; background: #fff; padding: 14px; border-radius: 12px;
  border: 1px solid var(--line); margin: 4px 0 12px;
}
.qr-wrap svg { display: block; width: 180px; height: 180px; }
.qr-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem;
  color: var(--ink-2); word-break: break-all; background: var(--field); border-radius: 8px;
  padding: 8px 12px; margin: 0 0 14px;
}
.qr-card .form-actions { justify-content: center; }

.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 10px 18px; border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: #fff; border-color: transparent; }
.btn.primary:hover { background: var(--brand-hover); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger), transparent 55%); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger), transparent 92%); }
.btn.small { padding: 6px 11px; font-size: .78rem; border-radius: 8px; }

.form-msg { margin: 10px 0 0; font-size: .84rem; color: var(--muted); min-height: 1.2em; }
.form-msg.err { color: var(--danger); }
.form-msg.ok { color: #0f9d58; }

/* Board — a clean data-table card: quiet header bar, light table head with
   a brand underline, flat rank-medal chips. */
.board-card { padding: 0; overflow: hidden; }
.board-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 22px; border-bottom: 1px solid var(--line);
}
.board-head h2 {
  margin: 0; display: flex; align-items: center; gap: 8px; font-weight: 800;
  font-size: 1.05rem; letter-spacing: -.01em; color: var(--ink);
}
.bh-title { min-width: 0; }
.bh-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; margin-top: 2px; }
.bh-meta:empty, .bh-meta:not(:has(span:not(:empty))) { display: none; }
.board-head .count {
  color: var(--muted); font-size: .8rem; font-weight: 600; white-space: nowrap;
}
.last-updated { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.empty { color: var(--muted); text-align: center; padding: 32px 18px; font-size: .92rem; }
.table-wrap { overflow-x: auto; padding: 0 22px 20px; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 440px; }
th, td { padding: 12px 8px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th.rank, td.rank { text-align: center; width: 40px; }
th.name, td.name { text-align: left; white-space: normal; }
thead tr { background: var(--thead-bg); }
th {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
  color: var(--muted); border-bottom: 2px solid var(--brand); padding-top: 13px; padding-bottom: 13px;
}
tbody tr.zebra td { background: var(--zebra); }
tbody tr.player-row { cursor: pointer; }
tbody tr.player-row:hover td { background: color-mix(in srgb, var(--brand), transparent 96%); }
tbody tr.open td { border-bottom-color: transparent; }
td.total, th.total { color: var(--brand); font-weight: 800; }
.m-only { display: none; }
.move {
  display: inline-flex; align-items: center; gap: 1px; font-size: .7rem; font-weight: 800;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.move span[aria-hidden] { font-size: .6rem; }
.move.up { color: #0f7b45; }
.move.down { color: var(--danger); }

/* Rank medal chips — flat fills, not glossy gradients */
.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; font-weight: 700; font-size: .78rem;
  color: var(--ink-2); background: var(--field); border: 1px solid var(--line);
}
.rank-badge.gold   { background: var(--gold);   color: #fff; border: none; }
.rank-badge.silver { background: var(--silver); color: #fff; border: none; }
.rank-badge.bronze { background: var(--bronze); color: #fff; border: none; }

tbody tr.leader-row td { background: var(--accent-bg); font-weight: 700; }
tbody tr.leader-row:hover td { background: var(--accent-bg); }
tr.me-row td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.you-pill {
  flex: none; padding: 1px 7px; border-radius: 999px; background: var(--brand); color: #fff;
  font-size: .62rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; line-height: 1.5;
}
.player-name { font-weight: 700; }
.board-hint { margin: 12px 0 0; color: var(--muted); font-size: .78rem; text-align: center; }
.name-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 0; margin: 0; border: 0; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 4px;
}
.name-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.chev {
  flex: none; width: 7px; height: 7px; margin-top: -3px; border-right: 2px solid var(--brand); border-bottom: 2px solid var(--brand);
  transform: rotate(45deg); transition: transform .15s ease;
}
tr.open .chev { transform: rotate(-135deg); margin-top: 3px; }

/* Points breakdown: extra rows under a tapped player, in the table's own columns */
tbody tr.bd-row td {
  background: var(--field); padding-top: 7px; padding-bottom: 7px; border-bottom: 0; font-size: .82rem;
  color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums;
}
tr.bd-row td.bd-name { padding-left: 52px; box-shadow: inset 38px 0 0 var(--field), inset 40px 0 0 var(--line); }
tr.bd-row.bd-last td { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.bd-label { display: block; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.bd-detail { display: block; font-weight: 500; font-size: .76rem; color: var(--muted); white-space: nowrap; }
/* Admin-only strip at the bottom of an opened player: log sessions, edit, delete */
tbody tr.bd-admin td { padding: 6px 8px 14px 52px; text-align: left; white-space: normal; }
.admin-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.aa-log, .aa-manage { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.aa-label { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-right: 2px; }
.session-btn { border-color: color-mix(in srgb, var(--brand), transparent 70%); color: var(--brand); background: var(--card); }
.session-btn:hover { background: color-mix(in srgb, var(--brand), transparent 93%); border-color: var(--brand); }

/* Initials avatars */
.av {
  flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  color: #fff; font-weight: 800; font-size: .78rem; letter-spacing: .02em; line-height: 1;
}
.av-sm { width: 28px; height: 28px; font-size: .68rem; }
.av-lg { width: 52px; height: 52px; font-size: 1.05rem; }
.av-xl { width: 64px; height: 64px; font-size: 1.3rem; border: 3px solid #fff; box-shadow: 0 4px 12px rgba(28,20,20,.15); }

/* Pre-launch: countdown + who's in */
.launch-card { text-align: center; border-top: 3px solid var(--brand); }
.launch-card .launch-kicker { margin: 0 0 12px; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); }
.launch-count { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; }
.lc-tile { min-width: 84px; padding: 12px 10px 10px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.lc-num { display: block; font-size: 2.1rem; font-weight: 800; line-height: 1; color: var(--brand); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.lc-lbl { display: block; margin-top: 6px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.launch-roster-head { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 2px 8px; border-top: 1px solid var(--line); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.launch-roster { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 136px), 1fr)); gap: 8px; }
.launch-roster li { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 22px; background: var(--field); border: 1px solid var(--line); font-weight: 700; font-size: .9rem; }
.launch-roster .lr-name { min-width: 0; line-height: 1.2; text-align: left; overflow-wrap: anywhere; }
.launch-roster .av { width: 30px; height: 30px; font-size: .7rem; }
.launch-roster .lr-you { padding: 0; background: none; border: 0; }
.lr-you a {
  display: flex; width: 100%; box-sizing: border-box; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: 999px;
  border: 1.5px dashed color-mix(in srgb, var(--brand), transparent 45%); color: var(--brand); font-weight: 800; text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}
.lr-you a:hover { background: var(--accent-bg); border-color: var(--brand); }
.lr-you a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.lr-plus { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-bg); }
.lr-plus svg { width: 16px; height: 16px; display: block; }
.launch-roster .lr-empty { grid-column: 1 / -1; padding: 8px 12px; color: var(--muted); font-weight: 600; }

/* Top-3 podium */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 10px; padding: 18px 22px 4px; }
.pod {
  appearance: none; border: 0; background: none; font: inherit; color: inherit; cursor: pointer;
  flex: 1 1 0; max-width: 170px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0;
}
.pod .av { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--line); margin-bottom: 4px; }
.pod.gold .av { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--gold); }
.pod.silver .av { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--silver); }
.pod.bronze .av { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--bronze); }
.pod-name { max-width: 100%; font-weight: 800; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-pts { display: flex; flex-direction: column; align-items: center; font-weight: 800; font-size: 1.05rem; line-height: 1.1; color: var(--brand); font-variant-numeric: tabular-nums; }
.pod-step {
  width: 100%; margin-top: 6px; display: grid; place-items: center; border-radius: 12px 12px 0 0;
  color: #fff; font-weight: 800; font-size: 1.35rem; background: var(--muted);
}
.pod.gold .pod-step { background: var(--gold); }
.pod.silver .pod-step { background: var(--silver); }
.pod.bronze .pod-step { background: var(--bronze); }
.pod-1 .pod-step { height: 76px; }
.pod-2 .pod-step { height: 54px; }
.pod-3 .pod-step { height: 40px; }
.pod:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 12px; }
.pod:hover .pod-name { color: var(--brand); }

/* Climber of the week (inside the board card, under the podium) */
.climber {
  appearance: none; font: inherit; color: inherit; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 12px; width: calc(100% - 44px); margin: 14px 22px 0; padding: 10px 14px 10px 10px;
  border-radius: 14px; border: 1px solid color-mix(in srgb, #0f7b45, transparent 70%);
  background: linear-gradient(100deg, #e9f6ee, #fff 80%);
}
.climber:hover { border-color: #0f7b45; }
.climber:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.climber .av { width: 44px; height: 44px; font-size: .9rem; flex: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0f7b45; }
.cl-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cl-eyebrow { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: #0f7b45; }
.cl-name { font-weight: 800; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-when { font-size: .76rem; color: var(--muted); font-weight: 600; }
.cl-stats { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-variant-numeric: tabular-nums; }
.cl-up { font-weight: 800; color: #0f7b45; font-size: .95rem; white-space: nowrap; }
.cl-pts { font-weight: 800; color: var(--brand); font-size: .85rem; white-space: nowrap; }

/* Page visits (admin) */
.stats-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stats-sub { margin: 0; font-size: .82rem; color: var(--muted); }
.stats-total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 14px 0 12px; }
.st-num { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.st-lbl { font-weight: 700; color: var(--ink-2); font-size: .9rem; }
.st-delta { font-size: .78rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--field); color: var(--muted); }
.st-delta.up { background: #e9f6ee; color: #0f7b45; }
.st-delta.down { background: var(--accent-bg); color: var(--brand); }
.st-all { flex-basis: 100%; font-size: .8rem; color: var(--muted); font-weight: 600; }
.stats-bars { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.stats-bars li { display: grid; grid-template-columns: minmax(0, 9.5rem) 1fr 2.5rem; align-items: center; gap: 10px; font-size: .86rem; }
.sb-lbl { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-track { height: 10px; border-radius: 999px; background: var(--field); border: 1px solid var(--line); overflow: hidden; }
.sb-fill { display: block; height: 100%; border-radius: 999px; background: var(--brand); min-width: 4px; }
.sb-n { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.stats-bars .sb-empty { display: block; color: var(--muted); font-weight: 600; }
.stats-links { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.stats-links-head { margin: 0; font-size: .9rem; font-weight: 800; }
.stats-hint { margin: 2px 0 10px; font-size: .8rem; color: var(--muted); }
.stats-link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.stats-link-list li { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 10px; background: var(--field); border: 1px solid var(--line); }
.sl-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sl-lbl { font-weight: 800; font-size: .86rem; }
.sl-url { font-size: .76rem; color: var(--muted); word-break: break-all; }

/* Winner banner (after the end date) */
.winner {
  display: flex; align-items: center; gap: 16px; margin-bottom: 16px; padding: 16px 18px; border-radius: 16px;
  background: linear-gradient(110deg, #fff4dc, #fcebed 60%, #fff); border: 1px solid color-mix(in srgb, var(--gold), transparent 50%);
  box-shadow: var(--shadow-sm);
}
.win-avatars { display: flex; flex: none; }
.win-avatars .av + .av { margin-left: -16px; }
.win-txt { flex: 1; min-width: 0; }
.win-kicker { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: #8a5300; }
.win-head { font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; margin-top: 2px; }
.win-sub { font-size: .88rem; color: var(--ink-2); margin-top: 2px; }
.win-sub b { color: var(--ink); }
.win-paddle { flex: none; width: 34px; height: 72px; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(28,20,20,.22)); }

/* Upcoming community events */
.events-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px 12px; margin-bottom: 12px; }
.events-head .events-sub { display: block; margin-top: 2px; }
.event-form { padding: 4px 0 14px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.event-form .section-lbl { margin-top: 0; padding-top: 0; border-top: 0; }
.event-form select, .form-row input[type="date"], .form-row input[type="time"] {
  font: inherit; padding: 9px 10px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--field); color: var(--ink); width: 100%; min-height: 42px;
}
.event-form select:focus, .form-row input[type="date"]:focus, .form-row input[type="time"]:focus { border-color: var(--brand); outline: 3px solid color-mix(in srgb, var(--brand), transparent 85%); }
.opt { font-weight: 500; color: var(--muted); }
.form-row label.ev-type-field { flex: 1 0 250px; }
.ev-tag { white-space: nowrap; }
.events-empty { margin: 0 0 4px; padding: 12px; border-radius: 10px; border: 1px dashed var(--line); background: var(--field); color: var(--ink-2); font-size: .86rem; }
.ev.past { opacity: .6; }
.ev.being-edited { outline: 2px solid var(--brand); outline-offset: -1px; }
.ev-admin { flex: none; display: flex; gap: 6px; }
#eventsManageLink { text-decoration: none; white-space: nowrap; }
.cal-error { border-style: solid; border-color: color-mix(in srgb, var(--danger), transparent 60%); background: color-mix(in srgb, var(--danger), transparent 94%); color: var(--danger); margin-bottom: 10px; }
.ev-subscribe { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.ev-sub-lbl { font-size: .84rem; font-weight: 700; color: var(--ink-2); }
.ev-sub-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ev-sub-btns .btn { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.ev-sub-btns svg { width: 16px; height: 16px; flex: none; }
.events-card .events-head h2 { margin: 0; font-size: 1.05rem; letter-spacing: -.01em; }
.events-sub { font-size: .82rem; color: var(--muted); font-weight: 600; }
.events-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ev {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card);
}
.ev.next { border-color: color-mix(in srgb, var(--brand), transparent 70%); background: var(--accent-bg); }
.ev-date {
  flex: none; width: 52px; text-align: center; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--card);
}
.ev-mon { display: block; background: var(--brand); color: #fff; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 2px 0; }
.ev-day { display: block; font-size: 1.3rem; font-weight: 800; color: var(--ink); padding: 2px 0 4px; font-variant-numeric: tabular-nums; }
.ev-body { flex: 1; min-width: 0; }
.ev-title { font-weight: 800; font-size: .95rem; letter-spacing: -.01em; }
.ev-meta { font-size: .8rem; color: var(--ink-2); margin: 2px 0 6px; }
.ev-tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 800;
  background: var(--field); border: 1px solid var(--line); color: var(--ink-2);
}
.ev-tag.social { color: #0f6e3f; background: #e8f6ee; border-color: #c6e9d4; }
.ev-tag.drill { color: #1d4f91; background: #e9f0fb; border-color: #cddcf3; }
.ev-tag.ranked { color: var(--brand); background: var(--accent-bg); border-color: color-mix(in srgb, var(--brand), transparent 75%); }
.ev-tag.special { color: #7a4b00; background: #fdf1d8; border-color: #f0dcae; }
.ev { flex-wrap: wrap; }
.ev-cal { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.ev-cal[aria-expanded="true"] { border-color: var(--brand); color: var(--brand); }
.ev-cal-opts { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; padding-left: 66px; }
.ev-cal-opts .btn { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.ev-cal-opts svg { width: 16px; height: 16px; flex: none; }
.ev-cal svg { width: 16px; height: 16px; flex: none; }

/* Challenge information (with "How scoring works": the formula as three
   tiles, not a sentence). A <details>, collapsed by default. */
.scoring { margin-top: 0; padding: 14px; }
.scoring[open] { padding-bottom: 20px; }
.info-sum { display: flex; align-items: center; gap: 12px; min-width: 0; }
.info-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-bg); color: var(--brand); }
.info-ico svg { width: 22px; height: 22px; }
.info-txt { display: flex; flex-direction: column; min-width: 0; }
.info-hint { font-size: .78rem; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--muted); margin-top: 1px; }
.scoring .scoring-title {
  display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none;
  font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2);
}
.scoring .scoring-title::-webkit-details-marker { display: none; }
.scoring .scoring-title::after {
  content: ""; flex: none; width: 7px; height: 7px; margin-right: 7px; border-right: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand); transform: rotate(45deg); transition: transform .15s ease;
}
.scoring[open] .scoring-title { margin-bottom: 14px; }
.scoring[open] .scoring-title::after { transform: rotate(-135deg); }
.scoring .info-title { margin: 0; font-size: 1rem; font-weight: 800; text-transform: none; letter-spacing: -.01em; color: var(--ink); }
/* Preview card for the Instagram announcement post, at the end of How It Works */
.post-card {
  display: flex; align-items: center; gap: 14px; margin: 12px 0 0; padding: 10px 14px 10px 10px; border-radius: 14px;
  background: var(--card); border: 1.5px solid var(--outline, var(--line)); color: var(--ink); text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.post-card:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.post-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand), transparent 55%); outline-offset: 2px; }
.post-card .pc-thumb { display: block; width: 88px; height: 88px; max-width: none; flex: none; margin: 0; border-radius: 10px; object-fit: cover; background: var(--field); filter: none; }
.pc-txt { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.pc-handle { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: .74rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.pc-h { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pc-handle svg { width: 14px; height: 14px; flex: none; color: var(--brand); }
.pc-title { font-size: .98rem; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; }
.pc-sub { font-size: .8rem; color: var(--ink-2); line-height: 1.35; }
.pc-cta { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: .84rem; font-weight: 800; color: var(--brand); white-space: nowrap; }
@media (max-width: 380px) {
  .post-card { gap: 12px; padding-right: 12px; }
  .pc-cta { font-size: .8rem; }
  .post-card .pc-thumb { width: 72px; height: 72px; }
}
.pc-cta svg { width: 15px; height: 15px; flex: none; transition: transform .15s ease; }
.post-card:hover .pc-cta svg { transform: translateX(2px); }
/* Eligibility: the one rule that decides who can take part */
.info-elig {
  display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 0; padding: 10px 14px; border-radius: 12px;
  background: var(--field); border: 1px solid var(--outline-soft, var(--line)); font-size: .86rem; line-height: 1.45; color: var(--ink-2);
}
.info-elig svg, .jd-elig svg { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--brand); }
.info-elig b { color: var(--ink); }
.f-tie { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); font-size: .82rem; color: var(--ink-2); }
.f-tie b { color: var(--ink); }
/* The formula as one line of labels, then a tile explaining each part */
.f-eq {
  margin: 0 0 12px; padding: 11px 12px; border-radius: 12px; text-align: center; background: var(--field); border: 1px solid var(--line);
  font-size: clamp(.8rem, 3.7vw, .95rem); font-weight: 700; color: var(--ink); line-height: 1.35;
}
.f-eq b { color: var(--brand); font-weight: 800; }
.f-sym { font-weight: 800; color: var(--muted); margin: 0 2px; }
.hint-tight { margin: -6px 0 14px; }
.formula { display: grid; grid-template-columns: 1fr 1.2fr; align-items: stretch; gap: 10px; }
.f-tile {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--field);
}
.f-name { font-weight: 800; font-size: .98rem; letter-spacing: -.01em; }
.f-rule { font-size: .88rem; color: var(--ink-2); }
.f-rule b { color: var(--brand); font-weight: 800; white-space: nowrap; }
.f-when { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.f-when li { display: flex; justify-content: space-between; gap: 10px; font-size: .84rem; color: var(--ink-2); }
.f-when b { font-weight: 800; color: var(--ink); white-space: nowrap; }
.f-ex { margin: 4px 0 0; padding-top: 7px; border-top: 1px dashed var(--line); font-size: .78rem; color: var(--muted); }
.f-ex b { color: var(--brand); font-weight: 800; white-space: nowrap; }
.f-arrow { color: var(--brand); font-weight: 800; margin: 0 2px; }
.f-desc { font-size: .76rem; color: var(--muted); line-height: 1.4; }
.f-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.f-list li { display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--ink-2); }
.f-list svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.f-list span { flex: 1; }
.f-list b { color: var(--brand); font-weight: 800; font-variant-numeric: tabular-nums; }
.f-val { white-space: nowrap; }
.f-list span { white-space: nowrap; }
@media (max-width: 360px) {
  .f-list li { gap: 6px; font-size: .8rem; }
}

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  font-size: .86rem; box-shadow: var(--shadow); z-index: 30;
}
.toast-action {
  appearance: none; border: 0; background: none; padding: 2px 0; font: inherit; font-weight: 800;
  color: #ff9aa4; cursor: pointer; flex: none;
}
.toast-action:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .formula { grid-template-columns: 1fr; gap: 8px; }
  .f-eq b { display: block; font-size: 1.05rem; }
  .f-eq-rest { font-size: .84rem; }
  .form-row.counts { gap: 10px; }
  .form-row.counts label { min-width: calc(50% - 6px); flex: 1 1 calc(50% - 6px); }
  .board-head { padding: 14px 16px; }
  .table-wrap { padding: 0 12px 14px; }
  th, td { padding: 10px 4px; }
  /* Fit the table on a phone instead of scrolling sideways. */
  table { min-width: 0; }
  th { white-space: normal; line-height: 1.25; letter-spacing: .03em; font-size: .7rem; }
  /* Phones get just the Lotus Score; tapping a player shows the split. */
  .col-sub { display: none; }
  .m-only { display: inline; }
  .finder { padding: 12px 16px 2px; }
  .me-strip { flex-wrap: wrap; }
  .me-txt { flex: 1 1 calc(100% - 60px); }
  .me-actions { flex-basis: 100%; max-width: none; justify-content: flex-start; }
  .me-actions .link-btn { flex-basis: auto; margin-left: auto; }
  .no-scores, .dupr-warn { margin: 10px 16px 0; }
  .prize { padding: 8px 14px 8px 10px; gap: 12px; }
  .prize-meta { display: none; }
  .lc-tile { min-width: 0; flex: 1 1 0; }
  .lc-num { font-size: 1.8rem; }
  .podium { padding: 16px 12px 2px; gap: 8px; }
  .climber { width: calc(100% - 24px); margin: 12px 12px 0; }
  .stats-bars li { grid-template-columns: minmax(0, 9.2rem) 1fr 2rem; gap: 8px; }
  .av-lg { width: 46px; height: 46px; font-size: .95rem; }
  .winner { padding: 14px; gap: 12px; }
  .av-xl { width: 52px; height: 52px; font-size: 1.05rem; }
  .win-head { font-size: 1.05rem; }
  .win-paddle { display: none; }
  .ev { gap: 12px; padding: 12px; }
  .ev-date { width: 46px; }
  .ev-day { font-size: 1.15rem; }
  .ev-cal { width: 40px; height: 40px; padding: 0; justify-content: center; align-self: center; }
  .ev-cal svg { width: 19px; height: 19px; }
  .ev-cal-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ev-admin { flex-direction: column; }
  .ev-cal-opts { padding-left: 0; }
  .ev-cal-opts { flex-direction: column; gap: 6px; }
  .ev-sub-btns { flex-direction: column; width: 100%; }
  .ev-sub-btns .btn { justify-content: center; padding: 10px 12px; }
  .ev-cal-opts .btn { justify-content: center; padding: 10px 12px; }
  /* The title wraps on a phone, so line everything up along the top edge
     instead of centring the logo and menu button against a tall block. */
  .hd, .hd-brand { align-items: flex-start; }
  /* Keep the admin "..." button level with the middle of the logo
     (46px logo, 36px button + 5px), and size the title so it fits on one
     line on most phones even with the button taking room. */
  .hd-brand { gap: 11px; }
  .hd-logo { width: 46px; height: 46px; border-radius: 12px; }
  .hd-actions { margin-top: 5px; }
  .hd-actions .icon-btn { width: 36px; height: 36px; border-radius: 10px; }
  .hd-actions .icon-btn.share-btn { width: 36px; padding: 0; justify-content: center; }
  .share-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .hd h1 { font-size: 1.16rem; }
  .prize-main { font-size: .95rem; }
  th.rank, td.rank { width: 30px; }
  .name-btn { gap: 5px; }
  .you-pill { padding: 1px 5px; }
  .table-wrap { padding: 0 8px 14px; }
  tr.bd-row td.bd-name { padding-left: 44px; box-shadow: inset 30px 0 0 var(--field), inset 32px 0 0 var(--line); }
  tbody tr.bd-admin td { padding-left: 12px; padding-right: 8px; }
  .admin-actions { flex-direction: column; align-items: stretch; }
  .aa-log { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .aa-label { grid-column: 1 / -1; }
  .session-btn { padding: 9px 4px; font-size: .8rem; }
}

/* Link card (Gachapon): a tappable row like the Challenge
   information header, opening a post in a new tab. */
.link-card {
  display: flex; align-items: center; gap: 12px; padding: 14px; text-decoration: none; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.link-card:hover { border-color: color-mix(in srgb, var(--brand), transparent 60%); transform: translateY(-1px); box-shadow: var(--shadow); }
.link-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.lk-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-bg); color: var(--brand); }
.lk-ico svg { width: 30px; height: 30px; }
.lk-ico svg.lk-key { width: auto; height: 34px; } /* keychain: loop + ball, taller than wide */
.lk-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lk-title { font-weight: 800; font-size: 1rem; letter-spacing: -.01em; }
.lk-sub { font-size: .78rem; font-weight: 600; color: var(--muted); margin-top: 1px; }
.lk-arrow { flex: none; color: var(--brand); display: grid; place-items: center; }
.lk-arrow svg { width: 20px; height: 20px; }

/* Footer */
.site-foot {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  position: relative; z-index: 1; width: calc(100% - 32px); max-width: 868px; margin: 0 auto; padding: 22px 16px 36px; border-top: 1px solid var(--line);
}
.site-foot img { width: 36px; height: 36px; margin-bottom: 4px; }
.sf-name { font-weight: 800; font-size: .92rem; color: var(--ink); }
.sf-ig { font-size: .84rem; font-weight: 600; color: var(--brand); text-decoration: none; }
.sf-ig:hover { text-decoration: underline; }
.sf-live { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: .76rem; font-weight: 600; color: var(--muted); }
.sf-dot { width: 7px; height: 7px; border-radius: 50%; background: #0f9d58; box-shadow: 0 0 0 3px rgba(15, 157, 88, .15); }

/* Loading placeholder (until the board first arrives) */
.skel-card { display: flex; flex-direction: column; gap: 14px; }
.sk { border-radius: 8px; background: linear-gradient(90deg, #f1eceb 0%, #f8f5f4 40%, #f1eceb 80%); background-size: 200% 100%; animation: sk-shimmer 1.3s ease-in-out infinite; }
.sk-title { width: 42%; height: 18px; }
.sk-row { display: flex; justify-content: center; gap: 28px; padding: 6px 0; }
.sk-av { width: 52px; height: 52px; border-radius: 50%; }
.sk-line { height: 38px; border-radius: 10px; }
.sk-line.short { width: 70%; }
@keyframes sk-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }


/* Prize photo, full size */
.lightbox {
  border: 0; padding: 20px 20px 18px; border-radius: 20px; background: #fff; max-width: min(92vw, 420px); width: 100%;
  box-shadow: 0 24px 60px rgba(28, 20, 20, .35); text-align: center; color: var(--ink);
}
.lightbox::backdrop { background: rgba(20, 14, 14, .62); backdrop-filter: blur(3px); }
.lightbox img { display: block; width: auto; height: min(62vh, 520px); max-width: 100%; margin: 6px auto 12px; object-fit: contain; filter: drop-shadow(0 12px 18px rgba(28, 20, 20, .28)); }
.lb-close {
  position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); display: grid; place-items: center; cursor: pointer;
  z-index: 2; /* above the full-size photo on tall, narrow phones */
}
.lb-close svg { width: 16px; height: 16px; }
.lb-close:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.lb-cap { margin: 0; display: flex; flex-direction: column; gap: 2px; font-weight: 800; font-size: 1.05rem; }
.lb-inc { list-style: none; margin: 10px auto 0; padding: 0; width: fit-content; display: flex; flex-direction: column; gap: 6px; text-align: left; font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.lb-inc li { display: flex; align-items: center; gap: 8px; }
.lb-inc li::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 11px no-repeat; }
.lb-note { margin: 8px 0 0; font-size: .76rem; font-weight: 600; color: var(--muted); }
.lb-shop { display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-top: 14px; min-height: 44px; text-decoration: none; }
.lb-shop svg { width: 15px; height: 15px; color: var(--brand); }
.lb-kicker { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
/* Gachapon rewards board */
.gacha-sheet { text-align: left; max-width: min(92vw, 400px); max-height: calc(100dvh - 32px); overflow-y: auto; }
.gacha-sheet .lb-kicker { margin: 0; font-weight: 800; }
.gacha-sheet .jd-title { margin-bottom: 8px; }
.gk-intro { margin: 0 0 14px; font-size: .9rem; line-height: 1.45; color: var(--ink-2); }
.gk-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.gk-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 10px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); }
.gk-ball { width: 32px; height: 41px; flex: none; }
.gk-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.gk-label { padding: 6px 14px; border-radius: 10px; font-weight: 800; font-size: 1rem; letter-spacing: -.01em; transform: rotate(-1deg); }
.gk-red .gk-ball { color: #d62b2b; }    .gk-red .gk-label { background: #b91c2b; color: #fff; }
.gk-yellow .gk-ball { color: #f2c230; } .gk-yellow .gk-label { background: #f7d64a; color: #3b2f00; }
.gk-blue .gk-ball { color: #2f6fe0; }   .gk-blue .gk-label { background: #2563eb; color: #fff; }
.gk-green .gk-ball { color: #2ea44f; }  .gk-green .gk-label { background: #15803d; color: #fff; }
.gk-all { margin: -6px 0 0; padding-left: 2px; font-size: .8rem; color: var(--muted); }
.gk-all b { color: var(--ink-2); font-weight: 700; }
.gk-sponsor { padding-left: 4px; font-size: .74rem; color: var(--muted); line-height: 1.3; }
.gk-sponsor b { color: var(--ink-2); font-weight: 700; }
.sponsor-row label > span { display: inline-flex; align-items: center; gap: 6px; }
.sp-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.sp-red { background: #d62b2b; } .sp-yellow { background: #f2c230; } .sp-blue { background: #2f6fe0; } .sp-green { background: #2ea44f; }
.gk-red { border-color: color-mix(in srgb, var(--brand), transparent 60%); background: var(--accent-bg); }
.gk-card { margin-top: 16px; }

/* How to join panel */
.join-sheet { text-align: left; max-width: min(92vw, 440px); max-height: calc(100dvh - 32px); overflow-y: auto; }
.join-sheet .lb-kicker { margin: 0; font-weight: 800; }
.jd-title { margin: 2px 40px 12px 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; }
.jd-elig { display: flex; align-items: flex-start; gap: 8px; margin: -4px 0 14px; font-size: .84rem; line-height: 1.4; color: var(--ink-2); }
.jd-elig svg { width: 18px; height: 18px; }
.jd-elig b { color: var(--ink); }
.jd-label { display: block; margin: 0 0 6px; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
/* The message as a sent chat bubble */
.jd-bubble {
  margin: 0 0 12px; padding: 11px 14px; border-radius: 18px 18px 4px 18px; max-width: 92%; margin-left: auto;
  background: linear-gradient(135deg, #b91c2b, #d6336c); color: #fff; font-size: 1rem; font-weight: 600; line-height: 1.4;
  -webkit-user-select: all; user-select: all; box-shadow: 0 4px 12px rgba(185, 28, 43, .18);
}
.jd-how { margin: 0; font-size: .88rem; line-height: 1.45; color: var(--ink-2); }
.jd-how b { color: var(--ink); }
.jd-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.jd-fail { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: #fff8e1; border: 1px solid #f0c040; color: #5c4400; font-size: .82rem; line-height: 1.4; }
.jd-actions .btn { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 14px; font-weight: 800; font-size: .98rem; }
.jd-open { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.jd-open svg { width: 16px; height: 16px; }

@media (prefers-reduced-motion: reduce) {
  .sk { animation: none; }
}

/* One outline system. Cards and secondary buttons share one warm neutral
   outline, and boxes inside a card a lighter one. Red is kept for what
   should pull the eye: the Join button, the prize banner, links, scores,
   icons and arrows (and a card's outline on hover). */
:root {
  --outline: #d6cfcc;
  --outline-soft: var(--line);
}
.card, .prize { border-width: 1.5px; border-style: solid; border-color: var(--outline); }
.prize { border-color: color-mix(in srgb, var(--brand), transparent 45%); }
.info-ico, .lk-ico { background: var(--field); border: 1px solid var(--line); }
.launch-card { border-top: 3px solid var(--brand); }
.btn:not(.primary):not(.danger), .icon-btn, .rank-match, .lb-close { border-color: var(--outline); }
.btn:not(.primary):not(.danger):hover, .icon-btn:hover, .rank-match:hover { border-color: var(--brand); }
.f-tile, .f-eq, .f-tie, .lc-tile, .stats-link-list li, .ev { border-color: var(--outline-soft); }
.link-card:hover { border-color: var(--brand); }

/* Join confetti overlay */
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 60; }

/* Month calendar: colour = availability, dots = sessions; "Coming up" says it in words */
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mc-wd { text-align: center; font-size: .68rem; font-weight: 800; color: var(--muted); letter-spacing: .04em; padding-bottom: 2px; }
.mc-day {
  appearance: none; font: inherit; min-width: 0; min-height: 46px; padding: 6px 1px 5px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
button.mc-day { cursor: pointer; transition: border-color .15s, background .15s; }
button.mc-day:hover { border-color: color-mix(in srgb, var(--brand), transparent 50%); }
button.mc-day:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.mc-num { font-size: .8rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; min-width: 1.6em; padding: 2px 0; border-radius: 999px; text-align: center; }
.mc-part { font-size: .55rem; font-weight: 800; letter-spacing: .02em; line-height: 1; color: #7a4b00; white-space: nowrap; }
.mc-dots { display: flex; gap: 3px; }
.dot { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; }
.dot-drill { background: #1d4f91; }
.dot-ranked { background: var(--brand); }
.dot-social { background: #0f6e3f; }
.mc-day.is-part { background: #fdf1d8; border-color: #efd9a6; }
.mc-day.is-off {
  color: var(--muted); border-color: #e2dcd9;
  background: repeating-linear-gradient(135deg, #f4f1ef 0 5px, #e9e4e1 5px 7px);
}
/* Past days: muted rather than transparent, so the date stays readable */
.mc-day.is-full { background: #ece7e4; border-color: #ddd6d2; color: var(--ink-2); }
.mc-full { color: var(--ink-2); letter-spacing: .04em; }
.mc-day.is-past { color: var(--muted); background: var(--field); border-color: var(--line); }
.mc-day.is-past .mc-part { color: var(--muted); }
.mc-day.is-past .dot { opacity: .45; }
.mc-day.is-past.is-off { background: repeating-linear-gradient(135deg, #f4f1ef 0 5px, #ebe6e3 5px 7px); }
.mc-day.is-today { border-color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--ink-2); }
.mc-day.is-key .mc-num { background: var(--brand); color: #fff; }
.mc-day.is-sel { border-color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); opacity: 1; }
.month-legend { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .74rem; font-weight: 600; color: var(--ink-2); }
.month-legend li { display: inline-flex; align-items: center; gap: 5px; }
.sw { display: inline-block; width: 13px; height: 13px; border-radius: 4px; border: 1px solid var(--line); background: var(--card); }
.sw-part { background: #fdf1d8; border-color: #efd9a6; }
.sw-full { background: #ddd6d2; border-color: #cfc7c3; }
.sw-off { background: repeating-linear-gradient(135deg, #f4f1ef 0 3px, #d9d2ce 3px 4.5px); border-color: #e2dcd9; }
.month-detail { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); }
.md-date { font-weight: 800; font-size: .95rem; }
.md-key { margin-top: 2px; font-size: .8rem; font-weight: 800; color: var(--brand); }
.md-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.md-empty { margin-top: 2px; font-size: .84rem; color: var(--muted); }
.md-edit { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.md-edit .aa-label { flex-basis: 100%; }
.md-toggle[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.ev-tag.off { color: var(--ink-2); background: var(--card); }
.ev-tag.am, .ev-tag.pm, .ev-tag.eve { color: #7a4b00; background: #fdf1d8; border-color: #f0dcae; }
.month-lbl { margin: 16px 0 8px; }
.month-pts { color: var(--brand); font-weight: 800; }
.month-agenda { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ag-row { display: flex; align-items: center; gap: 12px; padding: 6px 12px 6px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.ag-row.is-off { background: var(--field); }
.ag-row.is-part { border-color: #efd9a6; }
.ag-date { flex: none; width: 40px; text-align: center; border-radius: 9px; padding: 3px 0; background: var(--field); border: 1px solid var(--line); line-height: 1.1; }
.ag-row.is-part .ag-date { background: #fdf1d8; border-color: #efd9a6; }
.ag-wd { display: block; font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ag-day { display: block; font-size: 1rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.ag-body { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ag-key { flex-basis: 100%; }
.ag-main { font-size: .88rem; font-weight: 800; color: var(--ink); }
.ag-row.is-off .ag-main { color: var(--ink-2); }
.ag-row.is-part .ag-main { color: #7a4b00; }
.ag-key { font-size: .78rem; font-weight: 800; color: var(--brand); }
.ag-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.ag-book { flex: none; text-decoration: none; }
.md-book { display: inline-flex; margin-top: 12px; text-decoration: none; }
.ev-tag.open { color: var(--ink-2); background: var(--card); }
#monthTitle:focus { outline: none; }
#monthTitle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.ag-empty { font-size: .86rem; color: var(--muted); }
.month-note { margin: 12px 0 0; font-size: .76rem; font-weight: 600; color: var(--muted); }
