/* Core components. Sandbox и тестовый профиль /design-system/profile. Живой /user/{id} этот файл не грузит. */

.tn-ds .tn-c-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 var(--space-6);
  font-size: var(--small-size);
}
.tn-ds .tn-c-toc a { color: var(--text-secondary); }
.tn-ds .tn-c-cap {
  font-size: var(--caption-size);
  line-height: var(--caption-line);
  color: var(--text-muted);
  margin: 0 0 var(--space-3);
  max-width: 720px;
}
.tn-ds .tn-c-pair {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  margin: 0 0 var(--space-5);
}
.tn-ds .tn-c-frame {
  background: var(--surface-page);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--radius-control);
  padding: var(--space-4);
  min-width: 0;
}
.tn-ds .tn-c-frame--desktop { flex: 1; }
.tn-ds .tn-c-frame--mobile { width: 390px; flex-shrink: 0; }
.tn-ds .tn-c-frame-label {
  font-size: var(--eyebrow-size);
  font-weight: 700;
  letter-spacing: var(--eyebrow-tracking);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}
.tn-ds .tn-c-states {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-5);
  align-items: flex-end;
}
.tn-ds .tn-c-state { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.tn-ds .tn-c-state-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.tn-ds .tn-c-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.tn-ds .tn-c-btn {
  font-family: var(--font-family);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  line-height: 1;
  box-sizing: border-box;
}
.tn-ds .tn-c-btn:disabled { cursor: default; }
.tn-ds .tn-c-btn--action {
  background: var(--brand-action);
  color: var(--text-on-action);
  font-size: var(--button-size);
  font-weight: var(--button-weight);
  padding: 12px 24px;
  border-radius: var(--radius-control);
}
.tn-ds .tn-c-btn--action:hover,
.tn-ds .tn-c-btn--action.is-hover,
.tn-ds .tn-c-btn--action:active,
.tn-ds .tn-c-btn--action.is-active,
.tn-ds .tn-c-btn--action:focus {
  background: var(--brand-action-hover);
  color: var(--text-on-action-hover);
  text-decoration: none;
}
.tn-ds .tn-c-btn--action:disabled {
  background: var(--surface-muted);
  color: var(--text-muted);
}
.tn-ds .tn-c-btn--sm {
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-control-sm);
}
.tn-ds .tn-c-btn--soft {
  background: var(--brand-soft);
  color: var(--brand-deep);
  border: 1.5px solid var(--brand-line);
  border-radius: var(--radius-control);
  padding: 15px 26px;
  font-size: 15px;
  font-weight: 700;
  min-height: 48px;
}
.tn-ds .tn-c-btn--soft:hover,
.tn-ds .tn-c-btn--soft.is-hover,
.tn-ds .tn-c-btn--soft:active,
.tn-ds .tn-c-btn--soft.is-active,
.tn-ds .tn-c-btn--soft:focus {
  background: var(--brand-soft-hover);
  color: var(--brand-deep);
}
.tn-ds .tn-c-btn--soft:disabled {
  background: var(--surface-muted);
  color: var(--text-muted);
  border-color: var(--border-subtle);
}
.tn-ds .tn-c-btn--quiet {
  background: var(--surface-primary);
  color: var(--text-primary);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--radius-control);
  padding: 12px 24px;
  font-size: var(--button-size);
  font-weight: var(--button-weight);
}
.tn-ds .tn-c-btn--quiet:hover,
.tn-ds .tn-c-btn--quiet.is-hover {
  background: var(--surface-muted);
}
.tn-ds .tn-c-btn--text {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.tn-ds .tn-c-btn--text:hover,
.tn-ds .tn-c-btn--text.is-hover { color: var(--text-primary); }
.tn-ds .tn-c-btn:focus-visible {
  outline: 2px solid var(--brand-deep);
  outline-offset: 2px;
}
.tn-ds .tn-c-frame--mobile .tn-c-btn--block {
  width: 100%;
}

.tn-ds .tn-c-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-round);
  background: var(--surface-inverse);
  color: var(--brand-action);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}
.tn-ds .tn-c-avatar--sm {
  width: 36px;
  height: 36px;
  font-size: 13px;
}
.tn-ds .tn-c-avatar--photo {
  background-size: cover;
  background-position: center;
  color: transparent;
}
/* StatsGroup: колонка по содержимому, не 1fr на ширину карточки.
   Потолок — container-measure, тот же, что у ProfileHeader. */
.tn-ds .tn-c-stats,
.tn-ds .tn-c-stats-group {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: var(--space-4) var(--space-6);
  width: fit-content;
  max-width: min(100%, var(--container-measure));
}
.tn-ds .tn-c-stat {
  flex: 0 0 auto;
  min-width: 0;
  text-align: center;
}
.tn-ds .tn-c-stats .profileV2__stat-box,
.tn-ds .tn-c-stats-group .profileV2__stat-box {
  border-right: 0;
  background: transparent;
}
.tn-ds .tn-c-stat-val {
  font-size: var(--heading-m-size);
  font-weight: var(--numeric-weight);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text-primary);
}
.tn-ds .tn-c-stat-lbl {
  margin-top: 4px;
  font-size: var(--eyebrow-size);
  font-weight: var(--eyebrow-weight);
  letter-spacing: var(--eyebrow-tracking);
  text-transform: uppercase;
  color: var(--text-secondary);
}
.tn-ds .tn-c-stat-sub {
  margin-top: 2px;
  font-size: var(--caption-size);
  line-height: var(--caption-line);
  color: var(--text-muted);
}
.tn-ds .tn-c-stats-card { padding: 16px 20px 18px; }
.tn-ds .tn-c-frame--mobile .tn-c-avatar--profile {
  width: 60px;
  height: 60px;
  font-size: 18px;
}

.tn-ds .tn-c-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.tn-ds .tn-c-identity-text { min-width: 0; }
.tn-ds .tn-c-identity-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.tn-ds .tn-c-frame--mobile .tn-c-identity-name { font-size: 16px; }
.tn-ds .tn-c-identity-me {
  font-weight: 500;
  font-size: 14px;
  color: var(--text-secondary);
}
.tn-ds .tn-c-identity-meta {
  margin-top: 3px;
  font-size: 13px;
  color: var(--text-secondary);
}
.tn-ds .tn-c-identity-note {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

.tn-ds .tn-c-level-label {
  font-size: var(--eyebrow-size);
  font-weight: var(--eyebrow-weight);
  letter-spacing: var(--eyebrow-tracking);
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.tn-ds .tn-c-level-value {
  font-size: var(--numeric-size);
  font-weight: var(--numeric-weight);
  line-height: var(--numeric-line);
  letter-spacing: var(--numeric-tracking);
  color: var(--text-primary);
}
.tn-ds .tn-c-frame--mobile .tn-c-level-value {
  font-size: var(--numeric-size-compact);
}
.tn-ds .tn-c-level-delta {
  margin-top: 4px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tn-ds .tn-c-level-delta--up { color: var(--status-win); }
.tn-ds .tn-c-level-delta--down { color: var(--status-loss); }

.tn-ds .tn-c-ladder {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 72px;
}
.tn-ds .tn-c-ladder-step {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}
.tn-ds .tn-c-ladder-bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
}
.tn-ds .tn-c-ladder-name {
  margin-top: 4px;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  color: var(--text-primary);
}
.tn-ds .tn-c-h1 { height: 18px; background: var(--ladder-1); }
.tn-ds .tn-c-h2 { height: 24px; background: var(--ladder-2); }
.tn-ds .tn-c-h3 { height: 30px; background: var(--ladder-3); }
.tn-ds .tn-c-h4 { height: 36px; background: var(--ladder-4); }
.tn-ds .tn-c-h5 { height: 44px; background: var(--ladder-5); }
.tn-ds .tn-c-h6 { height: 52px; background: var(--ladder-6); }
.tn-ds .tn-c-h7 { height: 60px; background: var(--ladder-7); }
.tn-ds .tn-c-h8 { height: 68px; background: var(--ladder-8); }

.tn-ds .tn-c-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  line-height: 1.3;
}
.tn-ds .tn-c-badge--win { background: var(--status-win-bg); color: var(--status-win-ink); }
.tn-ds .tn-c-badge--lose {
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-weight: 400;
}
.tn-ds .tn-c-badge--sensation {
  background: var(--status-sensation-bg);
  color: var(--status-sensation-text);
}
.tn-ds .tn-c-badge--express {
  background: var(--status-express-bg);
  color: var(--status-express-text);
}
/* Status badges — secondary. Чёрный Ambassador сохраняет семантику,
   но радиус и вес не как у имени (700) и не как у Level (800). */
.tn-ds .tn-c-badge--premium {
  background: transparent;
  color: var(--brand-deep);
  border: 1px solid var(--brand-line);
  font-weight: 600;
}
.tn-ds .tn-c-badge--ambassador {
  background: var(--surface-inverse);
  color: var(--brand-action);
  font-weight: 600;
}

.tn-ds .tn-c-card {
  background: var(--surface-primary);
  border-radius: var(--radius-card);
  padding: 20px;
}
.tn-ds .tn-c-card--line { border: 0.5px solid var(--border-subtle); }
.tn-ds .tn-c-card--inverse {
  background: var(--surface-inverse);
  color: var(--text-on-inverse);
  border-radius: var(--radius-inverse);
  padding: 28px 24px;
}
.tn-ds .tn-c-frame--desktop .tn-c-card--inverse {
  border-radius: var(--radius-inverse-desktop);
}
.tn-ds .tn-c-card-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 8px;
}
.tn-ds .tn-c-frame--mobile .tn-c-card-title { font-size: 24px; }
.tn-ds .tn-c-card-soft {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-on-inverse-soft);
}
.tn-ds .tn-c-card--note {
  background: var(--surface-page);
  border-radius: var(--radius-tooltip);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.tn-ds .tn-c-score { display: flex; flex-direction: column; flex-shrink: 0; }
.tn-ds .tn-c-score-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 8px 0;
}
.tn-ds .tn-c-score-row + .tn-c-score-row {
  border-top: 0.5px solid var(--border-subtle);
}
.tn-ds .tn-c-score-cell {
  min-width: 18px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
}
.tn-ds .tn-c-score-cell--lose {
  color: #C0C0C0;
  font-size: 14px;
  font-weight: 400;
}
.tn-ds .tn-c-score-compact {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-name);
  line-height: 1.5;
  text-align: right;
  white-space: nowrap;
}
.tn-ds .tn-c-frame--mobile .tn-c-score-compact { font-size: 16px; }
.tn-ds .tn-c-score-compact--lose {
  font-size: 13px;
  font-weight: 400;
  color: #B0B0B0;
  line-height: 2.2;
}
.tn-ds .tn-c-match {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tn-ds .tn-c-match-side { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.tn-ds .tn-c-playerline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.tn-ds .tn-c-playerline-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .tn-ds .tn-c-pair { flex-direction: column; }
  .tn-ds .tn-c-frame--mobile { width: 100%; max-width: 390px; }
}

/* Review: композиции. Cookie только на внутренних страницах с этим классом. */
body.tn-ds-page .cookieBox { display: none !important; }

.tn-ds .tn-x-kicker {
  font-size: var(--eyebrow-size);
  font-weight: 700;
  letter-spacing: var(--eyebrow-tracking);
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px;
}
.tn-ds .tn-x-sheet {
  background: var(--surface-primary);
  border-radius: var(--radius-card);
}
.tn-ds .tn-x-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px 16px;
}
.tn-ds .tn-x-line + .tn-x-line {
  border-top: 0.5px solid var(--border-subtle);
}
.tn-ds .tn-x-who { min-width: 0; flex: 1; }
.tn-ds .tn-x-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tn-ds .tn-x-meta {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.3;
  color: var(--text-secondary);
}
.tn-ds .tn-x-level {
  margin-left: auto;
  text-align: right;
  flex-shrink: 0;
}
.tn-ds .tn-x-level-num {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-primary);
}
.tn-ds .tn-x-level-delta {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.2;
}
.tn-ds .tn-x-level-delta--up { color: var(--status-win); }
.tn-ds .tn-x-level-delta--down { color: var(--status-loss); }
.tn-ds .tn-x-level-delta--flat { color: var(--text-muted); }
.tn-ds .tn-x-place {
  width: 22px;
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: right;
}
.tn-ds .tn-x-match { padding: 6px 16px 8px; }
.tn-ds .tn-x-match-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.tn-ds .tn-x-match-row + .tn-x-match-row {
  border-top: 0.5px solid var(--border-subtle);
}
.tn-ds .tn-x-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
/* ProfileHeader. Карточка может быть широкой: кластер сам по себе,
   расстояние до Level — space-6, не край карточки. */
.tn-ds .tn-x-profile {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  gap: var(--space-6);
  width: fit-content;
  max-width: 100%;
  max-inline-size: var(--container-measure);
  padding: 0;
}
.tn-ds .tn-x-profile.profileV2__profile-top {
  margin-bottom: 0;
}
.tn-ds .tn-x-profile-main {
  min-width: 0;
  flex: 0 1 auto;
}
.tn-ds .tn-x-profile .tn-c-identity,
.tn-ds .tn-x-profile .profileV2__profile-head {
  flex: 0 1 auto;
}
.tn-ds .tn-x-profile-title {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  width: fit-content;
  max-width: 100%;
}
.tn-ds .tn-x-profile-title .tn-c-identity-name {
  flex: 0 1 auto;
}
.tn-ds .tn-x-profile-actions {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.tn-ds .tn-x-profile-actions:empty { display: none; }
.tn-ds .tn-x-profile-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  text-decoration: none;
  flex-shrink: 0;
}
.tn-ds .tn-x-profile-action i { font-size: 18px; line-height: 1; }
.tn-ds .tn-x-profile-action:hover { color: var(--text-secondary); text-decoration: none; }
.tn-ds .tn-x-profile-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.tn-ds .tn-x-profile-badges:not(:has(.tn-c-badge)):not(:has(.profileV2__badge)) {
  display: none;
}
.tn-ds .tn-x-profile-level {
  flex: 0 0 auto;
  text-align: right;
}
.tn-ds .tn-x-profile-note {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-secondary);
}
.tn-ds .tn-x-profile .tn-c-btn--text { margin-top: 8px; }
.tn-ds .tn-x-sheet:has(> .tn-x-profile) {
  padding: var(--space-ref-20);
}
.tn-ds .tn-c-frame--mobile .tn-x-profile {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  max-inline-size: 100%;
}
.tn-ds .tn-c-frame--mobile .tn-x-profile-level { text-align: left; }
@media (max-width: 990px) {
  .tn-ds .tn-x-profile {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    max-inline-size: 100%;
  }
  .tn-ds .tn-x-profile-level { text-align: left; }
  .tn-ds .tn-c-avatar--profile { width: 60px; height: 60px; font-size: 18px; }
  .tn-ds .tn-c-identity-name { font-size: 16px; }
  .tn-ds .tn-c-level-value { font-size: var(--numeric-size-compact); }
  .tn-ds .tn-c-stats,
  .tn-ds .tn-c-stats-group {
    gap: var(--space-3) var(--space-4);
    max-width: 100%;
  }
}
.tn-ds .tn-c-frame--mobile .tn-c-stats,
.tn-ds .tn-c-frame--mobile .tn-c-stats-group {
  gap: var(--space-3) var(--space-4);
  max-width: 100%;
}
.tn-ds .tn-c-frame--mobile .tn-x-line,
.tn-ds .tn-c-frame--mobile .tn-x-match { padding-left: 12px; padding-right: 12px; }
.tn-ds .tn-c-frame--mobile .tn-x-level-num { font-size: 18px; }

/* Compact Level: плотные списки. Герой профиля остаётся 44/36. */
.tn-ds .tn-c-level--compact .tn-c-level-value,
.tn-ds .tn-c-frame--mobile .tn-c-level--compact .tn-c-level-value {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0;
}
.tn-ds .tn-c-level--compact .tn-c-level-delta,
.tn-ds .tn-c-frame--mobile .tn-c-level--compact .tn-c-level-delta {
  margin-top: 0;
  font-size: 11px;
  line-height: 1.2;
  gap: 0;
}
.tn-ds .tn-c-level-delta--flat { color: var(--text-muted); }
.tn-ds .tn-c-level-delta--none { color: var(--text-muted); }

/* Dense PlayerIdentity: список. Профильный вариант без этого класса не меняется. */
.tn-ds .tn-c-identity--dense {
  gap: 8px;
  align-items: center;
}
.tn-ds .tn-c-identity--dense .tn-c-identity-name,
.tn-ds .tn-c-frame--mobile .tn-c-identity--dense .tn-c-identity-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
}
.tn-ds .tn-c-identity--dense .tn-c-identity-name a {
  color: inherit;
  text-decoration: none;
}
.tn-ds .tn-c-identity--dense .tn-c-identity-name a:hover {
  text-decoration: underline;
}
.tn-ds .tn-c-identity--dense .tn-c-identity-name a:focus-visible {
  outline: 2px solid var(--brand-deep);
  outline-offset: 2px;
}
.tn-ds .tn-c-identity--dense .tn-c-identity-meta,
.tn-ds .tn-c-frame--mobile .tn-c-identity--dense .tn-c-identity-meta {
  margin-top: 1px;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tn-ds .tn-c-frame--mobile .tn-c-identity--dense .tn-c-identity-name,
.tn-ds .tn-c-frame--mobile .tn-c-identity--dense .tn-c-identity-meta {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
@media (max-width: 900px) {
  .tn-ds .tn-c-identity--dense .tn-c-identity-name,
  .tn-ds .tn-c-identity--dense .tn-c-identity-meta {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}
@media (max-width: 990px) {
  .tn-ds .tn-c-level--compact .tn-c-level-value { font-size: 20px; }
  .tn-ds .tn-c-identity--dense .tn-c-identity-name { font-size: 15px; }
}
