/* Shared window frame. Values refer to the scaled UI viewport. */
#uiShell{--window-gap:20px;--window-pad:20px;--window-width:760px;--window-height:660px;--window-surface:#1d2c28;--window-card:#162720;--window-line:#9fb48b30}
#uiShell .modal-shade{padding:max(var(--window-gap),var(--hud-safe-top,0px)) max(var(--window-gap),var(--hud-safe-right,0px)) max(var(--window-gap),var(--hud-safe-bottom,0px)) max(var(--window-gap),var(--hud-safe-left,0px));display:flex;align-items:center;justify-content:center;overflow:hidden;background:#0d1b17c9;backdrop-filter:none;-webkit-backdrop-filter:none}
#uiShell .modal[data-panel]{display:flex;flex-direction:column;width:min(var(--window-width),100%);height:min(var(--window-height),calc(var(--ui-height,100dvh) - var(--window-gap)*2));max-height:calc(var(--ui-height,100dvh) - var(--window-gap)*2);max-width:100%;min-height:0;padding:0;overflow:hidden;border:1px solid #9fb48b55;border-radius:10px;background:var(--window-surface);box-shadow:0 16px 50px #05120c70;scroll-padding:0}
#uiShell .modal[data-panel] .modal-header{position:static;flex:none;display:flex;align-items:flex-start;justify-content:space-between;min-width:0;gap:16px;margin:0;padding:var(--window-pad);border:0;border-bottom:1px solid var(--window-line);background:var(--window-surface)}
#uiShell .modal-header>div:first-child{min-width:0;flex:1}
#uiShell .modal[data-panel] .modal-header .eyebrow{font-size:9px;line-height:1.4;letter-spacing:1.6px}
#uiShell .modal[data-panel] .modal-header h2{font-size:25px;line-height:1.2;margin:5px 0 0;overflow-wrap:anywhere}
#uiShell .modal[data-panel] .modal-header p{font-size:12px;line-height:1.5;color:#a9b99f;margin:8px 0 0;max-width:560px}
#uiShell .modal-title-actions{display:flex;align-items:center;gap:10px;flex:none}
#uiShell .modal[data-panel] .close-button,#uiShell .fitting-back-compact{display:grid;place-items:center;width:44px;height:44px;min-height:44px;flex:none;margin:0;padding:0;border:1px solid var(--window-line);border-radius:6px;background:#14251e;color:#eee9d5;font-size:24px}
#uiShell .panel-body{flex:1;min-height:0;min-width:0;padding:var(--window-pad);overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin;scrollbar-color:#6a805e #15271f;scroll-padding:16px}
#uiShell .panel-body> :first-child{margin-top:0}#uiShell .panel-body> :last-child{margin-bottom:0}
#uiShell .panel-body :is(.primary,.secondary,.danger-button){min-height:44px;padding:10px 14px;font-size:12px;line-height:1.35;border-radius:6px;box-shadow:none}
#uiShell .panel-body .primary{background:#ec9d55;color:#19291f;border:1px solid #f2b574;font-weight:700}
#uiShell .panel-body .secondary{background:#2a4031;border:1px solid #91a57650;color:#dce3c9}
#uiShell .panel-body button:focus-visible,#uiShell .modal-header button:focus-visible{outline:2px solid #f3bf83;outline-offset:-3px}
#uiShell .panel-body button:disabled{opacity:.45}
#uiShell .panel-body :is(p,.small-note,.shop-note,.inventory-note,.lobby-note){font-size:12px;line-height:1.6}
#uiShell .panel-body .field{min-width:0;display:flex;flex-direction:column;gap:7px;margin:0 0 16px;font-size:12px;line-height:1.4}
#uiShell .panel-body :is(input,select){width:100%;min-width:0;max-width:100%;min-height:44px;padding:11px 12px;border:1px solid #91a57650;border-radius:6px;background:#12231c;color:#eee9d5;font-size:16px}
#uiShell .panel-body input::placeholder{font-size:12px;color:#839b7d}
#uiShell .panel-body form>.primary.large{width:100%;min-width:0;min-height:44px;padding:12px 16px;font-size:13px}
#uiShell .panel-body .form-error:empty{display:none}
#uiShell .panel-body .section-label{margin:18px 0 9px;font-size:10px;line-height:1.4;letter-spacing:1px;gap:10px;flex-wrap:wrap}
#uiShell .panel-body .section-label>span{font-size:10px;letter-spacing:0}
#uiShell .create-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:16px 0}
#uiShell .create-facts>span{min-width:0;padding:10px;border:1px solid var(--window-line);border-radius:6px;background:var(--window-card);font-size:16px;line-height:1.3}
#uiShell .create-facts strong{font-size:10px;line-height:1.4;margin-top:6px}
#uiShell .quality-setting,#uiShell .sound-setting,#uiShell #installDock{padding:16px;margin:0 0 12px;border:1px solid var(--window-line);border-radius:7px;background:var(--window-card)}
#uiShell .quality-setting .field{margin:0 0 10px;max-width:none}
#uiShell .sound-setting{display:flex;align-items:center;justify-content:space-between;gap:14px}
#uiShell .sound-setting h3{font-size:15px;margin:0 0 5px;color:#e5c697}
#uiShell .sound-setting p,#uiShell .quality-setting p{margin:0;font-size:12px;line-height:1.6}
#uiShell #installDock p{margin:9px 0 0;font-size:11px}
#uiShell .help-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
#uiShell .help-grid section{min-width:0;padding:14px;background:var(--window-card);border:1px solid var(--window-line);border-radius:7px}
#uiShell .help-grid h3{margin:0 0 8px;font-size:15px;color:#e5c697}
#uiShell .help-grid p{margin:0;font-size:12px;line-height:1.65}
#uiShell .lobby{position:static;inset:auto;width:100%;height:auto;padding:0;overflow:visible;background:none;backdrop-filter:none;-webkit-backdrop-filter:none}
#uiShell .lobby-tools{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;margin:0 0 16px;align-items:stretch}
#uiShell .search-field{grid-column:1/-1;min-width:0;max-width:none;padding:0 12px;min-height:44px;border-radius:6px;background:#12231c;border:1px solid #91a57650}
#uiShell .search-field input{border:0;padding:10px 0;background:none;font-size:14px;min-height:42px}
#uiShell .search-field input::placeholder{font-size:13px}
#uiShell .room-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start}
#uiShell .room-art{height:64px}#uiShell .room-card{border-radius:7px;border-color:var(--window-line);background:var(--window-card)}
#uiShell .room-card-body{padding:14px}#uiShell .room-card h3{font-size:17px;line-height:1.35;overflow-wrap:anywhere}#uiShell .room-card footer{flex-wrap:wrap;gap:10px;margin-top:14px}
#uiShell .empty-lobby{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:220px;gap:12px;padding:24px 18px;border:1px dashed #91a57650;border-radius:7px;background:#16272088;text-align:center}
#uiShell .empty-lobby>span{font-size:30px;margin:0;color:#94ac80}#uiShell .empty-lobby strong{font-size:20px;line-height:1.3}#uiShell .empty-lobby p{margin:0;max-width:450px}
#uiShell .lobby-note{color:#94a98e;margin:16px 0 0}
#uiShell .account-hero{margin:0 0 16px;border-radius:7px;border-color:var(--window-line);background:var(--window-card)}
#uiShell .account-footer,#uiShell .collection-footer{margin-top:16px;padding-top:14px;border-top:1px solid var(--window-line);gap:12px}
#uiShell .account-footer p,#uiShell .collection-footer p{font-size:11px;line-height:1.5}
#uiShell .account-avatar{width:155px;height:170px}#uiShell .account-identity h3{font-size:19px}#uiShell .account-edit{font-size:12px}
#uiShell .account-weapon{margin:14px 0 0;border-color:var(--window-line);border-radius:7px}#uiShell .fitting-display{border-color:var(--window-line);border-radius:7px;background:var(--window-card)}
#uiShell .market-showroom .market-empty h3{font-size:22px}#uiShell .market-stock-empty{border-radius:6px}
#uiShell .beast-card{border-color:var(--window-line);border-radius:7px;background:var(--window-card);padding:12px;min-height:120px}#uiShell .beast-card p{font-size:11px}
#uiShell .shop-heading{position:static;flex:none;top:auto;padding:0;margin:0;background:var(--window-surface)}
#uiShell .shop-heading .tabs{padding:8px var(--window-pad);border-bottom:1px solid var(--window-line);margin:0;gap:8px}
#uiShell .shop-heading .tabs button{min-height:44px;border:1px solid transparent;border-radius:6px;font-size:12px}#uiShell .shop-heading .tabs button.active{background:#e5a65c1f;border-color:#e5a65c77;color:#f2bd7f}
#uiShell .intro-copy{align-content:start}#uiShell .intro-tags{align-items:center;align-self:start}#uiShell .intro-tags span{height:auto;min-height:0;align-self:start}
@media(max-width:700px){
 #uiShell{--window-gap:12px;--window-pad:16px;--window-height:700px}
 #uiShell .modal[data-panel] .modal-header{gap:10px}#uiShell .modal[data-panel] .modal-header h2{font-size:22px}
 #uiShell .modal[data-panel] .modal-header .eyebrow{font-size:8px;letter-spacing:1.4px}#uiShell .modal[data-panel] .modal-header p{font-size:11px;margin-top:7px}
 #uiShell .help-grid,#uiShell .room-list{grid-template-columns:1fr}#uiShell .lobby-tools{grid-template-columns:1fr 1fr;gap:7px}#uiShell #createFromLobby{grid-column:1/-1}
 #uiShell .empty-lobby{min-height:220px;padding:20px 12px}#uiShell .empty-lobby strong{font-size:18px}
 #uiShell .account-avatar{width:118px;height:140px}#uiShell .account-hero{gap:16px;padding:10px}#uiShell .account-identity h3{font-size:16px}#uiShell .account-edit{font-size:11px}
 #uiShell .account-footer{flex-direction:column;align-items:stretch}#uiShell .account-footer p{max-width:none;text-align:center}#uiShell .account-footer button{width:100%}
 #uiShell .fitting-room,#uiShell .market-showroom{grid-template-columns:1fr;gap:16px}#uiShell .bestiary-grid{grid-template-columns:1fr;gap:8px}#uiShell .beast-card{min-height:106px}#uiShell .create-facts>span{padding:8px}
}
@media(max-height:500px) and (orientation:landscape){
 #uiShell{--window-gap:10px;--window-pad:14px}#uiShell .modal[data-panel] .modal-header h2{font-size:21px}
 #uiShell .modal[data-panel] .modal-header p{font-size:11px;line-height:1.4;margin-top:5px}#uiShell .modal[data-panel] .modal-header .eyebrow{font-size:8px}
 #uiShell #createForm,#uiShell #joinForm{display:grid;grid-template-columns:1fr 1fr;gap:12px}#uiShell #createForm>.field,#uiShell #joinForm>.field{margin:0}
 #uiShell #createForm>.field:first-child,#uiShell form>.primary.large,#uiShell form>.small-note,#uiShell form>.form-error,#uiShell .create-facts{grid-column:1/-1}
 #uiShell .create-facts{margin:0}#uiShell .create-facts>span{display:flex;align-items:center;gap:8px;padding:8px}#uiShell .create-facts strong{margin:0}#uiShell form>.small-note{margin:0;font-size:11px}
 #uiShell .help-grid,#uiShell .room-list,#uiShell .bestiary-grid{grid-template-columns:1fr 1fr}
 #uiShell .lobby-tools{grid-template-columns:minmax(180px,1fr) auto auto auto}#uiShell .search-field,#uiShell #createFromLobby{grid-column:auto}
 #uiShell .empty-lobby{min-height:150px;padding:18px;gap:8px}#uiShell .empty-lobby>span{display:none}#uiShell .empty-lobby strong{font-size:18px}
 #uiShell .fitting-room,#uiShell .market-showroom{grid-template-columns:minmax(180px,.8fr) minmax(0,1.2fr)}
 #uiShell .account-avatar{width:116px;height:132px}#uiShell .account-identity h3{font-size:15px}#uiShell .account-edit{font-size:11px}#uiShell .account-hero{gap:14px}#uiShell .account-footer{flex-direction:row}#uiShell .beast-card{min-height:112px}
}
@media(max-width:350px){#uiShell{--window-gap:8px;--window-pad:12px}#uiShell .modal[data-panel] .modal-header h2{font-size:20px}#uiShell .account-avatar{width:92px;height:116px}#uiShell .account-hero{gap:13px;padding:8px}#uiShell .account-edit{font-size:10px}#uiShell .account-identity h3{font-size:14px}#uiShell .create-facts strong{font-size:9px}}

#uiShell .panel-body .primary:hover{background:#f5af70}#uiShell .panel-body .secondary:hover{background:#354e3b}
#uiShell .panel-body .sticky-actions{bottom:calc(0px - var(--window-pad));background:var(--window-surface);border-top:1px solid var(--window-line)}
#uiShell .death-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0 0 20px}
#uiShell .death-stats>div{padding:18px 8px;text-align:center;background:var(--window-card);border:1px solid var(--window-line);border-radius:7px}
#uiShell .death-stats strong{font-size:28px}#uiShell .death-stats span{font-size:9px;line-height:1.5}

/* Keep mobile text metrics and the inventory header stable during live updates. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
#uiShell .modal[data-panel="inventory"] .inventory-points-summary{display:grid;grid-template-rows:18px 18px;gap:0;height:36px;min-height:36px;line-height:18px;font-size:11px}
#uiShell .inventory-points-line,#uiShell .inventory-level-bonus{display:block;white-space:nowrap;line-height:18px}
#uiShell #inventoryPoints{display:inline-block;min-width:4ch;font-weight:700;font-variant-numeric:tabular-nums}
#uiShell .inventory-level-bonus{color:#8fa58a}
#uiShell .modal[data-panel="inventory"] .panel-body{scrollbar-gutter:stable}

/* Arsenal: bounded touch controls and three sockets per weapon, at every UI scale. */
.arsenal-icon{display:block;width:100%;height:100%;max-height:64px;object-fit:contain}.gear-icon .arsenal-icon{min-width:44px}
.module-slots{display:flex;align-items:center;gap:5px;margin-top:7px;flex-wrap:wrap}.module-slot{width:28px;height:28px;display:grid;place-items:center;border:1px dashed #788563;border-radius:4px;color:#788563}.module-slot.filled{border-style:solid;background:#303f30}.module-slots button{font-size:11px;min-height:32px;padding:5px 8px}.chip-summary{font-size:12px;color:#b9c5a6;line-height:1.5;margin:12px 0}.gear-row{align-items:center}.gear-info{min-width:0}.gear-info>span{overflow-wrap:anywhere}
.throwable-belt{position:absolute;left:calc(var(--safe-left,0px) + 76px);bottom:160px;display:flex;flex-direction:column;gap:6px;pointer-events:auto}.throwable-belt .quick-potion{width:48px;height:48px;min-height:48px;padding:3px}.throwable-belt img{width:36px;height:30px;object-fit:contain}.throwable-belt small{font-size:8px}.throwable-belt b{position:absolute;right:3px;top:3px;font-size:11px}
#throwHint{position:absolute;left:50%;top:24%;transform:translateX(-50%);width:min(300px,80%);padding:9px;background:#162b24ed;border:1px solid #c39761;border-radius:6px;display:flex;align-items:center;gap:8px;font-size:12px;pointer-events:auto}#throwHint.hidden{display:none}#throwHint button{padding:6px;min-height:36px;font-size:12px}#ammoText{position:absolute;left:50%;bottom:78px;transform:translateX(-50%);font-size:10px;color:#d5d4b9;background:#1c302466;padding:2px 6px;border-radius:4px;pointer-events:none}
@media(max-width:600px){.throwable-belt{left:70px;bottom:calc(144px + env(safe-area-inset-bottom,0px))}#ammoText{bottom:70px}}
@media(orientation:landscape) and (max-height:600px){.throwable-belt{left:calc(60px + env(safe-area-inset-left,0px));bottom:116px;gap:4px}.throwable-belt .quick-potion{width:44px;height:44px;min-height:44px}#ammoText{bottom:58px}.module-slots{margin-top:4px}}

/* Mobile consumables: grenades above healing, entirely outside the movement stick. */
@media (max-width:700px), (pointer:coarse) {
 .throwable-belt{left:max(12px,env(safe-area-inset-left));bottom:calc(env(safe-area-inset-bottom) + 330px);flex-direction:row;gap:6px}
 .throwable-belt .quick-potion{width:44px;min-width:44px;height:44px;min-height:44px}
 #potionCooldown{top:auto;bottom:0;left:50px}
}
@media (orientation:landscape) and (max-height:600px) {
 .potion-belt{left:max(10px,env(safe-area-inset-left));top:auto;bottom:calc(env(safe-area-inset-bottom) + 172px);gap:6px}
 .potion-belt .quick-potion{width:44px;min-width:44px;height:44px;min-height:44px}
 .throwable-belt{left:max(10px,env(safe-area-inset-left));bottom:calc(env(safe-area-inset-bottom) + 274px);flex-direction:row;gap:6px}
 .throwable-belt .quick-potion{width:44px;min-width:44px;height:44px;min-height:44px}
 .playing .fps-counter{left:112px;top:12px;max-width:none;white-space:nowrap}
}
@media (orientation:landscape) and (max-height:380px) {
 .potion-belt{bottom:calc(env(safe-area-inset-bottom) + 150px);flex-direction:row}
 .throwable-belt{bottom:calc(env(safe-area-inset-bottom) + 202px)}
 .touch-stick{bottom:calc(env(safe-area-inset-bottom) + 56px)}
}
#classStatus{position:absolute;right:max(12px,env(safe-area-inset-right));bottom:90px;font-size:10px;color:#d1cda8;background:#1b302466;border-radius:4px;padding:3px 7px;pointer-events:none}
.module-slots{flex-wrap:wrap}.module-slots>small{flex-basis:100%;font-size:10px;color:#aebd9c}
.module-slot svg{width:24px;height:24px}
.gear-info>span{overflow-wrap:anywhere}
@media(orientation:landscape) and (max-height:600px){#classStatus{bottom:68px;font-size:9px}}

/* Field guide: one window, three compact chapters, no sideways mobile scroll. */
#uiShell .guide-help-button{display:grid;place-items:center;width:44px;height:44px;flex:none;border:1px solid #e5a65c77;border-radius:6px;background:#e5a65c18;color:#f2bd7f;font-size:22px;font-weight:700}
#uiShell .guide-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:16px}
#uiShell .guide-nav button[aria-pressed="true"]{background:#e5a65c26;border-color:#e5a65c99;color:#ffd19a}
#uiShell .guide-return{font-size:12px;min-height:44px;margin:-8px 0 8px;padding:8px 0;color:#e9bc81}
#uiShell .guide-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:16px}
#uiShell .guide-facts>div{background:var(--window-card);border:1px solid var(--window-line);border-radius:7px;padding:14px 8px;text-align:center}
#uiShell .guide-facts strong{display:block;color:#f2bd7f;font-size:22px;line-height:1.2;margin-bottom:7px}
#uiShell .guide-facts span{font-size:11px;line-height:1.5;color:#a9b99f}
#uiShell .guide-section{padding:14px;margin-bottom:14px;border:1px solid var(--window-line);border-radius:7px;background:var(--window-card)}
#uiShell .guide-section h3,#uiShell .module-guide h3{font-size:15px;line-height:1.35;margin:0 0 8px;color:#e5c697}
#uiShell .guide-section p{margin:8px 0 0}
#uiShell .loot-table{width:100%;border-collapse:collapse;margin-top:12px;font-size:12px;table-layout:fixed}
#uiShell .loot-table th,#uiShell .loot-table td{padding:11px 5px;border-bottom:1px solid var(--window-line);text-align:right;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#uiShell .loot-table th:first-child{width:47%;text-align:left}
#uiShell .loot-table thead{color:#a9b99f;font-size:11px}
#uiShell .rarity-label{color:var(--rarity);font-weight:600}.rarity-label i{display:inline-block;width:6px;height:6px;background:var(--rarity);margin-right:7px;transform:rotate(45deg)}
#uiShell .guide-details{margin-top:8px;font-size:12px}#uiShell .guide-details summary{min-height:44px;display:flex;align-items:center;cursor:pointer;color:#e5c697}#uiShell .guide-details summary::before{content:'+';margin-right:8px}#uiShell .guide-details[open] summary::before{content:'−'}
#uiShell .module-guide{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:14px}
#uiShell .module-guide-card{padding:14px;background:var(--window-card);border:1px solid var(--window-line);border-radius:7px;min-width:0}
#uiShell .module-guide-card header{display:flex;align-items:center;gap:10px;margin-bottom:10px}#uiShell .module-guide-card img{width:54px;height:46px;object-fit:contain;flex:none}#uiShell .module-guide-card h3{margin:0;font-size:14px}
#uiShell .module-guide-card p{margin:8px 0 0}#uiShell .module-total{color:#d1dcb8}#uiShell .module-note{color:#91a88c;font-size:11px}
@media(max-width:700px){#uiShell .module-guide{grid-template-columns:1fr}#uiShell .guide-facts strong{font-size:19px}#uiShell .guide-facts span{font-size:10px}#uiShell .guide-section{padding:12px}#uiShell .loot-table{font-size:11px}#uiShell .loot-table th,#uiShell .loot-table td{padding:11px 2px}#uiShell .rarity-label i{margin-right:5px}}
@media(orientation:landscape) and (max-height:500px){#uiShell .module-guide{grid-template-columns:1fr 1fr}}
#uiShell .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
/* Both journals share one frame; seasonal entries never replace ordinary art. */
#uiShell .bestiary-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:0 0 12px}
#uiShell .bestiary-tabs button{display:flex;justify-content:center;align-items:center;gap:8px;min-width:0;min-height:44px;font-size:12px;line-height:1.3}
#uiShell .bestiary-tabs .active{background:#e5a65c1a;border-color:#d99e5f99;color:#f2bd7f}
#uiShell .bestiary-badge{display:grid;place-items:center;flex:none;min-width:20px;height:20px;border-radius:5px;background:#eaa15e;color:#19291f;font-size:10px;font-weight:700;padding:0 4px}
#uiShell .bestiary-intro{margin:0 0 14px;color:#a9b99f}
#uiShell .bestiary-reward-note{padding:12px;margin:0 0 14px;border:1px solid #d99e5f44;border-radius:7px;background:#bf8b4020}
#uiShell .bestiary-reward-note p{margin:0 0 5px;font-size:11px}
#uiShell .bestiary-reward-note strong{color:#f2bd7f}
#uiShell .bestiary-reward-note small{display:block;font-size:10px;line-height:1.5;color:#aab99f}
#uiShell .bestiary-feedback:empty{display:none}
#uiShell .bestiary-feedback{margin:0 0 12px;font-size:11px;color:#e8bd80}
#uiShell .beast-card .bestiary-claim{display:flex;align-items:center;justify-content:center;gap:6px;margin-top:10px;min-height:44px;width:100%;max-width:200px;padding:8px;font-size:11px;border-color:#e1a35877;background:#9e783527;color:#f2bd7f}
#uiShell .beast-card .bestiary-claim img,#uiShell .beast-card .bestiary-claimed img{width:20px;height:20px;object-fit:contain;flex:none}
#uiShell .bestiary-claimed{display:flex;align-items:center;gap:6px;min-height:44px;margin-top:10px;color:#9cb58c;font-size:10px}
@media(max-width:400px){#uiShell .bestiary-tabs button{font-size:11px;padding:9px 6px;gap:5px}#uiShell .bestiary-badge{min-width:18px;height:18px;font-size:9px}}
