/* =========================================================================
   DIE RANGLISTE (29.09.2026)
   =========================================================================
   Eine echte Tabelle: Platz, Figur mit Name, Klasse, Basisstufe, Jobstufe.
   Farben und Linien sind die der Seite (core/base.css: --gold, --hairline,
   --line, --ink, --ink-dim), nichts davon ist neu erfunden.

   Der Zeilentakt ist fest (`--rk-row`), er gehört mit `ROW_HEIGHT` in
   ranking-table.js zusammen. Nur so lässt sich die Liste fenstern, ohne zu
   messen, und nur so springt beim Nachladen der Figuren nichts.
   ========================================================================= */

.rk {
  --rk-row: 64px;
  --rk-figure-w: 52px;

  position: relative;
}

.rk-hint {
  margin: 0 0 0.9rem;
}

.rk-status {
  margin: 1.2rem 0;
  color: var(--ink-dim);
  font-size: 0.9rem;
  text-align: center;
}

.rk-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.rk-table thead th {
  padding: 0 0.5rem 0.45rem;
  border-bottom: 1px solid var(--hairline);
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.rk-table thead th.rk-head--num {
  text-align: right;
}

.rk-row {
  height: var(--rk-row);
  border-bottom: 1px solid rgb(255 255 255 / 6%);
  transition: background 0.18s ease;
}

.rk-row:hover {
  background: rgb(255 255 255 / 3%);
}

.rk-cell {
  padding: 0 0.5rem;
  color: var(--ink);
  vertical-align: middle;
  white-space: nowrap;
}

.rk-cell--place {
  width: 3.2rem;
  text-align: center;
}

.rk-cell--class {
  overflow: hidden;
  max-width: 11rem;
  color: var(--ink-dim);
  text-overflow: ellipsis;
}

.rk-cell--num {
  width: 3.4rem;
  text-align: right;
}

/* Name und Figur in einer Zelle, die Figur links vom Namen. */
.rk-who {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  height: var(--rk-row);
  min-width: 0;
}

.rk-name {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
}

/*
  Die Figur. Der Platz steht fest, bevor das Bild da ist; das Bild blendet
  weich ein. Pixelgrafik bleibt scharf (kein Weichzeichnen beim Verkleinern).
*/
.rk-figure {
  display: flex;
  flex: none;
  align-items: flex-end;
  justify-content: center;
  width: var(--rk-figure-w);
  height: calc(var(--rk-row) - 6px);
}

.rk-figure__img {
  max-width: 100%;
  max-height: 100%;
  opacity: 0;
  image-rendering: pixelated;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.rk-figure__img.is-ready {
  opacity: 1;
}

/* Der Platz als kleine runde Marke. */
.rk-place {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.9rem;
  height: 1.9rem;
  padding: 0 0.3rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink-dim);
  font-weight: 600;
}

/*
  Plätze 1 bis 3: dezent, nichts Grelles. Gold nimmt die Werte der Seite,
  Silber und Bronze sind gedämpft im selben Stil (Rand plus leichter Grund).
*/
.rk-row--top1 .rk-place {
  border-color: rgb(232 195 122 / 55%);
  background: linear-gradient(to bottom, rgb(232 195 122 / 16%), rgb(232 195 122 / 5%));
  color: var(--gold-bright);
  box-shadow: 0 0 12px rgb(232 195 122 / 14%);
}

.rk-row--top2 .rk-place {
  border-color: rgb(206 214 226 / 45%);
  background: linear-gradient(to bottom, rgb(206 214 226 / 13%), rgb(206 214 226 / 4%));
  color: #e6ebf3;
}

.rk-row--top3 .rk-place {
  border-color: rgb(205 140 92 / 50%);
  background: linear-gradient(to bottom, rgb(205 140 92 / 14%), rgb(205 140 92 / 4%));
  color: #f0c7a4;
}

.rk-row--top1 .rk-name {
  color: var(--gold-bright);
}

/* Platzhalter beim Laden: gleiche Höhe wie echte Zeilen, ruhig, ohne Bewegung. */
.rk-row--ghost .rk-cell::after {
  content: '';
  display: block;
  height: 0.7rem;
  border-radius: 4px;
  background: rgb(255 255 255 / 5%);
}

/* Der Abstandhalter des Fensters: nur Höhe, nichts zu sehen. */
.rk-spacer td {
  padding: 0;
  border: 0;
}

.rk-table thead th.rk-head--place {
  text-align: center;
}

/* -------------------------------------------- Die große Ansicht (30.09.2026) */

/*
  Werte, Gilde und Im Spiel (Renés Wunsch): nur im Großen. In der schmalen
  Ansicht sind die Zellen gar nicht da (display: none), die Tabelle sieht
  dort also genau aus wie vorher.
*/
.rk-head--gross,
.rk-cell--gross {
  display: none;
}

.panel.is-gross .rk-head--gross,
.panel.is-gross .rk-cell--gross {
  display: table-cell;
}

.panel.is-gross .rk-cell--num {
  padding-right: 1.4rem;
}

/* Die Werte in zwei ruhigen Zeilen: oben STR bis LUK, darunter die Traits. */
.rk-stats {
  display: block;
  color: var(--ink-dim);
  font-size: 0.8rem;
  letter-spacing: 0.3px;
}

.rk-stats--traits {
  margin-top: 0.2rem;
  color: var(--gold);
  font-size: 0.74rem;
}

/* Die Gilde größer und in Gold (Renés Wunsch 30.09.2026). */
.rk-cell--guild {
  overflow: hidden;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.98rem;
  letter-spacing: 0.4px;
  text-overflow: ellipsis;
}

/*
  FESTE SPALTEN im Großen (Renés Befund 30.09.2026: beim Rollen rutschte ab
  "Klasse" alles hin und her). Mit automatischer Tabellenbreite richtet der
  Browser die Spalten nach den gerade gebauten Zeilen aus, und die wechseln
  beim Rollen (gefenstert). Jetzt bestimmt allein der Tabellenkopf die
  Breiten. Was nicht passt, endet mit Auslassungspunkten; der volle Text
  steht im Tooltip (title, ranking-table.js).
*/

/*
  Die schmale Ansicht rutschte genauso (gemessen 12 Punkte). Ihre Breiten
  sind die, die der Browser vorher im Mittel selbst gewählt hat, sie sieht
  also aus wie vorher, nur ruhig. Der Name bekommt den Rest.
*/
.rk-table thead th:nth-child(1) {
  width: 3.4rem;
}

.rk-table thead th:nth-child(3) {
  width: 11.7rem;
}

.rk-table thead th:nth-child(4),
.rk-table thead th:nth-child(5) {
  width: 3.4rem;
}

.rk-cell--name,
.rk-cell--class {
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel.is-gross .rk-table thead th:nth-child(1) {
  width: 4.2rem;
}

.panel.is-gross .rk-table thead th:nth-child(2) {
  width: 14rem;
}

.panel.is-gross .rk-table thead th:nth-child(3) {
  width: 10rem;
}

.panel.is-gross .rk-table thead th:nth-child(4),
.panel.is-gross .rk-table thead th:nth-child(5) {
  width: 5rem;
}

.panel.is-gross .rk-table thead th:nth-child(7) {
  width: 11rem;
}

.panel.is-gross .rk-table thead th:nth-child(8) {
  width: 15rem;
}

.panel.is-gross .rk-table thead th:nth-child(9) {
  width: 5.5rem;
}

/* Die meistgenutzten Skills, fünf Icons nebeneinander. */
.rk-cell--skills {
  color: var(--ink-dim);
}

.rk-skill {
  width: 24px;
  height: 24px;
  margin-right: 5px;
  vertical-align: middle;
  image-rendering: pixelated;
}

.panel.is-gross .rk-cell {
  overflow: hidden;
  text-overflow: ellipsis;
}

.rk-head--online,
.rk-cell--online {
  width: 4.5rem;
  text-align: center;
}

/* Ein kleiner Punkt: grün im Spiel, sonst gedämpft. */
.rk-online {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgb(255 255 255 / 14%);
}

.rk-online.is-online {
  background: #5fd47a;
  box-shadow: 0 0 6px rgb(95 212 122 / 60%);
}

/* Die Werte etwa so weit von "Job" weg wie "Job" von "Basis" (Renés Wunsch). */
.panel.is-gross .rk-table thead th:nth-child(6),
.panel.is-gross .rk-cell--stats {
  padding-left: 2.6rem;
}
