/* Furia MU - Rankings (W3). Owner: frontend-engineer. Loaded by view.header.php after furia-pages.css for every rankings view
   (index, search, online players, bans, GMs); everything is scoped to .furia-shell.body-page.page-rankings.
   Scope: the "Hall of Legends" on the rankings page = class rail + search bar, podium (top 3), ledger (places 4+), guild ledger,
   loading / empty / error states. Tokens: --fp-* from furia-pages.css; --fr-* below are local (medal tones, ornaments).
   The podium uses the same vocabulary as the home (furia-podium__place/figure/plinth/rank/name/class/stats) so a later merge into one
   sheet is a rename of the scope, nothing else. Hooks (EJS + view.index.php) are listed in rank_players.ejs. */

/* 1. Local tokens ---------------------------------------------------------------------------------- */
.furia-shell.body-page.page-rankings {
    --fr-silver: #bcc5c9;      /* same medal tones as the home (--fh-silver / --fh-bronze) */
    --fr-bronze: #c48a5a;
    --fr-crest: url("../../images/generated/orn-crest.webp");
    --fr-chalice: url("../../images/generated/orn-chalice.webp");
}
.furia-shell.body-page.page-rankings .fp-tabs { margin-bottom: clamp(14px, 2vw, 22px); }
.furia-shell.body-page.page-rankings .fp-rankings-content:has(.furia-hall__state) { min-height: 0; }   /* furia-pages reserves 360 px while the list loads; a state card needs no reserve */

/* 2. The hall: one bar (class rail + search), then the podium and the ledger --------------------------- */
.furia-shell.body-page.page-rankings .furia-hall { position: relative; isolation: isolate; }
.furia-shell.body-page.page-rankings .furia-hall__sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.furia-shell.body-page.page-rankings .furia-hall__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 0 0 clamp(6px, 1.4vw, 14px); }
.furia-shell.body-page.page-rankings .furia-hall--guilds .furia-hall__bar { justify-content: flex-end; }

/* class rail: icons only, the name arrives as a tooltip (hover, keyboard focus) and, on touch layouts, as a caption */
.furia-shell.body-page.page-rankings .furia-hall__rail { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-width: 0; margin: 0; }
.furia-shell.body-page.page-rankings .furia-hall__rail ul { display: flex; gap: 2px; margin: 0; padding: 2px; list-style: none; background: var(--fp-sunk); border: 1px solid var(--fp-line); border-radius: 3px; }
.furia-shell.body-page.page-rankings .furia-hall__rail li { flex: none; margin: 0; padding: 0; }
.furia-shell.body-page.page-rankings .dmn-content .furia-hall__rail li a {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 44px;
    height: 44px;
    padding: 0 6px;
    color: var(--fp-muted);
    text-decoration: none;
    background: none;
    border: 0;
    border-radius: 2px;
    transition: color .15s, background-color .15s;
}
.furia-shell.body-page.page-rankings .dmn-content .furia-hall__rail li a:hover { color: var(--fp-text); background: rgba(237, 231, 217, .06); text-decoration: none; }
.furia-shell.body-page.page-rankings .dmn-content .furia-hall__rail li a.is-active { color: var(--fp-text); background: var(--fp-raise); }
.furia-shell.body-page.page-rankings .furia-hall__rail a.is-active::before { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; background: var(--fp-cyan); }
.furia-shell.body-page.page-rankings .furia-hall__all { font: 600 .8125rem/1 var(--fp-body); }
.furia-shell.body-page.page-rankings .dmn-content .furia-hall__rail img { width: 28px; height: 28px; object-fit: cover; border-radius: 2px; opacity: .78; transition: opacity .15s; }
.furia-shell.body-page.page-rankings .furia-hall__rail a:hover img, .furia-shell.body-page.page-rankings .furia-hall__rail a:focus-visible img, .furia-shell.body-page.page-rankings .furia-hall__rail a.is-active img { opacity: 1; }
.furia-shell.body-page.page-rankings .furia-hall__rail a::after {   /* tooltip */
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    z-index: 6;
    padding: 5px 10px;
    font: 500 .8125rem/1.3 var(--fp-body);
    white-space: nowrap;
    color: var(--fp-text);
    background: var(--fp-bg);
    border: 1px solid var(--fp-line-2);
    border-radius: 2px;
    opacity: 0;
    transform: translate(-50%, 4px);
    pointer-events: none;
    transition: opacity .15s, transform .2s var(--fp-ease);
}
.furia-shell.body-page.page-rankings .furia-hall__rail a:hover::after, .furia-shell.body-page.page-rankings .furia-hall__rail a:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.furia-shell.body-page.page-rankings .furia-hall__now { display: none; font-size: .8125rem; color: var(--fp-muted); }

/* search lives in the bar, one line: field + quiet button (the gold primary stays free for real calls to action) */
.furia-shell.body-page.page-rankings .furia-hall__search { display: flex; flex: 1 1 280px; gap: 8px; min-width: 0; max-width: 420px; margin: 0 0 0 auto; padding: 0; border: 0; }
.furia-shell.body-page.page-rankings .dmn-content .furia-hall__search input { flex: 1 1 auto; min-width: 0; min-height: 50px; }
.furia-shell.body-page.page-rankings .dmn-content .furia-hall__search .btn { flex: none; min-height: 50px; padding-inline: 18px; }
/* quiet buttons (the shared .fp-btn-ghost loses to the gold base rule on specificity, so the hall states its own) */
.furia-shell.body-page.page-rankings .dmn-content :is(.furia-hall__search .btn, .furia-hall__state-action) { color: var(--fp-text); background: transparent; border-color: var(--fp-line-2); }
.furia-shell.body-page.page-rankings .dmn-content :is(.furia-hall__search .btn, .furia-hall__state-action):hover { color: var(--fp-cyan); background: rgba(55, 217, 197, .06); border-color: var(--fp-cyan); filter: none; }
.furia-shell.body-page.page-rankings .dmn-content :is(.furia-hall__search .btn, .furia-hall__state-action)::after { display: none; }

/* 3. Podium: class art standing on three plinths (same language as the home Hall of Legends) -------------- */
.furia-shell.body-page.page-rankings .furia-podium {
    position: relative;
    isolation: isolate;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: clamp(10px, 1.8vw, 26px);
    margin: 0 0 clamp(26px, 3.4vw, 44px);
    padding: clamp(8px, 2vw, 24px) 0 0;
    list-style: none;
}
.furia-shell.body-page.page-rankings .furia-podium::before {   /* one cool light pool behind the three figures */
    content: "";
    position: absolute;
    inset: 0 8% 10%;
    z-index: -1;
    background: radial-gradient(48% 58% at 50% 46%, color-mix(in srgb, var(--fp-cyan) 9%, transparent), transparent 72%);
    pointer-events: none;
}
.furia-shell.body-page.page-rankings .furia-podium__place {
    --medal: var(--fr-silver);
    --fig-h: clamp(210px, 23vw, 310px);
    --plinth-h: 190px;
    --num: clamp(42px, 3.8vw, 54px);
    --d: 0;
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin: 0;
    padding: 0;
}
.furia-shell.body-page.page-rankings .furia-podium__place[data-rank="1"] { --medal: var(--fp-gold); --fig-h: clamp(260px, 29vw, 390px); --plinth-h: 226px; --num: clamp(50px, 4.8vw, 66px); --d: 2; flex-grow: 1.18; max-width: 430px; order: 2; }
.furia-shell.body-page.page-rankings .furia-podium__place[data-rank="2"] { order: 1; }
.furia-shell.body-page.page-rankings .furia-podium__place[data-rank="3"] { --medal: var(--fr-bronze); --fig-h: clamp(196px, 21vw, 290px); --plinth-h: 166px; --d: 1; order: 3; }
.furia-shell.body-page.page-rankings .furia-podium__figure { position: relative; z-index: 2; display: flex; align-items: flex-end; justify-content: center; height: var(--fig-h); margin-bottom: -14px; }
.furia-shell.body-page.page-rankings .furia-podium__place[data-rank="1"] .furia-podium__figure::before {   /* the hall's crest behind the number one */
    content: "";
    position: absolute;
    left: 50%;
    top: 46%;
    z-index: 0;
    width: min(86%, 380px);
    aspect-ratio: 513 / 560;
    translate: -50% -50%;
    background: var(--fr-crest) center / contain no-repeat;
    opacity: .26;
    pointer-events: none;
}
.furia-shell.body-page.page-rankings .furia-podium__figure::after {   /* contact shadow on the plinth */
    content: "";
    position: absolute;
    left: 14%;
    right: 14%;
    bottom: 2px;
    z-index: 0;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(0, 0, 0, .6), transparent);
}
.furia-shell.body-page.page-rankings .dmn-content .furia-podium__figure img {
    position: relative;
    z-index: 1;
    display: block;
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 16px 20px rgba(0, 0, 0, .55));
}
.furia-shell.body-page.page-rankings .furia-podium__place[data-class="dk"] .furia-podium__figure img { max-width: 124%; }
/* the real in-game picture is wrapped in <picture> (a still for reduced motion): let the image size itself against the figure box, and never apply the painted-art crop to it */
.furia-shell.body-page.page-rankings .furia-podium__figure picture { display: contents; }
.furia-shell.body-page.page-rankings .dmn-content .furia-podium__figure img.furia-podium__photo { max-width: 100%; }   /* the Dark Knight art is landscape */
.furia-shell.body-page.page-rankings .dmn-content .furia-podium__figure img.furia-podium__badge { width: 112px; height: 112px; margin-bottom: 20px; border: 2px solid var(--medal); border-radius: 50%; object-fit: cover; filter: none; }
.furia-shell.body-page.page-rankings .furia-podium__plinth {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: var(--plinth-h);
    padding: 22px 14px 18px;
    text-align: center;
    background: linear-gradient(180deg, color-mix(in srgb, var(--medal) 12%, transparent), transparent 46%), linear-gradient(180deg, var(--fp-raise), var(--fp-sunk));
    border: 1px solid var(--fp-line);
    border-top-color: var(--medal);
    border-radius: 2px;
    box-shadow: 0 30px 40px -30px rgba(0, 0, 0, .8);
}
.furia-shell.body-page.page-rankings .furia-podium__plinth::before { content: ""; position: absolute; inset: 0 0 auto; height: 14px; background: linear-gradient(180deg, rgba(237, 231, 217, .1), transparent); pointer-events: none; }
.furia-shell.body-page.page-rankings .furia-podium__rank { display: block; margin: 0 0 6px; font-family: var(--fp-display); font-size: var(--num); font-weight: 600; line-height: 1; color: var(--medal); }
.furia-shell.body-page.page-rankings .dmn-content .furia-podium__name { max-width: 100%; margin: 0; font-size: clamp(1.125rem, 1.05rem + .45vw, 1.5rem); font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; color: var(--fp-text); }
.furia-shell.body-page.page-rankings .furia-podium__place[data-rank="1"] .furia-podium__name { font-size: clamp(1.25rem, 1.1rem + .7vw, 1.75rem); }
.furia-shell.body-page.page-rankings .dmn-content .furia-podium__name a { display: inline-block; padding-block: 8px; color: inherit; text-decoration: none; transition: color .2s; }
.furia-shell.body-page.page-rankings .dmn-content .furia-podium__name a:hover { color: var(--fp-cyan); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.furia-shell.body-page.page-rankings .dmn-content .furia-podium__class { margin: 0; font-size: .875rem; line-height: 1.4; color: var(--fp-muted); }
.furia-shell.body-page.page-rankings .furia-podium__plinth .fp-status { margin: 8px 0 0; }
.furia-shell.body-page.page-rankings .furia-podium__stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; width: 100%; margin: auto 0 0; padding: 16px 0 0; }   /* auto margin: the stat rows of the three plinths share one baseline */
.furia-shell.body-page.page-rankings .furia-podium__stats > div { display: flex; flex-direction: column-reverse; align-items: center; min-width: 0; }
.furia-shell.body-page.page-rankings .furia-podium__stats dt { margin: 0; font-size: .8125rem; font-weight: 500; line-height: 1.4; color: var(--fp-muted); }
.furia-shell.body-page.page-rankings .furia-podium__stats dd { margin: 0; font-size: 1.125rem; font-weight: 600; line-height: 1.3; font-variant-numeric: lining-nums tabular-nums; }
.furia-shell.body-page.page-rankings .furia-podium__stats sup { margin-left: 2px; font-size: .6875rem; color: var(--fp-muted) !important; }
.furia-shell.body-page.page-rankings .furia-podium a.furia-player-online::before { margin-right: 7px; }

/* 4. Ledger (places 4+, guilds): furia-pages.css owns the table kit; only what the hall adds ------------- */
.furia-shell.body-page.page-rankings .dmn-content .furia-hall__ledger .fp-rank-table { margin-bottom: 0; }
.furia-shell.body-page.page-rankings .dmn-content .furia-hall__ledger .fp-class-icon, .furia-shell.body-page.page-rankings .dmn-content .furia-hall__ledger .fp-guild-mark { width: 36px; height: 36px; margin-right: 14px; }
.furia-shell.body-page.page-rankings .dmn-content .furia-hall__ledger .fp-guild-mark { padding: 3px; background: var(--fp-sunk); border: 1px solid var(--fp-line); border-radius: 2px; image-rendering: pixelated; }
.furia-shell.body-page.page-rankings .dmn-content .furia-hall--guilds .fp-rank-table tbody tr:nth-child(-n+3) > td:first-child { font-family: var(--fp-display); font-size: 1.375rem; font-weight: 600; color: var(--fp-gold); }
.furia-shell.body-page.page-rankings .dmn-content .furia-hall--guilds .fp-rank-table tbody tr:nth-child(2) > td:first-child { color: var(--fr-silver); }
.furia-shell.body-page.page-rankings .dmn-content .furia-hall--guilds .fp-rank-table tbody tr:nth-child(3) > td:first-child { color: var(--fr-bronze); }
@media (min-width: 1000px) {   /* guild tab: the winged chalice stands beside the ledger, as on the home */
    .furia-shell.body-page.page-rankings .furia-hall--guilds { padding-left: clamp(240px, 24vw, 320px); }
    .furia-shell.body-page.page-rankings .furia-hall--guilds::before { content: ""; position: absolute; left: 0; top: 0; z-index: -1; width: clamp(200px, 20vw, 270px); aspect-ratio: 503 / 560; background: var(--fr-chalice) center / contain no-repeat; filter: drop-shadow(0 22px 26px rgba(0, 0, 0, .55)); pointer-events: none; }
}

/* 5. Loading, empty and error states ------------------------------------------------------------------ */
.furia-shell.body-page.page-rankings .furia-hall__loading { display: none; }
.furia-shell.body-page.page-rankings .fp-rankings-content.is-js > .furia-hall__loading { display: block; }
.furia-shell.body-page.page-rankings .furia-hall__skeleton { display: flex; align-items: flex-end; justify-content: center; gap: clamp(10px, 1.8vw, 26px); height: clamp(190px, 26vw, 300px); }
.furia-shell.body-page.page-rankings .furia-hall__skeleton i { flex: 1 1 0; max-width: 340px; height: 74%; background: var(--fp-sunk); border: 1px solid var(--fp-line); border-radius: 2px; animation: fr-breathe 1.8s ease-in-out infinite; }
.furia-shell.body-page.page-rankings .furia-hall__skeleton i:nth-child(2) { height: 100%; max-width: 400px; animation-delay: .15s; }
.furia-shell.body-page.page-rankings .furia-hall__skeleton i:nth-child(3) { height: 62%; animation-delay: .3s; }
.furia-shell.body-page.page-rankings .furia-hall__loading p { margin: 16px 0 0; text-align: center; font-size: .9375rem; color: var(--fp-muted); }
@keyframes fr-breathe { 50% { opacity: .55; } }

.furia-shell.body-page.page-rankings .furia-hall__state { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: clamp(10px, 2vw, 20px) 0 0; padding: clamp(36px, 6vw, 64px) 20px; text-align: center; color: var(--fp-muted); background: var(--fp-sunk); border: 1px solid var(--fp-line); border-radius: 3px; }
.furia-shell.body-page.page-rankings .furia-hall__state svg { color: var(--fp-muted); }
.furia-shell.body-page.page-rankings .furia-hall__state--error svg { color: var(--fp-bad); }
.furia-shell.body-page.page-rankings .dmn-content .furia-hall__state-title { margin: 0; font-size: 1.125rem; font-weight: 600; line-height: 1.4; color: var(--fp-text); }
.furia-shell.body-page.page-rankings .furia-hall__state-action { margin-top: 4px; }

/* 6. Entrance: the podium rises once when the ranking arrives or is filtered (the hero place last) -------- */
@keyframes fr-rise { from { opacity: 0; transform: translateY(14px); } }
.furia-shell.body-page.page-rankings .furia-podium__place { animation: fr-rise .7s var(--fp-ease) both; animation-delay: calc(var(--d) * 90ms); }

/* 7. Narrow layouts ------------------------------------------------------------------------------------ */
@media (max-width: 760px) {
    .furia-shell.body-page.page-rankings .furia-hall__bar { gap: 10px; }
    .furia-shell.body-page.page-rankings .furia-hall__rail { flex: 1 1 100%; }
    .furia-shell.body-page.page-rankings .furia-hall__rail ul { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(44px, 1fr); flex: 1 1 100%; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
    .furia-shell.body-page.page-rankings .furia-hall__rail ul::-webkit-scrollbar { display: none; }
    .furia-shell.body-page.page-rankings .furia-hall__now { display: block; flex: 1 1 100%; }
    .furia-shell.body-page.page-rankings .furia-hall__search { flex: 1 1 100%; max-width: none; }
    .furia-shell.body-page.page-rankings .furia-podium { flex-wrap: wrap; align-items: stretch; gap: 26px 10px; padding-top: 10px; }
    .furia-shell.body-page.page-rankings .furia-podium__place { flex: 1 1 calc(50% - 5px); max-width: none; --fig-h: 230px; --plinth-h: 0px; --num: 40px; }
    .furia-shell.body-page.page-rankings .furia-podium__place[data-rank="1"] { flex: 1 1 100%; --fig-h: 320px; --num: 50px; order: 1; }
    .furia-shell.body-page.page-rankings .furia-podium__place[data-rank="2"] { order: 2; }
    .furia-shell.body-page.page-rankings .furia-podium__place[data-rank="3"] { order: 3; --fig-h: 230px; }
    .furia-shell.body-page.page-rankings .furia-podium__place[data-class="dk"] .furia-podium__figure img { max-width: 100%; }
    .furia-shell.body-page.page-rankings .furia-podium__plinth { padding: 18px 10px 16px; }
    .furia-shell.body-page.page-rankings .furia-podium__stats { gap: 6px 14px; }
    .furia-shell.body-page.page-rankings .furia-podium__stats dd { font-size: 1rem; }
    .furia-shell.body-page.page-rankings .furia-hall__skeleton i:nth-child(n+2) { display: none; }
    .furia-shell.body-page.page-rankings .furia-hall__skeleton i { max-width: none; height: 100%; }
}
@media (max-width: 640px) {   /* ledger on phones: class column is hidden by furia-pages, so keep # / name / numbers inside 358 px */
    .furia-shell.body-page.page-rankings .dmn-content .furia-hall__ledger > .fp-rank-table { min-width: 0; }   /* furia-pages gives .table-responsive-sm > .table 560 px */
    .furia-shell.body-page.page-rankings .dmn-content .furia-hall__ledger .fp-rank-table :is(th, td) { padding: 10px 6px !important; }
    .furia-shell.body-page.page-rankings .dmn-content .furia-hall__ledger .fp-rank-table .fp-name { white-space: normal; overflow-wrap: anywhere; }
    .furia-shell.body-page.page-rankings .dmn-content .furia-hall__ledger .fp-class-icon, .furia-shell.body-page.page-rankings .dmn-content .furia-hall__ledger .fp-guild-mark { width: 28px; height: 28px; margin-right: 8px; }
    .furia-shell.body-page.page-rankings .furia-hall__ledger .fp-th-note { display: none; }
}
@media (hover: none) {
    .furia-shell.body-page.page-rankings .furia-hall__rail a::after { display: none; }
    .furia-shell.body-page.page-rankings .furia-hall__now { display: block; }
}

/* 8. Motion off ------------------------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .furia-shell.body-page.page-rankings .furia-podium__place, .furia-shell.body-page.page-rankings .furia-hall__skeleton i { animation: none; }
    .furia-shell.body-page.page-rankings .furia-hall__rail a::after { transition: none; }
}

/* painted icons on the ranking tabs (rankings/view.index.php prints <img class="fp-tab__ico"> before the label; the tab ids and the click plumbing are the CMS's) */
.furia-shell.body-page.page-rankings .dmn-content .fp-tab { display: inline-flex; align-items: center; gap: 8px; }
.furia-shell.body-page.page-rankings .fp-tab__ico { display: block; flex: none; width: 28px; height: 28px; object-fit: contain; opacity: .78; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); transition: opacity .2s, transform .3s var(--fp-ease); }
.furia-shell.body-page.page-rankings .dmn-content .fp-tab:hover .fp-tab__ico,
.furia-shell.body-page.page-rankings .dmn-content .fp-tab.is-active .fp-tab__ico { opacity: 1; }
.furia-shell.body-page.page-rankings .dmn-content .fp-tab.is-active .fp-tab__ico { transform: scale(1.08); }
@media (prefers-reduced-motion: reduce) { .furia-shell.body-page.page-rankings .fp-tab__ico { transition: none; transform: none !important; } }
