/* Member profiles (#/profile): the Service Record, Collector's Card and Medal Cabinet.
   Built on app.css's tokens (navy, gold, cream; Caslon Display headings over Inter). A
   member's accent colour is a class on the page (pf-accent-*) that sets --pf-accent. */

.pf-accent-gold { --pf-accent: #c9a84c; --pf-accent-bright: #e0c36a; --pf-accent-ink: #0b1629; }
.pf-accent-red { --pf-accent: #e01515; --pf-accent-bright: #ff6a5e; --pf-accent-ink: #ffffff; }
.pf-accent-naval { --pf-accent: #3d74c9; --pf-accent-bright: #8ab4f8; --pf-accent-ink: #ffffff; }
.pf-accent-rifle { --pf-accent: #2f7d52; --pf-accent-bright: #7fcb9d; --pf-accent-ink: #ffffff; }
.pf-accent-silver { --pf-accent: #9aa6b4; --pf-accent-bright: #dfe6ee; --pf-accent-ink: #0b1629; }

@property --pf-fa { syntax: "<angle>"; inherits: true; initial-value: 0deg; }

.pf-page h1, .pf-page h2, .pf-page h3 { font-family: var(--serif); font-weight: 400; color: var(--white); text-wrap: balance; margin: 0; letter-spacing: 0; }
.pf-page .btn.primary { background: var(--pf-accent); border-color: var(--pf-accent); color: var(--pf-accent-ink); }
.pf-page .btn.primary:hover { filter: brightness(1.08); }
.pf-page .link-btn { color: var(--pf-accent-bright); }
.pf-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--pf-accent-bright); margin: 0; }
.pf-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.pf-sec-head h2, .pf-sec-head h3, .pf-page .panel > h3 { font-size: 21px; }
.pf-page .panel .hint { margin-top: 4px; }

/* ---------- top bar: crumbs, the three views, find a member, customise ---------- */
.pf-topbar { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; margin-bottom: 18px; }
.pf-crumbs { display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); flex: 1 1 220px; min-width: 0; }
.pf-crumbs a { color: var(--gold); text-decoration: none; }
.pf-crumbs span:last-child { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-views { display: flex; gap: 4px; padding: 4px; background: var(--navy-800); border: 1px solid var(--line); border-radius: 999px; }
.pf-views button {
    display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 500;
    padding: 7px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.pf-views button svg { width: 16px; height: 16px; }
.pf-views button:hover { color: var(--white); }
.pf-views button.current { background: var(--navy-600); color: var(--white); box-shadow: inset 0 0 0 1px var(--line-strong); }
.pf-views button.current svg { color: var(--pf-accent-bright); }
.pf-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pf-find { position: relative; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 12px; background: var(--navy-800); }
.pf-find svg { width: 16px; height: 16px; color: var(--faint); }
.pf-find input { background: none; border: 0; outline: 0; width: 170px; font-size: 14px; color: var(--cream); }
.pf-find-list {
    position: absolute; top: calc(100% + 6px); right: 0; width: 280px; z-index: 35; padding: 6px; max-height: 360px; overflow-y: auto;
    background: var(--navy-700); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow);
}
.pf-find-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--radius-sm); color: var(--cream); text-decoration: none; font-size: 14px; }
.pf-find-item:hover, .pf-find-item:focus-visible { background: rgba(201, 168, 76, 0.12); color: var(--white); }
.pf-find-item img { width: 30px; height: 30px; border-radius: 50%; }
.pf-find-item small { display: block; color: var(--faint); font-size: 12px; }
.pf-find-empty { margin: 6px 8px; color: var(--faint); font-size: 13px; }

/* ---------- medal art (Discord app emoji images; the shine is masked to the medal) ---------- */
.pf-medal { position: relative; display: block; width: var(--size, 56px); height: var(--size, 56px); flex: none; }
.pf-medal img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45)); }
.pf-medal-blank { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--navy-700); color: var(--gold); }
.pf-medal-blank svg { width: 50%; height: 50%; }
.pf-medal.shine::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat;
    background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.6) 50%, transparent 62%) 160% 0 / 300% 100% no-repeat;
    animation: pf-shine 6s ease-in-out infinite; animation-delay: var(--d, 0s);
}
@keyframes pf-shine { 0%, 72% { background-position: 160% 0; } 100% { background-position: -60% 0; } }
.pf-medal.dark img { filter: grayscale(1) brightness(0.32) contrast(1.15); opacity: 0.75; }
.pf-medal.goal img { filter: grayscale(0.85) brightness(0.7); }
.pf-medal-btn { background: none; border: 0; padding: 4px; border-radius: 8px; cursor: pointer; transition: transform 0.2s ease, background 0.2s ease; }
.pf-medal-btn:hover { transform: translateY(-3px) scale(1.06); background: rgba(255, 255, 255, 0.05); }

.pf-bar { display: block; height: 6px; border-radius: 999px; background: rgba(232, 224, 208, 0.08); margin-top: 6px; overflow: hidden; }
.pf-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--pf-accent), var(--pf-accent-bright)); }
.pf-pill { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; border-radius: 999px; padding: 2px 8px; margin-top: 8px; }
.pf-pill.top { background: rgba(224, 195, 106, 0.16); color: var(--gold-bright); box-shadow: inset 0 0 0 1px rgba(224, 195, 106, 0.35); }
.pf-pill.ok { background: rgba(127, 174, 120, 0.15); color: #a6d39e; box-shadow: inset 0 0 0 1px rgba(127, 174, 120, 0.35); }

/* ---------- Service Record: hero ---------- */
.pf-hero { position: relative; border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; background: var(--navy-800); }
.pf-banner { position: relative; height: 230px; overflow: hidden; background: var(--navy-950); }
.pf-hero > .pf-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15, 29, 51, 0) 35%, rgba(15, 29, 51, 0.7) 75%, var(--navy-800)); }
.pf-banner .b-blur { position: absolute; inset: -30px; width: calc(100% + 60px); height: calc(100% + 60px); object-fit: cover; filter: blur(18px) saturate(1.1) brightness(0.7); max-width: none; }
.pf-banner .b-main {
    position: absolute; left: 50%; top: 0; height: 100%; width: auto; max-width: none; transform: translateX(-50%);
    -webkit-mask: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}
.pf-banner.small { height: 100%; }
.pf-banner.small .b-main { -webkit-mask: none; mask: none; }
.pf-banner-crest { background: radial-gradient(ellipse at 50% 130%, rgba(201, 168, 76, 0.3), transparent 60%), var(--navy-900); }
.pf-banner-crest::before { content: ""; position: absolute; inset: 0; background: url(/static/crest.png) 0 0 / 74px repeat; opacity: 0.08; transform: rotate(-8deg) scale(1.3); }
.pf-banner-sea {
    background:
        radial-gradient(circle at 78% 30%, rgba(245, 242, 237, 0.9) 0 16px, rgba(245, 242, 237, 0.12) 17px 60px, transparent 61px),
        repeating-linear-gradient(176deg, transparent 0 14px, rgba(138, 180, 248, 0.07) 14px 16px),
        linear-gradient(180deg, #071226 0%, #0d2546 52%, #0a1d38 53%, #061224 100%);
}
.pf-banner-scarlet { background: repeating-linear-gradient(115deg, transparent 0 26px, rgba(224, 195, 106, 0.2) 26px 28px), linear-gradient(135deg, #6e0b0b, #c41212 48%, #7a0e0e); }
.pf-hero-main { position: relative; z-index: 1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 26px; align-items: end; padding: 0 30px; margin-top: -92px; }
.pf-avatar { position: relative; width: 150px; height: 150px; border-radius: 50%; padding: 4px; background: linear-gradient(145deg, var(--gold-bright), var(--gold) 45%, #6f5a22); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); }
.pf-avatar > img:first-child, .pf-avatar-blank { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; border: 4px solid var(--navy-800); }
.pf-avatar-blank { display: grid; place-items: center; background: var(--navy-700); color: var(--gold); }
.pf-avatar-blank svg { width: 50%; height: 50%; }
.pf-insignia { position: absolute; right: -4px; bottom: 4px; width: 48px; height: 48px; border-radius: 10px; background: var(--navy-900); border: 1px solid var(--line-strong); padding: 4px; object-fit: contain; }
.pf-identity { min-width: 0; padding-bottom: 4px; }
.pf-identity h1 { font-size: 54px; line-height: 1.02; margin: 6px 0 4px; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5); overflow-wrap: anywhere; }
.pf-title-line { margin: 0; font-family: var(--serif); font-size: 22px; color: var(--pf-accent-bright); }
.pf-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 14px 0 0; }
.pf-chips li { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--cream); background: rgba(8, 17, 34, 0.55); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px 4px 8px; }
.pf-chips li img { width: 20px; height: 20px; }
.pf-chips li svg { width: 16px; height: 16px; color: var(--pf-accent-bright); }
.pf-status-dot { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; border: 4px solid var(--navy-800); background: #80848e; }
.pf-presence { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 14px 0 0; font-size: 13px; color: var(--cream); }
.pf-presence-dot { width: 10px; height: 10px; border-radius: 50%; background: #80848e; flex: none; }
.pf-presence-game { color: var(--faint); }
.pf-presence-game::before { content: "·"; margin-right: 7px; }
.pf-status-dot.online, .pf-presence.online .pf-presence-dot { background: #23a55a; }
.pf-status-dot.idle, .pf-presence.idle .pf-presence-dot { background: #f0b232; }
.pf-status-dot.dnd, .pf-presence.dnd .pf-presence-dot { background: #f23f43; }
.pf-presence.offline { color: var(--faint); }
.pf-views-line { display: flex; align-items: center; gap: 7px; margin: 12px 0 0; font-size: 13px; color: var(--faint); }
.pf-views-line svg { width: 16px; height: 16px; flex: none; }
.pf-clock { text-align: right; padding: 14px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(8, 17, 34, 0.6); min-width: 230px; }
.pf-clock .k { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.pf-clock .v { display: block; font-family: var(--serif); font-weight: 400; font-size: 28px; color: var(--white); line-height: 1.15; margin-top: 2px; }
.pf-clock .tick { display: block; font-variant-numeric: tabular-nums; color: var(--pf-accent-bright); font-size: 14px; font-weight: 600; margin-top: 2px; min-height: 21px; }
.pf-clock .s { display: block; font-size: 12px; color: var(--faint); }
.pf-hero-foot { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; padding: 22px 30px 26px; }
.pf-motto { margin: 0; font-family: var(--serif); font-size: 24px; color: var(--white); line-height: 1.25; overflow-wrap: anywhere; }
.pf-motto::before { content: "\201C"; color: var(--pf-accent-bright); margin-right: 2px; }
.pf-motto::after { content: "\201D"; color: var(--pf-accent-bright); margin-left: 2px; }
.pf-bio { margin: 8px 0 0; color: var(--muted); max-width: 62ch; white-space: pre-line; overflow-wrap: anywhere; }
.pf-bio.muted { color: var(--faint); font-style: italic; }
.pf-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 0; align-content: start; }
.pf-facts div { border-left: 2px solid var(--line-strong); padding-left: 10px; min-width: 0; }
.pf-facts dt { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.pf-facts dd { margin: 0; color: var(--white); font-size: 14px; overflow-wrap: anywhere; }

/* ---------- showcase and tiles ---------- */
.pf-showcase {
    margin-top: 18px; border-radius: 14px; border: 1px solid var(--line-strong); padding: 18px 22px 20px;
    background: radial-gradient(ellipse at 50% 0%, rgba(201, 168, 76, 0.16), transparent 60%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 5px), linear-gradient(180deg, #3a0f14, #22080c);
}
/* A wrapping row, centred, so a short last row (2 of 3 on a phone) sits in the middle. */
.pf-pins { --cols: 5; --gap-x: 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px var(--gap-x); }
.pf-pins > .pf-pin { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap-x)) / var(--cols)); min-width: 0; }
.pf-pin {
    display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 12px 6px 10px; cursor: pointer;
    background: none; border: 1px solid transparent; border-radius: var(--radius); transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease; color: inherit;
}
.pf-pin:hover { transform: translateY(-4px); background: rgba(255, 255, 255, 0.04); border-color: rgba(224, 195, 106, 0.3); }
.pf-pin .pf-medal { --size: 92px; }
.pf-pin-name { font-family: var(--serif); font-size: 17px; color: var(--white); line-height: 1.15; }
.pf-pin-cat { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(232, 224, 208, 0.62); }
.pf-pin.empty { border: 1px dashed rgba(224, 195, 106, 0.35); color: var(--faint); font-size: 13px; justify-content: center; min-height: 150px; }
.pf-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.pf-tile { padding: 16px 16px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--navy-800); min-width: 0; }
.pf-tile .k { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); display: flex; align-items: center; gap: 6px; }
.pf-tile .k svg { width: 16px; height: 16px; color: var(--pf-accent-bright); }
.pf-tile .v { font-size: 30px; font-weight: 600; color: var(--white); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; margin-top: 4px; line-height: 1.1; overflow-wrap: anywhere; }
.pf-tile .v.small { font-size: 22px; }
.pf-tile .v small { font-size: 16px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.pf-tile .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.pf-tile .pf-private { color: var(--faint); margin-top: 12px; }

/* ---------- tabs ---------- */
.pf-tabs { margin-top: 22px; }
.pf-tablist { display: flex; gap: 4px; border-bottom: 1px solid var(--line-strong); overflow-x: auto; scrollbar-width: none; }
.pf-tablist button { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 10px 16px; color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.pf-tablist button:hover { color: var(--white); }
.pf-tablist button[aria-selected="true"] { color: var(--white); border-bottom-color: var(--pf-accent-bright); }
.pf-tablist .count { font-size: 12px; color: var(--faint); margin-left: 5px; }
.pf-tab-panel { padding-top: 20px; }
.pf-ov-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr); gap: 16px; }
.pf-side-stack { display: grid; gap: 16px; align-content: start; }
.pf-next { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 14px; }
.pf-next li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.pf-next .pf-medal-btn { padding: 0; }
.pf-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(201, 168, 76, 0.1); color: var(--pf-accent-bright); border: 1px solid var(--line); margin-left: 4px; }
.pf-ico svg { width: 20px; height: 20px; }
.pf-next strong { display: block; color: var(--white); font-weight: 600; font-size: 14px; }
.pf-next .what { display: block; color: var(--faint); font-size: 12.5px; }
.pf-next .left { text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; }
.pf-next .left b { display: block; color: var(--white); font-size: 15px; }
.pf-trophy-box { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: center; }
.pf-trophy { position: relative; border-radius: 12px; transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.15s ease-out; }
.pf-trophy img { display: block; width: 100%; border-radius: 12px; box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45); }
.pf-trophy .glare { position: absolute; inset: 0; border-radius: 12px; pointer-events: none; background: radial-gradient(circle at var(--mx, 30%) var(--my, 20%), rgba(255, 255, 255, 0.35), transparent 50%); mix-blend-mode: soft-light; }
.pf-trophy-box p { margin: 0; color: var(--muted); font-size: 13.5px; }
.pf-trophy-box p strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 20px; color: var(--white); margin-bottom: 4px; }
.pf-relic { display: block; color: var(--gold-bright); margin-top: 4px; }
.pf-plain-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; aspect-ratio: 720 / 985; padding: 12px; border-radius: 12px; text-align: center; background: #f3ecdc; border: 6px solid var(--rc, #7d7d7d); color: #2b2a26; }
.pf-plain-card .r { font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--rc, #7d7d7d); }
.pf-plain-card .e { font-size: 40px; }
.pf-plain-card .n { font-family: var(--serif); font-size: 15px; line-height: 1.15; }
.pf-plain-card.r-uncommon { --rc: #3f8f43; } .pf-plain-card.r-rare { --rc: #3061c2; } .pf-plain-card.r-epic { --rc: #8b3fc9; } .pf-plain-card.r-legendary { --rc: #b9820f; }
.pf-mini-record { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; }
.pf-mini-record li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; font-size: 13.5px; }
.pf-mini-record time { color: var(--faint); font-variant-numeric: tabular-nums; }

.pf-rack { display: grid; gap: 14px; }
.pf-rack-cat { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--navy-800); }
.pf-rack-cat h3 { font-size: 18px; }
.pf-rack-cat .meta { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.pf-rack-cat .meta .pf-pill { margin: 0; }
.pf-rack-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-rack-row .pf-medal { --size: 50px; }
.pf-rack-foot { display: flex; justify-content: center; margin-top: 18px; }
.pf-despatches { margin-top: 18px; }
.pf-despatches ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pf-despatches li { display: grid; gap: 4px; }
.pf-despatches .meta { color: var(--muted); font-size: 0.85em; }
.pf-despatches blockquote { margin: 0; font-family: var(--serif); font-style: italic; overflow-wrap: anywhere; }

.pf-ach-summary { display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.pf-ach-summary b { color: var(--white); }
.pf-ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pf-ach { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 14px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--navy-800); align-items: center; }
.pf-ach.locked { opacity: 0.62; }
.pf-hex { width: 54px; height: 60px; display: grid; place-items: center; color: #10203a; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: linear-gradient(160deg, var(--t1), var(--t2)); }
.pf-hex svg { width: 24px; height: 24px; stroke-width: 2; }
.pf-hex.t0 { --t1: #3a4356; --t2: #252d3d; color: var(--faint); }
.pf-hex.t1 { --t1: #e0a56a; --t2: #8a5426; }
.pf-hex.t2 { --t1: #eef2f6; --t2: #8d98a6; }
.pf-hex.t3 { --t1: #ffe18a; --t2: #b0841f; }
.pf-hex.t4 { --t1: #e9fbff; --t2: #7fb8cc; }
.pf-hex.t5 { --t1: #d9ecff; --t2: #4f7fe0; }
.pf-hex.t6 { --t1: #ff8b7e; --t2: #a3111b; color: #ffe7a3; }
.pf-ach h4 { margin: 0; font-size: 15px; font-weight: 600; color: var(--white); display: flex; justify-content: space-between; gap: 8px; }
.pf-ach h4 .tier { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.pf-ach p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.pf-ach .to-next { font-size: 12px; color: var(--faint); margin-top: 4px; }
.pf-subhead { font-size: 19px; margin: 26px 0 12px !important; }

.pf-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.pf-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.pf-two.wide-left { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.pf-chart-box { position: relative; }
.pf-chart { width: 100%; height: auto; display: block; margin-top: 8px; }
.pf-chart .grid { stroke: rgba(232, 224, 208, 0.08); stroke-width: 1; }
.pf-chart .grid.base { stroke: rgba(232, 224, 208, 0.25); }
.pf-chart .axis { fill: var(--faint); font-size: 12px; font-family: var(--sans); }
.pf-chart .label { fill: var(--white); font-size: 13px; font-weight: 600; font-family: var(--sans); }
.pf-chart .bar path { fill: var(--pf-accent); transition: fill 0.15s ease; }
.pf-chart .bar.peak path { fill: var(--pf-accent-bright); }
.pf-chart .bar:hover path { fill: var(--white); }
.pf-chart .hit { fill: transparent; }
.pf-ladder-panel { margin-top: 16px; }
.pf-ladder { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 20px; }
.pf-ladder li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.pf-ladder strong { color: var(--white); font-size: 14px; font-weight: 600; display: block; }
.pf-ladder span { color: var(--faint); font-size: 12.5px; }
.pf-ladder .state { font-size: 12px; font-weight: 600; color: var(--muted); }
.pf-ladder .state.done { color: #a6d39e; }

.pf-private-note { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 14px; padding: 16px 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.pf-private-note svg, .pf-money-note svg { width: 16px; height: 16px; }
.pf-money-note { display: flex; align-items: center; gap: 6px; }
.pf-rarity { display: flex; gap: 2px; height: 22px; margin-top: 14px; border-radius: 6px; overflow: hidden; }
.pf-rarity span { display: block; height: 100%; min-width: 3px; }
.pf-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; padding: 0; margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.pf-legend li { display: inline-flex; align-items: center; gap: 6px; }
.pf-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.pf-legend b { color: var(--white); font-weight: 600; font-variant-numeric: tabular-nums; }
.pf-ring-row { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.pf-ring { position: relative; width: 96px; height: 96px; flex: none; }
.pf-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pf-ring .track { stroke: rgba(232, 224, 208, 0.1); }
.pf-ring .fill { stroke: var(--pf-accent-bright); stroke-linecap: round; }
.pf-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; color: var(--white); font-variant-numeric: tabular-nums; }
.pf-prints { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.pf-prints b { color: var(--gold-bright); }
.pf-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 18px; }
.pf-table th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); }
.pf-table td { padding: 8px 8px 8px 0; border-bottom: 1px solid rgba(201, 168, 76, 0.08); color: var(--cream); vertical-align: top; }
.pf-table .r { text-align: right; font-variant-numeric: tabular-nums; }
.pf-table .ed, .pf-table .gone, .pf-table .when { display: block; font-size: 12px; }
.pf-table .ed { color: var(--gold-bright); }
.pf-table .gone, .pf-table .when { color: var(--faint); }
.pf-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 12px; }
.pf-games { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 16px; }
.pf-game { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--navy-800); }
.pf-game h4 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.pf-game .big { font-size: 24px; font-weight: 600; color: var(--white); font-variant-numeric: tabular-nums; margin-top: 4px; }
.pf-game p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.pf-wlp { display: flex; gap: 2px; height: 8px; margin-top: 10px; border-radius: 4px; overflow: hidden; }
.pf-wlp .w { background: #7fae78; } .pf-wlp .l { background: #e0736b; } .pf-wlp .p { background: #9a9a9a; }

.pf-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.pf-timeline::before { content: ""; position: absolute; left: 127px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--line-strong), rgba(201, 168, 76, 0.05)); }
.pf-timeline li { display: grid; grid-template-columns: 112px 28px minmax(0, 1fr); align-items: start; padding: 8px 0; }
.pf-timeline time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; padding-right: 14px; padding-top: 2px; }
.pf-timeline .dot { width: 12px; height: 12px; border-radius: 50%; margin: 6px 0 0 6px; background: var(--navy-900); border: 2px solid var(--k, var(--gold)); position: relative; z-index: 1; }
.pf-timeline .what { padding-left: 10px; }
.pf-timeline .kind { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--k, var(--gold)); }
.pf-timeline p { margin: 1px 0 0; color: var(--cream); }

/* ---------- Collector's Card ---------- */
.pf-card-stage {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: 40px; align-items: center; padding: 40px 36px; border-radius: 16px;
    border: 1px solid var(--line); background: radial-gradient(ellipse at 30% 40%, rgba(201, 168, 76, 0.14), transparent 60%), var(--navy-950);
}
.pf-card-col { display: grid; place-items: center; }
.pf-tcard-wrap { width: min(340px, 100%); perspective: 1300px; }
.pf-tcard {
    position: relative; width: 100%; aspect-ratio: 5 / 7; transform-style: preserve-3d; border-radius: 20px; cursor: pointer;
    transform: rotateX(var(--rx, 0deg)) rotateY(calc(var(--ry, 0deg) + var(--flip, 0deg))); transition: transform 0.12s ease-out;
}
.pf-tcard.turning { transition: transform 0.7s cubic-bezier(0.2, 0.75, 0.2, 1); }
.pf-tcard.flipped { --flip: 180deg; }
.pf-face { position: absolute; inset: 0; border-radius: 20px; padding: 9px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55); }
.pf-face.back { transform: rotateY(180deg); }
.frame-foil .pf-face { background: conic-gradient(from var(--pf-fa), #e0c36a, #f4e8b8, #9fd8e8, #e8a5d8, #e0c36a, #fff3c4, #a7c9f2, #e0c36a); animation: pf-foil 24s linear infinite; }
@keyframes pf-foil { to { --pf-fa: 360deg; } }
/* Commissioned officers: scarlet with gold lace and gold piping, as on the mess dress. */
.frame-scarlet .pf-face {
    background: repeating-linear-gradient(115deg, transparent 0 7px, rgba(240, 215, 132, 0.28) 7px 8.5px), linear-gradient(145deg, #e8453c, #9e0f0f 40%, #d3221b 60%, #5e0707);
    box-shadow: inset 0 0 0 2px #e0c36a, 0 30px 60px rgba(0, 0, 0, 0.55);
}
.frame-scarlet .c-inner { border: 1.5px solid #e0c36a; }
.frame-gold .pf-face { background: linear-gradient(145deg, #f3dd8f, #b8902e 40%, #f0d784 60%, #8a6a1c); }
.frame-silver .pf-face { background: linear-gradient(145deg, #f4f6f8, #9aa4b0 40%, #e6eaee 60%, #6f7884); }
.frame-bronze .pf-face { background: linear-gradient(145deg, #f0bf8a, #91582a 40%, #e2a46b 60%, #6a3f1d); }
.c-inner { position: relative; height: 100%; border-radius: 13px; background: linear-gradient(180deg, #13243f, #0b1629 60%); padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; overflow: hidden; }
.c-top { display: flex; justify-content: space-between; align-items: center; font-size: 10.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-bright); min-height: 30px; }
.c-top img { width: 30px; height: 30px; }
.c-art { position: relative; flex: 0 0 172px; border-radius: 10px; overflow: hidden; border: 1px solid rgba(224, 195, 106, 0.5); background: #ece3cf; }
.c-art > img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; display: block; }
.c-rank { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--white); background: rgba(8, 17, 34, 0.82); border-radius: 999px; padding: 3px 10px 3px 4px; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-rank img { width: 22px; height: 22px; border-radius: 50%; object-fit: contain; }
.c-name h2 { font-size: 26px !important; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-name p { margin: 2px 0 0; font-family: var(--serif); color: var(--pf-accent-bright); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; }
.c-stats div { text-align: center; padding: 6px 2px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(224, 195, 106, 0.16); min-width: 0; }
.c-stats dt { font-size: 9.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.c-stats dd { margin: 0; font-size: 15px; font-weight: 700; color: var(--white); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.c-pins { display: flex; justify-content: space-between; padding: 0 4px; min-height: 40px; }
.c-pins .pf-medal { --size: 40px; }
.c-foot { margin-top: auto; display: flex; justify-content: space-between; gap: 8px; font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(232, 224, 208, 0.62); }
.c-foil, .c-glare { position: absolute; inset: 0; border-radius: 20px; pointer-events: none; }
.frame-foil .c-foil {
    background: linear-gradient(115deg, transparent 22%, rgba(255, 120, 200, 0.28) 36%, rgba(120, 230, 255, 0.28) 46%, rgba(255, 240, 140, 0.28) 56%, transparent 72%);
    background-size: 260% 260%; background-position: var(--mx, 50%) var(--my, 50%); mix-blend-mode: color-dodge; opacity: 0.6;
}
.frame-scarlet .c-foil {
    background: linear-gradient(115deg, transparent 30%, rgba(255, 222, 140, 0.3) 44%, rgba(255, 248, 220, 0.34) 50%, rgba(255, 222, 140, 0.3) 56%, transparent 70%);
    background-size: 260% 260%; background-position: var(--mx, 50%) var(--my, 50%); mix-blend-mode: overlay; opacity: 0.8;
}
.c-glare { background: radial-gradient(circle at var(--mx, 35%) var(--my, 20%), rgba(255, 255, 255, 0.28), transparent 46%); mix-blend-mode: overlay; }
.pf-face.back .c-inner { align-items: center; text-align: center; }
.pf-face.back .watermark { position: absolute; width: 74%; top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: 0.07; pointer-events: none; }
.pf-face.back h3 { font-size: 22px; margin-top: 4px; }
.pf-face.back .sub { font-size: 12px; color: var(--muted); margin: -6px 0 0; }
.c-rack { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; width: 100%; }
.c-rack .pf-medal { --size: 100%; aspect-ratio: 1; height: auto; }
.c-more { display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--gold-bright); }
.pf-face.back blockquote { margin: 2px 0 0; font-family: var(--serif); font-size: 16px; color: var(--white); overflow-wrap: anywhere; }
.pf-face.back .c-foot { width: 100%; }
.pf-card-side h2 { font-size: 34px; margin: 6px 0 8px !important; }
.pf-card-side > p { color: var(--muted); margin: 0 0 16px; max-width: 46ch; }
.pf-card-side h3 { font-size: 19px; margin: 24px 0 10px !important; }
.pf-btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pf-card-side .hint { margin-top: 12px; }
.pf-frames { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pf-frames li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 14px; color: var(--white); }
.pf-frames li small { display: block; color: var(--faint); font-size: 12px; }
.pf-frames li.yours { border-color: var(--pf-accent-bright); background: rgba(201, 168, 76, 0.08); }
.pf-sw { width: 26px; height: 34px; border-radius: 5px; flex: none; display: inline-block; }
.pf-sw.foil { background: conic-gradient(#e0c36a, #f4e8b8, #9fd8e8, #e8a5d8, #e0c36a); }
.pf-sw.scarlet { background: repeating-linear-gradient(115deg, transparent 0 4px, rgba(240, 215, 132, 0.45) 4px 5.5px), linear-gradient(145deg, #e8453c, #9e0f0f 40%, #d3221b 60%, #5e0707); }
.pf-sw.gold { background: linear-gradient(145deg, #f3dd8f, #b8902e 40%, #f0d784 60%, #8a6a1c); }
.pf-sw.silver { background: linear-gradient(145deg, #f4f6f8, #9aa4b0 40%, #e6eaee 60%, #6f7884); }
.pf-sw.bronze { background: linear-gradient(145deg, #f0bf8a, #91582a 40%, #e2a46b 60%, #6a3f1d); }

/* ---------- Medal Cabinet ---------- */
.pf-cab-title h1 { font-size: 40px; }
.pf-cab-title p { color: var(--muted); margin: 6px 0 0; max-width: 70ch; }
.pf-cab-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; margin-top: 22px; padding: 22px 26px; border: 1px solid var(--line); border-radius: 14px; background: var(--navy-800); }
.pf-big-ring { position: relative; width: 168px; height: 168px; }
.pf-big-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pf-big-ring .track { stroke: rgba(232, 224, 208, 0.08); }
.pf-big-ring .fill { stroke: url(#pfRingGold); stroke-linecap: round; }
.pf-big-ring .txt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.pf-big-ring .txt b { font-family: var(--serif); font-weight: 400; font-size: 52px; color: var(--white); line-height: 1; }
.pf-big-ring .txt span { font-size: 13px; color: var(--muted); }
.pf-cat-bars { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 22px; }
.pf-cat-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; font-size: 13.5px; background: none; border: 0; padding: 4px 0; text-align: left; color: var(--cream); cursor: pointer; }
.pf-cat-bar .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.pf-cat-bar .pf-bar { grid-column: 1 / -1; margin-top: 2px; }
.pf-cat-bar.complete .pf-bar i { background: linear-gradient(90deg, #6e9f68, #a6d39e); }
.pf-cat-bar.complete .n { color: #a6d39e; }
.pf-cat-bar:hover span:first-child { color: var(--white); text-decoration: underline; }
.pf-cab-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 22px 0 6px; }
.pf-cab-filters, .pf-stat-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-chip { border: 1px solid var(--line-strong); background: none; color: var(--muted); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 500; cursor: pointer; }
.pf-chip[aria-pressed="true"] { background: var(--pf-accent); border-color: var(--pf-accent); color: var(--pf-accent-ink); }
.pf-chip:disabled { opacity: 0.45; cursor: default; }
.pf-search { margin-left: auto; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 12px; background: var(--navy-800); }
.pf-search input { background: none; border: 0; outline: 0; width: 200px; font-size: 14px; color: var(--cream); }
.pf-search svg { width: 16px; height: 16px; color: var(--faint); }
.pf-shelf { margin-top: 26px; scroll-margin-top: 90px; }
.pf-shelf header { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.pf-shelf h2 { font-size: 24px; }
.pf-shelf header span { color: var(--muted); font-size: 13.5px; }
.pf-shelf header .n { margin-left: auto; color: var(--white); font-variant-numeric: tabular-nums; font-weight: 600; }
.pf-case {
    margin-top: 10px; position: relative; border-radius: 12px; padding: 18px 18px 0; overflow: hidden; border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 30%), radial-gradient(ellipse at 50% 120%, rgba(201, 168, 76, 0.12), transparent 60%), linear-gradient(180deg, #13223b, #0b1629);
}
.pf-case::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: rgba(255, 255, 255, 0.25); }
.pf-shelf-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 14px 0; position: relative; padding-bottom: 16px; }
.pf-cab-medal { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; background: none; border: 0; padding: 8px 6px 22px; cursor: pointer; color: inherit; }
.pf-cab-medal::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 10px; z-index: -1; background: linear-gradient(180deg, #b39439, #5e4b1d); box-shadow: 0 -5px 12px rgba(0, 0, 0, 0.45); }
.pf-cab-medal .pf-medal { --size: 70px; transition: transform 0.25s ease; }
.pf-cab-medal .nm { font-size: 12.5px; line-height: 1.25; color: var(--cream); }
.pf-cab-medal.dark .nm { color: var(--faint); }
.pf-cab-medal:hover .pf-medal, .pf-cab-medal:focus-visible .pf-medal { transform: translateY(-6px); }
.pf-cab-medal:hover .nm { color: var(--white); }
.pf-cab-medal.lit .pf-medal::before { content: ""; position: absolute; inset: -10%; border-radius: 50%; background: radial-gradient(circle, rgba(224, 195, 106, 0.3), transparent 65%); z-index: -1; }
.pf-cab-medal .lock { position: absolute; top: 8px; right: 18%; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--navy-700); border: 1px solid var(--line); color: var(--faint); }
.pf-cab-medal .lock svg { width: 12px; height: 12px; }

/* ---------- medal dialog ---------- */
dialog.pf-medal-dialog {
    width: min(440px, calc(100vw - 32px)); border: 1px solid var(--line-strong); border-radius: 16px; padding: 28px 28px 24px; text-align: center;
    background: radial-gradient(ellipse at 50% 0%, rgba(201, 168, 76, 0.18), transparent 60%), var(--navy-800); color: var(--cream); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
dialog.pf-medal-dialog::backdrop { background: rgba(4, 9, 18, 0.72); }
.pf-md-art { position: relative; width: 190px; height: 190px; margin: 0 auto 10px; display: grid; place-items: center; }
.pf-md-art .rays {
    position: absolute; inset: 0; border-radius: 50%; background: repeating-conic-gradient(rgba(224, 195, 106, 0.16) 0 8deg, transparent 8deg 22deg);
    -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); mask: radial-gradient(circle, #000 30%, transparent 70%); animation: pf-spin 30s linear infinite;
}
.pf-md-art.dark .rays { opacity: 0.25; }
.pf-md-medal { display: block; transform: perspective(500px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.15s ease-out; }
@keyframes pf-spin { to { transform: rotate(360deg); } }
.pf-md-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--navy-700); color: var(--cream); font-size: 18px; line-height: 1; cursor: pointer; }
dialog.pf-medal-dialog h2 { font-family: var(--serif); font-weight: 400; color: var(--white); font-size: 30px; margin: 4px 0 8px; }
dialog.pf-medal-dialog .crit { margin: 0 auto; color: var(--muted); max-width: 34ch; }
dialog.pf-medal-dialog .crit.note { margin-top: 8px; color: var(--gold-bright); }
.pf-status { display: inline-flex; align-items: center; gap: 6px; margin: 14px 0 0; font-size: 13px; font-weight: 600; border-radius: 999px; padding: 4px 12px; }
.pf-status svg { width: 15px; height: 15px; }
.pf-status.yes { color: #a6d39e; background: rgba(127, 174, 120, 0.14); }
.pf-status.no { color: var(--muted); background: rgba(232, 224, 208, 0.07); }
.pf-md-actions { margin-top: 16px; display: flex; justify-content: center; gap: 8px; }
.pf-md-actions:empty { display: none; }

/* ---------- Customise drawer ---------- */
.pf-scrim { position: fixed; inset: 0; background: rgba(4, 9, 18, 0.55); z-index: 40; opacity: 0; transition: opacity 0.25s ease; }
.pf-scrim.open { opacity: 1; }
.pf-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 100%); z-index: 41; display: flex; flex-direction: column;
    background: var(--navy-800); border-left: 1px solid var(--line-strong); box-shadow: -20px 0 50px rgba(0, 0, 0, 0.45);
    transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.2, 0.75, 0.2, 1); color: var(--cream);
}
.pf-drawer.open { transform: none; }
.pf-drawer > header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.pf-drawer > header h2 { font-family: var(--serif); font-weight: 400; color: var(--white); font-size: 24px; margin: 0; }
.pf-x { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--navy-700); color: var(--cream); font-size: 18px; line-height: 1; cursor: pointer; }
.pf-drawer-body { overflow-y: auto; padding: 4px 20px 24px; flex: 1; }
.pf-drawer > footer { padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pf-drawer .btn.primary { background: var(--pf-accent); border-color: var(--pf-accent); color: var(--pf-accent-ink); }
.pf-drawer fieldset, .pf-drawer .pf-field { border: 0; margin: 0; padding: 20px 0 0; min-width: 0; }
.pf-drawer legend, .pf-lbl { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding: 0; margin-bottom: 10px; display: flex; justify-content: space-between; width: 100%; }
.pf-drawer legend span, .pf-counter { color: var(--pf-accent-bright); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.pf-drawer .hint { margin: -4px 0 10px; }
.pf-drawer .pf-field .hint { margin: 6px 0 0; }
.pf-swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.pf-opt { position: relative; }
.pf-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pf-swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; text-align: center; max-width: 92px; }
.pf-swatch > i { width: 36px; height: 36px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 3px var(--navy-800); }
.pf-swatch > i.pf-sw { border-radius: 6px; width: 30px; height: 38px; box-shadow: none; }
.pf-opt input:checked + .pf-swatch > i { border-color: var(--white); }
.pf-opt input:checked + .pf-swatch, .pf-opt input:checked + .pf-text-opt { color: var(--white); }
.pf-opt input:focus-visible + label { outline: 2px solid var(--pf-accent-bright); outline-offset: 2px; }
.pf-text-opt { display: inline-block; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 13px; color: var(--muted); cursor: pointer; }
.pf-opt input:checked + .pf-text-opt { background: var(--pf-accent); border-color: var(--pf-accent); color: var(--pf-accent-ink); }
.pf-thumbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pf-thumbs.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pf-banner-upload { margin-top: 10px; }
.pf-banner-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-banner-upload .hint { margin: 6px 0 10px; }
.pf-thumb { display: block; cursor: pointer; border-radius: 8px; border: 2px solid var(--line); overflow: hidden; font-size: 12.5px; color: var(--muted); }
.pf-thumb .pv { display: block; height: 56px; position: relative; overflow: hidden; }
.pf-thumb .pv.tall { height: 120px; background: var(--navy-900); }
.pf-thumb .pv img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; }
.pf-thumb .pv .pf-plain-card { border-width: 3px; height: 100%; aspect-ratio: auto; border-radius: 0; padding: 6px; }
.pf-thumb .pv .pf-plain-card .e { font-size: 28px; }
.pf-thumb .pv .pf-plain-card .n, .pf-thumb .pv .pf-plain-card .r { display: none; }
.pf-thumb .t { display: block; padding: 5px 8px; background: var(--navy-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-opt input:checked + .pf-thumb { border-color: var(--pf-accent-bright); color: var(--white); }
.pf-titles { display: grid; gap: 6px; }
.pf-title-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
.pf-title-opt b { font-family: var(--serif); font-weight: 400; font-size: 17px; color: var(--white); }
.pf-title-opt small { font-size: 12px; color: var(--faint); text-align: right; }
.pf-opt input:checked + .pf-title-opt { border-color: var(--pf-accent-bright); background: rgba(201, 168, 76, 0.08); }
.pf-opt input:disabled + .pf-title-opt { opacity: 0.45; cursor: not-allowed; }
.pf-drawer input[type="text"], .pf-drawer textarea { width: 100%; background: var(--navy-900); border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 12px; font-size: 14px; resize: vertical; color: var(--cream); }
.pf-pick-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.pf-pick { position: relative; background: none; border: 1px solid transparent; border-radius: 8px; padding: 3px; cursor: pointer; }
.pf-pick .pf-medal { --size: 100%; aspect-ratio: 1; height: auto; }
.pf-pick[aria-pressed="true"] { border-color: var(--pf-accent-bright); background: rgba(201, 168, 76, 0.12); }
.pf-pick[aria-pressed="true"]::after { content: attr(data-n); position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--pf-accent-bright); color: #0b1629; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.pf-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; font-size: 14px; cursor: pointer; }
.pf-toggle input { width: 38px; height: 22px; appearance: none; -webkit-appearance: none; border-radius: 999px; background: var(--navy-600); position: relative; cursor: pointer; transition: background 0.2s ease; flex: none; margin: 0; }
.pf-toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--cream); transition: transform 0.2s ease; }
.pf-toggle input:checked { background: var(--pf-accent); }
.pf-toggle input:checked::after { transform: translateX(16px); }

.pf-tip { position: fixed; z-index: 60; pointer-events: none; padding: 7px 10px; border-radius: 8px; font-size: 13px; max-width: 260px; background: var(--navy-950); border: 1px solid var(--line-strong); color: var(--white); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5); }

.pf-view { animation: pf-rise 0.4s ease both; }
@keyframes pf-rise { from { opacity: 0.4; transform: translateY(8px); } to { opacity: 1; transform: none; } }

a.menu-item { text-decoration: none; }

/* Member names on the Chain of Command open their profile. */
a.hier-person, a.hier-name-link { color: inherit; text-decoration: none; }
a.hier-person:hover, a.hier-name-link:hover { text-decoration: underline; }

@media (max-width: 1020px) {
    .pf-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pf-hero-main { grid-template-columns: auto minmax(0, 1fr); }
    .pf-clock { grid-column: 1 / -1; text-align: left; }
    .pf-ov-grid, .pf-two, .pf-two.wide-left, .pf-hero-foot { grid-template-columns: minmax(0, 1fr); }
    .pf-card-stage { grid-template-columns: minmax(0, 1fr); padding: 28px 18px; }
}
@media (max-width: 640px) {
    .pf-topbar { gap: 10px; }
    .pf-views { width: 100%; overflow-x: auto; }
    .pf-views button { flex: 1; justify-content: center; padding: 7px 10px; }
    .pf-views button span { display: none; }
    .pf-views button.current span { display: inline; }
    .pf-actions { width: 100%; }
    .pf-find { flex: 1; }
    .pf-find input { width: 100%; }
    .pf-find-list { left: 0; right: auto; width: 100%; }
    .pf-hero-main { grid-template-columns: minmax(0, 1fr); padding: 0 18px; margin-top: -80px; }
    .pf-avatar { width: 116px; height: 116px; }
    .pf-identity h1 { font-size: 38px; }
    .pf-hero-foot { padding: 18px; }
    .pf-facts { grid-template-columns: minmax(0, 1fr); }
    /* Phones: compact pins. The category label (which wrapped to three lines) is left to
       the medal's own window, opened by tapping it. */
    .pf-showcase { padding: 14px 12px 12px; }
    .pf-pins { --cols: 3; --gap-x: 4px; row-gap: 6px; }
    .pf-pin { gap: 6px; padding: 8px 2px; }
    .pf-pin:hover { transform: none; }
    .pf-pin .pf-medal { --size: 62px; }
    .pf-pin-name { font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; }
    .pf-pin-cat { display: none; }
    .pf-pin.empty { min-height: 110px; font-size: 12px; }
    .pf-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pf-rack-cat { grid-template-columns: minmax(0, 1fr); }
    .pf-trophy-box { grid-template-columns: 120px minmax(0, 1fr); }
    .pf-cab-top { grid-template-columns: minmax(0, 1fr); justify-items: center; }
    .pf-search { margin-left: 0; width: 100%; }
    .pf-search input { width: 100%; }
    .pf-timeline::before { left: 83px; }
    .pf-timeline li { grid-template-columns: 68px 28px minmax(0, 1fr); }
    .pf-drawer { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .pf-page *, .pf-page *::before, .pf-page *::after, .pf-drawer, .pf-medal-dialog * { animation: none !important; transition: none !important; }
}

/* Wall of Fame panel (supportPanel) */
.pf-support-main { display: flex; align-items: center; gap: 14px; }
.pf-support-place { font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1; color: var(--pf-accent-bright); }
.pf-support-main p { margin: 0; }
.pf-support-tier { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; font-size: 13px; color: var(--gold-bright); }
.pf-support-tier img { width: 18px; height: 18px; }
.pf-support-own { margin: 12px 0 0; font-size: 13.5px; color: var(--muted); }
