/* Your Team tab — themed per team via --t1/--t2/--t1-text set by js/team.js.
   Chrome (bg, surfaces, text) is shared with the rest of the site; team
   color only appears in the hero, badges, and section markers. */

:root {
  --t1: #000000;        /* team primary */
  --t2: #ffffff;        /* team secondary */
  --t1-text: #ffffff;   /* contrast text on primary (picked by js/team.js) */
  --t2-safe: #ffffff;   /* contrast-safe secondary for text (set by js/team.js) */
  --scrim-strong: rgba(0, 0, 0, 0.55); /* hero text-zone scrim (set by js/team.js) */
  --scrim-soft: rgba(0, 0, 0, 0.30);
  --scrim-clear: rgba(0, 0, 0, 0);
}

/* ---- Team hero ----
   AA-verified: directional scrim guarantees contrast for every team.
   Do not restyle text colors here without re-running the contrast audit. */
.team-hero {
  border: 1px solid var(--t1);
  background:
    linear-gradient(100deg, var(--scrim-strong) 0%, var(--scrim-strong) 40%, var(--scrim-soft) 65%, var(--scrim-clear) 85%),
    linear-gradient(135deg, var(--t1) 0%, var(--t2) 130%);
  border-radius: 16px;
  padding: 1.6rem;
  margin: 1.2rem 0 1.6rem;
  color: var(--t1-text);
}
.team-hero-top { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.1rem; }
.team-hero-logo { width: 64px; height: 64px; object-fit: contain; flex-shrink: 0; }
.team-hero .kicker { color: var(--t1-text); margin-bottom: 0.4rem; }
.team-hero h1 { margin: 0; font-size: var(--fs-3xl); letter-spacing: -0.02em; }
.team-blurb { margin: 0.45rem 0 0; font-style: italic; font-size: var(--fs-base); }

/* Team switcher dropdown */
.team-switch { position: relative; display: inline-flex; flex-direction: column; gap: 0.35rem; align-items: flex-start; }
.switch-label {
  font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--t1-text);
}
.team-btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  background: var(--t1-text); color: var(--t1);
  border: 1px solid currentColor; border-radius: var(--radius-pill);
  padding: 0.45rem 0.9rem; font-size: var(--fs-sm); font-weight: 700; cursor: pointer;
  box-shadow: 0 1px 5px rgb(0 0 0 / 0.28);
}
.team-btn:hover { filter: brightness(0.93); }
.team-btn img { width: 26px; height: 26px; object-fit: contain; }
.team-btn .caret { font-size: var(--fs-sm); opacity: 0.8; }
.team-menu {
  position: absolute; z-index: 50; top: calc(100% + 6px); left: 0;
  min-width: 240px; max-height: 320px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 0.35rem; box-shadow: var(--shadow-pop);
}
.team-menu button {
  display: flex; align-items: center; gap: 0.6rem; width: 100%;
  background: none; border: none; border-radius: var(--radius-control); cursor: pointer;
  color: var(--text); font-size: var(--fs-sm); font-weight: 600;
  padding: 0.45rem 0.6rem; text-align: left;
}
.team-menu button:hover { background: var(--surface-2); }
.team-menu button.current { background: var(--surface-2); outline: 1px solid var(--t1); }
.team-menu button img { width: 24px; height: 24px; object-fit: contain; flex-shrink: 0; }
.team-menu button .tabbr { margin-left: auto; color: var(--muted); font-size: var(--fs-xs); font-weight: 700; }

/* ---- Snapshot cards ---- */
.snap-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin-bottom: 2rem;
}
.snap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 1rem 1.1rem;
}
.snap .k { font-size: var(--fs-xs); color: var(--muted); letter-spacing: 0.08em; font-weight: 700; margin-bottom: 0.35rem; text-transform: uppercase; }
.snap .v { font-size: var(--fs-2xl); font-weight: 800; }
.snap .d { color: var(--muted); font-size: var(--fs-sm); margin-top: 0.25rem; }
.snap.next { border-color: var(--t1); box-shadow: inset 0 0 0 1px var(--t1); }

/* ---- Recent games ---- */
.game-row {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.55rem 0; border-top: 1px solid var(--border);
  font-size: var(--fs-sm);
}
.badge {
  flex-shrink: 0; width: 1.7rem; height: 1.7rem; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: var(--fs-sm);
}
/* Result colors are fixed league-wide: green = win, red = loss,
   whatever the team's own colors are. White letters pass AA on both
   (#15803d: 5.02:1; var(--red): 4.83:1, same pairing as the LIVE pill). */
.badge.w { background: #15803d; color: #fff; }
.badge.l { background: var(--red); color: #fff; }
.pre-tag {
  flex-shrink: 0;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0.1rem 0.5rem;
  white-space: nowrap;
}
.game-row .gdate { color: var(--muted); font-size: var(--fs-xs); width: 4.6rem; flex-shrink: 0; }
.game-row .gopp { flex: 1; font-weight: 600; }
.game-row .gscore { color: var(--muted); }
.game-row a { color: var(--text); font-size: var(--fs-sm); }
.game-row a:hover { color: var(--accent); }

/* ---- Spotlights ---- */
.spot {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 1rem 1.1rem; margin-bottom: 1rem;
}
.spot h3 { margin: 0 0 0.7rem; font-size: var(--fs-base); }
.spot h3 a.spot-date { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 0.18em; }
.spot h3 a.spot-date:hover { color: var(--accent); }
.spot-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .spot-cols { grid-template-columns: 1fr; } }
.spot h4 { margin: 0 0 0.45rem; font-size: var(--fs-xs); letter-spacing: 0.06em; color: var(--t2-safe, var(--t2)); text-transform: uppercase; }
.spot h4.villain { color: var(--text); }
.srow { display: flex; gap: 0.5rem; align-items: baseline; padding: 0.28rem 0; font-size: var(--fs-sm); border-top: 1px solid var(--border); }
.srow:first-of-type { border-top: none; }
.srow .sn { font-weight: 700; }
.srow .sn a { color: inherit; text-decoration: none; }
.srow .sn a:hover { color: var(--accent); text-decoration: underline; }
.srow .sl { color: var(--muted); font-size: var(--fs-xs); }

/* ---- Roster table ---- */
table.nice { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); margin-bottom: 2rem; }
table.nice th, table.nice td { text-align: right; padding: 0.45rem 0.5rem; border-top: 1px solid var(--border); }
table.nice th:first-child, table.nice td:first-child { text-align: left; }
table.nice th { color: var(--muted); font-size: var(--fs-xs); letter-spacing: 0.05em; border-top: none; text-transform: uppercase; }
table.nice td.pname { font-weight: 700; text-align: left; }
table.nice td.pos, table.nice th.pos { text-align: center; }
/* Frozen identity columns: the jersey # and player name stay pinned
   while the stat columns scroll sideways inside .table-wrap. Sticky
   cells need an opaque background or the scrolling stats show through —
   the roster table sits directly on the page background, so use --bg.
   The name column's left offset is the # column's fixed width. */
table.nice th:first-child, table.nice td:first-child {
  position: sticky; left: 0; z-index: 1;
  width: 2.6rem; min-width: 2.6rem;
  background: var(--bg);
}
table.nice th:nth-child(2), table.nice td.pname {
  position: sticky; left: 2.6rem; z-index: 1;
  background: var(--bg);
  white-space: nowrap;
  box-shadow: 1px 0 0 var(--border-strong);
}
table.nice thead th:first-child, table.nice thead th:nth-child(2) { z-index: 2; }

/* ---- Team sections ---- */
.team-section { margin-bottom: 0.5rem; }
.team-section > h2 { margin: 2.5rem 0 0.2rem; }
.team-section > h2::before {
  content: ""; display: inline-block; width: 0.45rem; height: 1.1em;
  background: var(--t1); border-radius: 3px; margin-right: 0.5rem; vertical-align: -0.15em;
}
.team-section > .muted { margin: 0 0 0.9rem; }

/* ---- Mobile ---- */
@media (max-width: 700px) {
  .team-hero { padding: 1.2rem; margin: 1rem 0 1.3rem; }
  .team-hero h1 { font-size: var(--fs-xl); }
  .team-hero-logo { width: 48px; height: 48px; }

  /* Snapshot cards go two-across */
  .snap-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.7rem; }
  .snap { padding: 0.8rem 0.9rem; }
  .snap .v { font-size: var(--fs-xl); }

  .game-row { flex-wrap: wrap; row-gap: 0.35rem; column-gap: 0.6rem; }
  .game-row .gdate { width: 3.6rem; }
  .game-row .gopp { flex: 1 1 auto; min-width: 0; white-space: nowrap; }
  /* When the Preseason tag and Box score link can't fit next to the
     score, they wrap onto a right-aligned second line — the opponent
     ("vs XXX") is never cut off again. */
  .game-row .pre-tag, .game-row a { margin-left: auto; }
  .game-row .pre-tag ~ a { margin-left: 0; }
  .game-row a { white-space: nowrap; }

  .spot { padding: 0.85rem 0.9rem; }
}
