/* ── Section ─────────────────────────────────────────────── */
.section {
  margin-bottom: 16px;
}

.section-header {
  background: #1e3a5f;
  color: #fff;
  padding: 9px 14px;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.section-header.collapsed {
  border-radius: 8px;
}

.section-header h3 {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sec-count {
  font-size: 11px;
  opacity: 0.7;
}

.sec-arrow {
  font-size: 10px;
  opacity: 0.8;
  transition: transform 0.2s;
}

.sec-arrow.open {
  transform: rotate(180deg);
}

/* ── Table ──────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: 0 0 8px 8px;
  border: 1px solid #e8e8e8;
  border-top: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

thead tr {
  background: #f8f9fa;
}

th {
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  color: #555;
  border-bottom: 1px solid #e8e8e8;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

th:hover {
  background: #eef2f7;
}

th.sorted-asc::after {
  content: ' ▲';
  font-size: 9px;
  color: #1e3a5f;
}

th.sorted-desc::after {
  content: ' ▼';
  font-size: 9px;
  color: #1e3a5f;
}

td {
  padding: 7px 10px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

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

tr.row-even td {
  background: #fafafa;
}

.hide  {
  display: none;
}

.rank-1 .rank-cell {
  color: #b45309;
  font-weight: 700;
}

.rank-2 .rank-cell {
  color: #6b7280;
  font-weight: 600;
}

.rank-3 .rank-cell {
  color: #92400e;
  font-weight: 600;
}

.time-cell {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #1e3a5f;
}

.time-cell.is-new {
  color: #d97706;
}

/* ── Section collapse buttons ────────────────────────────── */
.section-controls {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

/* ── Mobile cards ───────────────────────────────────────── */
@media(max-width:599px) {
  table thead {
    display: none;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  tr {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 8px 10px;
    background: #fff;
  }

  tr.row-even {
    background: #fff;
  }

  td {
    padding: 3px 0;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  td::before {
    content: attr(data-label);
    font-size: 10px;
    color: #888;
    font-weight: 500;
    flex-shrink: 0;
    margin-right: 8px;
  }

  td.rank-cell {
    font-size: 16px;
    font-weight: 700;
    justify-content: flex-start;
  }

  td.rank-cell::before {
    display: none;
  }

  .table-wrap {
    border-radius: 0 0 8px 8px;
  }
}

@media(min-width:600px) {
  td::before {
    display: none;
  }
}