/* ============================================
   CS Live — style.css
   Полный файл стилей
   ============================================ */

/* ===== RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== BASE ===== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', Arial, sans-serif;
  background: #0f1117;
  color: #fff;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
  background: #13151f;
  border-bottom: 1px solid #1e2130;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.logo {
  font-size: 18px;
  font-weight: 700;
  color: #5865f2;
  letter-spacing: 0.5px;
  user-select: none;
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-links a {
  color: #888;
  font-size: 14px;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-links a:hover {
  color: #fff;
}

.nav-links a.active {
  color: #fff;
  border-bottom-color: #5865f2;
}

/* ============================================
   CONTAINER
   ============================================ */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px;
}

/* ============================================
   SECTION TITLE
   ============================================ */
.section-title {
  font-size: 20px;
  font-weight: 700;
  color: #e0e0e0;
  margin-bottom: 16px;
  letter-spacing: 0.3px;
}

/* ============================================
   FILTERS
   ============================================ */
.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-btn {
  background: #1a1d26;
  border: 1px solid #2a2d3e;
  color: #888;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  outline: none;
}

.filter-btn:hover {
  background: #222633;
  color: #fff;
  border-color: #3a3d52;
}

.filter-btn.active {
  background: #5865f2;
  border-color: #5865f2;
  color: #fff;
}

/* ============================================
   MATCH CARD
   ============================================ */
.match-card {
  background: #1a1d26;
  border: 1px solid #1e2130;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.match-card:hover {
  background: #1e2233;
  border-color: #2e3250;
  transform: translateY(-1px);
}

.match-card.hidden {
  display: none;
}

/* --- Match Info --- */
.match-info {
  flex: 1;
  min-width: 0;
}

.teams {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 7px;
  flex-wrap: wrap;
}

.team-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #13151f;
  border: 1px solid #2a2d3e;
  flex-shrink: 0;
}

.vs {
  color: #444;
  font-size: 12px;
  font-weight: 400;
}

/* --- Badges --- */
.badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.live-badge {
  background: rgba(255, 77, 77, 0.12);
  color: #ff4d4d;
  border: 1px solid rgba(255, 77, 77, 0.28);
}

.time-badge {
  background: rgba(160, 160, 160, 0.08);
  color: #999;
  border: 1px solid rgba(160, 160, 160, 0.18);
}

.map-badge {
  background: rgba(88, 101, 242, 0.1);
  color: #8892f7;
  border: 1px solid rgba(88, 101, 242, 0.2);
}

/* --- Score Block --- */
.score-block {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 90px;
  justify-content: center;
  flex-shrink: 0;
}

.score {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1;
}

.score-sep {
  color: #444;
  font-size: 22px;
  font-weight: 300;
}

.score-dash {
  font-size: 24px;
  color: #444;
  font-weight: 300;
}

/* --- Match Actions --- */
.match-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  outline: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.1s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #5865f2;
  color: #fff;
}

.btn-primary:hover {
  background: #4752c4;
}

.btn-ghost {
  background: transparent;
  border: 1px solid #2a2d3e;
  color: #888;
  font-size: 15px;
  padding: 7px 11px;
}

.btn-ghost:hover {
  border-color: #ffd700;
  color: #ffd700;
}

.btn-ghost.favorited {
  color: #ffd700;
  border-color: #ffd700;
}

/* ============================================
   MATCH PAGE — HEADER
   ============================================ */
.match-header {
  background: #13151f;
  border: 1px solid #1e2130;
  border-radius: 16px;
  padding: 28px 24px;
  margin-bottom: 20px;
}

.match-teams-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* --- Team Side --- */
.team-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.team-side img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #2a2d3e;
  background: #0f1117;
}

.team-side > span {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.team-side small {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
}

.team-side.ct small {
  background: rgba(88, 101, 242, 0.15);
  color: #8892f7;
}

.team-side.t small {
  background: rgba(255, 165, 0, 0.12);
  color: #ffa500;
}

/* --- Score Main --- */
.match-score-main {
  text-align: center;
  flex-shrink: 0;
}

.score-big {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: 6px;
  line-height: 1;
  margin-bottom: 10px;
}

.match-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #888;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

/* ============================================
   ROUND TRACKER
   ============================================ */
.round-tracker {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 280px;
  margin: 0 auto;
}

.round-dot {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  background: #2a2d3e;
  transition: background 0.2s;
  cursor: default;
}

.round-dot.ct {
  background: #5865f2;
}

.round-dot.t {
  background: #ffa500;
}

/* ============================================
   MATCH LAYOUT
   ============================================ */
.match-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

/* ============================================
   STREAM
   ============================================ */
.stream-section {
  /* обёртка стрима */
}

.video {
  position: relative;
  padding-top: 56.25%; /* 16:9 */
  border-radius: 12px;
  overflow: hidden;
  background: #0a0b10;
  margin-bottom: 12px;
}

.video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* --- Stream Info --- */
.stream-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ============================================
   MAP TABS
   ============================================ */
.map-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.map-tab {
  background: #1a1d26;
  border: 1px solid #2a2d3e;
  color: #888;
  padding: 7px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  outline: none;
  line-height: 1.4;
}

.map-tab:hover {
  background: #222633;
  color: #fff;
  border-color: #3a3d52;
}

.map-tab.active {
  background: #5865f2;
  border-color: #5865f2;
  color: #fff;
}

.map-result {
  display: block;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
  font-weight: 400;
}

.map-tab.active .map-result {
  color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   STATS SECTION
   ============================================ */
.stats-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* --- Team Stats Block --- */
.team-stats {
  background: #1a1d26;
  border: 1px solid #1e2130;
  border-radius: 12px;
  overflow: hidden;
}

.team-stats-header {
  background: #13151f;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid #1e2130;
  color: #8892f7;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.stats-table-header {
  display: grid;
  grid-template-columns: 1fr repeat(3, 44px);
  gap: 4px;
  padding: 6px 14px;
  font-size: 11px;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #1e2130;
}

/* --- Player Row --- */
.player {
  display: grid;
  grid-template-columns: 1fr repeat(3, 44px);
  gap: 4px;
  padding: 10px 14px;
  font-size: 14px;
  border-bottom: 1px solid #1a1d26;
  transition: background 0.15s;
  align-items: center;
}

.player:last-child {
  border-bottom: none;
}

.player:hover {
  background: #1e2233;
}

.player-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Цвет по рейтингу */
.player[data-rating="high"] .player-name { color: #4ade80; }
.player[data-rating="med"]  .player-name { color: #e0e0e0; }
.player[data-rating="low"]  .player-name { color: #ff6b6b; }

/* ============================================
   SKELETON LOADER
   ============================================ */
.skeleton {
  pointer-events: none;
}

.skel {
  background: linear-gradient(
    90deg,
    #1e2130 25%,
    #252840 50%,
    #1e2130 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 6px;
  height: 16px;
}

.skel-wide {
  width: 55%;
}

.skel-sm {
  width: 30%;
  margin-top: 10px;
}

.skel-btn {
  width: 84px;
  height: 34px;
  border-radius: 8px;
}

@keyframes shimmer {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   STATE MESSAGES (пусто / ошибка)
   ============================================ */
.state-msg {
  text-align: center;
  padding: 48px 20px;
  color: #555;
  font-size: 15px;
  line-height: 2;
}

.state-msg.error {
  color: #ff6b6b;
}

.state-msg a {
  color: #5865f2;
  text-decoration: underline;
}

/* ============================================
   TOAST УВЕДОМЛЕНИЯ
   ============================================ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: #1e2233;
  border: 1px solid #2e3250;
  color: #fff;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 999;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #0f1117;
}

::-webkit-scrollbar-thumb {
  background: #2a2d3e;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a3d52;
}

/* ============================================
   SELECTION
   ============================================ */
::selection {
  background: #5865f2;
  color: #fff;
}

/* ============================================
   RESPONSIVE — TABLET (≤ 900px)
   ============================================ */
@media (max-width: 900px) {
  .match-layout {
    grid-template-columns: 1fr;
  }

  .stats-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

/* ============================================
   RESPONSIVE — MOBILE (≤ 600px)
   ============================================ */
@media (max-width: 600px) {
  .navbar {
    padding: 0 16px;
  }

  .container {
    padding: 16px 12px;
  }

  /* Карточка матча — колонкой */
  .match-card {
    flex-wrap: wrap;
    padding: 14px;
    gap: 12px;
  }

  .match-info {
    width: 100%;
  }

  .score-block {
    min-width: auto;
  }

  /* Шапка матча */
  .match-teams-header {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .score-big {
    font-size: 32px;
    letter-spacing: 4px;
  }

  .team-side img {
    width: 56px;
    height: 56px;
  }

  .team-side > span {
    font-size: 16px;
  }

  /* Статистика — одна колонка */
  .stats-section {
    grid-template-columns: 1fr;
  }

  /* Счёт */
  .score {
    font-size: 20px;
  }

  /* Фильтры */
  .filters {
    gap: 6px;
  }

  .filter-btn {
    padding: 5px 14px;
    font-size: 12px;
  }

  /* Навлинки */
  .nav-links {
    gap: 14px;
  }

  .nav-links a {
    font-size: 13px;
  }

  /* Toast */
  .toast {
    bottom: 16px;
    font-size: 13px;
    padding: 9px 16px;
    white-space: normal;
    text-align: center;
    max-width: calc(100vw - 32px);
  }
}
