:root{color-scheme:dark;--ink:#eee0bf;--gold:#b49a65;--panel:rgba(27,29,25,.87)}*{box-sizing:border-box}body{margin:0;background:#1d2524;color:var(--ink);font-family:Georgia,'Times New Roman',serif;overflow:hidden}button{font-family:inherit;color:inherit;cursor:pointer;touch-action:manipulation}button:focus-visible,canvas:focus-visible{outline:2px solid #f1d196;outline-offset:4px}#game{position:relative;width:100%;height:100dvh;min-height:360px;overflow:hidden}canvas{display:block;width:100%;height:100%;outline:none!important;touch-action:none}#loading{position:absolute;inset:0;display:grid;place-items:center;background:#1d2524;font-size:28px;z-index:10}.hud{position:absolute;top:24px;left:25px;right:25px;display:flex;align-items:flex-start;justify-content:space-between;gap:24px;pointer-events:none;text-shadow:0 2px 3px #000}.vitals{display:flex;align-items:center;width:335px;gap:8px}.portrait{width:59px;height:64px;display:grid;place-items:center;border:2px solid var(--gold);border-radius:45%;background:var(--panel);font-size:38px;box-shadow:0 2px 5px #171915}.vital-body{flex:1}.health-frame{height:22px;border:2px solid #b5a077;outline:2px solid #292b27;background:#49231e;position:relative}.health-frame #health-fill{height:100%;width:100%;background:linear-gradient(#c84837,#9c271f);transition:width .15s}.health-frame span{position:absolute;inset:0;text-align:center;font:14px/18px Georgia}.stats{display:flex;justify-content:space-between;gap:9px;font-size:13px;margin-top:8px;color:#e2d8c4}.brand{position:absolute;left:50%;transform:translateX(-50%);text-align:center;min-width:180px;padding:0 20px;background:linear-gradient(90deg,transparent,rgba(24,29,26,.7),transparent)}h1{font-weight:400;font-size:30px;margin:0;letter-spacing:1px}.ornament{font-size:15px;color:var(--gold);line-height:24px}.quest{width:270px;background:linear-gradient(90deg,var(--panel),rgba(27,29,25,.48));padding:12px 17px;border-top:1px solid var(--gold);border-bottom:1px solid #837651}.quest h2{font-size:19px;font-weight:400;color:#ead29c;margin:0 0 9px}.quest h2 span{color:#e9b453;padding-right:8px}.quest p{font-size:14px;line-height:1.5;margin:0}.quest #quest-progress{font-size:13px;color:#bfbca8;margin-top:5px}.location{position:absolute;left:50%;transform:translateX(-50%);top:92px;text-shadow:0 2px 4px #000;font-size:14px;color:#f0e6ce;letter-spacing:1px}.message{position:absolute;bottom:163px;left:50%;transform:translateX(-50%);text-align:center;max-width:560px;width:max-content;background:var(--panel);border:1px solid #8a7b5b;border-radius:2px;padding:11px 20px;font-size:15px;line-height:1.5;pointer-events:none}.bottom{position:absolute;bottom:15px;left:50%;transform:translateX(-50%);text-align:center;max-width:100%;width:max-content}.actions{display:flex;justify-content:center;gap:9px;margin-bottom:16px}.actions button{position:relative;display:grid;place-items:center;width:65px;height:66px;background:linear-gradient(135deg,#34362e,#181e1c);border:2px solid #ad9463;box-shadow:0 0 0 2px #22251e,0 4px 10px #0005;border-radius:3px;transition:filter .15s,transform .15s}.actions button:hover{filter:brightness(1.3);transform:translateY(-2px)}.actions button:active{transform:translateY(1px)}.actions svg{height:42px;width:42px}.actions kbd{position:absolute;bottom:-10px;left:50%;transform:translateX(-50%);border-radius:4px;background:#242822;border:1px solid #b69d6b;font:14px Georgia;padding:2px 6px}.talk-symbol{font-size:38px;color:#edd191}.quantity{position:absolute;right:5px;bottom:5px;font-size:15px}.help>*{white-space:nowrap}.help{display:flex;flex-wrap:wrap;justify-content:center;gap:4px 16px;font-size:13px;text-shadow:0 1px 3px #000;background:#1d2524aa;padding:8px 12px;border-radius:2px}.help kbd{font-family:inherit;color:#e6d0a0;margin-right:4px}.utility{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px 10px;margin-top:8px;color:#d5cebb;font:12px system-ui,sans-serif;text-shadow:0 1px 3px #000}.utility>*{white-space:nowrap}.utility button{border:0;border-bottom:1px solid #928366;background:#1d252480;padding:3px 5px;font:13px system-ui,sans-serif}dialog{background:#222b27;color:var(--ink);border:1px solid var(--gold);padding:32px;text-align:center;max-width:90%}dialog::backdrop{background:#10161299}dialog h2{font-weight:400}dialog button{background:#aa8b52;border:0;color:#17201b;padding:12px 20px;font-size:15px}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:800px){.hud{top:14px;left:12px;right:12px;gap:10px}.vitals{width:215px}.portrait{width:42px;height:48px;font-size:29px}.stats{font-size:11px;gap:4px}.brand{top:63px}h1{font-size:25px}.quest{width:205px;padding:8px 10px}.quest h2{font-size:16px}.quest p{font-size:13px}.location{top:129px;font-size:12px}.help{display:none}.message{bottom:153px;font-size:14px;max-width:calc(100% - 28px);width:max-content;padding:9px 12px}.bottom{bottom:15px}.utility{flex-wrap:wrap;gap:8px}.actions{gap:7px}.actions button{width:52px;height:53px}.actions svg{width:34px;height:34px}}@media(max-width:450px){.vitals{width:172px}.portrait{display:none}.quest{width:174px}.quest h2{font-size:15px}.utility{max-width:310px}.utility span{flex-basis:100%}.message{bottom:171px}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}

/* Keep the title clear of the quest panel on narrow screens. */
@media(max-width:800px){.brand{top:98px}.location{top:165px}}

/* Let the stats row wrap instead of overflowing when values grow on very narrow screens. */
@media(max-width:450px){.stats{flex-wrap:wrap;row-gap:2px;column-gap:6px}}
.health-frame.resting #health-fill{animation:rest-glow 1.6s ease-in-out infinite}@keyframes rest-glow{50%{filter:brightness(1.3) saturate(1.1)}}@media (prefers-reduced-motion:reduce){.health-frame.resting #health-fill{animation:none;filter:brightness(1.2)}}
.actions button.cooling{opacity:.5;filter:saturate(.4)}
@media(max-width:420px){.actions{gap:6px}.actions button{width:46px;height:47px}.actions svg{width:30px;height:30px}}
dialog .controls{margin:6px auto 14px;border-collapse:collapse;font-size:14px;text-align:left}dialog .controls th,dialog .controls td{padding:5px 10px;border-bottom:1px solid #b49a6533}dialog .controls thead th{color:var(--gold);font-weight:400;font-size:13px;letter-spacing:.06em;text-transform:uppercase}dialog .controls tbody th{font-weight:400;color:#f3e6c8}dialog .controls kbd{border:1px solid #b69d6b;border-radius:3px;background:#1a201d;padding:1px 5px;font:14px Georgia}.controls-tip{font-size:14px;color:#cbb68c;margin:0 0 16px}@media(max-width:520px){dialog{padding:20px 14px}dialog .controls{font-size:13.5px}dialog .controls th,dialog .controls td{padding:4px 5px}dialog .controls thead th:nth-child(3),dialog .controls td:nth-child(3){display:none}}
.controls-touch{display:none;font-size:14px;line-height:1.45;max-width:34em;margin:0 auto 12px}@media(pointer:coarse){.controls-touch{display:block}}
.account{position:absolute;inset:0;z-index:20;display:grid;place-items:center;padding:16px;background:rgba(14,18,16,.72)}.account[hidden]{display:none}.account form{width:min(360px,100%);background:#222b27;border:1px solid var(--gold);box-shadow:0 0 0 3px #1a201d,0 18px 40px #0008;padding:26px 24px 22px;display:grid;gap:8px}.account h2{margin:0;font-weight:400;font-size:24px;text-align:center}.account-lead{margin:0 0 6px;text-align:center;color:#cbb68c;font-size:15px}.account-tabs{display:grid;grid-template-columns:1fr 1fr;margin-bottom:6px;border-bottom:1px solid #b49a6555}.account-tabs button{background:none;border:0;border-bottom:2px solid transparent;padding:8px 4px;font-size:15px;color:#cbb68c}.account-tabs button[aria-selected=true]{color:var(--ink);border-bottom-color:var(--gold)}.account label{font-size:14px;color:#e6d4ac}.account input{font:15px Georgia;color:var(--ink);background:#161c19;border:1px solid #6f6045;padding:9px 10px}.account input:focus-visible{outline:2px solid #f1d196;outline-offset:1px}.account-hint{margin:2px 0 0;font-size:14px;color:#b9a888;line-height:1.4}.account-error{margin:0;min-height:1.2em;font-size:14px;color:#ff9b85}.account button[type=submit]{margin-top:4px;background:#aa8b52;border:0;color:#17201b;padding:11px 18px;font-size:15px}.account button[type=submit]:disabled{opacity:.6}
#inventory-dialog{width:min(720px,calc(100% - 24px));max-height:calc(100dvh - 32px);padding:24px;text-align:left;border:1px solid #b49a65;background:linear-gradient(145deg,#30382d,#18221d);box-shadow:0 16px 80px #0009;border-radius:4px}#inventory-dialog::backdrop{background:#101612b8}.inventory-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;border-bottom:1px solid #8a7950;padding-bottom:16px}.inventory-heading h2{margin:0;font-size:30px}.inventory-heading p{margin:7px 0 0;font-size:15px;color:#cfbf9b}#inventory-dialog h3{font-size:14px;text-transform:uppercase;letter-spacing:2px;color:#bba77b;margin:20px 0 10px}#inventory-equipped{display:grid;grid-template-columns:1fr 1fr;gap:12px}.equipped-slot{display:flex;gap:12px;align-items:center;padding:12px;background:#121b1680;border:1px solid #655d43}.equipped-copy,.item-copy{display:flex;flex-direction:column;gap:5px}.slot-label{font-size:13px;color:#b9a16e}.item-detail{font:14px/1.5 system-ui,sans-serif;color:#b9bbae}.item-icon{display:grid;place-items:center;flex:0 0 46px;height:46px;color:#d5c199;background:#101812;border:1px solid #685c40;border-radius:3px}.item-icon svg{width:38px;height:38px}#inventory-list{list-style:none;margin:0;padding:0}.inventory-row{display:flex;gap:12px;align-items:center;padding:12px 0;border-bottom:1px solid #ffffff12}.item-copy{flex:1;min-width:0}.item-buttons{display:flex;gap:8px}#inventory-dialog button:not(.bag-slot):not(.char-slot):not(.bag-tool):not(.bag-place){font-size:14px;padding:9px 12px;border:1px solid #a38b56;border-radius:2px}#inventory-dialog button:disabled{cursor:default;opacity:.4}#inventory-dialog .item-sell{background:transparent;color:#d1c29d;border-color:#70674d}.rarity-uncommon strong{color:#a9ce90}.rarity-rare strong{color:#96bcdf}#inventory-status{min-height:20px;color:#e6d29c;font:14px/1.5 system-ui,sans-serif;margin:16px 0 4px}#inventory-trade-hint{font:14px/1.5 system-ui,sans-serif;color:#b9bbae;margin:0}#loot-notice{position:absolute;top:145px;left:50%;transform:translateX(-50%);max-width:calc(100% - 24px);width:max-content;padding:10px 16px;background:#1c291fee;border:1px solid #b49a65;color:#ead7ad;font-size:15px;text-align:center;pointer-events:none}#loot-notice[hidden]{display:none}@media(max-width:550px){#inventory-dialog{padding:16px}.inventory-heading h2{font-size:26px}#inventory-equipped{grid-template-columns:1fr}.inventory-row{flex-wrap:wrap}.item-buttons{margin-left:58px;width:calc(100% - 58px)}.item-buttons button{flex:1}#loot-notice{top:160px;font-size:14px}}
@media(max-width:450px){.utility{position:relative;z-index:2}}
#smith-dialog{width:min(650px,calc(100% - 24px));max-height:calc(100dvh - 32px);padding:24px;text-align:left;border:1px solid #b49a65;background:linear-gradient(145deg,#383328,#19221b);box-shadow:0 16px 80px #0009;border-radius:4px}#smith-dialog::backdrop{background:#101612b8}#smith-dialog button{font-size:14px;padding:10px 14px;border:1px solid #a38b56;border-radius:2px}#smith-dialog button:disabled{opacity:.4;cursor:default}#smith-quest{font:15px/1.7 system-ui,sans-serif;color:#ddd0b5;margin:20px 0 14px}#smith-dialog h3{font-size:14px;letter-spacing:2px;text-transform:uppercase;color:#bba77b;margin-top:26px}#smith-recipes{list-style:none;padding:0;margin:0}#smith-recipes li{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:16px 0;border-bottom:1px solid #ffffff15}#smith-recipes p{font:14px/1.6 system-ui,sans-serif;color:#bebba9;margin:6px 0 0}#smith-status{font:14px/1.5 system-ui,sans-serif;min-height:20px;color:#e6d29c}@media(max-width:550px){#smith-dialog{padding:16px}.inventory-heading{align-items:flex-start}#smith-dialog h2{font-size:25px}#smith-recipes li{align-items:flex-start}}
#cook-dialog{width:min(650px,calc(100% - 24px));max-height:calc(100dvh - 32px);padding:24px;text-align:left;border:1px solid #b49a65;background:linear-gradient(145deg,#383328,#19221b);box-shadow:0 16px 80px #0009;border-radius:4px}#cook-dialog::backdrop{background:#101612b8}#cook-dialog button{font-size:14px;padding:10px 14px;border:1px solid #a38b56;border-radius:2px}#cook-dialog button:disabled{opacity:.4;cursor:default}#cook-quest{font:15px/1.7 system-ui,sans-serif;color:#ddd0b5;margin:20px 0 14px}#cook-dialog h3{font-size:14px;letter-spacing:2px;text-transform:uppercase;color:#bba77b;margin-top:26px}#cook-recipes{list-style:none;padding:0;margin:0}#cook-recipes li{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:16px 0;border-bottom:1px solid #ffffff15}#cook-recipes p{font:14px/1.6 system-ui,sans-serif;color:#bebba9;margin:6px 0 0}#cook-status{font:14px/1.5 system-ui,sans-serif;min-height:20px;color:#e6d29c}@media(max-width:550px){#cook-dialog{padding:16px}.inventory-heading{align-items:flex-start}#cook-dialog h2{font-size:25px}#cook-recipes li{align-items:flex-start}}
@media(max-width:450px){.utility span{flex-basis:auto}.utility>span:first-child{flex-basis:100%}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}.actions button:hover,.actions button:active{transform:none}}
#account-dialog{width:min(460px,calc(100% - 24px));max-height:calc(100dvh - 32px);padding:24px;text-align:left;border:1px solid #b49a65;background:linear-gradient(145deg,#30382d,#18221d);box-shadow:0 16px 80px #0009;border-radius:4px}#account-dialog::backdrop{background:#101612b8}#account-dialog h2{margin:0 0 4px}#account-dialog-user{margin:0 0 8px;color:#cbb68c;font-size:15px}.account-section{display:grid;gap:6px;padding:14px 0;border-top:1px solid #b49a6533}.account-section h3{margin:0 0 2px;font-size:14px;letter-spacing:2px;text-transform:uppercase;color:#bba77b;font-weight:400}.account-section p{margin:0;font-size:14px;line-height:1.4}.account-section label{font-size:14px;color:#e6d4ac}.account-section input[type=password]{font:15px Georgia;color:var(--ink);background:#161c19;border:1px solid #6f6045;padding:8px 10px}.account-section .confirm{display:flex;gap:8px;align-items:center}.account-section button{justify-self:start;background:#aa8b52;border:0;color:#17201b;padding:10px 16px;font-size:15px}.account-section button:disabled{opacity:.6}.account-section.danger button{background:#8e3a2c;color:#fbe9d6}.account-status{min-height:1.2em;color:#ff9b85}.account-status.ok{color:#a8d99a}#account-close{margin-top:6px;background:none;color:var(--ink);border:1px solid #a38b56;padding:9px 16px}

.chat{position:absolute;left:14px;bottom:225px;width:min(340px,calc(100% - 28px));z-index:3;font:14px/1.4 system-ui,sans-serif;transition:opacity .6s}
.chat-log{list-style:none;margin:0;padding:6px 9px;max-height:7.5em;overflow:hidden;display:flex;flex-direction:column;justify-content:flex-end;background:#1d2524b3;border-left:2px solid #8a7b5b;border-radius:2px;pointer-events:none;text-shadow:0 1px 2px #000;overflow-wrap:anywhere}
.chat-log:empty{display:none}
.chat-log strong{color:#e6d0a0;font-weight:600}
.chat-log .self strong{color:#b8d4a6}
.chat-log .system{color:#d9a48f;font-style:italic}
.chat.quiet .chat-log{opacity:.35}
.chat.open .chat-log{max-height:12.6em;background:var(--panel)}

/* Combat Meter 2.0: two draggable/resizable generic meter windows. */
.combat-meters{position:absolute;inset:0;z-index:4;pointer-events:none}
.combat-meter{position:absolute;z-index:4;min-width:240px;min-height:150px;max-width:560px;max-height:620px;resize:both;overflow:auto;pointer-events:auto;padding:8px;background:rgba(20,25,21,.94);border:1px solid #8a7b5b;border-radius:3px;box-shadow:0 5px 18px #0007;font:13px/1.35 system-ui,sans-serif;text-shadow:0 1px 2px #000}
.combat-meter[hidden]{display:none}
.combat-meter.locked{resize:none}
.combat-meter-head{display:flex;align-items:center;gap:7px;border-bottom:1px solid #6f6045;padding-bottom:6px;cursor:move;user-select:none}
.combat-meter.locked .combat-meter-head{cursor:default}
.combat-meter-head>div{min-width:0;display:flex;flex-direction:column;flex:1}
.combat-meter-head strong{font:15px Georgia;color:#f0d796;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.combat-meter-period{font-size:11px;color:#bcb39e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.combat-meter button,.combat-meter select{background:#252b25;border:1px solid #6f6045;color:#d8ccb0;border-radius:2px;padding:3px 6px;font:12px system-ui,sans-serif}
.combat-meter .combat-meter-close,.combat-meter-menu-button{border:0;background:transparent;padding:2px 4px;font-size:15px}
.combat-meter-menu{margin:7px 0;padding:7px;background:#151a16;border:1px solid #ffffff16}
.combat-meter-menu[hidden]{display:none}
.combat-meter-menu label{display:grid;grid-template-columns:68px 1fr;gap:6px;align-items:center;margin:4px 0;color:#cfc5ae}
.combat-meter-menu select{min-width:0;width:100%}
.combat-meter-menu>div{display:flex;gap:6px;margin-top:7px}
.combat-meter-list{list-style:none;margin:7px 0 0;padding:0;display:flex;flex-direction:column;gap:4px}
.combat-meter-row{position:relative;min-height:30px;padding:4px 6px;overflow:hidden;background:#151a16;border:1px solid #ffffff12;cursor:pointer}
.combat-meter-row:hover,.combat-meter-row:focus{outline:none;border-color:#9a875e}
.combat-meter-bar{position:absolute;inset:0 auto 0 0;width:0;background:rgba(180,154,101,.22);pointer-events:none}
.combat-meter-row.target .combat-meter-bar{background:rgba(196,72,55,.28)}
.combat-meter-row.taunt{border-color:#d5b35f}
.combat-meter-line{position:relative;z-index:1;display:flex;justify-content:space-between;gap:8px}
.combat-meter-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#f1e3c5}
.combat-meter-value{white-space:nowrap;color:#d2c6ad;font-variant-numeric:tabular-nums}
.combat-meter-empty{margin:8px 2px 2px;color:#9f998b;font-size:12px}
.combat-meter-breakdown{margin-top:8px;padding-top:7px;border-top:1px solid #6f6045}
.combat-meter-breakdown[hidden]{display:none}
.combat-meter-breakdown-head{display:flex;justify-content:space-between;align-items:center;gap:8px}
.combat-meter-breakdown-head strong{color:#f0d796}
.combat-meter-breakdown p{margin:4px 0 6px;color:#cfc5ae}
.combat-meter-abilities{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}
.combat-meter-abilities li{display:flex;justify-content:space-between;gap:8px;padding:2px 0;border-bottom:1px solid #ffffff0d}
.combat-meter-extra{display:grid;grid-template-columns:1fr 1fr;gap:3px 8px;margin-top:7px;color:#bcb39e;font-size:11px}
.combat-meter-extra b{color:#e6d8b9}
@media(max-width:800px){.combat-meter{max-width:calc(100vw - 16px);max-height:45vh}.combat-meters{z-index:7}}
.chat-form{display:flex;gap:6px;margin-top:6px}
.chat-form[hidden]{display:none}
.chat-form input{flex:1;min-width:0;background:#141917;color:var(--ink);border:1px solid var(--gold);border-radius:2px;padding:7px 9px;font:inherit}
.chat-form button{border:1px solid var(--gold);background:#2b3029;color:var(--ink);padding:6px 12px;border-radius:2px;font:inherit}
@media(max-width:800px){.chat{bottom:auto;top:190px;left:12px;width:min(300px,calc(100% - 24px));font-size:14px}.chat-log{max-height:4.4em}.chat.open .chat-log{max-height:8.5em}}
@media(prefers-reduced-motion:reduce){.chat{transition:none}}

.small-dialog{min-width:min(320px,calc(100% - 24px))}
.small-dialog h2{margin:0 0 6px}
.small-dialog p{margin:0 0 16px;color:#cfbf9b}
.dialog-buttons{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}
dialog button.secondary,.trade-invite button.secondary{background:transparent;color:#d1c29d;border:1px solid #70674d}
.trade-invite{position:absolute;top:140px;left:50%;transform:translateX(-50%);z-index:4;background:var(--panel);border:1px solid var(--gold);border-radius:2px;padding:12px 16px;text-align:center;width:max-content;max-width:calc(100% - 24px)}
.trade-invite p{margin:0 0 10px}
.trade-invite button{background:#aa8b52;border:0;color:#17201b;padding:9px 16px;font-size:15px}
#trade-dialog{width:min(640px,calc(100% - 24px));max-height:calc(100dvh - 32px);padding:20px;text-align:left;border:1px solid #b49a65;background:linear-gradient(145deg,#30382d,#18221d);box-shadow:0 16px 80px #0009}
#trade-dialog::backdrop{background:#101612b8}
#trade-dialog h3{font-size:14px;text-transform:uppercase;letter-spacing:2px;color:#bba77b;margin:16px 0 8px}
.trade-sides{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.trade-sides ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;font:14px/1.4 system-ui,sans-serif}
.trade-sides li{display:flex;justify-content:space-between;align-items:center;gap:8px}
.trade-sides input,.trade-gold input{width:64px;background:#141917;color:var(--ink);border:1px solid var(--gold);border-radius:2px;padding:5px 6px;font:inherit}
.trade-gold{display:flex;justify-content:space-between;align-items:center;margin-top:10px;font:14px system-ui,sans-serif}
.trade-state{font:14px/1.5 system-ui,sans-serif;color:#cfbf9b;margin:10px 0 0}
#trade-status{font:14px/1.5 system-ui,sans-serif;color:#d9cfb6;margin:16px 0 10px}
#trade-dialog button{font-size:15px;padding:10px 14px;border-radius:2px}
#trade-dialog button:disabled{opacity:.55;cursor:default}
@media(max-width:520px){.trade-sides{grid-template-columns:1fr;gap:4px}.trade-invite{top:275px}}
.chat-log .old{opacity:.7}
.player-report{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center;margin-top:14px;font:14px system-ui,sans-serif}
.player-report[hidden]{display:none}
.player-report select{background:#141917;color:var(--ink);border:1px solid var(--gold);padding:7px;font:inherit}
.player-report button{padding:8px 12px;font-size:14px}
.heroes-list{text-align:left;margin:0 auto 16px;padding-left:28px;font:14px/1.8 system-ui,sans-serif;max-width:360px}
.heroes-list strong{color:#e6d0a0}
.heroes-list .me strong{color:#b8d4a6}
.group{position:absolute;left:14px;top:96px;z-index:3;background:var(--panel);border:1px solid #8a7b5b;border-radius:2px;padding:8px 12px;font:14px/1.5 system-ui,sans-serif;min-width:140px}
.group[hidden]{display:none}
.group h2{font:13px system-ui,sans-serif;letter-spacing:2px;text-transform:uppercase;color:#bba77b;margin:0 0 4px}
.group ul{list-style:none;margin:0 0 6px;padding:0;color:#b8d4a6}
.group button{border:0;border-bottom:1px solid #928366;background:transparent;color:#d5cebb;padding:2px 0;font:13px system-ui,sans-serif}
@media(max-width:800px){.group{top:140px;left:auto;right:12px;min-width:0;padding:6px 10px}}
body.page{overflow:auto}
.page-text{max-width:680px;margin:0 auto;padding:24px 16px 56px;font:16px/1.65 Georgia,serif}
.page-text h1{font-weight:400;font-size:30px;margin:12px 0 8px}
.page-text h2{font-weight:400;font-size:20px;color:#e6d0a0;margin:28px 0 6px}
.page-text a,.account-legal a{color:#e6d0a0}
.page-text ul{padding-left:20px}
.account-legal{font:14px system-ui,sans-serif;text-align:center;margin:10px 0 0}
.feats{list-style:none;margin:0;padding:0;font:14px/1.8 system-ui,sans-serif;color:#b9bbae}
.feats strong{color:#d8c79f;font-weight:600}
.feats .done strong{color:#b8d4a6}
.feats .done::before{content:"✓ ";color:#b8d4a6}
#inventory-rank{font:14px system-ui,sans-serif;color:#cfbf9b;margin:0 0 6px}
.chat-log .whisper,.chat-log .whisper strong{color:#d6b8e8}
.heroes-now{font:14px system-ui,sans-serif;letter-spacing:2px;text-transform:uppercase;color:#bba77b;margin:4px 0 6px}
.online-list{list-style:none;padding-left:0}
.minimap{position:absolute;right:14px;top:112px;z-index:2;width:200px;height:auto;border:1px solid var(--gold);border-radius:2px;box-shadow:0 4px 14px #0007;cursor:zoom-in;transform:scale(var(--minimap-scale,1));transform-origin:top right;transition:transform .15s}
.minimap[hidden]{display:none}
@media(max-width:800px){.minimap{width:150px;height:auto;top:auto;bottom:250px;right:12px;transform-origin:bottom right}}
/* Two rows keep all five actions reachable without shrinking their touch targets. */
@media(max-width:420px){.bottom{width:100%}.actions{display:grid;grid-template-columns:repeat(5,48px);gap:6px;width:max-content;margin-left:auto;margin-right:auto}.actions button{width:48px;height:48px}.actions svg{width:30px;height:30px}.actions kbd{font-size:12px;padding:1px 4px}.utility{margin-left:auto;margin-right:auto}.message{bottom:300px}.minimap{bottom:356px}}
.chat-log .emote{font-style:italic;color:#e9dcc0}
.tips{position:absolute;left:14px;top:96px;z-index:3;max-width:280px;background:var(--panel);border:1px solid var(--gold);border-radius:2px;padding:10px 12px;font:14px/1.5 system-ui,sans-serif}
.tips[hidden]{display:none}
.tips p{margin:0 0 6px}
.tips .tips-step{font-size:13px;letter-spacing:2px;text-transform:uppercase;color:#bba77b}
.tips button{background:transparent;border:0;border-bottom:1px solid #928366;color:#d5cebb;padding:2px 0;font:14px system-ui,sans-serif}
@media(max-width:800px){.tips{top:215px;left:12px;right:12px;max-width:none;font-size:14px;padding:8px 10px}}
@media(max-width:450px){.xp-next{display:none}.stats{flex-wrap:nowrap;white-space:nowrap}}
.player-profile{display:grid;grid-template-columns:auto 1fr;gap:4px 12px;text-align:left;margin:0 auto 14px;max-width:320px;font:14px/1.5 system-ui,sans-serif}
.player-profile[hidden]{display:none}
.player-profile dt{color:#bba77b}
.player-profile dd{margin:0;color:var(--ink)}
/* 3D view (?3d): WebGL behind, the 2D canvas on top for clicks and overlays */
#world3d{position:absolute;inset:0;width:100%;height:100%;display:block}
.view-3d #world{position:relative;background:transparent}
.skills-list{list-style:none;text-align:left;margin:0 auto 16px;padding:0;max-width:320px;font:14px/1.5 system-ui,sans-serif}.skills-list li{display:grid;gap:3px;margin:0 0 12px}.skills-list strong{color:#e6d0a0;font-weight:600}.skills-list span{color:#cbb68c;font-size:14px}.skills-list progress{width:100%;height:8px;accent-color:#b8d4a6}
/* Boxes show for a moment and fade, so text never covers the world for long. */
.brand{opacity:0;transition:opacity .8s;pointer-events:none}.brand.show{opacity:1}
.brand-area{margin:2px 0 0;font-size:15px;letter-spacing:2px;color:#f0e6ce}
.message{opacity:0;transition:opacity .6s}.message.show{opacity:1}
.menu-toggle{display:none}
/* Phones: the guide and the map sit under the top bar, side by side; the small buttons fold into a menu. */
@media(max-width:800px){
.location{top:64px;left:12px;transform:none;font-size:12px;text-align:left}
.brand{top:34vh}
.tips{top:100px;left:12px;right:132px;max-width:none}
.minimap{width:110px;top:100px;bottom:auto;right:12px;transform-origin:top right}
.menu-toggle{display:inline-block;margin:10px auto 0;border:1px solid #70674d;background:var(--panel);padding:6px 18px;font:14px system-ui,sans-serif;border-radius:2px}
.utility{display:none}
.bottom.menu-open .utility{display:flex;background:var(--panel);border:1px solid #70674d;padding:8px;border-radius:2px}
}
/* A smaller, lighter HUD: the world is the main thing on screen. */
#game:has(.brand.show) .location{opacity:0}
.location{transition:opacity .4s}
.vitals{width:330px}.stats{white-space:nowrap}.portrait{width:48px;height:52px;font-size:30px}.health-frame{height:18px}
.quest{width:230px;padding:8px 12px;background:linear-gradient(90deg,rgba(27,29,25,.72),rgba(27,29,25,.3))}
.quest h2{font-size:15px;margin:0 0 4px}.quest p{font-size:14px;line-height:1.4}#quest-progress{font-size:12.5px;margin-top:3px}
.tips{max-width:240px;padding:7px 10px;font-size:14px;line-height:1.4;background:rgba(27,29,25,.78)}.tips .tips-step{font-size:11.5px;letter-spacing:1.5px}.tips p{margin:0 0 4px}
.minimap{width:160px}
.message{font-size:14px;padding:7px 14px;background:rgba(27,29,25,.8)}
.actions button{width:54px;height:55px}.actions svg{width:32px;height:32px}
.help{font-size:13px;gap:14px;padding:4px 10px;background:#1d252466}
@media(max-width:800px){
.vitals{width:160px}.health-frame{height:16px}
.quest{width:150px;padding:6px 8px}.quest h2{font-size:14px;margin:0 0 2px}.quest p{font-size:12.5px}#quest-progress{font-size:11.5px}
.tips{top:92px;right:122px;font-size:12.5px;padding:5px 8px}.tips .tips-step{font-size:10.5px}.tips button{font-size:12.5px}
.minimap{width:100px;top:92px;transform-origin:top right}
.message{font-size:13px;padding:5px 10px}
.actions button{width:42px;height:42px}.actions svg{width:24px;height:24px}
.menu-toggle{padding:4px 14px;font-size:14px;margin-top:6px}
}
/* Touch: holding a button must not start text selection or the copy menu (iOS). */
#game{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
#game input,#game textarea{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
/* Between zones: a short dark fade with the zone's name hides the new map being built. */
.zone-fade{position:absolute;inset:0;z-index:6;display:grid;place-items:center;background:#0e1210;color:#eadbb8;font:22px Georgia,serif;letter-spacing:2px;opacity:0;pointer-events:none;transition:opacity .35s}.zone-fade.show{opacity:.92}
/* Longer zone names in the banner stay on one line on phones. */
@media(max-width:800px){.brand h1{font-size:22px;white-space:nowrap}}

/* The map (K): fills the screen, a header with the zone's name and the views, the map below. */
.world-map{position:fixed;inset:0;z-index:30;display:flex;flex-direction:column;background:#141a16f5;color:var(--ink)}
.world-map[hidden]{display:none}
.world-map-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 18px;border-bottom:1px solid var(--gold);background:linear-gradient(#262c26,#1b211d)}
.world-map-head h2{margin:0;font-weight:400;font-size:24px;color:#f0d796}
.world-map-head p{margin:2px 0 0;font-size:14px;color:#c9bfa6}
.world-map-buttons{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.world-map-buttons button{background:#2a302a;border:1px solid var(--gold);padding:7px 12px;font-size:15px;border-radius:2px}
.world-map-buttons button[aria-pressed=true]{background:#5a4a2c;color:#fff2cc}
.world-map canvas{flex:1;min-height:0;width:100%;height:100%;display:block;cursor:pointer}
.world-map-legend{display:flex;flex-wrap:wrap;justify-content:center;gap:8px 20px;padding:10px 14px;border-top:1px solid var(--gold);font:13px system-ui,sans-serif;background:#1b211d;color:#f3e6c4}
.world-map-legend[hidden]{display:none}
@media(max-width:600px){.world-map-head{padding:8px 10px;flex-wrap:wrap}.world-map-head h2{font-size:18px}.world-map-buttons button{padding:6px 9px;font-size:14px}}

/* The bags (I): each bag its own window of places, stacked in the bottom right; the backpack lowest. */
.bags-dialog{position:fixed;inset:auto 14px 14px auto;margin:0;padding:0;border:0;background:transparent;max-width:min(360px,calc(100% - 20px));max-height:calc(100dvh - 28px);overflow:auto;color:var(--ink)}
.bags-dialog::backdrop{background:transparent}
.bags-top{display:flex;justify-content:space-between;align-items:center;background:#1b211df0;border:1px solid var(--gold);padding:4px 8px;margin-bottom:6px}
.bags-top h2{font-size:15px;margin:0;font-weight:400}
.bags-top button,.char-head button{background:#5a2a20;border:1px solid var(--gold);width:28px;height:28px;padding:0}
.bag-windows{display:flex;flex-direction:column;gap:6px}
.bag-window{background:linear-gradient(#2b2f29,#1d211d);border:2px solid #6d5a3a;border-radius:4px;box-shadow:0 4px 12px #0008;padding:6px}
.bag-head{display:flex;align-items:center;gap:6px;margin-bottom:5px;font-size:14px}
.bag-head .item-icon{width:22px;height:22px}
.bag-grid{display:grid;grid-template-columns:repeat(4,52px);gap:4px}
.bag-slot,.char-slot{position:relative;width:52px;height:52px;padding:4px;background:#141814;border:2px solid #3e3a30;border-radius:3px;display:grid;place-items:center}
.bag-slot.empty,.char-slot.empty{background:#121512;opacity:.75}
.char-slot.empty .item-icon{opacity:.25}
.bag-slot .item-icon,.char-slot .item-icon{width:38px;height:38px}
.bag-slot.chosen,.char-slot.chosen{outline:2px solid #f0d796}
.bag-count{position:absolute;right:3px;bottom:1px;font-size:14px;text-shadow:0 1px 2px #000,0 0 2px #000}
.bag-slot.rarity-common,.char-slot.rarity-common{border-color:#8f8b80}.bag-slot.rarity-uncommon,.char-slot.rarity-uncommon{border-color:#4f9a4f}.bag-slot.rarity-rare,.char-slot.rarity-rare{border-color:#4a7fcf}
strong.rarity-uncommon{color:#8ed18e}strong.rarity-rare{color:#8db6ff}
.bag-foot{display:flex;justify-content:space-between;margin-top:6px;font-size:14px;color:#c9bfa6}
.bag-gold{color:#f0c672}
.bag-info{background:#1b211df0;border:1px solid var(--gold);margin-top:6px;padding:8px 10px;font-size:14px}
.bag-info p{margin:4px 0}.bag-detail{border-bottom:1px solid #4a4434;padding-bottom:6px;margin-bottom:4px}
.bag-detail .item-buttons{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
.bag-detail button,.char-info button{background:#aa8b52;border:0;color:#17201b;padding:6px 10px;font-size:14px;margin-top:6px}
.bag-detail button.secondary,.char-info button.secondary{background:#3a3f37;color:var(--ink);border:1px solid var(--gold)}
.hint{color:#b9b09a}
/* The character window (C): the knight in the middle, gear round it, numbers and feats below. */
.character-dialog{width:min(430px,calc(100% - 20px));padding:0;border:2px solid #6d5a3a;background:linear-gradient(#2b2f29,#1a1e1a);color:var(--ink);text-align:left}
.character-dialog::backdrop{background:#0006}
.char-head{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;border-bottom:1px solid var(--gold);background:#20261f}
.char-head h2{margin:0;font-size:20px;font-weight:400;color:#f0d796}.char-head p{margin:2px 0 0;font-size:14px;color:#c9bfa6}
.char-body{display:grid;grid-template-columns:60px 1fr 60px;gap:6px;padding:10px;align-items:start}
.char-slots{display:flex;flex-direction:column;gap:8px}
.char-figure{position:relative;background:radial-gradient(#3a4036,#151915);border:1px solid #3e3a30;border-radius:4px}
.char-figure canvas{display:block;width:100%;height:auto}
.char-turn{position:absolute;top:6px;left:6px;display:flex;gap:4px}
.char-turn button{width:30px;height:30px;background:#2a302a;border:1px solid var(--gold);padding:0}
.char-bottom{display:flex;justify-content:center;gap:8px;padding:0 10px 8px}
.char-stats{display:grid;grid-template-columns:repeat(5,1fr);gap:4px;padding:0 10px 8px;font-size:14px}
.char-stat{background:#141814;border:1px solid #3e3a30;padding:4px;text-align:center;display:flex;flex-direction:column}
.char-stat span{color:#b9b09a;font-size:13px}.char-stat strong{color:#f3e6c4}
.char-info{margin:0 10px 8px;padding:8px;background:#141814;border:1px solid #3e3a30;font-size:14px;min-height:40px}
.char-info p{margin:4px 0}
.char-feats{padding:0 12px 12px;font-size:14px}.char-feats h3{margin:4px 0;font-weight:400;color:#f0d796}
@media(max-width:600px){.bags-dialog{inset:auto 6px 6px 6px;max-width:none}.bag-grid{grid-template-columns:repeat(4,1fr)}.bag-slot{width:auto;aspect-ratio:1}.char-stats{grid-template-columns:repeat(3,1fr)}}
.bags-dialog .bag-slot,.character-dialog .char-slot{color:var(--ink);background:#141814}.bags-dialog .bag-slot.empty,.character-dialog .char-slot.empty{background:#121512}.bag-count{color:#fff7df;font-weight:600}
.char-turn button,.bags-top button,.char-head button{color:var(--ink)}
/* The character window is not modal (the bags sit beside it), so it is placed as a modal would be. */
.character-dialog[open]{position:fixed;inset:0;margin:auto;max-height:calc(100dvh - 28px);overflow:auto;z-index:40}
.bags-dialog[open]{z-index:41}
@media(min-width:900px){.character-dialog[open]{inset:0 390px 0 0}}
@media(max-width:600px){.character-dialog[open]{inset:6px 6px auto 6px;margin:0 auto;max-height:54dvh}body:has(.character-dialog[open]) #inventory-dialog[open]{max-height:calc(46dvh - 18px)}}
/* The bag places under the backpack, and the places an old overfull save has no room for. */
.bag-places{display:flex;gap:4px;margin-top:6px}
.bag-place{width:30px;height:30px;display:grid;place-items:center;background:#141814;border:2px solid #6d5a3a;border-radius:3px}
.bag-place .item-icon{width:24px;height:24px}.bag-place.empty{border-color:#3e3a30}.bag-place.empty .item-icon{opacity:.25}
.bag-overflow{border-color:#9a3b30}.bag-over{color:#ff9a8a}
/* Small icons (bag heads, bag places): the drawing fits its box, with no frame of its own. */
.bag-head .item-icon,.bag-place .item-icon{flex:0 0 auto;background:none;border:0}
.bag-head .item-icon svg,.bag-place .item-icon svg{width:100%;height:100%}
/* Dragging gear between the bags and the character window (src/drag.js). */
.draggable{touch-action:none;cursor:grab}
.drag-ghost{position:fixed;z-index:60;pointer-events:none;opacity:.9;transform:scale(1.08);box-shadow:0 6px 16px #000a}
.drop-over{outline:2px solid #f0d796;outline-offset:1px;background:#3a3420}
/* Unit frames (src/unit-frames.js): on a big computer screen your health sits left of the action bar
   and your foe's right of it, as in WoW; the health bar at the top then goes. Phones keep it as it was. */
.unit-frame{display:none}
@media (min-width:1100px) and (min-height:600px){
  .actions{position:relative;width:max-content;margin-left:auto;margin-right:auto}
  .unit-frame{display:block;position:absolute;bottom:4px;width:250px;padding:5px 7px 6px;background:linear-gradient(#262b24f0,#161a17f0);border:2px solid #ad9463;box-shadow:0 0 0 2px #22251e,0 4px 10px #0005;border-radius:3px;text-align:left;font:14px Georgia;color:#eadbb7}
  .unit-frame.self{right:calc(100% + 22px)}
  .unit-frame.target{left:calc(100% + 22px);visibility:hidden}
  .unit-frame.target.on{visibility:visible}
  .unit-head{display:flex;justify-content:space-between;margin-bottom:4px}
  .unit-bar{position:relative;height:20px;border:1px solid #b5a077;background:#49231e}
  .unit-fill{height:100%;width:100%;background:linear-gradient(#c84837,#9c271f);transition:width .15s}
  .unit-bar span{position:absolute;inset:0;text-align:center;line-height:18px;text-shadow:0 1px 2px #000}
  .unit-bar.resting .unit-fill{animation:rest-glow 1.6s ease-in-out infinite}
  .vitals .health-frame{display:none}
}
@media (min-width:1100px) and (min-height:600px) and (prefers-reduced-motion:reduce){.unit-bar.resting .unit-fill{animation:none;filter:brightness(1.2)}}
/* Epic gear, the rarest the smith makes. */
.bag-slot.rarity-epic,.char-slot.rarity-epic{border-color:#9a5bd6}strong.rarity-epic{color:#c99bff}.rarity-epic strong{color:#c99bff}
.bag-slot.rarity-legendary,.char-slot.rarity-legendary{border-color:#d88932;box-shadow:inset 0 0 10px #d8893228}.rarity-legendary strong,strong.rarity-legendary{color:#ffb454}
.bag-slot.rarity-mythic,.char-slot.rarity-mythic{border-color:#d86cff;box-shadow:0 0 10px #b34cff55,inset 0 0 12px #8c3cff2e}.rarity-mythic strong,strong.rarity-mythic{color:#e899ff;text-shadow:0 0 7px #b44cff88}
/* Choosing a class (src/class-ui.js). */
.class-dialog{width:min(760px,calc(100% - 20px));max-height:calc(100dvh - 24px);overflow:auto;padding:0;border:2px solid #6d5a3a;background:linear-gradient(#2b2f29,#1a1e1a);color:var(--ink);text-align:left}
.class-dialog::backdrop{background:#000a}
.class-list{list-style:none;margin:0;padding:12px;display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px}
.class-card{background:#141814;border:1px solid #3e3a30;border-radius:4px;padding:10px;display:flex;flex-direction:column;gap:6px}
.class-card.current{border-color:#f0d796}
.class-head{display:flex;flex-direction:column}.class-head strong{font-size:19px;color:#f0d796;font-weight:400}
.class-role{font-size:14px;color:#c9bfa6;text-transform:uppercase;letter-spacing:1px}
.class-card p{margin:0;font-size:14px}.class-traits{color:#b9b09a;font-size:14px!important}
.class-card button{margin-top:auto;background:#aa8b52;border:0;color:#17201b;padding:8px 10px;font-size:15px}
.class-card button:disabled{opacity:.55}
#class-status{padding:0 14px 12px;margin:0;color:#e6d29c;font-size:14px}
/* Abilities (src/abilities.js): two buttons in the bar with their wait, and the class's resource. */
.actions .ability .ability-icon svg{width:42px;height:42px}
.actions .ability.cooling{filter:grayscale(.8) brightness(.7)}
.ability-wait{position:absolute;inset:0;display:grid;place-items:center;font:600 18px Georgia;color:#fff;text-shadow:0 1px 3px #000;pointer-events:none}
.resource-frame{height:9px;margin-top:3px;border:1px solid #6d5a3a;background:#1a1d24;position:relative}
.resource-frame #resource-fill{height:100%;width:0;background:linear-gradient(#5a8ad8,#2f5aa0);transition:width .15s}
.resource-frame.rage #resource-fill{background:linear-gradient(#d85a3a,#a02f1f)}.resource-frame.focus #resource-fill{background:linear-gradient(#e0b84a,#a8822a)}
.resource-frame span{position:absolute;inset:0;font:11px/9px Georgia;text-align:center;color:#fff;text-shadow:0 1px 1px #000}
.unit-bar.resource{height:12px;margin-top:3px;background:#1a1d24}.unit-bar.resource .unit-fill{background:linear-gradient(#5a8ad8,#2f5aa0)}
.unit-bar.resource.rage .unit-fill{background:linear-gradient(#d85a3a,#a02f1f)}.unit-bar.resource.focus .unit-fill{background:linear-gradient(#e0b84a,#a8822a)}
.unit-bar.resource span{line-height:11px;font-size:12px}
@media(max-width:420px){.actions{grid-template-columns:repeat(6,46px)!important}.actions button{width:46px!important;height:46px!important}.actions .ability .ability-icon svg{width:30px;height:30px}}
/* The XP bar under the action buttons (hud.js xpBar); the rested reserve shows ahead in blue. */
.xp-bar{position:relative;width:min(560px,calc(100vw - 24px));height:12px;margin:-8px auto 10px;background:#1a1d1a;border:1px solid #6d5a3a;box-shadow:0 0 0 1px #22251e}
.xp-bar #xp-bar-fill,.xp-bar #xp-bar-rest{position:absolute;left:0;top:0;bottom:0;width:0;transition:width .3s}
.xp-bar #xp-bar-fill{background:linear-gradient(#b48ce0,#7a4fb0)}.xp-bar #xp-bar-rest{background:#3a5a8a99}
.xp-bar span{position:absolute;inset:0;text-align:center;font:12px/11px Georgia;color:#f3e6c4;text-shadow:0 1px 2px #000}
@media (min-width:1100px) and (min-height:600px){.vitals .resource-frame{display:none}}
/* Party frames (group-ui.js): each mate with a round portrait, name, level, health and resource. */
.group{left:14px;top:104px;background:none;border:0;padding:0;min-width:0;font:14px Georgia}
.group ul.party{display:flex;flex-direction:column;gap:6px;margin:0 0 6px;color:var(--ink)}
.party-frame{display:flex;align-items:center;gap:6px;width:196px}
.party-frame.far{opacity:.5}
.party-portrait{flex:0 0 40px;height:40px;border-radius:50%;border:2px solid #ad9463;background:radial-gradient(#3a4036,#151915);display:grid;place-items:center;font-size:19px;box-shadow:0 2px 4px #0008;position:relative}
.party-level{position:absolute;bottom:-4px;right:-4px;background:#1b211d;border:1px solid #ad9463;border-radius:8px;font:12px Georgia;padding:0 4px;color:#f0d796}
.party-bars{flex:1;display:flex;flex-direction:column;gap:2px;background:#151915e6;border:1px solid #6d5a3a;padding:3px 4px}
.party-name{font-size:13px;color:#f3e6c4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.party-bar{position:relative;height:10px;background:#2a1a17}
.party-bar>div{height:100%;transition:width .2s}
.party-bar.hp>div{background:linear-gradient(#5fbf4f,#2f8a2a)}
.party-bar.res{height:6px;background:#1a1d24}.party-bar.res>div{background:linear-gradient(#5a8ad8,#2f5aa0)}
.party-bar.res.rage>div{background:linear-gradient(#d85a3a,#a02f1f)}.party-bar.res.focus>div{background:linear-gradient(#e0b84a,#a8822a)}
.party-bar span{position:absolute;inset:0;font:11px/10px Georgia;text-align:center;color:#fff;text-shadow:0 1px 1px #000}
.party-frame.down .party-portrait{filter:grayscale(1)}
@media(max-width:800px){.group{top:150px;left:8px;right:auto}.party-frame{width:150px}.party-portrait{flex-basis:30px;height:30px;font-size:15px}}
.group #group-leave{background:#151915e6;border:1px solid #6d5a3a;padding:2px 8px;font:13px Georgia;color:#d5cebb}
/* The special attack on X: set apart at the end of the bar, with a warmer frame. */
.actions .ability.special{margin-left:10px;border-color:#e0b84a;box-shadow:0 0 0 2px #22251e,0 0 10px #e0b84a55}
.actions .draggable{cursor:pointer}.actions .drag-ghost{opacity:.85}
@media(max-width:420px){.actions{grid-template-columns:repeat(8,40px)!important;gap:4px!important}.actions button{width:40px!important;height:40px!important}.actions .ability.special{margin-left:0}.actions svg,.actions .ability .ability-icon svg{width:26px!important;height:26px!important}}
/* Friends (friends-ui.js). */
.friends-dialog{width:min(460px,calc(100% - 20px));max-height:calc(100dvh - 24px);overflow:auto;padding:0;border:2px solid #6d5a3a;background:linear-gradient(#2b2f29,#1a1e1a);color:var(--ink);text-align:left}
.friends-dialog::backdrop{background:#0008}
.friends-add{display:flex;gap:6px;padding:10px 12px}.friends-add input{flex:1;background:#141814;border:1px solid #6d5a3a;color:var(--ink);padding:7px 8px;font:15px Georgia}
.friends-add button{padding:7px 12px;font-size:15px}
.friends-list{list-style:none;margin:0;padding:0 12px 12px;display:flex;flex-direction:column;gap:6px}
.friend{background:#141814;border:1px solid #3e3a30;padding:8px;opacity:.65}.friend.online{opacity:1;border-color:#6d5a3a}
.friend-who{display:flex;align-items:center;gap:7px}.friend-who strong{color:#f3e6c4;font-weight:400;font-size:15px}
.friend-dot{width:9px;height:9px;border-radius:50%;background:#6a6a60}.friend.online .friend-dot{background:#5fbf4f;box-shadow:0 0 6px #5fbf4f}
.friend-about{margin:3px 0 6px;font-size:14px;color:#b9b09a}
.friend-buttons{display:flex;gap:6px;flex-wrap:wrap}.friend-buttons button{padding:5px 10px;font-size:14px}
.friend-empty{color:#b9b09a;font-size:14px}
/* The menu on a party frame, and the teleport's countdown above the action bar. */
.party-menu{position:absolute;z-index:20;display:flex;flex-direction:column;gap:4px;background:#1b211df2;border:1px solid #ad9463;padding:8px;min-width:150px;font:14px Georgia}
.party-menu[hidden]{display:none}.party-menu strong{font-weight:400;color:#f0d796}
.party-menu button{background:#aa8b52;border:0;color:#17201b;padding:6px 8px;font-size:14px;text-align:left}.party-menu button.secondary{background:#3a3f37;color:var(--ink)}
.player-menu{position:fixed;z-index:60;min-width:180px;box-shadow:0 8px 24px #0008}
.player-menu button:hover,.player-menu button:focus-visible{outline:1px solid #f0d796;filter:brightness(1.08)}
.cast-bar{position:absolute;left:50%;bottom:205px;transform:translateX(-50%);width:min(320px,calc(100% - 40px));height:22px;background:#1a1d1a;border:2px solid #ad9463;z-index:4}
.cast-bar[hidden]{display:none}
.cast-bar #cast-fill{height:100%;width:0;background:linear-gradient(#8ab8e8,#3f6fb0)}
.cast-bar span{position:absolute;inset:0;text-align:center;font:14px/18px Georgia;color:#fff;text-shadow:0 1px 2px #000}
.cast-bar button{position:absolute;right:-30px;top:-2px;width:24px;height:22px;padding:0;background:#5a2a20;border:1px solid #ad9463;color:#f3e6c4}
/* Buffs (src/buffs.js): small icons with seconds left, under one's own health and on party frames. */
.buffs{display:flex;gap:3px;margin-top:3px;min-height:0}
.buff{position:relative;width:20px;height:20px;background:#151915e6;border:1px solid #ad9463;border-radius:3px;display:grid;place-items:center}
.buff svg{width:16px;height:16px}
.buff-time{position:absolute;right:-3px;bottom:-5px;font:11px Georgia;color:#fff;text-shadow:0 1px 2px #000}
.party-frame .buff{width:16px;height:16px}.party-frame .buff svg{width:12px;height:12px}
#vital-buffs .buffs{margin-top:5px}
/* What a recipe still lacks (smith-ui.js). */
#smith-recipes .smith-missing{color:#e8a08a;font-size:14px;margin-top:2px}
.smith-all{display:block;font:14px system-ui,sans-serif;color:#c9bfa6;margin:-4px 0 8px}.smith-all[hidden]{display:none}
/* The dungeon window and its "ready?" banner (dungeon-ui.js). */
.dungeon-body{padding:10px 14px 14px;font-size:15px}.dungeon-body p{margin:0 0 10px}
#dungeon-status{color:#e6d29c}
.dungeon-ready{border-color:#e0b84a!important;box-shadow:0 0 18px #e0b84a55}
/* A set item's line: the set, how much is worn, and its bonuses. */
.item-set{color:#c99bff;font:14px/1.5 system-ui,sans-serif;margin:4px 0 0}
/* Narrow screens: a dish has four buttons (eat, on Q, sell, sell all), two to a row. */
@media(max-width:550px){.bag-detail .item-buttons{flex-wrap:wrap;margin-left:0;width:100%}.bag-detail .item-buttons button{flex:1 1 calc(50% - 8px)}}
/* Q waiting after a meal (src/quick-slot.js), greyed like an ability. */
.actions #heal{position:relative}.actions #heal.cooling{filter:grayscale(.8) brightness(.7)}
/* "Udstyr" in another knight's menu (src/inspect-ui.js): their figure beside what they wear. */
.inspect{display:flex;gap:12px;align-items:flex-start;text-align:left;margin:0 auto 14px;max-width:440px}
.inspect[hidden]{display:none}
.inspect-figure{flex:0 0 120px;width:120px;height:150px;background:#121a15;border:1px solid #4a4434;border-radius:3px}
.inspect-list{list-style:none;margin:0;padding:0;flex:1;min-width:0;max-height:240px;overflow:auto}
.inspect-row{display:flex;gap:8px;align-items:center;padding:4px 0;border-bottom:1px solid #ffffff10}
.inspect-row .item-icon{flex:0 0 30px;width:30px;height:30px}
.inspect-row .item-icon svg{width:24px;height:24px}
.inspect-text{display:flex;flex-direction:column;min-width:0;font:14px/1.35 system-ui,sans-serif}
.inspect-text strong{font-size:14px}
@media(max-width:550px){.inspect{flex-direction:column;align-items:center}.inspect-list{width:100%;max-height:200px}}
.dungeon-tiers{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin:10px 0}.dungeon-tiers .tier{border:1px solid #6d6150;background:#1d2524;color:var(--ink);padding:7px 11px;font-size:14px}.dungeon-tiers .tier[aria-pressed=true]{border-color:var(--gold);background:#3a3326;box-shadow:0 0 0 1px var(--gold)}.dungeon-tiers .tier:disabled{opacity:.45;cursor:not-allowed}.tier-elite{color:#9fd0ff!important}.tier-legendary{color:#f2a65a!important}.tier-mythic{color:#d79bff!important}
.item-tip{position:fixed;z-index:30;width:270px;pointer-events:none}.loot-card{background:linear-gradient(145deg,#30382dee,#18221dee);border:1px solid #b49a65;border-radius:4px;padding:10px 12px;box-shadow:0 8px 30px #0008;font:14px/1.4 system-ui,sans-serif;color:#e6dcc4;animation:loot-in .25s ease-out}.loot-card-head{display:flex;gap:10px;align-items:center}.loot-card-name{display:flex;flex-direction:column}.loot-card-name strong{font:16px Georgia,serif}.loot-card.rarity-uncommon strong{color:#a9ce90}.loot-card.rarity-rare strong{color:#96bcdf}.loot-card.rarity-epic strong{color:#c99bff}.loot-card.rarity-legendary strong{color:#ffb454}.loot-card.rarity-mythic{border-color:#c46cff;box-shadow:0 8px 30px #0008,0 0 18px #a94cff55}.loot-card.rarity-mythic strong{color:#e899ff;text-shadow:0 0 7px #b44cff88}.loot-card-stat{font-size:13px;color:#b9bbae}.loot-card-vs{margin:8px 0 2px;font-size:13px;color:#b9a16e}.loot-card-diff{list-style:none;margin:0;padding:0}.loot-card-diff .up{color:#8fe08a}.loot-card-diff .down{color:#ef7b6b}.loot-card-diff .same{color:#b9bbae}.loot-card-why{margin:6px 0 0;color:#ef9b6b;font-size:13px}.loot-card-buttons{display:flex;gap:8px;margin-top:8px}.loot-card-buttons button{flex:1;padding:8px;border:1px solid #a38b56;border-radius:2px;background:#aa8b52;color:#17201b;font-size:14px}.loot-card-buttons button.secondary{background:transparent;color:#d1c29d;border-color:#70674d}.loot-card-buttons button:disabled{opacity:.45}@keyframes loot-in{from{transform:translateX(30px);opacity:0}to{transform:none;opacity:1}}@media(prefers-reduced-motion:reduce){.loot-card{animation:none}}
.bag-slot.drop-over{outline:2px solid #f1d196;outline-offset:-2px}
.bag-tools{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:8px}.bag-tools-label{font:12px system-ui,sans-serif;color:#b9a16e;margin-right:2px}.bag-tool{display:grid;place-items:center;width:34px;height:34px;border:1px solid #685c40;border-radius:3px;background:#101812}.bag-tool .item-icon{flex:0 0 30px;width:30px;height:30px;border:0;background:none}.bag-tool .item-icon svg{width:26px;height:26px}.loot-card-desc{margin:6px 0 0;color:#cfc6ae;font-size:13px}.loot-card-effect{margin:4px 0 0;color:#8fe08a;font-size:13px}
html:has(#game){overflow:hidden}.quest-tracker{list-style:none;margin:6px 0 0;padding:0;font:13px/1.4 system-ui,sans-serif}.quest-tracker li{margin-top:4px;color:#d9d2bd}.quest-tracker li strong{color:#ead29c;font-weight:600}.quest-tracker li.ready strong{color:#9fe08f}.quest-dialog{max-width:min(560px,calc(100% - 24px))}.quest-body{display:flex;flex-direction:column;gap:12px;max-height:min(70dvh,560px);overflow:auto;text-align:left}.quest-card{border:1px solid #6d6150;background:#1a211d;padding:12px 14px;border-radius:3px}.quest-card.ready{border-color:#8fbf6a}.quest-card h3{margin:0 0 6px;font:600 16px Georgia,serif;color:#ead29c}.quest-card p{margin:6px 0;font:14px/1.5 system-ui,sans-serif;color:#d9d2bd}.quest-goals{margin:6px 0;padding-left:18px;font:14px/1.5 system-ui,sans-serif;color:#cfc6ae}.quest-goals li.met{color:#8fe08a}.quest-reward{color:#e6d29c!important}.quest-hint{color:#b9a16e!important;font-size:13px!important}.quest-card button{margin-top:6px}
/* Quest tracker, quest log and giver windows (src/quest-ui.js). */
.quest h2{display:flex;align-items:center;gap:6px;white-space:nowrap}.quest-panel-log{pointer-events:auto;margin-left:auto;background:#2a2f27cc;border:1px solid #8a7650;color:#ead29c;font:12px system-ui,sans-serif;padding:3px 8px;border-radius:3px;text-shadow:none}.quest-panel-log:hover{background:#3a3b2ecc}
.quest-tracker li{display:flex;flex-direction:column;margin-top:6px;padding-left:8px;border-left:2px solid #b49a6588}.quest-tracker li.ready{border-left-color:#8fe08a}.quest-tracker li span{font-size:12.5px;color:#cfc6ae}.quest-tracker li.ready span{color:#9fe08f}
.quest-dialog{width:min(560px,calc(100% - 24px));padding:22px;text-align:left;border:1px solid #b49a65;background:linear-gradient(145deg,#383328,#19221b);box-shadow:0 16px 80px #0009;border-radius:4px}#questlog-dialog{width:min(780px,calc(100% - 24px))}.quest-dialog .char-head p{margin:2px 0 0;font:13px system-ui,sans-serif;color:#bba77b}
.quest-meta{color:#bba77b!important;font-size:12.5px!important;margin:0 0 6px!important}
.quest-goals{list-style:none;padding:0}.quest-goals li{display:grid;grid-template-columns:1fr auto;gap:2px 10px;margin:5px 0}.goal-count{color:#ead29c;font-variant-numeric:tabular-nums}.quest-goals li.met .goal-count{color:#8fe08a}.goal-bar{grid-column:1/-1;height:5px;background:#0e1310;border:1px solid #4c4433;border-radius:3px;overflow:hidden}.goal-bar span{display:block;height:100%;background:linear-gradient(90deg,#9a7a3c,#e0c070)}.quest-goals li.met .goal-bar span{background:#6fbf5a}
.quest-card button:disabled{opacity:.45;cursor:default}
#questlog-list{display:grid;grid-template-columns:230px 1fr;gap:14px;align-items:start}#questlog-list>.quest-hint{grid-column:1/-1}.questlog-side{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.questlog-pick{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;background:#1a211d!important;border:1px solid #4c4433!important;color:var(--ink)!important;padding:9px 11px!important;border-radius:3px}.questlog-pick strong{font:600 14px Georgia,serif;color:#ead29c}.questlog-pick span{font:12px system-ui,sans-serif;color:#b9ab8a}.questlog-pick.ready span{color:#8fe08a}.questlog-pick.chosen{border-color:#e0c070!important;background:#2c2b20!important}.questlog-pick:hover{border-color:#b49a65!important}
@media(max-width:640px){#questlog-list{grid-template-columns:1fr}.questlog-side{flex-direction:row;overflow-x:auto;padding-bottom:4px}.questlog-side li{flex:0 0 160px}.quest-dialog{padding:14px}.quest-tracker li span{font-size:11.5px}}
.cook-buttons{display:flex;flex-direction:column;gap:6px;align-items:stretch}.cook-buttons button{white-space:nowrap}#cook-dialog button.secondary{background:transparent;color:#ead29c}
/* The admin window (src/admin-ui.js). */
.admin-body{display:flex;flex-direction:column;gap:10px;text-align:left;font:14px system-ui,sans-serif}.admin-body label{display:flex;flex-direction:column;gap:4px;color:#bba77b}.admin-body fieldset{display:flex;flex-wrap:wrap;gap:8px;align-items:center;border:1px solid #4c4433;border-radius:3px;padding:8px 10px;margin:0}.admin-body legend{color:#ead29c;padding:0 4px}.admin-body input,.admin-body select{background:#121815;color:var(--ink);border:1px solid #6d6150;padding:7px 8px;font:14px system-ui,sans-serif;border-radius:2px}#admin-item{flex:1 1 180px}#admin-count,#admin-level,#admin-gold,#admin-skill-level{width:90px}.admin-body button{padding:8px 14px;font-size:14px}#admin-status{min-height:20px;color:#e6d29c;margin:0}
.admin-dialog{max-height:calc(100dvh - 24px);overflow:auto}.admin-body fieldset{min-width:0}.admin-body fieldset input,.admin-body select{min-width:0}@media(max-width:640px){#admin-item{flex-basis:100%}}


/* Compact MMO HUD pass */
/* Information should feel like overlays, not big modal blocks. Pure info must not steal world clicks. */
:root{
  --hud-glass:rgba(18,23,20,.72);
  --hud-glass-soft:rgba(18,23,20,.52);
  --hud-line:rgba(180,154,101,.48);
}

/* Click-through informational surfaces. Explicit controls opt back in below. */
.brand,.location,.message,#loot-notice,.chat-log,
.combat-meter-list,.combat-meter-sub,.combat-meter-empty,
.unit-frame,.quest-tracker{pointer-events:none}
#unit-self{pointer-events:auto;cursor:pointer} /* a click sends heals back to oneself */
.quest{pointer-events:none}
.quest button,.combat-meter button,.chat-form,.chat-form *,
.party-menu,.party-menu *{pointer-events:auto}

/* Top HUD: smaller footprint and lighter framing. */
.hud{top:14px;left:16px;right:16px;gap:14px}
.vitals{width:286px;gap:6px}
.portrait{width:48px;height:52px;border-width:1px;font-size:30px;box-shadow:0 3px 12px #0005}
.health-frame{height:18px;border-width:1px;outline-width:1px}
.health-frame span{font:12px/16px Georgia}
.resource-frame{height:7px}
.resource-frame span{font-size:9px;line-height:6px}
.stats{font-size:11px;margin-top:5px;gap:7px}

.brand{min-width:140px;padding:0 12px;background:linear-gradient(90deg,transparent,rgba(18,23,20,.48),transparent)}
.brand h1{font-size:24px;letter-spacing:.6px}
.ornament{font-size:11px;line-height:17px;opacity:.7}
.location{top:67px;font-size:12px;letter-spacing:.5px;color:#e9dfc8;opacity:.9}

/* Quest tracker: slim translucent card rather than a large rectangle. */
.quest{
  width:236px;
  padding:7px 10px 8px;
  background:linear-gradient(100deg,rgba(18,23,20,.74),rgba(18,23,20,.26));
  border:0;
  border-left:2px solid var(--hud-line);
  border-radius:0 6px 6px 0;
  box-shadow:0 5px 18px #0003;
}
.quest h2{font-size:15px;margin:0 0 4px;gap:4px}
.quest h2>span:first-child{font-size:11px;padding-right:2px;opacity:.7}
.quest p{font-size:12px;line-height:1.3}
.quest #quest-progress{font-size:11px;margin-top:3px}
.quest-panel-log{padding:2px 6px;font-size:10px;border-color:#8a765077;background:#252a24aa}
.quest-tracker{margin-top:3px;font-size:11px;line-height:1.28}
.quest-tracker li{margin-top:4px;padding-left:6px;border-left-width:1px}
.quest-tracker li span{font-size:10.5px}

/* Short status chips instead of big blocks. */
.message{
  bottom:145px;
  max-width:min(440px,calc(100% - 32px));
  padding:6px 11px;
  font-size:12px;
  line-height:1.3;
  background:var(--hud-glass);
  border:1px solid #8a7b5b77;
  border-radius:8px;
  box-shadow:0 5px 16px #0004;
  backdrop-filter:blur(3px);
}
#loot-notice{
  top:104px;
  padding:6px 10px;
  font-size:12px;
  border-radius:8px;
  background:rgba(20,31,23,.82);
  border-color:#b49a6588;
  box-shadow:0 5px 18px #0004;
}

/* Bottom action area: smaller but still comfortable to click. */
.bottom{bottom:10px}
.actions{gap:6px;margin-bottom:12px}
.actions button{
  width:56px;height:57px;
  border-width:1px;
  border-radius:5px;
  box-shadow:0 0 0 1px #22251e,0 3px 9px #0005;
}
.actions svg,.actions .ability .ability-icon svg{width:36px;height:36px}
.actions kbd{bottom:-8px;font-size:11px;padding:1px 4px}
.quantity{right:4px;bottom:3px;font-size:12px}
.ability-wait{font-size:16px}
.xp-bar{height:9px;margin:-6px auto 7px}
.xp-bar span{font-size:10px;line-height:8px}

/* Compact self/target frames. */
@media (min-width:1100px) and (min-height:600px){
  .unit-frame{
    width:205px;
    padding:4px 6px 5px;
    border-width:1px;
    box-shadow:0 3px 10px #0005;
    font-size:12px;
    border-radius:5px;
  }
  .unit-frame.self{right:calc(100% + 14px)}
  .unit-frame.target{left:calc(100% + 14px)}
  .unit-head{margin-bottom:3px}
  .unit-bar{height:16px;border-width:1px}
  .unit-bar span{line-height:14px;font-size:11px}
  .unit-bar.resource{height:8px}
  .unit-bar.resource span{line-height:7px;font-size:9px}
}

/* Chat looks like floating text until the player actually opens it. */
.chat{left:12px;bottom:190px;width:min(310px,calc(100% - 24px));font-size:12px}
.chat-log{
  padding:4px 7px;
  max-height:6.6em;
  background:rgba(18,23,20,.48);
  border-left:1px solid #8a7b5b99;
  border-radius:0 5px 5px 0;
}
.chat.open .chat-log{max-height:11em;background:rgba(18,23,20,.82)}
.chat-form{pointer-events:auto;margin-top:4px}
.chat-form input{padding:5px 7px;font-size:12px}
.chat-form button{padding:5px 9px;font-size:12px}

/* Combat meter: substantially smaller and less block-like. */
.combat-meter{
  right:12px;
  bottom:190px;
  width:218px;
  padding:6px;
  border-color:#8a7b5b88;
  border-radius:6px;
  box-shadow:0 4px 14px #0005;
  background:rgba(18,23,20,.78);
  font-size:11px;
}
.combat-meter-head{gap:5px;padding-bottom:4px;border-bottom-color:#6f604577}
.combat-meter-head strong{font-size:12px}
.combat-meter button{padding:2px 5px;font-size:10px}
.combat-meter-sub{margin:4px 1px 3px;font-size:10px}
.combat-meter-list{gap:2px}
.combat-meter-row{min-height:23px;padding:2px 4px;border-color:#ffffff0c;background:#151a1699}
.combat-meter-line{gap:5px}
.combat-meter-flags{font-size:9px}
.combat-meter-empty{margin:5px 1px 1px;font-size:10px}

/* Party frames are information first; keep the actual party menu interactive. */
.group{top:88px;font-size:12px}
.party-frame{gap:5px;width:168px}
.party-portrait{flex-basis:32px;height:32px;border-width:1px;font-size:15px}
.party-level{font-size:9px;padding:0 3px}
.party-bars{gap:1px;padding:2px 3px;border-color:#6d5a3a99;background:rgba(18,23,20,.72)}
.party-name{font-size:11px}
.party-bar{height:8px}
.party-bar.res{height:5px}
.party-bar span{font-size:9px;line-height:7px}
.party-frame .buff{width:14px;height:14px}
.party-frame .buff svg{width:10px;height:10px}
.group #group-leave{padding:2px 6px;font-size:11px}

/* Buffs and small transient info. */
.buff{width:18px;height:18px;border-width:1px}
.buff svg{width:14px;height:14px}
.buff-time{font-size:9px;right:-2px;bottom:-4px}
.cast-bar{bottom:174px;width:min(270px,calc(100% - 40px));height:17px;border-width:1px}
.cast-bar span{font-size:11px;line-height:15px}
.cast-bar button{right:-25px;width:21px;height:19px;font-size:11px}

/* Player/context menus should feel like menus, not dialog boxes. */
.party-menu{
  gap:2px;
  min-width:140px;
  padding:5px;
  border-color:#ad946388;
  border-radius:6px;
  background:rgba(18,23,20,.94);
  box-shadow:0 7px 22px #0007;
  font-size:12px;
}
.party-menu button{padding:4px 7px;font-size:12px;border-radius:3px}
.player-menu{min-width:158px}

/* Info tooltips/cards: less padding and lighter chrome. */
.item-tip{width:235px}
.loot-card{padding:7px 9px;border-radius:6px;font-size:12px;line-height:1.32;box-shadow:0 6px 20px #0006}
.loot-card-name strong{font-size:14px}
.loot-card-stat,.loot-card-vs,.loot-card-why,.loot-card-desc,.loot-card-effect{font-size:11px}
.loot-card-vs{margin:5px 0 2px}
.loot-card-buttons{gap:5px;margin-top:6px}
.loot-card-buttons button{padding:5px 7px;font-size:11px}

/* Small dialogs are genuinely small now. Larger inventory/character windows keep their own layouts. */
.small-dialog{min-width:min(280px,calc(100% - 24px));padding:18px}
.small-dialog h2{font-size:20px;margin-bottom:4px}
.small-dialog p{font-size:13px;line-height:1.4;margin-bottom:11px}
.small-dialog button{padding:8px 12px;font-size:13px}
.dialog-buttons{gap:6px}

/* Mobile keeps the same compact philosophy without crushing controls. */
@media(max-width:800px){
  .hud{top:9px;left:8px;right:8px}
  .vitals{width:190px}
  .portrait{width:36px;height:40px}
  .quest{width:185px;padding:6px 8px}
  .quest h2{font-size:13px}
  .quest p{font-size:11px}
  .brand{top:76px}
  .brand h1{font-size:20px}
  .location{top:137px;font-size:10px}
  .message{bottom:138px;font-size:11px;padding:5px 8px}
  .chat{top:162px;bottom:auto;width:min(260px,calc(100% - 16px));font-size:11px}
  .combat-meter{top:214px;right:8px;bottom:auto;width:min(205px,calc(100% - 16px));max-height:34vh}
}


/* Compact stat and info panels */
.bag-info{
  padding:5px 7px;
  margin-top:4px;
  font-size:12px;
  border-color:#b49a6577;
  border-radius:5px;
  background:rgba(18,23,20,.82);
}
.bag-info p{margin:2px 0}
.bag-detail{padding-bottom:4px;margin-bottom:3px}
.bag-detail .item-buttons{gap:4px;margin-top:4px}
.bag-detail button,.char-info button{padding:4px 7px;font-size:12px;margin-top:4px}

.char-stats{
  grid-template-columns:repeat(4,1fr);
  gap:3px;
  padding:0 8px 6px;
  font-size:11px;
}
.char-stat{
  padding:3px 2px;
  border-color:#3e3a3088;
  background:rgba(18,23,20,.7);
  border-radius:3px;
}
.char-stat span{font-size:10px}
.char-stat strong{font-size:12px}
.char-info{
  margin:0 8px 6px;
  padding:5px 7px;
  font-size:12px;
  min-height:30px;
  border-color:#3e3a3088;
  background:rgba(18,23,20,.72);
  border-radius:4px;
}
.char-info p{margin:2px 0}
.char-feats{padding:0 10px 9px;font-size:12px}
.char-feats h3{font-size:13px}

@media(max-width:600px){
  .char-stats{grid-template-columns:repeat(3,1fr)}
}


/* Dungeon completion results */
.dungeon-complete{
  width:min(620px,calc(100% - 24px));
  padding:18px;
  border:1px solid #b49a65;
  border-radius:8px;
  background:linear-gradient(145deg,#2b3129,#151c18);
  box-shadow:0 18px 70px #000b,0 0 34px #b49a6522;
}
.dungeon-complete::backdrop{background:rgba(5,8,7,.58);backdrop-filter:blur(2px)}
.dungeon-complete .char-head{margin-bottom:10px}
.dungeon-complete .char-head h2{font-size:24px;letter-spacing:.4px}
.dungeon-complete .char-head p{margin:2px 0 0;color:#d5bd85;font-size:12px;text-transform:uppercase;letter-spacing:1.4px}
.dungeon-summary{display:flex;flex-direction:column;gap:10px}
.dungeon-summary-meta{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:5px;
}
.dungeon-summary-meta>div{
  padding:7px 8px;
  background:#111713aa;
  border:1px solid #5d533f88;
  border-radius:5px;
  text-align:center;
}
.dungeon-summary-meta span{display:block;font:10px system-ui,sans-serif;color:#ab9e80;text-transform:uppercase;letter-spacing:.7px}
.dungeon-summary-meta strong{display:block;margin-top:2px;font:18px Georgia,serif;color:#f0d796}
.dungeon-personal-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:5px}
.dungeon-personal-stats[hidden]{display:none}
.dungeon-personal-stats>div{padding:6px 8px;background:#182019cc;border:1px solid #6a5d4388;border-radius:4px}
.dungeon-personal-stats span{display:block;font:9px system-ui,sans-serif;color:#aaa18d;text-transform:uppercase;letter-spacing:.45px}
.dungeon-personal-stats strong{display:block;margin-top:2px;color:#e7d4aa;font:14px Georgia,serif;font-variant-numeric:tabular-nums}
.dungeon-score-head,.dungeon-score li{
  display:grid;
  grid-template-columns:minmax(120px,1fr) 90px 90px 55px;
  align-items:center;
  gap:7px;
}
.dungeon-score-head{
  padding:0 7px 3px;
  color:#a99d82;
  font:10px system-ui,sans-serif;
  text-transform:uppercase;
  letter-spacing:.45px;
}
.dungeon-score{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:3px}
.dungeon-score li{
  padding:6px 7px;
  background:rgba(18,24,20,.78);
  border-left:2px solid #8a7650aa;
  font:12px system-ui,sans-serif;
}
.dungeon-score li span:not(:first-child){text-align:right;font-variant-numeric:tabular-nums}
.dungeon-score li:first-child{border-left-color:#e0bd6f;background:rgba(47,41,28,.72)}
.dungeon-score b{color:#d5bd85;font-weight:600}
.dungeon-loot{
  padding-top:8px;
  border-top:1px solid #5d533f66;
}
.dungeon-loot h3{margin:0 0 6px;font:15px Georgia,serif;color:#ead29c}
#dungeon-complete-loot{display:grid;grid-template-columns:1fr 1fr;gap:4px}
.dungeon-loot-row{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:6px 8px;
  background:#11171399;
  border:1px solid #453f3488;
  border-radius:4px;
  font:11px system-ui,sans-serif;
}
.dungeon-loot-row strong{font-size:12px}
.dungeon-loot-row span{color:#aaa18d;white-space:nowrap}
.dungeon-loot-row.rarity-rare strong{color:#96bcdf}
.dungeon-loot-row.rarity-epic strong{color:#c99bff}
.dungeon-loot-row.rarity-legendary strong{color:#ffb454}
.dungeon-loot-row.rarity-mythic strong{color:#e899ff;text-shadow:0 0 6px #b44cff66}
.dungeon-loot-row.gold strong{color:#f0d796}
.dungeon-complete-buttons{justify-content:flex-end;margin-top:2px}
.dungeon-complete-buttons button{padding:7px 11px;font-size:12px}
.dungeon-complete-buttons button:disabled{opacity:.42;cursor:not-allowed}
@media(max-width:560px){
  .dungeon-complete{padding:12px}
  .dungeon-summary-meta{grid-template-columns:repeat(2,1fr)}
  .dungeon-personal-stats{grid-template-columns:repeat(2,1fr)}
  .dungeon-score-head,.dungeon-score li{grid-template-columns:minmax(95px,1fr) 66px 66px 40px;gap:4px}
  .dungeon-score-head{font-size:9px}
  .dungeon-score li{font-size:10px}
  #dungeon-complete-loot{grid-template-columns:1fr}
}


/* Combat feedback polish */
.unit-frame.target.on{
  border-color:#b49a65aa;
  box-shadow:0 3px 10px #0005,0 0 0 1px #b49a6533;
}
.unit-frame.target.on.boss{
  border-color:#dfaa61;
  box-shadow:0 3px 12px #0006,0 0 10px #d88d3633;
}
.unit-frame.target.on.danger{
  border-color:#e66a4e;
  box-shadow:0 3px 12px #0007,0 0 12px #e64f303f;
}
.unit-frame.target.on.danger .unit-head{color:#ffd0c6}
.buff{position:relative}
.buff-buff-mythic,.buff-mythic{border-color:#b56cff!important;box-shadow:0 0 6px #b56cff55}


/* Finished MMO chat system */
.chat{
  width:min(370px,calc(100% - 24px));
  font:12px/1.35 system-ui,sans-serif;
}
.chat-tabs{
  display:none;
  gap:3px;
  align-items:center;
  margin-bottom:4px;
  pointer-events:auto;
}
.chat.open .chat-tabs{display:flex}
.chat-tabs button{
  position:relative;
  padding:3px 6px;
  border:1px solid #5f5644;
  border-radius:3px;
  background:rgba(18,23,20,.86);
  color:#bdb39d;
  font:10px system-ui,sans-serif;
}
.chat-tabs button[aria-selected=true]{
  color:#f0d796;
  border-color:#a88d57;
  background:#332f24e8;
}
.chat-tabs button.unread::after{
  content:attr(data-unread);
  position:absolute;
  top:-7px;
  right:-6px;
  min-width:13px;
  height:13px;
  padding:0 2px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:#b75848;
  color:#fff;
  font:8px/1 system-ui,sans-serif;
  box-shadow:0 1px 3px #0009;
}
.chat-log{
  max-height:7em;
  padding:5px 7px;
  gap:1px;
  background:linear-gradient(90deg,rgba(16,21,18,.68),rgba(16,21,18,.28));
  border-left:1px solid #8a7b5b99;
  border-radius:0 5px 5px 0;
}
.chat.open .chat-log{
  max-height:190px;
  overflow-y:auto;
  overscroll-behavior:contain;
  pointer-events:auto;
  background:rgba(15,20,17,.9);
  border:1px solid #6b604a;
  scrollbar-width:thin;
}
.chat-log li{
  padding:1px 2px;
  color:#ddd4c1;
}
.chat-log li[hidden]{display:none}
.chat-time{
  display:none;
  margin-right:5px;
  color:#746f64;
  font-size:9px;
  font-variant-numeric:tabular-nums;
}
.chat.open .chat-time{display:inline}
.chat-label{
  display:inline-block;
  min-width:42px;
  margin-right:2px;
  color:#8e8778;
  font-size:9px;
  text-transform:uppercase;
  letter-spacing:.4px;
}
.chat-name{
  display:inline;
  padding:0;
  border:0;
  background:none;
  color:#e6d0a0;
  font:600 inherit;
  cursor:pointer;
}
.chat-name:hover,.chat-name:focus-visible{color:#fff0bd;text-decoration:underline;outline:0}
.chat-log .self .chat-name{color:#a9d299}
.chat-log .party,.chat-log .party .chat-name{color:#87c9e8}
.chat-log .party .chat-label{color:#68aeca}
.chat-log .whisper,.chat-log .whisper .chat-name{color:#d9a9f0}
.chat-log .whisper .chat-label{color:#b97cd6}
.chat-log .system{color:#d8a38e;font-style:italic}
.chat-log .system .chat-label{color:#ba7562}
.chat-log .old{opacity:.58}
.chat-log .emote{font-style:italic;color:#e6dcc3}
.chat-form{
  display:flex;
  gap:4px;
  margin-top:4px;
  pointer-events:auto;
}
.chat-form[hidden]{display:none}
.chat-form select{
  flex:0 0 72px;
  min-width:0;
  padding:5px 4px;
  border:1px solid #6d6150;
  border-radius:3px;
  background:#171d19;
  color:#d9ceb5;
  font:11px system-ui,sans-serif;
}
.chat-form input{
  padding:5px 7px;
  font-size:12px;
}
.chat-form button{
  padding:5px 8px;
  font-size:11px;
}
.chat-help{
  display:none;
  margin:3px 2px 0;
  color:#847e70;
  font:9px/1.25 system-ui,sans-serif;
  pointer-events:none;
}
.chat.open .chat-help{display:block}
.chat.quiet:not(.open) .chat-log{opacity:.28}
#chat-button{position:relative}
#chat-button.chat-unread::after{
  content:attr(data-unread);
  position:absolute;
  top:-6px;
  right:-6px;
  min-width:14px;
  height:14px;
  padding:0 2px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:#b75848;
  color:white;
  font:9px/1 system-ui,sans-serif;
  box-shadow:0 1px 4px #0008;
}
@media(max-width:800px){
  .chat{top:162px;left:8px;width:min(340px,calc(100% - 16px));font-size:11px}
  .chat.open .chat-log{max-height:150px}
  .chat-tabs{overflow-x:auto;padding-top:7px}
  .chat-tabs button{white-space:nowrap}
}


/* Direct-message composer */
.chat-recipient{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:5px;
  max-width:155px;
  padding:3px 5px 3px 7px;
  border:1px solid #9b6cb2;
  border-radius:4px;
  background:rgba(55,34,65,.92);
  color:#e2b7f1;
  font:10px/1.2 system-ui,sans-serif;
}
.chat-recipient[hidden]{display:none}
.chat-recipient span{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.chat-recipient strong{color:#f1d5fa;font-weight:700}
.chat-recipient button{
  flex:0 0 18px;
  width:18px;
  height:18px;
  padding:0;
  border:0;
  border-radius:50%;
  background:#8a587f;
  color:#fff;
  font:14px/17px system-ui,sans-serif;
  cursor:pointer;
}
.chat-recipient button:hover,.chat-recipient button:focus-visible{background:#ad73a4;outline:1px solid #f0d2ff}
.chat-form:has(.chat-recipient:not([hidden])) input{border-color:#9b6cb2;box-shadow:inset 0 0 0 1px #9b6cb222}


/* Crafting browser ---------------------------------------------------------
   Cooking and smithing share the same visual grammar: compact cards, visible
   requirements and a small set of filters. The older id rules remain as safe
   fallbacks; these scoped rules intentionally override them. */
#cook-dialog,#smith-dialog{
  width:min(980px,calc(100% - 28px));
  max-height:calc(100dvh - 28px);
  padding:0;
  overflow:auto;
  border:1px solid #8f7a52;
  border-radius:10px;
  background:
    radial-gradient(circle at 18% 0%,#66583b2d 0 28%,transparent 50%),
    linear-gradient(160deg,#28271f 0%,#151b17 58%,#101511 100%);
  box-shadow:0 24px 90px #000c, inset 0 1px #ffffff10;
}
#cook-dialog::backdrop,#smith-dialog::backdrop{background:#070b09c9;backdrop-filter:blur(2px)}
#cook-dialog>.inventory-heading,#smith-dialog>.inventory-heading{
  position:sticky;top:0;z-index:8;
  display:flex;align-items:center;justify-content:space-between;gap:18px;
  padding:20px 22px 16px;
  margin:0;
  background:linear-gradient(180deg,#2d2b22f7,#20231cf3);
  border-bottom:1px solid #ffffff12;
  box-shadow:0 8px 24px #0005;
}
#cook-dialog .inventory-heading h2,#smith-dialog .inventory-heading h2{
  margin:0;color:#f0ddb0;font-size:27px;letter-spacing:.02em;
}
#cook-dialog .inventory-heading p,#smith-dialog .inventory-heading p{
  margin:3px 0 0;color:#aaa58f;font:13px/1.4 system-ui,sans-serif;
}
#cook-close,#smith-close{
  min-width:74px;background:#171b17;border-color:#6c654e!important;color:#ded5bd;
}
#cook-close:hover,#smith-close:hover{background:#262b22;border-color:#b19b67!important}
#cook-quest,#smith-quest{
  margin:0!important;padding:15px 22px!important;
  border-bottom:1px solid #ffffff0c;
  background:#1117137a;
  color:#c9c3ad!important;font:14px/1.55 system-ui,sans-serif!important;
}
#smith-job{margin:14px 22px 0}
#cook-dialog>h3,#smith-dialog>h3{
  margin:18px 22px 8px!important;color:#d2ba83!important;
}
#smith-all-label{
  margin:0 22px 10px;
  display:flex;align-items:center;gap:8px;color:#bdb49d;font:13px/1.4 system-ui,sans-serif;
}
#smith-all-label input{accent-color:#b99b5d}

.craft-toolbar{
  display:flex;flex-wrap:wrap;gap:7px;
  padding:10px 22px 12px;
  border-bottom:1px solid #ffffff0d;
  background:#111713b8;
}
#cook-dialog .craft-toolbar{position:sticky;top:76px;z-index:7}
#smith-dialog .craft-toolbar{position:sticky;top:76px;z-index:7}
#cook-dialog button.craft-filter,#smith-dialog button.craft-filter{
  min-height:30px;padding:5px 10px;
  border:1px solid #4f5548;border-radius:999px;
  background:#1a211b;color:#aaa996;
  font:600 12px/1.2 system-ui,sans-serif;
  letter-spacing:.01em;
}
#cook-dialog button.craft-filter:hover,#smith-dialog button.craft-filter:hover{
  color:#eee0bd;border-color:#8d7b55;background:#252a21;
}
#cook-dialog button.craft-filter.active,#smith-dialog button.craft-filter.active{
  color:#171810;background:linear-gradient(#d9c086,#b89655);border-color:#e0c98f;
  box-shadow:0 0 0 1px #0006,inset 0 1px #fff7;
}

.craft-grid{
  list-style:none!important;
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;
  padding:14px 22px 20px!important;margin:0!important;
}
#cook-recipes.craft-grid li,#smith-recipes.craft-grid li{border-bottom:0;padding:0}
.craft-card{
  --rarity:#8f948b;
  position:relative;display:flex!important;flex-direction:column;align-items:stretch!important;
  gap:10px!important;min-width:0;
  padding:14px!important;
  border:1px solid #ffffff12!important;border-left:3px solid var(--rarity)!important;
  border-radius:8px;
  background:linear-gradient(145deg,#232820e8,#161b17ed);
  box-shadow:0 7px 20px #0005,inset 0 1px #ffffff08;
  transition:transform .12s ease,border-color .12s ease,background .12s ease;
}
.craft-card.ready:hover{transform:translateY(-1px);background:linear-gradient(145deg,#293026,#181f19)}
.craft-card.unavailable{opacity:.78;background:linear-gradient(145deg,#20231e,#151815)}
.craft-card.rarity-common{--rarity:#a5aaa2}
.craft-card.rarity-uncommon{--rarity:#67b36f}
.craft-card.rarity-rare{--rarity:#5b9dd9}
.craft-card.rarity-epic{--rarity:#a276d6}
.craft-card.rarity-legendary{--rarity:#d49445}
.craft-card.rarity-mythic{--rarity:#d15bcc}

.craft-card-top{display:flex;align-items:center;gap:11px;min-width:0;min-height:54px}
.craft-item-icon{
  width:54px;height:54px;flex:0 0 54px;
  display:grid;place-items:center;border:1px solid color-mix(in srgb,var(--rarity) 58%,#403b31);
  border-radius:7px;background:#0e130f;box-shadow:inset 0 0 18px #0008;
  outline:none;cursor:help;
}
.craft-item-icon:focus-visible{box-shadow:0 0 0 2px #e6c97a,inset 0 0 18px #0008}
.craft-item-icon .item-icon{width:42px;height:42px}
.craft-item-icon .item-icon svg{width:100%;height:100%}
.craft-card-title{min-width:0;flex:1}
.craft-name-row{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.craft-name{font:700 15px/1.2 system-ui,sans-serif;overflow-wrap:anywhere}
.craft-level{
  flex:0 0 auto;padding:3px 6px;border:1px solid #ffffff13;border-radius:4px;
  background:#0e130fc4;color:#aaa997;font:600 10px/1.2 system-ui,sans-serif;
}
.craft-rarity{
  display:block;margin-top:4px;color:var(--rarity);font:700 10px/1 system-ui,sans-serif;
  letter-spacing:.12em;text-transform:uppercase;
}
.craft-stat,.craft-description{
  margin:0!important;color:#d0c9b5!important;font:13px/1.45 system-ui,sans-serif!important;
}
.craft-description{color:#989a8c!important;font-size:12px!important}
.craft-effects{
  list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:5px;
}
/* The old #cook-recipes li / #smith-recipes li rules also match the nested
   effect rows. Use a more specific selector so effect text keeps the full
   card width instead of collapsing beside the item icon. */
#cook-recipes .craft-effects>li,
#smith-recipes .craft-effects>li{
  position:relative;
  display:block;
  width:100%;
  min-width:0;
  margin:0;
  padding:0 0 0 15px;
  border:0;
  align-items:initial;
  justify-content:initial;
  gap:0;
  white-space:normal;
  overflow-wrap:break-word;
  color:#d4ceb8;
  font:12.5px/1.45 system-ui,sans-serif;
}
#cook-recipes .craft-effects>li::before,
#smith-recipes .craft-effects>li::before{
  content:"•";
  position:absolute;
  left:1px;
  top:0;
  color:#8e9e80;
}
#cook-recipes .craft-effects>li.buff,
#smith-recipes .craft-effects>li.buff{
  padding:7px 9px 7px 28px;
  border:1px solid #9b7d3d4d;
  border-radius:5px;
  background:linear-gradient(90deg,#2a2415cc,#1a1c15a8);
  color:#ead08a;
  font-weight:650;
}
#cook-recipes .craft-effects>li.buff::before,
#smith-recipes .craft-effects>li.buff::before{
  content:"✦";
  left:10px;
  top:7px;
  color:#e2b95c;
}

.craft-materials{display:flex;flex-wrap:wrap;gap:6px}
.craft-material,.craft-owned{
  min-height:25px;display:inline-flex;align-items:center;gap:5px;
  padding:3px 7px;border:1px solid #ffffff0f;border-radius:5px;
  background:#0c120ecf;color:#b9b7a6;font:600 11px/1.2 system-ui,sans-serif;
}
.craft-material .item-icon{width:17px;height:17px}
.craft-material .item-icon svg{width:100%;height:100%}
.craft-material.have{border-color:#5d7d5d66;color:#b8d2ad}
.craft-material.missing{border-color:#935e5066;color:#dda896;background:#1d1210}
.craft-owned{color:#cdbd92}
.craft-notes{display:flex;flex-direction:column;gap:4px}
.craft-warning{
  color:#d9aa7e;font:12px/1.35 system-ui,sans-serif;
}
.craft-state{
  margin-top:auto;padding:7px 8px;border-radius:5px;
  font:600 11.5px/1.35 system-ui,sans-serif;
}
.craft-state.available{background:#152417;color:#a9d2a6;border:1px solid #6aa46842}
.craft-state.blocked{background:#241714;color:#d2a08f;border:1px solid #a5645140}

.craft-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:1px}
#cook-dialog .craft-actions button,#smith-dialog .craft-actions button{
  min-height:34px;padding:7px 10px;flex:1 1 auto;
  border-radius:5px;font:700 12px/1 system-ui,sans-serif;
}
#cook-dialog .craft-actions .craft-primary,#smith-dialog .craft-actions .craft-primary{
  color:#191910;border-color:#d2b66f;
  background:linear-gradient(#d7bf83,#ae8d4f);
  box-shadow:inset 0 1px #fff7;
}
#cook-dialog .craft-actions .craft-primary:hover:not(:disabled),
#smith-dialog .craft-actions .craft-primary:hover:not(:disabled){filter:brightness(1.08)}
#cook-dialog .craft-actions .secondary,#smith-dialog .craft-actions .secondary{
  background:#171d18;color:#c8c2ae;border-color:#555746;
}
#cook-dialog .craft-actions button:disabled,#smith-dialog .craft-actions button:disabled{
  opacity:.34;filter:saturate(.45);cursor:not-allowed;
}

.craft-empty{
  grid-column:1/-1!important;padding:34px!important;text-align:center;
  border:1px dashed #ffffff18!important;border-radius:8px;color:#96998b;
  font:14px/1.5 system-ui,sans-serif;
}
#cook-status,#smith-status{
  position:sticky;bottom:0;z-index:9;
  min-height:21px!important;margin:0!important;padding:11px 22px!important;
  border-top:1px solid #ffffff13;
  background:#101510f2;color:#e2ce95!important;
  box-shadow:0 -8px 22px #0005;
}

#cook-dialog .item-tip,#smith-dialog .item-tip{
  max-width:min(330px,calc(100vw - 20px));
  border-radius:7px;box-shadow:0 14px 40px #000c;
}

@media(max-width:760px){
  #cook-dialog,#smith-dialog{width:min(620px,calc(100% - 16px));max-height:calc(100dvh - 16px)}
  .craft-grid{grid-template-columns:1fr;padding:12px 12px 18px!important}
  .craft-toolbar{padding-left:12px;padding-right:12px}
  #cook-dialog>.inventory-heading,#smith-dialog>.inventory-heading{padding:15px 14px 13px}
  #cook-dialog .inventory-heading h2,#smith-dialog .inventory-heading h2{font-size:22px}
  #cook-quest,#smith-quest{padding:12px 14px!important}
  #cook-status,#smith-status{padding:10px 14px!important}
  #smith-dialog>h3,#cook-dialog>h3,#smith-all-label{margin-left:14px!important;margin-right:14px!important}
}
@media(max-width:440px){
  .craft-toolbar{gap:5px}
  #cook-dialog button.craft-filter,#smith-dialog button.craft-filter{padding:5px 8px;font-size:11px}
  .craft-card{padding:11px!important}
  .craft-card-top{min-height:48px}
  .craft-item-icon{width:48px;height:48px;flex-basis:48px}
  .craft-item-icon .item-icon{width:37px;height:37px}
  .craft-name-row{display:block}
  .craft-level{display:inline-block;margin-top:4px}
}


/* Linked personal bank ----------------------------------------------------- */
#bank-dialog{
  width:min(860px,calc(100% - 24px));height:min(640px,calc(100dvh - 32px));max-height:calc(100dvh - 32px);
  padding:0;overflow:hidden;flex-direction:column;
  border:1px solid #77684b;border-radius:9px;
  background:linear-gradient(155deg,#202722,#101713);
  box-shadow:0 24px 90px #000c;
}
#bank-dialog[open]{display:flex}
#bank-dialog::backdrop{background:#070b09ce;backdrop-filter:blur(2px)}
.bank-head{flex:0 0 auto;padding:15px 18px;border-bottom:1px solid #ffffff13;background:linear-gradient(#252c26,#171e19)}
.bank-head h2{margin:0;color:#e7d29c}.bank-head p{margin:3px 0 0;color:#999d8d;font:12px/1.4 system-ui,sans-serif}
.bank-toolbar{flex:0 0 auto;display:flex;gap:9px;padding:10px 14px;background:#111813;border-bottom:1px solid #ffffff0c}
#bank-search{flex:1;min-width:150px;padding:9px 11px;border:1px solid #4a5145;border-radius:5px;background:#0b110d;color:#e2decf}
#bank-deposit-materials{white-space:nowrap}
.bank-filters{flex:0 0 auto;display:flex;flex-wrap:wrap;gap:6px;padding:8px 14px;background:#111813;border-bottom:1px solid #ffffff0c}
.bank-filter{padding:5px 10px!important;border-radius:999px!important;background:#1a211b!important;border:1px solid #4f574b!important;color:#aaa!important;font:600 12px/1.2 system-ui,sans-serif!important}
.bank-filter.active{background:#b59759!important;border-color:#d5bc7e!important;color:#171810!important}
.bank-layout{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(250px,.75fr);flex:1 1 auto;min-height:0;overflow:hidden}
.bank-vault,.bank-bag{min-height:0;padding:12px 14px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.bank-vault{border-right:1px solid #ffffff10}
.bank-section-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.bank-section-head h3{margin:0;color:#d8c38f;font-size:14px;letter-spacing:.08em;text-transform:uppercase}
.bank-section-head strong,.bank-section-head span{color:#a9aa9d;font:12px/1.3 system-ui,sans-serif}
.bank-grid{display:grid;grid-template-columns:repeat(10,minmax(42px,1fr));gap:5px;align-content:start}
.bank-slot{
  position:relative;aspect-ratio:1;min-width:0;padding:4px!important;display:grid;place-items:center;
  border:1px solid #454c43!important;border-radius:4px!important;background:#0b110d!important;
  color:#c8c3af;box-shadow:inset 0 0 10px #0008;
}
.bank-slot:hover:not(.empty),.bank-slot.selected{border-color:#d0b56f!important;background:#182019!important}
.bank-slot.empty{opacity:.42;background:#0a0e0b!important}
.bank-slot .item-icon{width:100%;height:100%;max-width:38px;max-height:38px}
.bank-slot .item-icon svg{width:100%;height:100%}
.bank-count{position:absolute;right:2px;bottom:1px;padding:0 2px;border-radius:3px;background:#080b09d9;color:#fff;font:700 10px/1.2 system-ui,sans-serif;text-shadow:0 1px #000}
.bank-empty{grid-column:1/-1;margin:18px 0!important;color:#8f9489!important;text-align:center;font:13px/1.5 system-ui,sans-serif!important}
.bank-selected{
  min-height:42px;margin-top:10px;padding:9px 10px;display:flex;align-items:center;gap:10px;
  border:1px solid #ffffff10;border-radius:5px;background:#0c120e;
}
.bank-selected:empty{display:none}
.bank-selected>strong{margin-right:auto}.bank-selected-count{color:#999d90;font-size:12px}
.bank-selected-actions{display:flex;gap:6px}.bank-selected-actions button{padding:6px 9px;font-size:12px}
.bank-bags{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.bank-bag-row{
  display:grid;grid-template-columns:38px minmax(0,1fr) auto;align-items:center;gap:8px;
  padding:8px;border:1px solid #ffffff0e;border-radius:5px;background:#151c17;
}
.bank-bag-icon{width:36px;height:36px;display:grid;place-items:center;background:#0c110e;border:1px solid #41473f;border-radius:4px;cursor:help}
.bank-bag-icon .item-icon{width:30px;height:30px}.bank-bag-icon svg{width:100%;height:100%}
.bank-bag-info{min-width:0;display:flex;flex-direction:column;gap:2px}.bank-bag-info strong{font-size:12px;overflow-wrap:anywhere}.bank-bag-info span{font-size:11px;color:#969b8e}
.bank-bag-actions{display:flex;gap:5px}.bank-bag-actions button{padding:5px 7px;font-size:11px;white-space:nowrap}
#bank-status{flex:0 0 auto;min-height:20px;margin:0;padding:9px 14px;border-top:1px solid #ffffff12;background:#0d130f;color:#e1ce96;font:12px/1.4 system-ui,sans-serif}
@media(max-width:800px){
  #bank-dialog{
    width:calc(100% - 12px);height:min(600px,calc(100dvh - 16px));max-height:calc(100dvh - 16px);
  }
  .bank-layout{display:block;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
  .bank-vault,.bank-bag{overflow:visible}
  .bank-vault{border-right:0;border-bottom:1px solid #ffffff10}
  .bank-grid{grid-template-columns:repeat(8,minmax(36px,1fr))}
}
@media(max-width:520px){
  .bank-toolbar{flex-direction:column}.bank-grid{grid-template-columns:repeat(6,minmax(34px,1fr))}
  .bank-bag-row{grid-template-columns:34px minmax(0,1fr)}.bank-bag-actions{grid-column:1/-1}.bank-bag-actions button{flex:1}
  .bank-selected{align-items:flex-start;flex-wrap:wrap}.bank-selected-actions{width:100%}.bank-selected-actions button{flex:1}
}


/* Waystones --------------------------------------------------------------- */
#waystone-dialog{
  width:min(610px,calc(100% - 22px));padding:0;overflow:hidden;
  border:1px solid #557f8f;border-radius:9px;
  background:
    radial-gradient(circle at 50% -15%,#347f9a2e 0 30%,transparent 55%),
    linear-gradient(155deg,#1c2628,#0f1719);
  box-shadow:0 24px 90px #000c,0 0 32px #3abce91c;
}
#waystone-dialog::backdrop{background:#050b0dcc;backdrop-filter:blur(2px)}
#waystone-dialog .char-head{
  padding:17px 18px;border-bottom:1px solid #75d9f51f;
  background:linear-gradient(#203239,#142126);
}
#waystone-dialog .char-head h2{margin:0;color:#aeeaff}
#waystone-dialog .char-head p{margin:3px 0 0;color:#8fa9b0;font:12px/1.4 system-ui,sans-serif}
.waystone-body{padding:14px 16px 16px}
.waystone-progress-row{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  margin-bottom:11px;padding:8px 10px;border:1px solid #65bad22e;border-radius:6px;background:#0a1418a8;
}
.waystone-progress-row strong{color:#c3edf7;font:700 12px/1.3 system-ui,sans-serif}
.waystone-progress-row span{color:#799197;text-align:right;font:11px/1.35 system-ui,sans-serif}
.waystone-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:7px;max-height:min(52vh,470px);overflow:auto}
.waystone-destination{
  display:grid;grid-template-columns:38px minmax(0,1fr) auto;gap:9px;align-items:center;
  padding:9px 10px;border:1px solid #ffffff10;border-radius:6px;
  background:linear-gradient(145deg,#172328,#10191c);
}
.waystone-destination.current{border-color:#69cae354;background:linear-gradient(145deg,#1c343b,#102128)}
.waystone-rune{
  width:34px;height:34px;display:grid;place-items:center;border-radius:50%;
  color:#9eeaff;background:#0b1b21;border:1px solid #51c3e15c;
  text-shadow:0 0 10px #55d7ff;box-shadow:inset 0 0 14px #43c8ee18;
}
.waystone-destination-info{display:flex;min-width:0;flex-direction:column;gap:2px}
.waystone-destination-info strong{color:#d6edf1;font:700 13px/1.25 system-ui,sans-serif}
.waystone-destination-info span{color:#829aa0;font:11px/1.3 system-ui,sans-serif}
.waystone-destination button{min-width:76px;padding:7px 10px}
.waystone-empty{
  padding:24px 16px;text-align:center;border:1px dashed #70b6c52d;border-radius:6px;
  color:#84989c;font:13px/1.55 system-ui,sans-serif;
}
#waystone-status{min-height:18px;margin:11px 0 0;color:#bce8f1;font:12px/1.4 system-ui,sans-serif}
@media(max-width:520px){
  .waystone-progress-row{align-items:flex-start;flex-direction:column}
  .waystone-progress-row span{text-align:left}
  .waystone-destination{grid-template-columns:34px minmax(0,1fr)}
  .waystone-destination button{grid-column:1/-1;width:100%}
}


/* Innkeeper home confirmation --------------------------------------------- */
#inn-dialog{
  width:min(500px,calc(100% - 22px));padding:0;overflow:hidden;
  border:1px solid #8c7448;border-radius:9px;
  background:
    radial-gradient(circle at 50% -25%,#c59b4524 0 32%,transparent 58%),
    linear-gradient(155deg,#27251f,#121713);
  box-shadow:0 24px 90px #000c;
}
#inn-dialog::backdrop{background:#070a08cf;backdrop-filter:blur(2px)}
.inn-head{padding:17px 18px;border-bottom:1px solid #d0ad6626;background:linear-gradient(#302b21,#1b1c17)}
.inn-head h2{margin:0;color:#ecd49b}.inn-head p{margin:3px 0 0;color:#a8a18e;font:12px/1.4 system-ui,sans-serif}
.inn-body{padding:17px 18px 18px}
.inn-home-change{
  display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:stretch;gap:10px;
  margin-bottom:16px;
}
.inn-home-place{
  min-width:0;padding:12px 11px;border:1px solid #ffffff12;border-radius:7px;
  background:#0d120f;
}
.inn-home-place.new{border-color:#c39d514d;background:#17170f}
.inn-home-place span{display:block;margin-bottom:4px;color:#8e9488;font:600 10px/1.2 system-ui,sans-serif;letter-spacing:.08em;text-transform:uppercase}
.inn-home-place strong{display:block;color:#d9d1bb;font:700 14px/1.3 system-ui,sans-serif;overflow-wrap:anywhere}
.inn-home-place.new strong{color:#efd18c}
.inn-home-arrow{align-self:center;color:#b49a65;font-size:20px}
.inn-question{margin:0;color:#d8d2bf;font:14px/1.55 system-ui,sans-serif}
.inn-status{min-height:20px;margin:8px 0 0;color:#d8bf83;font:12px/1.4 system-ui,sans-serif}
.inn-actions{justify-content:flex-end;margin-top:13px}
#inn-dialog button{min-height:40px;padding:9px 14px;border:1px solid #806b43;border-radius:5px}
#inn-confirm{background:linear-gradient(#d5ba78,#aa884b);color:#17170f;font-weight:700;border-color:#d7bd7b!important}
#inn-confirm:disabled{opacity:.55;cursor:default}
#inn-cancel{background:#171d18;color:#c9c4b4}
@media(max-width:460px){
  .inn-body{padding:14px}
  .inn-home-change{grid-template-columns:1fr;gap:7px}
  .inn-home-arrow{justify-self:center;transform:rotate(90deg)}
  .inn-actions{display:grid;grid-template-columns:1fr 1fr}
}
/* The Respawn button shown while one is down (src/game.js updateRespawn). */
.respawn-panel{position:fixed;left:50%;top:calc(64% + 24px);transform:translateX(-50%);z-index:45;display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center}
.respawn-panel[hidden]{display:none}
.respawn-panel p{margin:0;color:#e9cf98;font:16px Georgia,serif;text-shadow:0 1px 3px #000}
.respawn-panel button{font-size:18px;padding:10px 28px;border:1px solid #a38b56;border-radius:2px;background:#4a3d22;color:#f4e6bf;cursor:pointer}
.respawn-panel button:disabled{opacity:.45;cursor:default}
/* The bag and character panels sit at the side; the world stays bright behind them. An id rule above had out-ranked the class rule that made the bag's backdrop clear. */
#inventory-dialog::backdrop,.character-dialog::backdrop{background:transparent}
/* Party frames (src/group-ui.js): the targeted mate, the tools to move them and to lay them out side by side. */
.group-tools{display:flex;gap:4px;margin:0 0 4px}
.group .group-tools button{border:1px solid #6d5a3a;background:#151915e6;color:#e8d9b0;padding:0 6px;font:14px/20px system-ui,sans-serif;min-width:24px;border-radius:2px}
#group-move{cursor:grab;touch-action:none}#group-move:active{cursor:grabbing}
.party-frame{cursor:pointer}
.party-frame.targeted .party-bars{outline:2px solid #f0d796;outline-offset:1px}
.party-frame.targeted .party-portrait{border-color:#f0d796;box-shadow:0 0 8px #f0d79688}
.group.horizontal ul.party{flex-direction:row;flex-wrap:wrap}
/* Phones: the unit frames are hidden, but the target is shown small just above the action bar, so one can see what one is fighting. */
@media(max-width:700px){
  .unit-frame.target.on{display:block;position:absolute;left:8px;top:auto;bottom:calc(100% + 6px);width:min(200px,52vw);padding:3px 6px;z-index:6;background:#161a17e6;border:1px solid #ad9463;border-radius:3px;font-size:12px}
  .unit-frame.target.on .unit-head{font-size:12px;display:flex;justify-content:space-between;gap:8px}
}
.talent-dialog{width:min(1000px,calc(100% - 16px));max-height:calc(100dvh - 16px);overflow:auto;padding:0}
.talent-dialog .char-head{position:sticky;top:0;z-index:2}
.talent-grid{display:grid;grid-template-columns:1fr;gap:12px;margin:10px 12px}
.talent-branch{display:flex;flex-direction:column;background:#141814;border:1px solid #3e3a30;border-radius:4px;padding:8px}
.talent-branch h3{margin:0 0 8px;font-size:16px;color:#e6d0a0;text-align:center}
.talent-rows{display:grid;gap:6px}
.talent-row{display:grid;grid-template-columns:26px 1fr 1fr;gap:6px;align-items:stretch}
.talent-gate{display:flex;align-items:center;justify-content:center;font-size:12px;color:#7d7560;border-right:1px solid #3e3a30}
.talent-gate.open{color:#9fe08f}
.talent{display:block;position:relative;text-align:left;background:#1d231d;border:1px solid #5a5a48;color:#e6d0a0;padding:5px 8px;height:78px;overflow:hidden}
.talent strong{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:13px;line-height:1.2;font-weight:600;padding-right:30px}
.talent small{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin-top:3px;color:#c4b99d;font-size:11.5px;line-height:1.25}
.talent-rank{position:absolute;top:5px;right:8px;color:#f0d796;font-size:13px}
.talent.learned{border-color:#aa8b52;background:#262a1e}
.talent.maxed{border-color:#f0d796;background:#2f2c1c}
.talent.capstone{grid-column:2/-1;height:auto;min-height:50px}
.talent.locked{opacity:.45;border-color:#3e3a30}
.talent:disabled:not(.locked){opacity:1}
.talent:disabled{cursor:default}
.talent-dialog>p,.talent-dialog>button{margin-left:12px;margin-right:12px}
#talent-reset{margin-top:6px;margin-bottom:12px}
@media (min-width:820px){
  .talent-grid{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:auto repeat(10,78px);column-gap:12px;row-gap:6px}
  .talent-branch{display:grid;grid-template-rows:subgrid;grid-row:span 11;row-gap:6px}
  .talent-branch h3{margin:0;align-self:center}
  .talent-rows{display:contents}
  .talent-row{grid-row:auto}
  .talent.capstone{height:78px;min-height:0}
}
