/* ===== Team pages ===== */

/* ----- All teams, by division ----- */
.tm-divisions { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.tm-div h2 { margin: 0 0 .5rem; font-family: var(--display); font-stretch: 72%; font-style: italic; font-size: 1.2rem; text-transform: uppercase; color: var(--red); }
.tm-div ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.tm-div a {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: .6rem;
  padding: .45rem .6rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--team);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
}
.tm-div a:hover { background: var(--surface); }
.tm-pick-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-rec { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ----- Logos (team color circle with the code if the logo file is missing) ----- */
.tm-logo { width: 44px; height: 44px; object-fit: contain; flex: none; }
.tm-logo.small { width: 36px; height: 36px; }
.tm-logo.large { width: 96px; height: 96px; }
.tm-logo-fallback {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--team, var(--black));
  color: var(--team-ink, var(--white));
  box-shadow: inset 0 0 0 3px var(--team-2, transparent);
  font-size: .75rem;
  font-weight: 700;
}
.tm-logo.large.tm-logo-fallback { font-size: 1.6rem; background: rgba(255, 255, 255, .15); color: #fff; }

/* ----- Team header in team colors ----- */
.tm-hero {
  margin: -.5rem 0 1.25rem;
  padding: 1.1rem 1.4rem 1.4rem;
  border-radius: 14px;
  border-bottom: 6px solid var(--team-2);
  background: linear-gradient(120deg, var(--team), color-mix(in srgb, var(--team) 45%, #000));
  color: var(--team-ink);
}
.tm-back { display: inline-block; margin-bottom: .6rem; color: inherit; opacity: .85; font-size: .85rem; font-weight: 700; text-decoration: none; }
.tm-back:hover { opacity: 1; text-decoration: underline; }
.tm-hero-row { display: flex; align-items: center; gap: 1.1rem; }
.tm-hero-kicker { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.tm-hero-name { margin: .1rem 0 .35rem; font-family: var(--display); font-stretch: 72%; font-style: italic; font-weight: 800; font-size: 3rem; line-height: .95; text-transform: uppercase; }
.tm-hero-name span { display: block; font-size: .5em; opacity: .85; }
.tm-hero-facts { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; margin: 0; font-size: .95rem; }

/* ----- Layout ----- */
.tm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 1rem; align-items: start; }
.tm-main, .tm-side { display: grid; gap: 1rem; }
.tm-side { position: sticky; top: calc(var(--nav-height) + 1rem); }
.tm-card { padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.tm-card h2 { margin: 0 0 .7rem; font-family: var(--display); font-stretch: 72%; font-style: italic; font-size: 1.35rem; text-transform: uppercase; }
.tm-card h3 { margin: .8rem 0 .4rem; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--red); }
.tm-card h3 small { color: var(--subtle); letter-spacing: 0; text-transform: none; font-weight: 600; }
.tm-muted { margin: .6rem 0 0; color: var(--subtle); font-size: .84rem; }
.tm-card a { color: var(--ink); }
.tm-card a:hover { color: var(--red); }

/* Needs */
.tm-needs { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.tm-needs li { display: grid; grid-template-columns: 1.6rem 3.2rem minmax(0, 1fr) minmax(80px, 30%); align-items: center; gap: .5rem; }
.tm-need-rank { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--red); color: var(--white); font-size: .75rem; font-weight: 700; }
.tm-needs small { color: var(--subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-need-bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.tm-need-bar i { display: block; height: 100%; background: var(--red); }

/* Picks */
.tm-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.tm-pick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.tm-pick-list li { display: flex; align-items: baseline; gap: .5rem; padding: .3rem .5rem; border-radius: 6px; background: var(--surface); font-size: .9rem; }
.tm-pick-list span { min-width: 2.6rem; color: var(--subtle); font-weight: 700; font-size: .8rem; }
.tm-pick-list small { margin-left: auto; color: var(--subtle); }

/* Habits */
.tm-gm { margin: 0 0 .5rem; }
.tm-facts, .tm-tend { margin: 0; padding-left: 1.1rem; display: grid; gap: .3rem; }
.tm-tend li { font-size: .9rem; color: var(--muted); }

/* Recent drafts */
.tm-draft { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.tm-draft li { display: grid; grid-template-columns: 5.4rem auto auto minmax(0, 1fr); align-items: baseline; gap: .45rem; font-size: .9rem; }
.tm-draft small { color: var(--subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-rd { color: var(--subtle); font-weight: 700; font-size: .8rem; }

/* Lineup */
.tm-lineup { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.tm-lineup li { display: flex; align-items: center; gap: .5rem; padding: .25rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.tm-spot { min-width: 2.6rem; color: var(--subtle); font-weight: 700; font-size: .78rem; }
.tm-flag { margin-left: auto; padding: 0 .35rem; border-radius: 4px; background: var(--surface-2); color: var(--muted); font-size: .66rem; font-weight: 700; text-transform: uppercase; }
.tm-flag.hurt { background: var(--red-soft); color: var(--red); }
.tm-flag + .tm-flag { margin-left: .25rem; }

.pos-tag { display: inline-block; padding: 0 .3rem; border-radius: 3px; background: var(--black); color: var(--white); font-size: .66rem; font-weight: 700; }

@media (max-width: 900px) {
  .tm-grid { grid-template-columns: minmax(0, 1fr); }
  .tm-side { position: static; }
}
@media (max-width: 600px) {
  .tm-hero-name { font-size: 2.2rem; }
  .tm-logo.large { width: 64px; height: 64px; }
  .tm-picks { grid-template-columns: minmax(0, 1fr); }
  .tm-draft li { grid-template-columns: 4.6rem auto minmax(0, 1fr); }
  .tm-draft small { display: none; }
}

/* Team logos sit on a light disc with a ring in the team's second color, so every logo stands out
   on its own team color (Jets green on Jets green) and on the dark theme */
img.tm-logo {
  box-sizing: border-box;
  padding: 6px;
  border-radius: 50%;
  background: #f7f7f4;
  box-shadow: 0 0 0 2px var(--team-2, var(--line)), 0 4px 12px rgba(0, 0, 0, .25);
}
img.tm-logo.small { padding: 5px; }
img.tm-logo.large { padding: 12px; box-shadow: 0 0 0 4px var(--team-2, #fff), 0 8px 22px rgba(0, 0, 0, .35); }
