/* Kalypse - Ink & Seal: ranking page (loads after ink.css) */

.rk main { position: relative; }
.rk-glyph {
  position: absolute;
  z-index: 0;
  left: -5vw;
  top: 36px;
  font-family: var(--brush);
  font-size: min(64vh, 44vw, 620px);
  line-height: 1;
  color: var(--wash);
  opacity: .15;
  mix-blend-mode: multiply;
  pointer-events: none;
  user-select: none;
  animation: rk-ink-in 1.8s cubic-bezier(.2,.65,.25,1) .05s both;
}
@keyframes rk-ink-in {
  0% { opacity: 0; filter: blur(24px); transform: scale(1.08); }
  100% { opacity: .15; filter: none; transform: none; }
}

/* ---------- layout: margin index on the left, the board on the right ---------- */
.rk-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(24px, 3vw, 48px);
  row-gap: clamp(56px, 6vw, 88px);
  align-items: start;
  padding-top: clamp(124px, 11vw, 160px);
  padding-bottom: clamp(88px, 9vw, 136px);
}
.rk-grid .rk-head { grid-column: 1 / span 4; grid-row: 1; }
.rk-grid .podium-wrap { grid-column: 5 / span 8; grid-row: 1; }
.rk-grid .rk-side { grid-column: 1 / span 4; grid-row: 2; position: sticky; top: 28px; min-width: 0; padding-right: clamp(8px, 2vw, 32px); }
.rk-grid .rk-list { grid-column: 5 / span 8; grid-row: 2; min-width: 0; padding-left: clamp(16px, 2.5vw, 40px); border-left: 1px solid rgba(20,18,16,.14); }
.rk-grid--flat .rk-list { grid-row: 1 / span 2; }

/* ---------- head + ranking index ---------- */
.rk-head h1 {
  font-size: clamp(2.6rem, 4.6vw, 4rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.05;
}
.rk-head .sec-head .seal { margin-top: .45rem; }
.rk-intro {
  margin-top: 1rem;
  margin-left: calc(3.25rem + 1.25rem);
  max-width: 22rem;
  font-size: 1.06rem;
  line-height: 1.65;
  color: var(--ink-soft);
}
.rk-tabs { margin-top: clamp(28px, 3vw, 44px); }
.rk-tabs li { background: var(--brushline) left bottom / 100% 3px no-repeat; }
.rk-tabs li:first-child { background: var(--brushline) left top / 100% 3px no-repeat, var(--brushline) left bottom / 100% 3px no-repeat; }
.rk-tabs a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.4rem;
  column-gap: 1.1rem;
  align-items: center;
  min-height: 4.75rem;
  padding: .7rem 0 .75rem;
  text-decoration: none;
}
.rk-tabs .t {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}
.rk-tabs .t::after {
  content: "";
  flex: 1;
  min-width: 1.5rem;
  border-bottom: 2px dotted var(--wash);
  opacity: .8;
}
.rk-tabs .d {
  grid-column: 1;
  margin-top: .15rem;
  font-size: .95rem;
  line-height: 1.4;
  color: var(--wash-text);
}
.rk-tabs .g, .rk-tabs .seal { grid-column: 2; grid-row: 1 / span 2; justify-self: center; }
.rk-tabs .g {
  font-family: var(--brush);
  font-size: 2.6rem;
  line-height: 1;
  color: var(--ink);
  transition: color .2s;
}
.rk-tabs .seal { --s: 3.1rem; --r: 3deg; }
.rk-tabs a:hover .g, .rk-tabs a:focus-visible .g { color: var(--cinnabar); }
.rk-tabs a:hover .t, .rk-tabs a:focus-visible .t { color: var(--cinnabar); }
.rk-tabs a.on .t::after { border-bottom-color: var(--cinnabar); opacity: .7; }

/* ---------- podium: three hanging scrolls, the winner hangs highest ---------- */
.podium {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.16fr) minmax(0, 1fr);
  gap: clamp(36px, 3.4vw, 52px);
  align-items: start;
  padding-inline: 24px;
}
.pod .rod { margin-inline: -8px; }
.pod .rod::before { left: -6px; } .pod .rod::after { right: -6px; }
.pod .rod--bottom { margin-inline: -10px; }
.pod .rod--bottom::before { left: -8px; } .pod .rod--bottom::after { right: -8px; }
.pod--1 { order: 2; }
.pod--2 { order: 1; }
.pod--3 { order: 3; }
.pod .painting {
  position: relative;
  min-height: 430px;
  padding: 24px 18px 20px;
}
.pod--1 .painting { min-height: 500px; padding: 28px 22px 22px; }
.pod .painting p { margin-top: 0; }
.pod-rank {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 1.7rem !important;
  font-weight: 800 !important;
  line-height: 1;
  color: var(--ink) !important;
}
.pod-rank .seal {
  --s: 3.5rem;
  --r: 4deg;
  font-size: 1.7rem;
  animation: stamp .5s cubic-bezier(.3,1.6,.5,1) .6s both;
}
.pod .g {
  font-family: var(--brush);
  font-size: clamp(5rem, 7vw, 7rem);
  line-height: 1;
  text-align: center;
  color: var(--ink);
  margin-block: 26px 22px;
}
.pod--1 .g { font-size: clamp(6rem, 9vw, 9.25rem); margin-top: 34px; }
.pod h3 {
  margin-top: auto;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.pod--1 h3 { font-size: 1.85rem; }
.pod h3 a { text-decoration: none; }
.pod h3 a:hover { color: var(--cinnabar); }
.pod .job {
  margin-top: .25rem !important;
  font-size: .98rem !important;
  line-height: 1.4;
}
.pod-stats { margin: 1rem 0 0; }
.pod-stats div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .75rem;
  padding-block: .32rem .4rem;
  background: var(--brushline) left bottom / 100% 3px no-repeat;
}
.pod-stats div:first-child { background: var(--brushline) left top / 100% 3px no-repeat, var(--brushline) left bottom / 100% 3px no-repeat; padding-top: .45rem; }
.pod-stats dt { font-size: .9rem; line-height: 1.3; color: var(--wash-text); flex: none; }
.pod-stats dd {
  margin: 0;
  min-width: 0;
  text-align: right;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  font-variant-numeric: lining-nums tabular-nums;
  overflow-wrap: anywhere;
}
.pod-stats .main dd { font-size: 1.35rem; font-weight: 800; }
.pod--1 .pod-stats .main dd { font-size: 1.6rem; }
.pod-stats dd small { font-size: .7em; font-weight: 500; color: var(--wash-text); }
.pod-stats dd img, .rk-table td.pet img {
  display: inline-block;
  width: 30px;
  height: 30px;
  margin-right: .5rem;
  vertical-align: middle;
  background: var(--ink);
  image-rendering: pixelated;
  border-radius: 1px;
}

/* ---------- side: find, filter, notes ---------- */
.rk-side { display: grid; gap: 2.2rem; }
.rk-find label { display: block; font-size: 1.2rem; font-weight: 700; margin-bottom: .6rem; }
.rk-find .field { display: flex; gap: .5rem; }
.rk-find .field input { flex: 1 1 auto; min-width: 0; }
.rk-find .field button, .rk-find .field .btn { flex: none; }
.rk-find input {
  flex: 1;
  min-width: 0;
  min-height: 3.25rem;
  padding: .65rem .9rem;
  font: 500 1.05rem var(--serif);
  color: var(--ink);
  background: rgba(224,217,202,.7);
  border: 0;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1.5px var(--ink);
  -webkit-appearance: none;
  appearance: none;
}
.rk-find input:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 3px; }
.rk-find .btn { min-height: 3.25rem; padding-inline: 1.35rem; }
.rk-find .clear { display: inline-block; margin-top: .8rem; font-size: 1rem; }

.rk-filter h2, .rk-note h2 { font-size: 1.2rem; font-weight: 700; line-height: 1.3; margin-bottom: .55rem; }
.rk-filter ul { display: flex; flex-wrap: wrap; gap: .1rem .95rem; }
.rk-filter a {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-height: 2.75rem;
  font-size: 1.05rem;
  font-weight: 500;
  text-decoration: none;
  background-image: linear-gradient(var(--cinnabar), var(--cinnabar));
  background-position: left calc(100% - 4px);
  background-size: 0 2px;
  background-repeat: no-repeat;
  transition: background-size .25s;
}
.rk-filter a span { font-family: var(--brush); font-size: 1.4rem; line-height: 1; }
.rk-filter a:hover, .rk-filter a:focus-visible { background-size: 100% 2px; }
.rk-filter a[aria-current] { font-weight: 700; background-size: 100% 2px; }
.rk-filter a[aria-current] span { color: var(--cinnabar); }

.rk-note { padding-top: 1.5rem; background: var(--brushline) left top / 100% 5px no-repeat; }
.champs li {
  display: grid;
  grid-template-columns: 2.1rem 4.4rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: .5rem;
  padding-block: .45rem .5rem;
  background: var(--brushline) left bottom / 100% 3px no-repeat;
}
.champs .g { font-family: var(--brush); font-size: 1.6rem; line-height: 1; }
.champs .c { font-size: .95rem; color: var(--wash-text); }
.champs .p { font-weight: 700; overflow-wrap: anywhere; }
.champs .v { font-weight: 700; font-variant-numeric: lining-nums tabular-nums; }
.rk-note .legend { display: flex; align-items: center; gap: .6rem; margin-top: 1rem; font-size: .95rem; color: var(--wash-text); }
i.on {
  display: inline-block;
  width: .48rem;
  height: .48rem;
  margin-left: .6rem;
  vertical-align: .18em;
  background: var(--cinnabar);
  transform: rotate(45deg);
}
.legend i.on { margin-left: .1rem; vertical-align: 0; }
.ranks li {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  padding-block: .12rem;
  font-size: .98rem;
  line-height: 1.5;
}
.ranks li span:first-child { flex: 1; display: flex; align-items: baseline; gap: .5rem; }
.ranks li span:first-child::after { content: ""; flex: 1; min-width: 1rem; border-bottom: 2px dotted var(--wash); opacity: .7; }
.ranks .v { font-variant-numeric: lining-nums tabular-nums; color: var(--ink-soft); }
.ranks li:first-child { font-weight: 700; }
.ranks li:first-child .v { color: var(--cinnabar); }
.rk-note .fine { margin-top: .9rem; max-width: 26rem; font-size: .98rem; line-height: 1.6; color: var(--ink-soft); }
.kd-best b {
  display: block;
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--cinnabar);
  font-variant-numeric: lining-nums;
}
.kd-best span { display: block; margin-top: .55rem; font-size: 1.04rem; line-height: 1.5; }
.kd-best a { font-weight: 700; }

/* ---------- the list ---------- */
.rk-list-title { font-size: 1.35rem; font-weight: 700; line-height: 1.3; }
.rk-grid .rk-list table { margin-top: 1.1rem; }
.rk-table th:last-child, .rk-table td:last-child { padding-right: 0; }
.rank.rk-list .rk-table td { padding-block: .8rem; }
.rk-table th.num, .rk-table td.num { text-align: right; }
.rk-table td.name { overflow-wrap: anywhere; }
.who {
  text-decoration: underline;
  text-decoration-color: rgba(20,18,16,.28);
  text-decoration-thickness: 1px;
  text-underline-offset: .3em;
  transition: color .15s, text-decoration-color .15s;
}
.who:hover, .who:focus-visible { color: var(--cinnabar); text-decoration-color: var(--cinnabar); }
.pod h3 .who { text-decoration-color: rgba(20,18,16,.22); text-decoration-thickness: 1.5px; }
.rk-table td.cls { font-size: 1.04rem; }
.rk-table td.val { font-weight: 700; font-size: 1.25rem; }
.rk-table td.num.x { color: var(--ink-soft); }
.rk-table td.guild, .rk-table td.tag { font-size: 1.02rem; color: var(--ink-soft); }
.rk-table .none { color: var(--wash-text); }
.rk-table td.exp { white-space: nowrap; font-size: 1rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.bar {
  position: relative;
  display: inline-block;
  width: 4.5rem;
  height: 3px;
  margin-right: .6rem;
  vertical-align: middle;
  background: rgba(20,18,16,.16);
}
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--ink); }
.rk-table td small { font-size: .72em; font-weight: 500; color: var(--wash-text); }
.kd-hi { color: var(--ink); font-weight: 800; }
.kd-lo { color: var(--wash-text); }
.rk-empty {
  margin-top: 1.25rem;
  max-width: 36rem;
  padding: 1.5rem 0 1.6rem;
  font-size: 1.15rem;
  line-height: 1.7;
  background: var(--brushline) left top / 100% 4px no-repeat, var(--brushline) left bottom / 100% 4px no-repeat;
}
.rk-empty .textlink { margin-left: .3rem; }

/* ---------- gear view ---------- */
.gear-pop {
  position: fixed; inset: 0; z-index: 195;
  display: grid; place-items: center; padding: 16px;
  background: rgba(20,18,16,.55);
}
.gear-pop[hidden] { display: none; }
.gear-card {
  position: relative;
  width: min(480px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 2.1rem 2rem 1.8rem;
  background: var(--paper-hi);
  border: 1px solid var(--ink);
  box-shadow: 0 0 0 5px var(--paper-hi), 0 0 0 6px var(--ink), 0 30px 60px -20px rgba(0,0,0,.55);
}
.gear-card > .seal { --s: 3rem; --r: 4deg; position: absolute; top: 1.5rem; right: 1.6rem; }
.gear-card h2 { padding-right: 4rem; font-size: 2rem; overflow-wrap: anywhere; }
.gear-sub { margin-top: .35rem; font-size: 1rem; color: var(--ink-soft); }
.gear-box { margin-top: 1.3rem; min-height: 120px; padding: 18px; background: var(--ink); border-radius: 2px; }
.gear-card > .btn { width: 100%; margin-top: 1.4rem; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .rk-grid .rk-head { grid-column: 1 / -1; }
  .rk-intro { max-width: 34rem; }
  .rk-tabs ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(20px, 3vw, 40px); }
  .rk-tabs li:nth-child(-n+3) { background: var(--brushline) left top / 100% 3px no-repeat, var(--brushline) left bottom / 100% 3px no-repeat; }
  .rk-grid .podium-wrap { grid-column: 1 / -1; grid-row: 2; }
  .podium { max-width: 920px; margin-inline: auto; }
  .rk-grid .rk-side { grid-column: 1 / -1; grid-row: 3; position: static; padding-right: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(28px, 4vw, 56px); }
  .rk-grid .rk-side .rk-note { grid-column: 1 / -1; max-width: 36rem; }
  .rk-grid .rk-list { grid-column: 1 / -1; grid-row: 4; padding-left: 0; border-left: 0; }
  .rk-grid--flat .rk-side { grid-row: 2; }
  .rk-grid--flat .rk-list { grid-row: 3; }
}
@media (max-width: 900px) {
  .rk-grid .rk-side { grid-column: 1 / -1; position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
  .rk-grid .rk-side .rk-note { grid-column: 1 / -1; }
  .rk-grid .rk-list { grid-column: 1 / -1; grid-row: 4; padding-left: 0; border-left: 0; }
  .rk-grid .rk-side { padding-right: 0; }
  .rk-grid--flat .rk-list { grid-row: 3; }
  .rk-glyph { font-size: 70vw; left: -8vw; top: 56px; }
}
@media (max-width: 720px) {
  .podium { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 26px; row-gap: 22px; padding-inline: 12px; }
  .pod--1 { order: 0; grid-column: 1 / -1; width: min(100%, 320px); justify-self: center; }
  .pod--2 { order: 1; }
  .pod--3 { order: 2; }
  .podium .pod--1 { --h: 26px !important; }
  .podium .pod--2 { --h: 34px !important; }
  .podium .pod--3 { --h: 62px !important; }
  .pod .painting { min-height: 330px; padding: 16px 12px 14px; }
  .pod--1 .painting { min-height: 400px; padding: 22px 18px 18px; }
  .pod .g { font-size: 4.4rem; margin-block: 30px 14px; }
  .pod--1 .g { font-size: 6.6rem; margin-top: 30px; }
  .pod h3 { font-size: 1.12rem; }
  .pod--1 h3 { font-size: 1.6rem; }
  .pod-rank { top: 10px; right: 10px; font-size: 1.35rem !important; }
  .pod-rank .seal { --s: 2.9rem; font-size: 1.4rem; }
  .pod:not(.pod--1) .pod-stats div { display: block; }
  .pod:not(.pod--1) .pod-stats dd { text-align: left; }
  .pod:not(.pod--1) .pod-stats dt { font-size: .82rem; }
  .pod:not(.pod--1) .pod-stats .main dd { font-size: 1.15rem; }

  /* the table becomes stacked rows */
  .rk-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .rk-table, .rk-table tbody { display: block; }
  .rk-table tr {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: .9rem;
    row-gap: .2rem;
    padding: .75rem 0 .85rem 3.1rem;
    background: var(--brushline) left bottom / 100% 4px no-repeat;
  }
  .rank.rk-list .rk-table td { display: block; padding: 0; background: none; font-size: 1rem; }
  .rank.rk-list .rk-table td.pos { position: absolute; left: 0; top: .8rem; width: auto; font-size: 1.3rem; }
  .rank.rk-list .rk-table td.pos .seal { --s: 2.2rem; font-size: 1.05rem; }
  .rank.rk-list .rk-table td.name { order: 1; flex: 1 1 0; min-width: 0; font-size: 1.1rem; }
  .rank.rk-list .rk-table td.val { order: 2; margin-left: auto; font-size: 1.2rem; text-align: right; }
  .rank.rk-list .rk-table td.cls, .rank.rk-list .rk-table td.pet { order: 3; flex-basis: 100%; font-size: .98rem; color: var(--ink-soft); }
  .rank.rk-list .rk-table td.cls .g { font-size: 1.35rem; margin-right: .35rem; }
  .rank.rk-list .rk-table td.x { order: 4; font-size: .92rem; color: var(--ink-soft); text-align: left; }
  .rank.rk-list .rk-table td.x::before { content: attr(data-label) " "; color: var(--wash-text); }
  .rk-table td.exp .bar { width: 3rem; margin-right: .4rem; }
  .rank.rk-list .rk-table td.x:has(.none)::before { content: none; }
}
@media (max-width: 560px) {
  .rk-head h1 { font-size: 2.5rem; }
  .rk-head .sec-head .seal { margin-top: .15rem; }
  .rk-intro { margin-left: 0; }
  .rk-tabs ol { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
  .rk-tabs li:nth-child(3) { background: var(--brushline) left bottom / 100% 3px no-repeat; }
  .rk-tabs a { grid-template-columns: minmax(0, 1fr) 2.4rem; column-gap: .5rem; min-height: 4.1rem; padding: .55rem 0 .6rem; }
  .rk-tabs .t { font-size: 1.15rem; }
  .rk-tabs .t::after { display: none; }
  .rk-tabs .d { font-size: .82rem; line-height: 1.35; }
  .rk-tabs .g { font-size: 2rem; }
  .rk-tabs .seal { --s: 2.4rem; }
  .rk-grid .rk-side { grid-template-columns: minmax(0, 1fr); }
  .rk-filter ul { gap: 0 .85rem; }
  .gear-card { padding: 1.7rem 1.25rem 1.4rem; }
  .gear-card h2 { font-size: 1.6rem; }
  .gear-box { padding: 12px; }
}
