:root {
  --suit: #0a0a0c;
  --suit-2: #141418;
  --suit-3: #1d1d23;
  --stripe: rgba(184, 188, 194, 0.06);
  --line: rgba(195, 199, 204, 0.16);
  --silver: #c3c7cc;
  --muted: #8f949b;
  --ink: #ece8df;
  --gold: #cda34d;
  --emerald: #1fa36f;
  --red: #d0505c;
  --display: "Big Shoulders Display", Impact, "Arial Narrow", sans-serif;
  --serif: "Libre Caslon Text", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100svh; color: var(--ink); font-family: var(--serif); line-height: 1.55;
  background-color: var(--suit);
  background-image: repeating-linear-gradient(90deg, transparent 0 22px, var(--stripe) 22px 23px);
}
a { color: inherit; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}
.wrap { max-width: 64rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Masthead */
.masthead { display: grid; gap: 1rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
@media (min-width: 760px) { .masthead { grid-template-columns: 1fr auto; align-items: end; } }
.presents { margin: 0; font-family: var(--display); font-weight: 500; letter-spacing: .08em; color: var(--silver); font-size: 1.05rem; }
.title { margin: .1rem 0 0; font-family: var(--display); font-weight: 900; text-transform: uppercase; line-height: .9;
  font-size: clamp(3rem, 11vw, 6rem); }
.title span { color: var(--gold); }
.week-line { margin: .5rem 0 0; color: var(--silver); font-style: italic; }
.week-pick { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--muted); }
.week-pick select { font: inherit; font-size: .95rem; color: var(--ink); background: var(--suit-2); border: 1px solid var(--line);
  border-radius: 6px; padding: .45rem .6rem; }
.sponsor { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem; margin-top: 1rem; padding: .6rem .9rem;
  border: 1px solid var(--gold); border-radius: 6px; background: rgba(205, 163, 77, .06); }
.sponsor .label { font-family: var(--display); font-weight: 700; letter-spacing: .06em; color: var(--gold); font-size: .95rem; }
.sponsor a { font-family: var(--display); font-weight: 800; font-size: 1.15rem; text-decoration: none; }
.sponsor a:hover { text-decoration: underline; }
.sponsor .tagline { color: var(--silver); font-size: .9rem; }

/* The board */
.board { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.row { display: grid; grid-template-columns: 3.4rem 3rem minmax(0, 1fr) auto; gap: .75rem; align-items: center;
  padding: .85rem 0; border-bottom: 1px solid var(--line); }
.row .rank { font-family: var(--display); font-weight: 900; font-size: 2.6rem; line-height: 1; text-align: right; font-variant-numeric: tabular-nums; }
.row:nth-child(-n+3) .rank { color: var(--gold); }
.row .who { min-width: 0; }
.row .name { font-family: var(--display); font-weight: 800; font-size: 1.4rem; line-height: 1.1; text-decoration: none; display: inline-block; }
.row .name:hover { text-decoration: underline; }
.row .meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin-top: .2rem; font-size: .85rem; color: var(--muted); }
.row .move { font-family: var(--display); font-weight: 800; font-size: .95rem; }
.move.up { color: var(--emerald); } .move.down { color: var(--red); } .move.new { color: var(--gold); } .move.same { color: var(--muted); }
.row .score { text-align: right; min-width: 5.5rem; }
.row .score b { font-family: var(--display); font-weight: 900; font-size: 1.9rem; line-height: 1; font-variant-numeric: tabular-nums; }
.row .bar { height: 4px; background: var(--suit-3); border-radius: 2px; margin-top: .35rem; overflow: hidden; }
.row .bar i { display: block; height: 100%; background: var(--gold); }
.parts { display: none; gap: .9rem; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (min-width: 760px) { .parts { display: flex; } }
.parts span b { color: var(--silver); font-weight: 400; }

.avatar { width: 3rem; height: 3rem; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); background: var(--suit-3); }
.avatar.big { width: 6rem; height: 6rem; }
.avatar.fallback { display: inline-grid; place-items: center; font-family: var(--display); font-weight: 800; color: var(--silver); }
.avatar.big.fallback { font-size: 2rem; }
.badge { display: inline-block; font-family: var(--display); font-weight: 700; font-size: .78rem; letter-spacing: .03em;
  padding: .05rem .45rem; border-radius: 4px; border: 1px solid var(--line); color: var(--silver); }
.badge.verified { border-color: var(--emerald); color: var(--emerald); }
.badge.coin { border-color: var(--gold); color: var(--gold); }
.badge.held { border-color: var(--red); color: var(--red); }

/* Side boards */
.side { display: grid; gap: 1rem; margin-top: 2.5rem; }
@media (min-width: 640px) { .side { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .side { grid-template-columns: repeat(4, 1fr); } }
.card { background: var(--suit-2); border: 1px solid var(--line); border-radius: 8px; padding: .9rem 1rem; }
.card h2 { font-family: var(--display); font-weight: 800; font-size: 1.25rem; margin: 0 0 .1rem; }
.card .what { margin: 0 0 .6rem; font-size: .8rem; color: var(--muted); font-style: italic; }
.card ol { margin: 0; padding: 0; list-style: none; }
.card li { display: flex; justify-content: space-between; gap: .5rem; padding: .3rem 0; border-top: 1px solid var(--line); font-size: .92rem; }
.card li a { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card li a:hover { text-decoration: underline; }
.card li span { color: var(--gold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.card .empty { color: var(--muted); font-size: .85rem; font-style: italic; border: 0; }

/* Calls to action */
.ctas { display: grid; gap: 1rem; margin-top: 2.5rem; }
@media (min-width: 760px) { .ctas { grid-template-columns: 1fr 1fr; } }
.cta { border: 1px solid var(--line); border-radius: 8px; padding: 1.1rem 1.2rem; }
.cta h2 { font-family: var(--display); font-weight: 800; font-size: 1.5rem; margin: 0 0 .3rem; }
.cta p { margin: 0 0 .9rem; color: var(--silver); font-size: .95rem; }
.cta small { display: block; margin-top: .5rem; color: var(--muted); font-size: .78rem; }
.btn { display: inline-block; font-family: var(--display); font-weight: 800; font-size: 1rem; letter-spacing: .03em; cursor: pointer;
  border-radius: 999px; padding: .45rem 1.15rem; border: 2px solid var(--silver); background: transparent; color: var(--ink); text-decoration: none; }
.btn:hover { background: var(--silver); color: var(--suit); }
.btn.gold { border-color: var(--gold); background: var(--gold); color: #1c1405; }
.btn.gold:hover { background: #e2bb64; }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn:disabled { opacity: .45; cursor: default; }

/* Methodology */
.method { margin-top: 2.5rem; }
.method h2 { font-family: var(--display); font-weight: 800; font-size: 1.6rem; margin: 0 0 .5rem; }
.method table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.method th, .method td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.method th { font-family: var(--display); font-weight: 700; color: var(--silver); font-size: .95rem; }
.method td:nth-child(2) { font-family: var(--display); font-weight: 800; color: var(--gold); white-space: nowrap; }
.method p { color: var(--silver); font-size: .92rem; max-width: 46rem; }

/* Profile */
.back { display: inline-block; margin-bottom: 1rem; color: var(--silver); text-decoration: none; font-size: .9rem; }
.back:hover { text-decoration: underline; }
.profile-head { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.profile-head h1 { font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: clamp(2.4rem, 8vw, 4rem); line-height: .95; margin: 0; }
.profile-head .links { display: flex; flex-wrap: wrap; gap: .4rem .8rem; margin-top: .4rem; color: var(--silver); font-size: .92rem; }
.profile-head .bio { color: var(--silver); margin: .5rem 0 0; max-width: 40rem; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem; margin: 1.5rem 0; }
.stat { background: var(--suit-2); border: 1px solid var(--line); border-radius: 8px; padding: .75rem .9rem; }
.stat .k { font-size: .8rem; color: var(--muted); }
.stat .v { font-family: var(--display); font-weight: 900; font-size: 2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.history { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
.history th, .history td { padding: .5rem; border-bottom: 1px solid var(--line); text-align: right; }
.history th:first-child, .history td:first-child { text-align: left; }
.history th { font-family: var(--display); font-weight: 700; color: var(--silver); }
.table-scroll { overflow-x: auto; }

/* States */
.notice { margin: 3rem auto; max-width: 34rem; text-align: center; }
.notice h2 { font-family: var(--display); font-weight: 900; font-size: clamp(2rem, 7vw, 3.2rem); margin: 0 0 .5rem; }
.notice p { color: var(--silver); }
.error-bar { background: #6e1b26; color: var(--ink); padding: .5rem 1rem; text-align: center; font-size: .9rem; }
footer { margin-top: 3rem; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); padding-top: 1rem; }

/* Admin */
.admin h1 { font-family: var(--display); font-weight: 900; font-size: 2.6rem; margin: 0 0 1rem; }
.admin h2 { font-family: var(--display); font-weight: 800; font-size: 1.5rem; margin: 2rem 0 .75rem; }
.admin form, .admin .panel { background: var(--suit-2); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; }
.admin label { display: block; font-size: .85rem; color: var(--silver); margin-bottom: .75rem; }
.admin input, .admin select, .admin textarea { display: block; width: 100%; margin-top: .25rem; padding: .5rem .6rem; font: inherit; font-size: .95rem;
  color: var(--ink); background: var(--suit); border: 1px solid var(--line); border-radius: 5px; }
.admin input[type=checkbox] { display: inline-block; width: auto; margin: 0 .35rem 0 0; }
.tabs { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs button[aria-selected=true] { background: var(--gold); border-color: var(--gold); color: #1c1405; }
.grid2 { display: grid; gap: 0 1rem; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); } }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; }
.msg { margin: .75rem 0; padding: .6rem .8rem; border-radius: 6px; background: var(--suit-3); font-size: .92rem; white-space: pre-wrap; }
.msg.err { background: #6e1b26; }
.entry { width: 100%; border-collapse: collapse; font-size: .9rem; }
.entry th, .entry td { padding: .35rem .4rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.entry th { font-family: var(--display); font-weight: 700; color: var(--silver); white-space: nowrap; }
.entry input[type=text], .entry input[inputmode] { margin: 0; padding: .35rem .45rem; min-width: 6.5rem; }
.entry .coin { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.char-list li { display: flex; justify-content: space-between; gap: .5rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.char-list { list-style: none; margin: 0; padding: 0; }
.hint { color: var(--muted); font-size: .85rem; margin: .25rem 0 .75rem; }
