/*
 * The rank moment on the results of a ranked match (screens/rank-moment.js;
 * the spec is docs/mockups/rank-change-moments.html, Firmware). It takes the
 * graph's place and keeps one size from start to end, so nothing moves.
 */
.rank-moment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8.5rem;
  align-items: center;
  gap: var(--space-4);
  height: 10.5rem;
  padding: var(--space-3) var(--space-4);
  overflow: hidden;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.rank-moment__log {
  font: var(--text-xs) / 1.65 var(--font-mono);
  color: var(--text-dim);
  white-space: pre-wrap;
  overflow: hidden;
  max-height: 100%;
}

.rank-moment__log b {
  font-weight: 700;
}

.rank-moment__off {
  color: #4a5060;
}

.rank-moment__cur::after {
  content: '_';
  animation: rank-moment-blink 1s steps(1) infinite;
}

@keyframes rank-moment-blink {
  50% {
    opacity: 0;
  }
}

.rank-moment__side {
  display: grid;
  justify-items: center;
  gap: var(--space-1);
  text-align: center;
}

.rank-moment__box {
  position: relative;
  width: 4.6rem;
  aspect-ratio: 136 / 152;
}

.rank-moment__box > .emblem-wrap {
  position: absolute;
  inset: 0;
}

.rank-moment__box > .is-waiting {
  opacity: 0.5;
}

.rank-moment__title {
  min-height: 1em;
  font: 700 var(--text-md) / 1 var(--font-mono);
  letter-spacing: 0.16em;
}

.rank-moment__title.is-long {
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.rank-moment__sub {
  min-height: 2.6em;
  margin: 0;
  font-size: var(--text-xs);
  line-height: 1.3;
  color: var(--text-dim);
}

.rank-moment__sub b {
  font-weight: 700;
  white-space: nowrap;
}

/* The bad-signal fault (ui/rank-fx.js) draws over the whole results panel. */
.results__panel {
  position: relative;
}

.rank-fx-defs {
  position: absolute;
}

.rank-fx-lines {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgb(0 0 0 / 0.3) 2px 3px);
}

.rank-fx-roll {
  position: absolute;
  left: 0;
  right: 0;
  height: 22%;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgb(255 255 255 / 0.035) 50%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion='full']) .rank-moment__cur::after {
    animation: none;
  }
}

:root[data-motion='reduced'] .rank-moment__cur::after {
  animation: none;
}

/* Phones: a narrower emblem column and a smaller log, still with no scroll. */
:root:is([data-phone='true'], [data-tight='true']) .rank-moment {
  grid-template-columns: minmax(0, 1fr) 5.5rem;
  gap: var(--space-2);
  height: 9.5rem;
  padding: var(--space-2) var(--space-3);
}

:root:is([data-phone='true'], [data-tight='true']) .rank-moment__log {
  font-size: 0.66rem;
}

:root:is([data-phone='true'], [data-tight='true']) .rank-moment__box {
  width: 3.4rem;
}

:root:is([data-phone='true'], [data-tight='true']) .rank-moment__title {
  font-size: var(--text-sm);
  letter-spacing: 0.1em;
}

:root:is([data-phone='true'], [data-tight='true']) .rank-moment__title.is-long {
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}
