/**
 * Abas de chave OPB (Ouro / Prata / Bronze / Lata) — Jogos da Rodada
 * e Ranking da chave / Acumulado (links <a> com as mesmas classes).
 * Cores alinhadas ao ranking geral OPB (#fdd96c, #e8e8e8, #fab46f, #d4ddd4).
 * Contraste: fundo claro + texto escuro (REGRA_CRITICA_DESIGN).
 */
.opb-chave-tabs {
  --opb-tab-radius: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  border: 0 !important;
  border-bottom: 1px solid rgba(2, 105, 33, 0.12) !important;
  padding: 0.15rem 0 0.85rem;
  margin-bottom: 1.1rem !important;
}

.opb-chave-tabs .nav-item {
  margin: 0;
}

.opb-chave-tabs .nav-link.opb-chave-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  border: 2px solid transparent !important;
  border-radius: var(--opb-tab-radius) !important;
  padding: 0.55rem 1rem 0.55rem 0.85rem !important;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-decoration: none !important;
  background-image: none !important;
  box-shadow: none;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease,
    filter 0.15s ease,
    opacity 0.15s ease;
}

.opb-chave-tabs .nav-link.opb-chave-tab:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.opb-chave-tabs .nav-link.opb-chave-tab:focus-visible {
  outline: 3px solid rgba(2, 105, 33, 0.35);
  outline-offset: 2px;
}

.opb-chave-tabs .nav-link.opb-chave-tab.active {
  transform: translateY(-1px);
  filter: none;
  opacity: 1;
}

.opb-chave-tab__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.opb-chave-tab__label {
  font-size: 1.12rem;
  font-weight: 800;
}

.opb-chave-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
  background: rgba(0, 0, 0, 0.12);
  color: inherit;
}

/* —— Ouro —— */
.opb-chave-tabs .opb-chave-tab--ouro {
  color: #5c4500 !important;
  background: linear-gradient(145deg, #ffe9a8 0%, #fdd96c 55%, #f0c84a 100%) !important;
  border-color: #c9a227 !important;
}

.opb-chave-tabs .opb-chave-tab--ouro .opb-chave-tab__icon {
  color: #8a6a00;
  background: rgba(255, 255, 255, 0.45);
}

.opb-chave-tabs .opb-chave-tab--ouro:not(.active) {
  opacity: 0.78;
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.25);
}

.opb-chave-tabs .opb-chave-tab--ouro.active {
  box-shadow:
    0 4px 14px rgba(201, 162, 39, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  border-color: #a67c00 !important;
}

/* —— Prata —— */
.opb-chave-tabs .opb-chave-tab--prata {
  color: #2f343a !important;
  background: linear-gradient(145deg, #f4f4f4 0%, #e8e8e8 55%, #d5d5d5 100%) !important;
  border-color: #9e9e9e !important;
}

.opb-chave-tabs .opb-chave-tab--prata .opb-chave-tab__icon {
  color: #5c636a;
  background: rgba(255, 255, 255, 0.55);
}

.opb-chave-tabs .opb-chave-tab--prata:not(.active) {
  opacity: 0.78;
  box-shadow: inset 0 0 0 1px rgba(108, 117, 125, 0.2);
}

.opb-chave-tabs .opb-chave-tab--prata.active {
  box-shadow:
    0 4px 14px rgba(108, 117, 125, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  border-color: #6c757d !important;
}

/* —— Bronze —— */
.opb-chave-tabs .opb-chave-tab--bronze {
  color: #5a2e0a !important;
  background: linear-gradient(145deg, #ffc98a 0%, #fab46f 55%, #e89a4a 100%) !important;
  border-color: #cd7f32 !important;
}

.opb-chave-tabs .opb-chave-tab--bronze .opb-chave-tab__icon {
  color: #8a4b12;
  background: rgba(255, 255, 255, 0.4);
}

.opb-chave-tabs .opb-chave-tab--bronze:not(.active) {
  opacity: 0.78;
  box-shadow: inset 0 0 0 1px rgba(205, 127, 50, 0.25);
}

.opb-chave-tabs .opb-chave-tab--bronze.active {
  box-shadow:
    0 4px 14px rgba(205, 127, 50, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  border-color: #a35f1c !important;
}

/* —— Lata —— */
.opb-chave-tabs .opb-chave-tab--lata {
  color: #243028 !important;
  background: linear-gradient(145deg, #e4ebe4 0%, #d4ddd4 55%, #bcc8bc 100%) !important;
  border-color: #8a9a8a !important;
}

.opb-chave-tabs .opb-chave-tab--lata .opb-chave-tab__icon {
  color: #4a5c4a;
  background: rgba(255, 255, 255, 0.45);
}

.opb-chave-tabs .opb-chave-tab--lata:not(.active) {
  opacity: 0.78;
  box-shadow: inset 0 0 0 1px rgba(90, 107, 90, 0.2);
}

.opb-chave-tabs .opb-chave-tab--lata.active {
  box-shadow:
    0 4px 14px rgba(90, 107, 90, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  border-color: #5a6b5a !important;
}

/* —— Todas as chaves (Ranking da chave / Acumulado) —— */
.opb-chave-tabs .opb-chave-tab--todas {
  color: #0a3d1f !important;
  background: linear-gradient(145deg, #e8f5ec 0%, #d4edda 55%, #bfe3c9 100%) !important;
  border-color: #198754 !important;
}

.opb-chave-tabs .opb-chave-tab--todas .opb-chave-tab__icon {
  color: #0d5c2e;
  background: rgba(255, 255, 255, 0.5);
}

.opb-chave-tabs .opb-chave-tab--todas:not(.active) {
  opacity: 0.78;
  box-shadow: inset 0 0 0 1px rgba(25, 135, 84, 0.22);
}

.opb-chave-tabs .opb-chave-tab--todas.active {
  box-shadow:
    0 4px 14px rgba(25, 135, 84, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  border-color: #0d5c2e !important;
}

.opb-chave-tab__badge-hist {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-transform: lowercase;
  background: rgba(0, 0, 0, 0.16);
  color: inherit;
}

@media (max-width: 575.98px) {
  .opb-chave-tabs .nav-link.opb-chave-tab {
    font-size: 1rem;
    padding: 0.5rem 0.85rem 0.5rem 0.7rem !important;
  }

  .opb-chave-tab__label {
    font-size: 1rem;
  }
}
