/* Palette lifted from the app UI so the panel reads as the same product:
   volt on near-black, red for misses, amber for the podium. */
:root {
  --page:      #0A0C08;
  --panel:     #101319;
  --panel-2:   #1A1E28;
  --line:      #242A36;
  --line-soft: #1d222c;

  --text:      #F2F5FA;
  --text-2:    #C9D1DE;
  --muted:     #9AA3B4;

  --volt:      #C6F135;
  --volt-dim:  #9FC42A;
  --amber:     #FFC53D;
  --red:       #FF2E45;

  --radius: 10px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--volt); }

/* ------------------------------------------------------------------ topbar */

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 3px solid var(--volt);
  box-shadow: 0 0 14px rgba(198, 241, 53, .45);
  flex: none;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 14px; letter-spacing: .14em; }
.brand-text small { font-size: 11px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }

.tabs { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }

.tabs a {
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-2);
  border: 1px solid transparent;
}

.tabs a:hover { background: var(--panel-2); color: var(--text); }

.tabs a.active {
  background: var(--volt);
  color: #10140a;
  border-color: var(--volt);
}

/* Hidden until the session says this visitor is logged in. */
.tabs a.gated { display: none; }
body.authed .tabs a.gated { display: inline-block; }

.session { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------- shell */

main {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 22px 40px;
}

.foot {
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

h1 { font-size: 22px; letter-spacing: .04em; margin: 0 0 4px; }
h2 { font-size: 15px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); margin: 0 0 12px; }

.view-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.view-head .sub { color: var(--muted); font-size: 13px; margin: 0; }
.view-head .spacer { margin-left: auto; }

.loading, .empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ------------------------------------------------------------------- cards */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.stat {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.stat .label {
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.stat .value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .value.volt { color: var(--volt); }

/* ------------------------------------------------------------------ tables */

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  background: var(--panel-2);
}

table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }

thead th {
  text-align: left;
  padding: 12px 14px;
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-weight: 600;
}

tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #1e2432; }

.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.miss { color: var(--red); font-weight: 600; }
.hit { color: var(--volt); font-weight: 700; }

.rank { font-weight: 800; font-variant-numeric: tabular-nums; width: 54px; }
.rank.p1 { color: var(--amber); }
.rank.p2, .rank.p3 { color: var(--text-2); }

/* The board highlights its own top row the way screen 10 does. */
tbody tr.top td { background: rgba(198, 241, 53, .09); }

.name { font-weight: 600; }

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--muted);
}

.pill.guest { border-color: #3a3050; color: #b294d8; }
.pill.consent { border-color: #33400f; color: var(--volt-dim); }

/* ----------------------------------------------------------------- controls */

.controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

input[type="search"], input[type="date"], input[type="password"], select {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  min-width: 0;
}

input:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--volt);
  outline-offset: 1px;
}

input[type="search"] { min-width: 230px; }

button {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 15px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  font-family: inherit;
  cursor: pointer;
}

button:hover:not(:disabled) { border-color: #39415A; }
button:disabled { opacity: .45; cursor: default; }

button.primary { background: var(--volt); color: #10140a; border-color: var(--volt); }
button.primary:hover:not(:disabled) { background: #d3fb4e; }

.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 14px; font-size: 12.5px; color: var(--muted); }

/* -------------------------------------------------------------------- login */

.login {
  max-width: 380px;
  margin: 56px auto;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

.login h1 { font-size: 17px; letter-spacing: .1em; text-transform: uppercase; }
.login p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.login form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.login input { width: 100%; }

.notice {
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--line);
  background: var(--panel-2);
  margin-bottom: 18px;
}

.notice.bad { border-color: #4a1f26; background: #1d1215; color: #ffb3bd; }
.notice.warn { border-color: #4a3d17; background: #1c1810; color: #f3d894; }

/* -------------------------------------------------------------------- round */

.round-head {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.back { display: inline-block; margin-bottom: 14px; font-size: 12.5px; text-decoration: none; letter-spacing: .06em; text-transform: uppercase; }
.back:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .topbar { gap: 12px; padding: 12px 16px; }
  .tabs { margin-left: 0; width: 100%; }
  main { padding: 18px 14px 30px; }
  .stat .value { font-size: 21px; }
}
