/* =========================================================
   FPL Live Scores - Compact mobile standings rows (NO scroll)
   ========================================================= */

.fpl-ls{ width:100%; padding:14px 12px; }
.fpl-ls *{ box-sizing:border-box; }

.fpl-ls-card{
  background:#fff;
  border:1px solid rgba(15,23,42,.10);
  border-radius:18px;
  box-shadow:0 18px 55px rgba(0,0,0,.10);
  overflow:hidden;
}

.fpl-ls-head{
  padding:16px 16px 12px;
  border-bottom:1px solid rgba(15,23,42,.08);
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  justify-content:space-between;
  align-items:flex-end;
}

.fpl-ls-title{ font-size:18px; font-weight:1000; color:#0f172a; }
.fpl-ls-sub{ font-size:13px; font-weight:700; color:rgba(15,23,42,.65); margin-top:4px; }

.fpl-ls-controls{
  display:flex;
  gap:10px;
  align-items:flex-end;
  flex-wrap:wrap;
}

.fpl-ls-field label{
  display:block;
  font-size:12px;
  font-weight:900;
  color:rgba(15,23,42,.70);
  margin-bottom:6px;
}

.fpl-ls-field input,
.fpl-ls select{
  height:40px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,.12);
  padding:0 12px;
  font-size:14px;
  font-weight:800;
  background:#fff;
  color:#0f172a;
  outline:none;
}

.fpl-ls-field input{ width:160px; }

.fpl-ls-btn{
  height:40px;
  border-radius:12px;
  border:0;
  padding:0 14px;
  font-weight:1000;
  background:#4f46e5;
  color:#fff;
  cursor:pointer;
  box-shadow:0 10px 25px rgba(79,70,229,.25);
}

.fpl-ls-body{ padding:14px 16px 18px; }

#fplLsStatus{
  margin:6px 0 12px;
  font-weight:900;
  color:rgba(15,23,42,.70);
}

.fpl-ls-leaguewrap label{
  display:block;
  font-size:12px;
  font-weight:900;
  color:rgba(15,23,42,.70);
  margin:10px 0 6px;
}

.fpl-ls-pillbar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:10px 0 12px;
}
.fpl-ls-pill{
  border:1px solid rgba(15,23,42,.12);
  background:#fff;
  border-radius:999px;
  padding:7px 11px;
  font-size:12px;
  font-weight:1000;
  cursor:pointer;
  color:#0f172a;
}
.fpl-ls-pill.active{
  background:#0f172a;
  color:#fff;
  border-color:#0f172a;
}

/* =========================
   Table base (desktop)
   ========================= */
.fpl-ls-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  border:1px solid rgba(15,23,42,.10);
  border-radius:14px;
  overflow:hidden;
  background:#fff;
}

.fpl-ls-table thead th{
  text-align:left;
  font-size:12px;
  font-weight:1000;
  color:rgba(15,23,42,.70);
  background:#f8fafc;
  border-bottom:1px solid rgba(15,23,42,.08);
  padding:12px 12px;
  white-space:nowrap;
}

.fpl-ls-table tbody td{
  padding:12px 12px;
  border-bottom:1px solid rgba(15,23,42,.06);
  font-size:14px;
  font-weight:800;
  color:#0f172a;
  vertical-align:top;
}

.fpl-ls-table tbody tr:last-child td{ border-bottom:0; }

.fpl-ls-link{
  color:#2563eb;
  font-weight:1000;
  cursor:pointer;
  text-decoration:none;
}
.fpl-ls-link:hover{ text-decoration:underline; }

.fpl-ls-muted{
  color:rgba(15,23,42,.55);
  font-weight:800;
  font-size:12px;
  margin-top:4px;
}

.fpl-ls-livepill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(99,102,241,.25);
  background:#eef2ff;
  color:#1e1b4b;
  font-weight:1100;
  font-size:12px;
  white-space:nowrap;
}

/* =========================================================
   MOBILE: no scroll, LIVE moved to 2nd line
   ========================================================= */
@media (max-width: 820px){

  /* Controls stack */
  .fpl-ls-field input{ width:100%; }
  .fpl-ls-controls{ width:100%; }
  .fpl-ls-controls > *{ flex:1 1 100%; }

  .fpl-ls-body{ padding:12px 12px 16px; }

  /* Table becomes list */
  .fpl-ls-table{
    border-radius:16px;
    overflow:hidden;
  }
  .fpl-ls-table thead{ display:none; }

  .fpl-ls-table tbody tr{
    display:grid;
    grid-template-columns: 44px 1fr;
    grid-template-areas:
      "rank name"
      "rank sub";
    gap:4px 10px;
    padding:10px 12px;
    border-bottom:1px solid rgba(15,23,42,.08);
    align-items:start;
  }
  .fpl-ls-table tbody tr:last-child{ border-bottom:0; }

  .fpl-ls-table tbody td{
    border-bottom:0 !important;
    padding:0 !important;
  }

  /* 1 Rank */
  .fpl-ls-table tbody td:nth-child(1){
    grid-area:rank;
    font-size:12px;
    font-weight:1100;
    color:rgba(15,23,42,.70);
    padding-top:2px !important;
  }

  /* 2 Manager / Team cell */
  .fpl-ls-table tbody td:nth-child(2){
    grid-area:name;
    min-width:0;
  }

  /* 3 Live => we HIDE original column and show it inside subline */
  .fpl-ls-table tbody td:nth-child(3){
    display:none;
  }

  /* 4 Official GW => hide on mobile */
  .fpl-ls-table tbody td:nth-child(4){
    display:none;
  }

  /* 5 Total => hide original column and show it inside subline */
  .fpl-ls-table tbody td:nth-child(5){
    display:none;
  }

  .fpl-ls-link{
    display:block;
    font-size:13px;
    line-height:1.15;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  /* Build a compact 2nd line with: Team/Entry | Live | Total
     We "reuse" the existing .fpl-ls-muted line, but turn it into a flex row.
  */
  .fpl-ls-muted{
    margin-top:3px;
    font-size:11px;
    line-height:1.15;
    display:flex;
    gap:8px;
    align-items:center;
    justify-content:space-between;
    flex-wrap:nowrap;
  }

  .fpl-ls-muted .left{
    min-width:0;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .fpl-ls-muted .right{
    display:flex;
    gap:6px;
    align-items:center;
    flex:0 0 auto;
  }

  /* Smaller live pill */
  .fpl-ls-livepill{
    padding:4px 7px;
    font-size:11px;
    font-weight:1200;
  }

  .fpl-ls-totalpill{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:4px 7px;
    border-radius:999px;
    border:1px solid rgba(15,23,42,.10);
    background:#f8fafc;
    color:#0f172a;
    font-weight:1100;
    font-size:11px;
    white-space:nowrap;
  }
}

/* Modal (basic) */
.fpl-ls-modal{ display:none; position:fixed; inset:0; z-index:999999; }
.fpl-ls-modal.open{ display:block; }
.fpl-ls-modal-backdrop{ position:absolute; inset:0; background:rgba(2,6,23,.55); backdrop-filter: blur(6px); }
.fpl-ls-modal-panel{
  position:relative;
  width:min(820px, calc(100% - 22px));
  max-height: calc(100% - 28px);
  margin:14px auto;
  background:#fff;
  border-radius:18px;
  overflow:hidden;
  box-shadow:0 30px 90px rgba(0,0,0,.40);
  display:flex;
  flex-direction:column;
}
.fpl-ls-modal-head{
  padding:14px 16px;
  border-bottom:1px solid rgba(15,23,42,.08);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}
.fpl-ls-modal-title{ font-size:16px; font-weight:1100; color:#0f172a; }
.fpl-ls-modal-sub{ font-size:12px; font-weight:800; color:rgba(15,23,42,.65); margin-top:4px; }
.fpl-ls-x{
  width:36px; height:36px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,.12);
  background:#fff;
  font-size:18px;
  font-weight:1100;
  cursor:pointer;
}
.fpl-ls-modal-body{ padding:14px 16px 18px; overflow:auto; }
