:root {
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --accent: #1e40af;
  --accent-soft: #60a5fa;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --locked: #34d399;
  --contention: #fbbf24;
  --eliminated: #f87171;
  --error: #f87171;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  min-height: 100%;
}
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding: 2rem 1rem;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
}
a {
  color: var(--accent-soft);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
.back-btn {
  display: inline-block;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.back-btn:hover {
  color: var(--text);
}
h1 {
  font-size: clamp(2rem, 3vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}
.frozen-badge {
  display: inline-block;
  background: var(--locked);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 1rem;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}
.stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-soft);
  margin-top: 0.25rem;
}
.page-actions,
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: center;
}
.page-actions input[type="text"],
.page-actions label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
input[type="text"] {
  width: 100%;
  max-width: 320px;
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
}
input[type="text"]::placeholder {
  color: var(--text-muted);
}
label {
  font-size: 0.95rem;
  color: var(--text-muted);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 2rem;
}
th, td {
  padding: 0.9rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  background: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
tr:last-child td {
  border-bottom: none;
}
tr:hover {
  background: rgba(30, 64, 175, 0.08);
}
.status-locked { color: var(--locked); font-weight: 600; }
.status-contention { color: var(--contention); font-weight: 600; }
.status-eliminated { color: var(--eliminated); font-weight: 600; }
.loading { color: var(--text-muted); font-style: italic; }
.error { color: var(--error); padding: 1rem; }
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot-locked { background: var(--locked); }
.dot-contention { background: var(--contention); }
.dot-eliminated { background: var(--eliminated); }
@media (max-width: 768px) {
  .events-table th:nth-child(4), .events-table td:nth-child(4),
  .ranks-table th:nth-child(5), .ranks-table td:nth-child(5) {
    display: none;
  }
}
