/* Billionaires Digest v3: My team (team.html). Needs tokens.css + ui.css. Prefix: tm-.
   No team: fantasy landing (hero band + three action cards). With a team: approved concept 06 — dark score card vs the
   S&P 500, starting five table, season card; right column with next round, team news and leagues. */

.tm-main { padding-top: 0; }
.tm-main > .v2-wrap { padding-top: var(--s2); }
.tm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--gutter); align-items: start; }
.tm-colmain, .tm-colside { display: flex; flex-direction: column; gap: var(--gutter); min-width: 0; }
@media (max-width: 1023px) { .tm-layout { grid-template-columns: minmax(0, 1fr); } }

/* ---------- landing ---------- */
.tm-land {
  position: relative; overflow: hidden; color: #fff; text-align: center;
  background-color: #1A1C20;
  background-image:
    radial-gradient(ellipse 60% 90% at 50% 40%, rgba(214, 45, 39, .38) 0%, rgba(214, 45, 39, 0) 70%),
    repeating-linear-gradient(60deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(-60deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 22px);
  padding: var(--s5) 0 var(--s4);
}
.tm-land__in { max-width: 1000px; }
.tm-land__kick { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 var(--s1); font-size: var(--fs-sm); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #fff; }
.tm-land__kick::before { content: 'BD'; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; background: var(--brand); border-radius: 3px; font-family: var(--font-display); font-weight: var(--fw-display); font-size: 19px; letter-spacing: 0; }
.tm-land__h { font-family: var(--font-display); font-weight: var(--fw-display); font-size: 54px; line-height: 1; margin: 0 auto 12px; max-width: 24ch; }
.tm-land__dek { font-size: 20px; font-weight: 700; color: #FFD7D5; margin: 0 0 var(--s3); }
.tm-land__cards { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s1); text-align: center; }
.tm-land__card { background: #fff; color: #121417; border-radius: var(--radius-card); padding: var(--s2) var(--s1) var(--s1); box-shadow: 0 6px 24px rgba(0, 0, 0, .3); }
.tm-land__card p { margin: 12px 0 0; font-size: var(--fs-md); color: #555C66; }
.tm-land__card :focus-visible { outline-color: #2359C4; }
.tm-land__practice { margin: var(--s3) 0 0; font-size: var(--fs-lg); color: #fff; }
.tm-land__practice a { color: #fff; font-weight: 700; text-underline-offset: 3px; }
.tm-land :focus-visible { outline-color: #8AB4FF; }
.tm-land__more { margin-bottom: var(--s2); }
.tm-how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); }
.tm-how__i { background: var(--card); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: var(--s2); }
.tm-how__i p { margin: 6px 0 0; color: var(--text-muted); }
.tm-how__n { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; font-family: var(--font-display); font-weight: var(--fw-display); font-size: 20px; margin-bottom: 10px; }
.tm-land__next { margin: var(--s2) 0 0; color: var(--text-muted); }
.tm-land__next a { color: var(--link); font-weight: 600; }
@media (max-width: 767px) {
  .tm-land { padding: var(--s3) 0 var(--s3); }
  .tm-land__h { font-size: 36px; }
  .tm-land__dek { font-size: var(--fs-lg); margin-bottom: var(--s2); }
  .tm-land__cards, .tm-how { grid-template-columns: minmax(0, 1fr); }
  .tm-land__practice { margin-top: var(--s2); font-size: var(--fs-md); }
}

/* ---------- dark score card ---------- */
.tm-score {
  --text: #FFFFFF; --text-muted: #B9BFC7; --positive: #3CC985; --negative: #FF6B64;
  background: var(--ink-2); color: #fff; border-radius: var(--radius-card); padding: var(--s2) var(--s3) var(--s3); box-shadow: var(--shadow);
}
.tm-score :focus-visible { outline-color: #8AB4FF; }
.tm-score__top { display: flex; justify-content: space-between; align-items: center; gap: var(--s1); flex-wrap: wrap; margin-bottom: 6px; }
.tm-score__k { display: block; font-size: var(--fs-sm); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #D5D9DE; }
.tm-score__grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s3); align-items: end; }
.tm-score__name { font-family: var(--font-display); font-weight: var(--fw-display); font-size: 48px; line-height: 1; text-transform: uppercase; overflow-wrap: anywhere; }
.tm-scout { display: inline-flex; margin-top: 8px; text-decoration: none; }
.tm-scout:hover { text-decoration: underline; }
.tm-score__row { display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; margin-top: 8px; }
.tm-score__big { font-family: var(--font-display); font-weight: var(--fw-display); font-size: 104px; line-height: .85; letter-spacing: -.01em; }
.tm-score__unit { font-size: var(--fs-sm); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #D5D9DE; }
.tm-score__vs { display: flex; flex-direction: column; gap: 6px; border-left: 1px solid #33373C; padding-left: var(--s3); }
.tm-score__diff { font-family: var(--font-display); font-weight: var(--fw-display); font-size: 64px; line-height: .95; }
.tm-score__sub { color: #D5D9DE; }
.tm-score__note { margin: var(--s2) 0 0; padding-top: 12px; border-top: 1px solid #33373C; color: #D5D9DE; font-size: var(--fs-sm); }
@media (max-width: 767px) {
  .tm-score { padding: var(--s1); }
  .tm-score__grid { grid-template-columns: minmax(0, 1fr); gap: var(--s1); }
  .tm-score__name { font-size: 34px; }
  .tm-score__big { font-size: 72px; }
  .tm-score__vs { border-left: 0; padding-left: 0; border-top: 1px solid #33373C; padding-top: 12px; }
  .tm-score__diff { font-size: 44px; }
}

/* ---------- starting five table ---------- */
.tm-tablewrap { overflow-x: auto; }
.tm-table th[scope="row"] { font-weight: 400; text-align: left; padding-left: 0; }
.tm-table tbody tr.is-captain th, .tm-table tbody tr.is-captain td { background: transparent; }
.tm-name {
  display: inline-block; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: left;
  font-size: var(--fs-md); font-weight: 700; color: var(--text); line-height: 1.25; min-height: 24px;
}
.tm-name:hover { text-decoration: underline; text-underline-offset: 2px; }
.tm-table .v2-player { min-height: var(--tap); }
.tm-table td.n { font-size: var(--fs-lg); }
.tm-hint { margin: 10px 0 0; font-size: var(--fs-sm); color: var(--text-muted); }
@media (max-width: 767px) {
  .tm-hide-sm { display: none; }
  .tm-table td.n { font-size: var(--fs-md); }
  .tm-table th, .tm-table td { padding-left: 4px; padding-right: 4px; }
  .tm-table .v2-av { display: none; }
}

/* ---------- season: streak, XP, coins, badges ---------- */
.tm-season__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s2); }
@media (max-width: 767px) { .tm-season__grid { grid-template-columns: minmax(0, 1fr); } }
.tm-meter__k { display: block; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.tm-streak { margin-bottom: var(--s1); }
.tm-streak__lamps { display: flex; gap: 6px; margin: 8px 0 6px; }
.tm-streak__l { width: 28px; height: 8px; border-radius: 2px; background: var(--disabled-bg); }
.tm-streak__l.is-lit { background: var(--positive); }
.tm-streak__txt { margin: 0; font-size: var(--fs-sm); }
.tm-xp__row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s1); }
.tm-xp__lvl { font-family: var(--font-display); font-weight: var(--fw-display); font-size: 24px; text-transform: uppercase; }
.tm-xp__n { font-weight: 700; }
.tm-xp__bar { height: 8px; border-radius: 999px; background: var(--disabled-bg); overflow: hidden; margin: 6px 0; }
.tm-xp__fill { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.tm-small { font-size: var(--fs-sm); color: var(--text-muted); margin: 6px 0 0; }
.tm-formula { font-variant-numeric: tabular-nums; }
.tm-link { color: var(--link); font-weight: 600; font-size: var(--fs-sm); text-underline-offset: 2px; }
.tm-coins__row { display: flex; gap: 12px; align-items: flex-start; }
.tm-coins__disc { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); background: radial-gradient(circle, var(--surface-2) 0 45%, transparent 46%), var(--disabled-bg); }
.tm-coins__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tm-coins__v { font-family: var(--font-display); font-weight: var(--fw-display); font-size: 24px; line-height: 1.05; }
.tm-coins__v--off { font-family: var(--font-body); font-weight: 600; font-size: var(--fs-md); }
.tm-coins .tm-small { margin: 0; }
.tm-coins .tm-small a { color: var(--link); }
.tm-sub { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: var(--s2) 0 0; padding-top: var(--s1); border-top: 1px solid var(--line); }
.tm-badges { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 var(--s2); }
.tm-badge { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tm-badge__disc { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); margin-top: 2px; display: inline-flex; align-items: center; justify-content: center; }
.tm-badge.is-earned .tm-badge__disc { background: var(--positive); border-color: var(--positive); }
.tm-badge.is-earned .tm-badge__disc::after { content: ''; width: 8px; height: 4px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); }
.tm-badge__txt { display: flex; flex-direction: column; min-width: 0; }
.tm-badge__name { font-weight: 700; }
.tm-badge__state { font-size: var(--fs-sm); color: var(--text-muted); }
.tm-xpnote { margin: var(--s1) 0 0; font-size: var(--fs-sm); color: var(--text-muted); }
.tm-xpnote:focus { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- next round ---------- */
.tm-next .v2-h2 { margin-bottom: 8px; }
.tm-next__when { font-family: var(--font-display); font-weight: var(--fw-display); font-size: 30px; text-transform: uppercase; line-height: 1; margin: 0 0 8px; }
.tm-next__cd { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.tm-next__v { font-weight: 700; color: var(--text); }
.tm-next__v.is-locked { color: var(--brand-ink); }
.tm-next .v2-btn { margin-top: var(--s1); }
.tm-next__lucky { margin-top: 12px; }

/* ---------- team news, leagues ---------- */
.v2-news { list-style: none; margin: 0; padding: 0; }
.v2-news li + li { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.v2-news .v2-kicker { color: var(--brand-ink); }
.v2-news__h { display: block; font-size: var(--fs-md); font-weight: 700; line-height: 1.3; color: var(--text); text-decoration: none; margin-top: 2px; }
a.v2-news__h:hover { text-decoration: underline; text-underline-offset: 2px; }
.v2-news__src { display: block; font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.v2-news__foot { margin: var(--s1) 0 0; font-size: var(--fs-sm); color: var(--text-muted); }
.v2-news__foot a { color: var(--link); font-weight: 600; }
.tm-leagues .v2-h2 { margin: 4px 0 8px; }
.v2-leagues { list-style: none; margin: 0 0 var(--s1); padding: 0; }
.v2-leagues li { display: flex; justify-content: space-between; gap: var(--s1); align-items: center; min-height: var(--tap); border-bottom: 1px solid var(--line); }
.v2-leagues a { font-weight: 700; color: var(--text); }

/* ---------- profile preview dialog ---------- */
.tm-dlg { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; padding: var(--s1); }
.tm-dlg__panel { width: min(420px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--card); color: var(--text); border-radius: var(--radius-card); box-shadow: 0 16px 50px rgba(0, 0, 0, .4); padding: var(--s2); }
.tm-dlg__top { display: flex; gap: var(--s1); align-items: center; padding-bottom: var(--s1); border-bottom: 1px solid var(--line); }
.tm-dlg__who { min-width: 0; }
.tm-dlg__kick { margin: 0; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-ink); }
.tm-dlg__name { font-family: var(--font-display); font-weight: var(--fw-display); font-size: 30px; line-height: 1; text-transform: uppercase; margin: 2px 0; }
.tm-dlg__sector { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }
.tm-dlg__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s1); margin: var(--s1) 0; }
.tm-dlg__stats dt { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.tm-dlg__stats dd { margin: 2px 0 0; font-weight: 700; font-size: var(--fs-lg); overflow-wrap: anywhere; }
.tm-dlg__note { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; margin: 0 0 var(--s1); }
.tm-dlg__btns { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.tm-score .v2-pill, .tm-score .v2-lamp { background: #2A2D31; border-color: #3A3E44; color: #fff; }
.tm-score .v2-lamp.is-win { border-color: #3CC985; }
.tm-score .v2-lamp.is-loss { border-color: #FF6B64; }

/* ---------- day-by-day chart (inside the dark score card) ---------- */
.tm-chart { margin-top: var(--s2); padding-top: 12px; border-top: 1px solid #33373C; }
.tm-chart__k { margin: 0 0 8px; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #D5D9DE; }
.tm-chart__plot { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; height: 140px; }
.tm-chart__zero { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid #8A919B; z-index: 1; }
.tm-chart__col { display: flex; flex-direction: column; min-width: 0; height: 100%; border-radius: 3px; }
.tm-chart__col.is-open, .tm-chart__col.is-late { border: 1px dashed #4A4F56; }
.tm-chart__up, .tm-chart__down { display: flex; justify-content: center; min-height: 0; }
.tm-chart__up { align-items: flex-end; }
.tm-chart__down { align-items: flex-start; }
.tm-chart__bar { display: block; width: 70%; max-width: 56px; min-height: 2px; background: #3CC985; transition: opacity .2s ease, outline-color .2s ease; outline: 2px solid transparent; outline-offset: 2px; }
.tm-chart__bar.is-up { border-radius: 3px 3px 0 0; }
.tm-chart__bar.is-down { background: #FF6B64; border-radius: 0 0 3px 3px; }
.tm-chart__axis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 6px; text-align: center; }
.tm-chart__ax { display: flex; flex-direction: column; min-width: 0; border-radius: 3px; padding: 2px 0; transition: background-color .2s ease; }
.tm-chart__dow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; color: #D5D9DE; }
.tm-chart__v { font-weight: 700; font-size: var(--fs-sm); color: #fff; }
.tm-chart__ax.is-open .tm-chart__v, .tm-chart__ax.is-late .tm-chart__v { color: #8A919B; font-weight: 400; }
/* replay highlight */
.tm-chart.is-replaying .tm-chart__col.is-ahead .tm-chart__bar { opacity: .18; }
.tm-chart.is-replaying .tm-chart__ax.is-ahead .tm-chart__v { opacity: .35; }
.tm-chart__col.is-now .tm-chart__bar { outline-color: #fff; }
.tm-chart__ax.is-now { background: #2A2D31; box-shadow: inset 0 -2px 0 #fff; }
@media (max-width: 767px) {
  .tm-chart__plot { height: 110px; gap: 6px; }
  .tm-chart__axis { gap: 6px; }
  .tm-chart__v { font-size: var(--fs-xs); }
}

/* ---------- box score total row ---------- */
.tm-table tfoot th, .tm-table tfoot td { border-top: 2px solid var(--text); font-weight: 700; }
.tm-table tfoot th { text-transform: uppercase; letter-spacing: .04em; font-size: var(--fs-sm); padding-left: 0; }

/* ---------- play the week ---------- */
.tm-replay__note { margin: 0 0 12px; font-size: var(--fs-sm); color: var(--text-muted); }
.tm-replay__days { display: flex; flex-wrap: wrap; gap: 8px; }
.tm-replay__day {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: var(--tap); min-height: 52px; padding: 4px 8px;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--card); color: var(--text); cursor: pointer; font: inherit;
}
.tm-replay__day:hover { border-color: var(--text); }
.tm-replay__day.is-on { background: var(--text); border-color: var(--text); color: var(--card); }
.tm-replay__day.is-off { cursor: default; border-style: dashed; color: var(--text-muted); background: transparent; }
.tm-replay__dn { font-family: var(--font-display); font-weight: var(--fw-display); font-size: 20px; line-height: 1; }
.tm-replay__dw { font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.tm-replay__mini { margin: var(--s1) 0; padding: 12px var(--s1); border-radius: var(--radius); background: var(--surface-2); }
.tm-replay__k { display: block; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.tm-replay__big { display: block; font-family: var(--font-display); font-weight: var(--fw-display); font-size: 44px; line-height: 1; margin: 4px 0; }
.tm-replay__unit { font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 700; color: var(--text-muted); }
.tm-replay__line { margin: 0; font-size: var(--fs-sm); }
.tm-replay__ctl { display: flex; flex-wrap: wrap; gap: 8px; }
.tm-replay__ctl [aria-disabled="true"] { background: var(--disabled-bg); border-color: var(--disabled-bg); color: var(--disabled-ink); cursor: default; }

/* ---------- the benchmark ---------- */
.tm-bench__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s1); }
.tm-bench__cell { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.tm-bench__cell.is-win { border-color: var(--positive); box-shadow: inset 0 3px 0 var(--positive); }
.tm-bench__k { display: block; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.tm-bench__v { display: block; font-family: var(--font-display); font-weight: var(--fw-display); font-size: 40px; line-height: 1; margin-top: 4px; }
.tm-bench__diff { margin: 12px 0 0; }
.tm-bench__diff strong { font-size: var(--fs-lg); }
.tm-bench__btn { margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  .tm-chart__bar, .tm-chart__ax { transition: none; }
}
