/* =========================================================================
   team.css — team page: hero with team colors, squad cards with aura.
   Inspired by CastoloFC pn-team-hero / pn-squad-card.
   Reads colors from tokens.css; team-specific palette via --tm-* vars set inline.
   ========================================================================= */

/* ---------------------------------------------------------------------------
   Team Hero — uses --tm-primary and --tm-secondary set inline per team
   --------------------------------------------------------------------------- */
.tm-hero {
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: stretch;
  position: relative;
  min-height: 200px;
  background: var(--tm-secondary, #0f172a);
}

.tm-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 100% at 0% 100%, var(--tm-primary-alpha, rgba(255,87,34,0.25)) 0%, transparent 70%),
    linear-gradient(135deg, var(--tm-secondary-dark, #0a0f1e) 0%, var(--tm-secondary, #0f172a) 100%);
}

.tm-hero-watermark {
  position: absolute;
  right: -10px;
  bottom: -20px;
  font-family: var(--font-display);
  font-size: 130px;
  font-weight: 600;
  color: #fff;
  opacity: 0.04;
  line-height: 1;
  user-select: none;
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
}

.tm-hero-crest {
  position: relative;
  z-index: 1;
  width: 180px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 8px 28px 28px;
}

.tm-hero-crest img {
  width: clamp(90px, 12vw, 140px);
  height: clamp(90px, 12vw, 140px);
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.6));
}

.tm-hero-crest-placeholder {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.tm-hero-info {
  position: relative;
  z-index: 1;
  padding: 28px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.tm-hero-name {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: #fff;
  line-height: 1.05;
  margin: 0 0 6px;
  font-weight: 600;
}

.tm-hero-sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--tm-primary, var(--color-soft));
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 18px;
  opacity: 0.85;
}

.tm-hero-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.tm-hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tm-hero-meta-key {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tm-primary, var(--color-primary));
  opacity: 0.7;
}

.tm-hero-meta-val {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

/* ---------------------------------------------------------------------------
   Season Stats Strip (below hero, same dark card)
   --------------------------------------------------------------------------- */
.tm-stats-strip {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 8px;
}

.tm-stats-strip-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--tm-primary, var(--color-primary));
  opacity: 0.7;
  margin-right: 12px;
  white-space: nowrap;
}

.tm-stats-strip-list {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.tm-stats-strip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.tm-stats-strip-val {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  line-height: 1;
}

.tm-stats-strip-key {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.4);
}

/* ---------------------------------------------------------------------------
   Section Title
   --------------------------------------------------------------------------- */
.tm-section-title {
  display: flex;
  align-items: center;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--color-soft-translucent);
}

.tm-section-title h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink-strong);
  text-shadow: 1px 0 0 currentColor;
}

/* ---------------------------------------------------------------------------
   Next Match Panel
   --------------------------------------------------------------------------- */
.tm-next-match-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.tm-next-match-comp {
  font-size: 11px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  text-align: center;
}

.tm-next-match-teams {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  justify-content: center;
}

.tm-next-match-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 140px;
}

.tm-next-match-team img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 8px;
}

.tm-next-match-team-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-strong);
  text-align: center;
  text-shadow: 1px 0 0 currentColor;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.tm-next-match-vs {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink-muted);
  font-weight: 600;
  flex-shrink: 0;
}

.tm-next-match-when {
  background: var(--surface-muted);
  border: 1px solid var(--line-warm);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  text-align: center;
  width: 100%;
}

.tm-next-match-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
  display: block;
}

.tm-next-match-time {
  font-size: 12px;
  color: var(--ink-muted);
  display: block;
  margin-top: 2px;
}

/* ---------------------------------------------------------------------------
   Roster title
   --------------------------------------------------------------------------- */
.tm-roster-title {
  margin: 0 0 16px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink-strong);
  text-shadow: 1px 0 0 currentColor;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-soft-translucent);
}

/* ---------------------------------------------------------------------------
   Squad Group Labels
   --------------------------------------------------------------------------- */
.sc-group { margin-bottom: 20px; }
.sc-group:last-child { margin-bottom: 0; }

.sc-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-muted);
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 10px;
}

/* ---------------------------------------------------------------------------
   Squad Cards — castolo pn-squad-card style, hooperstats orange palette
   --------------------------------------------------------------------------- */
.sc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.sc-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-soft-translucent);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}

.sc-card:hover {
  background: var(--surface-muted);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-left-color: var(--color-primary);
}

/* Header row */
.sc-header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
}

.sc-avatar {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin: 8px 10px 8px 12px;
  flex-shrink: 0;
  overflow: visible;
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.sc-dorsal {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: var(--color-primary);
  color: var(--color-soft);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: var(--radius-pill);
  line-height: 1;
  letter-spacing: 0.3px;
}

.sc-info {
  flex: 1;
  min-width: 0;
  padding: 8px 10px 8px 4px;
}

.sc-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  margin-bottom: 3px;
  text-shadow: 1px 0 0 currentColor;
}

.sc-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Position badge — orange family, single consistent palette */
.sc-pos {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: var(--color-soft-translucent);
  color: var(--color-primary);
  border: 1px solid var(--line-warm);
}

.sc-gp {
  font-size: 11px;
  color: var(--ink-muted);
}

/* Stats row: PTS · REB · AST · MIN */
.sc-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line-soft);
}

.sc-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 7px 2px;
  border-right: 1px solid var(--line-soft);
}

.sc-stat:last-child { border-right: 0; }

.sc-stat-val {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-strong);
  line-height: 1;
}

.sc-stat-key {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--ink-muted);
}

/* Aura / Rating row */
.sc-aura {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--surface-muted);
}

.sc-aura-key {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-muted);
  white-space: nowrap;
}

.sc-aura-bar-wrap {
  position: relative;
  height: 6px;
  background: var(--line-soft);
  border-radius: 3px;
  overflow: visible;
}

.sc-aura-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--color-soft-translucent) 0%, var(--color-primary) 100%);
}

.sc-aura-tick {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  background: var(--color-primary);
  border: 2px solid var(--surface);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.sc-aura-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
  text-align: right;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .tm-hero {
    flex-direction: column;
    min-height: auto;
  }

  .tm-hero-crest {
    width: 100%;
    padding: 24px 20px 12px;
    justify-content: flex-start;
  }

  .tm-hero-crest img { width: 80px; height: 80px; }
  .tm-hero-info { padding: 0 20px 24px; }
  .tm-hero-name { font-size: clamp(1.5rem, 6vw, 2rem); }
  .tm-hero-meta { gap: 14px; }
  .tm-hero-watermark { font-size: 80px; }

  .tm-stats-strip { padding: 12px 16px; }
  .tm-stats-strip-list { gap: 18px; }
  .tm-stats-strip-val { font-size: 20px; }

  .sc-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width: 480px) {
  .tm-hero-crest { padding: 20px 16px 8px; }
  .tm-hero-info { padding: 0 16px 20px; }
  .tm-stats-strip-label { width: 100%; margin-right: 0; margin-bottom: 4px; }
  .sc-grid { grid-template-columns: 1fr; }
  .tm-next-match-team img { width: 40px; height: 40px; }
}
