/*
 * The Ranks screen's Ladder tab: where the community stands (screens/ranks-ladder.js)
 * and the You card (screens/ranks-you.js). Layout: docs/mockups/ranks-screen.html.
 */

/* Ladder: the community on the left, you on the right. */
.ranks__ladder {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: var(--space-5);
  min-height: 0;
  overflow: hidden;
}

.ranks__ladder > .ranks-you {
  grid-column: 2;
  grid-row: 1;
}

.ranks-dist {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--space-2);
  min-height: 0;
}

.ranks-label {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  color: var(--text-dim);
}

.ranks-dist__rows {
  display: grid;
  grid-template-rows: repeat(7, minmax(0, 1fr));
  gap: var(--space-1);
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ranks-row {
  position: relative;
  display: grid;
  grid-template-columns: 2.6rem 8.5rem minmax(0, 1fr) 4.6rem;
  align-items: center;
  gap: var(--space-3);
  min-height: 0;
  padding: 0 var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius);
}

.ranks-row.is-me {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.ranks-row .emblem-wrap {
  width: 2.4rem;
}

.ranks-row__name {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.ranks-row__band {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-dim);
}

.ranks-row__bar {
  position: relative;
  height: 10px;
  border-radius: 2px;
  background: rgb(255 255 255 / 0.05);
}

.ranks-row__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 2px;
}

.ranks-row__pct {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-align: right;
  white-space: nowrap;
}

.ranks-row__pct small {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-dim);
}

.ranks-row__empty {
  grid-column: 3 / 5;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-dim);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ranks-row > [hidden] {
  display: none;
}

.ranks-row__you {
  position: absolute;
  top: 50%;
  right: calc(4.6rem + var(--space-5));
  transform: translateY(-50%);
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 2px;
}

.ranks-dist__foot {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-dim);
}

/* You */
.ranks-you {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: var(--space-2);
  min-height: 0;
  padding: var(--space-4);
  text-align: center;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.ranks-you__content {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: var(--space-3);
  min-height: 0;
}

.ranks-you .emblem-wrap {
  width: min(8.5rem, 100%);
  margin: 0 auto;
}

.ranks-you__name {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ranks-you__rating {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.15;
}

.ranks-you__facts {
  display: grid;
  align-content: end;
  gap: var(--space-2);
  min-height: 0;
  text-align: left;
}

.ranks-you__stand {
  font-size: var(--text-md);
  text-align: center;
}

.ranks-you__stand b {
  font-family: var(--font-mono);
}

.ranks-fact {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  padding-top: var(--space-2);
  font-size: var(--text-sm);
  border-top: 1px solid var(--line);
}

.ranks-fact > span:last-of-type {
  font-family: var(--font-mono);
}

.ranks-fact .dim {
  color: var(--text-dim);
}

.ranks-fact__bar {
  position: relative;
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 3px;
  background: rgb(255 255 255 / 0.06);
}

.ranks-fact__bar i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 3px;
}

.ranks-you__note {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--warn);
}

.ranks-you__note:empty {
  display: none;
}

/* The action keeps one place and one height, whatever it says. */
.ranks-you__slot {
  display: grid;
  min-height: var(--target);
}

.ranks-you__slot[hidden] {
  display: none;
}

.ranks-you__cta {
  width: 100%;
  min-height: var(--target);
}

.ranks-you__queue {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-3);
}

.ranks-you__queue .ranks-you__cta {
  width: auto;
}

.ranks-you__finding {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-align: left;
}

.ranks-you__clock {
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}
