@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

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

body {
  background: #080808;
  color: #fff;
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

#stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

header, .hero, main, #player-overlay {
  position: relative;
  z-index: 1;
}

header {
  height: 60px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0d0d0d;
  border-bottom: 1px solid #1a1a1a;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo { font-size: 1.2em; font-weight: 900; color: #fff; letter-spacing: -0.5px; }
.logo span { color: #8b5cf6; }

.header-right { display: flex; align-items: center; gap: 24px; }

nav a {
  color: #555;
  text-decoration: none;
  font-size: 0.85em;
  font-weight: 500;
  transition: color 0.15s;
}
nav a:hover { color: #fff; }

.refresh-btn {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #888;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.78em;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.refresh-btn:hover { background: #222; color: #fff; }

.hero {
  padding: 40px 32px 0;
  max-width: 1300px;
  margin: 0 auto;
}

.hero-tagline {
  font-size: 0.72em;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.hero-title {
  font-size: 2.2em;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 6px;
}

.hero-title span { color: #8b5cf6; }

main { max-width: 1300px; margin: 0 auto; padding: 36px 32px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-left: 14px;
  border-left: 3px solid #22c55e;
}

.section-header.upcoming { border-left-color: #8b5cf6; }

.section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.68em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #22c55e;
  margin-bottom: 4px;
}

.section-header.upcoming .section-label { color: #8b5cf6; }

.live-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
  flex-shrink: 0;
}

.section-header.upcoming .live-dot {
  background: #8b5cf6;
  animation: none;
}

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

.section-title {
  font-size: 1.4em;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 52px;
}

.match-card {
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/11;
  cursor: default;
  transition: transform 0.2s, box-shadow 0.2s;
  background: #111;
}

.match-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}

.card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.3s;
}

.match-card:hover .card-bg { transform: scale(1.04); }

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.15) 0%,
    rgba(0,0,0,0.1) 30%,
    rgba(0,0,0,0.75) 70%,
    rgba(0,0,0,0.95) 100%
  );
}

.card-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 14px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.badge-live {
  background: #22c55e;
  color: #000;
  font-size: 0.6em;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-live .dot {
  width: 5px;
  height: 5px;
  background: #000;
  border-radius: 50%;
  animation: pulse 1.2s infinite;
}

.badge-countdown {
  background: rgba(139,92,246,0.85);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.65em;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.badge-sport {
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  color: #aaa;
  font-size: 0.6em;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
}

.card-teams {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 0;
}

.card-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.card-team img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.8));
}

.card-vs {
  font-size: 0.75em;
  font-weight: 800;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
}

.card-bottom {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-match-title {
  font-size: 0.92em;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.3px;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-league {
  font-size: 0.68em;
  color: #777;
  font-weight: 500;
}

.card-time {
  font-size: 0.68em;
  color: #777;
  font-weight: 500;
}

.watch-btn {
  background: #8b5cf6;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 0.75em;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s;
  align-self: flex-start;
  margin-top: 4px;
}

.watch-btn:hover { background: #7c3aed; }

.empty-state {
  text-align: center;
  color: #333;
  padding: 40px 0;
  font-size: 0.88em;
  grid-column: 1 / -1;
}

#player-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#player-overlay.hidden { display: none; }
#player-box { position: relative; width: 92%; max-width: 1000px; }

#clappr-player {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
}

#close-player {
  position: absolute;
  top: -42px;
  right: 0;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #888;
  font-size: 0.82em;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  padding: 7px 14px;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s;
}

#close-player:hover { background: #2a2a2a; color: #fff; }
.discord-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.78em;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}

.discord-btn:hover { background: transparent; color: #fff; }
.viewers-count {
  font-size: 0.68em;
  color: #aaa;
  font-weight: 500;
  margin-top: 4px;
  display: block;
}

.viewers-count {
  font-size: 0.68em;
  color: #aaa;
  font-weight: 500;
  margin-top: 4px;
  display: block;
}

.player-match-info {
  padding: 16px 20px 12px;
  background: #0d0d0d;
  border-bottom: 1px solid #1a1a1a;
}

.player-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 10px;
}

.player-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.player-team img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.player-team span {
  font-size: 0.85em;
  font-weight: 700;
  color: #fff;
}

.player-vs {
  font-size: 0.75em;
  font-weight: 800;
  color: #444;
}

.player-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 0.72em;
}

.player-league {
  color: #777;
  font-weight: 500;
}

.player-live {
  color: #22c55e;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.live-dot-small {
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.player-viewers {
  color: #aaa;
  font-weight: 500;
}
