/* Ranking page: tabs + search, top-3 podium, compact rows for 4..100 */

/* ── Toolbar: tabs + search ── */
.rk-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 20px; scroll-margin-top: calc(var(--header-h) + 12px); }
.rk-tabs { flex: 1 1 640px; min-width: 0; }
.rk-tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.rk-tab .icon { flex: none; opacity: 0.8; }
.rk-tab.is-active .icon { opacity: 1; }
.rk-tab__short { display: none; }
.rk-search { position: relative; flex: 0 1 300px; min-width: 220px; }
.rk-search .icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.rk-search .input { min-height: 50px; padding-left: 44px; border-radius: 14px; }
.rk-search .input::-webkit-search-cancel-button { filter: invert(0.7); cursor: pointer; }

/* ── Board ── */
.rk-panel { padding: clamp(18px, 3vw, 32px); }
.rk-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: clamp(24px, 4vw, 40px); }
.rk-title { margin: 0; font-size: clamp(1.25rem, 2.4vw, 1.65rem); }
.rk-sub { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.rk-board.is-searching .rk-pager { display: none; }

/* pager */
.rk-pager { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(5, 10, 22, 0.5); }
.rk-page { min-height: 36px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font: 700 0.8rem/1 var(--font-body); font-variant-numeric: tabular-nums; cursor: pointer; transition: background 0.2s, color 0.2s; }
.rk-page:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.rk-page.is-active { background: rgba(56, 189, 248, 0.16); color: #fff; box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.45); }
.rk-pager--bottom { display: flex; width: max-content; margin: 22px auto 0; }

/* the ranked value */
.rk-val { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; color: #fff; white-space: nowrap; }
.rk-val--pk { color: #fda4af; }
.rk-val--poin { color: #6ee7b7; }
.rk-val--star { color: var(--gold); }
.rk-star { flex: none; width: 18px; height: 18px; filter: drop-shadow(0 0 6px rgba(246, 196, 83, 0.55)); }
.rk-legion {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 2px 9px; border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.32); background: rgba(167, 139, 250, 0.12); color: #c4b5fd; font-size: 0.74rem; font-weight: 600; line-height: 1.5;
}
.rk-legion span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-legion .icon { flex: none; }

/* ── Podium (ranks 1-3) ── */
.podium { list-style: none; margin: 0 0 clamp(24px, 4vw, 40px); padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 2vw, 22px); align-items: end; }
.pod {
  --tier: 246, 196, 83;
  position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 30px 16px 22px; border-radius: var(--r-lg); border: 1px solid rgba(var(--tier), 0.42);
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(var(--tier), 0.2), transparent 70%),
    linear-gradient(180deg, rgba(20, 36, 70, 0.72), rgba(8, 15, 32, 0.9));
  box-shadow: 0 26px 60px -32px rgba(var(--tier), 0.75), var(--shadow);
}
.pod--1 { order: 2; padding-top: 44px; padding-bottom: 30px; }
.pod--2 { order: 1; --tier: 203, 213, 225; }
.pod--3 { order: 3; --tier: 222, 146, 84; }
.pod__crown { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); color: var(--gold); filter: drop-shadow(0 4px 14px rgba(246, 196, 83, 0.7)); }
.pod__face { position: relative; width: 100px; height: 100px; margin-bottom: 14px; padding: 3px; border-radius: 50%; background: linear-gradient(160deg, rgb(var(--tier)), rgba(var(--tier), 0.25)); box-shadow: 0 0 34px -4px rgba(var(--tier), 0.6); }
.pod--1 .pod__face { width: 128px; height: 128px; }
.pod__face img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid #0a1430; background: #0a1430; }
.pod__medal {
  position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%);
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(160deg, #fff, rgb(var(--tier)) 55%, rgba(var(--tier), 0.7)); border: 3px solid #0a1430;
  color: #1a1204; font: 800 1rem/1 var(--font-body);
}
.pod--1 .pod__medal { width: 40px; height: 40px; bottom: -16px; font-size: 1.15rem; }
.pod__name { max-width: 100%; margin: 4px 0 0; font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod--1 .pod__name { font-size: 1.35rem; }
.pod__meta { margin: 0; color: var(--text-2); font-size: 0.84rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod__owner { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; margin: 0; color: var(--muted); font-size: 0.8rem; }
.pod__owner span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod__stat { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(var(--tier), 0.32); background: rgba(5, 10, 22, 0.62); }
.pod__label { color: var(--muted); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; }
.pod .rk-val { font-size: 1.4rem; }
.pod--1 .rk-val { font-size: 1.7rem; }
.pod__extra { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin: 2px 0 0; color: var(--muted); font-size: 0.78rem; }
.pod__extra b { color: var(--text-2); font-variant-numeric: tabular-nums; }
.pod .item-grid { justify-content: center; margin-top: 4px; }
.pod .item-slot img { width: 30px; height: 30px; }

/* golden pets */
.pod--pet {
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(var(--tier), 0.25), transparent 70%),
    linear-gradient(180deg, rgba(10, 14, 26, 0.55), rgba(8, 12, 24, 0.9)),
    url("../../../img/800/images/misc/golden_background.png.webp") center / cover no-repeat;
}
.pod--pet .pod__face { border-radius: 26px; }
.pod--pet .pod__face img { border-radius: 23px; }

/* ── Rows (ranks 4..100) ── */
.rk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rk-item { border: 1px solid var(--line); border-radius: 14px; background: rgba(8, 15, 32, 0.62); transition: border-color 0.2s, background 0.2s; }
.rk-item:hover { border-color: rgba(56, 189, 248, 0.38); background: rgba(56, 189, 248, 0.06); }
.rk-row { display: grid; align-items: center; column-gap: 14px; padding: 8px 18px 8px 10px; min-height: 64px; }
.rk-row--head { min-height: 0; padding-top: 0; padding-bottom: 10px; color: var(--muted); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.rk-row--head span:nth-child(1) { text-align: center; }
.rk-row--head span:nth-child(2) { grid-column: span 2; }
.rk-row--head span:last-child { text-align: right; }
.rk-table--toppet .rk-row--head span:nth-last-child(2) { text-align: right; }
.rk-row__rank { text-align: center; color: var(--text-2); font: 800 1rem/1 var(--font-body); font-variant-numeric: tabular-nums; }
.rk-row__face { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line-2); background: #0a1430; }
.rk-row__name { min-width: 0; color: #fff; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-row__info { display: contents; }
.rk-c { min-width: 0; color: var(--text-2); font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-c--lv { font-variant-numeric: tabular-nums; }
.rk-c--owner { display: inline-flex; align-items: center; gap: 6px; }
.rk-c--owner .icon { flex: none; color: var(--muted); }
.rk-c--owner span { overflow: hidden; text-overflow: ellipsis; }
.rk-row__stat { text-align: right; }
.rk-row__stat .rk-val { font-size: 1.1rem; }

.rk-table--players .rk-row { grid-template-columns: 44px 48px minmax(0, 1.5fr) 72px minmax(0, 0.9fr) minmax(0, 1.1fr) 130px; }
.rk-table--pets .rk-row { grid-template-columns: 44px 48px minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) 120px; }
.rk-table--toppet .rk-row { grid-template-columns: 44px 48px minmax(0, 1.3fr) 64px minmax(0, 0.8fr) minmax(0, 1fr) 132px 112px 18px; }

/* golden pet rows */
.rk-table--pets .rk-item {
  border-color: rgba(246, 196, 83, 0.2);
  background:
    linear-gradient(90deg, rgba(8, 13, 26, 0.94) 0%, rgba(8, 13, 26, 0.84) 60%, rgba(8, 13, 26, 0.74) 100%),
    url("../../../img/800/images/misc/golden_background.png.webp") center / cover no-repeat;
}
.rk-table--pets .rk-item:hover { border-color: rgba(246, 196, 83, 0.5); }
.rk-table--pets .rk-row__face { border-color: rgba(246, 196, 83, 0.55); box-shadow: 0 0 14px -4px rgba(246, 196, 83, 0.6); }

/* top pet: expandable rows */
.rk-x > summary { list-style: none; cursor: pointer; }
.rk-x > summary::-webkit-details-marker { display: none; }
.rk-x > summary:focus-visible { outline-offset: -2px; border-radius: 14px; }
.rk-row__chev { color: var(--muted); transition: transform 0.25s var(--ease); }
.rk-x[open] .rk-row__chev { transform: rotate(90deg); color: var(--primary); }
.rk-x[open] { border-radius: 14px; background: rgba(56, 189, 248, 0.04); }
.rk-item:has(.rk-x[open]) { border-color: rgba(56, 189, 248, 0.38); }
.rk-row__pets { min-width: 0; }
.rk-minipets { display: flex; gap: 6px; }
.rk-minipet { position: relative; flex: none; }
.rk-minipet img { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; border: 1px solid rgba(246, 196, 83, 0.55); box-shadow: 0 0 10px -3px rgba(246, 196, 83, 0.6); }
.rk-minipet b { position: absolute; right: -4px; bottom: -5px; padding: 0 4px; border-radius: 6px; background: #0a1430; border: 1px solid rgba(246, 196, 83, 0.45); color: var(--gold); font-size: 0.6rem; line-height: 1.4; font-variant-numeric: tabular-nums; }
.pod .rk-minipets { margin-top: 4px; }
.rk-more { display: grid; grid-template-columns: auto auto 1fr; align-items: start; gap: 16px 28px; padding: 6px 18px 18px 116px; }
.rk-more__stats { display: grid; gap: 8px; align-content: start; }
.rk-more__stats b { color: #fff; font-variant-numeric: tabular-nums; }
.rk-more__label { margin: 0 0 8px; color: var(--muted); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.rk-pets { display: flex; flex-wrap: wrap; gap: 8px; }
.rk-pet {
  display: grid; justify-items: center; gap: 4px; width: 96px; padding: 8px 6px; border-radius: 12px; text-align: center;
  border: 1px solid rgba(246, 196, 83, 0.4);
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.35), rgba(10, 14, 26, 0.75)), url("../../../img/800/images/misc/golden_background.png.webp") center / cover no-repeat;
}
.rk-pet img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; border: 1px solid rgba(255, 210, 120, 0.6); }
.rk-pet__name { max-width: 100%; color: #fff1c4; font-size: 0.74rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-pet__star { display: inline-flex; align-items: center; gap: 4px; color: var(--gold); font-size: 0.8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.rk-pet__star .rk-star { width: 14px; height: 14px; }

/* equipment (border colour = item quality, last digit of its type) */
.item-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.item-slot { position: relative; display: grid; place-items: center; padding: 3px; border-radius: 9px; border: 1px solid rgba(120, 200, 255, 0.2); background: rgba(5, 10, 22, 0.65); transition: box-shadow 0.2s; }
.item-slot img { width: 36px; height: 36px; border-radius: 6px; }
.item-q0 { border-color: rgba(255, 255, 255, 0.55); --q: 255, 255, 255; }
.item-q1 { border-color: rgba(80, 220, 80, 0.6); --q: 80, 220, 80; }
.item-q2 { border-color: rgba(70, 130, 255, 0.6); --q: 70, 130, 255; }
.item-q3 { border-color: rgba(255, 60, 60, 0.6); --q: 255, 60, 60; }
.item-q4 { border-color: rgba(255, 165, 0, 0.65); --q: 255, 165, 0; }
.item-slot:hover { box-shadow: 0 0 12px rgba(var(--q, 80, 160, 255), 0.35); }
@media (hover: hover) {
  .item-slot::after {
    content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 5;
    padding: 4px 8px; border-radius: 6px; background: rgba(2, 6, 16, 0.95); border: 1px solid var(--line-2);
    color: rgb(var(--q, 224, 234, 255)); font-size: 0.7rem; font-weight: 600; white-space: nowrap; pointer-events: none; display: none;
  }
  .item-slot:hover::after { display: block; }
}

/* ── Loading, empty, error ── */
.rk-skel-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 32px; }
.rk-skel-head span:nth-child(1) { width: 260px; max-width: 70%; height: 26px; }
.rk-skel-head span:nth-child(2) { width: 200px; max-width: 50%; height: 14px; }
.rk-skel-podium .skeleton { border-radius: var(--r-lg); height: 230px; }
.rk-skel-podium .pod--1 { height: 270px; }
.rk-skel-rows { display: grid; gap: 6px; }
.rk-skel-rows span { height: 64px; border-radius: 14px; }
.rk-empty, .rk-noresult { display: grid; justify-items: center; gap: 10px; }
.rk-empty .icon, .rk-noresult .icon { color: var(--line-2); }
.rk-empty p, .rk-noresult p { margin: 0; }
.rk-board.is-searching .rk-head { margin-bottom: 18px; }
.rk-error { align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* ── Tablet ── */
@media (max-width: 1020px) {
  .rk-table--toppet .rk-row { grid-template-columns: 44px 48px minmax(0, 1.3fr) 64px minmax(0, 0.9fr) minmax(0, 1fr) 112px 18px; }
  .rk-table--toppet .rk-row__pets, .rk-table--toppet .rk-row--head span:nth-child(6) { display: none; }
  .rk-more { padding-left: 18px; }
}

/* ── Phones ── */
@media (max-width: 760px) {
  .rk-toolbar { gap: 10px; margin-bottom: 14px; }
  .rk-tabs { flex-basis: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .rk-tab { flex-direction: column; gap: 4px; padding: 9px 4px; font-size: 0.76rem; }
  .rk-tab__long { display: none; }
  .rk-tab__short { display: block; }
  .rk-search { flex: 1 1 100%; min-width: 0; }
  .rk-search .input { min-height: 46px; }
  .rk-panel { padding: 16px 12px 18px; border-radius: var(--r); }
  .rk-head { margin-bottom: 30px; }
  .rk-head .rk-pager { display: none; }

  .podium { gap: 6px; }
  .pod { padding: 22px 6px 12px; gap: 3px; border-radius: var(--r); }
  .pod--1 { padding-top: 30px; padding-bottom: 16px; }
  .pod__crown { width: 26px; height: 26px; top: -14px; }
  .pod__face { width: 62px; height: 62px; padding: 2px; margin-bottom: 10px; }
  .pod--1 .pod__face { width: 80px; height: 80px; }
  .pod__face img { border-width: 2px; }
  .pod__medal { width: 26px; height: 26px; bottom: -11px; font-size: 0.82rem; border-width: 2px; }
  .pod--1 .pod__medal { width: 30px; height: 30px; bottom: -13px; font-size: 0.92rem; }
  .pod__name, .pod--1 .pod__name { font-size: 0.86rem; }
  .pod__meta, .pod__owner { font-size: 0.7rem; }
  .pod .rk-legion { font-size: 0.64rem; padding: 1px 6px; }
  .pod .rk-legion .icon { display: none; }
  .pod__stat { flex-direction: column; gap: 2px; margin-top: 4px; padding: 5px 10px; border-radius: 12px; max-width: 100%; }
  .pod__label { font-size: 0.56rem; letter-spacing: 0.08em; white-space: normal; line-height: 1.25; text-align: center; }
  .pod .rk-val, .pod--1 .rk-val { font-size: 1.02rem; gap: 4px; }
  .pod .rk-star { width: 14px; height: 14px; }
  .pod .rk-minipets { gap: 4px; }
  .pod .rk-minipet img { width: 26px; height: 26px; border-radius: 7px; }
  .pod .rk-minipet b { font-size: 0.54rem; right: -3px; }
  .pod .item-grid { gap: 3px; }
  .pod .item-slot { padding: 1px; border-radius: 6px; }
  .pod .item-slot img { width: 22px; height: 22px; }
  .pod__extra { font-size: 0.64rem; flex-direction: column; gap: 0; }

  .rk-row--head { display: none !important; }
  .rk-list { gap: 5px; }
  .rk-item { border-radius: 12px; }
  .rk-row,
  .rk-table--players .rk-row,
  .rk-table--pets .rk-row {
    grid-template-columns: 28px 42px minmax(0, 1fr) auto;
    grid-template-areas: "rank face name stat" "rank face info stat";
    column-gap: 10px; row-gap: 1px; min-height: 58px; padding: 7px 12px 7px 6px;
  }
  .rk-table--toppet .rk-row {
    grid-template-columns: 28px 42px minmax(0, 1fr) auto 14px;
    grid-template-areas: "rank face name stat chev" "rank face info stat chev";
    column-gap: 10px; row-gap: 1px; min-height: 58px; padding: 7px 10px 7px 6px;
  }
  .rk-row__rank { grid-area: rank; font-size: 0.9rem; }
  .rk-row__face { grid-area: face; width: 42px; height: 42px; border-radius: 10px; }
  .rk-row__name { grid-area: name; align-self: end; font-size: 0.92rem; }
  .rk-row__info { grid-area: info; align-self: start; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; overflow: hidden; }
  .rk-row__stat { grid-area: stat; }
  .rk-row__chev { grid-area: chev; }
  .rk-row__pets { display: none; }
  .rk-c { flex: none; font-size: 0.74rem; color: var(--muted); }
  .rk-c--prof { flex: 1 1 0; min-width: 0; }
  .rk-c--prof::before { content: "\00b7"; margin-right: 6px; }
  .rk-c--legion { flex: 0 0 100%; min-width: 0; display: flex; }
  .rk-c--legion:empty { display: none; }
  .rk-legion { font-size: 0.66rem; padding: 0 7px; }
  .rk-legion .icon { display: none; }
  .rk-c--species { flex: 0 1 auto; }
  .rk-c--owner { flex: 0 1 auto; min-width: 0; gap: 4px; }
  .rk-row__stat .rk-val { font-size: 1rem; }
  .rk-row__stat .rk-star { width: 15px; height: 15px; }
  .rk-more { grid-template-columns: 1fr; gap: 14px; padding: 4px 12px 14px; }
  .rk-more__stats { display: flex; flex-wrap: wrap; }
  .rk-pet { width: calc((100% - 16px) / 3); }
  .rk-pager--bottom { margin-top: 18px; }
  .rk-skel-podium .skeleton { height: 170px; }
  .rk-skel-podium .pod--1 { height: 200px; }
  .rk-skel-rows span { height: 58px; }
}
@media (max-width: 380px) {
  .rk-tab .icon { display: none; }
}
