.container {
  max-width: 1000px;
  margin: 0 auto;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 30px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(10px);
}

.card h2 {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Matches List */
.match-item {
  padding: 15px;
  border-bottom: 1px solid var(--panel-border);
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.match-item:last-child { border-bottom: none; }

.match-item:hover, .match-item.active {
  background: rgba(255, 79, 0, 0.1);
}

.match-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 5px; }
.match-teams { font-weight: 700; font-size: 1.1rem; }
.match-score { font-size: 1.2rem; font-weight: 900; color: var(--accent); }

/* Stats Table */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

th, td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--panel-border);
}

th {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

td { font-weight: 600; }

.kda { display: flex; gap: 5px; }
.kda span {
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9rem;
}

.mvp {
  color: #FFD700;
  font-weight: 800;
}

#stats-view { display: none; }

/* ===================== HISTORY VIEW (SPA, Season 2) ===================== */
.history-root { max-width: 1200px; margin: 0 auto; padding: 20px; }
.history-header { margin-bottom: 20px; }
.history-title {
    font-family: 'Outfit', sans-serif; font-weight: 900; font-size: 2rem;
    letter-spacing: 3px; color: var(--primary); margin-top: 10px;
}
.history-season-select {
    margin-top: 12px;
    padding: 8px 12px;
    background: #0e0f13;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
}
.history-season-select:focus { outline: none; border-color: var(--primary); }
.history-layout { display: grid; grid-template-columns: 320px 1fr; gap: 22px; align-items: start; }
@media (max-width: 860px) { .history-layout { grid-template-columns: 1fr; } }

.history-empty { color: var(--dim-text); padding: 30px 10px; text-align: center; font-size: 0.9rem; }

/* --- list --- */
.history-list { display: flex; flex-direction: column; gap: 10px; max-height: 80vh; overflow-y: auto; }
.history-card {
    text-align: left; width: 100%; cursor: pointer;
    background: rgba(28,30,38,0.6); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px; padding: 12px 14px; transition: 0.18s; color: var(--text);
}
.history-card:hover { border-color: rgba(255,85,0,0.4); transform: translateY(-1px); }
.history-card.active { border-color: var(--primary); background: rgba(255,85,0,0.06); }
.history-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.history-card-label { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 0.8rem; letter-spacing: 1px; }
.history-card-bo { font-size: 0.6rem; font-weight: 900; color: var(--primary); border: 1px solid rgba(255,85,0,0.3); padding: 1px 7px; border-radius: 20px; }
.history-card-tn { font-size: 0.68rem; color: var(--dim-text); margin-bottom: 8px; letter-spacing: 0.5px; }

.history-team { display: flex; align-items: center; gap: 9px; padding: 4px 0; }
.history-team.winner .history-team-name { color: #4CAF50; font-weight: 700; }
.history-logo {
    width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0;
    background: rgba(255,255,255,0.06) center/cover no-repeat; border: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 0.6rem; color: var(--dim-text);
}
.history-team-name { flex: 1; font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-tag { color: var(--dim-text); font-size: 0.7rem; }
.history-team-score { font-family: 'Outfit', sans-serif; font-weight: 900; font-size: 1.05rem; }

/* --- detail --- */
.history-detail { min-width: 0; }
.history-series-head {
    background: rgba(28,30,38,0.6); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px; padding: 18px 20px; margin-bottom: 18px;
}
.history-series-meta { font-size: 0.72rem; color: var(--dim-text); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 12px; }
.history-series-score { display: flex; align-items: center; justify-content: center; gap: 22px; }
.history-series-team { display: flex; align-items: center; gap: 8px; font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.15rem; }
.history-series-team.winner { color: #FFC400; }
.history-series-team .icon { width: 18px; height: 18px; }
.history-series-num { font-family: 'Outfit', sans-serif; font-weight: 900; font-size: 1.8rem; color: var(--primary); }

.history-map {
    background: rgba(255,255,255,0.015); border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px; padding: 14px 16px; margin-bottom: 16px;
}
.history-map-header { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.history-map-name { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 0.85rem; letter-spacing: 1px; flex: 1; }
.history-map-score { font-family: 'Outfit', sans-serif; font-weight: 900; font-size: 1.1rem; display: flex; gap: 6px; }
.history-map-score .sep { color: var(--dim-text); }
.history-map-score .win { color: #4CAF50; }
.history-demo-btn {
    display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
    font-size: 0.68rem; font-weight: 800; letter-spacing: 1px; color: var(--text);
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    padding: 5px 10px; border-radius: 8px; transition: 0.18s;
}
.history-demo-btn:hover { border-color: var(--primary); color: var(--primary); }
.history-demo-btn .icon { width: 13px; height: 13px; }

.history-table-wrap { margin-bottom: 10px; overflow-x: auto; }
.history-table-team { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 0.75rem; letter-spacing: 1px; margin: 6px 2px; color: var(--text); }
.history-table-team.winner { color: #4CAF50; }
.history-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; min-width: 560px; }
.history-table th, .history-table td { padding: 6px 8px; text-align: center; white-space: nowrap; }
.history-table th { color: var(--dim-text); font-weight: 700; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.history-table td { border-bottom: 1px solid rgba(255,255,255,0.03); }
.history-table .l { text-align: left; }
.history-table .history-kda { font-variant-numeric: tabular-nums; }

/* Фиксированная ширина столбцов для идеального выравнивания */
.history-table th:nth-child(1),
.history-table td:nth-child(1) {
    width: 25%;
    min-width: 180px;
    text-align: left;
}
.history-table th:nth-child(2),
.history-table td:nth-child(2) {
    width: 8%;
    min-width: 50px;
}
.history-table th:nth-child(3),
.history-table td:nth-child(3) {
    width: 12%;
    min-width: 80px;
}
.history-table th:nth-child(4),
.history-table td:nth-child(4) {
    width: 7%;
    min-width: 45px;
}
.history-table th:nth-child(5),
.history-table td:nth-child(5) {
    width: 8%;
    min-width: 55px;
}
.history-table th:nth-child(6),
.history-table td:nth-child(6) {
    width: 8%;
    min-width: 55px;
}
.history-table th:nth-child(7),
.history-table td:nth-child(7) {
    width: 8%;
    min-width: 55px;
}
.history-table th:nth-child(8),
.history-table td:nth-child(8) {
    width: 8%;
    min-width: 40px;
}
.history-table th:nth-child(9),
.history-table td:nth-child(9) {
    width: 8%;
    min-width: 40px;
}
.history-table th:nth-child(10),
.history-table td:nth-child(10) {
    width: 8%;
    min-width: 40px;
}
.history-table .rate { font-weight: 800; font-family: 'Outfit', sans-serif; }
.history-table .rate.rate-hi { color: #4CAF50; }
.history-table .rate.rate-lo { color: #e57373; }
.history-table .pos { color: #4CAF50; }
.history-table .neg { color: #e57373; }
