/* Modern tip match lists — navy/yellow aligned with nav-modern */
.matches-table--modern{
  --ml-navy:#000040;
  --ml-yellow:#ffcc00;
  --ml-accent:#bb2000;
  --ml-border:#e2e8f0;
  --ml-muted:#64748b;
  --ml-text:#0f172a;
  --ml-row:#ffffff;
  --ml-row-alt:#f8fafc;
  width:100%;
  max-width:100%;
  border-collapse:separate;
  border-spacing:0 8px;
  margin:0;
  table-layout:auto;
  overflow:visible !important;
  background:transparent !important;
}
.matches-table--modern thead{
  display:none;
}
.matches-table--modern tbody tr.ml-row{
  background:var(--ml-row);
  box-shadow:0 1px 0 rgba(15,23,42,.04);
}
.matches-table--modern tbody tr.ml-row:nth-child(even){
  background:var(--ml-row-alt);
}
.matches-table--modern.table-hover>tbody>tr.ml-row:hover{
  background:#fffbeb !important;
}
.matches-table--modern.table-hover>tbody>tr.ml-row:hover *{
  color:inherit !important;
}
.matches-table--modern.table-hover>tbody>tr.ml-row:hover .ml-tip-pill,
.matches-table--modern.table-hover>tbody>tr.ml-row:hover .ml-tip > span.border-radius,
.matches-table--modern.table-hover>tbody>tr.ml-row:hover .ml-score .score-pill{
  background:var(--ml-yellow);
  border-color:#e6b800;
  color:var(--ml-navy);
}
.matches-table--modern.table-hover>tbody>tr.ml-row:hover .ml-teams-td span,
.matches-table--modern.table-hover>tbody>tr.ml-row:hover .match-list-team-name,
.matches-table--modern.table-hover>tbody>tr.ml-row:hover .match-list-team,
.matches-table--modern.table-hover>tbody>tr.ml-row:hover .match-list-team-logo-wrap{
  background:transparent !important;
  border:none !important;
  color:inherit !important;
}

/* ========== Desktop: tip under teams ========== */
@media (min-width:992px){
  .matches-table--modern{
    display:block;
    width:100%;
    border-spacing:0;
  }
  .matches-table--modern > tbody{
    display:block;
    width:100%;
  }
  .matches-table--modern tr.ml-row{
    display:grid !important;
    grid-template-columns:minmax(110px,18%) 52px minmax(0,1fr) 56px;
    grid-template-areas:
      "league time teams score"
      "league time tip score";
    column-gap:12px;
    row-gap:6px;
    align-items:center;
    width:100%;
    box-sizing:border-box;
    margin:0 0 8px;
    padding:10px 14px;
    border:1px solid var(--ml-border);
    border-radius:10px;
    background:var(--ml-row);
  }
  .matches-table--modern tbody tr.ml-row:nth-child(even){
    background:var(--ml-row-alt);
  }
  .matches-table--modern tr.ml-row > th,
  .matches-table--modern tr.ml-row > td{
    display:block !important;
    width:auto !important;
    max-width:none !important;
    min-width:0 !important;
    border:none !important;
    border-radius:0 !important;
    padding:0 !important;
    margin:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    vertical-align:middle;
    font-size:13px !important;
    color:var(--ml-text);
  }
  .matches-table--modern tr.ml-row > .ml-league{
    grid-area:league;
    align-self:center;
    font-weight:700;
    font-size:11px !important;
    color:var(--ml-navy);
    white-space:normal;
    overflow:visible;
    text-overflow:clip;
    line-height:1.3;
    word-break:break-word;
  }
  .matches-table--modern tr.ml-row > .ml-time{
    grid-area:time;
    align-self:center;
    text-align:center;
    white-space:nowrap;
    font-variant-numeric:tabular-nums;
    font-weight:700;
    color:var(--ml-muted);
  }
  .matches-table--modern tr.ml-row > .ml-teams-td{
    grid-area:teams;
    min-width:0;
    width:100% !important;
  }
  .matches-table--modern tr.ml-row > .ml-tip{
    grid-area:tip;
    justify-self:center;
    width:auto !important;
    max-width:90%;
    text-align:center;
  }
  .matches-table--modern tr.ml-row > .ml-score{
    grid-area:score;
    align-self:center;
    justify-self:center;
    text-align:center;
    white-space:nowrap;
    overflow:visible !important;
  }
  .matches-table--modern .ml-tip > span.border-radius,
  .matches-table--modern .ml-tip > .ml-tip-pill{
    border:1px solid var(--ml-border);
    background:#fff;
    padding:4px 8px !important;
    display:inline-block !important;
    border-radius:6px !important;
    font-weight:800 !important;
    font-size:11px !important;
    line-height:1.25 !important;
    color:var(--ml-navy);
    max-width:100%;
    width:auto;
    text-align:center;
    white-space:normal !important;
    word-break:break-word;
  }
  .matches-table--modern .ml-score > span.border-radius,
  .matches-table--modern .ml-score > .score-pill,
  .matches-table--modern .ml-score > .live-score-slot,
  .matches-table--modern .ml-score .score-pill,
  .matches-table--modern .ml-score .live-score-slot{
    border:1px solid var(--ml-border);
    background:#fff;
    padding:3px 5px !important;
    display:inline-block !important;
    border-radius:6px !important;
    font-weight:800 !important;
    font-size:11px !important;
    line-height:1.2 !important;
    color:var(--ml-navy);
    min-width:34px;
    text-align:center;
    white-space:nowrap;
    visibility:visible !important;
  }
  .matches-table--modern .score-pill--empty{
    min-height:20px;
    min-width:34px;
    border-style:dashed !important;
    background:transparent !important;
  }
  .matches-table--modern .match-list-team-name{
    white-space:nowrap !important;
    overflow:hidden;
    text-overflow:ellipsis;
    font-size:12px !important;
  }
}

/* Team logos — never inherit legacy span boxes */
.matches-table--modern .ml-teams-td span,
.matches-table--modern .match-list-teams-link span,
.matches-table--modern .match-teams-cell span,
.matches-table--modern .match-list-team-logo-wrap,
.matches-table--modern .match-list-team,
.matches-table--modern .match-list-team-name,
.matches-table--modern .match-list-form-row{
  border:none !important;
  background:transparent !important;
  padding:0 !important;
  box-shadow:none !important;
  min-width:0;
  border-radius:0 !important;
}
.match-list-teams-link{
  display:block;
  text-decoration:none !important;
  color:inherit;
  border:none !important;
  background:transparent !important;
  padding:0 !important;
  max-width:100%;
}
.match-list-teams-link:hover .match-list-team-name{
  color:var(--ml-accent);
}
.match-teams-cell,
.match-teams-cell--stacked,
.match-teams-cell--row{
  display:flex;
  flex-direction:row;
  flex-wrap:nowrap;
  align-items:center;
  gap:12px;
  min-width:0;
  max-width:100%;
  border:none !important;
  background:transparent !important;
  padding:0 !important;
  box-shadow:none !important;
}
.match-teams-side{
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:10px;
  min-width:0;
  flex:1 1 0;
  justify-content:flex-start;
  text-align:left;
}
.match-teams-side--home,
.match-teams-side--away{
  justify-content:flex-start;
  text-align:left;
}
.match-teams-side--home .match-list-team,
.match-teams-side--away .match-list-team{
  align-items:flex-start;
}
/* Keep logo on the left of the name */
.match-teams-side .match-list-team-logo-wrap{
  order:0;
}
.match-teams-side .match-list-team{
  order:1;
}
.match-list-vs{
  flex:0 0 auto;
  display:inline-block !important;
  padding:0 4px !important;
  border:none !important;
  background:transparent !important;
  color:var(--ml-muted) !important;
  font-size:12px !important;
  font-weight:800 !important;
  text-transform:uppercase;
  letter-spacing:.04em;
  line-height:1;
}
.match-list-team-logo-wrap{
  flex:0 0 40px;
  width:40px;
  height:40px;
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
}
.match-list-team-logo{
  width:40px;
  height:40px;
  object-fit:contain;
  display:block;
  border-radius:50%;
  background:transparent;
  box-shadow:none;
  border:none;
}
.match-list-team{
  display:flex !important;
  flex-direction:column;
  gap:2px;
  min-width:0;
  flex:1 1 auto;
}
.match-list-team-name{
  display:block !important;
  font-weight:700 !important;
  font-size:12px !important;
  line-height:1.25 !important;
  color:var(--ml-text) !important;
  white-space:nowrap !important;
  overflow:hidden;
  text-overflow:ellipsis;
  word-break:normal;
  text-transform:none !important;
  font-style:normal !important;
}
.match-list-form-row{
  display:flex;
  gap:2px;
}
.match-list-form-pill{
  width:14px;
  height:14px;
  border-radius:3px;
  font-size:9px !important;
  font-weight:800;
  line-height:14px;
  text-align:center;
  color:#fff !important;
}
.match-list-form-win{background:#16a34a !important;}
.match-list-form-draw{background:#94a3b8 !important;}
.match-list-form-loss{background:#dc2626 !important;}

/* Wrappers must not clip card rows */
.ml-list-wrap{
  overflow:visible !important;
  height:auto !important;
  max-height:none !important;
  width:100%;
  max-width:100%;
}

/* ========== Mobile / narrow: card grid ========== */
@media (max-width:991px){
  .ml-list-wrap{
    overflow:visible !important;
    height:auto !important;
    max-height:none !important;
  }

  .matches-table--modern{
    display:block;
    width:100%;
    border-spacing:0;
    overflow:visible !important;
  }
  .matches-table--modern > thead{
    display:none;
  }
  .matches-table--modern > tbody{
    display:block;
    width:100%;
  }

  .matches-table--modern tr.ml-row{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
    grid-template-areas:
      "league league time"
      "teams teams teams"
      "score tip .";
    column-gap:8px;
    row-gap:8px;
    align-items:center;
    width:100%;
    box-sizing:border-box;
    margin:0 0 10px;
    padding:12px;
    border:1px solid var(--ml-border) !important;
    border-radius:12px !important;
    background:#fff !important;
    box-shadow:0 2px 10px rgba(15,23,42,.06);
  }
  .matches-table--modern tr.ml-row:nth-child(even){
    background:#fff !important;
  }
  .matches-table--modern.table-hover>tbody>tr.ml-row:hover{
    background:#fffbeb !important;
  }

  .matches-table--modern tr.ml-row > th,
  .matches-table--modern tr.ml-row > td{
    display:block !important;
    width:auto !important;
    max-width:none !important;
    min-width:0 !important;
    border:none !important;
    border-radius:0 !important;
    padding:0 !important;
    margin:0 !important;
    white-space:normal !important;
    overflow:visible !important;
    text-overflow:clip !important;
    background:transparent !important;
    box-shadow:none !important;
    vertical-align:middle;
  }

  .matches-table--modern tr.ml-row > .ml-league{
    grid-area:league;
    font-size:11px !important;
    font-weight:800 !important;
    color:var(--ml-navy) !important;
    line-height:1.3;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
  }
  .matches-table--modern tr.ml-row > .ml-time{
    grid-area:time;
    justify-self:end;
    text-align:right;
    font-size:12px !important;
    font-weight:800 !important;
    color:var(--ml-muted) !important;
    white-space:nowrap !important;
  }
  .matches-table--modern tr.ml-row > .ml-teams-td{
    grid-area:teams;
    width:100% !important;
    min-width:0 !important;
    padding:2px 0 !important;
  }
  .matches-table--modern tr.ml-row > .ml-tip{
    grid-area:tip;
    justify-self:center;
    text-align:center;
    width:auto !important;
    min-width:0 !important;
    max-width:100% !important;
  }
  .matches-table--modern tr.ml-row > .ml-score{
    grid-area:score;
    justify-self:start;
    align-self:center;
    text-align:left;
    width:auto !important;
    min-width:0 !important;
    max-width:none !important;
    overflow:visible !important;
  }

  .matches-table--modern .match-list-team-name{
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    font-size:14px !important;
    font-weight:800 !important;
    word-break:normal;
    display:block !important;
    line-height:1.3 !important;
  }
  .matches-table--modern .match-list-team-logo,
  .matches-table--modern .match-list-team-logo-wrap{
    width:44px;
    height:44px;
    flex:0 0 44px;
  }
  .matches-table--modern .match-teams-cell--row,
  .matches-table--modern .match-teams-cell--stacked{
    gap:10px;
  }
  .matches-table--modern .match-teams-side{
    gap:10px;
  }
  .matches-table--modern .match-list-vs{
    font-size:12px !important;
  }
  .matches-table--modern .ml-tip > span.border-radius,
  .matches-table--modern .ml-tip > .ml-tip-pill{
    display:inline-block !important;
    width:auto;
    max-width:100%;
    min-width:0;
    white-space:normal !important;
    word-break:break-word;
    padding:4px 6px !important;
    font-size:11px !important;
    font-weight:800 !important;
    text-align:center;
    border:none !important;
    background:transparent !important;
    box-shadow:none !important;
    border-radius:0 !important;
  }
  .matches-table--modern.table-hover>tbody>tr.ml-row:hover .ml-tip-pill,
  .matches-table--modern.table-hover>tbody>tr.ml-row:hover .ml-tip > span.border-radius{
    border:none !important;
    background:transparent !important;
  }
  .matches-table--modern .ml-score > span.border-radius,
  .matches-table--modern .ml-score > .score-pill,
  .matches-table--modern .ml-score > .live-score-slot,
  .matches-table--modern .ml-score .score-pill,
  .matches-table--modern .ml-score .live-score-slot{
    min-width:32px;
    padding:3px 6px !important;
    font-size:11px !important;
    white-space:nowrap;
  }
}

@media (max-width:420px){
  .matches-table--modern tr.ml-row{
    padding:10px;
    row-gap:6px;
  }
  .matches-table--modern .match-list-team-name{
    font-size:13px !important;
  }
  .matches-table--modern .match-list-team-logo,
  .matches-table--modern .match-list-team-logo-wrap{
    width:40px;
    height:40px;
    flex:0 0 40px;
  }
}
