@font-face {
  font-family: Geist;
  src: url("/geist-400.ttf");
}
@font-face {
  font-family: Geist;
  src: url("/geist-600.ttf");
  font-weight: 600;
}
:root {
  --ground: #0e0d0c;
  --surface: #181716;
  --raised: #252321;
  --rule: #302d29;
  --text: #f4f1ec;
  --muted: #b7b0a5;
  --faint: #a49b8e;
  --accent: #d6aa65;
  --negative: #ee9891;
  --radius: 12px;
  color-scheme: dark;
  font-family: Geist, system-ui, sans-serif;
  background: var(--ground);
  color: var(--text);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button,
select {
  min-height: 40px;
  border: 1px solid #514b43;
  background: transparent;
  color: var(--text);
  border-radius: 7px;
  padding: 8px 14px;
  cursor: pointer;
}
button:hover,
.button:hover {
  background: var(--raised);
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button.primary {
  background: var(--text);
  color: var(--ground);
  border-color: var(--text);
  font-weight: 600;
}
input,
textarea {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #514b43;
  border-radius: 6px;
  background: var(--ground);
  color: var(--text);
  max-width: 100%;
}
input[type="checkbox"] {
  min-height: 18px;
  width: 18px;
  accent-color: var(--accent);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.035em;
  margin-bottom: 12px;
}
h2 {
  font-size: 16px;
  font-weight: 600;
}
h3 {
  font-size: 20px;
  font-weight: 600;
}
p {
  color: var(--muted);
}
small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.topbar {
  max-width: 1360px;
  margin: auto;
  padding: 28px 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
  gap: 20px;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 13px;
  font-weight: 600;
  font-size: 16px;
}
.wordmark small {
  font-weight: 400;
  margin-top: 2px;
}
.brand-mark {
  font-size: 36px;
  font-weight: 400;
  line-height: 1;
}
.topbar nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-size: 13px;
}
.logo {
  width: 100px;
  max-height: 48px;
  object-fit: contain;
}
.topbar nav a:hover {
  color: var(--text);
}
main {
  max-width: 1272px;
  margin: 0 auto;
  padding: 40px 0 24px;
}
.leaderboard-main {
  padding: 38px 44px 24px;
  max-width: 1360px;
}
.scope {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 24px;
}
.title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 30px;
}
.title-row p {
  margin-bottom: 0;
}
.title-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.period-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  gap: 20px;
  margin-bottom: 30px;
}
.tabs {
  display: flex;
  gap: 25px;
  overflow-x: auto;
}
.tabs button {
  border: 0;
  border-radius: 0;
  white-space: nowrap;
  color: var(--muted);
  padding: 15px 0;
  border-bottom: 2px solid transparent;
  min-height: 48px;
}
.tabs button:hover {
  background: transparent;
  color: var(--text);
}
.tabs button[aria-pressed="true"] {
  color: var(--text);
  border-bottom-color: var(--text);
}
.toggle {
  display: flex !important;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}
.board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 44px;
}
.standings {
  min-width: 0;
}
.table-head,
.team-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 70px 130px;
  align-items: center;
  gap: 16px;
}
.table-head {
  font-size: 12px;
  color: var(--muted);
  padding: 0 16px 12px;
}
.table-head span:nth-child(n + 3) {
  text-align: right;
}
.team-row {
  padding: 16px;
  border-top: 1px solid var(--rule);
  min-height: 84px;
  font-variant-numeric: tabular-nums;
}
.team-row.place-1 {
  background: var(--surface);
  border-radius: var(--radius);
  border: 0;
  margin-bottom: 4px;
  min-height: 110px;
}
.rank {
  font-size: 18px;
  color: var(--faint);
}
.place-1 .rank,
.place-1 .completion strong {
  color: var(--accent);
}
.place-2 .rank {
  color: #e2d9cc;
}
.place-3 .rank {
  color: #beac95;
}
.team strong {
  font-size: 16px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.team span,
.completion span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.completion {
  text-align: right;
}
.completion strong {
  font-size: 25px;
  letter-spacing: -0.035em;
  font-weight: 400;
}
.players {
  text-align: right;
  color: var(--muted);
}
.players small {
  display: none;
}
.table-footer {
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 12px;
  color: var(--muted);
  padding: 20px 16px;
}
.room-notes {
  padding-top: 26px;
}
.room-clock {
  border-left: 2px solid var(--accent);
  padding: 4px 0 0 24px;
}
.room-clock > span {
  color: var(--muted);
  font-size: 12px;
}
.room-clock strong {
  font-size: 40px;
  font-weight: 400;
  display: block;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}
.room-clock p {
  font-size: 13px;
  line-height: 1.7;
  margin: 12px 0 0;
}
.room-stats {
  margin: 36px 0 28px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
}
.room-stats h2 {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 20px;
}
dl {
  margin: 0;
}
dl > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
}
dt {
  font-size: 12px;
  color: var(--muted);
}
dd {
  margin: 0;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.ranking-note {
  font-size: 12px;
  line-height: 1.8;
  padding: 0 4px;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 12px;
  color: var(--faint);
  margin-top: 55px;
  border-top: 1px solid var(--rule);
  padding-top: 22px;
}
.empty {
  padding: 60px 30px;
  text-align: center;
  border-top: 1px solid var(--rule);
  color: var(--muted);
}
.empty-clock {
  font-size: 46px;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
  letter-spacing: -0.05em;
  display: block;
  margin-bottom: 18px;
}
.empty h2 {
  color: var(--text);
  font-size: 22px;
}
.empty p {
  max-width: 340px;
  margin: 0 auto;
}
.notice {
  background: var(--surface);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 0 0 20px;
  color: var(--negative);
}
.notice button {
  margin-left: 12px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.admin-main {
  padding: 40px 44px;
  max-width: 1360px;
}
.admin-tabs {
  border-bottom: 1px solid var(--rule);
  margin-bottom: 28px;
}
.filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 25px;
}
.records article {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.records article small {
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.record-team {
  flex: 1;
  min-width: 0;
}
.records article strong {
  overflow-wrap: anywhere;
}
.pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}
.pagination span {
  margin-right: auto;
  color: var(--muted);
}
.login {
  max-width: 420px;
  padding: 90px 20px;
}
.login h1 {
  font-size: 28px;
}
.login form {
  margin: 28px 0;
}
.login button {
  width: 100%;
}
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 18px 0;
}
dialog {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: 14px;
  max-width: 480px;
  width: calc(100% - 32px);
  padding: 28px;
  max-height: 90dvh;
}
dialog::backdrop {
  background: #000a;
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 25px;
}
textarea {
  resize: vertical;
  min-height: 90px;
}
.mapping-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr 120px auto;
  align-items: end;
  gap: 16px;
  border-bottom: 1px solid var(--rule);
  padding: 18px 0;
}
.mapping-row label {
  margin: 0;
}
.mapping-row input {
  width: 100%;
}
#settings {
  max-width: 1050px;
}
#settings > label {
  max-width: 600px;
}
#settings > h2 {
  margin-top: 40px;
}
#admin-notice {
  color: var(--accent);
  margin-bottom: 16px;
  white-space: pre-wrap;
}
.display .room-notes,
.display .period-row,
.display .scope,
.display footer {
  display: none;
}
.display .board-layout {
  display: block;
}
.display h1 {
  font-size: 36px;
}
.display .team-row {
  min-height: 95px;
}
.display .team strong {
  font-size: 26px;
}
.display .completion strong {
  font-size: 36px;
}
.display .team-row {
  grid-template-columns: 80px 1fr 100px 170px;
}
.display .rank {
  font-size: 26px;
}
.embed .room-notes,
.embed footer,
.embed .scope {
  display: none;
}
.embed .board-layout {
  display: block;
}
.embed main {
  padding: 20px;
}
.embed h1 {
  font-size: 24px;
}
/* 1272px canvas = flexible standings + 44px gap + 260px room rail. */
@media (min-width: 1600px) {
  .display main,
  .display .topbar {
    max-width: 1600px;
  }
  .display .team-row {
    min-height: 110px;
  }
  .display .team strong {
    font-size: 30px;
  }
}
@media (max-width: 1100px) {
  .board-layout {
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 24px;
  }
  .topbar,
  .leaderboard-main,
  .admin-main {
    padding-left: 28px;
    padding-right: 28px;
  }
  .tabs {
    gap: 19px;
  }
  .mapping-row {
    grid-template-columns: 1fr 1fr;
  }
  .room-stats {
    padding: 18px;
  }
  .table-head,
  .team-row {
    grid-template-columns: 42px minmax(0, 1fr) 52px 105px;
    gap: 12px;
  }
}
@media (max-width: 700px) {
  input,
  select,
  textarea {
    font-size: 16px;
  }
  .topbar {
    padding: 20px;
  }
  .topbar nav {
    font-size: 12px;
    gap: 12px;
  }
  .wordmark {
    font-size: 14px;
  }
  .brand-mark {
    font-size: 30px;
  }
  .topbar small {
    font-size: 11px;
  }
  .leaderboard-main,
  .admin-main {
    padding: 26px 20px;
  }
  .scope {
    margin-bottom: 22px;
    font-size: 11px;
  }
  .title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 20px;
  }
  h1 {
    font-size: 28px;
  }
  .title-actions {
    width: 100%;
    justify-content: space-between;
  }
  .title-actions select {
    min-width: 0;
    max-width: 60%;
  }
  .title-actions .button {
    font-size: 12px;
    padding: 10px;
  }
  .period-row {
    display: block;
    margin-bottom: 23px;
  }
  .tabs {
    gap: 24px;
  }
  .tabs button {
    font-size: 13px;
    min-height: 48px;
  }
  .period-row .toggle {
    padding: 14px 0;
  }
  .board-layout {
    display: block;
  }
  .room-notes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding-top: 25px;
  }
  .room-clock {
    padding-left: 16px;
  }
  .room-clock strong {
    font-size: 32px;
  }
  .room-stats {
    margin: 0;
  }
  .ranking-note {
    grid-column: 1/-1;
  }
  .table-head {
    grid-template-columns: 36px minmax(0, 1fr) 82px;
    padding-left: 8px;
    padding-right: 8px;
  }
  .table-head span:nth-child(3) {
    display: none;
  }
  .team-row {
    grid-template-columns: 36px minmax(0, 1fr) 82px;
    padding: 17px 8px;
    gap: 10px;
    position: relative;
  }
  .team strong {
    font-size: 14px;
  }
  .team span {
    font-size: 11px;
  }
  .rank {
    font-size: 16px;
  }
  .players {
    grid-column: 2;
    font-size: 11px;
    text-align: left;
    margin-top: -5px;
  }
  .players small {
    display: inline;
    font-size: 11px;
  }
  .completion {
    grid-column: 3;
    grid-row: 1/3;
  }
  .completion strong {
    font-size: 24px;
  }
  .completion span {
    font-size: 11px;
  }
  .table-footer {
    padding: 18px 8px;
    font-size: 11px;
  }
  footer {
    display: block;
    margin-top: 24px;
    font-size: 11px;
  }
  footer span {
    display: block;
    margin-top: 8px;
  }
  .records article {
    flex-wrap: wrap;
    gap: 12px;
  }
  .record-team {
    flex-basis: 60%;
  }
  .records article small {
    font-size: 11px;
  }
  .mapping-row {
    grid-template-columns: 1fr;
  }
  .filters > * {
    flex: 1;
    min-width: 130px;
  }
  .login {
    padding-top: 60px;
  }
  .display .team-row {
    grid-template-columns: 36px 1fr 82px;
  }
  .display .team strong {
    font-size: 18px;
  }
  .display .completion strong {
    font-size: 26px;
  }
  .display .rank {
    font-size: 18px;
  }
}
@media (hover: none) {
  button:hover,
  .button:hover {
    background: transparent;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
.metric-strip {
  display: flex;
  gap: 0;
  border-block: 1px solid var(--rule);
  margin: 28px 0;
}
.metric-strip > div {
  flex: 1;
  padding: 20px;
  border-right: 1px solid var(--rule);
}
.metric-strip > div:last-child {
  border-right: 0;
}
.metric-strip span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.metric-strip strong {
  display: block;
  font-size: 24px;
  font-weight: 400;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}
.endpoint {
  overflow-wrap: anywhere;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}
#csv-form {
  max-width: 800px;
}
#csv-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}
#csv-form > button {
  margin: 10px 10px 10px 0;
}
@media (max-width: 700px) {
  .metric-strip {
    flex-wrap: wrap;
  }
  .metric-strip > div {
    min-width: 33%;
    border: 0;
    padding: 12px;
  }
  .admin-tabs {
    gap: 22px;
  }
  #csv-columns {
    display: block;
  }
}

.toggle {
  flex-direction: row;
}
