/* The site in the game's "Broadcast" style (docs/ui/UI-GUIDELINES.md): flat black and
   white, one orange for the primary action, Archivo Black over Fira Mono, no radius,
   shadows or gradients. Values come from tokens.css only. The site is dark whatever the
   OS theme, as the game is. */

*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg-base);
  color: var(--fg-primary);
  font-family: var(--face-mono);
  font-size: var(--type-body-size);
  line-height: 1.4;
}

a { color: inherit; }

.wrap {
  max-width: calc(1280px - 2 * var(--space-6));
  margin: 0 auto;
  padding: var(--space-6);
}

/* --- header --- */

.top {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-7);
}
.brand {
  display: flex;
  align-items: center;
  height: var(--header-height);
  padding: 0 var(--space-4);
  background: var(--fg-primary);
  color: var(--bg-base);
  font-family: var(--face-display);
  font-size: var(--type-button-size);
  text-transform: uppercase;
  text-decoration: none;
}
.nav { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.who {
  display: flex;
  align-items: center;
  height: var(--header-height);
  padding: 0 var(--space-3);
  background: var(--bg-panel);
  color: var(--fg-muted);
  font-size: var(--type-caption-size);
}

/* --- buttons: primary (orange, one per page), secondary (outline) --- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  height: var(--button-small);
  padding: 0 var(--space-5);
  border: var(--outline) solid var(--fg-primary);
  background: transparent;
  color: var(--fg-primary);
  font-family: var(--face-mono);
  font-size: var(--type-body-size);
  text-decoration: none;
  cursor: pointer;
}
.button:hover, .button:focus-visible { background: var(--bg-panel); outline: none; }
.button.primary {
  height: var(--button-standard);
  border-color: var(--accent-live);
  background: var(--accent-live);
  color: var(--bg-base);
  font-family: var(--face-display);
  font-size: var(--type-button-size);
  text-transform: uppercase;
}
.button.primary:hover, .button.primary:focus-visible { border-color: var(--fg-primary); }
.button.danger { border-color: var(--danger); color: var(--danger); }
.button:disabled, .button[aria-disabled="true"] {
  border-color: var(--bg-raised);
  background: transparent;
  color: var(--fg-disabled);
  cursor: default;
}
.button.square { min-width: 0; width: var(--button-small); padding: 0; }

/* --- section chips --- */

.chips { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.chip {
  padding: var(--space-1) var(--space-3);
  background: var(--fg-primary);
  color: var(--bg-base);
  font-family: var(--face-display);
  font-size: var(--type-chip-size);
  text-transform: uppercase;
}
.chip.off {
  background: transparent;
  color: var(--fg-disabled);
  outline: var(--outline) solid var(--bg-raised);
  outline-offset: calc(-1 * var(--outline));
}
.caption { color: var(--fg-muted); font-size: var(--type-caption-size); }
.error { color: var(--danger); font-size: var(--type-caption-size); min-height: 1em; }
.error:empty { display: none; }

h1 {
  margin: 0;
  font-family: var(--face-display);
  font-size: var(--type-display-size);
  font-weight: normal;
  text-transform: uppercase;
  line-height: 1;
}

/* --- the leaderboard --- */

.board { margin-top: var(--space-4); display: flex; flex-direction: column; gap: 2px; }
.row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 120px 80px 80px;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--row-height);
  padding: 0 var(--space-3);
  background: var(--bg-panel);
}
.row > :nth-child(4), .row > :nth-child(5) { text-align: right; }
.row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.head { background: transparent; color: var(--fg-muted); font-size: var(--type-caption-size); }
.row.you { background: var(--fg-primary); color: var(--bg-base); }
.row.you .rank { font-family: var(--face-display); }
.board .gap { height: var(--space-3); }
.pager { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-4); }
.empty { padding: var(--space-5); background: var(--bg-panel); color: var(--fg-muted); }

/* --- forms (the login mock) --- */

.panel { width: 440px; max-width: 100%; margin: 0 auto; background: var(--bg-panel); }
.panel > .head {
  display: flex;
  align-items: center;
  min-height: var(--header-height);
  padding: var(--space-3) var(--space-5);
  border-bottom: var(--outline) solid var(--bg-raised);
}
.panel > .body { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5); }
.field { display: flex; flex-direction: column; gap: var(--space-1); }
.field label { color: var(--fg-muted); font-size: var(--type-caption-size); }
input {
  width: 100%;
  height: var(--button-small);
  padding: 0 var(--space-3);
  border: var(--outline) solid var(--bg-raised);
  border-radius: 0;
  background: var(--bg-base);
  color: var(--fg-primary);
  font-family: var(--face-mono);
  font-size: var(--type-body-size);
}
input:focus { border-color: var(--fg-primary); outline: none; }
.name-row { display: flex; align-items: center; }
.name-row input.tag { width: 96px; flex: none; }
.name-row .hash {
  width: var(--space-6);
  text-align: center;
  color: var(--fg-muted);
  font-family: var(--face-display);
  font-size: var(--type-button-size);
}
.panel .button { width: 100%; }
.stack { display: flex; flex-direction: column; gap: var(--space-5); max-width: 640px; }
.lines { display: flex; flex-direction: column; gap: var(--space-2); }
.line { display: flex; justify-content: space-between; gap: var(--space-4); }
.line > :first-child { color: var(--fg-muted); }

/* --- phones: one column, 16 px gutter, the essential columns only --- */

@media (max-width: 640px) {
  .wrap { padding: var(--space-4); }
  .top { margin-bottom: var(--space-5); }
  .row { grid-template-columns: 48px minmax(0, 1fr) 64px; }
  .row > :nth-child(3), .row > :nth-child(5) { display: none; }
  .button { min-width: 0; }
}
