/* ---------- Global typography: Flashscore-style font (Roboto) ----------
   Flashscore uses Roboto (Helvetica/Arial fallbacks). Change --font-main to
   swap the font for the whole site. Weights: 400 for normal text, 700 for
   anything bold (team names, scores, headings). */
:root {
  --font-main: "Roboto", Helvetica, Arial, sans-serif;
}

body { font-weight: 400; }
b, strong, th, h1, h2, h3, h4, h5, h6 { font-weight: 700; }
button, input, select, textarea { font-family: inherit; }

/* =========================================================
   ScoreB - stylesheet
   ========================================================= */

:root {
  --bg: #0e1117;
  --bg-elevated: #161b24;
  --bg-card: #1b212c;
  --border: #2a3140;
  --text: #eef1f6;
  --text-dim: #9aa4b2;
  --accent: #23c56d;
  --accent-dark: #17974f;
  --live: #ff4d4f;
  --radius: 10px;
  --header-h: 64px;
  --site-blue: #0EA5E9;
  --site-blue-dark: #0c8fc9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #F2F2F2;
  color: var(--text);
  font-family: var(--font-main);
}

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

/* ---------- Header ---------- */
header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.tittle h1 { 
margin: 0; 
font-size: 28px; 
letter-spacing: 0.5px; 
color:  #C9D1D9;
}

.tittle h1 span { color: #006CFF; }

header nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
}

header nav ul li a {
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 400;
}

header nav ul li a:hover { color: var(--text); }

.login { display: flex; align-items: center; gap: 8px; color: var(--text-dim); }

.login .btn {
  background: #0EA5E9;
  color: #04160b;
  padding: 7px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
}

/* ---------- Sub-nav / search ---------- */
.container {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 24px;
border-bottom: 1px solid var(--text-dim);
gap: 16px;
flex-wrap: wrap;
background: #0EA5E9;
}

.sport-nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.sport-nav ul li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.sport-nav ul li a { transition: color 0.2s ease; }

.sport-nav ul li.active,
.sport-nav ul li.active a {
  color: #000;
  font-weight: 700;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 14px;
  min-width: 260px;
  flex: 1;
  max-width: 380px;
}

.search-box input {
background: transparent;
border: none;
outline: none;
color: #222;
width: 100%;
font-size: 13px;
}

.search-box i { color: var(--text-dim); font-size: 13px; }

/* ---------- Layout grid ---------- */
.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  padding: 20px 24px 40px;
  align-items: start;
  transition: grid-template-columns 0.25s ease;
}

.layout.detail-open {
  grid-template-columns: 220px minmax(0, 1fr) 380px;
}

.left-panel {
  background: #fff;
  border: 1px solid #e3e6ea;
  border-radius: var(--radius);
  padding: 14px 8px 10px;
  position: sticky;
  top: calc(var(--header-h) + 20px);
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto;
}

/* Pinned leagues (desktop only - the whole panel is hidden on small screens) */
.pinned-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 0 8px 10px;
  border-bottom: 1px solid #e3e6ea;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #222;
}
.pinned-title i { font-size: 12px; color: var(--site-blue); }
.pinned-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.pinned-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 6px 8px;
  border-radius: 8px;
  color: #222;
  font-size: 14px;
  transition: background 0.15s ease;
}
.pinned-link:hover { background: rgba(0, 0, 0, 0.05); }
.pinned-link:focus-visible { outline: 2px solid var(--site-blue); outline-offset: -2px; }
.pinned-logo {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pinned-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pinned-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
  .layout, .layout.detail-open { grid-template-columns: minmax(0, 1fr); }
  .left-panel { display: none; }
}

/* ---------- Mobile fixes (index page header / sport-nav / league groups) ---------- */
@media (max-width: 640px) {
  html, body { overflow-x: hidden; }

  header {
    padding: 0 14px;
  }

  .tittle h1 { font-size: 22px; }

  .login .btn { padding: 6px 12px; font-size: 13px; }

  /* Blue sub-nav bar: stop it from overflowing the viewport width */
  .container {
    padding: 10px 14px;
    gap: 10px;
  }

  .sport-nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .sport-nav::-webkit-scrollbar { display: none; }

  .sport-nav ul {
    flex-wrap: nowrap;
    gap: 16px;
    width: max-content;
  }

  .search-box {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  /* Main content area: equal left/right spacing, no leftover gap */
  .layout {
    padding: 14px 14px 30px;
    gap: 14px;
  }

  .date-nav {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .date-picker { margin-left: 0; }

  .league-group {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .match-row {
    grid-template-columns: 46px 1fr 50px;
    padding: 10px 12px;
    gap: 8px;
  }
}

/* ---------- Date nav ---------- */
.date-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.date-btn {
  background: #0EA5E9;
  border: 1px solid var(--border);
  color: white;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.date-btn:hover { border-color: var(--accent); }

.today-btn {
  width: auto;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
}

.today-btn:disabled {
  opacity: 0.5;
  cursor: default;
  border-color: var(--border);
}

.current-date {
  font-weight: 700;
  font-size: 15px;
  min-width: 110px;
}

.date-picker {
  background: #0EA5E9;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 13px;
  margin-left: auto;
}

/* ---------- Date nav: keep everything on ONE row on every phone ----------
   Placed after the base .date-nav rules on purpose so it wins over them
   (and over the older wrap rule in the 640px block above). */
@media (max-width: 640px) {
  .date-nav {
    flex-wrap: nowrap;
    gap: 8px;
  }

  /* buttons + date picker keep their size */
  .date-btn,
  .date-picker {
    flex-shrink: 0;
  }

  /* the (empty-looking) date label becomes a flexible spacer that
     shrinks first, so nothing ever has to wrap to a second line */
  .current-date {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
  }

  .date-picker { margin-left: 0; }
}

/* very small phones (<= 360px wide) */
@media (max-width: 360px) {
  .date-nav { gap: 6px; }
  .date-btn { width: 32px; height: 32px; }
  .today-btn { padding: 0 10px; font-size: 12px; }
  .date-picker { padding: 5px 6px; font-size: 12px; }
}

.status-bar {
color: var(--text-dim);
font-size: 12px;
margin-bottom: 14px;
min-height: 16px;
}

/* ---------- Nav buttons (All / Live / Schedule / Popular / African) ---------- */
.nav-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.nav-buttons .nav-btn {
  background: #0EA5E9;
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.nav-buttons .nav-btn:hover { background: #0c8fc9; }

.nav-buttons .nav-btn.active {
  background: #0369a1;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
}

@media (max-width: 640px) {
  .nav-buttons {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 2px;
  }

  .nav-buttons::-webkit-scrollbar { display: none; }

  .nav-buttons .nav-btn {
    flex-shrink: 0;
    padding: 7px 14px;
    font-size: 12.5px;
  }
}

@media (max-width: 360px) {
  .nav-buttons .nav-btn { padding: 6px 12px; font-size: 12px; }
}

/* ---------- Schedule date-picker popup ---------- */
.schedule-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.schedule-modal-overlay.open {
  display: flex;
  opacity: 1;
}

.schedule-modal {
  position: relative;
  background: white;
  color: #222;
  width: 100%;
  max-width: 320px;
  border-radius: var(--radius);
  padding: 24px 20px 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  transform: translateY(0);
  transition: transform 0.25s ease;
}

.schedule-modal-handle { display: none; }

.schedule-modal h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.schedule-modal-sub {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-dim);
}

.schedule-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.schedule-modal-close:hover,
.schedule-modal-close:active { background: rgba(0, 0, 0, 0.08); }

.schedule-date-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #222;
  background: #F5F7FA;
  margin-bottom: 18px;
  min-height: 46px;
  -webkit-appearance: none;
  appearance: none;
}

.schedule-modal-actions {
  display: flex;
  gap: 10px;
}

.schedule-btn {
  flex: 1;
  padding: 8px 0;
  min-height: 42px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  -webkit-tap-highlight-color: transparent;
}

.schedule-btn-confirm {
  background: #0EA5E9;
  color: white;
}

.schedule-btn-confirm:hover,
.schedule-btn-confirm:active { background: #0c8fc9; }

/* On phones the popup becomes a full-width bottom sheet: easier to
   reach with a thumb, no risk of overflowing a narrow viewport, and
   it respects the iPhone home-indicator safe area. */
@media (max-width: 640px) {
  .schedule-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .schedule-modal {
    max-width: 100%;
    width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 10px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
  }

  .schedule-modal-overlay.open .schedule-modal {
    transform: translateY(0);
  }

  .schedule-modal-handle {
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 4px;
    background: var(--border);
    margin: 2px auto 14px;
  }

  .schedule-modal-close {
    top: 8px;
    right: 8px;
  }

  .schedule-modal h3 { font-size: 18px; }

  .schedule-modal-sub { font-size: 13.5px; margin-bottom: 18px; }

  .schedule-date-input {
    font-size: 17px;
    padding: 13px 14px;
    min-height: 50px;
    margin-bottom: 20px;
  }

  .schedule-modal-actions {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .schedule-btn {
    padding: 8px 0;
    min-height: 46px;
    font-size: 15px;
  }
}

@media (max-width: 360px) {
  .schedule-modal { padding: 8px 14px calc(16px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- League groups / matches ---------- */
.league-group {
  background: white;
  border: 1px solid var(--text-dim);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.league-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #0EA5E9;
  border-bottom: 1px solid var(--text-dim);
}

.league-header img { width: 20px; height: 20px; object-fit: contain; }
.league-name { font-size: 13px; font-weight: 700; }
.league-country { font-size: 12px; color: white; margin-left: 4px; }

.match-row {
  display: grid;
  grid-template-columns: 56px 1fr 60px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--text-dim);
  gap: 10px;
}

.match-row:last-child { border-bottom: none; }

.match-status {
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: var(--text-dim);
}

.match-status.live { color: var(--live); }
.match-status.finished { color: var(--text-dim); }
.match-status.scheduled { color: #222; }

.match-teams { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.team-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: #222;
  min-width: 0;
}

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

.team-line img { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.team-line.winner { color: #222; font-weight: Bold; }

.match-score {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  font-size: 13.5px;
  font-weight: 700;
 color: #222;
}

/* ---------- Sport switch transition ---------- */
#matches-container {
  transition: opacity 0.2s ease, transform 0.2s ease;
  opacity: 1;
  transform: translateY(0);
}

#matches-container.fading {
  opacity: 0;
  transform: translateY(6px);
}

.empty-state, .error-state {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}



/* ---------- Match detail card ---------- */
.match-detail {
  display: none;
  position: sticky;
  top: calc(var(--header-h) + 20px);
  background: white;
  border: 1px solid var(--text-dim);
  border-radius: var(--radius);
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow: hidden;
  flex-direction: column;
  color: #222;
}

.layout.detail-open .match-detail { display: flex; }

.close-detail {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: none;
  color: var(--text);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.close-detail:hover { background: rgba(255, 255, 255, 0.15); }

.match-detail-header {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--text-dim);
  background: #F0F0EF;
  position: relative;
}

.detail-league {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #222;
  text-align: center;
  margin-bottom: 10px;
}

.detail-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.detail-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  
}

.detail-team img { width: 56px; height: 56px; object-fit: contain; background: white; border-radius: 8px; }

.detail-score-wrap { text-align: center; }
.detail-score { font-size: 24px; font-weight: 700; }
.detail-status { font-size: 11px; color: var(--live); font-weight: 700; margin-top: 2px; }

.detail-meta {
  text-align: center;
  font-size: 11.5px;
  color: #222;
  margin-top: 10px;
}

.detail-tabs {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--text-dim);
  background: white;
  flex-shrink: 0;
}

.tab-btn {
  background: none;
  border: none;
  color: #222;
  font-size: 12.5px;
  font-weight: 700;
  padding: 12px 14px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.tab-btn.active { color: #000; border-bottom-color: #0EA5E9; }

.tab-btn:focus {
  outline: none;
  color: #0EA5E9;
  border-bottom-color: #0EA5E9;
}

.detail-content {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.detail-placeholder, .detail-loading, .detail-empty, .detail-error {
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  padding: 30px 10px;
}



.detail-loading i { margin-right: 6px; }

/* ---- Summary tab (events) ---- */
.half-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F0F0EF;
  margin: 0 -16px 4px;
  padding: 8px 16px;
  font-size: 11px;
}

.half-header:first-child { margin-top: -16px; }

.half-header-label {
  color: #222;
  font-weight: 300;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.half-header-score { color: #000; font-weight: 300; }

.event-list { display: flex; flex-direction: column; gap: 2px; }

.event-row {
  display: grid;
  grid-template-columns: 1fr 44px 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  font-size: 11.5px;
}

.event-minute { color: #000; font-weight: 300; text-align: center; }

.event-side { display: flex; align-items: center; gap: 6px; min-width: 0; }
.event-side.event-home { justify-content: flex-end; text-align: right; flex-direction: row-reverse; }
.event-side.event-away { justify-content: flex-start; text-align: left; flex-direction: row; }
.event-side .player { font-weight: 300; }
.var-badge {
  display: inline-block;
  background: #222;
  color: #fff;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 4px;
  margin-right: 2px;
  vertical-align: 1px;
}
.event-side .assist.var-player { color: #000; font-weight: 300; }
/* Card events read left to right on both sides: the card, then the player's name */
.event-side.card-event { flex-direction: row; text-align: left; }
.event-side .assist { color: var(--text-dim); font-size: 10.5px; }
.event-side .assist .sub-out { color: var(--text-dim); font-weight: 300; }
.event-side .assist .sub-in { color: #000; font-weight: 300; }
.event-icon { width: 16px; text-align: center; color: var(--text-dim); flex-shrink: 0; }
.event-icon.goal { color: #0EA5E9; }
.event-icon.yellow { color: #f2c744; }
.event-icon.red { color: var(--live); }

/* Yellow / red card shapes in the Summary tab */
.card-icon {
  display: inline-block;
  position: relative;
  width: 11px;
  height: 15px;
  border-radius: 2px;
  vertical-align: middle;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.card-icon.yellow { background: #f2c744; }
.card-icon.red { background: #e11d2e; }
.card-icon.yellow-red { background: #e11d2e; margin-left: 5px; }
.card-icon.yellow-red::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0;
  width: 9px;
  height: 15px;
  border-radius: 2px 0 0 2px;
  background: #f2c744;
}
.event-icon i.fa-right-left {
  background: linear-gradient(180deg, #e11d2e 0%, #e11d2e 50%, #22c55e 50%, #22c55e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Lineups tab (pitch) ---- */
.lineups-wrap { display: flex; flex-direction: column; gap: 14px; }

/* team names, coaches and substitutes on the lineup tab */
.lineups-wrap .formation-label,
.lineups-wrap .lineup-meta,
.lineups-wrap .coach-label,
.lineups-wrap .subs-list,
.lineups-wrap .subs-title { color: #222; }

.formation-label {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
}

.pitch {
  --u: 3.3px;                 /* 1% of pitch width (fallback for old browsers) */
  position: relative;
  width: calc(100% + 3px);       /* 3px wider than before, centred */
  max-width: 423px;
  margin: 0 -1.5px;
  aspect-ratio: 679 / 1079;      /* Flashscore pitch proportions (fallback for old browsers) */
  container-type: inline-size;
  background: repeating-linear-gradient(
    to bottom,
    #1e5e34,
    #1e5e34 10%,
    #226b3a 10%,
    #226b3a 20%
  );
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  overflow: hidden;
  isolation: isolate;         /* keeps pitch lines under the players */
}

@supports (width: 1cqw) {
  .pitch { --u: 1cqw; }

  /* wide screens: keep the 423px pitch centred */
  @container (min-width: 421px) {
    .lineups-wrap .pitch { margin: 0 auto; }
  }

  /* pitch height = Flashscore proportions (height = 1.589 x width): the
     lineups wrapper is the size container, so its width tells us the pitch width */
  .lineups-wrap { container-type: inline-size; }
  .lineups-wrap .pitch {
    aspect-ratio: auto;
    height: calc(min(100cqw, 420px) * 1.589);
  }
}

.pitch::before {
  /* halfway line */
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 2px;
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-50%);
  z-index: 0;
}

.pitch::after {
  /* center circle */
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: calc(var(--u) * 29.7); height: calc(var(--u) * 29.7);
  box-sizing: border-box;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  /* centre spot, same line colour */
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.35) 0, rgba(255, 255, 255, 0.35) calc(var(--u) * 1.3), transparent calc(var(--u) * 1.3 + 0.5px));
  transform: translate(-50%, -50%);
  z-index: 0;
}

.pitch-box {
  /* 18 area (outer box) */
  position: absolute;
  left: 50%;
  width: 63.5%;
  height: 16.1%;
  box-sizing: border-box;
  border: 2px solid rgba(255, 255, 255, 0.35);
  transform: translateX(-50%);
  z-index: 0;
}

.pitch-box.small {
  /* 16 area (inner box, pulled back towards the goal) */
  width: 31.2%;
  height: 6.1%;
}

/* corner arcs: a circle centred on each pitch corner, clipped by the pitch */
.pitch-corner {
  position: absolute;
  width: calc(var(--u) * 9.7);
  height: calc(var(--u) * 9.7);
  box-sizing: border-box;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  z-index: 0;
}
.pitch-corner.tl { left: calc(var(--u) * -4.85); top: calc(var(--u) * -4.85); }
.pitch-corner.tr { right: calc(var(--u) * -4.85); top: calc(var(--u) * -4.85); }
.pitch-corner.bl { left: calc(var(--u) * -4.85); bottom: calc(var(--u) * -4.85); }
.pitch-corner.br { right: calc(var(--u) * -4.85); bottom: calc(var(--u) * -4.85); }

.pitch-box.top { top: -2px; border-top: none; }
.pitch-box.bottom { bottom: -2px; border-bottom: none; }

.pitch-player {
  position: absolute;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--u) * 0.6);
  width: calc(var(--u) * 16);
  z-index: 1;
}

.pitch-player .avatar {
  position: relative;
  width: calc(var(--u) * 9 + 13px);
  height: calc(var(--u) * 9 + 13px);
  border-radius: 50%;
  background: #1b212c;
  border: 2px solid var(--accent);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  /* no overflow hidden here so the number badge can sit on the edge */
}

.pitch-player.away .avatar { border-color: #4d9dff; }

/* pitch with 6 lines of players: slightly smaller avatars so lines never touch */
.pitch.compact .pitch-player .avatar {
  width: calc(var(--u) * 7 + 11px);
  height: calc(var(--u) * 7 + 11px);
}
.pitch.compact .pitch-player .name { font-size: calc(var(--u) * 2.8); }

.pitch-player .photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  background: #e9edf2;
  display: block;
}

.pitch-player .fallback {
  display: none;
  color: #fff;
  font-size: calc(var(--u) * 3.8);
  font-weight: 700;
  align-items: center;
  justify-content: center;
}

.pitch-player .avatar.no-photo .fallback { display: flex; }
.pitch-player .avatar.no-photo .badge { display: none; }

.pitch-player .badge {
  position: absolute;
  right: calc(var(--u) * -1.8);
  bottom: calc(var(--u) * -1);
  min-width: calc(var(--u) * 4.4);
  height: calc(var(--u) * 4.4);
  padding: 0 calc(var(--u) * 0.8);
  box-sizing: border-box;
  border-radius: calc(var(--u) * 2.2);
  background: var(--accent);
  color: #fff;
  font-size: calc(var(--u) * 2.7);
  font-weight: 700;
  line-height: calc(var(--u) * 4.4);
  text-align: center;
}

.pitch-player.away .badge { background: #4d9dff; }

.pitch-player .name {
  font-size: calc(var(--u) * 3);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  text-align: center;
  line-height: 1.15;
  max-width: calc(var(--u) * 16);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lineup-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 11.5px;
}

.lineup-meta .coach-label { font-weight: 700; }

.subs-list {
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.subs-title { font-weight: 700; margin-bottom: 4px; font-size: 12.5px; }

/* players on the lineup tab open their profile when clicked */
.pitch-player[data-player-id=""],
.sub-row[data-player-id=""] { cursor: default; }
.pitch-player:hover .name,
.pitch-player:focus-visible .name { text-decoration: underline; }
.pitch-player:focus-visible { outline: none; }
.pitch-player:active .avatar { transform: scale(0.94); }
.sub-row {
  cursor: pointer;
  padding: 2px 0;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

/* nationality flag in front of the jersey number. The space is always
   reserved, so numbers and names line up whether or not it has loaded. */
.sub-nat {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 20px;
  min-height: 14px;
}
.sub-nat.loading::before {
  content: "";
  width: 20px;
  height: 14px;
  border-radius: 2px;
  background: #e3e3e3;
  animation: sub-nat-pulse 1.2s ease-in-out infinite;
}
@keyframes sub-nat-pulse { 50% { opacity: 0.45; } }
.sub-flag {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  display: block;
}
.sub-nat-code { font-size: 10px; font-weight: 700; color: #555; min-width: 20px; text-align: center; }
.sub-num { flex: 0 0 auto; min-width: 1.3em; text-align: right; font-weight: 700; }
.sub-dot { flex: 0 0 auto; }
.sub-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
.sub-row:hover, .sub-row:focus-visible { color: #0EA5E9; outline: none; }

/* player names in the Summary tab */
.player-link { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.player-link:hover, .player-link:focus-visible { color: #0EA5E9; text-decoration: underline; outline: none; }


/* ---- H2H tab ---- */
.h2h-list { display: flex; flex-direction: column; gap: 6px; }

.h2h-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--bg-elevated);
  border-radius: 8px;
  font-size: 12px;
}

.h2h-row .h2h-team { display: flex; align-items: center; gap: 6px; overflow: hidden; }
.h2h-row .h2h-team img { width: 16px; height: 16px; object-fit: contain; }
.h2h-row .h2h-team.right { flex-direction: row-reverse; text-align: right; }
.h2h-row .h2h-score { font-weight: 700; font-size: 13px; }
.h2h-date { font-size: 10.5px; color: var(--text-dim); text-align: center; margin-top: 2px; }

/* ---- Standings tab ---- */
.standings-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }

.standings-table th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 700;
  padding: 6px 4px;
  border-bottom: 1px solid var(--border);
}

.standings-table td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--border);
}

.standings-table td.team-cell { display: flex; align-items: center; gap: 6px; }
.standings-table td.team-cell img { width: 16px; height: 16px; object-fit: contain; }
.standings-table tr.highlight { background: rgba(35, 197, 109, 0.08); }
.standings-table td, .standings-table th { text-align: center; }
.standings-table td.team-cell, .standings-table th.team-th { text-align: left; }

/* ---- Stats tab ---- */
.stats-wrap .formation-label { color: #222; margin-bottom: 12px; }

.stats-periods {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
}

.stats-period-btn {
  border: none;
  background: #EEEEEE;
  color: #222;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: 10px;
  white-space: nowrap;
  cursor: pointer;
}

.stats-period-btn.active { background: #0EA5E9; color: #fff; }

.stats-list { display: flex; flex-direction: column; gap: 16px; }

.stat-row .stat-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.stat-row .stat-val { font-size: 13px; font-weight: 700; color: #222; }
.stat-row .stat-val.away { text-align: right; }

.stat-row .stat-label {
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: #222;
}

/* both bars grow from the middle outwards on a light grey track */
.stat-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: #EBEBEB;
}

.stat-half { flex: 1; display: flex; }
.stat-half.home { justify-content: flex-end; }

.stat-fill { height: 100%; border-radius: 4px; background: #222; }
.stat-fill.home-bar { margin-right: 2px; }
.stat-fill.away-bar { margin-left: 2px; }

/* the team with more is blue; equal stats stay black on both sides */
.stat-fill.lead { background: #0EA5E9; }

/* ==========================================================
   Full-screen match page (match.html)
   Only ever reached from a small screen (see MOBILE_BREAKPOINT
   in script.js) - it reuses the same .match-detail-header /
   .detail-tabs / .detail-content classes as the sidebar card
   on the home page, just laid out to fill the whole viewport.
   ========================================================== */
html, body {
  height: 100%;
  font-family: var(--font-main);
}

.match-page-body {
  margin: 0;
  min-height: 100%;
  background: #F2F2F2;
  color: #222;
}

.match-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.match-page-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  height: var(--header-h);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.match-page-back {
  background: none;
  border: none;
  color: var(--text);
  font-size: 18px;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.match-page-back:hover { background: rgba(255, 255, 255, 0.08); }

.match-page-title h1 { margin: 0; font-size: 18px; }

.match-page{

border-radius: 0;
}	


.match-detail-header {
border-radius: 0;
background: #F0F0EF; 
}

.match-page {
  position: sticky;
  top: var(--header-h);
  z-index: 9;
} 


.detail-tabs {
position: sticky;
top: var(--header-h);
z-index: 9;
background: white;
}

.match-page {
flex: 1;
max-width: 640px;
width: 100%;
margin: 0 auto;
}  


.detail-content {
flex: 1;
max-width: 640px;
width: 100%;
margin: 0 auto;
background: white;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  margin-top: 10px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 24px;
  display: grid;
  grid-template-columns: 1.3fr 1.6fr 1fr 1fr;
  gap: 28px 32px;
}

.footer-brand .tittle h1 { font-size: 24px; }

.footer-brand p {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
  max-width: 280px;
}

.footer-col h4 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #C9D1D9;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  font-size: 13px;
  padding: 4px 0;
  cursor: default;
}

/* Popular leagues run in two columns */
.footer-leagues ul { column-count: 2; column-gap: 24px; }
.footer-leagues li { break-inside: avoid; }

.footer-bottom {
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  padding: 14px 24px;
}

@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand,
  .footer-leagues { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .footer-inner { padding: 28px 14px 18px; gap: 22px 20px; }
  .footer-bottom { padding: 14px; }
}

/* ---------- Favourite stars (logged-in users only) ----------
   Sits at the FRONT of each league header. Glyph is 21px on desktop /
   20px on phones (was 17 / 16). The button is a 32px tap target but uses
   negative margins so the header doesn't get taller. */
.league-header .fav-star {
  background: none;
  border: none;
  padding: 0;
  margin: -4px -2px -4px -6px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.league-header .fav-star:hover { color: #fff; }
.league-header .fav-star.active { color: #FFD54A; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }
.league-header .fav-star:active { transform: scale(0.9); }

/* Keep long league / country names from pushing the star off screen */
.league-header .league-name,
.league-header .league-country {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.league-header .league-name { flex: 0 1 auto; }
.league-header .league-country { flex: 0 1 auto; }

.nav-buttons .nav-btn[hidden] { display: none; }

@media (max-width: 640px) {
  .league-header { gap: 8px; padding: 10px 12px; }
  .league-header .fav-star { font-size: 20px; margin-left: -8px; }
}

@media (max-width: 360px) {
  .league-header .league-country { display: none; }
}


/* ==========================================================
   Player of the Match (POM) - logged-in users only
   Button is the last item in the detail tabs on BOTH match cards
   (desktop sidebar + mobile match page). See pom.js.
   ========================================================== */
body.pom-lock { overflow: hidden; }

.pom-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pom-overlay[hidden] { display: none; }

.pom-sheet {
  background: #fff;
  color: #222;
  width: 100%;
  max-width: 460px;
  max-height: min(640px, calc(100dvh - 32px));
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.pom-grab { display: none; }

.pom-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid #e3e6ea;
  flex-shrink: 0;
}

.pom-title { margin: 0; font-size: 17px; font-weight: 700; }
.pom-sub { margin-top: 2px; font-size: 12.5px; color: #5b6472; }

.pom-close {
  background: #f0f2f5;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #333;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.pom-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 4px 12px 8px;
  flex: 1 1 auto;
}

.pom-note {
  font-size: 12px;
  color: #5b6472;
  text-align: center;
  padding: 10px 0 4px;
}

.pom-empty {
  text-align: center;
  color: #5b6472;
  font-size: 14px;
  line-height: 1.5;
  padding: 34px 12px;
}

.pom-team {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  padding: 12px 4px 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #0c8fc9;
  border-bottom: 1px solid #e3e6ea;
}

.pom-player {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  margin-top: 4px;
  background: #fff;
  border: 1.5px solid transparent;
  border-radius: 10px;
  color: #222;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.pom-player:hover { background: #f5f7fa; }
.pom-player.picked { background: #e6f5fd; border-color: #0EA5E9; }

.pom-num {
  width: 26px;
  flex-shrink: 0;
  text-align: center;
  font-weight: 700;
  color: #5b6472;
  font-size: 13px;
}

.pom-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.pom-name em { font-style: normal; font-size: 10.5px; color: #8b93a0; margin-left: 4px; font-weight: 700; }

.pom-count {
  flex-shrink: 0;
  min-width: 26px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #0c8fc9;
  background: #e6f5fd;
  border-radius: 999px;
  padding: 2px 8px;
}

.pom-check {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid #c8ced6;
  color: transparent;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pom-player.picked .pom-check { background: #0EA5E9; border-color: #0EA5E9; color: #fff; }

.pom-foot {
  flex-shrink: 0;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #e3e6ea;
  background: #fff;
}

.pom-foot:empty { display: none; }

.pom-submit {
  width: 100%;
  min-height: 46px;
  border: none;
  border-radius: 10px;
  background: #0EA5E9;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.pom-submit:disabled { background: #c8ced6; cursor: default; }

/* Phones: slide up from the bottom as a full-width sheet */
@media (max-width: 640px) {
  .pom-overlay { align-items: flex-end; padding: 0; }
  .pom-sheet {
    max-width: none;
    max-height: 88dvh;
    border-radius: 18px 18px 0 0;
    animation: pom-up 0.22s ease-out;
  }
  .pom-grab {
    display: block;
    width: 38px;
    height: 4px;
    border-radius: 2px;
    background: #d3d8df;
    margin: 8px auto 0;
    flex-shrink: 0;
  }
  .pom-head { padding-top: 10px; }
}

@keyframes pom-up {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}


/* ---------- Match stars (logged-in users only) ----------
   A star sits in FRONT of the time in every match row, Flashscore-style.
   Logged-out rows are untouched (no .has-star class, no extra column).
   Tap target is the full column width x 36px, but negative vertical
   margins keep the row exactly as tall as before. */
.match-row.has-star {
  grid-template-columns: 28px 56px minmax(0, 1fr) 60px;
  gap: 8px;
}

.match-row .match-star {
  background: none;
  border: none;
  padding: 0;
  margin: -8px 0;
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  color: #b4bcc6;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.match-row .match-star:hover { color: #FFB300; }
.match-row .match-star.active { color: #FFB300; }
.match-row .match-star:active { transform: scale(0.88); }
.match-row .match-star:focus-visible { outline: 2px solid #0EA5E9; outline-offset: -2px; border-radius: 6px; }

/* Phones */
@media (max-width: 640px) {
  .match-row.has-star {
    grid-template-columns: 26px 42px minmax(0, 1fr) 44px;
    padding: 10px 10px;
    gap: 6px;
  }
  .match-row .match-star { font-size: 19px; }
}

/* Very small phones (<= 360px wide) */
@media (max-width: 360px) {
  .match-row.has-star {
    grid-template-columns: 24px 38px minmax(0, 1fr) 40px;
    padding: 10px 8px;
    gap: 5px;
  }
  .match-row .match-star { font-size: 18px; }
  .match-row.has-star .match-status { font-size: 11px; }
}


/* ==========================================================
   Detail tabs: scroll sideways when they don't fit, with the POM
   button as the last tab. Used by BOTH match cards.
   Faded edges show when there's more to scroll to.
   ========================================================== */
.detail-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  background-color: #FFFFFF;
  background-image:
    linear-gradient(to right, #FFFFFF 30%, rgba(255, 255, 255, 0)),
    linear-gradient(to left, #FFFFFF 30%, rgba(255, 255, 255, 0)),
    linear-gradient(to right, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)),
    linear-gradient(to left, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0));
  background-position: left center, right center, left center, right center;
  background-repeat: no-repeat;
  background-size: 28px 100%, 28px 100%, 12px 100%, 12px 100%;
  background-attachment: local, local, scroll, scroll;
}

/* Touch screens: swipe, no scrollbar */
@media (hover: none) {
  .detail-tabs { scrollbar-width: none; }
  .detail-tabs::-webkit-scrollbar { display: none; }
}

.detail-tabs .tab-btn,
.detail-tabs .pom-tab {
  flex: 0 0 auto;
}

/* POM tab: sits with the other tabs, trophy tells it apart */
.pom-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #222;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 12px 14px;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.pom-tab i { color: #F5A400; font-size: 13px; }
.pom-tab:hover { color: #0EA5E9; }
.pom-tab:active { background: rgba(14, 165, 233, 0.08); }
.pom-tab:focus-visible { outline: 2px solid #0EA5E9; outline-offset: -2px; }
.pom-tab.pom-tab-waiting { color: #7a8594; }
.pom-tab.pom-tab-waiting i { color: #b4bcc6; }

/* Phones: comfortable 44px tap height */
@media (max-width: 640px) {
  .detail-tabs .tab-btn,
  .detail-tabs .pom-tab {
    min-height: 44px;
    padding-top: 0;
    padding-bottom: 0;
  }
  .detail-tabs .tab-btn { display: inline-flex; align-items: center; }
}

/* ==========================================================
   Team stars on the match cards (logged-in users only)
   A small round star sits on the top-right corner of each team's
   logo (Flashscore-style). It's positioned over the logo so the
   header layout / height doesn't change at all. See team-stars.js.
   ========================================================== */
.detail-team { position: relative; }

.team-star {
  position: absolute;
  top: -6px;
  left: calc(50% + 14px);
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  line-height: 1;
  color: #aab3bf;
  background: #fff;
  border: 1px solid #e1e5ea;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* invisible extra hit area -> ~40px tap target without a bigger look */
.team-star::before {
  content: "";
  position: absolute;
  inset: -6px;
}

.team-star:hover { color: #FFB300; }
.team-star.active { color: #FFB300; border-color: #ffe08a; }
.team-star:active { transform: scale(0.88); }
.team-star:focus-visible { outline: 2px solid #0EA5E9; outline-offset: 2px; }

@media (max-width: 360px) {
  .team-star { width: 26px; height: 26px; font-size: 16px; left: calc(50% + 12px); }
}


/* ---------- Search suggestions dropdown ---------- */
.search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  background: #fff;
  color: #222;
  border: 1px solid #d9dee6;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  max-height: min(70vh, 460px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 0;
}
.search-suggest[hidden] { display: none; }

.search-suggest-heading {
  padding: 8px 14px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7686;
}

.search-suggest-msg {
  padding: 14px;
  font-size: 13px;
  color: #6b7686;
}

.search-suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;           /* comfortable thumb target */
  padding: 8px 14px;
  background: transparent;
  border: 0;
  text-align: left;
  font: inherit;
  font-size: 13px;
  color: #222;
  cursor: pointer;
}
.search-suggest-item.active,
.search-suggest-item:hover { background: #eef6fc; }

.ss-logo { width: 24px; height: 24px; object-fit: contain; flex: 0 0 auto; }
.ss-logo.round { border-radius: 50%; object-fit: cover; }
.ss-logo.sm { width: 16px; height: 16px; }
.ss-logo.ph { display: inline-block; background: #e6eaf0; border-radius: 50%; }

.ss-main { display: flex; flex-direction: column; min-width: 0; }
.ss-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-sub { font-size: 11px; color: #6b7686; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* match suggestion rows */
.search-suggest-item:has(.ss-match) { flex-wrap: wrap; row-gap: 0; }
.ss-match { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; }
.ss-when { flex: 0 0 62px; font-size: 11px; color: #6b7686; line-height: 1.2; }
.ss-teams { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.ss-team { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ss-team span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-score { font-weight: 700; white-space: nowrap; }
.ss-league { width: 100%; padding-left: 72px; }

@media (max-width: 640px) {
  .search-suggest { max-height: 60vh; border-radius: 12px; }
  .search-box input { font-size: 16px; } /* stops iOS zooming in on focus */
}

/* ---- Summary tab + live clock: tidy and fit on small screens ---- */
.event-list { min-width: 0; }
.event-row { min-width: 0; }
.event-side > div { min-width: 0; overflow-wrap: anywhere; word-break: break-word; line-height: 1.25; }
.event-side .assist { line-height: 1.25; }
.event-minute { white-space: nowrap; font-variant-numeric: tabular-nums; }
.event-icon { display: inline-flex; align-items: center; justify-content: center; }
.var-badge { white-space: nowrap; }

/* Live clock: digits keep the same width so the time doesn't wobble each second */
.detail-status { font-variant-numeric: tabular-nums; min-width: 44px; letter-spacing: 0.2px; }

@media (max-width: 640px) {
  .event-row { grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr); gap: 6px; padding: 7px 2px; font-size: 11px; }
  .event-side { gap: 5px; }
}

@media (max-width: 360px) {
  .event-row { grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr); gap: 4px; padding: 6px 0; font-size: 10.5px; }
  .event-side { gap: 4px; }
  .event-side .assist { font-size: 9.5px; }
  .event-icon { width: 14px; }
  .var-badge { font-size: 8px; padding: 1px 4px; }
  .card-icon { width: 10px; height: 14px; }
  .detail-status { font-size: 10.5px; }
}

/* ---- Lineups tab: predicted/official label + injuries ---- */
.lineup-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 11.5px;
  line-height: 1.3;
  color: #222;
  min-width: 0;
}
.lineup-banner.predicted { background: #fff7e0; border: 1px solid #f2d98a; }
.lineup-banner.official { background: #e8f6fd; border: 1px solid #b9e2f5; }
.lineup-badge {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.lineup-banner.official .lineup-badge { color: #0b78a8; }
.lineup-banner.predicted .lineup-badge { color: #8a6100; }
.lineup-banner-text { flex: 1 1 160px; min-width: 0; color: #4a4a4a; }

.inj-section { display: flex; flex-direction: column; gap: 6px; color: #222; }
.inj-title { font-weight: 700; font-size: 12.5px; color: #222; }
.inj-col { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.inj-team { font-weight: 700; font-size: 11.5px; color: #555; overflow-wrap: anywhere; }
.inj-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  padding: 2px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.inj-row[data-player-id=""] { cursor: default; }
.inj-row:hover .inj-name, .inj-row:focus-visible .inj-name { color: #0EA5E9; }
.inj-row:focus-visible { outline: none; }
.inj-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; }
.inj-dot.out { background: #e11d2e; }
.inj-dot.doubt { background: #f2a900; }
.inj-body { display: flex; flex-direction: column; min-width: 0; }
.inj-name { font-size: 12px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.inj-reason { font-size: 10.5px; color: #666; line-height: 1.25; overflow-wrap: anywhere; }
.inj-none { font-size: 11.5px; color: #777; }
.lineups-wrap .detail-empty { padding: 14px 6px; }

@media (max-width: 360px) {
  .lineup-banner { padding: 6px 8px; font-size: 11px; }
  .inj-name { font-size: 11.5px; }
  .inj-reason { font-size: 10px; }
}

/* ==========================================================
   Player of the Match tab (pom.js) - shared by both match cards
   ========================================================== */
.pom-tab.active { color: #000; }
.pom-tab.active i { color: #F5A400; }

.pomv { display: flex; flex-direction: column; gap: 12px; padding: 4px 2px 12px; color: #222; min-width: 0; font-size: 13px; }
.pomv * { box-sizing: border-box; }

/* Header */
.pomv-hero {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: 14px; color: #fff;
  background: linear-gradient(135deg, #0b2a43 0%, #0EA5E9 100%);
  min-width: 0;
}
.pomv-hero.closed { background: linear-gradient(135deg, #2b3340 0%, #5b6677 100%); }
.pomv-hero.before { background: linear-gradient(135deg, #1f3a52 0%, #4a86ad 100%); }
.pomv-hero-icon {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.16); display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #FFC93C;
}
.pomv-hero-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pomv-hero-title { font-size: 16px; font-weight: 700; line-height: 1.15; }
.pomv-hero-sub { font-size: 12px; opacity: 0.85; overflow-wrap: anywhere; line-height: 1.25; }
.pomv-chip {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: rgba(255, 255, 255, 0.18); width: fit-content; max-width: 100%;
  font-variant-numeric: tabular-nums;
}
.pomv-chip.open { background: rgba(34, 197, 94, 0.28); }
.pomv-live { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; animation: pomv-pulse 1.4s ease-in-out infinite; }
@keyframes pomv-pulse { 50% { opacity: 0.35; transform: scale(0.8); } }

/* Messages / notices */
.pomv-msg { padding: 9px 12px; border-radius: 10px; font-size: 12.5px; font-weight: 700; }
.pomv-msg[hidden] { display: none; }
.pomv-msg.success { background: #eafaf1; color: #167a45; border: 1px solid #c8f0da; }
.pomv-msg.error { background: #fdecea; color: #b3261e; border: 1px solid #f5c6c1; }
.pomv-rules, .pomv-info, .pomv-hidden-note {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px;
  background: #f3f6fa; font-size: 12.5px; line-height: 1.4; color: #3b4452; min-width: 0;
}
.pomv-rules > span, .pomv-info > i { flex: 0 0 auto; color: #0EA5E9; font-size: 16px; margin-top: 1px; }
.pomv-info > i { font-size: 20px; }
.pomv-info.closed > i { color: #6b7686; }
.pomv-rules > div, .pomv-info > div { min-width: 0; overflow-wrap: anywhere; }
.pomv-hidden-note { background: #fff7e0; color: #7a5a00; align-items: center; padding: 8px 12px; font-size: 12px; }
.pomv-hidden-note i { color: #c58a00; }
.pomv-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 12px; color: #667; text-align: center; font-size: 13px; }
.pomv-empty i { font-size: 22px; color: #0EA5E9; }
.pomv-none { padding: 14px; text-align: center; color: #778; font-size: 12.5px; }

/* Sections */
.pomv-section { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pomv-section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 700; }
.pomv-section-title span { font-size: 11.5px; font-weight: 700; color: #778; }

/* Player photos */
.pomv-photo {
  position: relative; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  background: #e6ebf1; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
}
.pomv-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pomv-photo.no-photo::after { content: "\f007"; font-family: "Font Awesome 6 Free"; font-weight: 900; color: #a3adba; font-size: 16px; }
.pomv-photo.sm { width: 30px; height: 30px; }
.pomv-photo.lg { width: 52px; height: 52px; }
.pomv-photo.xl { width: 60px; height: 60px; border: 3px solid #FFC93C; }

/* Your vote */
.pomv-mine {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; min-width: 0;
  background: #eafaf1; border: 1px solid #bfeccf;
}
.pomv-mine-body { flex: 1 1 auto; min-width: 0; }
.pomv-mine-label { font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: #167a45; }
.pomv-mine-name { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; line-height: 1.2; }
.pomv-mine-team { font-size: 12px; color: #55705f; overflow-wrap: anywhere; }
.pomv-share {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #0EA5E9; background: #fff;
  color: #0b78a8; border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 700; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pomv-share:active { background: #e6f5fd; }

/* Results */
.pomv-leader { border-radius: 14px; padding: 12px; background: linear-gradient(135deg, #fff8e1, #ffefb8); border: 1px solid #f2d98a; min-width: 0; }
.pomv-leader-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: #8a6100; margin-bottom: 8px; }
.pomv-leader-tag i { color: #e0a400; }
.pomv-leader-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pomv-leader-body { flex: 1 1 auto; min-width: 0; }
.pomv-leader-name { font-size: 16px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.pomv-leader-team { font-size: 12px; color: #6d5a1f; overflow-wrap: anywhere; }
.pomv-leader-pct { flex: 0 0 auto; text-align: right; font-size: 28px; font-weight: 700; line-height: 1; color: #222; }
.pomv-leader-pct small { font-size: 14px; }
.pomv-leader-pct span { display: block; font-size: 11px; font-weight: 700; color: #6d5a1f; margin-top: 3px; }
.pomv-bars { display: flex; flex-direction: column; gap: 9px; }
.pomv-bar-row { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 2px 0; }
.pomv-rank { flex: 0 0 16px; text-align: center; font-weight: 700; font-size: 12px; color: #8a93a0; }
.pomv-bar-main { flex: 1 1 auto; min-width: 0; }
.pomv-bar-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.pomv-bar-name { font-weight: 700; min-width: 0; overflow-wrap: anywhere; line-height: 1.2; }
.pomv-bar-name em { font-style: normal; font-size: 10px; font-weight: 700; background: #0EA5E9; color: #fff; padding: 1px 6px; border-radius: 999px; margin-left: 4px; vertical-align: 1px; }
.pomv-bar-val { flex: 0 0 auto; color: #667; font-weight: 700; font-variant-numeric: tabular-nums; }
.pomv-bar { height: 7px; border-radius: 99px; background: #e8edf2; overflow: hidden; margin-top: 4px; }
.pomv-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #0EA5E9, #38bdf8); transition: width 0.5s ease; }
.pomv-bar-row.mine .pomv-bar i { background: linear-gradient(90deg, #16a34a, #4ade80); }
.pomv-split { display: flex; flex-direction: column; gap: 5px; }
.pomv-split-labels { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; font-weight: 700; color: #3b4452; }
.pomv-split-labels span { min-width: 0; overflow-wrap: anywhere; }
.pomv-split-bar { display: flex; height: 9px; border-radius: 99px; overflow: hidden; background: #e8edf2; }
.pomv-split-bar i.h { background: #0EA5E9; }
.pomv-split-bar i.a { background: #222; }
.pomv-updated { text-align: center; font-size: 11px; color: #8a93a0; }

/* Voting: filters, search, player cards */
.pomv-tools { display: flex; flex-direction: column; gap: 8px; }
.pomv-filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.pomv-filters::-webkit-scrollbar { display: none; }
.pomv-filter {
  flex: 0 0 auto; max-width: 48%; border: 1px solid #d5dbe3; background: #fff; color: #333; border-radius: 999px;
  padding: 6px 12px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  -webkit-tap-highlight-color: transparent;
}
.pomv-filter.on { background: #0EA5E9; border-color: #0EA5E9; color: #fff; }
.pomv-search { display: flex; align-items: center; gap: 8px; border: 1px solid #d5dbe3; border-radius: 10px; padding: 0 10px; background: #fff; }
.pomv-search i { color: #8a93a0; font-size: 12px; }
.pomv-search input { flex: 1 1 auto; min-width: 0; border: none; outline: none; background: none; padding: 10px 0; font-size: 14px; color: #222; }
.pomv-search:focus-within { border-color: #0EA5E9; }

.pomv-list { display: flex; flex-direction: column; gap: 8px; }
.pomv-card {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; color: #222;
  background: #fff; border: 1.5px solid #e1e6ec; border-radius: 12px; padding: 9px 10px; cursor: pointer; min-width: 0;
  -webkit-tap-highlight-color: transparent; transition: border-color 0.15s, background 0.15s;
}
.pomv-card:hover { background: #f7fafc; }
.pomv-card.picked { border-color: #0EA5E9; background: #e9f7fe; }
.pomv-card-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pomv-card-name { font-weight: 700; font-size: 13.5px; line-height: 1.2; overflow-wrap: anywhere; }
.pomv-card-meta { font-size: 11px; color: #6b7686; line-height: 1.25; overflow-wrap: anywhere; }
.pomv-card-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 1px; }
.pomv-stat { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: #3b4452; }
.pomv-stat i.fa-solid { color: #7a8594; font-size: 10.5px; }
.pomv-mini { display: inline-block; width: 8px; height: 11px; border-radius: 1.5px; }
.pomv-mini.yellow { background: #f2c744; }
.pomv-mini.red { background: #e11d2e; }
.pomv-top { display: inline-flex; align-items: center; gap: 3px; font-size: 9.5px; font-weight: 700; color: #8a6100; background: #fff1c2; padding: 1px 6px; border-radius: 999px; margin-left: 3px; vertical-align: 1px; white-space: nowrap; }
.pomv-top i { font-size: 8.5px; color: #e0a400; }
.pomv-rating { flex: 0 0 auto; min-width: 36px; text-align: center; font-size: 12px; font-weight: 700; color: #fff; border-radius: 8px; padding: 4px 6px; background: #8a93a0; font-variant-numeric: tabular-nums; }
.pomv-rating.r-great { background: #16a34a; }
.pomv-rating.r-good { background: #0EA5E9; }
.pomv-rating.r-ok { background: #f2a900; }
.pomv-rating.r-low { background: #e5484d; }
.pomv-tick { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #cfd6df; display: flex; align-items: center; justify-content: center; color: transparent; font-size: 11px; }
.pomv-card.picked .pomv-tick { background: #0EA5E9; border-color: #0EA5E9; color: #fff; }

/* Sticky confirm bar */
.pomv-bar-sticky { position: sticky; bottom: 0; z-index: 3; margin: 0 -2px; padding-top: 6px; background: linear-gradient(to top, #fff 75%, rgba(255, 255, 255, 0)); }
.pomv-confirm {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px;
  padding: 10px 12px; border-radius: 14px; background: #0b2a43; color: #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.pomv-confirm.hint { display: block; text-align: center; background: #eef2f6; color: #5b6677; box-shadow: none; font-size: 12.5px; font-weight: 700; }
.pomv-confirm-text { display: flex; flex-direction: column; min-width: 0; }
.pomv-confirm-text span { font-size: 10.5px; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.4px; }
.pomv-confirm-text strong { font-size: 14px; overflow-wrap: anywhere; line-height: 1.2; }
.pomv-submit {
  display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: 10px; background: #22c55e; color: #fff;
  font-size: 13px; font-weight: 700; padding: 11px 14px; cursor: pointer; white-space: nowrap; touch-action: manipulation;
}
.pomv-submit:disabled { background: #7b8794; cursor: default; }
.pomv-confirm-note { grid-column: 1 / -1; font-size: 11px; opacity: 0.75; }

@media (max-width: 360px) {
  .pomv-hero { padding: 12px; gap: 10px; }
  .pomv-hero-icon { width: 38px; height: 38px; font-size: 19px; }
  .pomv-hero-title { font-size: 15px; }
  .pomv-card { padding: 8px; gap: 8px; }
  .pomv-photo { width: 36px; height: 36px; }
  .pomv-leader-pct { font-size: 24px; }
  .pomv-share span { display: none; }
  .pomv-submit { padding: 10px 12px; font-size: 12.5px; }
}

/* Countries list (drop-down leagues per country) */
.countries-title { margin-top: 32px; }
.country-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.country-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #222;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.country-btn:hover { background: rgba(0, 0, 0, 0.05); }
.country-btn:focus-visible { outline: 2px solid var(--site-blue); outline-offset: -2px; }
.country-item.is-open > .country-btn { background: rgba(0, 0, 0, 0.06); font-weight: 600; }
.country-flag { flex-shrink: 0; width: 22px; height: 16px; display: inline-flex; align-items: center; justify-content: center; }
.country-flag img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 2px; }
.country-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.country-chev { font-size: 11px; color: #666; transition: transform 0.2s ease; }
.country-item.is-open .country-chev { transform: rotate(180deg); }
.country-leagues { list-style: none; margin: 2px 0 6px 14px; padding: 0 0 0 8px; border-left: 2px solid #e3e6ea; }
.country-leagues[hidden] { display: none; }
.country-league { font-size: 13px; }
.country-msg { padding: 8px; font-size: 13px; color: #666; }
.country-retry { border: 0; background: none; padding: 0; font: inherit; color: var(--site-blue); text-decoration: underline; cursor: pointer; }
.country-item[hidden] { display: none; }
.country-more { margin-top: 4px; }
.country-more-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  color: #222;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.country-more-btn:hover { background: rgba(0, 0, 0, 0.09); }
.country-more-btn:focus-visible { outline: 2px solid var(--site-blue); outline-offset: -2px; }
.country-more-btn i { font-size: 11px; transition: transform 0.2s ease; }
.country-more-btn.is-open i { transform: rotate(180deg); }

/* ---------- Mobile search: header icon + full-screen popup ---------- */
.header-search-btn { display: none; }
.msearch-close { display: none; }
.msearch-defaults { display: none; } /* only shown inside the mobile popup */

@media (max-width: 640px) {
  .header-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: auto;
    margin-right: 16px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    font-size: 17px;
  }
  .header-search-btn:active { background: rgba(255, 255, 255, 0.1); }

  /* the bar itself is hidden until the icon is pressed */
  .search-box { display: none; }

  .search-box.is-popup {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: center;
    gap: 0 10px;
    position: fixed;
    inset: 0;
    z-index: 300;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: 12px 14px;
    border: 0;
    border-radius: 0;
    background: #fff;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.search-open { overflow: hidden; }

  .search-box.is-popup > i#search { order: 1; font-size: 15px; color: #6b7686; }
  .search-box.is-popup > input {
    order: 2;
    flex: 1 1 0;
    min-width: 0;
    padding: 12px 14px;
    background: #f1f4f8;
    border-radius: 12px;
  }
  .search-box.is-popup > .msearch-close {
    order: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #222;
    font-size: 18px;
  }
  /* live results flow under the input instead of floating */
  .search-box.is-popup > .search-suggest {
    order: 4;
    position: static;
    flex: 0 0 100%;
    width: 100%;
    max-height: none;
    margin-top: 10px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }
  .search-box.is-popup > .msearch-defaults:not([hidden]) { display: block; order: 5; flex: 0 0 100%; width: 100%; margin-top: 12px; }

  .msearch-heading {
    margin: 14px 0 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7686;
  }
  .msearch-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .msearch-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 6px 10px;
    border-radius: 10px;
    background: #f6f8fb;
    color: #222;
    font-size: 13px;
    font-weight: 600;
    min-width: 0;
  }
  .msearch-item:active { background: #e8eef6; }
  .msearch-img { width: 26px; height: 26px; flex: 0 0 auto; object-fit: contain; }
  .msearch-img.round { border-radius: 50%; object-fit: cover; background: #e6eaf0; }
  .msearch-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #0EA5E9;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
  }
  .msearch-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Mobile: a little more height for the header and the blue sport bar */
@media (max-width: 640px) {
  :root { --header-h: 72px; }
  .container { padding-top: 16px; padding-bottom: 16px; }
}
