/* Команды (teams.js) и «Аккаунт и данные» (account.js). Отдельный файл, чтобы не пересекаться
   с правками replay.css; токены цветов и шрифтов — из replay.css (:root). Mobile-first. */

.tm-screen.simple-screen { max-width: 980px; }
.tm-screen .access-card { min-width: 0; }
.tm-lead { margin: 0 0 6px; color: var(--hint); line-height: 1.45; }
.tm-hint { margin: 6px 0 10px; color: var(--hint); font-size: var(--fs-sm); line-height: 1.4; }
.tm-meta { margin: -6px 0 12px; color: var(--hint); font-size: var(--fs-sm); }
.tm-sub { margin: 14px 0 6px; font-weight: 600; font-size: var(--fs-sm); }
.tm-muted { color: var(--hint); }
.tm-empty { margin-top: 10px; }

/* список команд */
.tm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tm-card {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); text-decoration: none;
}
.tm-card:active { filter: brightness(1.12); }
.tm-card-ic {
  flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--ct-soft); color: var(--ct-text); font-weight: 700;
}
.tm-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tm-card-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-card-main small { color: var(--hint); font-size: var(--fs-xs); }
.tm-go { flex: none; color: var(--hint); font-size: var(--fs-lg); }

/* формы */
.tm-form { display: flex; flex-wrap: wrap; gap: 8px; }
.tm-form input {
  flex: 1 1 180px; min-width: 0; min-height: 44px; padding: 0 12px;
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.tm-form .seg { flex: 1 1 200px; }
.tm-form .btn { flex: 0 0 auto; min-height: 44px; }
.tm-roster-form input[name=steamid] { flex-basis: 200px; font-variant-numeric: tabular-nums; }
.tm-invite-row input { font-size: var(--fs-sm); color: var(--hint); }
.tm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
@media (max-width: 480px) {
  .tm-form .btn { flex: 1 1 100%; }
}

/* приглашение */
.tm-invite { padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.tm-invite-kicker { margin: 0; color: var(--hint); font-size: var(--fs-sm); }
.access-card .tm-invite-name { margin: 2px 0 4px; font-size: var(--fs-xl); text-transform: none; letter-spacing: 0; color: var(--text); }
.tm-terms { margin: 12px 0; padding-left: 18px; line-height: 1.45; }
.tm-terms li { margin-bottom: 6px; }
.tm-invite .tm-actions .btn { flex: 1 1 auto; }

/* вкладки команды */
.tm-tabs { margin-bottom: 12px; }
.tm-tab-body { min-height: 120px; }

/* плитки сводки */
.tm-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 700px) { .tm-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tm-tile {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; min-width: 0;
}
.tm-tile small { color: var(--hint); font-size: var(--fs-xs); }
.tm-tile b { font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
.tm-tile span { color: var(--hint); font-size: var(--fs-xs); }
.tm-tile-ct b { color: var(--ct-text); }
.tm-tile-t b { color: var(--t-text); }

/* карты */
.tm-maps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tm-maps li { display: grid; grid-template-columns: minmax(70px, 110px) 1fr auto; align-items: center; gap: 10px; }
.tm-map-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-bar { height: 8px; border-radius: 999px; background: var(--panel2); overflow: hidden; }
.tm-bar i { display: block; height: 100%; border-radius: inherit; background: var(--good); }
.tm-map-num { color: var(--hint); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tm-map-num b { color: var(--text); }

/* матчи команды */
.tm-matches { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tm-match {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none;
}
.tm-match.is-off { opacity: 0.7; }
.tm-m-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tm-m-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-m-main small { color: var(--hint); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-res {
  flex: none; width: 34px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  font-size: var(--fs-xs); font-weight: 700; background: var(--panel2); color: var(--hint);
}
.tm-res.win { background: rgba(79, 201, 117, 0.18); color: var(--good); }
.tm-res.loss { background: rgba(236, 106, 110, 0.18); color: var(--danger); }
.tm-res.draw { background: rgba(217, 167, 92, 0.2); color: var(--warn); }

/* сравнение игроков: таблица прокручивается внутри, страница — нет */
.tm-window { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 4px; color: var(--hint); font-size: var(--fs-sm); }
.tm-window .seg { flex: 0 1 220px; }
.tm-table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -2px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
}
.tm-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.tm-table th, .tm-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: right; }
.tm-table thead th { position: sticky; top: 0; background: var(--panel2); z-index: 1; font-weight: 600; }
.tm-table thead button {
  font: inherit; font-weight: 600; color: var(--hint); background: none; border: 0; padding: 4px 0; min-height: 32px; cursor: pointer;
}
.tm-th-plain { color: var(--hint); }
.tm-table .tm-th-name, .tm-table .tm-td-name {
  position: sticky; left: 0; text-align: left; background: var(--panel); z-index: 2;
  max-width: 132px; overflow: hidden; text-overflow: ellipsis; box-shadow: 1px 0 0 var(--line);
}
.tm-table thead .tm-th-name { background: var(--panel2); z-index: 3; }
.tm-td-name b { display: block; overflow: hidden; text-overflow: ellipsis; }
.tm-td-name small { display: block; color: var(--hint); font-weight: 400; font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; }
.tm-table tbody tr { cursor: pointer; }
.tm-table tbody tr:hover td, .tm-table tbody tr:hover th { filter: brightness(1.12); }
.tm-table tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tm-table tfoot th, .tm-table tfoot td { color: var(--hint); border-bottom: 0; }
.tm-table tfoot .tm-td-name { font-weight: 600; }
.tm-good { background: rgba(79, 201, 117, 0.12); color: var(--good); }
.tm-good2 { background: rgba(79, 201, 117, 0.24); color: var(--good); font-weight: 600; }
.tm-bad { background: rgba(236, 106, 110, 0.12); color: var(--danger); }
.tm-bad2 { background: rgba(236, 106, 110, 0.24); color: var(--danger); font-weight: 600; }

/* состав и участники */
.tm-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tm-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.tm-row-main { min-width: 0; flex: 1 1 160px; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.tm-row-main small { color: var(--hint); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.tm-row-act { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-row-act .btn { text-decoration: none; }
.tm-cands { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-cand {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; max-width: 100%;
  font: inherit; font-size: var(--fs-sm); color: var(--text); background: var(--panel2); border: 1px solid var(--line);
  border-radius: 999px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tm-cand small { color: var(--hint); }
.tm-plus { color: var(--good); font-weight: 700; }

/* метка команды у матча в списке */
.mc-teamtag {
  flex: none; max-width: 140px; padding: 1px 8px; border-radius: 999px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--fs-2xs); font-weight: 600; background: var(--t-soft); color: var(--t-text);
}

/* «Аккаунт и данные» */
.ad-list { margin: 0 0 4px; padding-left: 20px; line-height: 1.45; }
.ad-list li { margin-bottom: 6px; }
.ad-del li::marker { color: var(--danger); }
.ad-keep li::marker { color: var(--good); }
.ad-block {
  margin-top: 16px; padding: 12px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(217, 167, 92, 0.14); line-height: 1.4;
}
.ad-form {
  display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 12px;
  border: 1px solid rgba(236, 106, 110, 0.45); background: rgba(236, 106, 110, 0.07);
}
.ad-form label { line-height: 1.4; }
.ad-form input {
  min-height: 44px; padding: 0 12px; font: inherit; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.ad-danger { min-height: 44px; background: var(--danger); color: #fff; }
.ad-danger:disabled { opacity: 0.45; }
.acct-data { color: var(--hint); }

/* вкладки: «Состав и доступ» на телефоне — в две строки, без обрезки */
.tm-tabs > button { white-space: normal; line-height: 1.15; overflow: visible; text-overflow: clip; }
