/*
 * Community squads (resources/views/pages/builder/squads.php). Head, toolbar and menus come from teams-page.css (.tp);
 * this is the toolbar row, the squad rows (desktop: columns, phones: cards) and the pages.
 */
.sq-new {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--tp-ink) !important;
  background: var(--tp-accent);
  border-radius: 10px;
}
.sq-new:hover {
  filter: brightness(1.08);
}

/* toolbar: formation, OVR, clear on the left; sort on the right */
.sq-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.sq-sort {
  margin-left: auto;
}
.tp .pl-btn.on {
  border-color: rgba(92, 248, 219, 0.55);
}
.sq-clear {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tp-fg-3) !important;
}
.sq-clear:hover {
  color: #fff !important;
}
.tp .sq-pop-grid {
  display: none;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 2px;
  min-width: 300px;
  max-height: min(420px, 70vh);
}
.tp .pl-menu.open .sq-pop-grid {
  display: grid;
}
.tp .sq-pop-grid .pl-opt:first-child {
  grid-column: 1 / -1;
}

/* the list */
.sq-list {
  display: grid;
  gap: 6px;
}
.sq-row {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) 58px 86px 76px minmax(0, 1.5fr) minmax(0, 1.5fr) minmax(0, 1.2fr) 92px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #fff !important;
  background: var(--tp-glass);
  border: 1px solid var(--tp-line);
  border-radius: 12px;
  transition: border-color 0.15s, background 0.15s;
}
a.sq-row:hover,
a.sq-row:focus-visible {
  background: rgba(92, 248, 219, 0.06);
  border-color: rgba(92, 248, 219, 0.4);
  outline: none;
}
.sq-row-head {
  padding-top: 0;
  padding-bottom: 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tp-fg-3);
  background: none;
  border: 0;
}
.sq-name {
  display: grid;
  min-width: 0;
}
.sq-name b {
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sq-form {
  font-size: 12px;
  color: var(--tp-accent);
}
.sq-ovr {
  justify-self: start;
  min-width: 40px;
  padding: 3px 8px;
  font-family: var(--tp-display);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}
.sq-ovr.t-green { color: #3ac842; }
.sq-ovr.t-lgreen { color: #8eae4e; }
.sq-ovr.t-yellow { color: #e3c30b; }
.sq-ovr.t-red { color: #ff6b81; }
.sq-num {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--tp-fg-2);
}
.sq-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  color: var(--tp-fg-2);
}
.sq-top img {
  flex: none;
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.sq-top img.sq-flag {
  width: 22px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
}
.sq-top-name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sq-date {
  font-size: 12.5px;
  white-space: nowrap;
  color: var(--tp-fg-3);
}
.sq-empty {
  margin: 0;
  padding: 40px 12px;
  text-align: center;
  color: var(--tp-fg-3);
}

/* pages */
.sq-pages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 13px;
  color: var(--tp-fg-3);
}
.sq-pages .pl-btn {
  text-decoration: none;
}

/* smaller screens: drop the date, then cards */
@media (max-width: 1199.98px) {
  .sq-row {
    grid-template-columns: minmax(0, 2fr) 54px 80px 70px minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 1.1fr);
  }
  .sq-row > :nth-child(8) {
    display: none;
  }
}
@media (max-width: 767.98px) {
  .sq-row-head {
    display: none;
  }
  /* card: name + OVR on top, value / wage, then team, league, nation */
  .sq-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name ovr"
      "money money"
      "team team"
      "league league"
      "nation nation";
    gap: 8px 10px;
    padding: 12px;
  }
  .sq-name { grid-area: name; }
  .sq-ovr { grid-area: ovr; justify-self: end; }
  .sq-row > .sq-num:nth-child(3) { grid-area: money; }
  .sq-row > .sq-num:nth-child(4) {
    grid-area: money;
    justify-self: end;
  }
  .sq-row > .sq-top:nth-child(5) { grid-area: team; }
  .sq-row > .sq-top:nth-child(6) { grid-area: league; }
  .sq-row > .sq-top:nth-child(7) { grid-area: nation; }
  .sq-num {
    display: flex;
    align-items: center;
  }
  .sq-num::before,
  .sq-top::before {
    content: attr(data-label);
    flex: none;
    width: 52px;
    margin-right: 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tp-fg-3);
  }
  .sq-tools .pl-menu,
  .sq-sort {
    flex: 1 1 auto;
  }
  .sq-sort {
    margin-left: 0;
  }
  .tp .sq-pop-grid {
    min-width: min(300px, calc(100vw - 48px));
  }
}
