/* Ranked-table card */
.rt-wrap {
  perspective: 700px;
  perspective-origin: 50% 50%;
}
.rt-card {
  background: var(--ink-0);
  border: 1px solid var(--border-hair);
  border-radius: 16px;
  box-shadow: 0 32px 80px -20px rgba(46, 28, 56, 0.28), 0 8px 24px -8px rgba(46, 28, 56, 0.12);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  transform: rotateY(-22deg) rotateX(4deg);
  transform-origin: center center;
  transform-style: preserve-3d;
  opacity: 0;
  transition: transform 1100ms cubic-bezier(0.2, 0.7, 0.2, 1), opacity 700ms ease;
  will-change: transform, opacity;
  overflow: hidden;
}
.rt-card.is-slid {
  transform: rotateY(-14deg) rotateX(3deg);
  opacity: 1;
}

/* Header */
.rt-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border-hair);
}
.rt-header-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand-plum-tint);
  color: var(--brand-plum);
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.rt-header-icon svg { width: 20px; height: 20px; display: block; }
.rt-header-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 17px;
  color: var(--ink-8);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.rt-header-sub {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 13px;
  color: var(--brand-plum);
  margin-top: 4px;
}

/* Table */
.rt-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-family: var(--font-sans);
  transform-style: preserve-3d;
}
.rt-c-name { width: auto; min-width: 0; }
.rt-c-fit  { width: 160px; flex-shrink: 0; }

.rt-table thead tr {
  background: var(--ink-1);
  border-bottom: 1px solid var(--border-hair);
}
.rt-th {
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-8);
  letter-spacing: -0.005em;
  padding: 14px 22px;
}
.rt-th:first-child { padding-left: 28px; }
.rt-th:last-child  { padding-right: 28px; }

/* Tier backgrounds on rows */
.rt-row--strongest td { background: var(--ink-0); }
.rt-row--strong    td { background: var(--ink-1); }
.rt-row--moderate  td { background: var(--brand-slate-tint); }

/* Tier separator border */
.rt-row--tier-start td { border-top: 1px solid var(--border-hair); }

/* Row — cascade from upper-left: top rows travel furthest, all staggered so
   3-4 rows are visibly in-flight at once. Each row takes 800ms to land,
   staggered 180ms apart → ~3-4 rows overlapping at any moment. */
.rt-row {
  opacity: 0;
  transition: opacity 500ms ease;
}
.rt-row td {
  /* --row-i: 0=first(top), 9=last. Top rows start furthest upper-left. */
  transform: translate(
    calc(-24px - (9 - var(--row-i, 0)) * 18px),
    calc(-24px - (9 - var(--row-i, 0)) * 16px)
  );
  transition: transform 800ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.rt-row.is-in { opacity: 1; }
.rt-row.is-in td { transform: translate(0, 0); }

.rt-cell {
  padding: 12px 22px;
  font-size: 14px;
  color: var(--ink-8);
  line-height: 1.3;
  vertical-align: middle;
  white-space: nowrap;
}
.rt-cell:first-child {
  padding-left: 22px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rt-cell-name-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}
.rt-cell-name-inner span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.rt-cell:last-child  { padding-right: 28px; }
.rt-cell-fit { text-align: left; vertical-align: middle; }

/* Avatar */
.rt-avatar {
  flex: 0 0 32px;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-plum-tint);
  color: var(--brand-plum);
  flex-shrink: 0;
}
.rt-avatar svg { width: 18px; height: 18px; display: block; }

/* Pills */
.rt-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  width: 100px;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 320ms ease 200ms, transform 380ms cubic-bezier(0.2, 0.9, 0.3, 1.2) 200ms;
}
.rt-row.is-in .rt-pill { opacity: 1; transform: scale(1); }
.rt-pill--strongest { background: var(--brand-plum); color: #fff; }
.rt-pill--strong    { background: var(--brand-plum-tint); color: var(--brand-plum); }
.rt-pill--moderate  { background: var(--brand-slate-soft); color: var(--brand-slate-deep); }

@media (max-width: 720px) {
  .rt-th, .rt-cell { padding: 10px 10px; font-size: 13px; }
  .rt-th:first-child { padding-left: 14px; }
  .rt-cell:first-child { padding-left: 14px; gap: 10px; }
  .rt-th:last-child, .rt-cell:last-child { padding-right: 14px; }
  .rt-pill { min-width: 90px; padding: 5px 10px; font-size: 10px; }
  .rt-avatar { width: 28px; height: 28px; font-size: 10px; }
}
