/* Scroll magic / cabinet */
.belt-slot.selected{outline:3px solid #ffe27a;outline-offset:2px;background:#1c2c25}
.recipe-list{display:grid;gap:8px;overflow:auto;padding-right:2px}
.recipe-entry{display:grid;grid-template-columns:44px 1fr;gap:10px;align-items:center;background:#141f1b;border:1px solid #2d4038;border-radius:11px;padding:10px}
.recipe-entry.locked{opacity:.62}.recipe-entry.discovered{border-color:#526d61}
.recipe-icon{font-size:28px;display:grid;place-items:center}
.recipe-entry b,.recipe-entry small,.recipe-entry strong{display:block}.recipe-entry small{color:#91a49b;margin-top:3px;font-size:10px}.recipe-entry strong{margin-top:5px;color:#ffe27a;font-size:11px}

.scroll-cabinet-panel{position:relative;height:min(760px,94dvh);gap:8px;overflow:hidden}
.cabinet-head{position:absolute;z-index:10;top:18px;right:18px;min-height:0;margin:0;pointer-events:none}
.cabinet-head-actions{position:relative;margin:0;pointer-events:auto}
.cabinet-info-button{width:34px!important;height:34px!important;min-height:34px!important;padding:0!important;border:1px solid #415a4f!important;border-radius:50%!important;background:#17251f!important;color:#dbe9e2!important;font-size:15px!important;font-weight:900!important;line-height:1!important;text-transform:none!important}
.cabinet-info-button[aria-expanded="true"]{border-color:#9df0c9!important;background:#244236!important;color:#f2fff8!important}
.cabinet-info-bubble{position:absolute;right:0;top:calc(100% + 8px);z-index:12;width:min(330px,calc(100vw - 72px));display:grid;gap:7px;padding:10px 11px;border:1px solid #435a50;border-radius:11px;background:#0c1713;box-shadow:0 10px 28px rgba(0,0,0,.5);color:#a8bbb2;font-size:9px;line-height:1.4}
.cabinet-info-bubble b{color:#eef7f2;font-size:11px}.cabinet-info-bubble span{display:block}

/* Deliberately gives the selected scroll substantially more reading room. */
.cabinet-detail{flex:0 0 auto;min-height:180px;max-height:270px;overflow-y:auto;overscroll-behavior:contain;display:grid;gap:7px;padding:12px 13px;border:1px solid #35483f;border-radius:11px;background:#101a16;scrollbar-gutter:stable}
.cabinet-detail-head{display:grid;grid-template-columns:46px minmax(0,1fr);gap:10px;align-items:center;padding-right:118px}
.cabinet-detail-icon{width:46px;height:46px;display:grid;place-items:center;border:1px solid #3b5147;border-radius:10px;background:#17251f;font-size:30px}
.cabinet-detail-head b,.cabinet-detail-head small{display:block}.cabinet-detail-head b{font-size:14px}.cabinet-detail-head small{margin-top:3px;color:#91a49b;font-size:9px}
.cabinet-detail p{margin:0;color:#a8bbb2;font-size:11px;line-height:1.38}
.cabinet-detail strong{display:block;color:#ffe27a;font-size:10px}
.cabinet-empty{display:grid;gap:5px;place-content:center;min-height:130px;text-align:center}.cabinet-empty span{color:#91a49b;font-size:10px}

.fusion-sockets{flex:0 0 auto;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.fusion-socket{position:relative;min-width:0!important;height:64px;padding:4px!important;background:#101a16!important;border:1px dashed #4a6358!important;display:grid!important;place-items:center!important}
.fusion-socket.filled{border-style:solid!important;border-color:#a783c8!important;background:#201a25!important}
.fusion-socket>span{font-size:24px;line-height:1}.fusion-socket>small{position:absolute;right:4px;bottom:3px;color:#82958c;font-size:8px;line-height:1}

.cabinet-slot-hint{flex:0 0 auto;min-height:42px;display:grid;align-content:center;gap:3px;padding:7px 10px;border:1px solid #35483f;border-radius:9px;background:#121e1a;color:#9fb2a9;font-size:9px;line-height:1.25}
.cabinet-slot-hint strong{display:block;color:#ffe27a;font-size:10px}
.cabinet-slot-hint .cabinet-next{display:block;color:#9df0c9;font-size:9px}
.cabinet-slot-hint .cabinet-slot-instruction{display:block;color:#9fb2a9;font-size:9px}

/* Compact, independently scrolling inventory browser with a vertical family rail. */
.cabinet-browser{flex:1 1 156px;min-height:120px;display:grid;grid-template-columns:42px minmax(0,1fr);gap:7px;overflow:hidden}
.cabinet-family-filters{min-height:0;display:flex;flex-direction:column;gap:5px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;padding:1px 2px 1px 1px}
.cabinet-family-filter{position:relative;flex:0 0 38px;width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;padding:0!important;border:1px solid #34483f!important;border-radius:9px!important;background:#16231e!important;color:#dce9e3!important;display:grid!important;place-items:center!important}
.cabinet-family-filter>span{font-size:18px;line-height:1}
.cabinet-family-filter.active{outline:2px solid #9df0c9;outline-offset:-1px;background:#244236!important;border-color:#679c83!important}
.cabinet-family-filter:disabled{opacity:.38}

.cabinet-scroll-grid{min-width:0;min-height:0;height:100%;display:grid;grid-template-columns:repeat(auto-fill,minmax(50px,1fr));grid-auto-rows:52px;gap:5px;align-content:start;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;padding:1px 2px 2px 1px}
.cabinet-scroll-cell{position:relative;min-width:0!important;height:52px!important;padding:3px!important;background:#16231e!important;border:1px solid #34483f!important;display:grid!important;place-items:center!important}
.cabinet-scroll-cell>span{font-size:23px;line-height:1}.cabinet-scroll-cell>small{position:absolute;right:3px;bottom:2px;color:#ffe27a;font-size:8px;font-weight:900}
.cabinet-scroll-cell.selected{outline:2px solid #d8a9ff;background:#2a2231!important}
.cabinet-scroll-cell.depleted{opacity:.48}

.cabinet-actions{flex:0 0 auto;display:flex;gap:7px}
.cabinet-actions>button{flex:1 1 0;min-width:0}
.cabinet-message{flex:0 0 auto;min-height:0;margin:0}
.cabinet-message:empty{display:none}

@media(max-width:430px){
  .scroll-cabinet-panel{height:94dvh;padding:14px;gap:7px}
  .cabinet-head{top:14px;right:14px;min-height:0}
  .cabinet-detail{min-height:190px;max-height:255px;padding:10px 11px}
  .cabinet-detail-head{padding-right:112px}
  .cabinet-detail p{font-size:10px;line-height:1.4}
  .fusion-sockets{gap:4px}.fusion-socket{height:58px}.fusion-socket>span{font-size:21px}
  .cabinet-slot-hint{min-height:40px;padding:6px 8px}
  .cabinet-browser{flex:1 1 142px;min-height:108px;grid-template-columns:36px minmax(0,1fr);gap:5px}
  .cabinet-family-filter{flex-basis:34px;width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important}
  .cabinet-family-filter>span{font-size:16px}
  .cabinet-scroll-grid{height:100%;grid-template-columns:repeat(5,minmax(0,1fr));grid-auto-rows:48px;gap:4px}
  .cabinet-scroll-cell{height:48px!important}.cabinet-scroll-cell>span{font-size:21px}
  .cabinet-actions{gap:5px}.cabinet-actions>button{font-size:10px;padding-left:5px;padding-right:5px}
}

/* Chest inventory: large scrollable details, tight icon grid, fixed actions below. */
.loot-panel{height:min(760px,94dvh);display:flex;flex-direction:column;gap:7px;overflow:hidden}
.loot-heading{flex:0 0 auto}
.loot-details{flex:1 1 auto;min-height:230px;overflow:auto;background:#121f1a;border:1px solid #31453c;border-radius:14px;padding:13px;overscroll-behavior:contain}
.loot-grid-label{flex:0 0 auto;font-size:10px;font-weight:900;letter-spacing:.1em;color:#849a90}
.loot-grid{flex:0 0 auto;min-height:68px;max-height:148px;display:grid;grid-template-columns:repeat(auto-fill,68px);grid-auto-rows:68px;gap:6px;overflow:auto;align-content:start;justify-content:start;padding:1px 2px 3px 1px}
.loot-cell{width:68px;height:68px;border:1px solid #34483f;background:#16231e;border-radius:9px;position:relative;padding:3px;display:grid;place-items:center;cursor:pointer;color:#eef7f2;overflow:hidden}
.loot-cell.selected{outline:2px solid #9df0c9;background:#1c3027}
.loot-cell .cell-icon{font-size:27px;line-height:1;align-self:center}
.loot-cell .cell-rarity{position:absolute;left:4px;bottom:4px;width:6px;height:6px;border-radius:50%;background:var(--rarity,#aaa)}
.loot-recovered{flex:0 0 auto;display:grid;gap:5px}
.loot-resources{display:flex;flex-wrap:wrap;gap:6px;margin:0;min-height:0}
.loot-recovered-cell{width:48px;height:48px;position:relative;display:grid;place-items:center;padding:0;border:1px solid #34483f;border-radius:9px;background:#16231e;color:#eef7f2;cursor:pointer}
.loot-recovered-cell:hover,.loot-recovered-cell:focus-visible{border-color:#6f9383}
.loot-recovered-cell.selected{outline:2px solid #9df0c9;background:#1c3027}
.loot-recovered-icon{font-size:23px;line-height:1}
.loot-recovered-count{position:absolute;right:3px;bottom:2px;min-width:18px;padding:1px 3px;border-radius:7px;background:#0b1511e8;color:#dff5e9;font-size:9px;line-height:1.15;text-align:center}
.loot-actions{flex:0 0 auto;border-top:1px solid #2f433a;padding-top:7px;background:#102019}
.loot-actions .gear-actions{margin:0;grid-template-columns:repeat(3,1fr)}
.loot-actions .gear-actions button{min-height:42px}
.loot-compare-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.loot-compare-pair section{min-width:0}.loot-compare-pair h4{font-size:11px;margin:0 0 6px;color:#c5d8cd}
.loot-compare-pair .equipment-detail-frame{padding:8px;min-height:100%}
.loot-compare-pair .detail-head{gap:6px}.loot-compare-pair .detail-icon{font-size:27px;width:36px;height:36px;flex:0 0 36px}
.loot-compare-pair .detail-head h3{font-size:12px;overflow-wrap:anywhere}
.loot-compare-pair .equipment-level-badge{font-size:9px}
.loot-replace-warning{font-size:11px;color:#ffc3ae}
.loot-confirm-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}
@media(max-width:430px){.loot-compare-pair{grid-template-columns:minmax(0,1fr)}}
#lootMessage{flex:0 0 auto;min-height:0;margin:0}
@media(max-width:430px){
  .loot-details{min-height:250px}
  .loot-grid{grid-template-columns:repeat(auto-fill,62px);grid-auto-rows:62px;max-height:136px}
  .loot-cell{width:62px;height:62px}.loot-cell .cell-icon{font-size:25px}
  .loot-recovered-cell{width:44px;height:44px}.loot-recovered-icon{font-size:21px}
}

/* Stats + permanent upgrades merged table */
.stats-screen{padding-bottom:6px}
.stats-identity{display:flex;gap:8px;margin:4px 0 2px}
.stats-identity .identity-chip{display:flex;align-items:center;gap:7px;background:#1b2823;border:1px solid #2d4138;border-radius:10px;padding:8px 11px;font-size:11px;color:#9fb1aa}
.stats-identity .identity-chip b{font-size:14px;color:#f4f7f5}
.stats-upgrade-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin:14px 0 8px}
.stats-upgrade-head h3{margin:0!important;font-size:15px}
.stats-upgrade-head p{margin:4px 0 0;color:#8ea79d;font-size:10px;line-height:1.25}
.star-wallet{flex:0 0 auto!important;width:auto!important;min-height:40px!important;display:flex!important;align-items:center;gap:7px;border:1px solid #526a60!important;background:#17241f!important;border-radius:999px!important;padding:7px 11px!important;box-shadow:inset 0 0 18px rgba(120,223,255,.05)}
.star-wallet span{font-size:17px;color:#dff8ff;text-shadow:0 0 10px rgba(120,223,255,.45)}
.star-wallet b{font-size:15px}
.star-wallet[aria-expanded="true"]{outline:2px solid #83b9a4}
.star-help{border:1px solid #42584f;background:#13201b;border-radius:11px;padding:10px 12px;margin:0 0 9px;font-size:10px;color:#9fb1aa;line-height:1.4}
.star-help b{display:block;color:#dff8ff;font-size:11px;margin-bottom:3px}.star-help p{margin:0}
.stat-upgrade-table-head{display:grid;grid-template-columns:minmax(82px,1.35fr) .72fr 30px .9fr 54px;gap:6px;padding:0 9px 5px;color:#748b81;font-size:8px;font-weight:900;letter-spacing:.08em}
.upgrade-grid.stat-upgrade-list{display:grid;grid-template-columns:1fr;gap:6px}
.stat-upgrade-list button{display:grid!important;grid-template-columns:minmax(82px,1.35fr) .72fr 30px .9fr 54px;gap:6px;align-items:center;position:relative;text-align:left;padding:9px!important;min-height:58px!important;border:1px solid #394d44;background:linear-gradient(180deg,#24362f,#1e2e28);overflow:hidden}
.stat-upgrade-list button.selected-stat{border-color:#789c8d;box-shadow:inset 3px 0 #a7d8c4}
.stat-upgrade-list button.can-afford{border-color:#4f6e61}.stat-upgrade-list button.cannot-afford{opacity:.72}
.stat-name{display:flex;align-items:center;gap:7px;min-width:0}.stat-name .upgrade-icon{font-size:18px;line-height:1}.stat-name strong{font-size:10px;line-height:1.15;text-transform:uppercase;letter-spacing:.045em;color:#dfe8e4}
.stat-current{font-size:13px;font-weight:900;color:#fff}.stat-level{text-align:center;font-size:10px;color:#9bb0a7;font-weight:900}
.stat-next{font-size:10px;color:#b7c7c0;line-height:1.15}.stat-cost{display:flex;justify-content:center;align-items:center;gap:3px;border-radius:8px;background:#15221d;padding:7px 5px;font-size:10px;color:#dff8ff;font-weight:900}
.stat-description{margin-top:9px;min-height:66px;border:1px solid #31463d;border-radius:11px;background:#121f1a;padding:10px 12px}
.stat-description b{display:block;font-size:12px;color:#edf5f1;margin-bottom:4px}.stat-description p{margin:0;color:#91a49b;font-size:10px;line-height:1.4}
.stats-message{min-height:16px;margin:7px 0 0}
@media(max-width:430px){
 .stat-upgrade-table-head,.stat-upgrade-list button{grid-template-columns:minmax(76px,1.25fr) .7fr 27px .82fr 49px;gap:4px}
 .stat-upgrade-list button{padding:8px 7px!important}.stat-name{gap:5px}.stat-name .upgrade-icon{font-size:16px}.stat-current{font-size:12px}.stat-next{font-size:9px}
}

/* Stats interaction polish: fixed detail panel, scroll-only list, tactile feedback */
.stats-screen{display:flex;flex-direction:column;min-height:0;overflow:hidden!important}
.stats-identity,.stats-upgrade-head,.star-help,.stat-description,.stats-message{flex:0 0 auto}
.stats-list-shell{flex:1 1 auto;min-height:190px;display:flex;flex-direction:column;overflow:hidden;margin-top:2px}
.stats-list-shell .stat-upgrade-table-head{flex:0 0 auto}
.stats-list-shell .stat-upgrade-list{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 2px 10px 0;scrollbar-width:thin;scrollbar-color:#496358 transparent}
.stat-description{margin-top:8px;box-shadow:0 -8px 22px rgba(0,0,0,.12)}
.stat-upgrade-list button{transition:transform .12s ease,border-color .16s ease,background .16s ease,box-shadow .16s ease,opacity .16s ease}
.stat-upgrade-list button:active{transform:scale(.985)}
.stat-upgrade-list button.can-afford .stat-cost{background:#1c392c;box-shadow:inset 0 0 12px rgba(127,239,177,.06)}
.stat-upgrade-list button.can-afford:active .stat-cost{transform:scale(.96)}
.stat-upgrade-list button.upgrade-success{animation:statUpgradePop .46s ease}
.stat-upgrade-list button.upgrade-success .stat-current,.stat-upgrade-list button.upgrade-success .stat-level{animation:valueFlash .58s ease}
.star-wallet.star-denied{animation:starDenied .42s ease;border-color:#ff686f!important;background:#351b1d!important;box-shadow:0 0 0 3px rgba(255,76,87,.12),0 0 20px rgba(255,76,87,.18)!important}
.star-wallet.star-denied span,.star-wallet.star-denied b{color:#ff777d!important;text-shadow:0 0 10px rgba(255,80,90,.45)!important}
.stat-cost.cost-denied{animation:costDenied .42s ease;color:#ff858a;background:#341c1e}
.star-wallet.star-spent{animation:starSpent .55s ease}
.star-wallet.star-spent span{animation:starTwinkle .55s ease}
.stat-description.detail-swap{animation:detailSwap .22s ease}
@keyframes starDenied{0%,100%{transform:translateX(0)}20%{transform:translateX(-5px) rotate(-2deg)}40%{transform:translateX(5px) rotate(2deg)}60%{transform:translateX(-4px)}80%{transform:translateX(3px)}}
@keyframes costDenied{0%,100%{transform:translateX(0)}30%{transform:translateX(-3px)}60%{transform:translateX(3px)}}
@keyframes statUpgradePop{0%{transform:scale(1)}35%{transform:scale(1.018);border-color:#8fe2b8;box-shadow:0 0 18px rgba(114,225,165,.14)}100%{transform:scale(1)}}
@keyframes valueFlash{0%{color:#fff;text-shadow:none}35%{color:#baffd3;text-shadow:0 0 10px rgba(133,255,183,.5)}100%{color:#fff;text-shadow:none}}
@keyframes starSpent{0%{transform:scale(1)}35%{transform:scale(.93)}65%{transform:scale(1.06)}100%{transform:scale(1)}}
@keyframes starTwinkle{0%,100%{transform:rotate(0) scale(1)}50%{transform:rotate(24deg) scale(1.35)}}
@keyframes detailSwap{0%{opacity:.55;transform:translateY(3px)}100%{opacity:1;transform:translateY(0)}}
@media (prefers-reduced-motion:reduce){.stat-upgrade-list button,.star-wallet{transition:none}.star-wallet.star-denied,.stat-cost.cost-denied,.stat-upgrade-list button.upgrade-success,.stat-upgrade-list button.upgrade-success .stat-current,.stat-upgrade-list button.upgrade-success .stat-level,.star-wallet.star-spent,.star-wallet.star-spent span,.stat-description.detail-swap{animation:none}}

/* Stats visual polish — same structure, richer EmorgiE presentation */
.stats-screen{
  position:relative;
  background:
    radial-gradient(circle at 86% 4%,rgba(118,219,175,.055),transparent 24%),
    radial-gradient(circle at 8% 92%,rgba(109,184,153,.035),transparent 26%);
}
.stats-screen::before{
  content:"";position:absolute;inset:0;pointer-events:none;opacity:.16;
  background-image:linear-gradient(rgba(255,255,255,.012) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.009) 1px,transparent 1px);
  background-size:22px 22px;mask-image:linear-gradient(to bottom,black,transparent 78%);
}
.stats-screen>*{position:relative;z-index:1}
.stats-identity .identity-chip{
  border-color:#3a5047;
  background:linear-gradient(180deg,rgba(37,55,48,.96),rgba(23,37,31,.96));
  box-shadow:inset 0 1px rgba(255,255,255,.035),0 5px 14px rgba(0,0,0,.08);
}
.stats-identity .identity-chip b{letter-spacing:.035em;text-shadow:0 1px 8px rgba(255,255,255,.08)}
.stats-upgrade-head h3{letter-spacing:.015em;text-shadow:0 2px 10px rgba(0,0,0,.25)}
.star-wallet{
  position:relative;overflow:hidden;
  background:linear-gradient(145deg,#1d3028,#13231d)!important;
  border-color:#58756a!important;
  box-shadow:inset 0 1px rgba(255,255,255,.055),inset 0 0 18px rgba(118,226,181,.035),0 5px 16px rgba(0,0,0,.13)!important;
}
.star-wallet::after{content:"";position:absolute;inset:-60% auto -60% -45%;width:32%;transform:rotate(18deg);background:linear-gradient(90deg,transparent,rgba(225,255,242,.12),transparent);transition:left .5s ease}
.star-wallet:hover::after,.star-wallet:active::after{left:115%}
.star-wallet span{filter:drop-shadow(0 0 5px rgba(173,241,255,.28))}
.star-help{background:linear-gradient(180deg,#17271f,#111d18);border-color:#40594e;box-shadow:inset 0 1px rgba(255,255,255,.025),0 8px 18px rgba(0,0,0,.08)}
.stat-upgrade-table-head{border-bottom:1px solid rgba(123,158,143,.13);margin-bottom:5px}
.stat-upgrade-list{padding-top:1px!important}
.stat-upgrade-list button{
  isolation:isolate;
  border-color:#385047;
  border-radius:13px!important;
  background:
    radial-gradient(circle at 92% 50%,rgba(132,213,178,.035),transparent 29%),
    linear-gradient(135deg,#253a32,#1d3029 64%,#1a2b25);
  box-shadow:inset 0 1px rgba(255,255,255,.035),inset 0 -1px rgba(0,0,0,.15),0 5px 13px rgba(0,0,0,.09);
}
.stat-upgrade-list button::before{
  content:"";position:absolute;z-index:-1;left:0;top:14%;bottom:14%;width:2px;border-radius:4px;
  background:linear-gradient(transparent,rgba(162,213,191,.32),transparent);opacity:.45
}
.stat-upgrade-list button::after{
  content:"";position:absolute;z-index:-1;right:-24px;top:-35px;width:100px;height:100px;border-radius:50%;
  border:1px solid rgba(183,230,210,.025);box-shadow:0 0 0 16px rgba(183,230,210,.012),0 0 0 32px rgba(183,230,210,.007)
}
.stat-upgrade-list button.selected-stat{
  border-color:#78a894;
  background:radial-gradient(circle at 92% 50%,rgba(148,235,197,.07),transparent 30%),linear-gradient(135deg,#29443a,#20372f 64%,#1c3029);
  box-shadow:inset 3px 0 #a5dec5,inset 0 1px rgba(255,255,255,.05),0 0 0 1px rgba(158,222,194,.07),0 7px 17px rgba(0,0,0,.12);
}
.stat-upgrade-list button.selected-stat::before{width:3px;opacity:1;background:linear-gradient(transparent,#b8ecd4,transparent);box-shadow:0 0 10px rgba(164,235,203,.28)}
.stat-name .upgrade-icon{
  display:grid;place-items:center;width:27px;height:27px;border-radius:8px;
  background:rgba(8,20,15,.2);border:1px solid rgba(164,202,185,.08);
  text-shadow:0 2px 8px rgba(0,0,0,.3);filter:drop-shadow(0 0 5px rgba(191,232,214,.08))
}
.stat-name strong{color:#dce8e3;text-shadow:0 1px 5px rgba(0,0,0,.25)}
.stat-current{font-size:13.5px;text-shadow:0 2px 7px rgba(0,0,0,.25)}
.stat-level{display:grid;place-items:center;min-width:23px;height:23px;border-radius:7px;background:rgba(7,18,14,.16);border:1px solid rgba(158,197,180,.06)}
.stat-next{color:#b7cbc2}
.stat-cost{
  border:1px solid rgba(139,184,164,.08);
  background:linear-gradient(180deg,#182a23,#12231c);
  box-shadow:inset 0 1px rgba(255,255,255,.025),0 3px 8px rgba(0,0,0,.1);
  transition:transform .13s ease,box-shadow .15s ease,background .15s ease;
}
.stat-upgrade-list button.can-afford .stat-cost{
  color:#d9fff0;background:linear-gradient(180deg,#214234,#173428);
  border-color:rgba(131,222,178,.15);text-shadow:0 0 8px rgba(145,255,194,.14);
  box-shadow:inset 0 1px rgba(255,255,255,.035),0 0 12px rgba(93,207,145,.045)
}
.stat-upgrade-list button.can-afford .stat-cost::first-letter{color:#fff}
.stat-description{
  position:relative;overflow:hidden;
  border-color:#3b574b;
  background:radial-gradient(circle at 94% 0,rgba(124,221,179,.045),transparent 30%),linear-gradient(180deg,#16261f,#111e19);
  box-shadow:inset 0 1px rgba(255,255,255,.03),0 -7px 20px rgba(0,0,0,.08),0 6px 15px rgba(0,0,0,.08);
}
.stat-description::after{content:"";position:absolute;right:-22px;bottom:-32px;width:90px;height:90px;border-radius:50%;border:1px solid rgba(173,224,202,.025);box-shadow:0 0 0 14px rgba(173,224,202,.01)}
.stat-description b{color:#f1faf6;letter-spacing:.025em;text-shadow:0 2px 8px rgba(0,0,0,.22)}
.stats-list-shell::after{content:"";position:absolute;left:0;right:5px;bottom:0;height:15px;pointer-events:none;background:linear-gradient(transparent,rgba(12,25,19,.75))}
.stat-upgrade-list::-webkit-scrollbar{width:4px}.stat-upgrade-list::-webkit-scrollbar-track{background:transparent}.stat-upgrade-list::-webkit-scrollbar-thumb{background:#49685a;border-radius:8px}
@media(max-width:430px){
 .stat-name .upgrade-icon{width:24px;height:24px;border-radius:7px}
 .stat-upgrade-list button{border-radius:12px!important}
}

/* Account persistence / cross-device guidance */
.account-panel{overflow:auto;padding-right:3px}
.account-persistence-status{display:grid;grid-template-columns:34px 1fr;gap:10px;align-items:start;border:1px solid #405148;border-radius:12px;padding:11px;margin:7px 0 10px;background:#121d19}
.account-persistence-status.protected{border-color:#4f8064;background:#14251c}
.account-persistence-status.local-only{border-color:#806c45;background:#251f14}
.account-status-icon{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;font-size:17px;font-weight:900;background:#26372f}
.account-persistence-status.protected .account-status-icon{background:#285d3c}
.account-persistence-status.local-only .account-status-icon{background:#674f25}
.account-persistence-status strong,.account-persistence-status small{display:block}
.account-persistence-status strong{font-size:12px;line-height:1.2}
.account-persistence-status small{margin-top:4px;color:#a8b8b0;font-size:9px;line-height:1.35}
.account-info-card,.account-flow-card{border:1px solid #31463d;border-radius:12px;background:#121f1a;padding:11px;margin:8px 0}
.account-info-card>strong,.account-flow-card>strong{font-size:12px}
.account-info-card p,.account-flow-card p,.account-flow-card li{font-size:10px;line-height:1.4;color:#a7b7af}
.account-info-card p{margin:7px 0 0}
.account-flow-card ol{margin:8px 0 5px;padding-left:20px;display:grid;gap:5px}
.account-flow-card li b{color:#edf6f1}
.account-caution{border-top:1px solid #34473f;padding-top:8px!important;margin:8px 0 0!important;color:#d5c28b!important}
.account-form-help{margin:0 0 7px}
.account-panel output{margin-top:8px}
@media(max-width:430px){
  .account-persistence-status{grid-template-columns:30px 1fr;padding:9px}
  .account-info-card,.account-flow-card{padding:9px}
}


/* Equipment inspection rarity frames */
.equipment-details{position:relative}
.equipment-detail-frame{
  position:relative;
  min-height:100%;
  padding:10px;
  border:1px solid var(--rarity,#aeb5b1);
  border-radius:13px;
  background:
    linear-gradient(145deg,color-mix(in srgb,var(--rarity,#aeb5b1) 7%,transparent),transparent 42%),
    rgba(7,14,11,.18);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb,var(--rarity,#aeb5b1) 16%,transparent),
    inset 0 0 26px color-mix(in srgb,var(--rarity,#aeb5b1) 6%,transparent);
  overflow:hidden;
}
.equipment-detail-frame::before,
.equipment-detail-frame::after{
  content:"";
  position:absolute;
  pointer-events:none;
}
.equipment-detail-frame::before{
  inset:4px;
  border:1px solid color-mix(in srgb,var(--rarity,#aeb5b1) 26%,transparent);
  border-radius:10px;
  clip-path:polygon(0 0,34% 0,34% 1px,66% 1px,66% 0,100% 0,100% 100%,66% 100%,66% calc(100% - 1px),34% calc(100% - 1px),34% 100%,0 100%);
  opacity:.72;
}
.equipment-detail-frame::after{
  width:110px;height:110px;right:-58px;bottom:-64px;border-radius:50%;
  border:1px solid color-mix(in srgb,var(--rarity,#aeb5b1) 28%,transparent);
  box-shadow:0 0 0 14px color-mix(in srgb,var(--rarity,#aeb5b1) 5%,transparent),0 0 0 29px color-mix(in srgb,var(--rarity,#aeb5b1) 3%,transparent);
}
.equipment-detail-frame>*{position:relative;z-index:1}
.equipment-level-badge{
  position:absolute;
  top:8px;
  right:9px;
  z-index:3;
  min-width:42px;
  padding:4px 7px;
  border:1px solid var(--rarity,#aeb5b1);
  border-radius:999px;
  background:rgba(7,14,11,.88);
  color:#f5fbf8;
  font-size:9px;
  font-weight:900;
  letter-spacing:.05em;
  text-align:center;
  box-shadow:0 0 12px color-mix(in srgb,var(--rarity,#aeb5b1) 18%,transparent);
}
.equipment-detail-frame .detail-head{padding-right:48px}
.equipment-detail-frame.rarity-common{--rarity:#aeb5b1}
.equipment-detail-frame.rarity-uncommon{
  --rarity:#6bd18b;
  box-shadow:inset 0 0 0 1px rgba(107,209,139,.16),inset 0 0 30px rgba(107,209,139,.07),0 0 10px rgba(107,209,139,.04);
}
.equipment-detail-frame.rarity-rare{
  --rarity:#62aaf2;
  border-width:2px;
  box-shadow:inset 0 0 0 1px rgba(98,170,242,.18),inset 0 0 34px rgba(98,170,242,.09),0 0 14px rgba(98,170,242,.08);
}
.equipment-detail-frame.rarity-epic{
  --rarity:#c47cff;
  border-width:2px;
  background:
    radial-gradient(circle at 10% 12%,rgba(196,124,255,.11),transparent 28%),
    radial-gradient(circle at 92% 86%,rgba(107,209,255,.07),transparent 26%),
    linear-gradient(145deg,rgba(196,124,255,.09),transparent 46%),
    rgba(7,14,11,.22);
  box-shadow:inset 0 0 0 1px rgba(196,124,255,.2),inset 0 0 38px rgba(196,124,255,.12),0 0 18px rgba(196,124,255,.11);
}
.equipment-detail-frame.rarity-epic::before{
  border-style:double;
  border-width:3px;
  opacity:.82;
}
.equipment-detail-frame.rarity-legendary{
  --rarity:#f4c95d;
  border-width:2px;
  background:
    radial-gradient(circle at 10% 10%,rgba(255,229,145,.15),transparent 25%),
    radial-gradient(circle at 90% 85%,rgba(244,201,93,.10),transparent 30%),
    linear-gradient(135deg,rgba(244,201,93,.12),rgba(255,134,71,.045) 38%,transparent 60%),
    rgba(10,13,8,.30);
  box-shadow:
    inset 0 0 0 1px rgba(255,226,132,.28),
    inset 0 0 44px rgba(244,201,93,.14),
    0 0 0 1px rgba(137,88,26,.25),
    0 0 22px rgba(244,201,93,.16);
}
.equipment-detail-frame.rarity-legendary::before{
  inset:5px;
  border-color:rgba(255,230,148,.48);
  box-shadow:inset 0 0 10px rgba(255,211,95,.10);
  opacity:1;
}
.equipment-detail-frame.rarity-legendary .equipment-level-badge{
  color:#fff4c9;
  background:linear-gradient(180deg,rgba(64,46,12,.96),rgba(24,20,9,.96));
  text-shadow:0 0 8px rgba(255,225,128,.35);
}
@media(max-width:430px){
  .equipment-detail-frame{padding:8px;border-radius:11px}
  .equipment-detail-frame::before{inset:3px;border-radius:8px}
  .equipment-level-badge{top:6px;right:7px;font-size:8px;padding:3px 6px}
  .equipment-detail-frame .detail-head{padding-right:44px}
}

/* Deep puzzle relic rewards */
.relic-detail{display:grid;gap:9px}
.relic-target{border:1px solid #674f7a;background:#20172a;border-radius:10px;padding:9px 10px;color:#efc8ff;font-size:11px;font-weight:900;letter-spacing:.04em}
.relic-part-cell{border-color:#684f78;background:#1b1521}
.relic-part-cell.selected{outline-color:#e1b5ff;background:#2b1d35}
.relic-part-cell .cell-level{color:#d8b7e8}


