.team-intelligence-page-shell {
  padding-left: 24px;
  padding-right: 24px;
}

.team-intel-page {
  display: grid;
  gap: 16px;
}

.team-intel-hero,
.team-intel-filters,
.team-intel-note,
.team-card,
.team-intel-empty {
  border: 1px solid var(--border);
  background: rgba(10, 22, 38, 0.8);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
}

.team-intel-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(10, 30, 48, 0.92), rgba(7, 18, 32, 0.8)),
    radial-gradient(circle at 10% 5%, rgba(34, 197, 94, 0.13), transparent 26rem);
}

.team-intel-eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.team-intel-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1;
}

.team-intel-hero p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.team-intel-hero-card {
  min-width: 150px;
  border: 1px solid rgba(34, 197, 94, .35);
  border-radius: 14px;
  background: rgba(34, 197, 94, .08);
  padding: 14px 16px;
}

.team-intel-hero-card span,
.team-intel-hero-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.team-intel-hero-card strong {
  display: block;
  margin: 3px 0;
  color: var(--primary);
  font-size: 30px;
  line-height: 1;
}

.team-intel-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 18px 20px;
  border-radius: 14px;
}

.team-intel-filters label {
  display: grid;
  gap: 7px;
  width: 170px;
  min-width: 0;
}

.team-intel-filters .team-intel-filter-search { width: 240px; }
.team-intel-filters .team-intel-filter-league { flex: 1 1 250px; width: auto; }
.team-intel-filters .team-intel-filter-small { width: 130px; }

.team-intel-filters label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.team-intel-filters select,
.team-intel-filters input {
  width: 100%;
  height: 42px;
  min-height: 42px;
  border: 1px solid #34475c;
  border-radius: 9px;
  outline: 0;
  background-color: #091827;
  color: #e5edf6;
  font: inherit;
  font-size: 13px;
}

.team-intel-filters select {
  appearance: none;
  padding: 0 34px 0 11px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20'%3E%3Cpath fill='%2394a3b8' d='m5.5 7.5 4.5 4.5 4.5-4.5 1.4 1.4-5.9 5.9-5.9-5.9z'/%3E%3C/svg%3E");
  background-position: right 10px center;
  background-repeat: no-repeat;
}

.team-intel-filters input {
  padding: 0 11px;
}

.team-intel-filters input::placeholder {
  color: #64748b;
  opacity: 1;
}

.team-intel-filters select:hover,
.team-intel-filters input:hover {
  border-color: #49627c;
}

.team-intel-filters select:focus,
.team-intel-filters input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .18);
  background-color: #0b1d2e;
}

.team-intel-filters option {
  background: #091827;
  color: #e5edf6;
}

.team-intel-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
}

.team-intel-actions button,
.team-intel-actions a,
.team-intel-actions span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  border-radius: 9px;
  padding: 0 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.team-intel-actions button {
  border: 0;
  background: var(--primary);
  color: #04111d;
  cursor: pointer;
}

.team-intel-actions a {
  border: 1px solid #34475c;
  color: #b9c7d6;
}

.team-intel-actions span {
  border: 1px solid #34475c;
  color: #7d8b9b;
  opacity: .45;
}

.team-intel-actions button:hover {
  filter: brightness(1.08);
}

.team-intel-actions a:hover {
  border-color: #49627c;
  background: rgba(148, 163, 184, .07);
  color: #e5edf6;
}

.team-intel-actions button:focus-visible,
.team-intel-actions a:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .22);
}

.team-intel-note {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  padding: 13px 16px;
  color: var(--muted);
}

.team-intel-note strong {
  color: var(--primary);
}

.team-intel-note-soft {
  background: rgba(56, 189, 248, .08);
}

.team-intel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.team-card,
.team-intel-empty {
  border-radius: 16px;
  padding: 16px;
}

.team-card {
  display: grid;
  gap: 14px;
}

.team-card-main {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.team-card-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.team-card h2 {
  margin: 0 0 5px;
  font-size: 21px;
  line-height: 1.15;
}

.team-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.team-label {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.team-label-machine,
.team-label-goals {
  border: 1px solid rgba(34, 197, 94, .35);
  background: rgba(34, 197, 94, .12);
  color: #39ef7b;
}

.team-label-defense {
  border: 1px solid rgba(56, 189, 248, .35);
  background: rgba(56, 189, 248, .1);
  color: #7dd3fc;
}

.team-label-fade,
.team-label-trap {
  border: 1px solid rgba(248, 113, 113, .35);
  background: rgba(248, 113, 113, .1);
  color: #ff9d9d;
}

.team-label-chaos {
  border: 1px solid rgba(250, 204, 21, .35);
  background: rgba(250, 204, 21, .1);
  color: #fde047;
}

.team-label-neutral {
  border: 1px solid #34475c;
  background: rgba(148, 163, 184, .08);
  color: #b9c7d6;
}

.team-form-row {
  display: flex;
  gap: 6px;
}

.form-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 950;
}

.form-win {
  background: rgba(34, 197, 94, .18);
  color: #39ef7b;
}

.form-draw {
  background: rgba(250, 204, 21, .16);
  color: #fde047;
}

.form-loss {
  background: rgba(248, 113, 113, .16);
  color: #ff9d9d;
}

.team-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.team-stat-grid div,
.team-short-odds {
  border: 1px solid rgba(52, 71, 92, .72);
  border-radius: 12px;
  background: rgba(7, 18, 32, .5);
  padding: 10px;
}

.team-stat-grid span,
.team-stat-grid small,
.team-short-odds span,
.team-short-odds small {
  display: block;
  color: var(--muted);
}

.team-stat-grid span,
.team-short-odds span {
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.team-stat-grid strong,
.team-short-odds strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  margin-bottom: 6px;
}

.team-stat-grid small,
.team-short-odds small {
  font-size: 12px;
  line-height: 1.35;
}

.team-short-odds {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.team-short-profit {
  flex: 0 0 auto;
  font-size: 20px !important;
  margin: 0 !important;
}

.team-short-profit.positive { color: var(--primary); }
.team-short-profit.negative { color: #ff4d57; }
.team-short-profit.neutral { color: var(--muted); }

.team-intel-empty {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.team-intel-empty strong {
  color: var(--text);
  font-size: 20px;
}

.team-intel-load-more {
  display: flex;
  justify-content: center;
  padding: 8px 0 18px;
}

.team-intel-load-more a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(34, 197, 94, .42);
  border-radius: 10px;
  background: rgba(34, 197, 94, .1);
  padding: 0 18px;
  color: #d8fbe5;
  font-weight: 900;
  text-decoration: none;
}

.team-intel-load-more a:hover {
  border-color: var(--primary);
  background: rgba(34, 197, 94, .16);
}

.team-memory-link,
.team-back-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: var(--primary);
  font-weight: 900;
  text-decoration: none;
}

.team-memory-link {
  justify-self: start;
  border-bottom: 1px solid currentColor;
}

.team-memory-link:hover,
.team-back-link:hover {
  color: #66f59a;
}

.team-detail-page {
  gap: 18px;
}

.team-detail-hero {
  align-items: center;
}

.team-detail-form {
  margin-top: 14px;
}

.team-index-card {
  min-width: 210px;
  border-radius: 18px;
  padding: 18px;
}

.team-index-card span,
.team-index-card small {
  display: block;
  font-size: 12px;
  font-weight: 850;
}

.team-index-card span {
  color: var(--muted);
  text-transform: uppercase;
}

.team-index-card strong {
  display: block;
  margin: 8px 0;
  color: var(--text);
  font-size: 48px;
  line-height: 1;
}

.team-detail-filters {
  align-items: end;
}

.team-detail-summary,
.team-detail-grid {
  display: grid;
  gap: 14px;
}

.team-detail-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.team-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.team-detail-summary-card,
.team-detail-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(10, 22, 38, 0.8);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
}

.team-detail-summary-card {
  padding: 16px;
}

.team-detail-summary-card span,
.team-detail-summary-card small {
  display: block;
  color: var(--muted);
}

.team-detail-summary-card span {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.team-detail-summary-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.team-detail-panel {
  overflow: hidden;
}

.team-detail-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 16px 18px;
}

.team-detail-panel-head h2 {
  margin: 0;
  font-size: 22px;
}

.team-detail-panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.team-split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.team-split-card,
.team-ai-placeholder {
  border: 1px solid rgba(52, 71, 92, .72);
  border-radius: 14px;
  background: rgba(7, 18, 32, .5);
  padding: 14px;
}

.team-split-card span,
.team-split-card small,
.team-split-card em {
  display: block;
  color: var(--muted);
}

.team-split-card span {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.team-split-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 26px;
  line-height: 1;
}

.team-split-card em {
  margin-top: 8px;
  font-style: normal;
  font-size: 12px;
}

.team-ai-placeholder {
  margin: 16px;
  color: var(--muted);
}

.team-ai-placeholder strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 18px;
}

.team-ai-placeholder p {
  margin: 0 0 14px;
  line-height: 1.5;
}

.team-ai-placeholder button {
  height: 40px;
  border: 1px solid #34475c;
  border-radius: 9px;
  background: rgba(148, 163, 184, .08);
  padding: 0 14px;
  color: var(--muted);
  font: inherit;
  font-weight: 850;
  cursor: not-allowed;
}

.team-memory-table-wrap {
  overflow-x: auto;
}

.team-memory-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.team-memory-table th,
.team-memory-table td {
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  text-align: right;
  vertical-align: middle;
}

.team-memory-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.team-memory-table td {
  font-size: 13px;
}

.team-memory-table th:first-child,
.team-memory-table td:first-child,
.team-memory-table th:nth-child(2),
.team-memory-table td:nth-child(2),
.team-memory-table th:nth-child(3),
.team-memory-table td:nth-child(3) {
  text-align: left;
}

.team-memory-table .positive,
.team-match-row .positive {
  color: var(--primary);
  font-weight: 900;
}

.team-memory-table .negative,
.team-match-row .negative {
  color: #ff737b;
  font-weight: 900;
}

.team-memory-table .neutral,
.team-match-row .neutral {
  color: var(--muted);
  font-weight: 850;
}

.team-match-list {
  display: grid;
}

.team-match-row {
  display: grid;
  grid-template-columns: 92px 1.3fr 1.4fr auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 13px 16px;
  color: var(--text);
  text-decoration: none;
}

.team-match-row:hover {
  background: rgba(34, 197, 94, .06);
}

.team-match-row-danger:hover {
  background: rgba(248, 113, 113, .06);
}

.team-match-row span,
.team-match-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.team-match-row strong {
  color: var(--text);
  font-size: 13px;
}

.team-match-row b {
  justify-self: end;
  white-space: nowrap;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .team-intel-grid {
    grid-template-columns: 1fr;
  }

  .team-detail-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .team-intelligence-page-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .team-intel-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .team-intel-hero-card {
    min-width: 0;
  }

  .team-intel-filters {
    padding: 14px;
  }

  .team-intel-filters label,
  .team-intel-filters .team-intel-filter-search,
  .team-intel-filters .team-intel-filter-league,
  .team-intel-filters .team-intel-filter-small {
    flex: 1 1 100%;
    width: 100%;
  }

  .team-intel-actions {
    width: 100%;
  }

  .team-intel-actions button {
    flex: 1 1 auto;
  }

  .team-intel-note {
    align-items: start;
    flex-direction: column;
  }

  .team-card-main,
  .team-short-odds {
    align-items: start;
    flex-direction: column;
  }

  .team-detail-summary,
  .team-split-grid {
    grid-template-columns: 1fr;
  }

  .team-detail-panel-head,
  .team-detail-hero {
    align-items: start;
    flex-direction: column;
  }

  .team-index-card {
    min-width: 0;
    width: 100%;
  }

  .team-match-row {
    grid-template-columns: 1fr;
  }

  .team-match-row b {
    justify-self: start;
  }

  .team-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .team-stat-grid {
    grid-template-columns: 1fr;
  }
}
