/* Match History */
.history {
  padding: 0 22px 22px;
}

.match-card {
  border-top: 1px solid var(--line);
}

.match-card:first-child {
  border-top: 0;
}

.match-card summary {
  list-style: none;
  cursor: pointer;
  padding: 11px 0;
}

.match-card summary::-webkit-details-marker {
  display: none;
}

.match-row {
  display: grid;
  grid-template-columns: 46px auto minmax(0, 1fr) auto 24px;
  gap: 11px;
  align-items: center;
}

.champion {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  object-fit: cover;
  background: var(--panel2);
  border: 1px solid var(--line);
}

.server-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-align: center;
}

.server-pill.eune { color: var(--blue); }
.server-pill.euw { color: var(--violet); }

.server-pill.account-color-0,
.server-pill.account-color-1,
.server-pill.account-color-2,
.server-pill.account-color-3 {
  color: var(--account-color) !important;
  border-color: color-mix(in srgb, var(--account-color) 48%, transparent);
  background: color-mix(in srgb, var(--account-color) 8%, transparent);
}

.match-main {
  min-width: 0;
}

.match-top {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.result {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 900;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.result.win, .win {
  color: var(--success);
}
.result.win {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
}

.result.loss, .loss {
  color: var(--danger);
}
.result.loss {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
}

.match-lp-badge {
  box-sizing: border-box;
  min-height: 1.5rem;
  gap: 0.2rem;
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 850;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  line-height: 1.25;
  white-space: nowrap;
}
.match-lp-badge.lp-gain {
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid var(--success-border, color-mix(in srgb, var(--success) 35%, transparent));
}
.match-lp-badge.lp-loss {
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border, color-mix(in srgb, var(--danger) 35%, transparent));
}
.match-lp-badge.lp-neutral {
  color: var(--muted);
  background: var(--ctrl-bg, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--line);
}
.lp-shield-icon {
  color: var(--muted);
  filter: grayscale(1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 1.125rem;
  width: 1.125rem;
  height: 1.125rem;
  line-height: 1;
}
.lp-shield-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}
.match-lp-badge.lp-pending {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.match-champion {
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kda {
  text-align: right;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.kda small {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  margin-top: 3px;
}

.chev {
  color: var(--muted);
  transition: transform 0.16s;
}

.match-card[open] .chev {
  transform: rotate(180deg);
}

.match-lp-badge.lp-rank-change {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding-block: 2px;
}

.match-lp-badge.lp-rank-change img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.match-detail {
  padding: 4px 0 18px;
}

.detail-hero {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.detail-stat {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-surface, var(--panel2));
}

.detail-stat b {
  display: block;
  margin-top: 4px;
  font-size: 0.84rem;
}

.match-loadout-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
  gap: 10px;
  margin-bottom: 10px;
  align-items: stretch;
}

.match-loadout-grid > .analytic-card {
  margin: 0 !important;
  height: 100%;
}

.build {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.item-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel2);
}

.champ-rune-wrap, .player-champ-wrap {
  position: relative;
  width: max-content;
  line-height: 0;
}

.champ-rune-wrap .keystone-mini {
  position: absolute;
  right: -5px;
  bottom: -5px;
}

.player-champ-wrap .keystone-mini {
  position: absolute;
  right: -4px;
  bottom: -4px;
}

.keystone-mini {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.45);
  z-index: 2;
}

.player-champ-wrap .keystone-mini {
  width: 15px;
  height: 15px;
}

.rune-page {
  display: grid;
  gap: 9px;
  margin-top: 8px;
}

.rune-path {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.rune-path-title {
  min-width: 74px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  padding-top: 5px;
}

.rune-picks {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.rune-pick {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.rune-pick img {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.2);
}

.rune-pick.keystone img {
  width: 34px;
  height: 34px;
}

.rune-pick span {
  font-size: 0.67rem;
  font-weight: 750;
  max-width: 116px;
  line-height: 1.2;
}

.rune-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.10);
}

.rune-stat img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.18);
  flex: 0 0 38px;
}

.rune-stat-info {
  min-width: 0;
}

.rune-stat-name {
  font-size: 0.84rem;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rune-stat-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.67rem;
}

.rune-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.team {
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: var(--card-surface, var(--panel2));
}

.team-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 0.74rem;
  font-weight: 850;
}

.team-player {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.team-player:first-of-type {
  border-top: 0;
}

.team-player.me {
  background: rgba(111, 168, 255, 0.07);
}

.player-champ {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--panel2);
}

.player-main {
  min-width: 0;
}

.player-name {
  font-size: 0.75rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.63rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-right {
  text-align: right;
  font-size: 0.7rem;
  font-weight: 800;
}

.player-right small {
  display: block;
  color: var(--muted);
  font-size: 0.6rem;
  margin-top: 2px;
}

.player-items {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
  margin-top: 4px;
}

.player-items .item-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
}

.objectives {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.65;
}
/* Loadouts & Summoner Spells (migrated from overrides.css) */
.match-loadout, .player-loadout {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: max-content;
}

.summoner-spells {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 0;
}

.summoner-spells img {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: var(--panel2);
}

.summoner-spells.small img {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}
