/* Compare page (resources/views/pages/player/compare.php): player search, then one table with a column per player
   (+ "add" column), a sticky label column and sections. Same tokens and type scale as the player page
   (player-page.css). Page bar: page-bar.css. Plain CSS served as-is (not part of the gulp site.min.css bundle). */

.cp {
  --cp-glass: linear-gradient(160deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
  --cp-line: rgba(255, 255, 255, 0.1);
  --cp-row: rgba(255, 255, 255, 0.06);
  --cp-fg-2: rgba(255, 255, 255, 0.78);
  --cp-fg-3: rgba(255, 255, 255, 0.5);
  --cp-accent: #5cf8db;
  --cp-ink: #0b1d1a;
  --cp-display: "DINPro-Cond-Bold", "DINPro-Cond", "Barlow Condensed", "Arial Narrow", sans-serif;
  /* the sticky label column needs an opaque background: the glass over the page's dark blue */
  --cp-solid: #222059;
  --cp-fs-xs: 10px;
  --cp-fs-sm: 12px;
  --cp-fs-md: 13px;
  --cp-fs-lg: 15px;
  --cp-fs-xl: 18px;
  --cp-fs-2xl: 24px;
  --cp-fs-3xl: 40px;
  display: grid;
  gap: 16px;
  padding-top: 16px;
  padding-bottom: 32px;
  color: #fff;
}
.cp > * {
  min-width: 0;
}
.cp a {
  color: inherit;
}
.cp a:hover {
  text-decoration: none;
}
.cp-glass {
  background: var(--cp-glass);
  border: 1px solid var(--cp-line);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}
.cp-label {
  font-size: var(--cp-fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cp-fg-3);
}
.cp-num {
  font-variant-numeric: tabular-nums;
}
.cp-dim {
  color: var(--cp-fg-3);
}
/* same thresholds and colours as Fifa::statColor */
.cp .t-green { --tc: rgb(58, 200, 66); color: var(--tc); }
.cp .t-lgreen { --tc: rgb(142, 174, 78); color: var(--tc); }
.cp .t-yellow { --tc: rgb(187, 170, 7); color: var(--tc); }
.cp .t-red { --tc: rgb(209, 28, 66); color: var(--tc); }

/* search */
.cp-search {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
}
.cp-search-field {
  position: relative;
  flex: 1;
  min-width: 0;
}
.cp-search-field i {
  position: absolute;
  top: 50%;
  left: 14px;
  font-size: var(--cp-fs-md);
  color: var(--cp-fg-3);
  transform: translateY(-50%);
}
.cp-search input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 38px;
  font-size: var(--cp-fs-lg);
  color: #fff;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--cp-line);
  border-radius: 10px;
  outline: none;
}
.cp-search input::placeholder {
  color: var(--cp-fg-3);
}
.cp-search input:focus {
  border-color: var(--cp-accent);
}
.cp-search input:disabled {
  opacity: 0.6;
}
.cp-search-count {
  flex: none;
  font-size: var(--cp-fs-sm);
  color: var(--cp-fg-3);
}
.cp-search-count b {
  color: #fff;
}

/* nothing picked yet */
.cp-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 48px 20px;
  text-align: center;
}
.cp-empty i {
  font-size: var(--cp-fs-3xl);
  color: var(--cp-accent);
}
.cp-empty h2 {
  margin: 0;
  font-family: var(--cp-display);
  font-size: var(--cp-fs-2xl);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.cp-empty p {
  max-width: 520px;
  margin: 0;
  font-size: var(--cp-fs-md);
  color: var(--cp-fg-2);
}

/* Overview / Stats / RPP, same pills as the players list tabs */
.cp-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  background: #1a1a40;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
}
.site-dark-skin .cp-tabs {
  background: #1c1c1c;
}
.cp-tabs::-webkit-scrollbar {
  display: none;
}
.cp-tab {
  flex: 1 1 0;
  padding: 7px 14px;
  font-size: var(--cp-fs-md);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.cp-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}
.cp-tab[aria-selected="true"] {
  color: var(--cp-ink);
  background: var(--cp-accent);
}
.cp-table tbody[hidden] {
  display: none;
}

/* the table: horizontal scroll on narrow screens, label column stays put */
.cp-scroll {
  overflow-x: auto;
  padding: 4px 0 8px;
  /* solid like the sticky label column, so the two read as one surface when the table scrolls sideways */
  background: var(--cp-solid);
}
.cp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}
.cp-table.cp-n1 { min-width: 170px; }
.cp-table.cp-n2 { min-width: 530px; }
.cp-table.cp-n3 { min-width: 710px; }
.cp-table.cp-n4 { min-width: 890px; }
.cp-table.cp-n5 { min-width: 1070px; }
.cp-table th,
.cp-table td {
  padding: 9px 12px;
  vertical-align: middle;
  border-bottom: 1px solid var(--cp-row);
}
.cp-table tbody th,
.cp-corner {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 170px;
  font-size: var(--cp-fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  color: var(--cp-fg-3);
  background: var(--cp-solid);
}
.cp-table td {
  font-size: var(--cp-fs-lg);
  font-weight: 600;
  text-align: center;
  color: #fff;
}
.cp-table small {
  font-size: var(--cp-fs-sm);
  font-weight: 600;
}
.cp-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}
/* best value of the row */
.cp-table td.cp-best {
  background: rgba(92, 248, 219, 0.08);
  box-shadow: inset 0 -2px 0 rgba(92, 248, 219, 0.55);
}
.cp-table tbody tr:hover td.cp-best {
  background: rgba(92, 248, 219, 0.12);
}
.cp-table .cp-addcol {
  border-left: 1px dashed var(--cp-line);
}

/* player heads */
.cp-head {
  position: relative;
  padding: 16px 10px 14px !important;
  text-align: center;
  vertical-align: top !important;
  font-weight: 400;
  text-transform: none;
}
.cp-face {
  display: block;
  width: 84px;
  height: 84px;
  margin: 0 auto 8px;
}
.cp-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 65%, rgba(var(--club), 0.55) 0%, rgba(var(--club), 0.15) 55%, rgba(var(--club), 0) 72%), rgba(0, 0, 0, 0.25);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.cp-name {
  display: block;
  overflow: hidden;
  font-family: var(--cp-display);
  font-size: var(--cp-fs-xl);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-transform: uppercase;
}
.cp-name:hover {
  color: var(--cp-accent) !important;
}
.cp-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  font-size: var(--cp-fs-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--cp-accent);
}
.cp-meta img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.cp-meta img.cp-flag {
  width: 20px;
}
.cp-ratings {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}
.cp-ratings span {
  display: grid;
  justify-items: center;
}
.cp-ratings b {
  font-family: var(--cp-display);
  font-size: var(--cp-fs-2xl);
  font-weight: 800;
  line-height: 1;
}
.cp-ratings small {
  font-size: var(--cp-fs-xs) !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em;
  color: var(--cp-fg-3);
}
.cp-pot,
.cp-ratings .cp-pot b {
  color: var(--cp-accent);
}
.cp-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  font-size: var(--cp-fs-sm);
  color: var(--cp-fg-3) !important;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}
.cp-remove:hover {
  color: var(--cp-ink) !important;
  background: var(--cp-accent);
}
.cp-add {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 100%;
  padding: 18px 0;
  font-size: var(--cp-fs-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cp-fg-3);
  background: none;
  border: 0;
  cursor: pointer;
}
.cp-add i {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  font-size: var(--cp-fs-2xl);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}
.cp-add:hover {
  color: var(--cp-accent);
}
.cp-add:hover i {
  border-color: var(--cp-accent);
}

/* section heads (repeat the players' names) and attribute group rows */
.cp-table tr.cp-sec th,
.cp-table tr.cp-sec td {
  padding-top: 22px;
  border-bottom: 1px solid var(--cp-line);
}
.cp-table tr.cp-sec th {
  font-family: var(--cp-display);
  font-size: var(--cp-fs-xl);
  letter-spacing: 0.06em;
  color: #fff;
}
.cp-table tr.cp-sec td {
  overflow: hidden;
  font-size: var(--cp-fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-transform: uppercase;
  color: var(--cp-fg-3);
}
.cp-table tr.cp-sec:hover td {
  background: none;
}
.cp-table tr.cp-grp th {
  font-size: var(--cp-fs-sm);
  color: #fff;
}
.cp-table tr.cp-grp th small {
  font-size: var(--cp-fs-xs);
  color: var(--cp-fg-3);
}
.cp-table tr.cp-grp td b {
  font-family: var(--cp-display);
  font-size: var(--cp-fs-xl);
}

/* cell contents */
.cp-star {
  font-size: var(--cp-fs-xs);
  color: var(--cp-fg-3);
}
.cp-yes {
  color: var(--cp-accent);
}
.cp-no {
  color: var(--cp-fg-3);
}
.cp-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}
.cp-chip {
  padding: 2px 8px;
  font-size: var(--cp-fs-sm);
  font-weight: 600;
  color: var(--cp-fg-2);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--cp-line);
  border-radius: 999px;
}
.cp-chip-main {
  font-weight: 800;
  color: var(--cp-accent);
  border-color: rgba(92, 248, 219, 0.35);
}
.cp-roles {
  display: grid;
  gap: 4px;
  justify-items: center;
}
.cp-role {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: var(--cp-fs-md);
}
.cp-role-pos {
  font-size: var(--cp-fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--cp-fg-3);
}
.cp-role b {
  font-weight: 800;
  color: var(--cp-accent);
}
.cp-club {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  font-size: var(--cp-fs-md);
}
.cp-club span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cp-club img {
  flex: none;
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.cp-club:hover span {
  color: var(--cp-accent);
}
.cp-ps-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 10px;
}
.cp-ps {
  display: grid;
  justify-items: center;
  gap: 3px;
  width: 64px;
  font-size: var(--cp-fs-xs);
  font-weight: 600;
  line-height: 1.2;
  color: var(--cp-fg-2);
}
.cp-ps img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}
.cp-ps.plus {
  color: #fff;
}
.cp-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.cp-bar {
  width: 64px;
  height: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
.cp-bar i {
  display: block;
  height: 100%;
  background: var(--tc, var(--cp-accent));
}
.cp-stat b {
  width: 24px;
  text-align: right;
}
/* position ratings: a ring in the rating colour, filled for the player's own positions (like the player page's RPP pitch) */
.cp-rpp {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 26px;
  padding: 0 8px;
  font-weight: 800;
  border: 1.5px solid var(--tc, var(--cp-line));
  border-radius: 13px;
}
.cp .cp-rpp-own {
  color: var(--cp-ink);
  background: var(--tc);
}
.cp-table tr.cp-key td {
  padding-top: 6px;
  padding-bottom: 10px;
  font-size: var(--cp-fs-sm);
  font-weight: 600;
  text-align: left;
  color: var(--cp-fg-3);
}
.cp-table tr.cp-key .cp-rpp {
  min-width: 30px;
  height: 20px;
  margin-right: 6px;
  font-size: var(--cp-fs-xs);
}
.cp-table tr.cp-key:hover td {
  background: none;
}

@media (max-width: 767.98px) {
  .cp-search {
    flex-wrap: wrap;
    gap: 8px;
  }
  .cp-search-count {
    width: 100%;
  }
  /* phones: narrow label column and ~125px player columns, so two players fit side by side */
  .cp-table tbody th,
  .cp-corner {
    width: 92px;
    padding-left: 10px;
    padding-right: 6px;
  }
  .cp-table th,
  .cp-table td {
    padding: 8px 6px;
  }
  .cp-table.cp-n2 { min-width: 0; }
  .cp-table.cp-n3 { min-width: 470px; }
  .cp-table.cp-n4 { min-width: 595px; }
  .cp-table.cp-n5 { min-width: 720px; }
  .cp-table td {
    font-size: var(--cp-fs-md);
  }
  .cp-face,
  .cp-add i {
    width: 56px;
    height: 56px;
  }
  .cp-name {
    font-size: var(--cp-fs-lg);
  }
  .cp-ratings b {
    font-size: var(--cp-fs-xl);
  }
  .cp-bar {
    width: 34px;
  }
  .cp-stat {
    gap: 5px;
  }
  .cp-ps {
    width: 52px;
  }
}
