* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-main: #090c15;
  --bg-card: #111625;
  --bg-card-hover: #171e32;
  --border-color: #1f273d;
  --accent: #ff3355;
  --accent-hover: #e02444;
  --text-main: #f1f5f9;
  --text-muted: #8b96b0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
}

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

/* Navbar */
.navbar {
  background: rgba(11, 15, 26, 0.95);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.nav-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.accent {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-main);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.search-box input {
  background: #141a2b;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  font-size: 0.85rem;
  width: 190px;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: 0.2s;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-outline:hover {
  background: #171e32;
}

.btn-dark {
  background: #1b2236;
  color: var(--text-main);
  border: 1px solid #2a3452;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-size: 1.1rem;
  cursor: pointer;
}

/* Container */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
}

.view-all {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Popular Leagues Cards */
.leagues-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.league-card {
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.league-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.25);
}

.league-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  margin-bottom: 0.6rem;
}

.league-card h3 {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.league-card span {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
}

.card-blue { background: linear-gradient(135deg, #162e58, #0f192e); }
.card-amber { background: linear-gradient(135deg, #593315, #24160d); }
.card-purple { background: linear-gradient(135deg, #3b1c5e, #1b102b); }
.card-crimson { background: linear-gradient(135deg, #5c172b, #260d16); }
.card-emerald { background: linear-gradient(135deg, #134738, #0c211b); }
.card-cyan { background: linear-gradient(135deg, #133e52, #0c1f29); }

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.25rem;
  align-items: start;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.telegram-card {
  background: linear-gradient(145deg, #141c30, #1f172b);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
}

.tg-header {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.tg-icon {
  font-size: 1.4rem;
  background: #229ed9;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.tg-header h4 {
  font-size: 0.9rem;
}

.tg-header p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-telegram {
  display: block;
  text-align: center;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.5rem;
  border-radius: 6px;
}

.sidebar-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.9rem;
}

.sidebar-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.65rem;
}

.sidebar-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sidebar-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #cbd5e1;
  cursor: pointer;
  transition: 0.15s;
}

.sidebar-list li:hover,
.sidebar-list li.active {
  background: #1b2338;
  color: #fff;
}

.sidebar-list .count {
  font-size: 0.75rem;
  background: #0d121f;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  color: var(--text-muted);
}

/* Hero Banner */
.hero-banner {
  background: linear-gradient(120deg, #13192b 45%, #3d1828 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.hero-content h1 {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.6rem;
}

.hero-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 480px;
  margin-bottom: 1.25rem;
}

.hero-buttons {
  display: flex;
  gap: 0.75rem;
}

.hero-stat {
  text-align: center;
  padding-right: 1rem;
}

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
  100% { opacity: 1; transform: scale(1); }
}

/* Matches Section */
.filter-pills {
  display: flex;
  gap: 0.4rem;
}

.pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
}

.pill.active,
.pill:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.matches-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.95rem 1.2rem;
  display: grid;
  grid-template-columns: 150px 1fr auto;
  align-items: center;
  gap: 1rem;
  transition: background 0.15s;
}

.match-card:hover {
  background: var(--bg-card-hover);
}

.match-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.match-league {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.badge-live {
  display: inline-block;
  width: fit-content;
  background: rgba(255, 51, 85, 0.15);
  color: var(--accent);
  border: 1px solid rgba(255, 51, 85, 0.4);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  border-radius: 4px;
}

.badge-time {
  font-size: 0.8rem;
  color: #cbd5e1;
  font-weight: 600;
}

.match-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.team {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.team.right {
  justify-content: flex-end;
  text-align: right;
}

.team-flag {
  font-size: 1.25rem;
}

.team-score {
  font-size: 0.82rem;
  color: #38bdf8;
  font-weight: 700;
}

.vs-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #0c101c;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: #111625;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 100%;
  padding: 1.25rem;
}

.player-box {
  max-width: 780px;
}

.auth-box {
  max-width: 380px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.server-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.srv-btn {
  background: #192036;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
}

.srv-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.video-placeholder {
  background: #06080f;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
}

.live-badge {
  color: var(--accent);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.stream-status p {
  margin: 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
}

.stream-status small {
  color: var(--text-muted);
}

.auth-box form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.auth-box input {
  background: #0b0f1a;
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.65rem;
  border-radius: 6px;
}

.full-width {
  width: 100%;
}

.footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border-color);
  margin-top: 3rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .leagues-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .sidebar {
    order: 2;
  }
}

@media (max-width: 768px) {
  .nav-links,
  .search-box {
    display: none;
  }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: #111625;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
  }
  .mobile-menu-btn {
    display: block;
  }
  .leagues-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-banner {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
  .match-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .match-meta {
    align-items: center;
  }
  .match-teams {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .team,
  .team.right {
    justify-content: center;
  }
}
