:root {
  color-scheme: light;
  --bg: #eef2f5;
  --panel: #f7f9fa;
  --panel-2: #eef2f5;
  --panel-3: #dce4e9;
  --line: #b8c4cd;
  --text: #3a4852;
  --muted: #6b7d8a;
  --cyan: #2d9cdb;
  --gold: #0f7bb3;
  --green: #4a9d7c;
  --red: #c9302c;
  --red-hot: #a12624;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.7) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.7) 1px, transparent 1px),
    radial-gradient(circle at 50% 0%, #f0f4f7 0%, #eef2f5 80%);
  background-size: 50px 50px, 50px 50px, 100% 100%;
  background-repeat: repeat, repeat, no-repeat;
  background-attachment: fixed;
  color: var(--text);
  font-family: "Courier New", Courier, monospace;
  font-size: 15px;
  letter-spacing: 0;
}

.shell {
  width: min(1360px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-bottom: 3px double var(--cyan);
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}

.sub {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

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

button {
  height: 36px;
  border: 1px solid #1a7ab3;
  border-radius: 0;
  background: var(--cyan);
  color: #fff;
  padding: 0 14px;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
}

button:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

.home-btn {
  height: 36px;
  border: 1px solid #1a7ab3;
  background: var(--cyan);
  color: #fff;
  padding: 0 14px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.home-btn:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.status {
  min-width: 172px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.overview {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 12px;
}

.metric,
.table-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.05);
}

.metric {
  min-height: 92px;
  padding: 14px;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-value {
  margin-top: 10px;
  font-size: 27px;
  line-height: 1;
  font-weight: 800;
}

.metric-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.mini {
  min-height: 58px;
  padding: 12px 14px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mini span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.mini span:last-child {
  font-size: 18px;
  font-weight: 800;
  text-align: right;
}

.grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 12px;
  align-items: start;
}

.wide {
  grid-column: 1 / -1;
}

.table-panel {
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  background: #f0f4f7;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  font-size: 14px;
  font-weight: 800;
}

.panel-meta {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(176, 196, 205, 0.82);
  text-align: left;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

td {
  font-size: 13px;
}

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

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rank {
  width: 52px;
  color: var(--muted);
}

.map-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.map-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.meta-line {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-row {
  cursor: pointer;
}

.match-row:hover td {
  background: rgba(45, 156, 219, 0.08);
}

.toggle-cell {
  width: 34px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.match-row[aria-expanded="true"] .toggle-cell {
  color: var(--cyan);
}

.details-row[hidden] {
  display: none;
}

.details-row td {
  background: #f0f4f7;
  white-space: normal;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 4px 0;
}

.detail-stat {
  min-height: 58px;
  padding: 10px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 0;
}

.detail-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-value {
  margin-top: 7px;
  font-size: 16px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 10px;
  align-items: center;
}

.bar-track {
  height: 7px;
  background: #d0d8de;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  width: 0;
  height: 100%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(45, 156, 219, 0.35);
}

.bar-fill.gold {
  background: var(--gold);
}

.bar-fill.green {
  background: var(--green);
}

.empty,
.error {
  padding: 18px 14px;
  color: var(--muted);
}

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

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #f0f4f7;
  border-top: 1px solid var(--line);
}

.pager-info {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pager-actions {
  display: flex;
  gap: 8px;
}

.pager-actions button {
  height: 30px;
  min-width: 34px;
  padding: 0 10px;
}

@media (max-width: 1120px) {
  .overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .details-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 20px, 1360px);
    padding-top: 14px;
  }

  header {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions,
  button {
    width: 100%;
  }

  .status {
    min-width: 0;
    text-align: left;
  }

  .pager {
    align-items: stretch;
    flex-direction: column;
  }

  .pager-actions,
  .pager-actions button {
    width: 100%;
  }

  .overview,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-value {
    font-size: 24px;
  }

  th,
  td {
    padding: 9px 8px;
  }

  .hide-small {
    display: none;
  }
}