#inventory{width:640px;max-width:calc(100vw - 20px);padding:12px;background:#191336;border:1px solid #b5a3ed;color:#f4efff;overflow:auto}#inventory .tw-dismiss{display:block;margin-left:auto;font-size:12px}.tw-stats{font-size:11px;line-height:1.9;margin:6px 0 12px}.tw-windows{display:flex;gap:16px;justify-content:center;align-items:flex-start}.tw-equipment{width:197px;height:370px;background:url('assets/ui/1558-0000.png');flex-shrink:0;image-rendering:pixelated;position:relative}.tw-inventory{width:345px;height:400px;background:url('assets/ui/1681-0000.png');flex-shrink:0;image-rendering:pixelated;position:relative}#equipment{position:absolute;left:6px;top:26px}.tw-equip-row{display:block;width:184px;height:31px;border:0;border-radius:0;background:transparent;padding:0;position:relative;text-align:left;color:#fff;font:11px 'Microsoft JhengHei'}.tw-equip-row:hover{background:#d3bdff33}.tw-equip-row img{width:24px;height:24px;position:absolute;top:0;left:0;object-fit:contain;image-rendering:pixelated}.tw-equip-row span{position:absolute;left:34px;top:0;max-width:145px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:14px;background:#403879;color:white}#items{position:absolute;left:8px;top:40px;width:329px;height:306px;overflow:auto;scrollbar-width:thin;scrollbar-color:#aaa0d4 #39316c}.tw-item-row{display:flex;align-items:center;width:314px;height:25px;border:0;border-radius:0;background:transparent;padding:0;color:#fff;font:11px 'Microsoft JhengHei';text-align:left;gap:9px}.tw-item-row:hover,.tw-item-row:focus{background:#d3bdff44}.tw-item-row img{width:24px;height:24px;object-fit:contain;image-rendering:pixelated}.tw-item-row span{width:217px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tw-item-row small{width:53px;text-align:center}.tw-item-row[data-rarity="1"] span{color:#b9e5ff}.tw-item-row[data-rarity="2"] span{color:#ffe597}.tw-inventory>span{position:absolute;top:377px;font-size:11px;line-height:16px}#capacity{left:38px}#tw-weight{left:139px}#tw-seed{left:218px}.tw-details{background:#302755;border:1px solid #756397;padding:10px;margin-top:12px;font-size:11px;display:flex;gap:8px;flex-wrap:wrap;align-items:center}.tw-details p{width:100%;line-height:1.8;margin:0 0 5px}.tw-details button,.tw-details select{font:11px 'Microsoft JhengHei';padding:7px;background:#51417c;color:#fff}.tw-note{font-size:10px;line-height:1.8;color:#b8aed5}.roster-actions{display:flex;gap:12px;justify-content:flex-end;margin-top:15px}.roster-actions button{font-size:12px;padding:10px 15px}#creation{max-width:calc(100vw - 12px);width:max-content;padding:12px;background:#151b35;border-color:#8d82b5;overflow:auto}#creation .dialog-head{margin-bottom:10px}#creation-shell{position:relative}#creation-frame{width:800px;height:600px;background:url('assets/ui/0162-0000.png');position:relative;transform-origin:top left;font-family:'Microsoft JhengHei';color:white}#creation-sprite{position:absolute;left:162px;top:82px;width:126px;height:155px;display:grid;place-items:center}#creation-sprite canvas{width:120px;height:156px;image-rendering:pixelated}#creation-portrait{position:absolute;left:401px;top:100px;width:142px;height:142px;object-fit:contain;image-rendering:pixelated}#creation-prev,#creation-next{position:absolute;top:143px;width:41px;height:39px;border:0;background:transparent;padding:0;color:#63588a;font-size:20px}#creation-prev{left:91px}#creation-next{left:317px}#creation-role{position:absolute;top:246px;left:142px;width:166px;text-align:center;font-size:16px}#creation-frame .creation-style{position:absolute;top:337px;left:139px;width:181px;height:83px;display:flex;flex-direction:column;text-align:center;justify-content:center;font-size:15px;line-height:1.7}.creation-style span{font-size:13px}.creation-style small{font-size:11px}.creation-name-label{position:absolute;left:159px;top:453px;font-size:16px;background:#7278c4}#creation-name{position:absolute;left:137px;top:479px;width:186px;height:24px;background:transparent;border:0;color:#211943;font:14px 'Microsoft JhengHei';padding:0 3px;box-sizing:border-box}#creation-stat{position:absolute;left:451px;top:305px;width:207px;height:195px;background:#7976bd;border-radius:14px;padding:12px 15px;font-size:13px;box-sizing:border-box}#creation-stat>div{display:flex;justify-content:space-between;gap:8px;line-height:27px}#creation-stat b{font-size:12px;font-weight:400}#creation-description{position:absolute;top:524px;left:87px;width:454px;margin:0;font-size:12px;line-height:1.7}#confirm-create{position:absolute;left:575px;top:136px;width:120px;height:39px;color:white;background:#504385e8;border:1px solid #d6d0f0;font:16px 'Microsoft JhengHei'}#creation-error{color:#ffbdba;font-size:12px;max-width:600px;line-height:1.8}#creation .dialog-note{max-width:700px}#characters{width:780px}#characters #character-list{grid-template-columns:repeat(3,1fr)}.build{overflow:hidden;max-height:42px}.player h3{max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:610px){.tw-windows{flex-direction:row;align-items:flex-start;gap:8px}#inventory{max-height:calc(100svh - 20px)}#characters #character-list{grid-template-columns:repeat(2,1fr)}.roster-actions{flex-wrap:wrap}.roster-actions button{flex:1}.player h3{max-width:110px}.tw-details{position:sticky;bottom:0}#creation .dialog-head h2{font-size:16px}}
@media(max-height:600px) and (orientation:landscape){#characters #character-list{grid-template-columns:repeat(3,1fr)}#creation{max-height:98svh}#creation .dialog-note{display:none}}

#creation{max-height:calc(100svh - 20px)}

#creation-mobile{display:none}
@media(max-width:599px){#creation-mobile{display:flex;flex-direction:column;gap:10px;padding:12px 5px;font-size:13px}#creation-mobile .mobile-role-arrows{display:flex;justify-content:space-between;gap:12px}#creation-mobile button{padding:10px 16px;font-size:14px}#creation-name.mobile-creation-name{position:static;width:100%;height:42px;background:#fff;color:#211943;border:1px solid #a8a0d3;border-radius:5px;font-size:16px;padding:8px}#confirm-create{display:none}#creation .dialog-note{font-size:10px}.creation-name-label{display:none}}


#creation-form{position:relative;height:100%}#creation-frame{position:absolute;left:0;top:0}#creation-mobile{position:absolute;left:0;right:0}

#inventory-categories{position:absolute;left:9px;top:351px;display:flex;gap:9px}#inventory-categories button{width:74px;height:21px;padding:0 0 0 22px;border:0;border-radius:0;color:white;font:11px 'Microsoft JhengHei';background:var(--tab-art) left center/74px 21px no-repeat;text-shadow:1px 1px #332461;image-rendering:pixelated}#inventory-categories button[aria-pressed=true],#inventory-categories button:hover{background-image:var(--tab-active);color:#fff5bd}#inventory-categories button:focus-visible{outline:1px solid #fff0bb}

/* Keep original equipment/item art side by side, with readable 24px icons. */
@media(max-width:610px){
 #inventory{width:calc(100vw - 16px);max-width:calc(100vw - 16px);padding:8px;box-sizing:border-box}
 #inventory .tw-windows{display:grid;grid-template-columns:minmax(0,.37fr) minmax(0,.63fr);gap:6px;width:100%;min-width:0}
 #inventory .tw-equipment,#inventory .tw-inventory{width:100%;min-width:0;zoom:1;background-size:100% 100%;background-repeat:no-repeat}
 #inventory .tw-equipment{height:400px}
 #inventory #equipment{left:4px;right:4px;top:28px}
 #inventory .tw-equip-row{width:100%;height:33px;min-width:0}
 #inventory .tw-equip-row span{left:27px;right:0;max-width:none;font-size:10px;line-height:15px;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
 #inventory #items{left:5px;right:5px;top:40px;width:auto;height:306px}
 #inventory .tw-item-row{width:100%;height:34px;gap:3px;min-width:0}
 #inventory .tw-item-row img{flex:0 0 24px}
 #inventory .tw-item-row span{flex:1;width:auto;min-width:0;font-size:11px}
 #inventory .tw-item-row small{flex:0 0 18px;width:18px;font-size:10px}
 #inventory #inventory-categories{left:4px;right:4px;gap:2px}
 #inventory #inventory-categories button{flex:1;min-width:0;width:auto;padding:0;font-size:10px;background-size:100% 21px}
 #inventory #capacity{left:10%;font-size:10px}#inventory #tw-weight{left:42%}#inventory #tw-seed{left:64%;font-size:10px}
 #inventory .tw-details{position:static;padding:7px;gap:6px}
 #inventory .tw-details label{min-width:0;max-width:100%}
 #inventory .tw-details select{max-width:100%}
}
