/* ---------- completed match history ---------- */
.history-toolbar {
  display: flex;
  align-items: flex-start;
  margin-bottom: 14px;
}
.history-filters {
  width: min(100%, 420px);
}
.history-filter-title {
  margin-bottom: 8px;
  padding: 2px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.history-filter-menu {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: start;
  gap: 10px 16px;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.history-filter-menu .search-input {
  width: 100%;
  min-width: 0;
}
.history-mode-filters {
  display: grid;
  gap: 5px;
  padding-top: 2px;
}
.history-mode-filters label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-2);
}
.history-mode-filters input {
  margin: 0;
  accent-color: var(--signal);
}
@media (max-width: 520px) {
  .history-filter-menu {
    grid-template-columns: 1fr;
  }
}
.history-wrap {
  max-width: 1200px;
}
.history-table th:nth-child(1) {
  width: 38%;
}
.history-table th:nth-child(3),
.history-table th:nth-child(4) {
  font-family: var(--mono);
  font-size: 13.5px;
}
.history-row {
  cursor: pointer;
}
.history-row:hover td,
.history-row.open td {
  background: var(--panel-2);
}
.history-map {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}
.history-caret {
  width: 12px;
  color: var(--ink-3);
  font-size: 11px;
}
.history-map .map-thumb {
  width: 66px;
  height: 39px;
  object-fit: cover;
  border: 1px solid var(--line-2);
  border-radius: 2px;
}
.history-result {
  font-size: 13px;
  font-weight: 600;
}
.history-result.win {
  color: var(--ok-ink);
}
.history-result.draw {
  color: var(--ink-3);
}
.history-detail td {
  padding: 0 14px 14px;
  white-space: normal;
  background: var(--panel-2);
}
.history-detail-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.history-detail-loading,
.history-detail-error {
  padding: 16px;
  color: var(--ink-3);
}
.history-detail-error {
  color: var(--alarm-ink);
}
.history-teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.history-team {
  min-width: 0;
  padding: 14px 16px 16px;
}
.history-team + .history-team {
  border-left: 1px solid var(--line);
}
.history-team-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.history-team-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.history-team-name.winner {
  color: var(--ok-ink);
}
.history-team-objective {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-3);
}
.history-player {
  padding: 10px 0;
}
.history-player + .history-player {
  border-top: 1px dashed var(--line);
}
.history-player-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
}
.history-player-name {
  font-weight: 600;
}
.history-player-identity {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}
.history-player-portrait {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  object-fit: cover;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--panel-2);
}
.history-player-hero {
  margin-top: 2px;
  font-size: 13px;
  color: var(--ink-2);
}
.history-player-stats {
  align-self: start;
  text-align: right;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-3);
  white-space: nowrap;
}
.history-player-stats b {
  color: var(--ink);
  font-weight: 600;
}
.history-mmr {
  color: var(--ink-2);
}
.history-mmr-delta.gain {
  color: var(--ok-ink);
}
.history-mmr-delta.loss {
  color: var(--alarm-ink);
}
.history-markers {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.history-marker {
  padding: 1px 6px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.history-marker.backfill {
  color: var(--warn-ink);
  border-color: color-mix(in srgb, var(--warn-ink) 45%, var(--line));
}
.history-presences {
  margin-top: 8px;
}
.history-presences summary {
  cursor: pointer;
  color: var(--ink-2);
  font-size: 12.5px;
}
.history-presence {
  margin-top: 7px;
  padding: 8px;
  background: var(--panel-2);
  border-left: 2px solid var(--line-2);
  font-size: 12.5px;
  color: var(--ink-2);
}
.history-loadout {
  margin-top: 5px;
  color: var(--ink-3);
  line-height: 1.45;
}
.history-kit-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 6px 15px 0 0;
}
.history-kit-group > span {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--ink-3);
}
.history-kit-row {
  display: grid;
  grid-template-columns: repeat(6, 30px);
  gap: 4px;
}
.history-kit-slot {
  position: relative;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--panel);
}
.history-kit-slot.empty {
  border-style: dashed;
  background: transparent;
}
.history-kit-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.history-kit-slot > span {
  position: absolute;
  right: 2px;
  bottom: 0;
  padding: 0 2px;
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 12px;
  color: var(--ink-3);
}
.history-perk-row {
  grid-template-columns: repeat(3, 30px);
}
.history-more {
  margin-top: 14px;
}
@media (max-width: 720px) {
  .history-teams {
    grid-template-columns: 1fr;
  }
  .history-team + .history-team {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .history-map .map-thumb {
    display: none;
  }
  .history-table th:nth-child(3),
  .history-table td:nth-child(3) {
    display: none;
  }
}
