/* Score808 Match Center v7.0 — Responsive Homepage Styles */

:root {
  --bg: #0a0e1a;
  --card: #111827;
  --card2: #151d2e;
  --border: #1e293b;
  --border2: #253044;
  --txt: #f1f5f9;
  --dim: #94a3b8;
  --mut: #64748b;
  --grn: #22ff66;
  --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;
}

.s8w { max-width: 860px; margin: 0 auto; padding: 0 10px; }

/* Loading */
.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(--grn); 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: 8px 20px; background: var(--grn); color: #000; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 13px; }
.s8mt { text-align: center; padding: 40px 20px; color: var(--mut); font-size: 14px; }

/* ═══ Search Bar ═══ */
.s8-search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; margin: 12px 0 8px;
  transition: border-color .2s;
}
.s8-search-wrap:focus-within { border-color: var(--grn); }
.s8-search-icon { font-size: 14px; flex-shrink: 0; }
.s8si {
  flex: 1; background: none; border: none; outline: none;
  color: var(--txt); font-size: 14px; font-family: var(--font);
}
.s8si::placeholder { color: var(--mut); }

/* ═══ League Filter Tabs ═══ */
.s8-league-tabs {
  display: flex; gap: 6px; padding: 6px 0 10px;
  overflow-x: auto; scrollbar-width: none;
}
.s8-league-tabs::-webkit-scrollbar { display: none; }
.s8-ltab {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--dim); font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap; font-family: var(--font);
  transition: all .2s; flex-shrink: 0;
}
#score808-matches-root .s8-ltab img,
.s8-league-tabs .s8-ltab img {
  width: 16px !important; height: 16px !important; max-width: 16px !important;
  max-height: 16px !important; object-fit: contain !important; border-radius: 2px !important;
  display: inline-block !important; flex-shrink: 0 !important;
}
.s8-ltab:hover { border-color: var(--grn); color: var(--txt); }
.s8-ltab.on { background: var(--grn); color: #0a0e1a; border-color: var(--grn); }
#score808-matches-root .s8-ltab.on img { filter: brightness(0) !important; }

/* ═══ Section Header ═══ */
.s8-section-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 4px 8px; font-size: 13px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .5px; color: var(--txt);
}
.s8-section-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--grn);
  animation: pp 1.5s ease-in-out infinite; flex-shrink: 0;
}
@keyframes pp { 0%,100% { box-shadow: 0 0 0 0 rgba(34,255,102,.6); } 50% { box-shadow: 0 0 0 6px rgba(34,255,102,0); } }
.s8-section-title { color: var(--txt); }

/* League Group */
.s8lg { margin-bottom: 10px; margin-top: 6px; }
.s8lh {
  display: flex; align-items: center; gap: 8px; padding: 14px 12px 8px;
  font-size: 11px; font-weight: 700; color: var(--dim);
  text-transform: uppercase; letter-spacing: .6px;
}
#score808-matches-root .s8li,
.s8lh .s8li { width: 18px !important; height: 18px !important; max-width: 18px !important; object-fit: contain !important; border-radius: 3px !important; }

/* ═══ MATCH CARD ═══ */
.mc {
  display: block; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--rad); padding: 14px 12px; margin-bottom: 8px;
  text-decoration: none; color: inherit; position: relative;
  overflow: hidden; transition: all .2s;
}
.mc::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: transparent; transition: background .2s;
}
.mc.live::before { background: var(--grn); }
.mc.live { border-color: rgba(34,255,102,.2); }
.mc:hover { background: var(--card2); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,0,0,.3); }
.mc:active { transform: scale(.995); }

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

.mc-team {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 5px; min-width: 0;
}
#score808-matches-root .mc-logo,
.mc .mc-logo { width: 38px !important; height: 38px !important; max-width: 38px !important; object-fit: contain !important; border-radius: 6px !important; }
.mc-name {
  font-size: 11px; font-weight: 600; text-align: center;
  color: var(--txt); line-height: 1.2; 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: 2px; flex-shrink: 0; min-width: 80px;
}
.mc-min { font-size: 12px; font-weight: 700; font-family: var(--mono); color: var(--grn); line-height: 1; }
.mc-kick { font-size: 11px; font-weight: 600; font-family: var(--mono); color: var(--dim); line-height: 1; }
.mc-score {
  display: flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 22px; font-weight: 800;
  color: var(--txt); line-height: 1; padding: 2px 0;
}
.mc-sep { font-size: 16px; color: var(--mut); font-weight: 400; }

.mc-status {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; padding: 2px 6px; border-radius: 3px; line-height: 1;
}
.mc-status.live { color: var(--grn); background: rgba(34,255,102,.12); }
.mc-status.finished { color: var(--dim); background: rgba(148,163,184,.1); }
.mc-status.scheduled { color: var(--dim); background: rgba(148,163,184,.06); }
.mc-status.postponed { color: var(--mut); background: rgba(100,116,139,.1); }

.mc-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--grn);
  animation: mcpulse 1.5s ease-in-out infinite; flex-shrink: 0;
}
@keyframes mcpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,255,102,.5); opacity: 1; }
  50% { box-shadow: 0 0 0 4px rgba(34,255,102,0); opacity: .7; }
}

/* ═══ Sticky Bottom Nav ═══ */
.s8-bnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 999;
  display: flex; align-items: stretch; justify-content: space-around;
  background: #0d1220; border-top: 1px solid var(--border);
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.s8-bnav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 8px 4px 6px; background: none; border: none;
  cursor: pointer; color: var(--mut); transition: color .2s;
  font-family: var(--font); position: relative;
}
.s8-bnav-btn.on { color: var(--grn); }
.s8-bnav-btn.has-live .s8-bnav-icon { animation: bnav-pulse 2s ease-in-out infinite; }
@keyframes bnav-pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

.s8-bnav-top {
  display: flex; align-items: center; gap: 4px; position: relative;
}
.s8-bnav-icon { display: flex; align-items: center; justify-content: center; }
.s8-bnav-icon svg { width: 20px; height: 20px; }
.s8-bnav-badge {
  font-size: 11px; font-weight: 800; font-family: var(--mono);
  min-width: 20px; height: 20px; display: flex; align-items: center;
  justify-content: center; border-radius: 10px; padding: 0 5px;
  background: var(--border); color: var(--dim);
}
.s8-bnav-btn.on .s8-bnav-badge {
  background: rgba(34,255,102,.15); color: var(--grn);
}
.s8-bnav-label {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px;
}

/* Bottom spacer so content doesn't hide behind nav */
.s8-bottom-spacer { height: 80px; }


/* ═══════════════════════════════════════════════════════════════════════ */
/* ═══ MOBILE SMALL (≤400px) ═══ */
/* ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 400px) {
  #score808-matches-root .mc-logo { width: 32px !important; height: 32px !important; max-width: 32px !important; }
  .mc-name { font-size: 10px; }
  .mc-score { font-size: 20px; }
  .mc-center { min-width: 70px; }
  .mc { padding: 10px 8px; }
}


/* ═══════════════════════════════════════════════════════════════════════ */
/* ═══ TABLET (600px+) ═══ */
/* ═══════════════════════════════════════════════════════════════════════ */
@media (min-width: 600px) {
  .s8w { padding: 0 20px; }
  .s8-search-wrap { padding: 12px 18px; border-radius: 12px; }
  .s8si { font-size: 15px; }
  .s8-ltab { padding: 7px 16px; font-size: 13px; }
  .s8-section-hd { font-size: 14px; padding: 14px 4px 10px; }
  .s8lh { font-size: 12px; padding: 16px 12px 10px; letter-spacing: .8px; }
  .mc { padding: 16px 20px; margin-bottom: 10px; border-radius: 14px; }
  #score808-matches-root .mc-logo { width: 44px !important; height: 44px !important; max-width: 44px !important; }
  .mc-name { font-size: 13px; }
  .mc-score { font-size: 26px; gap: 6px; }
  .mc-sep { font-size: 18px; }
  .mc-center { min-width: 100px; }
  .mc-min { font-size: 13px; }
  .mc-kick { font-size: 12px; }
  .mc-status { font-size: 10px; padding: 3px 8px; }
}


/* ═══════════════════════════════════════════════════════════════════════ */
/* ═══ DESKTOP (768px+) — 2-column grid + floating nav ═══ */
/* ═══════════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  .s8w { max-width: 900px; padding: 0 24px; }

  /* League group becomes a 2-column grid */
  .s8lg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  /* League header spans both columns */
  .s8lh {
    grid-column: 1 / -1;
    width: 100%;
  }
  /* Match cards fill grid cells */
  .mc {
    margin-bottom: 0;
  }

  /* Bottom nav — floating pill centered */
  .s8-bnav {
    left: 0; right: 0;
    max-width: 400px; width: 90%;
    margin: 0 auto;
    border-radius: 16px 16px 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
    background: rgba(13, 18, 32, 0.95);
    box-shadow: 0 -4px 30px rgba(0,0,0,.4);
  }
  .s8-bnav-btn { padding: 10px 8px 8px; }
  .s8-bnav-label { font-size: 10px; letter-spacing: .8px; }
}


/* ═══════════════════════════════════════════════════════════════════════ */
/* ═══ LARGE DESKTOP (1024px+) ═══ */
/* ═══════════════════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
  .s8w { max-width: 960px; }

  /* Refined hover with depth */
  .mc:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.4);
    transform: translateY(-2px);
    border-color: var(--border2);
  }
  .mc.live:hover {
    border-color: rgba(34,255,102,.35);
    box-shadow: 0 6px 24px rgba(34,255,102,.08);
  }

  #score808-matches-root .mc-logo { width: 46px !important; height: 46px !important; max-width: 46px !important; }
  .mc-name { font-size: 13px; font-weight: 600; }
  .mc-score { font-size: 28px; }
  .mc-center { min-width: 110px; }
  .mc { padding: 18px 24px; }

  .s8-search-wrap { padding: 14px 20px; }

  /* League tabs wrap on desktop */
  .s8-league-tabs { flex-wrap: wrap; gap: 8px; padding: 8px 0 14px; }
  .s8-ltab { padding: 8px 18px; font-size: 13px; border-radius: 22px; }
  .s8-ltab:hover { background: var(--card2); }
  .s8-section-hd { font-size: 15px; padding: 16px 4px 12px; }

  /* Nav button hover */
  .s8-bnav { max-width: 440px; border-radius: 18px 18px 0 0; }
  .s8-bnav-btn {
    padding: 12px 10px 10px;
    transition: color .2s, background .2s;
    border-radius: 12px; margin: 2px;
  }
  .s8-bnav-btn:hover { background: rgba(255,255,255,.04); }
  .s8-bnav-label { font-size: 10px; }
  .s8-bnav-badge { font-size: 12px; min-width: 22px; height: 22px; }
  .s8-bottom-spacer { height: 90px; }
}


/* ═══════════════════════════════════════════════════════════════════════ */
/* ═══ ULTRAWIDE (1200px+) ═══ */
/* ═══════════════════════════════════════════════════════════════════════ */
@media (min-width: 1200px) {
  .s8w { max-width: 1040px; }
  .mc { padding: 18px 28px; border-radius: 14px; }
  #score808-matches-root .mc-logo { width: 48px !important; height: 48px !important; max-width: 48px !important; }
  .mc-name { font-size: 14px; }
  .mc-score { font-size: 30px; }
  .mc-center { min-width: 120px; }
}
