:root {
  color-scheme: light dark;
  --paper: light-dark(#f5f2e7, #252520);
  --panel: light-dark(#fffdf6, #302f28);
  --ink: light-dark(#26221a, #f6efdc);
  --muted: light-dark(#645c4e, #d1c8af);
  --line: light-dark(#ddd4c1, #58523f);
  --button: light-dark(#272219, #efe3c6);
  --button-text: light-dark(#fffdf6, #332a19);
  font: 16px/1.5 system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); }
main { width: min(100% - 32px, 540px); margin: 28px auto; }
header { margin-bottom: 24px; }
.brand { font-weight: 750; color: inherit; text-decoration: none; }
section { padding: clamp(18px, 5vw, 34px); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; }
h1, h2 { margin: 0 0 8px; line-height: 1.16; }
h1 { font-size: 2rem; letter-spacing: -.045em; }
h2 { margin-top: 22px; font-size: 1.1rem; }
p { color: var(--muted); margin: 0 0 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
button, input { font: inherit; min-height: 44px; border-radius: 9px; }
button { padding: 8px 16px; background: var(--button); color: var(--button-text); border: 1px solid transparent; font-weight: 650; cursor: pointer; }
button.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
button:disabled { opacity: .5; cursor: wait; }
input { padding: 8px; border: 1px solid var(--line); color: inherit; background: var(--paper); min-width: 0; }
form { display: grid; gap: 8px; }
table { width: 100%; margin: 12px 0 16px; border-collapse: collapse; font-variant-numeric: tabular-nums; text-align: right; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 4px; }
th:first-child { text-align: left; }
#status { margin: 10px 0 0; }
#status:empty { margin: 0; }
ul { padding-left: 20px; }

#leaderboardMode { font:inherit; color:inherit; background:transparent; padding:.6rem; border:1px solid currentColor; border-radius:.45rem; }

section + section { margin-top:16px; }
#leaderboardHeading { margin-top:0; }
#publicBoard :is(th,td):nth-child(2) { text-align:left; }
