/* CricBuz — modern flex UI for cricbuz.live */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=Outfit:wght@600;700;800&display=swap');

:root {
  --ink: #0b1220;
  --ink-2: #1a2436;
  --muted: #6b778c;
  --line: #e6ebf2;
  --paper: #f5f7fb;
  --card: #ffffff;
  --pitch: #0b7a4b;
  --pitch-deep: #065f3a;
  --live: #e11d48;
  --gold: #d97706;
  --sky: #0284c7;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(11, 18, 32, 0.08);
  --shadow-sm: 0 2px 10px rgba(11, 18, 32, 0.06);
  --max: 1180px;
  --font: 'IBM Plex Sans', ui-sans-serif, sans-serif;
  --display: 'Outfit', 'IBM Plex Sans', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(11, 122, 75, 0.12), transparent 55%),
    radial-gradient(900px 400px at 100% 0%, rgba(2, 132, 199, 0.08), transparent 50%),
    var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: 0; background: none; }

.nav-container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* —— Header —— */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 64px;
  display: flex;
  align-items: center;
  background: rgba(11, 18, 32, 0.92);
  color: #fff;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.logo-icon,
#brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pitch), #14b86a);
  color: #042816;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.sport-toggle {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  gap: 2px;
}

.sport-seg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  font-weight: 600;
  transition: 0.18s ease;
}

.sport-seg.active {
  background: #fff;
  color: var(--ink);
}

#cricket-nav,
#football-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
}

#cricket-nav a,
#football-nav a {
  color: rgba(255, 255, 255, 0.72);
  transition: color 0.15s;
}

#cricket-nav a:hover,
#football-nav a:hover { color: #fff; }

/* —— Live strip —— */
.match-strip-container {
  background: linear-gradient(160deg, var(--ink) 0%, var(--ink-2) 55%, #0f2a1d 100%);
  color: #fff;
  padding: 18px 0 22px;
}

.match-strip-container .nav-container {
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  justify-content: flex-start;
  padding-bottom: 10px;
}

.match-tab-btn {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.match-tab-btn.active {
  color: #042816;
  background: linear-gradient(135deg, #34d399, #0b7a4b);
  border-color: transparent;
}

.match-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 6px 20px 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.match-strip::-webkit-scrollbar { height: 6px; }
.match-strip::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

/* —— Match cards —— */
.espn-card {
  flex: 0 0 min(300px, 86vw);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 188px;
  padding: 14px 14px 0;
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.espn-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(11, 18, 32, 0.14);
}

.espn-card.active-card {
  outline: 2px solid var(--pitch);
  outline-offset: 1px;
}

.card-header {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 10px;
}

.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.team-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 700;
  font-size: 0.95rem;
}

.team-name img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
}

.team-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.match-status-text {
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pitch-deep);
  line-height: 1.35;
}

.live-red {
  color: var(--live);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.card-footer {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 4px;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* —— Hub pills —— */
.hub-quick-nav {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px 20px 6px !important;
  justify-content: flex-start !important;
}

.hub-quick-nav__pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}

.hub-quick-nav__pill--live {
  background: rgba(225, 29, 72, 0.08);
  border-color: rgba(225, 29, 72, 0.2);
  color: var(--live);
}

.hub-quick-nav__pill:hover {
  border-color: var(--pitch);
  color: var(--pitch-deep);
}

/* —— Home extras —— */
.home-extra-grid {
  display: grid !important;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  padding: 12px 20px 28px !important;
  align-items: start;
}

#home-series-list,
#home-players-list,
#current-series-sidebar,
#trending-players-sidebar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

.section-title,
h2.section-title {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

/* —— Detail —— */
#detail-section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 20px 40px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-weight: 700;
  color: var(--pitch-deep);
  cursor: pointer;
}

.detail-header-panel,
#detail-header {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}

.dh-top {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
}

.dh-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.dh-team {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
}

.dh-score {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.dh-status-bar {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-weight: 700;
  color: var(--pitch-deep);
}

.tabs-espn {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.tab-btn {
  flex: 0 0 auto;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
}

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

.espn-table-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 14px;
}

.table-header {
  padding: 12px 14px;
  font-family: var(--display);
  font-weight: 800;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.espn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.espn-table th,
.espn-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.espn-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.bold { font-weight: 700; }
.meta { color: var(--muted); }

/* —— Ball by ball —— */
.bbb-container { display: flex; flex-direction: column; gap: 10px; }
.bbb-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.bbb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  background: #f8fafc;
}
.bbb-header-left { display: flex; align-items: center; gap: 10px; }
.bbb-over-num {
  font-family: var(--display);
  font-weight: 800;
  color: var(--pitch-deep);
}

/* —— Fixtures —— */
#fixtures-section { max-width: var(--max); margin: 0 auto; }
#fixtures-date-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.loader {
  width: 28px;
  height: 28px;
  margin: 24px auto;
  border: 3px solid var(--line);
  border-top-color: var(--pitch);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* —— Ads / footer bits —— */
.home-ad,
.adsbygoogle {
  border-radius: var(--radius-sm);
  overflow: hidden;
}

#toast-container {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-title { font-weight: 800; }
.toast-msg { font-size: 0.85rem; color: var(--muted); }

/* —— SEO injected content —— */
#seo-crawl-content,
.seo-content-block {
  max-width: var(--max);
  margin: 0 auto;
  padding: 8px 20px 40px;
}

#seo-crawl-content a { color: var(--pitch-deep); font-weight: 600; }

/* —— Responsive —— */
@media (max-width: 900px) {
  .home-extra-grid { grid-template-columns: 1fr !important; }
  #cricket-nav,
  #football-nav { display: none !important; }
  .sport-toggle { margin-left: auto; }
}

@media (max-width: 640px) {
  header { height: 58px; }
  .logo { font-size: 1.15rem; }
  .sport-seg { padding: 7px 10px; font-size: 0.78rem; }
  .espn-card { flex-basis: min(280px, 88vw); min-height: 176px; }
}
