:root {
  color-scheme: light dark;
  --bg: #0f1420;
  --panel: #161d2e;
  --border: #2a3450;
  --text: #e8ecf5;
  --muted: #93a0bd;
  --accent: #4f8cff;
  --gold: #e0b23b;
  --silver: #b9c2d0;
  --bronze: #c07a3c;
  --danger: #e05a5a;
  --ok: #3fbf6f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.topbar a { color: var(--text); text-decoration: none; margin-right: 14px; font-weight: 600; }
.topbar a:hover { color: var(--accent); }

.container { max-width: 1100px; margin: 0 auto; padding: 20px; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 18px;
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.85em; text-transform: uppercase; }
td:first-child, th:first-child { text-align: left; }

.rank-1 { color: var(--gold); font-weight: 700; }
.rank-2 { color: var(--silver); font-weight: 700; }
.rank-3 { color: var(--bronze); font-weight: 700; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 1em;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.1); }
.btn.secondary { background: var(--border); }
.btn.danger { background: var(--danger); }

input, select {
  background: #0d1220;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  width: 100%;
}

label { display: block; margin: 10px 0 4px; color: var(--muted); font-size: 0.9em; }

.progress-outer {
  background: #0d1220;
  border-radius: 8px;
  overflow: hidden;
  height: 22px;
  border: 1px solid var(--border);
}
.progress-inner {
  background: var(--accent);
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
}

.mvp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.mvp-item { background: #0d1220; border-radius: 8px; padding: 10px 14px; }
.mvp-item .label { color: var(--muted); font-size: 0.85em; }
.mvp-item .value { font-weight: 700; font-size: 1.1em; }

.error { color: var(--danger); }
.badge-ok { color: var(--ok); }

@media (max-width: 700px) {
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  tr { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; padding: 6px; }
  td { display: flex; justify-content: space-between; border: none; padding: 4px 8px; }
  td::before { content: attr(data-label); color: var(--muted); font-weight: 600; }
}
