/* Raid History page - unlike achievements.css/prestige.css, this doesn't define its own fixed
   dark palette: it's a simple table, so it just uses the site's existing theme tokens directly
   (already light/dark-aware via style.css's :root definitions). */

.history-page .history-shell {
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.history-page .history-headline {
  margin-bottom: 18px;
}

.history-page .history-headline h1 {
  margin: 0 0 6px;
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.2;
}

.history-page .history-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.history-page .history-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 640px;
  line-height: 1.5;
}

.history-page .history-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}

.history-page .history-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.history-page .history-table th,
.history-page .history-table td {
  padding: 8px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
}

/* Map, Mode and When each read as one unit - letting them wrap turned every row into a
   two-line block ("Streets of / Tarkov", "Aug 7, 2026, / 2:23 AM") and doubled the height of
   the whole table. The Quests column is the only one that should still wrap, since it holds a
   variable number of chips. */
.history-page .history-table td:nth-child(-n + 5),
.history-page .history-table th:nth-child(-n + 5) {
  white-space: nowrap;
}

.history-page .history-table th {
  background: var(--surface-hover);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.history-page .history-table tbody tr:hover td {
  background: var(--surface-hover);
}

.history-page .history-table th[data-sort] {
  cursor: pointer;
  user-select: none;
}

.history-page .history-table th[data-sort]:hover {
  color: var(--text);
}

/* Arrow only renders once history.js sets data-sort-dir on the currently-sorted column - matches
   the same convention admin.js's users table uses. */
.history-page .history-table th[data-sort-dir]::after {
  margin-left: 0.3em;
  color: var(--accent-strong);
}

.history-page .history-table th[data-sort-dir="asc"]::after {
  content: "\25B2";
}

.history-page .history-table th[data-sort-dir="desc"]::after {
  content: "\25BC";
}

/* Quests completed during this raid (see server.ts's /api/raid-history, which cross-references
   task-progress timestamps against this raid's start/end window) - same complete-status green
   every other "complete" pill/chip in the app already uses, so it reads as the same signal. */
.history-page .history-quest-chip {
  display: inline-block;
  margin: 0 4px 4px 0;
  padding: 2px 8px;
  background: var(--status-complete-bg);
  color: var(--status-complete-text);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  white-space: nowrap;
}
