/* Team hub — Fandom-aligned layout */

body.team-page {
  overflow-x: hidden;
}

body.team-page .tm-page {
  padding: 12px 0 72px;
}

body.team-page .tm-layout {
  grid-template-columns: 260px minmax(0, 1fr) 300px;
  gap: 24px;
  max-width: 1240px;
  align-items: start;
}

body.team-page .tm-center {
  min-width: 0;
}

body.team-page .tm-center-page {
  max-width: none;
  margin: 0;
  padding: 0;
}

body.team-page .tm-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tm-rail-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
}

.tm-rail-card--action {
  border-color: rgba(0, 194, 203, 0.22);
}

.tm-rail-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 10px;
}

.tm-rail-flag {
  display: block;
  width: 48px;
  height: auto;
  border-radius: 4px;
  margin-bottom: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.tm-rail-team-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  margin: 0 0 10px;
}

.tm-rail-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tm-rail-actions .btn {
  width: 100%;
  justify-content: center;
}

.tm-rail-link {
  color: var(--teal, #00C2CB);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.tm-rail-link:hover,
.tm-rail-link:focus-visible {
  color: var(--teal, #00C2CB);
  opacity: 0.88;
  text-decoration: none;
}

.tm-rail-empty {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}

.tm-rail-facts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tm-rail-fact {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-size: 13px;
}

.tm-rail-fact-label {
  color: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}

.tm-rail-fact-value {
  color: rgba(255, 255, 255, 0.88);
  text-align: right;
  flex: 1 1 auto;
  min-width: 0;
}

.tm-rail-match {
  display: block;
  text-decoration: none;
  color: inherit;
}

.tm-rail-match-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.tm-rail-match-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 6px;
}

.tm-rail-group-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tm-rail-group-list a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 13px;
}

.tm-rail-group-list a:hover,
.tm-rail-group-list a:focus-visible {
  color: var(--teal, #00C2CB);
  text-decoration: none;
}

.tm-rail-player {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tm-rail-player:last-child {
  border-bottom: none;
}

/* Breadcrumbs */
.tm-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.tm-crumbs a {
  color: var(--teal, #00C2CB);
  text-decoration: none;
}

.tm-crumbs a:hover,
.tm-crumbs a:focus-visible {
  color: var(--teal, #00C2CB);
  opacity: 0.88;
  text-decoration: none;
}

.tm-crumb-sep { opacity: 0.45; }

/* Hero */
.tm-hero {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 42%, rgba(0, 0, 0, 0.18) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
}

.tm-hero-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.tm-hero-flag {
  width: 48px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.tm-hero-flag-link {
  display: block;
  line-height: 0;
  text-decoration: none;
}

.tm-hero-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  color: #fff;
  line-height: 1.05;
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.tm-hero-context {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin: 0 0 8px;
}

.tm-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tm-hero-chip {
  display: inline-flex;
  align-items: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 4px 10px;
}

.tm-hero-chip--accent {
  color: var(--teal, #00C2CB);
  border-color: rgba(0, 194, 203, 0.28);
  background: rgba(0, 194, 203, 0.06);
}

.tm-hero-meta-line {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 12px;
}

.tm-hero-meta-line strong {
  color: #fff;
  font-weight: 600;
}

.tm-hero-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.tm-hero-tile {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 0;
}

.tm-hero-tile-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 2px;
}

.tm-hero-tile-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tm-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* Favorito vive en left rail; centro solo Follow + Share en desktop */
body.team-page .tm-hero-cta .fav-team-bar[hidden] {
  display: none !important;
}

/* Tabs */
.tm-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
  scrollbar-width: none;
}

.tm-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255, 255, 255, 0.55);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 14px;
  margin: 0;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.tm-tab:hover,
.tm-tab:focus-visible {
  color: rgba(255, 255, 255, 0.88);
}

.tm-tab.is-active {
  color: var(--teal, #00C2CB);
  border-bottom-color: var(--teal, #00C2CB);
}

/* Panels / modules */
.tm-panel[hidden] { display: none !important; }

.tm-sec {
  margin-bottom: 20px;
}

.tm-sec-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.tm-module-marker {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--teal, #00C2CB);
  flex-shrink: 0;
}

.tm-sec-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  margin: 0;
}

.tm-sec-body {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 14px 16px;
}

.tm-sec-body p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
}

.tm-sec-body p:last-child { margin-bottom: 0; }

.tm-empty {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}

/* Match cards */
.tm-match-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tm-match-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 0.15s;
}

.tm-match-card:hover,
.tm-match-card:focus-visible {
  border-color: rgba(0, 194, 203, 0.28);
  text-decoration: none;
}

.tm-match-card.is-live {
  border-color: rgba(0, 194, 203, 0.35);
}

.tm-match-meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 6px;
}

.tm-match-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tm-match-team {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
}

.tm-match-team span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tm-match-mid {
  text-align: center;
  flex-shrink: 0;
  padding: 0 6px;
}

.tm-match-score {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--teal, #00C2CB);
  line-height: 1;
}

.tm-match-vs {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 600;
}

.tm-match-live {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal, #00C2CB);
}

.tm-match-venue {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 6px;
}

.tm-match-flag {
  width: 22px;
  height: auto;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Form strip */
.tm-form-strip {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.tm-form-pill {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.55);
}

.tm-form-pill--w { background: rgba(0, 194, 203, 0.15); color: var(--teal, #00C2CB); }
.tm-form-pill--d { background: rgba(255, 255, 255, 0.08); }
.tm-form-pill--l { background: rgba(255, 100, 100, 0.12); color: #ff8a8a; }

/* Standings table */
.tm-table-wrap { overflow-x: auto; }

.tm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tm-table th,
.tm-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tm-table th {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.tm-table tr.tm-table-hl td {
  color: var(--teal, #00C2CB);
  font-weight: 600;
}

/* Team Stats: Offense / Defense blocks and Team Leaders (team entity page
   v6, PART B). Hairline dividers, same tile surface as .tm-stat-tile. */
.tm-side-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.tm-side-block {
  background: var(--white-04);
  border: 1px solid var(--white-10);
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
}

.tm-side-title {
  margin: 0 0 8px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
}

.tm-side-list { margin: 0; }

.tm-side-row,
.tm-leader-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid var(--white-10);
  color: var(--white-70);
  font-size: 14px;
}

.tm-side-row:first-child { border-top: 0; }
.tm-side-row dt { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.tm-side-row dd,
.tm-leader-val {
  margin: 0;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}

.tm-leader-stat + .tm-leader-stat { margin-top: 10px; }

.tm-leader-name {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white-50);
}

.tm-leader-list { margin: 0; padding: 0; list-style: none; }
.tm-leader-player { min-width: 0; overflow-wrap: anywhere; }

.tm-info-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  border: 1px solid var(--white-30);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: var(--white-70);
  cursor: help;
  vertical-align: middle;
}

/* Advanced Stats (PART C): a centered bordered pill that expands in place.
   Standing UI rule, Kevin's v6 correction: a future Full Stats entry point
   must NOT reuse this pill treatment beside it (two same-shape bordered
   pills side by side read as "two dropdowns"). */
.tm-adv { margin-top: 16px; text-align: center; }

.tm-adv-toggle {
  display: inline-block;
  min-height: 44px;
  padding: 10px 20px;
  background: transparent;
  border: 1px solid var(--white-30);
  border-radius: 999px;
  color: var(--white);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.tm-adv-toggle:hover,
.tm-adv-toggle:focus-visible { border-color: var(--teal); }
.tm-adv-toggle[aria-expanded="true"] { border-color: var(--teal); }

.tm-adv-region { margin-top: 12px; text-align: left; }

/* Roster */
.tm-roster-group {
  margin-bottom: 14px;
}

.tm-roster-group:last-child { margin-bottom: 0; }

.tm-roster-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 6px;
}

.tm-roster-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Stats grid */
.tm-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tm-stat-tile {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
}

.tm-stat-tile-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.tm-stat-tile-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

/* Coach */
.tm-coach-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tm-coach-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 194, 203, 0.12);
  border: 1px solid rgba(0, 194, 203, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--teal, #00C2CB);
}

.tm-coach-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 2px;
}

.tm-coach-role {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
}

/* Fan takes */
.tm-fan-takes-composer {
  margin-bottom: 16px;
}

.tm-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tm-related-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}

.tm-related-card:hover,
.tm-related-card:focus-visible {
  border-color: rgba(0, 194, 203, 0.28);
  color: var(--teal, #00C2CB);
  text-decoration: none;
}

/* Generic / legacy team pages inside hub shell */
body.team-page .gtp-page,
body.team-page .page {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

body.team-page--generic .tm-layout {
  grid-template-columns: 1fr;
  max-width: 960px;
}

body.team-page--generic .tm-rail {
  display: none;
}

@media (max-width: 1100px) {
  body.team-page .tm-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  body.team-page .tm-rail.tm-rail:last-child,
  body.team-page .sf-feed-side--right {
    display: none;
  }
}

@media (max-width: 820px) {
  body.team-page .tm-layout {
    grid-template-columns: 1fr;
  }

  body.team-page .tm-rail.tm-rail:first-child,
  body.team-page .sf-feed-side--left {
    display: none;
  }

  .tm-hero-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tm-hero-top {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .tm-hero-chips {
    justify-content: center;
  }

  .tm-hero-cta {
    justify-content: center;
  }
}

/* Baseball consumer query box (js/baseball-query-ui.js) */
.bbq-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.bbq-input {
  flex: 1 1 auto;
  min-width: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  font-size: 14px;
}

.bbq-input:focus {
  outline: none;
  border-color: var(--teal, #00C2CB);
}

.bbq-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.bbq-submit {
  flex: 0 0 auto;
  background: var(--teal, #00C2CB);
  color: var(--navy, #0A1628);
  border: none;
  border-radius: 8px;
  padding: 0 18px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 13px;
  cursor: pointer;
}

.bbq-submit:disabled {
  opacity: 0.5;
  cursor: default;
}

.bbq-response:empty {
  display: none;
}

.bbq-answer {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 8px;
}

.bbq-loading {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}

.bbq-note {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.55);
  margin: 0 0 8px;
}

.bbq-source {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
}

.bbq-table-wrap {
  overflow-x: auto;
  margin: 0 0 10px;
}

.bbq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.bbq-table th,
.bbq-table td {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.bbq-table th {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.bbq-candidates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bbq-candidate {
  background: rgba(0, 194, 203, 0.08);
  border: 1px solid rgba(0, 194, 203, 0.28);
  color: var(--teal, #00C2CB);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}

.bbq-candidate:hover,
.bbq-candidate:focus-visible {
  background: rgba(0, 194, 203, 0.16);
}
