.fb-fantasy-view {
  display: block;
}

.fb-fantasy-toolbar {
  align-items: end;
}

.fb-fantasy-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.fb-fantasy-panel,
.fb-fantasy-xi {
  min-width: 0;
}

.fb-fantasy-table-wrap {
  overflow: auto;
  max-height: 720px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.08);
}

.fb-fantasy-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}

.fb-fantasy-table th,
.fb-fantasy-table td {
  padding: 11px 8px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  text-align: left;
  vertical-align: middle;
}

.fb-fantasy-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #111827;
  color: rgba(255,255,255,.72);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.fb-fantasy-table td:first-child,
.fb-fantasy-table th:first-child {
  width: 40px;
  text-align: center;
  color: rgba(255,255,255,.55);
}

.fb-fantasy-table th:nth-child(2),
.fb-fantasy-table td:nth-child(2) {
  width: 25%;
}

.fb-fantasy-table th:nth-child(3),
.fb-fantasy-table td:nth-child(3) {
  width: 70px;
}

.fb-fantasy-table th:nth-child(4),
.fb-fantasy-table td:nth-child(4) {
  width: 20%;
}

.fb-fantasy-table th:nth-child(5),
.fb-fantasy-table td:nth-child(5) {
  width: 120px;
}

.fb-fantasy-table th:nth-child(6),
.fb-fantasy-table td:nth-child(6),
.fb-fantasy-table th:nth-child(7),
.fb-fantasy-table td:nth-child(7) {
  width: 76px;
}

.fb-fantasy-table th:nth-child(8),
.fb-fantasy-table td:nth-child(8) {
  width: 96px;
}

.fb-fantasy-table strong {
  display: block;
  color: #fff;
}

.fb-fantasy-table td:nth-child(2) strong,
.fb-fantasy-table td:nth-child(4) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fb-fantasy-table small {
  display: block;
  margin-top: 3px;
  color: rgba(255,255,255,.5);
}

.fb-fantasy-pos {
  display: inline-flex;
  min-width: 44px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 800;
  background: rgba(255,255,255,.08);
  color: #fff;
}

.fb-fantasy-pos.gk { background: rgba(250,204,21,.16); color: #fde68a; }
.fb-fantasy-pos.def { background: rgba(34,197,94,.16); color: #86efac; }
.fb-fantasy-pos.mid { background: rgba(59,130,246,.18); color: #93c5fd; }
.fb-fantasy-pos.fwd { background: rgba(249,115,22,.18); color: #fdba74; }
.fb-fantasy-pos.unk { color: rgba(255,255,255,.68); }

.fb-fantasy-spark {
  display: inline-flex;
  align-items: end;
  gap: 4px;
  width: 76px;
  height: 46px;
}

.fb-fantasy-spark i {
  display: block;
  width: 9px;
  min-height: 10px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #41bdd9, #ff6b35);
}

.fb-fantasy-spark.empty {
  background: rgba(255,255,255,.06);
  border-radius: 6px;
}

.fb-fantasy-table .is-good {
  color: #86efac;
  font-weight: 800;
}

.fb-fantasy-table .is-bad {
  color: #fca5a5;
  font-weight: 800;
}

.fb-fantasy-table td:last-child b {
  display: inline-flex;
  min-width: 58px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: #fff;
  background: rgba(255,107,53,.18);
  border: 1px solid rgba(255,107,53,.35);
}

.fb-fantasy-xi #fantasyXiTotal {
  display: inline-flex;
  min-width: 70px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(65,189,217,.16);
  color: #fff;
}

.fb-fantasy-xi-line {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.fb-fantasy-xi-line > span {
  color: rgba(255,255,255,.55);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.fb-fantasy-xi-player {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.07);
}

.fb-fantasy-xi-player strong {
  display: block;
  color: #fff;
  line-height: 1.18;
}

.fb-fantasy-xi-player small {
  display: block;
  margin-top: 4px;
  color: rgba(255,255,255,.56);
}

@media (max-width: 1100px) {
  .fb-fantasy-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .fb-fantasy-table-wrap {
    max-height: none;
    overflow-x: hidden;
  }

  .fb-fantasy-table,
  .fb-fantasy-table tbody,
  .fb-fantasy-table tr,
  .fb-fantasy-table td {
    display: block;
    width: 100%;
  }

  .fb-fantasy-table {
    table-layout: auto;
    min-width: 0;
  }

  .fb-fantasy-table thead {
    display: none;
  }

  .fb-fantasy-table tr {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 54px 70px;
    grid-template-areas:
      "rank player pos pred"
      "rank team pos pred"
      "spark spark avg trend";
    gap: 4px 8px;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255,255,255,.09);
  }

  .fb-fantasy-table td {
    padding: 0;
    border-bottom: 0;
    min-width: 0;
  }

  .fb-fantasy-table td:first-child {
    grid-area: rank;
    align-self: center;
    width: auto;
    text-align: center;
    font-size: 15px;
  }

  .fb-fantasy-table td:nth-child(2) {
    grid-area: player;
  }

  .fb-fantasy-table td:nth-child(2) strong {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    line-height: 1.15;
    font-size: 15px;
  }

  .fb-fantasy-table td:nth-child(2) small {
    display: none;
  }

  .fb-fantasy-table td:nth-child(3) {
    grid-area: pos;
    align-self: center;
  }

  .fb-fantasy-table td:nth-child(4) {
    grid-area: team;
    width: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(255,255,255,.58);
    font-size: 12px;
  }

  .fb-fantasy-table td:nth-child(5) {
    grid-area: spark;
    width: auto;
    align-self: end;
  }

  .fb-fantasy-table td:nth-child(6) {
    grid-area: avg;
    width: auto;
    align-self: center;
    text-align: right;
    font-size: 14px;
  }

  .fb-fantasy-table td:nth-child(7) {
    grid-area: trend;
    width: auto;
    align-self: center;
    text-align: right;
    font-size: 14px;
  }

  .fb-fantasy-table td:nth-child(8) {
    grid-area: pred;
    width: auto;
    align-self: center;
    text-align: right;
  }

  .fb-fantasy-pos {
    min-width: 48px;
  }

  .fb-fantasy-spark {
    width: 74px;
    height: 38px;
  }

  .fb-fantasy-spark i {
    width: 9px;
  }

  .fb-fantasy-table td:last-child b {
    min-width: 58px;
    height: 32px;
    font-size: 14px;
  }
}
