:root {
  --bp-bg: #0b0b0b;
  --bp-card: #111214;
  --bp-text: #eaeaea;
  --bp-muted: #cfd3da;
  --bp-input: #0f1115;
  --bp-border: #2b3340;
}

/* ===== Base do portal (NÃO vaza pro site) ===== */
.bp-portal {
  color: var(--bp-text);
}

.bp-portal h1,
.bp-portal h2,
.bp-portal h3 {
  color: #fff;
  margin: 0 0 10px 0;
}

.bp-portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 10px;
  flex-wrap: wrap;
}

.bp-portal-header .bp-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== Tabs ===== */
.bp-portal .bp-tabs {
  display: flex;
  gap: 10px;
  margin: 10px 0 14px;
  flex-wrap: wrap;
}

.bp-portal .bp-tab {
  background: var(--bp-card);
  color: #fff;
  border: 1px solid #23242a;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}

.bp-portal .bp-tab.active {
  outline: none;
  border-color: rgba(255, 255, 255, .35);
}

/* IMPORTANTÍSSIMO: tema não pode sobrescrever */
.bp-portal .bp-tabpane {
  display: none !important;
}

.bp-portal .bp-tabpane.active {
  display: block !important;
}

/* ===== Cards KPI ===== */
.bp-portal .bp-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}

.bp-portal .bp-card {
  background: var(--bp-card);
  border: 1px solid #23242a;
  border-radius: 18px;
  padding: 14px;
}

.bp-portal .bp-card.kpi span {
  display: block;
  color: var(--bp-muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.bp-portal .bp-card.kpi strong {
  font-size: 22px;
}

/* Ensure hidden attributes work regardless of display property */
[hidden] {
  display: none !important;
}

/* ===== Charts & History ===== */
.bp-portal .bp-charts {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}

.bp-portal .bp-chart {
  background: var(--bp-card);
  border: 1px solid #23242a;
  border-radius: 18px;
  padding: 14px;
  /* Fixed height, but allow content (legend) to fit. 
     Flex column ensures canvas fills available space. 
  */
  height: 320px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Keep it tidy */
}

.bp-portal .bp-chart canvas {
  flex: 1;
  min-height: 0;
  /* Flexbox trick for canvas resizing */
  width: 100% !important;
  height: auto !important;
}

/* History Visualization (V/E/D) */
.bp-history-viz {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 10px 0 20px;
  /* space for axis */
}

.bp-history-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.bp-history-bar {
  width: 6px;
  background: #555;
  border-radius: 2px;
  position: relative;
  min-height: 4px;
  transition: width 0.2s, opacity 0.2s;
}

.bp-history-bar:hover {
  width: 10px;
  opacity: 0.9;
}

.bp-history-label {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  display: none;
}

.bp-history-bar:hover .bp-history-label {
  display: block;
}

.bp-history-idx {
  font-size: 9px;
  color: #6b7280;
  margin-top: 4px;
}


/* ===== Rankings ===== */
.bp-portal .bp-ranks {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}

.bp-portal .bp-rank-card {
  background: var(--bp-card);
  border: 1px solid #23242a;
  border-radius: 18px;
  padding: 14px;
  min-height: 120px;
}

.bp-portal .bp-rank-card h3 {
  margin: 0 0 10px 0;
  text-transform: lowercase;
}

.bp-portal .bp-btn-secondary {
  background: #1a1d24;
  border: 1px solid #2a2f3a;
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}

/* ===== Formulário (escopado) ===== */
.bp-portal label {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--bp-muted);
}

.bp-portal .bp-form {
  background: var(--bp-card);
  border: 1px solid #23242a;
  border-radius: 18px;
  padding: 14px;
}

.bp-portal .bp-form input,
.bp-portal .bp-form select,
.bp-portal .bp-form textarea,
.bp-portal .bp-goal-row input,
.bp-portal .bp-goal-row select {
  width: 100%;
  background: var(--bp-input) !important;
  color: #fff !important;
  border: 1px solid var(--bp-border) !important;
  border-radius: 10px;
  padding: 10px;
}

/* o que resolve o “seleciono e fica branco” em muitos temas */
.bp-portal .bp-form select,
.bp-portal .bp-goal-row select {
  -webkit-text-fill-color: #fff !important;
  text-shadow: 0 0 0 #fff;
}

.bp-portal .bp-form select option,
.bp-portal .bp-goal-row select option,
.bp-portal .bp-form optgroup,
.bp-portal .bp-goal-row optgroup {
  background: #0f1115 !important;
  color: #fff !important;
}

.bp-portal .bp-grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px;
}

.bp-portal .bp-grid3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 12px;
}

/* ===== Gols (linha grande) ===== */
.bp-portal .bp-goal-row {
  display: grid;
  grid-template-columns: 70px 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 90px;
  gap: 8px;
  align-items: end;
  margin: 10px 0;
}

.bp-portal .bp-goal-row .bp-g-rem {
  height: 42px;
}

.bp-portal .bp-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1a1d24;
  border: 1px solid #2a2f3a;
  color: #fff;
  border-radius: 999px;
  padding: 8px 10px;
  margin: 6px 6px 0 0;
}

.bp-portal .bp-chip .x {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

/* ===== Responsivo ===== */
@media (max-width: 1100px) {
  .bp-portal .bp-cards {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .bp-portal .bp-charts {
    grid-template-columns: 1fr;
  }

  .bp-portal .bp-ranks {
    grid-template-columns: repeat(2, 1fr);
  }

  .bp-portal .bp-goal-row {
    grid-template-columns: repeat(2, minmax(160px, 1fr)) !important;
  }

  .bp-portal .bp-goal-row .bp-g-rem {
    grid-column: 1 / -1;
  }

  .bp-portal .bp-goal-row .bp-g-desc {
    grid-column: 1 / -1;
  }

  .bp-portal .bp-grid2,
  .bp-portal .bp-grid3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .bp-portal .bp-cards {
    grid-template-columns: 1fr;
  }

  .bp-portal .bp-ranks {
    grid-template-columns: 1fr;
  }
}

/* Seletor de temporada (não é tab) */
.bp-portal .bp-season-select {
  background: var(--bp-card);
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  border: 1px solid #23242a;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.bp-portal .bp-season-select option {
  background: #0f1115;
  color: #fff;
}

/* ===== Ranking list (compacto e legível) ===== */
.bp-portal .bp-rank-card ol {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bp-portal .bp-rank-card li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #23242a;
  border-radius: 14px;
  background: rgba(255, 255, 255, .02);
}

/* número/posição (se você renderiza "1º", "2º" etc) */
.bp-portal .bp-rank-card li .pos {
  min-width: 34px;
  color: var(--bp-muted);
  font-weight: 700;
}

/* nome clicável: RESET total pra não virar "quadrado dourado" do tema */
.bp-portal .bp-rank-card li button,
.bp-portal .bp-rank-card li a {
  all: unset;
  cursor: pointer;
  color: #fff;
  font-weight: 700;
  line-height: 1.1;
  flex: 1;
  min-width: 0;
}

.bp-portal .bp-rank-card li button:hover,
.bp-portal .bp-rank-card li a:hover {
  text-decoration: underline;
}

/* valor (ex: "9 gols · 45% g/j" ou "6855 pts") */
.bp-portal .bp-rank-card li .meta {
  color: var(--bp-muted);
  font-size: 12px;
  white-space: nowrap;
  margin-left: 10px;
}

/* limita nomes muito longos */
.bp-portal .bp-rank-card li button,
.bp-portal .bp-rank-card li a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Modal overlay (abre no centro, sem rolar página) ===== */
.bp-portal .bp-modal[hidden] {
  display: none !important;
}

.bp-portal .bp-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  padding: 16px;
  display: none;
}

.bp-portal .bp-modal:not([hidden]) {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.bp-portal .bp-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .65);
}

.bp-portal .bp-modal__panel {
  position: relative;
  z-index: 2;
  width: min(720px, 96vw);
  max-height: min(78vh, 760px);
  overflow: auto;
  background: var(--bp-card);
  border: 1px solid #23242a;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
}

.bp-portal .bp-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid #23242a;
}

.bp-portal .bp-modal__body {
  padding: 14px;
  color: var(--bp-text);
}

.bp-portal .bp-modal__close {
  all: unset;
  cursor: pointer;
  color: #fff;
  font-size: 18px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid #23242a;
  background: rgba(255, 255, 255, .03);
}

.bp-portal .bp-modal__close:hover {
  background: rgba(255, 255, 255, .07);
}

/* trava scroll quando modal abre (se seu JS aplicar essa classe no body) */
body.bp-no-scroll {
  overflow: hidden !important;
}

/* ===== [bp_team] – Hub de jogadores no front: cards com zoom/hover e modal perfil (estilo Bayern) ===== */
.bp-team-hub {
  margin: 16px 0;
}

.bp-team-hub__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.bp-team-card {
  cursor: pointer;
  background: var(--bp-card);
  border: 1px solid #23242a;
  border-radius: 18px;
  overflow: hidden;
  transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .3s ease;
  position: relative;
}

.bp-team-card:hover,
.bp-team-card.bp-team-card--hover {
  transform: scale(1.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}

.bp-team-card__img-wrap {
  aspect-ratio: 1;
  background: #1a1d24;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bp-team-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bp-team-card:hover .bp-team-card__img,
.bp-team-card.bp-team-card--hover .bp-team-card__img {
  transform: scale(1.12);
}

.bp-team-card__placeholder {
  font-size: 32px;
  font-weight: 700;
  color: var(--bp-muted);
}

.bp-team-card__info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bp-team-card__name {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
}

.bp-team-card__num {
  font-size: 13px;
  color: var(--bp-muted);
}

.bp-team-card__stats {
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .4) 0%, rgba(11, 11, 11, .92) 100%);
  font-size: 12px;
  color: #fff;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity .3s ease, max-height .3s ease, padding .3s ease;
}

.bp-team-card:hover .bp-team-card__stats,
.bp-team-card.bp-team-card--hover .bp-team-card__stats {
  opacity: 1;
  max-height: 60px;
  padding: 10px 12px;
}

.bp-team-modal[hidden] {
  display: none !important;
}

.bp-team-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.bp-team-modal .bp-modal__panel {
  width: min(960px, 98vw);
  max-height: min(85vh, 720px);
  display: flex;
  flex-direction: column;
  position: relative;
}

.bp-team-modal__layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 0;
  overflow: auto;
  flex: 1;
}

@media (max-width: 800px) {
  .bp-team-modal__layout {
    grid-template-columns: 1fr;
  }
}

.bp-team-modal__left {
  padding: 20px;
  border-right: 1px solid #23242a;
  overflow-y: auto;
}

.bp-team-modal__right {
  padding: 20px;
  background: rgba(0, 0, 0, .2);
  overflow-y: auto;
}

.bp-team-modal__header {
  margin-bottom: 16px;
}

.bp-team-modal__photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  background: #1a1d24;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.bp-team-modal__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bp-team-modal__photo--placeholder span {
  font-size: 36px;
  font-weight: 700;
  color: var(--bp-muted);
}

.bp-team-modal__name {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
}

.bp-team-modal__nickname {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--bp-muted);
  font-style: italic;
}

.bp-team-modal__meta {
  margin: 0;
  font-size: 14px;
  color: var(--bp-muted);
}

.bp-team-modal__tabs {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.bp-team-modal__tab {
  padding: 10px 16px;
  border: 1px solid #23242a;
  border-radius: 12px;
  background: transparent;
  color: var(--bp-text);
  cursor: pointer;
  font-weight: 600;
}

.bp-team-modal__tab.active {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .25);
}

.bp-team-modal__tabpane {
  display: none;
}

.bp-team-modal__tabpane.active {
  display: block;
}

.bp-team-modal-detalhes p,
.bp-team-modal-bio {
  margin: 0 0 10px;
  color: var(--bp-text);
}

.bp-team-modal-empty {
  color: var(--bp-muted);
  font-style: italic;
}

.bp-age-dynamic {
  font-size: 11px;
  color: var(--bp-muted);
  font-weight: 400;
}

.bp-team-modal__stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.bp-team-modal__stats-header h3 {
  margin: 0;
}

.bp-team-modal__stats-header select {
  background: var(--bp-input);
  color: #fff;
  border: 1px solid var(--bp-border);
  border-radius: 10px;
  padding: 8px 12px;
}

.bp-team-modal-stats-summary {
  margin-bottom: 14px;
}

.bp-team-modal-stats-summary p {
  margin: 0 0 8px;
  font-size: 14px;
}

.bp-team-modal-breakdown {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.bp-team-modal-breakdown th,
.bp-team-modal-breakdown td {
  border: 1px solid #23242a;
  padding: 8px 10px;
  text-align: left;
}

.bp-team-modal-breakdown thead th {
  background: rgba(255, 255, 255, .06);
}

.bp-team-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
}

/* ===== Cadastro de Jogador (Adaptação para Dark Theme do Front) ===== */
.bp-portal .bp-cadastro-card {
  background: var(--bp-card);
  border: 1px solid #23242a;
  border-radius: 18px;
  padding: 30px;
  margin-top: 20px;
  max-width: 900px;
  color: var(--bp-text);
}

.bp-portal .bp-cadastro-card__grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
}

@media (max-width: 800px) {
  .bp-portal .bp-cadastro-card__grid {
    grid-template-columns: 1fr;
  }
}

.bp-portal .bp-cadastro-card__col--main h3 {
  font-size: 16px;
  border-bottom: 1px solid #23242a;
  padding-bottom: 10px;
  margin-bottom: 20px;
  color: #fff;
}

.bp-portal .bp-form-section {
  margin-bottom: 30px;
}

.bp-portal .bp-form-row {
  display: flex;
  gap: 20px;
}

.bp-portal .bp-form-row p {
  flex: 1;
  margin: 0;
}

.bp-portal .bp-form-row.two-cols p {
  flex: 1;
}

.bp-portal .bp-form-row.three-cols p {
  flex: 1;
}

/* Inputs estilo moderno (override dos estilos globais do portal para o form especifico se precisar) */
.bp-portal .bp-player-form--cadastro input[type="text"],
.bp-portal .bp-player-form--cadastro input[type="date"],
.bp-portal .bp-player-form--cadastro input[type="number"],
.bp-portal .bp-player-form--cadastro select,
.bp-portal .bp-player-form--cadastro textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--bp-border);
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  background: var(--bp-input);
  color: #fff;
}

.bp-portal .bp-player-form--cadastro input:focus,
.bp-portal .bp-player-form--cadastro select:focus,
.bp-portal .bp-player-form--cadastro textarea:focus {
  border-color: #4b5563;
  box-shadow: 0 0 0 1px #4b5563;
}

.bp-portal .bp-player-form--cadastro label {
  font-size: 13px;
  color: var(--bp-muted);
  margin-bottom: 6px;
  font-weight: 600;
  display: block;
}

.bp-portal .bp-player-form--cadastro .required {
  color: #ef4444;
  margin-left: 2px;
}

/* Área da foto destacada */
.bp-portal .bp-cadastro-card__col--photo {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Custom Position Selector (Tags) - Front */
.bp-pos-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}

.bp-pos-select-item {
  background: #1a1d24;
  border: 1px solid #2a2f3a;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
  transition: all 0.2s;
  color: #cdd1d8;
}

.bp-pos-select-item:hover {
  background: #2a2f3a;
  border-color: #3b82f6;
  color: #fff;
}

.bp-pos-select-item.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.bp-portal .bp-photo-picker.large {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 4px solid #23242a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
  background: #111;
  cursor: pointer;
  transition: transform .2s;
}

.bp-portal .bp-photo-picker.large:hover {
  transform: scale(1.02);
  border-color: #333;
}

.bp-portal .bp-photo-picker.large .bp-photo-picker__preview {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
}

.bp-portal .bp-photo-picker.large .bp-photo-picker__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bp-portal .bp-photo-picker.large .bp-photo-picker__add {
  font-size: 48px;
  color: #4b5563;
  transition: color .2s;
}

.bp-portal .bp-photo-picker.large:hover .bp-photo-picker__add {
  color: #d1d5db;
}

.bp-portal .bp-form-section.center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.bp-portal .description {
  font-style: italic;
  color: #6b7280;
  font-size: 12px;
  margin-top: 8px;
}

/* Botão submit */
.bp-portal .bp-submit-area {
  margin-top: 30px;
  width: 100%;
  text-align: center;
}

.bp-portal .button.button-hero {
  background: #fff;
  color: #000;
  border: none;
  padding: 12px 32px;
  font-size: 16px;
  border-radius: 30px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .2s;
  height: auto;
  line-height: 1.4;
}

.bp-portal .button.button-hero:hover {
  background: #eaeaea;
  transform: translateY(-2px);
}

.bp-portal .button.button-hero:active {
  transform: translateY(0);
}

/* ===== Títulos de Seção (Goleiros, Defensores, etc) ===== */
.bp-team-section-title {
  font-size: 24px;
  font-weight: 800;
  text-transform: uppercase;
  color: #fff;
  margin: 40px 0 20px;
  padding-left: 10px;
  border-left: 4px solid var(--bp-border);
  letter-spacing: 1px;
}

/* Espaçamento para o grid wrap */
.bp-team-hub__grid-wrap {
  margin-bottom: 40px;
}

/* Correção para modal admin foto circular */
#bp-admin-modal-photo,
.bp-team-modal__photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #23242a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  margin: 0 auto 16px;
  background: #1a1d24;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

#bp-admin-modal-photo img,
.bp-team-modal__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Ajuste no layout do header do modal para garantir alinhamento */
.bp-team-modal__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.bp-team-modal__name {
  margin-top: 10px;
}

/* Posições secundárias no modal */
.bp-pos-secondary {
  font-size: 0.85em;
  opacity: 0.8;
  margin-left: 6px;
  font-weight: 400;
  color: var(--bp-muted);
}