/* Furia MU - Character sheet and guild page (W3). Owner: frontend-engineer. Loaded by view.header.php after furia-pages.css for the
   `info` controller (info/character, info/guild); everything is scoped to .furia-shell.body-page.page-info.
   Character sheet: class art (generated/class-*.webp) with the real equipment slots around it on one Dark Steel stage, facts as <dl>.
   Equipment hooks that must stay (tooltip script + legacy CSS): #inventoryc, div#in_weapon ... #in_ear2 with data-info, #inventory (MU < 4).
   Every <div> inside #inventoryc / #inventory gets a tooltip bound by App.initializeTooltip, so the empty-slot frames are <span>s. */

/* 1. Local tokens and the lede under the title --------------------------------------------------------- */
.furia-shell.body-page.page-info {
    --fi-silver: #bcc5c9;      /* same medal tone as the home / rankings */
    --fi-bronze: #c48a5a;
}
.furia-shell.body-page.page-info .fc-lede { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.furia-shell.body-page.page-info .fc-lede__sep { color: var(--fp-gold); }

/* 2. The sheet: stage (portrait + gear) on the left, facts on the right -------------------------------- */
.furia-shell.body-page.page-info .fc-sheet { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 4vw, 52px); align-items: start; }
@media (min-width: 960px) {
    .furia-shell.body-page.page-info .fc-sheet { grid-template-columns: minmax(0, 540px) minmax(0, 1fr); }
}
.furia-shell.body-page.page-info .fc-stage {
    position: relative;
    padding: clamp(16px, 3vw, 30px);
    background:
        radial-gradient(46% 34% at 50% 34%, color-mix(in srgb, var(--fp-cyan) 11%, transparent), transparent 74%),
        linear-gradient(180deg, var(--fp-raise), var(--fp-sunk));
    border: 1px solid var(--fp-line);
    border-radius: 3px;
}
.furia-shell.body-page.page-info .fc-stage .alert { margin: 18px 0 0; }
@media (min-width: 960px) {
    .furia-shell.body-page.page-info .fc-stage { position: sticky; top: 100px; }   /* stays in view while the facts scroll past */
}

/* portrait: the cut-out stands on the stage floor */
.furia-shell.body-page.page-info .fc-portrait { position: relative; z-index: 0; display: flex; align-items: flex-end; justify-content: center; min-width: 0; }
.furia-shell.body-page.page-info .fc-portrait::after {   /* contact shadow */
    content: "";
    position: absolute;
    left: 12%;
    right: 12%;
    bottom: -2px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(0, 0, 0, .6), transparent);
    pointer-events: none;
}
.furia-shell.body-page.page-info .fc-portrait 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)); }
/* the Dark Knight art is landscape: inside the doll the cape and blade may bleed behind the slot frames; alone it simply fits */
.furia-shell.body-page.page-info #inventoryc .fc-portrait[data-class="dk"] img { width: 150%; max-width: none; height: auto; max-height: none; margin-bottom: 6%; }
.furia-shell.body-page.page-info .fc-portrait--solo[data-class="dk"] img { width: 100%; height: auto; max-height: 100%; }
.furia-shell.body-page.page-info .fc-portrait--solo { height: clamp(300px, 42vw, 440px); }

/* 3. Equipment: #inventoryc becomes a grid, the legacy absolute positions are reset ------------------------ */
.furia-shell.body-page.page-info #inventoryc {
    --cell: 84px;
    --gap: 10px;
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: var(--cell) repeat(3, minmax(0, 1fr)) var(--cell);
    grid-template-rows: repeat(5, var(--cell)) calc(var(--cell) * 1.6);
    grid-template-areas:
        "helm   portrait portrait   portrait wings"
        "armor  portrait portrait   portrait pendant"
        "gloves portrait portrait   portrait ring1"
        "pants  portrait portrait   portrait ring2"
        "boots  portrait portrait   portrait zoo"
        "weapon ear1     pentagram  ear2     shield";
    gap: var(--gap);
    width: 100%;
    max-width: 520px;
    height: auto;
    margin: 0 auto;
    background: none;
    text-align: left;
}
.furia-shell.body-page.page-info #inventoryc .fc-portrait { grid-area: portrait; }
.furia-shell.body-page.page-info #inventoryc [data-slot="weapon"] { grid-area: weapon; }
.furia-shell.body-page.page-info #inventoryc [data-slot="shield"] { grid-area: shield; }
.furia-shell.body-page.page-info #inventoryc [data-slot="helm"] { grid-area: helm; }
.furia-shell.body-page.page-info #inventoryc [data-slot="armor"] { grid-area: armor; }
.furia-shell.body-page.page-info #inventoryc [data-slot="pants"] { grid-area: pants; }
.furia-shell.body-page.page-info #inventoryc [data-slot="gloves"] { grid-area: gloves; }
.furia-shell.body-page.page-info #inventoryc [data-slot="boots"] { grid-area: boots; }
.furia-shell.body-page.page-info #inventoryc [data-slot="wings"] { grid-area: wings; }
.furia-shell.body-page.page-info #inventoryc [data-slot="zoo"] { grid-area: zoo; }
.furia-shell.body-page.page-info #inventoryc [data-slot="pendant"] { grid-area: pendant; }
.furia-shell.body-page.page-info #inventoryc [data-slot="ring1"] { grid-area: ring1; }
.furia-shell.body-page.page-info #inventoryc [data-slot="ring2"] { grid-area: ring2; }
.furia-shell.body-page.page-info #inventoryc [data-slot="pentagram"] { grid-area: pentagram; }
.furia-shell.body-page.page-info #inventoryc [data-slot="ear1"] { grid-area: ear1; }
.furia-shell.body-page.page-info #inventoryc [data-slot="ear2"] { grid-area: ear2; }
.furia-shell.body-page.page-info #inventoryc :is([data-slot="pentagram"], [data-slot="ear1"], [data-slot="ear2"]) { align-self: start; justify-self: center; width: var(--cell); height: var(--cell); }

/* the frame is a <span> under each slot; the item <div> (inline background image from the CMS) sits on top of it */
.furia-shell.body-page.page-info #inventoryc .fc-slot { position: relative; z-index: 1; display: block; background: var(--fp-sunk); border: 1px solid var(--fp-line); border-radius: 2px; }
.furia-shell.body-page.page-info #inventoryc .fc-slot.is-filled { background: linear-gradient(180deg, var(--fp-raise), var(--fp-sunk)); border-color: var(--fp-line-2); }
.furia-shell.body-page.page-info #inventoryc div[data-slot] {
    position: relative;
    z-index: 1;
    inset: auto;
    width: auto;
    height: auto;
    box-sizing: border-box;
    border: 9px solid transparent;   /* insets the item art inside the frame (the inline background-origin is the padding box) */
    border-radius: 2px;
    cursor: help;
    transition: box-shadow .15s;
}
.furia-shell.body-page.page-info #inventoryc div[data-slot]:hover { box-shadow: 0 0 0 1px var(--fp-cyan); }
.furia-shell.body-page.page-info #inventoryc div[data-slot="weapon"], .furia-shell.body-page.page-info #inventoryc div[data-slot="shield"] { border-width: 9px 14px; }
.furia-shell.body-page.page-info #inventoryc .fc-lvl { position: absolute; right: -8px; bottom: -8px; z-index: 2; padding: 1px 5px; font: 600 .75rem/1.3 var(--fp-body); color: var(--fp-text); background: var(--fp-bg); border: 1px solid var(--fp-line-2); border-radius: 2px; pointer-events: none; }
.furia-shell.body-page.page-info .fc-legacy { max-width: 100%; overflow-x: auto; text-align: center; }

/* 4. Facts ------------------------------------------------------------------------------------------------ */
.furia-shell.body-page.page-info .fc-info { min-width: 0; }
.furia-shell.body-page.page-info .fc-stats { margin-bottom: clamp(24px, 3vw, 36px); }
.furia-shell.body-page.page-info .dmn-content .fc-info__title { margin: 0; padding: 0 0 12px; font-size: 1.125rem; font-weight: 600; line-height: 1.3; border-bottom: 1px solid var(--fp-line-2); }
.furia-shell.body-page.page-info .fc-facts { margin: 0 0 clamp(26px, 3vw, 38px); padding: 0; }
.furia-shell.body-page.page-info .fc-facts > div { display: grid; grid-template-columns: minmax(104px, 36%) minmax(0, 1fr); align-items: center; gap: 4px 16px; min-height: 52px; padding: 8px 0; border-bottom: 1px solid var(--fp-line); }
.furia-shell.body-page.page-info .fc-facts dt { margin: 0; font-size: .9375rem; font-weight: 500; color: var(--fp-muted); }
.furia-shell.body-page.page-info .fc-facts dd { margin: 0; min-width: 0; font-size: .9375rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.furia-shell.body-page.page-info .fc-facts a { color: var(--fp-text); text-decoration: underline; text-decoration-color: var(--fp-line-2); text-underline-offset: 4px; }
.furia-shell.body-page.page-info .fc-facts a:hover { color: var(--fp-cyan); text-decoration-color: currentColor; }
.furia-shell.body-page.page-info .fc-chars { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0; padding: 0; list-style: none; }
.furia-shell.body-page.page-info .fc-chars li { margin: 0; }
.furia-shell.body-page.page-info .fc-mark { display: inline-block; width: 40px; height: 40px; margin: 0 12px 0 0; padding: 3px; vertical-align: middle; background: var(--fp-sunk); border: 1px solid var(--fp-line); border-radius: 2px; image-rendering: pixelated; }

/* 5. Guild page: mark plate + stat strip, then the members ledger ---------------------------------------------- */
.furia-shell.body-page.page-info .fg-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; margin: 0 0 clamp(30px, 4vw, 48px); }
@media (min-width: 760px) {
    .furia-shell.body-page.page-info .fg-head { grid-template-columns: 168px minmax(0, 1fr); gap: clamp(28px, 4vw, 52px); }
}
.furia-shell.body-page.page-info .fg-mark {
    display: grid;
    place-items: center;
    width: 168px;
    aspect-ratio: 1;
    max-width: 100%;
    background: radial-gradient(60% 60% at 50% 40%, color-mix(in srgb, var(--fp-cyan) 11%, transparent), transparent 75%), linear-gradient(180deg, var(--fp-raise), var(--fp-sunk));
    border: 1px solid var(--fp-line);
    border-radius: 3px;
}
.furia-shell.body-page.page-info .fg-mark img { display: block; width: 112px; height: 112px; image-rendering: pixelated; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .5)); }
.furia-shell.body-page.page-info .fg-head__facts { min-width: 0; }
.furia-shell.body-page.page-info .fg-stats { margin-bottom: 8px; }
.furia-shell.body-page.page-info .fg-facts { margin-bottom: 0; }
.furia-shell.body-page.page-info .fg-ledger { margin: 0; }
.furia-shell.body-page.page-info .dmn-content .fg-ledger .fp-rank-table { margin-bottom: 0; }
.furia-shell.body-page.page-info .fg-sub { display: none; }
.furia-shell.body-page.page-info .fg-state { display: flex; flex-direction: column; align-items: center; gap: 12px; 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-info .fg-state p { margin: 0; font-size: 1.125rem; font-weight: 600; color: var(--fp-text); }

/* 6. Narrow layouts ----------------------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .furia-shell.body-page.page-info .fg-mark { width: 120px; }
    .furia-shell.body-page.page-info .fg-mark img { width: 84px; height: 84px; }
    .furia-shell.body-page.page-info .dmn-content .fg-ledger .fp-status { gap: 0; font-size: 0; }   /* the dot carries the state on phones; the word stays in the DOM */
    .furia-shell.body-page.page-info .dmn-content .fg-ledger .fp-status::before { width: 10px; height: 10px; }
    .furia-shell.body-page.page-info .dmn-content .fg-ledger > .fp-rank-table { min-width: 0; }   /* furia-pages gives .table-responsive-sm > .table 560 px */
    .furia-shell.body-page.page-info .dmn-content .fg-ledger .fp-rank-table :is(th, td) { padding: 10px 6px !important; }
    .furia-shell.body-page.page-info #inventoryc { --cell: 58px; --gap: 7px; }
    .furia-shell.body-page.page-info .fc-stage { padding: 14px 10px; }
    .furia-shell.body-page.page-info #inventoryc div[data-slot] { border-width: 6px; }
    .furia-shell.body-page.page-info #inventoryc div[data-slot="weapon"], .furia-shell.body-page.page-info #inventoryc div[data-slot="shield"] { border-width: 6px 8px; }
    .furia-shell.body-page.page-info #inventoryc .fc-lvl { right: -6px; bottom: -6px; font-size: .6875rem; }
    .furia-shell.body-page.page-info .fc-facts > div { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 899px) {   /* members ledger: class and position move under the name so # / name / numbers / status fit */
    .furia-shell.body-page.page-info .dmn-content .fg-ledger .fp-hide-sm { display: none; }
    .furia-shell.body-page.page-info .fg-sub { display: block; font-size: .8125rem; line-height: 1.4; color: var(--fp-muted); }
    .furia-shell.body-page.page-info .dmn-content .fg-ledger .fp-rank-table .fp-name { white-space: normal; overflow-wrap: anywhere; }
}
@media (max-width: 1023px) {   /* 44 px touch targets for the links inside the facts */
    .furia-shell.body-page.page-info .fc-facts a { display: inline-flex; align-items: center; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    .furia-shell.body-page.page-info #inventoryc div[data-slot] { transition: none; }
}
