﻿:root {
  --bg: #0a0c10;
  --surface: #12161d;
  --surface-2: #181d26;
  --text: #e6e9ef;
  --muted: #8b95a5;
  --border: #232a36;
  --accent: #4c8dff;
  --pass: #2fbf71;
  --fail: #ef5350;
  --withheld: #e0a53e;
  --absent: #6b7686;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.site-header {
  padding: 2rem 1rem 0.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.site-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.subtitle {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

main {
  max-width: 900px;
  margin: 1.5rem auto;
  padding: 0 1rem;
  display: grid;
  gap: 1.5rem;
}

.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
}

.section h2 {
  margin: 0 0 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

#lookup-form {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  align-items: stretch;
}

#roll-input {
  flex: 1 1 0%;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
}

#lookup-form button {
  flex: 0 0 auto;
  white-space: nowrap;
}

#roll-input:focus {
  outline: none;
  border-color: var(--accent);
}

button {
  padding: 0.6rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.1);
}

.lookup-result {
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.lookup-result.error {
  color: var(--fail);
  border-color: #4b2327;
}

.lookup-result table {
  width: 100%;
  border-collapse: collapse;
}

.lookup-result td {
  padding: 0.25rem 0.4rem;
  vertical-align: top;
}

.lookup-result td:first-child {
  color: var(--muted);
  white-space: nowrap;
  width: 45%;
}

.lookup-result .status {
  margin: 0.6rem 0 0;
}

.badge {
  display: inline-block;
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0a0c10;
}

.badge.pass {
  background: var(--pass);
}
.badge.fail {
  background: var(--fail);
  color: #fff;
}
.badge.withheld {
  background: var(--withheld);
}
.badge.absent {
  background: var(--absent);
  color: #fff;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.stat .label {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat .value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0.1rem;
  font-variant-numeric: tabular-nums;
}

.stat .value.accent {
  color: var(--accent);
}
.stat .value.pass {
  color: var(--pass);
}
.stat .value.fail {
  color: var(--fail);
}
.stat .value.withheld {
  color: var(--withheld);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

tr:last-child td {
  border-bottom: none;
}

.distribution {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dist-row {
  display: grid;
  grid-template-columns: 84px 1fr 64px;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  padding: 0.1rem 0;
}

.dist-row .band {
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.dist-bar {
  background: var(--surface-2);
  border-radius: 999px;
  height: 16px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}

.dist-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, #2f6fdb, var(--accent));
  border-radius: 999px;
  min-width: 0;
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}

.dist-row:hover .fill {
  filter: brightness(1.2);
  box-shadow: 0 0 10px rgba(76, 141, 255, 0.45);
}

.dist-row .count {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
  text-align: center;
  justify-self: end;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 1rem 1rem 3rem;
  max-width: 900px;
  margin: 0 auto;
}

@media (max-width: 520px) {
  .dist-row {
    grid-template-columns: 64px 1fr 48px;
  }
}
