/* =========================================================
   CLUB PAGE (club.html) — club.css (Premium)
   ========================================================= */

/* =========================
   TOKENS
========================= */
:root {
  --bg: #eef2f7;
  --card: #ffffff;

  --text: #0f172a;
  --muted: #64748b;
  --line: #dbe3ec;

  --accent: #fb5904;

  --radius: 18px;
  --radius-sm: 12px;

  --shadow-1: 0 1px 0 rgba(0, 0, 0, 0.04);
  --shadow-2: 0 12px 30px rgba(15, 23, 42, 0.08);

  --good-bg: rgba(34, 197, 94, 0.22);
  --bad-bg: rgba(239, 68, 68, 0.22);
}

html,
body {
  background: var(--bg);
  color: var(--text);
}

.wrap {
  width: min(92vw, 1280px);
  margin: 0 auto;
}

@media (min-width: 1100px) {
  .wrap {
    width: min(92vw, 1520px);
  }
}

/* =========================
   TOPBAR
========================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(238, 242, 247, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.topbar .wrap {
  padding: 10px 0;
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.top-left,
.top-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 900;
  font-size: 12px;
  box-shadow: var(--shadow-1);
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(251, 89, 4, 0.35);
  box-shadow: var(--shadow-2);
}

.btn--ghost {
  background: transparent;
}

.btn--danger {
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.06);
}

/* theme.js marca botões */
[data-theme].is-active {
  border-color: rgba(251, 89, 4, 0.55);
  background: rgba(251, 89, 4, 0.12);
  box-shadow: 0 0 0 3px rgba(251, 89, 4, 0.12);
}

/* =========================
   LAYOUT
========================= */
.club-main {
  padding: 14px 0 18px;
  display: grid;
  gap: 14px;
}

/* =========================
   HERO
========================= */
.club-hero {
  border-radius: var(--radius);
  border: 1px solid rgba(15, 23, 42, 0.08);
  background:
    radial-gradient(
      900px 240px at 12% 10%,
      rgba(251, 89, 4, 0.1),
      transparent 55%
    ),
    linear-gradient(#ffffff, #fbfbff);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

.club-hero__grid {
  display: grid;
  gap: 12px;
  padding: 16px;
}

@media (min-width: 980px) {
  .club-hero__grid {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
  }
}

.club-hero__left {
  display: flex;
  gap: 14px;
  align-items: center;
}

.club-crest {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: linear-gradient(145deg, #ffffff, #f1f5f9);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
  flex: 0 0 auto;
}

.club-crest img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(15, 23, 42, 0.18));
}

.club-hero__meta {
  min-width: 0;
}

.club-hero__eyebrow {
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(100, 116, 139, 0.92);
  margin-bottom: 6px;
}

.club-hero__titleRow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.club-hero__title {
  font-size: 28px;
  font-weight: 1000;
  letter-spacing: -0.4px;
  margin: 0;
  line-height: 1.08;
}

.club-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(15, 23, 42, 0.02);
  font-size: 12px;
  font-weight: 900;
  color: rgba(15, 23, 42, 0.86);
}

.club-hero__subtitle {
  color: rgba(100, 116, 139, 0.95);
  font-size: 13px;
  margin-top: 6px;
  font-weight: 650;
}

/* meta pills */
.club-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(15, 23, 42, 0.02);
}

.meta-k {
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(100, 116, 139, 0.9);
}

.meta-v {
  font-size: 12px;
  font-weight: 950;
  color: rgba(15, 23, 42, 0.92);
}

/* right side */
.club-hero__right {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.8);
}

.club-hero__navlabel {
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(100, 116, 139, 0.9);
}

/* nav clubes */
.club-nav__row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

.club-nav__row::-webkit-scrollbar {
  height: 8px;
}
.club-nav__row::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.14);
  border-radius: 999px;
}
.club-nav__row::-webkit-scrollbar-track {
  background: transparent;
}

.club-nav__row .tab {
  flex: 0 0 auto;
  text-decoration: none;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 950;
  font-size: 12px;
  line-height: 1;
  color: rgba(15, 23, 42, 0.92);
  white-space: nowrap;
  transition:
    transform 0.08s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease,
    background 0.12s ease;
}

.club-nav__row .tab:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
  border-color: rgba(251, 89, 4, 0.35);
}

.club-nav__row .tab.active {
  background: rgba(251, 89, 4, 0.12);
  border-color: rgba(251, 89, 4, 0.65);
  box-shadow: inset 0 0 0 1px rgba(251, 89, 4, 0.18);
}

/* filtro jogos */
.club-filters {
  display: flex;
}

.games-filter {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  background: #fff;
  font-weight: 950;
  font-size: 12px;
  line-height: 1;
}

.games-filter span {
  color: rgba(100, 116, 139, 0.95);
  font-weight: 950;
  letter-spacing: 0.02em;
}

.games-select {
  border: none;
  outline: none;
  background: transparent;
  font-weight: 950;
  cursor: pointer;
  color: rgba(15, 23, 42, 0.92);
}

.club-help {
  font-size: 12px;
  color: rgba(100, 116, 139, 0.95);
  font-weight: 650;
  line-height: 1.35;
}

/* =========================
   SUMÁRIOS
========================= */
.club-summaries {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.panel {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: var(--card);
  box-shadow: var(--shadow-2);
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(#fff, #fbfbff);
}

.panel__title {
  font-weight: 1000;
  font-size: 16px;
  color: rgba(15, 23, 42, 0.92);
}

.panel__count {
  font-weight: 950;
  font-size: 12px;
  color: rgba(15, 23, 42, 0.86);
  padding: 6px 10px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  background: #fff;
}

.panel__body {
  padding: 12px 14px;
}

/* KPIs */
.club-sum__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.kpi {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  background: #fff;
  padding: 8px 10px;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.kpi-k {
  font-size: 10.5px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(100, 116, 139, 0.95);
  margin-bottom: 3px;
}

.kpi-v {
  font-size: 15px;
  font-weight: 1000;
  color: rgba(15, 23, 42, 0.92);
  letter-spacing: -0.1px;
}

.kpi.good {
  background: var(--good-bg);
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.32);
}
.kpi.bad {
  background: var(--bad-bg);
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.32);
}

/* =========================
   TABELAS
========================= */
.club-tables {
  display: grid;
  gap: 14px;
}

.club-table {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: var(--card);
  box-shadow: var(--shadow-2);
}

.club-table__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(#fff, #fbfbff);
}

.club-table__title {
  font-weight: 1000;
  font-size: 16px;
  color: rgba(15, 23, 42, 0.92);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(15, 23, 42, 0.02);
  font-size: 12px;
  font-weight: 950;
  color: rgba(15, 23, 42, 0.86);
}

/* wrapper scroll */
.table-wrap {
  width: 100%;
  overflow: auto;
  max-height: 44vh;
  background: linear-gradient(
    180deg,
    rgba(241, 245, 249, 0.65),
    rgba(241, 245, 249, 0.25)
  );
  padding: 12px;
}

/* tabela */
table.sheet {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: max-content;
}

table.sheet th,
table.sheet td {
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding: 8px 10px;
  font-size: 13px;
  white-space: nowrap;
  vertical-align: middle;
  background: #fff;
}

table.sheet thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f1f5f9;
  border-bottom: 2px solid rgba(15, 23, 42, 0.1);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 9px 10px;
  text-align: center;
}

/* zebra (não aplica em num e opp) */
table.sheet tbody tr:nth-child(even) td:not(.num):not(.opp-td) {
  background: rgba(15, 23, 42, 0.018);
}

table.sheet tbody tr:hover td {
  background: rgba(251, 89, 4, 0.06);
}

/* 1ª coluna (#) sticky */
table.sheet th:first-child,
table.sheet td:first-child {
  position: sticky;
  left: 0;
  z-index: 6;
  background: #f7f9fc;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  text-align: center;
  box-shadow: 1px 0 0 rgba(0, 0, 0, 0.06);
}

table.sheet th.num,
table.sheet td.num {
  width: 64px;
  min-width: 64px;
  max-width: 64px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* tags */
.cell-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-weight: 950;
  font-size: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  color: rgba(15, 23, 42, 0.92);
}

.tag-win {
  background: rgba(46, 213, 115, 0.18);
  border-color: rgba(46, 213, 115, 0.35);
}
.tag-draw {
  background: rgba(255, 193, 7, 0.22);
  border-color: rgba(255, 193, 7, 0.4);
}
.tag-loss {
  background: rgba(255, 71, 87, 0.18);
  border-color: rgba(255, 71, 87, 0.35);
}

.tag-over-yes {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}
.tag-over-no {
  background: #fff;
  border-color: #1d4ed8;
  color: #1d4ed8;
}

/* heatmap badge */
td.num .val {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 6px 8px;
  border-radius: 10px;
  font-weight: 950;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}

td.num .val.is-good {
  color: #065f46;
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.35);
}
td.num .val.is-bad {
  color: #7f1d1d;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.35);
}
td.num .val.is-mid {
  color: #1f2937;
}

/* adversário */
.opp-td {
  text-align: center;
  vertical-align: middle;
  padding: 6px 8px !important;
  width: 52px;
  min-width: 52px;
  max-width: 52px;
}

.opp-crest {
  width: 22px;
  height: 22px;
  display: inline-block;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(15, 23, 42, 0.18));
}

/* =========================
   RESPONSIVO
========================= */
@media (max-width: 980px) {
  .club-summaries {
    grid-template-columns: 1fr;
  }
  .club-sum__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .club-hero__left {
    align-items: flex-start;
  }
  .club-crest {
    width: 62px;
    height: 62px;
    border-radius: 16px;
  }
  .club-crest img {
    width: 48px;
    height: 48px;
  }
  .club-hero__title {
    font-size: 22px;
  }
  .table-wrap {
    max-height: 52vh;
  }
}

@media (max-width: 520px) {
  .club-sum__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .club-nav__row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding-bottom: 0;
  }
  .club-nav__row .tab {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 8px 0;
  }
}
