/* Shared soldier board: podium slots, rank insignia and the table. Used by the ranking page (views/ranking.php)
   and by the home teaser (views/home.php). Only rk-* classes; page layout lives in ranking-page.css.
   Rank insignia are 32 px PNGs: shown at 1x in rows and at exactly 2x (64 px) on the podium, so they stay crisp. */

:root {
  --rk-gold: #ffbd6d;
  --rk-silver: #c2d3e1;
  --rk-bronze: #dfa582;
}

/* ---------- Insignia ---------- */
.rk-insignia { display: inline-block; flex: none; line-height: 0; }
.rk-insignia img { display: block; width: 32px; height: 32px; image-rendering: pixelated; }
.rk-insignia--xl,
.rk-insignia--xl img { width: 64px; height: 64px; }

/* ---------- Podium slots ---------- */
.rk-slot {
  --medal: var(--rk-silver);
  position: relative;
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  padding: 20px 20px 18px;
  background: linear-gradient(180deg, #1b2229 0%, #12171c 100%);
  border: 1px solid #2a323a;
  box-shadow: inset 0 1px 0 #ffffff0f, 0 18px 40px #0008;
  container-type: inline-size;
}
.rk-slot::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--medal);
}
.rk-slot--1 {
  --medal: var(--rk-gold);
  padding: 26px 24px 22px;
  background:
    radial-gradient(120% 70% at 50% 0%, #ffbd6d1f 0, transparent 62%),
    linear-gradient(180deg, #232b33 0%, #12171c 100%);
  border-color: #5c4526;
}
.rk-slot--2 { --medal: var(--rk-silver); }
.rk-slot--3 { --medal: var(--rk-bronze); }

.rk-slot--empty {
  align-content: center;
  justify-items: center;
  min-height: 210px;
  background: transparent;
  border: 1px dashed #3a444e;
  box-shadow: none;
}
.rk-slot--empty::before { display: none; }
.rk-slot--empty .rk-medal { background: #232a31; color: #6b7681; }
.rk-slot-free {
  margin: 0;
  color: #6b7681;
  font-size: 14px;
  letter-spacing: 0.3px;
}

.rk-slot-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rk-medal {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--medal);
  color: #0b0e11;
  font: 700 16px/1 Barlow, Inter, Arial, sans-serif;
}
.rk-slot-place {
  color: var(--medal);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.rk-slot-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.rk-slot-text { display: grid; gap: 4px; min-width: 0; justify-items: start; }
.rk-slot-name {
  margin: 0;
  font: 700 26px/1.05 Barlow, Inter, Arial, sans-serif;
  letter-spacing: 0.2px;
  overflow-wrap: anywhere;
}
.rk-slot--1 .rk-slot-name { font-size: 34px; }
.rk-slot-rank { margin: 0; color: #8a949e; font-size: 13px; overflow-wrap: anywhere; }
.rk-clan-tag {
  display: inline-block;
  max-width: 100%;
  margin-top: 4px;
  padding: 2px 8px;
  border: 1px solid var(--medal);
  color: var(--medal);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  overflow-wrap: anywhere;
}

/* Stats: label above value. Four columns when the card is wide enough; two otherwise. Numbers never wrap. */
.rk-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid #2a323a;
}
.rk-stat { display: grid; gap: 4px; min-width: 0; padding: 0 10px; }
.rk-stat:first-child { padding-left: 0; }
.rk-stat + .rk-stat { border-left: 1px solid #ffffff0d; }
.rk-stat-label { color: #8a949e; font-size: 12px; letter-spacing: 0.2px; }
.rk-stat-value {
  margin: 0;
  font: 700 19px/1.15 Barlow, Inter, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* The query measures the slot's content box (about 355 px at 1440, 265 px at 1024): two columns only below 350 px. */
@container (max-width: 350px) {
  .rk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
  .rk-stat:nth-child(odd) { padding-left: 0; border-left: 0; }
  .rk-stat:nth-child(even) { border-left: 1px solid #ffffff0d; }
}

/* ---------- Table ---------- */
.rk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.rk-table caption { caption-side: bottom; }
.rk-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0;
  background: #141a20;
  color: #b7c2cc;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid #2a323a;
}
.rk-table thead th:nth-child(n+4) { text-align: right; }
.rk-table tbody td,
.rk-table tbody th {
  padding: 12px 14px;
  border-bottom: 1px solid #1c232a;
  vertical-align: middle;
}
.rk-table tbody th { font-weight: 400; text-align: left; }
.rk-row:nth-child(even) { background: #10151a; }
.rk-row:hover { background: #18202a; }
.rk-row:hover > td:first-child,
.rk-row:hover > th:first-child { color: #f2f4f6; }

.rk-pos {
  width: 64px;
  color: #8a949e;
  font: 700 16px/1 Barlow, Inter, Arial, sans-serif;
  letter-spacing: 0.5px;
}
.rk-row[data-place="1"] > .rk-pos { color: var(--rk-gold); }
.rk-row[data-place="2"] > .rk-pos { color: var(--rk-silver); }
.rk-row[data-place="3"] > .rk-pos { color: var(--rk-bronze); }
.rk-row[data-place] > .rk-pos { box-shadow: inset 3px 0 0 var(--medal-row, transparent); }
.rk-row[data-place="1"] { --medal-row: var(--rk-gold); }
.rk-row[data-place="2"] { --medal-row: var(--rk-silver); }
.rk-row[data-place="3"] { --medal-row: var(--rk-bronze); }

.rk-player { min-width: 0; }
.rk-player-text { display: inline-block; vertical-align: middle; min-width: 0; }
.rk-player .rk-insignia { margin-right: 12px; vertical-align: middle; }
/* Name is the strongest element of the row: normal case, not the uppercase header style. */
.rk-player,
.rk-name,
.rk-title {
  text-transform: none;
  letter-spacing: normal;
}
.rk-name {
  display: block;
  color: #f2f4f6;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.rk-title {
  display: block;
  margin-top: 2px;
  color: #8a949e;
  font-size: 12px;
  line-height: 1.3;
}
.rk-clan { color: #b7c2cc; font-size: 13px; overflow-wrap: anywhere; }
.rk-muted { color: #5d6772; }
.rk-num { text-align: right; white-space: nowrap; }
.rk-col-exp { color: #f2f4f6; }

@media (max-width: 760px) {
  .rk-table .rk-col-clan,
  .rk-table .rk-col-wins { display: none; }
}
