/* Targeted Manager Portal component remapping.
 * This layer now speaks the Brazil system: green + two blues carry the structure,
 * while white/off-white and yellow are reserved for working surfaces and highlights.
 */

#tacticsView .pitch-panel,
#tacticsView .squad-tray-panel,
#tacticsView .team-sheet-panel,
#tacticsView .team-preset-panel,
#tacticsView .current-submission {
  color: var(--tbg-colour-ink);
  background: #dbe8d5;
  border-color: #6f8f73;
  box-shadow: none;
}

#tacticsView .pitch-help,
#tacticsView .tray-player small,
#tacticsView .bench-slot.empty::after {
  color: var(--tbg-colour-muted);
}

#tacticsView .tray-player,
#tacticsView .bench-slot {
  color: var(--tbg-colour-ink);
  background: #eef3eb;
  border-color: #8aa08c;
}

#tacticsView .tray-player:hover,
#tacticsView .tray-player:focus-visible,
#tacticsView .bench-slot:hover,
#tacticsView .bench-slot:focus-visible {
  background: #dbe8d5;
  border-color: #2d6fa3;
}

#tacticsView .tray-player.selected,
#tacticsView .bench-slot.selected {
  outline-color: #ffdc02;
}

#tacticsView .board-actions button {
  color: #fff;
  background: #102330;
}

#tacticsView .board-actions button:hover,
#tacticsView .board-actions button:focus-visible {
  color: #fff;
  background: #214f70;
}

#tacticsView .football-pitch {
  background: repeating-linear-gradient(0deg, #267945 0, #267945 70px, #2d8650 70px, #2d8650 140px);
}

#tacticsView .formation-slot {
  background: #07304db8;
  color: #fff;
}

#tacticsView .formation-slot.drop-target {
  background: #0e6f9bd9;
}

#competitionsView .competition-card,
#competitionsView .division-round-card,
#competitionsView .competition-round-header,
#competitionsView .round-navigation,
#competitionsView .division-round-list,
#competitionsView .season-archive-summary {
  color: var(--tbg-colour-ink);
  background: #eef3eb;
  border-color: #78927c;
}

#competitionsView .competition-round-header p,
#competitionsView .round-navigation span,
#competitionsView .round-scorers,
#competitionsView .competition-round-loading {
  color: var(--tbg-colour-muted);
}

#competitionsView .competition-round-tabs button,
#competitionsView .round-navigation button,
#competitionsView .division-selector select,
#competitionsView .round-score,
#competitionsView .round-kickoff {
  color: #102330;
  background: #f4f6ef;
  border-color: #78927c;
}

#competitionsView .competition-round-tabs button.active,
#competitionsView .competition-round-tabs button:hover,
#competitionsView .competition-round-tabs button:focus-visible,
#competitionsView .round-navigation button:hover,
#competitionsView .round-navigation button:focus-visible,
#competitionsView .round-score:hover,
#competitionsView .round-score:focus-visible {
  color: #fff;
  background: #214f70;
}

#competitionsView .division-round-fixture {
  background: #edf3e9;
  border-bottom-color: #b8c8b6;
}

#competitionsView .division-round-fixture:nth-child(even) {
  background: #dfead9;
}

#competitionsView .division-round-fixture.managed-fixture {
  background: #fff0a8;
}

#competitionsView .round-count {
  color: #fff;
  background: #193375;
}

#worldView .world-control-summary article,
#worldView .world-control-card,
#worldView .world-transfer-card,
#worldView .request-history,
#worldView .world-history-block {
  color: var(--tbg-colour-ink);
  background: #e4eee0;
  border-color: #78927c;
  box-shadow: none;
}

#worldView .world-control-summary span,
#worldView .world-control-summary small,
#worldView .world-control-card small {
  color: var(--tbg-colour-muted);
}

#worldView .world-control-card input,
#worldView .world-control-card select,
#worldView .world-transfer-card input,
#worldView .world-transfer-card select {
  color: #102330;
  background: #f4f6ef;
  border-color: #78927c;
}

#worldView .world-control-card button,
#worldView .file-action {
  color: #fff;
  background: #214f70;
  border: 1px solid #193375;
}

#worldView .world-control-card button:hover,
#worldView .world-control-card button:focus-visible,
#worldView .file-action:hover,
#worldView .file-action:focus-visible,
#worldView .world-control-card .primary-action {
  color: #fff;
  background: #102330;
}

#worldView .bulk-registration-player {
  color: var(--tbg-colour-ink);
  background: #dbe8d5;
  border-color: #78927c;
}

#worldView .bulk-registration-player em {
  color: var(--tbg-colour-success);
  font-weight: 800;
}

#worldView .bulk-registration-player:hover,
#worldView .bulk-registration-player:focus-within {
  background: #cfe0c8;
  border-color: #2d6fa3;
}

#dashboardView .inbox-message,
#dashboardView .inbox-message.read {
  background: #edf3e9;
  border-color: #b8c8b6;
}

#dashboardView .inbox-message.read {
  opacity: .86;
}

#dashboardView .inbox-message.unread {
  background: #f4f6ef;
}

#dashboardView .inbox-message.unread:hover,
#dashboardView .inbox-message.unread:focus {
  background: #dfead9;
  outline-color: #2d6fa3;
}

#scheduleView .portal-card,
#historyView .portal-card,
#historyView .history-club-panel,
#historyView .season-archive {
  color: var(--tbg-colour-ink);
  background: #eef3eb;
  border-color: #78927c;
}

@media (max-width: 600px) {
  #competitionsView .division-round-fixture { background: #edf3e9; }
  #competitionsView .division-round-fixture:nth-child(even) { background: #dfead9; }
  #competitionsView .division-round-fixture.managed-fixture { background: #fff0a8; }
}

/* Portrait standings: retain every statistic, but use a deliberately compact
 * table rather than shrinking the desktop presentation indiscriminately. */
@media (max-width: 700px) {
  #competitionsView .competition-card {
    padding-inline: .35rem;
  }

  #competitionsView .competition-card > .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow: hidden !important;
  }

  #standingsTable {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
  }

  #standingsTable th,
  #standingsTable td {
    box-sizing: border-box;
    padding: .44rem .14rem !important;
    font-size: .64rem !important;
    line-height: 1.05;
    text-align: center;
    vertical-align: middle;
  }

  #standingsTable th:nth-child(1),
  #standingsTable td:nth-child(1) { width: 5.5%; }

  #standingsTable th:nth-child(2),
  #standingsTable td:nth-child(2) {
    width: 29.5%;
    min-width: 0 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    padding-left: .25rem !important;
  }

  #standingsTable td:nth-child(2) .portal-club-link {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #standingsTable th:nth-child(n+3):nth-child(-n+6),
  #standingsTable td:nth-child(n+3):nth-child(-n+6) { width: 4.8%; }

  #standingsTable th:nth-child(n+7):nth-child(-n+9),
  #standingsTable td:nth-child(n+7):nth-child(-n+9) { width: 5.3%; }

  #standingsTable th:nth-child(10),
  #standingsTable td:nth-child(10) {
    width: 6.4%;
    font-weight: 900 !important;
  }

  #standingsTable th:nth-child(11),
  #standingsTable td:nth-child(11) { width: 24%; }

  /* A td must remain a table-cell in a fixed table. The base .form-cell flex
   * declaration was what made Pts and Form visually collide in portrait. */
  #standingsTable td.form-cell {
    display: table-cell !important;
    min-width: 0 !important;
    white-space: nowrap;
    text-align: center;
  }

  #standingsTable .form-dot {
    display: inline-grid !important;
    place-items: center;
    width: .84rem !important;
    height: .84rem !important;
    min-width: .84rem !important;
    margin: 0 .02rem;
    font-size: .47rem !important;
    line-height: .84rem;
    vertical-align: middle;
  }

  #standingsTable thead th {
    color: #fff !important;
    white-space: nowrap;
    letter-spacing: .015em;
  }
}
