/* Existing approved parchment atlas and codex portraits, no new raster assets. */
.ranking-sheet .sheet-panel { background-color: #eee0c3 !important; }
.ranking-sheet .sheet-body { display: flex; flex-direction: column; }
.rank-intro { text-align: center; margin: -2px 0 13px; color: #69533b; font-size: 12px; line-height: 1.8; }
.rank-weekly { border: 1px solid #a68c62; padding: 14px; margin: 12px 0; background: #fff8e457; overflow-wrap: anywhere; }
.rank-weekly h3 { margin: 0 0 10px; }
.rank-weekly p { font-size: 13px; line-height: 1.7; }
.rank-weekly button { max-width: 100%; white-space: normal; }
.rank-weekly button:disabled { opacity: .5; }
.tamed-panel { padding: 8px; font-size: 12px; background: #eee0c3; color: #302018; }
.tamed-pages { display: flex; justify-content: space-between; align-items: center; margin: 6px 0; }
.tamed-cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.tamed-card { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.tamed-card img { width: 32px; height: 32px; object-fit: contain; }
.tamed-card.fallen { opacity: .5; }
.rank-divider { display: flex; align-items: center; gap: 12px; color: #8c3828; font-size: 11px; letter-spacing: .18em; margin-bottom: 15px; }
.rank-divider::before, .rank-divider::after { content: ''; height: 1px; flex: 1; background: #a68c62; box-shadow: 0 2px #fff6df; }
.rank-controls { display: flex; align-items: center; justify-content: space-between; gap: 6px; border-bottom: 2px solid #786044; padding-bottom: 9px; }
.rank-tabs { display: flex; gap: 4px; }
.rank-tabs button, .rank-refresh { border: 0; background: transparent; color: #6a543e; min-height: 40px; padding: 7px 8px; font-size: 13px; }
.rank-tabs button[aria-selected=true] { background: #6c3c2b; color: #f8e8c9; box-shadow: inset 0 0 0 2px #9e7250; }
.rank-refresh { font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }
.rank-column-label { display: grid; grid-template-columns: 34px 1fr auto; font-size: 10px; color: #78634b; padding: 10px 6px 6px; gap: 8px; letter-spacing: .06em; }
.rank-list { display: grid; gap: 0; }
.rank-row { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 8px; text-align: left; width: 100%; background: transparent; border: 0; border-bottom: 1px solid #a78c6659; padding: 13px 6px; color: #302018; }
.rank-row:hover { background: #fff8e457; }
.rank-row.rank-first { margin: 5px 0 6px; padding: 15px 6px; border: 1px solid #967143; box-shadow: inset 0 0 0 3px #f4e7ca, inset 0 0 0 4px #b99b6b; background: #ead6ae77; }
.rank-row.rank-self { background: #73805b22; border-left: 3px solid #586146; padding-left: 3px; }
.rank-place { font-family: var(--f-display); font-size: 23px; text-align: center; align-self: start; padding-top: 2px; color: #77614a; }
.rank-first .rank-place { color: #8c3828; font-size: 28px; }
.rank-place small { display: block; font-family: var(--f-body); font-size: 9px; letter-spacing: .1em; }
.rank-main { min-width: 0; }
.rank-topline { display: flex; gap: 6px; align-items: baseline; justify-content: space-between; }
.rank-name { font-size: 15px; overflow-wrap: anywhere; }
.rank-score { white-space: nowrap; color: #493b2d; font-size: 13px; }
.rank-score b { font-size: 19px; font-family: var(--f-display); }
.rank-subline { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 9px; font-size: 11px; color: #786148; }
.rank-victory { color: #8c3828; }
.rank-portraits { display: flex; align-items: start; gap: 12px; }
.rank-hero, .rank-party-group { display: grid; justify-items: start; gap: 5px; }
.rank-hero { grid-template-columns: 42px; flex-shrink: 0; justify-items: center; border-right: 1px solid #ac936e; padding-right: 12px; }
.rank-party-group { min-width: 0; }
.rank-companions { display: flex; flex-wrap: wrap; gap: 6px; align-items: start; min-height: 40px; }
.rank-party-person { display: grid; width: 42px; justify-items: center; gap: 5px; }
.rank-portraits .rank-party-label { margin-left: 0; max-width: 100%; text-align: center; line-height: 1.4; word-break: keep-all; overflow-wrap: anywhere; }
.rank-face { position: relative; display: inline-block; overflow: hidden; width: 42px; height: 42px; flex: 0 0 42px; background: #a99473; border: 1px solid #6c5238; outline: 1px solid #f8edcf; outline-offset: -3px; }
.rank-face img { display: block; position: absolute; width: 175%; max-width: none; height: 175%; left: -37.5%; top: -3%; object-fit: cover; image-rendering: pixelated; }
.rank-face canvas { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.rank-class-face { border-color: #8c3828; }
.rank-class-face img { width: 100%; height: auto; left: 0; top: 0; }
.rank-class-fallback { display: grid; place-items: center; height: 100%; padding: 3px; font-size: 10px; text-align: center; }
.rank-party-label { color: #80694e; font-size: 10px; margin-left: 3px; }
.rank-status { font-size: 12px; color: #6a543e; line-height: 1.7; margin: 12px 0; }
.rank-status:empty { display: none; }
.rank-empty { text-align: center; padding: 35px 12px; border: 1px solid #bca680; margin: 12px 0; background: #fff5db30; }
.rank-empty .rank-seal { width: 48px; height: 48px; margin: 0 auto 16px; display: grid; place-items: center; border: 3px double #996b45; color: #8c3828; font-family: var(--f-display); font-size: 23px; }
.rank-empty h3 { font-size: 19px; margin: 0 0 10px; }
.rank-empty p { font-size: 13px; color: #705b43; line-height: 1.8; }
.rank-action { padding: 11px 16px; background: #68402e; color: #f8e9cc; border: 1px solid #422b20; box-shadow: inset 0 0 0 2px #a17a51; font-size: 14px; min-height: 44px; }
.rank-action.secondary { background: transparent; color: #694c34; box-shadow: none; border-color: #ac936e; }
.rank-action:disabled { opacity: .55; }
.rank-form { display: grid; gap: 9px; margin-top: 16px; }
.rank-form input { width: 100%; min-width: 0; border: 1px solid #a48a63; padding: 12px; background: #fff7e1; color: #302018; font: inherit; }
.rank-form label { font-size: 13px; }
.rank-foot { border-top: 1px solid #ac936e; padding-top: 14px; margin-top: auto; }
.rank-foot p, .rank-rules { font-size: 11px; line-height: 1.8; color: #715c44; }
.rank-foot details { margin-top: 12px; font-size: 12px; color: #6a543e; }
.rank-foot summary { cursor: pointer; min-height: 30px; }
.rank-recovery { display: block; width: 100%; padding: 8px; font-size: 11px; background: #fff8e4; border: 1px solid #a48a63; }
.rank-demo-label { color: #843e29; border: 1px dashed #9a6743; padding: 8px; font-size: 12px; text-align: center; }
.rank-detail { padding: 12px 0; }
.rank-detail h3 { font-size: 25px; margin: 14px 0 5px; text-align: center; }
.rank-detail .rank-result { text-align: center; font-size: 17px; color: #8c3828; }
.rank-detail-hero { display: grid; justify-items: center; gap: 6px; margin: 20px 0; }
.rank-detail-hero .rank-face { width: 76px; height: 76px; }
.rank-detail-hero strong { font-size: 14px; }
.rank-detail-party { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; margin: 22px 0; }
.rank-detail-person { display: grid; justify-items: center; gap: 7px; font-size: 12px; }
.rank-detail-person .rank-face { width: 66px; height: 66px; }
.rank-equipment { display: grid; gap: 13px; margin: 23px 0; }
.rank-equipment div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px dotted #aa9069; font-size: 13px; }
.rank-equipment dt { color: #7b6349; }
.rank-equipment dd { margin: 0; text-align: right; }
.rank-start-note { position: fixed; inset: 0; z-index: 1000; background: #121c24bd; display: grid; place-items: center; padding: 24px; }
.rank-start-card { background: #e8d8ba; border: 3px double #715237; padding: 22px; max-width: 360px; color: #302018; }
.rank-start-card p { font-size: 14px; line-height: 1.8; }
.rank-start-card button { width: 100%; margin-top: 10px; font-family: var(--f-body); }
@media(max-width:350px) { .ranking-sheet .sheet-body { padding-left: 8px; padding-right: 8px; } .rank-row { grid-template-columns: 27px minmax(0,1fr); gap: 5px; } .rank-name { font-size: 13px; } .rank-score { font-size: 11px; } .rank-face { width: 37px; height: 37px; flex-basis: 37px; } .rank-hero { grid-template-columns: 37px; } .rank-party-person { width: 37px; } }
@media(prefers-reduced-motion:reduce) { .ranking-sheet .sheet-panel { animation: none !important; } }
