.trophy-cabinet{width:min(100%,720px);align-self:center;flex-shrink:0;padding:10px 12px 6px;border:1px solid #b89b683d;border-radius:16px;background:linear-gradient(#10141e55,#10141e99),url("assets/ui/menry-cabinet-keepsakes1.webp") center/cover;box-shadow:inset 0 1px #ffffff0a}
.trophy-cabinet>header{display:flex;justify-content:space-between;gap:8px;font-size:10px;color:#b7bfca;margin-bottom:7px}
.trophy-shelf{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;padding:0 0 10px;border-bottom:7px solid #665143;box-shadow:0 5px 5px #0005}
.trophy-slot{min-width:0;min-height:90px;border:1px solid transparent;border-radius:10px;padding:6px 3px;background:transparent;color:#c9ced9;display:flex;align-items:center;flex-direction:column;gap:4px;cursor:pointer;font:inherit;transition:background .18s,border-color .18s}
.trophy-slot strong{font-size:10px;line-height:1.2;text-align:center;overflow-wrap:anywhere}.trophy-slot small{font-size:9px;color:#aeb8c8}
.trophy-totem{display:grid;place-items:center;width:38px;height:40px;color:#ead398;background:linear-gradient(#b7985733,#d7b56d11);border-radius:16px 16px 7px 7px;border-bottom:4px solid #b49b66;filter:drop-shadow(0 3px 3px #0008)}
.trophy-totem .exp-icon{width:23px;height:23px}.trophy-slot.unearned .trophy-totem{opacity:.35;filter:grayscale(1)}
.trophy-slot.selected{border-color:#e3c589;background:#d7b56d16}.trophy-slot:focus-visible{outline:2px solid #b5e9e4;outline-offset:2px}.trophy-slot:hover{background:#ffffff0a}
.trophy-cabinet>.exp-pager{justify-content:center;margin-top:5px;gap:12px}.trophy-cabinet>.exp-pager button{min-width:44px;min-height:44px}
.ship-upgrades .journey-upgrade-stage{min-height:0;overflow-y:auto;overscroll-behavior:contain}
.relic-build-fit{display:block;padding:6px 8px;border-radius:7px;background:#ffffff08;color:#bbc5d2!important;line-height:1.4}.relic-build-fit.ready{background:#96d4b912;color:#b8e5cb!important}
@media(min-width:900px) and (min-height:501px){.exp-page.ship-upgrades{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);grid-template-rows:auto auto minmax(0,1fr) auto;gap:14px 26px}.ship-upgrades>.exp-screen-heading{grid-column:1/-1}.ship-upgrades>.ship-catalogue-tabs{grid-column:1;grid-row:2}.ship-upgrades>.trophy-cabinet{grid-column:1;grid-row:3;align-self:start;box-sizing:border-box}.ship-upgrades .trophy-shelf{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.ship-upgrades .trophy-slot{min-height:106px}.ship-upgrades .trophy-slot strong{font-size:12px}.ship-upgrades .trophy-slot small{font-size:10px}.ship-upgrades>.journey-upgrade-stage{grid-column:2;grid-row:2/4;align-self:stretch;gap:12px;padding:16px 10px}.ship-upgrades>.exp-screen-footer{grid-column:1/-1}.ship-upgrades .journey-upgrade-stage>h1{font-size:30px}.ship-upgrades .journey-upgrade-stage>.exp-upgrade-icon{width:56px;height:56px}}
@media(max-width:540px) and (min-height:501px){.ship-upgrades .trophy-slot{height:60px;min-height:60px;gap:2px;padding:3px}.ship-upgrades .trophy-slot strong{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.1}.ship-upgrades .trophy-totem{flex-shrink:0;width:25px;height:25px}.ship-upgrades .trophy-totem .exp-icon{width:17px;height:17px}.ship-upgrades .trophy-slot small{font-size:8px;flex-shrink:0}.ship-upgrades .journey-upgrade-stage{gap:7px;padding:10px 5px}.ship-upgrades .journey-upgrade-stage>.exp-upgrade-icon{width:34px;height:34px;border-radius:10px}.ship-upgrades .journey-upgrade-stage>.exp-upgrade-icon .exp-icon{width:20px;height:20px}.ship-upgrades .journey-upgrade-stage>h1{font-size:21px}.ship-upgrades .journey-upgrade-stage>p{font-size:11px;line-height:1.4}.ship-upgrades .ship-upgrade-benefit{padding:8px;gap:5px}.ship-upgrades .ship-upgrade-benefit>strong{font-size:10px}.ship-upgrades .ship-upgrade-benefit small{font-size:10px}.ship-upgrades .ship-upgrade-benefit b{font-size:14px}.ship-upgrades .ship-purchase-preview{padding:6px 8px}}
@media(max-height:500px) and (min-aspect-ratio:4/3){.ship-upgrades .trophy-shelf{grid-template-columns:repeat(3,minmax(0,1fr))}.ship-upgrades .trophy-slot{min-height:44px;display:grid;grid-template-columns:25px minmax(0,1fr);gap:2px 4px;padding:3px}.ship-upgrades .trophy-totem{grid-row:1/3;width:24px;height:28px}.ship-upgrades .trophy-slot strong{text-align:left;overflow-wrap:normal}.ship-upgrades .trophy-slot small{font-size:8px;text-align:left}}
@media(max-width:540px){.trophy-shelf{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}.trophy-slot{min-height:72px}.trophy-totem{width:30px;height:30px}.trophy-totem .exp-icon{width:20px;height:20px}.trophy-cabinet{padding:7px 8px 3px}.trophy-cabinet>header{font-size:9px}.trophy-slot strong{font-size:9px}}
@media(max-height:500px) and (min-aspect-ratio:4/3){.exp-page.ship-upgrades{display:grid;grid-template-columns:minmax(230px,.9fr) minmax(0,1.1fr);grid-template-rows:auto auto minmax(0,1fr) auto;gap:5px 14px}.ship-upgrades>.exp-screen-heading{grid-column:1/-1}.ship-upgrades>.ship-catalogue-tabs{grid-column:1;grid-row:2}.ship-upgrades>.trophy-cabinet{grid-column:1;grid-row:3;align-self:stretch;overflow-y:auto}.ship-upgrades>.journey-upgrade-stage{grid-column:2;grid-row:2/4}.ship-upgrades>.exp-screen-footer{grid-column:1/-1}.trophy-slot{min-height:65px}.trophy-shelf{gap:3px}.trophy-slot strong{font-size:9px}.trophy-totem{height:30px;width:30px}}

/* Illustrated keepsakes keep the same catalogue, ranks and hit targets. */
.keepsake-art{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;pointer-events:none;user-select:none}
.trophy-totem.illustrated-totem{width:54px;height:54px;flex-shrink:0;border:0;border-radius:0;background:none;filter:drop-shadow(0 3px 3px #0009)}
.trophy-slot.unearned .illustrated-totem{opacity:.48;filter:grayscale(1) brightness(.85)}
.ship-upgrades .journey-upgrade-stage>.keepsake-preview{width:96px;height:96px;flex-shrink:0;background:none;border:0;border-radius:0;filter:drop-shadow(0 7px 5px #0006)}
@media(min-width:900px) and (min-height:501px){.ship-upgrades .trophy-slot{min-height:122px}.ship-upgrades .illustrated-totem{width:72px;height:72px}}
@media(max-width:540px) and (min-height:501px){
 .ship-upgrades .trophy-slot:has(.illustrated-totem){height:70px;min-height:70px;padding:2px;gap:1px}
 .ship-upgrades .illustrated-totem{width:34px;height:34px}
 .ship-upgrades .journey-upgrade-stage>.keepsake-preview{width:60px;height:60px}
}
@media(max-height:500px) and (min-aspect-ratio:4/3){
 .ship-upgrades .trophy-slot:has(.illustrated-totem){grid-template-columns:34px minmax(0,1fr);min-height:50px}
 .ship-upgrades .illustrated-totem{width:34px;height:38px}
 .ship-upgrades .journey-upgrade-stage>.keepsake-preview{width:72px;height:72px}
}

.keepsake-view-navigation{display:none}
@media(max-width:540px) and (min-height:501px){
 .keepsake-view-navigation{display:flex;flex:none;gap:7px}.keepsake-view-navigation>.exp-button{flex:1;min-height:44px;padding:8px;font-size:12px}
 .keepsake-view-navigation [aria-pressed=true]{border-color:#9ce2d8;background:#24483f;color:#e8fff2}
 .ship-upgrades[data-keepsake-panel="shelf"]>.journey-upgrade-stage{display:none}
 .ship-upgrades[data-keepsake-panel="upgrade"]>.trophy-cabinet{display:none}
 .ship-upgrades[data-keepsake-panel="shelf"]>.trophy-cabinet{flex:1;min-height:0;display:flex;flex-direction:column;justify-content:center;gap:8px;margin:0;box-sizing:border-box}
 .ship-upgrades[data-keepsake-panel="shelf"] .trophy-slot:has(.illustrated-totem){height:auto;min-height:100px;gap:4px}
 .ship-upgrades[data-keepsake-panel="shelf"] .illustrated-totem{width:58px;height:58px}
 .ship-upgrades .journey-upgrade-stage{display:grid;grid-template-columns:64px minmax(0,1fr);align-content:start;align-items:start;text-align:left;gap:6px 10px;padding:10px 5px}
 .ship-upgrades .journey-upgrade-stage>*{grid-column:1/-1;max-width:100%;min-width:0}
 .ship-upgrades .journey-upgrade-stage>.exp-upgrade-icon{grid-column:1;grid-row:1/4;align-self:center;justify-self:center}
 .ship-upgrades .journey-upgrade-stage>.exp-eyebrow{grid-column:2;grid-row:1;align-self:end}
 .ship-upgrades .journey-upgrade-stage>h1{grid-column:2;grid-row:2;font-size:21px;align-self:center}
 .ship-upgrades .journey-upgrade-stage>.exp-ranks{grid-column:2;grid-row:3;justify-content:flex-start;gap:4px}
 .ship-upgrades .journey-upgrade-stage>.exp-button{justify-self:stretch;min-height:44px;margin:0}
 .ship-upgrades .journey-upgrade-stage>small{font-size:10px;line-height:1.35}
 .ship-upgrades .ship-upgrade-benefit{max-width:none}.ship-upgrades .ship-purchase-preview{margin:0}
}

@media(max-height:500px) and (min-aspect-ratio:4/3){
 .keepsake-view-navigation{display:flex;gap:7px;grid-column:2;grid-row:2;min-height:44px}
 .keepsake-view-navigation>.exp-button{flex:1;min-height:44px;padding:7px;font-size:12px}
 .keepsake-view-navigation [aria-pressed=true]{border-color:#9ce2d8;background:#24483f;color:#e8fff2}
 .ship-upgrades>.ship-catalogue-tabs{grid-column:1;grid-row:2}
 .ship-upgrades[data-keepsake-panel="shelf"]>.journey-upgrade-stage{display:none}
 .ship-upgrades[data-keepsake-panel="upgrade"]>.trophy-cabinet{display:none}
 .ship-upgrades[data-keepsake-panel="shelf"]>.trophy-cabinet{grid-column:1/-1;grid-row:3;display:grid;grid-template-columns:145px minmax(0,1fr);grid-template-rows:1fr 44px;gap:6px 12px;padding:8px 10px;overflow-y:auto}
 .ship-upgrades[data-keepsake-panel="shelf"] .trophy-cabinet>header{grid-column:1;grid-row:1;flex-direction:column;align-self:center;gap:5px;margin:0}
 .ship-upgrades[data-keepsake-panel="shelf"] .trophy-cabinet>.exp-pager{grid-column:1;grid-row:2;margin:0;gap:8px}
 .ship-upgrades[data-keepsake-panel="shelf"] .trophy-shelf{grid-column:2;grid-row:1/3;grid-template-columns:repeat(6,minmax(0,1fr));align-self:center}
 .ship-upgrades[data-keepsake-panel="shelf"] .trophy-slot{display:flex;flex-direction:column;gap:3px;min-height:92px;padding:3px 1px}
 .ship-upgrades[data-keepsake-panel="shelf"] .illustrated-totem{width:46px;height:46px}
 .ship-upgrades[data-keepsake-panel="shelf"] .trophy-slot strong{text-align:center;overflow-wrap:anywhere}
 .ship-upgrades[data-keepsake-panel="upgrade"]>.journey-upgrade-stage{grid-column:1/-1;grid-row:3;display:grid;grid-template-columns:64px minmax(0,1fr) minmax(0,1.2fr);grid-template-rows:auto auto 44px auto;align-content:start;align-items:start;text-align:left;gap:3px 12px;padding:5px}
 .ship-upgrades .journey-upgrade-stage>.exp-upgrade-icon{grid-column:1;grid-row:1/4;width:64px;height:64px;align-self:center;justify-self:center}
 .ship-upgrades .journey-upgrade-stage>.exp-eyebrow{grid-column:2;grid-row:1;align-self:end}
 .ship-upgrades .journey-upgrade-stage>h1{grid-column:2;grid-row:2;font-size:20px;align-self:center}
 .ship-upgrades .journey-upgrade-stage>.exp-ranks{grid-column:2;grid-row:3;justify-content:flex-start;align-self:center}
 .ship-upgrades .journey-upgrade-stage>p:not(.ship-purchase-preview){grid-column:1/3;grid-row:4;font-size:11px;line-height:1.35}
 .ship-upgrades .ship-upgrade-benefit{grid-column:3;grid-row:1/3;padding:5px 8px;gap:2px}
 .ship-upgrades .ship-upgrade-benefit>strong{font-size:10px;line-height:1.2}.ship-upgrades .ship-upgrade-benefit>span{gap:1px}.ship-upgrades .ship-upgrade-benefit small{font-size:9px;line-height:1.2}.ship-upgrades .ship-upgrade-benefit b{font-size:13px;line-height:1.2}
 .ship-upgrades .journey-upgrade-stage>.exp-button{grid-column:3;grid-row:3;justify-self:stretch;min-height:44px;margin:0;padding:6px}
 .ship-upgrades .journey-upgrade-stage>#permanent-upgrade-status{grid-column:3;grid-row:4;font-size:10px;line-height:1.3}
 .ship-upgrades .journey-upgrade-stage>.ship-purchase-preview{grid-column:3;grid-row:5;font-size:10px;line-height:1.2;padding:4px 6px;margin:0}
 .ship-upgrades .journey-upgrade-stage:has(>.exp-button:not(:disabled))>#permanent-upgrade-status{display:none}
 .ship-upgrades .journey-upgrade-stage:has(>.exp-button:not(:disabled))>.ship-purchase-preview{grid-row:4}
 .ship-upgrades .journey-upgrade-stage>small:not(#permanent-upgrade-status){grid-column:1/3;grid-row:5;font-size:10px;line-height:1.3}
}

@media(max-height:500px) and (min-aspect-ratio:4/3){
 /* Discovery conditions must precede their purchase control in reading order. */
 .ship-upgrades[data-keepsake-panel="upgrade"]>.journey-upgrade-stage:not(:has(>.keepsake-preview)){display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px}
}

/* Keep upgrade receipts above the fixed 44px navigation row. */
body:has(.ship-upgrades)>.toast{bottom:calc(58px + env(safe-area-inset-bottom,0px))}

