/* Mobile ranking: keep the desktop table intact and reflow each data row. */
.tn-top-status { display: none; }
@media (max-width: 980px) {
  .tn-top-page-wrap {
    min-width: 0;
    padding: 22px 12px 72px;
  }

  .tn-top-hero {
    margin-bottom: 20px;
  }

  .tn-top-hero h1 {
    font-size: clamp(1.75rem, 7vw, 2.35rem);
    line-height: 1.14;
  }

  .tn-top-hero p {
    margin-top: 14px;
    font-size: .9rem;
    line-height: 1.5;
  }

  .tn-top-tabs {
    flex-wrap: nowrap;
    gap: 8px;
    margin: 18px -12px 0;
    padding: 0 12px 8px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .tn-top-tabs::-webkit-scrollbar { display: none; }
  .tn-top-tabs a {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 13px;
    border-radius: 10px;
    font-size: .82rem;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .tn-top-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin-bottom: 18px;
    background: rgba(255,255,255,.08);
  }

  .tn-top-kpi {
    min-width: 0;
    min-height: 80px;
    padding: 15px 10px 12px 47px;
    border: 0;
    background: #111827;
  }

  .tn-top-kpi:before {
    top: 18px;
    left: 12px;
    width: 27px;
    height: 27px;
    border-radius: 9px;
  }

  .tn-top-kpi span, .tn-top-kpi small { font-size: .7rem; }
  .tn-top-kpi strong { margin-top: 5px; font-size: 1.15rem; }
  .tn-top-kpi--updated strong { font-size: .9rem; }
  .tn-top-kpi--growth { grid-column: 1 / -1; }

  .tn-top-layout { gap: 18px; }
  .tn-top-main-card {
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .tn-top-table-wrap { overflow: visible; }
  .tn-top-table {
    display: block;
    width: 100%;
    min-width: 0;
    border: 0;
  }

  .tn-top-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .tn-top-table tbody {
    display: grid;
    gap: 10px;
  }

  .tn-top-table tbody tr.tn-top-entry {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 14px;
    background: #111827;
    box-shadow: 0 8px 24px rgba(0,0,0,.17);
  }

  .tn-top-table tbody tr.tn-top-entry.is-featured {
    border-color: rgba(245,158,11,.28);
    background: linear-gradient(125deg,rgba(245,158,11,.08),#111827 50%);
  }

  .tn-top-table tbody tr.tn-top-entry.is-premium {
    border-color: rgba(145,70,255,.35);
    background: linear-gradient(125deg,rgba(145,70,255,.13),#111827 55%);
  }

  .tn-top-table tbody tr.tn-top-entry td,
  .tn-top-table tbody tr.tn-top-entry:hover td,
  .tn-top-table tbody tr.tn-top-entry.is-premium td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    white-space: normal;
  }

  .tn-top-entry td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }

  .tn-top-rank { width: 30px; height: 30px; font-size: .83rem; }

  .tn-top-entry td:nth-child(2) {
    grid-column: 2 / -1;
    grid-row: 1;
    align-self: center;
  }

  .tn-top-streamer-cell {
    display: flex;
    min-width: 0;
    width: 100%;
    gap: 9px;
  }

  .tn-top-streamer-cell img {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
  }

  .tn-top-streamer-cell > span { min-width: 0; }
  .tn-top-streamer-cell strong,
  .tn-top-streamer-cell small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .tn-top-streamer-cell strong { font-size: .94rem; }
  .tn-premium-mini-badge { margin-left: 5px; padding: 2px 4px; font-size: .55rem; }

  .tn-top-entry td:nth-child(3) {
    grid-column: 1 / 5;
    grid-row: 2;
    align-self: center;
    margin-top: 12px;
    overflow: hidden;
    color: #c4b5fd;
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap !important;
  }

  .tn-top-entry td:nth-child(6) {
    grid-column: 5 / -1;
    grid-row: 2;
    justify-self: end;
    align-self: center;
    margin-top: 12px;
    color: #9ca3af;
    font-size: .76rem;
    white-space: nowrap !important;
  }

  .tn-top-entry.is-online td:nth-child(6) { color: #4ade80; }
  .tn-top-entry td:nth-child(6) .tn-top-dot { width: 7px; height: 7px; margin-right: 5px; vertical-align: 1px; }
  .tn-top-entry td:nth-child(6) .tn-top-status { display: inline; }

  .tn-top-entry td:nth-child(4),
  .tn-top-entry td:nth-child(5),
  .tn-top-entry td:nth-child(7) {
    grid-row: 3;
    margin-top: 13px;
    padding: 10px 6px 2px !important;
    border-top: 1px solid rgba(255,255,255,.08) !important;
    font-size: .84rem;
    font-weight: 800;
    white-space: nowrap !important;
  }

  .tn-top-entry td:nth-child(4) { grid-column: 1 / 3; }
  .tn-top-entry td:nth-child(5) { grid-column: 3 / 5; text-align: center; }
  .tn-top-entry td:nth-child(7) { grid-column: 5 / -1; text-align: right; }

  .tn-top-entry td:nth-child(4):before,
  .tn-top-entry td:nth-child(5):before,
  .tn-top-entry td:nth-child(7):before {
    display: block;
    margin-bottom: 4px;
    color: #929bad;
    font-size: .64rem;
    font-weight: 650;
    letter-spacing: .01em;
  }

  .tn-top-entry td:nth-child(4):before { content: 'Фолловеры'; }
  .tn-top-entry td:nth-child(5):before { content: 'Рост 7 дн.'; }
  .tn-top-entry td:nth-child(7):before { content: 'Зрители'; }
  .tn-top-entry .tn-top-live-pill {
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #f5f3ff;
  }

  .tn-top-table tbody tr:not(.tn-top-entry) { display: block; }
  .tn-top-table tbody tr:not(.tn-top-entry) td { display: block; white-space: normal; }
  .tn-top-table-foot { padding: 15px 4px; font-size: .76rem; }
  .tn-top-pagination { margin: 0 0 18px; padding: 9px; gap: 5px; }
  .tn-top-pagination button,
  .tn-top-pagination span { min-width: 34px; height: 36px; font-size: .82rem; }
}

@media (min-width: 620px) and (max-width: 980px) {
  .tn-top-table tbody { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
