/* Score808 Match Center v8.3 — Professional Sports App */

:root {
  --bg: #0a0e1a;
  --card: #111827;
  --card2: #151d2e;
  --card3: #0f1729;
  --border: #1e293b;
  --border2: #253044;
  --txt: #f1f5f9;
  --dim: #94a3b8;
  --mut: #64748b;
  --acc: #10b981;
  --acc2: #0d9668;
  --acc-bg: rgba(16,185,129,.1);
  --acc-bg2: rgba(16,185,129,.15);
  --red: #ef4444;
  --yel: #facc15;
  --blu: #3b82f6;
  --rad: 12px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'SF Mono', Consolas, monospace;
}

/* ═══ Reset ═══ */
#score808-matches-root, #score808-matches-root * {
  box-sizing: border-box !important; margin: 0; padding: 0;
  font-family: var(--font); color: var(--txt);
  -webkit-font-smoothing: antialiased;
}
#score808-matches-root img { max-width: none !important; height: auto; }
#score808-matches-root a { color: inherit; text-decoration: none; }

/* ═══ Layout ═══ */
.s8w { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.s8-main { display: flex; gap: 24px; align-items: flex-start; }
.s8-feed { flex: 1; min-width: 0; }
.s8-sidebar { display: none; }

/* ═══ Loading / Error ═══ */
.s8ld { display: flex; align-items: center; justify-content: center; min-height: 300px; }
.s8sp { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--acc); border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.s8er { text-align: center; padding: 40px 20px; color: var(--red); font-size: 14px; }
.s8retry { padding: 10px 24px; background: var(--acc); color: #fff; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; margin-top: 12px; }
.s8mt { text-align: center; padding: 40px 20px; color: var(--mut); font-size: 14px; }

/* ═══ Top Status Tabs (Desktop only) ═══ */
.s8-top-tabs {
  display: none;
  align-items: stretch;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  margin: 16px 0 24px;
}
.s8-top-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 16px 8px; font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--mut); background: transparent; border: none;
  cursor: pointer; font-family: var(--font); transition: all .2s;
  border-bottom: 2px solid transparent; position: relative;
}
.s8-top-tab:hover { color: var(--dim); background: rgba(255,255,255,.02); }
.s8-top-tab.on { color: var(--acc); border-bottom-color: var(--acc); background: var(--acc-bg); }
.s8-top-tab .s8-tab-count {
  font-size: 11px; font-weight: 800; font-family: var(--mono);
  min-width: 26px; height: 24px; display: inline-flex; align-items: center;
  justify-content: center; border-radius: 12px; padding: 0 7px;
  background: var(--border); color: var(--dim);
}
.s8-top-tab.on .s8-tab-count { background: var(--acc-bg2); color: var(--acc); }

/* ═══ Live Ticker Strip ═══ */
.s8-live-strip {
  display: flex; gap: 10px;
  padding: 16px 0 !important;
  margin-bottom: 16px !important;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin-left: -16px; margin-right: -16px;
  padding-left: 16px !important; padding-right: 16px !important;
}
.s8-live-strip::-webkit-scrollbar { display: none; }
.s8-live-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px; border-radius: 12px;
  background: rgba(16,185,129,.07); border: 1px solid rgba(16,185,129,.2);
  color: var(--txt); font-size: 13px; font-weight: 600;
  white-space: nowrap; flex-shrink: 0; cursor: pointer;
  text-decoration: none; transition: all .15s;
}
.s8-live-chip:hover { background: rgba(16,185,129,.14); border-color: rgba(16,185,129,.35); }
.s8-live-chip img { width: 24px !important; height: 24px !important; object-fit: contain !important; }
.s8-live-score {
  font-family: var(--mono); font-weight: 800; color: var(--acc);
  font-size: 15px;
}
.s8-live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--acc);
  animation: mcpulse 1.5s ease-in-out infinite; flex-shrink: 0;
}

/* ═══ Search Bar ═══ */
.s8-search-wrap {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 2px solid var(--border);
  border-radius: 16px; padding: 16px 20px;
  margin-top: 0 !important; margin-bottom: 16px !important;
  transition: border-color .2s, box-shadow .2s;
}
.s8-search-wrap:focus-within { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
.s8-search-svg { flex-shrink: 0; opacity: .6; transition: opacity .2s; }
.s8-search-wrap:focus-within .s8-search-svg { opacity: 1; stroke: var(--acc); }
.s8si {
  flex: 1; background: none; border: none; outline: none;
  color: var(--txt); font-size: 16px; font-family: var(--font); font-weight: 500;
}
.s8si::placeholder { color: var(--mut); font-weight: 400; }
.s8-search-clear {
  width: 28px; height: 28px; border-radius: 50%; background: var(--border);
  border: none; color: var(--dim); font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background .15s;
}
.s8-search-clear:hover { background: rgba(239,68,68,.2); color: var(--red); }

/* ═══ League Filter Tabs ═══ */
.s8-league-tabs {
  display: flex; gap: 8px;
  padding: 0 !important; padding-bottom: 0 !important;
  margin-bottom: 16px !important;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin-left: -16px; margin-right: -16px; padding-left: 16px !important; padding-right: 16px !important;
}
.s8-league-tabs::-webkit-scrollbar { display: none; }
.s8-ltab {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--dim); font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; font-family: var(--font);
  transition: all .15s; flex-shrink: 0;
}
.s8-ltab:hover { border-color: var(--acc); color: var(--txt); }
.s8-ltab.on { background: var(--acc); color: #fff; border-color: var(--acc); }
#score808-matches-root .s8-ltab img,
.s8-league-tabs .s8-ltab img,
#score808-matches-root .s8li,
.s8lh .s8li {
  width: 18px !important; height: 18px !important; max-width: 18px !important;
  max-height: 18px !important; object-fit: contain !important; border-radius: 2px !important;
  display: inline-block !important; flex-shrink: 0 !important;
}

/* ═══ Section Header ═══ */
.s8-section-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 2px 14px !important; margin-top: 4px !important;
  font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px; color: var(--dim);
}
.s8-section-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--red);
  animation: pp 1.5s ease-in-out infinite; flex-shrink: 0;
}
@keyframes pp { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); } 50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); } }

/* ═══ League Group ═══ */
.s8lg { margin-bottom: 24px; }
.s8lh {
  display: flex; align-items: center; gap: 8px; padding: 0 4px 10px;
  font-size: 12px; font-weight: 700; color: var(--mut);
  text-transform: uppercase; letter-spacing: .8px;
}

/* ═══ MATCH CARD ═══ */
.mc {
  display: block; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--rad); padding: 20px 18px; margin-bottom: 12px;
  text-decoration: none; color: inherit; position: relative;
  overflow: hidden; transition: all .15s;
}
.mc::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: transparent; transition: background .15s;
}
.mc.live::before { background: var(--acc); }
.mc.live { border-color: rgba(16,185,129,.2); background: linear-gradient(135deg, rgba(16,185,129,.04), transparent); }
.mc:hover { background: var(--card2); box-shadow: 0 2px 12px rgba(0,0,0,.25); }
.mc:active { transform: scale(.998); }

.mc-row { display: flex; align-items: center; gap: 10px; }

.mc-team {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 8px; min-width: 0;
}
#score808-matches-root .mc-logo,
.mc .mc-logo {
  width: 44px !important; height: 44px !important; max-width: 44px !important;
  object-fit: contain !important; border-radius: 4px !important;
}
.mc-name {
  font-size: 12px; font-weight: 600; text-align: center;
  color: var(--txt); line-height: 1.3; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

.mc-center {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; flex-shrink: 0; min-width: 90px;
}
.mc-min { font-size: 13px; font-weight: 700; font-family: var(--mono); color: var(--acc); line-height: 1; }
.mc-kick { font-size: 12px; font-weight: 600; font-family: var(--mono); color: var(--dim); line-height: 1; }
.mc-score {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 26px; font-weight: 800;
  color: var(--txt); line-height: 1; padding: 4px 0;
}
.mc-sep { font-size: 16px; color: var(--mut); font-weight: 400; }

.mc-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; padding: 3px 8px; border-radius: 4px; line-height: 1;
  margin-top: 2px;
}
.mc-status.live { color: var(--acc); background: var(--acc-bg); }
.mc-status.finished { color: var(--dim); background: rgba(148,163,184,.08); }
.mc-status.scheduled { color: var(--dim); background: rgba(148,163,184,.05); }
.mc-status.postponed { color: var(--mut); background: rgba(100,116,139,.08); }

.mc-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--acc);
  animation: mcpulse 1.5s ease-in-out infinite; flex-shrink: 0;
}
@keyframes mcpulse {
  0%, 100% { opacity: 1; } 50% { opacity: .4; }
}

/* ═══ Bottom Nav (Mobile) ═══ */
.s8-bnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 999;
  display: flex;
  align-items: stretch; justify-content: space-around;
  background: rgba(10, 14, 26, 0.97); border-top: 1px solid var(--border);
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.s8-bnav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 10px 4px 8px; background: none; border: none;
  cursor: pointer; color: var(--mut); transition: color .15s;
  font-family: var(--font); text-decoration: none;
}
.s8-bnav-btn.on { color: var(--acc); }
.s8-bnav-top { display: flex; align-items: center; gap: 5px; }
.s8-bnav-icon { display: flex; align-items: center; justify-content: center; }
.s8-bnav-icon svg { width: 24px; height: 24px; }
.s8-bnav-badge {
  font-size: 11px; font-weight: 800; font-family: var(--mono);
  min-width: 22px; height: 20px; display: flex; align-items: center;
  justify-content: center; border-radius: 10px; padding: 0 6px;
  background: var(--border); color: var(--dim);
}
.s8-bnav-btn.on .s8-bnav-badge { background: var(--acc-bg2); color: var(--acc); }
.s8-bnav-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.s8-bottom-spacer { height: 20px; }

/* ═══ MOBILE (≤767px) ═══ */
@media (max-width: 767px) {
  .s8-top-tabs { display: none !important; }
  .s8-bnav { display: flex; }
  .s8-bottom-spacer { height: 90px; }
  .s8w { padding: 0 12px; }
  .s8-league-tabs { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .s8-live-strip { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .s8-sidebar { display: none !important; }
}

/* ═══ MOBILE SMALL (≤400px) ═══ */
@media (max-width: 400px) {
  .mc { padding: 14px 12px; }
  .mc-row { gap: 6px; }
  #score808-matches-root .mc-logo { width: 38px !important; height: 38px !important; max-width: 38px !important; }
  .mc-name { font-size: 11px; }
  .mc-score { font-size: 22px; }
  .mc-center { min-width: 80px; }
}

/* ═══ TABLET (600px+) ═══ */
@media (min-width: 600px) {
  .mc { padding: 20px 22px; }
  #score808-matches-root .mc-logo { width: 48px !important; height: 48px !important; max-width: 48px !important; }
  .mc-name { font-size: 13px; }
  .mc-score { font-size: 28px; }
  .mc-center { min-width: 100px; }
}

/* ═══ DESKTOP (768px+) ═══ */
@media (min-width: 768px) {
  .s8-top-tabs { display: flex !important; }
  .s8-bnav { display: none !important; }
  .s8-bottom-spacer { height: 20px; }

  .s8-sidebar { display: none !important; }
  .s8-feed { max-width: 100%; }

  .s8lg {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px;
  }
  .s8lh { grid-column: 1 / -1; }
  .mc { margin-bottom: 0; }

  .s8-league-tabs { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  .s8-live-strip { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
}

/* ═══ LARGE DESKTOP (1024px+) ═══ */
@media (min-width: 1024px) {
  .s8lg { gap: 14px; }
  .mc { padding: 20px 22px; border-radius: 12px; }
  #score808-matches-root .mc-logo { width: 50px !important; height: 50px !important; max-width: 50px !important; }
  .mc-name { font-size: 14px; }
  .mc-score { font-size: 30px; }
  .mc-center { min-width: 110px; }
  .mc:hover { box-shadow: 0 4px 20px rgba(0,0,0,.3); transform: translateY(-1px); }
  .mc.live:hover { box-shadow: 0 4px 20px rgba(16,185,129,.1); }
}

/* ═══ Sidebar ═══ */
.s8-sidebar-section {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; margin-bottom: 16px;
  overflow: hidden;
}
.s8-sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.s8-sidebar-title {
  font-size: 14px; font-weight: 700; color: var(--txt);
  display: flex; align-items: center; gap: 8px;
}
.s8-sidebar-title-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.s8-sidebar-title-icon.news { background: rgba(59,130,246,.12); }
.s8-sidebar-title-icon.trending { background: rgba(250,204,21,.12); }
.s8-sidebar-link {
  font-size: 11px; color: var(--acc); font-weight: 600;
  text-decoration: none; display: flex; align-items: center; gap: 3px;
}
.s8-sidebar-link:hover { text-decoration: underline; }

/* ═══ Sidebar News Cards (Rich) ═══ */
.s8-ncard {
  display: block; text-decoration: none; color: inherit;
  border-radius: 10px; overflow: hidden;
  margin-bottom: 10px; transition: all .15s;
  border: 1px solid var(--border); background: var(--card3);
}
.s8-ncard:last-child { margin-bottom: 0; }
.s8-ncard:hover { border-color: var(--border2); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,.3); }

.s8-ncard-visual {
  position: relative; height: 72px; padding: 10px 12px;
  background: linear-gradient(135deg, #0f172a, #1a2236);
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.s8-ncard-visual img {
  width: 32px !important; height: 32px !important;
  object-fit: contain !important; border-radius: 4px !important;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
}
.s8-ncard-vs {
  font-size: 10px; font-weight: 800; color: #334155;
  text-transform: uppercase; letter-spacing: 1px;
}
.s8-ncard-badge {
  position: absolute; top: 6px; left: 8px;
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; letter-spacing: .4px;
  line-height: 1.3;
}
.s8-ncard-badge.live { background: rgba(16,185,129,.15); color: var(--acc); }
.s8-ncard-badge.pre { background: rgba(59,130,246,.12); color: var(--blu); }
.s8-ncard-badge.post { background: rgba(148,163,184,.1); color: var(--dim); }

.s8-ncard-score {
  position: absolute; top: 6px; right: 8px;
  font-size: 12px; font-weight: 800; font-family: var(--mono);
  color: var(--acc); line-height: 1;
}

.s8-ncard-body {
  padding: 10px 12px 12px;
}
.s8-ncard-league {
  font-size: 9px; font-weight: 600; color: var(--mut);
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 4px;
}
.s8-ncard-title {
  font-size: 12px; font-weight: 700; color: var(--txt); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 4px;
}
.s8-ncard-excerpt {
  font-size: 11px; color: var(--mut); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.s8-ncard-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px 10px; font-size: 10px; color: var(--mut);
}
.s8-ncard-readmore {
  color: var(--acc); font-weight: 600; font-size: 10px;
}

/* ═══ Sidebar Trending (compact list) ═══ */
.s8-trend-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid rgba(30,41,59,.4);
  text-decoration: none; color: inherit; transition: opacity .15s;
}
.s8-trend-item:last-child { border-bottom: none; }
.s8-trend-item:hover { opacity: .8; }
.s8-trend-num {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--acc-bg); color: var(--acc);
  font-size: 10px; font-weight: 800; font-family: var(--mono);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.s8-trend-body { flex: 1; min-width: 0; }
.s8-trend-title {
  font-size: 12px; font-weight: 600; color: var(--txt); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.s8-trend-meta { font-size: 10px; color: var(--mut); margin-top: 1px; }
.s8-trend-logos {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.s8-trend-logos img {
  width: 20px !important; height: 20px !important;
  object-fit: contain !important; border-radius: 3px !important;
}
