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

:root {
  --bg:        #0d0f14;
  --surface:   #161a23;
  --surface2:  #1d2130;
  --border:    #252b38;
  --accent:    #3b82f6;
  --accent-dim:#1d4ed8;
  --text:      #f1f5f9;
  --muted:     #64748b;
  --green:     #22c55e;
  --red:       #ef4444;
  --yellow:    #eab308;
  --radius:    12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 60px;
}

/* ── Nav ── */
nav {
  width: 100%;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 10;
}

nav .brand {
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
  text-decoration: none;
  margin-right: 12px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}

nav a:hover, nav a.active { color: var(--text); background: var(--surface2); }

/* ── Page wrapper ── */
.page {
  width: 100%;
  max-width: 860px;
  padding: 32px 16px 0;
}

/* ── Search row ── */
.search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
}

.search-row input, .search-row select {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  padding: 9px 14px;
  outline: none;
  transition: border-color .15s;
}

.search-row input:focus, .search-row select:focus { border-color: var(--accent); }
.search-row input::placeholder { color: var(--muted); }
.search-row select option { background: var(--surface); }

.btn {
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  transition: background .15s;
  white-space: nowrap;
}

.btn:hover { background: var(--accent-dim); }
.btn.ghost {
  background: var(--surface2);
  color: var(--text);
}
.btn.ghost:hover { background: var(--border); }

/* ── Cards / tiles ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 14px;
}

.card-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }

.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.tile .label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.tile .value       { font-size: 18px; font-weight: 600; }
.tile .value.large { font-size: 24px; }
.tile .value.xlarge { font-size: 32px; font-weight: 700; }

/* ── Hero ── */
.hero {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 14px;
}

.hero img.crest {
  width: 80px;
  height: 80px;
  object-fit: contain;
  background: var(--bg);
  border-radius: 8px;
  padding: 8px;
  flex-shrink: 0;
}

.hero img.avatar {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}

.hero-text h1 { font-size: 24px; font-weight: 700; line-height: 1.2; }
.hero-text .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ── Badges ── */
.badge {
  display: inline-block;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  padding: 2px 8px;
  margin-top: 6px;
}

.badge + .badge { margin-left: 4px; }
.badge.blue   { background: var(--accent);  color: #fff; }
.badge.green  { background: var(--green);   color: #fff; }
.badge.red    { background: var(--red);     color: #fff; }
.badge.yellow { background: var(--yellow);  color: #000; }
.badge.muted  { background: var(--surface2); color: var(--muted); }

/* ── Table ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface2); }
.data-table td a { color: var(--accent); text-decoration: none; }
.data-table td a:hover { text-decoration: underline; }
.data-table .num { text-align: right; }
.data-table .center { text-align: center; }

/* ── Key-value rows ── */
.kv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.kv-row:last-child { border-bottom: none; }
.kv-row .k { color: var(--muted); }
.kv-row .v { font-weight: 500; }

/* ── Timeline (events) ── */
.timeline { list-style: none; }

.timeline li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.timeline li:last-child { border-bottom: none; }

.timeline .min {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  min-width: 36px;
  padding-top: 1px;
}

.timeline .icon { font-size: 16px; flex-shrink: 0; }
.timeline .detail { flex: 1; }
.timeline .detail strong { font-weight: 600; }
.timeline .detail .assist { color: var(--muted); font-size: 12px; }

/* ── Stat bar ── */
.stat-bar-row { margin-bottom: 10px; }
.stat-bar-row .stat-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-bar-row .bar-track {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--border);
}

.stat-bar-row .bar-home { background: var(--accent); border-radius: 3px 0 0 3px; }
.stat-bar-row .bar-away { background: var(--red);    border-radius: 0 3px 3px 0; margin-left: auto; }

/* ── Status / error ── */
#status, .status {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 8px 0;
  min-height: 22px;
}

#status.error, .status.error { color: var(--red); }

/* ── Responsive ── */
@media (max-width: 540px) {
  .hero { flex-direction: column; text-align: center; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  nav a span { display: none; }
}
