/* GoalKick - Live Football Scores */
:root {
  --bg-body: #0f1014;
  --bg-card: #181a20;
  --bg-header: rgba(15, 16, 20, 0.95);
  --border: #2a2b30;
  --text-main: #ffffff;
  --text-muted: #848a99;
  --accent: #ff3300;
  --live-red: #ef4444;
  --win-green: #22c55e;
  --draw-yellow: #eab308;
}

/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  background: var(--bg-body);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { text-decoration: none; color: inherit; transition: 0.2s; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* Header */
header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 60px;
  backdrop-filter: blur(10px);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
}
.brand {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
}
.brand span { color: var(--accent); }
.brand-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-icon svg { width: 16px; fill: #fff; }
.nav-right { display: flex; align-items: center; gap: 15px; }
.clock {
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(255,255,255,0.08);
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.05);
}
.back-btn {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
}
.back-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.mobile-toggle {
  display: none;
  padding: 8px;
  color: #fff;
}
.mobile-toggle svg { width: 28px; height: 28px; fill: currentColor; }

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(5,5,5,0.98);
  backdrop-filter: blur(20px);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
  display: flex;
  flex-direction: column;
}
.mobile-menu.open { opacity: 1; visibility: visible; }
.m-head {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 15px;
}
.m-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.m-close svg { width: 24px; height: 24px; fill: currentColor; }
.m-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
}
.m-link {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
}
.m-link:hover { color: var(--accent); }

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 15px;
  flex: 1;
}

/* Navigation Tabs */
.nav-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  background: var(--bg-card);
  padding: 5px;
  border-radius: 10px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.nav-btn {
  text-align: center;
  padding: 12px;
  cursor: pointer;
  color: #888;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 6px;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.nav-btn:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav-btn.active {
  background: var(--bg-body);
  color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.nav-icon { font-size: 0.7rem; }
.cnt-badge {
  background: rgba(255,255,255,0.1);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  min-width: 24px;
}
.nav-btn.active .cnt-badge { background: var(--accent); color: #fff; }
#btn-live.active .cnt-badge { background: var(--live-red); }

/* League Filter */
.league-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 20px;
  scrollbar-width: none;
}
.league-scroll::-webkit-scrollbar { display: none; }
.lg-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #bbb;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: 0.2s;
}
.lg-chip:hover, .lg-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.lg-chip img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* Match Cards Grid */
.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 15px;
}

/* Match Card */
.match-card {
  background: linear-gradient(145deg, #1f2129 0%, #131418 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
  display: block;
}
.match-card:hover {
  transform: translateY(-3px);
  border-color: #555;
}
.mc-league {
  font-size: 0.7rem;
  color: #888;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
}
.mc-league img {
  width: 16px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
}
.mc-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mc-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 35%;
  text-align: center;
}
.mc-logo {
  width: 45px;
  height: 45px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}
.mc-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mc-center { text-align: center; }
.mc-score {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.mc-time {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}
.mc-date {
  font-size: 0.7rem;
  color: #888;
  margin-top: 4px;
}
.mc-status {
  font-size: 0.7rem;
  font-weight: 800;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}
.mc-status.live {
  color: var(--live-red);
  background: rgba(239,68,68,0.15);
  animation: pulse 2s infinite;
}
.mc-status.scheduled {
  color: var(--accent);
  background: rgba(255,51,0,0.15);
}
.mc-status.finished {
  color: #888;
  background: rgba(255,255,255,0.05);
}
.live-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(239,68,68,0.2);
  color: var(--live-red);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  animation: pulse 1.5s infinite;
}
.watch-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* League Group */
.league-group { margin-bottom: 25px; }
.lg-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 5px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 15px;
}
.lg-flag {
  width: 22px;
  height: 16px;
  border-radius: 3px;
  object-fit: cover;
}
.lg-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
}

/* Loading & Empty State */
.loading, .empty-state, .error {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
  font-weight: 600;
}
.error { color: var(--live-red); }

/* ========== MATCH DETAIL PAGE ========== */
.match-container {
  max-width: 900px;
  margin: 0 auto;
  flex: 1;
}

/* Player */
.player-wrap {
  background: #000;
  border-bottom: 1px solid var(--border);
}
.player-aspect {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: #000;
}
.player-aspect iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 10;
}
.player-offline {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #555;
  background: #050505;
  z-index: 5;
}
.offline-icon { font-size: 2.5rem; margin-bottom: 15px; }
.offline-text { font-size: 0.85rem; color: #666; }
.stream-btns {
  padding: 10px;
  background: #111;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-top: 1px solid #222;
  scrollbar-width: none;
}
.stream-btns::-webkit-scrollbar { display: none; }
.str-btn {
  padding: 8px 14px;
  background: #222;
  color: #ccc;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid #333;
  transition: 0.2s;
}
.str-btn:hover { background: #333; color: #fff; }
.str-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Match Header */
.match-header {
  background: radial-gradient(circle at center, #1f2129 0%, #0f1014 100%);
  padding: 25px 15px;
  border-bottom: 1px solid var(--border);
}
.mh-league {
  text-align: center;
  margin-bottom: 20px;
}
.mh-league span {
  background: rgba(255,255,255,0.05);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.mh-league img { width: 16px; height: 12px; border-radius: 2px; }
.mh-scoreboard {
  display: grid;
  grid-template-columns: 1fr 110px 1fr;
  align-items: center;
  gap: 10px;
}
.mh-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.mh-logo {
  width: 70px;
  height: 70px;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(0,0,0,0.3));
}
.mh-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.mh-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.mh-score {
  font-size: 2.8rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -1px;
}
.mh-status {
  margin-top: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
}
.mh-status.live {
  color: var(--live-red);
  background: rgba(239,68,68,0.15);
  animation: pulse 2s infinite;
}
.mh-status.scheduled { color: var(--accent); background: rgba(255,51,0,0.15); }
.mh-status.finished { color: #888; background: rgba(255,255,255,0.05); }
.mh-time {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
}
.mh-date {
  font-size: 0.8rem;
  color: #888;
  margin-top: 5px;
}

/* Match Tabs */
.match-tabs {
  display: flex;
  overflow-x: auto;
  background: rgba(15,16,20,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 60px;
  z-index: 50;
  scrollbar-width: none;
}
.match-tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: 1;
  min-width: auto;
  text-align: center;
  padding: 14px 12px;
  color: #9ca3af;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: 0.2s;
}
.tab-btn:hover { color: #fff; }
.tab-btn.active { color: #fff; border-bottom-color: var(--accent); }

/* Tab Content */
.tab-content {
  padding: 20px 15px;
  min-height: 400px;
}
.tab-pane { display: none; animation: fadeIn 0.3s; }
.tab-pane.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stats */
.stat-row {
  display: grid;
  grid-template-columns: 1fr 100px 1fr;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.stat-val {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.stat-val.home { text-align: right; }
.stat-val.away { text-align: left; }
.stat-name {
  text-align: center;
  font-size: 0.75rem;
  color: #888;
  text-transform: uppercase;
}
.stat-bar {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  margin-top: 5px;
  overflow: hidden;
  display: flex;
}
.stat-bar .home-bar {
  background: var(--accent);
  height: 100%;
}
.stat-bar .away-bar {
  background: var(--win-green);
  height: 100%;
}

/* Lineups */
.lineup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.lineup-team h3 {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.lineup-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.lp-num {
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lp-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #222;
}
.lp-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #eee;
}
.lp-pos {
  font-size: 0.7rem;
  color: #888;
  margin-left: auto;
}

/* Timeline */
.timeline-item {
  display: grid;
  grid-template-columns: 1fr 50px 1fr;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.tl-home, .tl-away { display: flex; align-items: center; gap: 10px; }
.tl-home { justify-content: flex-end; text-align: right; }
.tl-away { justify-content: flex-start; }
.tl-min {
  width: 36px;
  height: 36px;
  background: #222;
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
  margin: 0 auto;
}
.tl-icon { font-size: 1.1rem; }
.tl-text {
  font-size: 0.85rem;
  color: #eee;
}
.tl-sub {
  font-size: 0.7rem;
  color: #888;
}

/* H2H */
.h2h-match {
  display: grid;
  grid-template-columns: 1fr 80px 1fr;
  align-items: center;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}
.h2h-team { font-size: 0.85rem; font-weight: 600; color: #ddd; }
.h2h-team.home { text-align: right; }
.h2h-center { text-align: center; }
.h2h-score { font-size: 1.1rem; font-weight: 800; color: #fff; }
.h2h-date { font-size: 0.65rem; color: #888; margin-top: 2px; }

/* Standing Table */
.standing-table {
  width: 100%;
  border-collapse: collapse;
}
.standing-table th {
  background: rgba(255,255,255,0.03);
  padding: 12px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #888;
  text-align: left;
  text-transform: uppercase;
}
.standing-table td {
  padding: 12px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 0.85rem;
}
.standing-table .pos { font-weight: 800; color: var(--accent); width: 30px; }
.standing-table .team-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.standing-table .team-cell img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}
.standing-table .pts { font-weight: 800; color: #fff; }
.standing-table tr.highlight { background: rgba(255,51,0,0.1); }

/* Footer */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
  .mobile-toggle { display: block; }
  .matches-grid { grid-template-columns: 1fr; }
  .mh-scoreboard { grid-template-columns: 1fr 90px 1fr; }
  .mh-logo { width: 50px; height: 50px; }
  .mh-score { font-size: 2.2rem; }
  .mh-name { font-size: 0.85rem; }
  .lineup-grid { grid-template-columns: 1fr; }
}
