:root{--gold:#b8a16b;--line:#61533c;--blue:#75c5f7;--panel:#111214;--text:#e6e3de}*{box-sizing:border-box}body{margin:0;background:#050506;color:var(--text);font:14px Georgia,'Times New Roman',serif}.screen{width:min(100vw,177.37vh);aspect-ratio:1646/928;margin:auto;position:relative;background:radial-gradient(ellipse at 50% 105%,#1d2117 0%,#090909 35%,#090a0b 75%);border:6px ridge #353637;overflow:hidden}.upper{position:absolute;inset:1.2% 5.9% 1.2% 5.9%;display:grid;grid-template-columns:40% 20% 40%;gap:0;}.panel{min-width:0;background:linear-gradient(135deg,#222326,#0b0b0d 10%,#121316 55%,#070708);border:5px ridge #3c3c3b;box-shadow:inset 0 0 0 3px #080809,inset 0 0 0 5px #5b5140,0 0 12px #000;padding:15px;display:flex;flex-direction:column;gap:9px}.bevel{border:3px ridge #5c513b;background:#101113;box-shadow:inset 0 0 12px #000}.chat-toolbar{display:flex;gap:5px;height:37px;min-width:0}.chat-toolbar select{min-width:0;flex:1;background:#111214;color:#e1d7bd;border:3px ridge #5c513b;font:14px Georgia;padding:2px}.chat-toolbar select:first-child{flex:1.1}.chat-toolbar select:nth-child(2){flex:.95}.chat-toolbar #system-toggle{flex:0 0 auto;white-space:nowrap;font:11px Georgia;padding:0 5px}.chat-log.hide-system .system-notice{display:none}.chat-log .word-filtered{display:none}.chat-toolbar #chat-filter-toggle{flex:0 0 auto;font:11px Georgia;padding:0 5px;white-space:nowrap}.chat-filter-panel{display:none;border:2px ridge #5c513b;background:#101113;padding:7px;flex-direction:column;gap:5px}.chat-filter-panel.open{display:flex}.chat-filter-panel[hidden]{display:none!important}.chat-filter-panel label{font:12px Georgia;color:#c3ad70}.chat-filter-panel textarea{resize:vertical;min-height:52px;max-height:130px;width:100%;background:#080808;border:2px ridge #574b35;color:#ddd;padding:6px;font:12px Arial}.chat-filter-panel small{font:11px Arial;color:#aaa}.lobby-title{height:37px;text-align:center;font:20px Arial;padding:5px}.chat-log{flex:1;overflow:auto;padding:12px 9px;font:clamp(10px,1.2vw,19px)/1.68 Arial;background:#060607}.chat-log p{margin:0 0 4px}.purple{color:#a54cff}.blue{color:var(--blue)}.yellow{color:#c6aa54}.chat-input{height:44px;display:flex;gap:5px}.chat-input input{flex:1;min-width:0;background:#080808;color:#ddd;border:3px ridge #574b35;padding:8px;font:16px Arial}.btn{background:linear-gradient(#303031,#111113 60%,#252525);color:#ddd;border:3px ridge #6b5a3a;letter-spacing:2px;font:small-caps 15px Georgia;cursor:pointer;padding:7px 12px}.btn:hover,.tab:hover{filter:brightness(1.4)}.middle{position:relative;min-width:0;display:flex;flex-direction:column;align-items:center}.logo{font-size:clamp(17px,3.2vw,49px);font-weight:bold;letter-spacing:3px;color:#ff8c2a;text-shadow:0 0 6px #f20,0 0 18px #b20;margin-top:6%;text-align:center}.logo small{display:block;font:clamp(6px,.65vw,12px) Georgia;letter-spacing:4px;color:#a58a68}.character-stage{position:absolute;top:21%;bottom:21%;left:1%;right:1%;border:4px ridge #49453f;background:radial-gradient(ellipse at 50% 70%,#2b2b29,#09090b 65%);display:flex;justify-content:center;align-items:center}.silhouette{font-size:clamp(60px,13vw,200px);filter:grayscale(1) brightness(.65);opacity:.8}.char-name{position:absolute;bottom:13%;width:100%;text-align:center;background:#090909;border:3px ridge #6c5934;padding:6px 0;color:#d5b768;letter-spacing:2px;font-size:clamp(10px,1vw,16px)}.char-name small{display:block;color:#fff;font-size:11px}.ornament{position:absolute;bottom:0;border:5px ridge #504631;border-radius:50%;height:12%;aspect-ratio:1;display:grid;place-items:center;background:radial-gradient(circle,#15539e 10%,#171719 15%,#4d4635 20%,#070707 70%);font-size:24px}.right{gap:7px}.tabs{display:flex;height:37px}.tab{flex:1;color:#bfb7a4;background:linear-gradient(#252629,#09090a);border:2px ridge #4b4538;font:small-caps 14px Georgia;letter-spacing:1px;cursor:pointer}.tab.active{color:white;background:#171719;border-bottom:2px solid #a68d58}.fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.45fr);gap:7px}.description-field{min-width:0}.description-field input{width:100%;height:25px;background:#09090a;border:2px ridge #554a38;color:#ddd;padding:3px 5px}.difficulty-buttons{display:flex;gap:3px;height:25px}.difficulty-button{flex:1;min-width:0;padding:0 2px;font:small-caps 11px Georgia;letter-spacing:0;background:#18191a;color:#bba879;border:2px ridge #665639;cursor:pointer}.difficulty-button.active{background:#5a4727;color:#fff;border-color:#d0ad5f}.actions{display:flex;justify-content:center;gap:9px}.actions .btn{width:43%;min-height:43px}.field label,.filterline label{display:block;font-variant:small-caps;color:#c3ad70;letter-spacing:1.6px;font-size:13px;margin-bottom:3px}.field input,.filterline input,.filterline select{height:25px;width:100%;background:#09090a;border:2px ridge #554a38;color:#ddd;padding:3px 5px}.filterline{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:7px}.difficulty-controls{display:flex;align-items:end;gap:5px;min-width:0}.difficulty-controls .difficulty-select{display:none}.difficulty-controls .activity-select{flex:1;min-width:0}.difficulty-controls .activity-select select{width:100%}.difficulty-controls .difficulty-select select{width:100%}.mini-control{height:25px;min-width:25px;padding:0 5px;border:2px ridge #69583b;background:#18191a;color:#cbb782;cursor:pointer;font-size:14px}.mini-control[aria-pressed="true"]{background:#53452b;color:#fff;border-color:#d0ad5f}.mini-control[data-mode="non-tz"]{background:#343d48;color:#fff;border-color:#83a5c6}.mini-control:hover{filter:brightness(1.35)}.games-area{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,1fr);gap:8px;min-height:0;flex:1}.games{overflow:auto;border:2px ridge #6a5a3e;background:#101113}.game-header,.game{display:grid;grid-template-columns:minmax(0,1fr) 59px 46px 42px 22px 19px;align-items:center;gap:3px;padding:3px 5px}.game-header span{cursor:pointer;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:clip}.game-header span:hover{color:#fff}.game-header span.sorted{color:#f1d58c}.game-header{font-variant:small-caps;letter-spacing:1px;color:#c3bdad;font-size:12px}.game{border-bottom:1px solid #323235;font:12px monospace;cursor:pointer;white-space:nowrap}.game:hover,.game.selected{background:#3a3327}.game span:first-child{overflow:hidden;text-overflow:ellipsis}.gold{color:#bca466}.green{color:#55a936}.settings{border:2px ridge #69583b;background:#0b0b0d;text-align:center;padding:7px 4px;overflow:auto}.detail-tabs{display:flex;gap:3px;margin-bottom:12px}.detail-tab{flex:1;background:#171719;color:#b7a67d;border:2px ridge #5c503a;padding:5px 1px;cursor:pointer;font:small-caps 12px Georgia}.detail-tab.active{background:#3a3327;color:#fff}.settings h4{margin:0 0 16px;font:small-caps 14px Georgia;letter-spacing:2px}.settings p{font:small-caps 13px Georgia;letter-spacing:2px;color:#aaa;margin:12px 0}.settings strong{display:block;font-weight:normal;font-size:14px;color:#fff}.join{align-self:center;width:43%;min-height:43px}.exit{min-height:41px;margin-top:4px}.bottom{position:absolute;left:11%;right:11%;bottom:1%;height:20%;display:flex;align-items:end;justify-content:space-around;gap:1%;border-top:2px solid #4d412f}.hero{text-align:center;width:12%;height:94%;display:flex;flex-direction:column;justify-content:end;align-items:center}.hero .figure{font-size:clamp(30px,6vw,95px);line-height:1.3;filter:grayscale(.5);opacity:.85}.hero small{color:#b7aeb0;white-space:nowrap;font:small-caps clamp(6px,.65vw,11px) Georgia;letter-spacing:1px}.arrow{position:absolute;bottom:7%;font-size:30px;color:#c5ad74}.arrow.left{left:8%}.arrow.right{right:8%}@media(max-width:850px){.panel{padding:6px;gap:4px;border-width:3px}.chat-input{height:30px}.chat-input input{font-size:11px}.btn{padding:3px;font-size:10px;letter-spacing:0}.chat-toolbar{height:25px;gap:2px}.chat-toolbar select{font-size:9px;padding:0}.chat-toolbar #system-toggle,.chat-toolbar #chat-filter-toggle{font-size:8px;padding:0 2px}.lobby-title{height:25px;font-size:13px}.tabs{height:25px}.tab{font-size:9px}.field label,.filterline label{font-size:8px}.field input,.filterline input,.filterline select{height:18px;font-size:9px}.game{font-size:8px;padding:1px}.game-header{font-size:8px}.mini-control{height:18px;min-width:18px;padding:0 2px;font-size:10px}.game-header,.game{grid-template-columns:minmax(0,1fr) 42px 29px 29px 12px 10px}.settings p{font-size:8px;margin:5px 0}.settings strong{font-size:9px}.settings h4{font-size:9px;margin-bottom:6px}.actions .btn{min-height:22px}.difficulty-button{font-size:7px}.difficulty-buttons,.description-field input{height:18px}.exit{min-height:20px}.char-name{padding:3px}.char-name small{font-size:7px}}
 .full-players{color:#858585}

/* Player context menu: anchored near right-click position, with a visible Battle.net ID. */
#player-context{position:fixed;z-index:1000;display:none;width:215px;background:#111113;border:3px ridge #6b5a3a;box-shadow:0 8px 22px #000;color:#d5bb7c;font:small-caps 13px Georgia;letter-spacing:1.2px}
#player-context.open{display:block}#player-context .player-account{padding:9px 8px;text-align:center;color:#e3dfd5;background:#252527;border-bottom:1px solid #67563b;letter-spacing:1px;font:12px Georgia;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#player-context button{display:block;width:100%;border:0;border-bottom:1px solid #393839;background:#19191b;color:#c9a96b;padding:7px 5px;font:small-caps 13px Georgia;letter-spacing:2px;cursor:pointer}#player-context button:hover{background:#3b3328;color:#fff}
#chat .player-name{cursor:context-menu}#chat .player-name:hover{text-decoration:underline}

[hidden]{display:none!important}
/* v1.19: Server above the Lobby/Friends tabs; channel and chat actions below tabs. */
.server-row{display:flex;justify-content:flex-end;align-items:center;gap:7px;min-height:27px;color:#c3ad70;font:small-caps 12px Georgia}.server-row select{width:105px;height:25px;background:#111214;color:#e1d7bd;border:2px ridge #5c513b;font:12px Georgia;padding:1px}.chat-section-tabs{display:flex;height:34px;gap:3px}.chat-section-tab{flex:1;background:linear-gradient(#252629,#09090a);border:2px ridge #4b4538;color:#bfb7a4;font:small-caps 15px Georgia;letter-spacing:1px;cursor:pointer}.chat-section-tab.active{background:#29251e;color:white;border-bottom-color:#a68d58}.chat-actions{display:flex;gap:5px;min-height:31px}.chat-actions select{min-width:0;flex:1;background:#111214;color:#e1d7bd;border:2px ridge #5c513b;font:13px Georgia}.chat-actions .mini-control{font:11px Georgia;white-space:nowrap;padding:0 6px}.friends-panel{flex:1;min-height:0;overflow:auto;padding:10px;background:#101116;font:14px Arial}.friends-panel[hidden]{display:none!important}.friend-group{margin-bottom:15px}.friend-group-title{background:none;border:0;color:#d5d4dd;font:15px Arial;cursor:pointer;text-align:left;padding:6px 2px;width:100%}.triangle{margin-right:6px}.friend-items{display:flex;flex-direction:column;gap:6px}.friend{display:flex;align-items:center;gap:10px;min-height:55px;padding:4px 2px}.avatar{display:grid;place-items:center;width:43px;height:43px;flex:none;border-radius:50%;background:#292d33;font-size:23px}.friend>div{min-width:0;flex:1}.friend-name{color:#85c2ff;font-size:15px;white-space:nowrap}.friend small{display:block;color:#c7c5cc;margin-top:4px;font-size:12px}.favorite-star{color:#ffc02f}.online{width:12px;height:12px;border-radius:50%;background:#6edb00;flex:none}.away{color:#ffc02f;font-size:20px;flex:none}@media(max-width:850px){.server-row{min-height:18px;font-size:9px}.server-row select{height:18px;width:75px;font-size:9px}.chat-section-tabs{height:23px}.chat-section-tab{font-size:10px}.chat-actions{min-height:21px;gap:2px}.chat-actions select,.chat-actions .mini-control{font-size:8px}.friends-panel{padding:4px}.friend-group-title{font-size:10px}.friend{min-height:35px;gap:4px}.avatar{width:25px;height:25px;font-size:13px}.friend-name{font-size:10px}.friend small{font-size:8px}}
#friend-context{position:fixed;z-index:1100;display:none;width:205px;background:#141416;border:2px ridge #756345;box-shadow:0 8px 24px #000b;color:#d8c29b;font:12px Georgia}#friend-context.open{display:block}#friend-context .friend-account{text-align:center;padding:9px;background:#272729;color:#eee0c1;border-bottom:1px solid #554936}#friend-context button{display:block;width:100%;padding:8px 7px;background:linear-gradient(#28282a,#111113);border:0;border-bottom:1px solid #3e3930;color:#c6a56b;cursor:pointer;font:small-caps 12px Georgia;letter-spacing:.5px}#friend-context button:hover{background:#453b2b;color:#fff}#friend-context button[hidden]{display:none}.friend{cursor:context-menu}.friend-note{color:#c9a667!important;font-style:italic}

/* v1.21: compact original-style create-game settings */
.create-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 14px;padding:7px 9px;background:#101012;border:2px ridge #584c38;color:#c9b681;font-variant:small-caps;letter-spacing:.8px;font-size:11px}.create-option{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}.create-option label{white-space:nowrap}.create-option input[type=number]{width:43px;min-width:0;height:22px;background:#09090a;border:2px ridge #62523b;color:#ddd;text-align:center}.create-option input[type=checkbox]{accent-color:#a98b4f;width:15px;height:15px;vertical-align:middle}.create-option input:disabled{opacity:.35}.create-option .check-label{cursor:pointer}.create-option:nth-child(5){grid-column:1/-1}@media(max-width:850px){.create-options{font-size:8px;gap:2px 6px;padding:4px}.create-option input[type=number]{width:32px;height:18px}.create-option input[type=checkbox]{width:12px;height:12px}}
/* v1.22: creation settings in left column, free-form description on right */
.creation-layout{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:stretch;margin:6px 0 8px;min-height:150px}
.creation-layout .create-options{display:flex;flex-direction:column;gap:5px;margin:0;padding:9px}
.creation-layout .create-option{min-height:22px}
.creation-layout .description-field{display:flex;flex-direction:column;min-width:0;margin:0}
.creation-layout .description-field input{width:100%;flex:1;min-height:80px;align-self:stretch}
@media(max-width:800px){.creation-layout{gap:5px}.creation-layout .create-options{padding:5px}.creation-layout .create-option{font-size:10px}}

/* v1.24: One collapsible Game Settings boundary encloses both settings and description. */
.game-settings-group{border:2px ridge #685c49;background:#101012;padding:0 9px 8px;min-width:0;margin:5px 0 8px}
.game-settings-group>summary{cursor:pointer;color:#d3b77a;font:small-caps 13px Georgia;letter-spacing:1.4px;padding:7px 2px;user-select:none}
.game-settings-group>summary:hover{color:#f4d998}
.game-settings-group .creation-layout{margin:0;min-height:150px}
.game-settings-group .create-options{border:0;background:transparent;padding:4px 5px}
.game-settings-group .description-field input{border:2px solid #858585;background:#09090a;color:#ddd}
@media(max-width:850px){.game-settings-group{padding:0 4px 4px}.game-settings-group>summary{font-size:9px;padding:3px}.game-settings-group .creation-layout{min-height:95px}}
.creation-layout .create-options select{width:100px;max-width:55%;background:#111;color:#d8c9a2;border:1px solid #665a46;font-size:11px;padding:3px}.creation-layout .create-options .create-option{display:flex;align-items:center;justify-content:space-between;gap:6px}.creation-layout .create-options .create-option .check-label{flex:1}/* Activity colors apply to both Game Name and Activity cells. Farming retains the original white. */
.game .activity-farming{color:#e6e3de}
.game .activity-quest{color:#69b8ff}
.game .activity-pvp{color:#ed7777}
.game .activity-trading{color:#d4a3f5}

/* v1.29 Character selection tab inspired by original D2R roster. */
.characters-panel{flex:1;min-height:0;display:flex;flex-direction:column;background:#111113;padding:8px;overflow:hidden}
.character-tabs{display:flex;flex:none;gap:3px}.character-mode{flex:1;background:#19191b;color:#bca46d;border:2px ridge #665537;padding:8px 3px;font:small-caps 12px Georgia;cursor:pointer}.character-mode.active{color:#f0d9a0;border-color:#c59a45;background:#2a261d}
.character-roster{flex:1;min-height:0;overflow-y:auto;border:2px ridge #63563e;background:#1b1b1d;padding:4px}
.character-entry{display:flex;flex-direction:column;align-items:flex-start;width:100%;min-height:64px;background:linear-gradient(110deg,#29292b,#171719);border:1px solid #494540;border-bottom:2px solid #514d46;color:#e1d7c4;padding:10px 9px;text-align:left;cursor:pointer;font:small-caps 15px Georgia;letter-spacing:1px}
.character-entry.selected{border:1px solid #c7a35c;background:#35322e}.character-entry small{font-size:11px;color:#bda56c;margin-top:5px}.character-footer{flex:none;display:flex;flex-direction:column;align-items:center;gap:9px;padding:10px 0 2px}.character-footer #new-character{width:75%;min-height:35px}.character-tools{display:flex;gap:14px}.character-tools .btn{min-width:43px}
@media(max-width:850px){.characters-panel{padding:3px}.character-mode{font-size:9px;padding:4px}.character-entry{min-height:42px;font-size:10px;padding:5px}.character-entry small{font-size:8px}.character-footer{padding:4px;gap:3px}}
/* v1.30 roster sorting and drag handle */
.character-sortbar{display:flex;align-items:center;gap:6px;padding:5px 2px;color:#bca46d;font:small-caps 12px Georgia}.character-sortbar select{flex:1;min-width:0;background:#141416;color:#e1d7c4;border:2px ridge #665537;padding:4px}.character-sortbar button{background:#232326;color:#d6ba7c;border:2px ridge #665537;cursor:pointer;padding:3px 9px}.character-entry{position:relative}.character-entry.dragging{opacity:.4}.character-entry.drag-over{outline:2px solid #c7a35c;outline-offset:-2px}

/* Offline mode: dim the right-side controls while retaining Create Game. */
body.offline-character .right .tabs,
body.offline-character .right .fields,
body.offline-character .right .game-settings-group,
body.offline-character .right .filterline,
body.offline-character .right .games-area,
body.offline-character .right #join-game,
body.offline-character .right .exit { opacity:.36; pointer-events:none; }
body.offline-character .right .games-area #game-list { display:none; }
body.offline-character .right #create-game { opacity:1; pointer-events:auto; }

/* v1.32: Offline play still permits choosing difficulty and Terrorized when creating a game. */
body.offline-character .right .fields,
body.offline-character .right .game-settings-group {opacity:1;pointer-events:auto}
body.offline-character .right .fields input {opacity:.36;pointer-events:none}
body.offline-character .right .game-settings-group .creation-layout {pointer-events:none}
body.offline-character .right .game-settings-group .creation-layout input,
body.offline-character .right .game-settings-group .creation-layout select {opacity:.36;pointer-events:none}
body.offline-character .right .game-settings-group #terrorized {opacity:1;pointer-events:auto}
body.offline-character .right .game-settings-group label:has(#terrorized) {pointer-events:auto;opacity:1}


/* v1.33: typed DELETE confirmation before native browser confirmation. */
.delete-dialog {border:1px solid #85704d;background:#171719;color:#e4d5b5;padding:22px;width:min(390px,calc(100vw - 40px));box-shadow:0 16px 60px #000b;}
.delete-dialog::backdrop {background:rgba(0,0,0,.75)}
.delete-dialog h3{margin:0 0 12px;color:#d7b779;font-variant:small-caps;letter-spacing:2px}
.delete-dialog p{line-height:1.5;margin:0 0 12px}
.delete-dialog input{width:100%;box-sizing:border-box;background:#09090a;border:1px solid #777;color:white;padding:9px;margin:6px 0 16px}
.delete-dialog .delete-buttons{display:flex;justify-content:flex-end;gap:10px}
.delete-dialog button{padding:8px 14px;background:#2c2a28;border:1px solid #766747;color:#e5d5b3;cursor:pointer}
.delete-dialog button:disabled{opacity:.35;cursor:not-allowed}
#lobby-credits{width:min(680px,calc(100vw - 32px));max-height:calc(100dvh - 32px)}
#lobby-credits-list{margin:0 0 16px;padding-inline-start:1.25em;line-height:1.45}
#lobby-credits-list li+li{margin-top:.5em}
#lobby-credits-list strong{color:#efd18a}
/* v1.38: Compact main-menu actions on the server toolbar. */
.server-row{justify-content:space-between;flex-wrap:wrap}
.server-menu-actions{display:flex;align-items:center;gap:4px;min-width:0}
.server-menu-actions .mini-control{font:small-caps 10px Georgia;padding:3px 6px;white-space:nowrap;cursor:pointer}
.server-location{display:flex;align-items:center;gap:6px;margin-left:auto}
@media(max-width:1100px){.server-menu-actions{gap:2px}.server-menu-actions .mini-control{font-size:8px;padding:2px 3px}}
.recent-deleted{border-top:1px solid #716345;margin:5px 4px 0;padding:7px 5px;max-height:150px;overflow-y:auto;background:rgba(12,12,13,.65)}
.recent-deleted-title{color:#c8a875;font-variant:small-caps;letter-spacing:1.2px;font-size:13px;margin-bottom:5px}
.deleted-character-entry{display:flex;flex-direction:column;padding:5px 8px;margin-bottom:3px;border:1px solid #4b4741;color:#858585;background:#1a1a1b;font-size:13px}
.deleted-character-entry small{font-size:11px;color:#777}
.recent-deleted-title .delete-warning{display:inline-flex;align-items:center;justify-content:center;margin-left:6px;width:16px;height:16px;border:1px solid #a98950;border-radius:50%;color:#d6b677;font-size:11px;cursor:help;vertical-align:middle}
.deleted-character-entry{flex-direction:row;align-items:center;justify-content:space-between;gap:8px}
.deleted-character-entry .deleted-info{display:flex;flex-direction:column;min-width:0}
.restore-character{border:1px solid #8a744d;background:#28251e;color:#e1c38a;padding:5px 8px;cursor:pointer;font:small-caps 12px Georgia;white-space:nowrap}
.restore-character:hover{background:#453824;border-color:#d5af6c}
/* v1.43 game age filter */
.age-filter-wrap{position:relative;display:inline-flex;align-items:center;min-width:0}
.age-filter-panel{position:absolute;z-index:80;right:0;top:calc(100% + 6px);width:235px;padding:12px;background:#171719;border:2px ridge #8c7447;box-shadow:0 8px 22px #000c;color:#d9c89e;font:12px Georgia}
.age-filter-panel[hidden]{display:none!important}
.age-filter-panel label{display:block;margin-bottom:7px}
.age-filter-inputs{display:flex;gap:6px;margin-bottom:10px}
.age-filter-inputs input{width:70px;min-width:0}
.age-filter-inputs select{flex:1;min-width:0}
.age-filter-inputs input,.age-filter-inputs select{background:#0c0c0e;color:#e4ddcb;border:1px solid #706044;padding:6px;font-size:12px}
.age-filter-panel .age-filter-check{display:flex;align-items:center;gap:6px;cursor:pointer}
.age-filter-panel small{display:block;color:#a69a83;line-height:1.4}
#age-filter-toggle.age-active{border-color:#c7a35c;color:#f1d08a}

/* v1.44: Item market and seller shop concept. */
.market-panel{flex:1;min-height:0;overflow:auto;padding:12px;background:#0c0d10;font:12px Georgia}
.market-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;color:#bca466}
.market-heading h2{font:small-caps 20px Georgia;margin:0;color:#e2c783}
.market-intro{color:#aaa;line-height:1.5;margin:8px 0}
.market-wallet{border:1px solid #61533c;padding:9px;color:#e0c47e;background:#242016;margin-bottom:12px}
.market-search-label{display:block;color:#bca466;margin-bottom:4px}
.market-panel input,.market-panel select{width:100%;background:#09090a;color:#ddd;border:1px solid #61533c;padding:6px;min-width:0}
.market-list{margin:10px 0;display:flex;flex-direction:column;gap:7px}
.market-item{display:flex;align-items:center;gap:9px;padding:10px 7px;background:linear-gradient(110deg,#252321,#111214);border:1px solid #514735}
.market-item-icon{font-size:28px;color:#c6ad70;flex:none;width:35px;text-align:center}
.market-item-copy{flex:1;min-width:0}.market-item h3{margin:0 0 5px;color:#cfb36c;font-size:14px}.market-item small{color:#91a9cd;line-height:1.4}.market-item p{margin:5px 0;color:#aaa;font-size:11px}.market-item strong{color:#d6bf84}
.market-item .mini-control{font:11px Georgia;height:auto;padding:7px;max-width:80px}
.market-listing,.market-inventory{border-top:1px solid #514735;padding-top:10px;margin-top:12px;color:#cdb477}
.market-listing summary,.market-inventory summary{cursor:pointer}.market-listing form{display:grid;gap:7px;margin-top:10px}.market-price-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}.market-price-fields label{display:grid;gap:4px}.market-listing .btn{font-size:12px;letter-spacing:1px}.market-status{color:#a7b99b;line-height:1.5}
.market-shop{width:min(480px,calc(100vw - 32px))}.market-location{color:#9e8b64;font-size:10px;letter-spacing:3px;margin-bottom:10px}.market-scene{display:flex;justify-content:space-around;align-items:center;height:120px;border:2px ridge #6b5a3a;background:radial-gradient(ellipse at bottom,#3c3222,#090a0d 75%);color:#cbb271;font-size:28px}.market-scene span:nth-child(2){font-size:65px;text-shadow:0 0 20px #987743}.market-stash-title{text-align:center;color:#aa956b;font-variant:small-caps;margin-top:8px!important}#market-offer{border:1px solid #534835;padding:14px;background:#0c0c0e}#market-offer h4{margin:0 0 8px;color:#d9bd75;font-size:19px}#market-offer p{color:#91a9cd}#market-purchase-status{margin-top:14px;color:#b9c7a9;min-height:44px;font-size:13px}.market-shop button:disabled{opacity:.45}
@media(max-width:850px){.market-panel{padding:6px;font-size:10px}.market-heading h2{font-size:14px}.market-item{padding:6px;gap:5px}.market-item-icon{width:20px;font-size:20px}.market-item h3{font-size:11px}.market-item .mini-control{font-size:9px;max-width:60px}.market-intro{margin:5px 0}.market-wallet{padding:6px}}

/* v1.45: Screenshot-based game scene, interactive shop, and inventory. */
#market-shop{width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;padding:0;border:0;background:#030303;color:#e4d5b5;overflow:auto}
#market-shop[open]{display:grid;place-items:center}
#player-context button[hidden]{display:none}
#player-inspect{--inspect-panel-width:min(560px,57vw,104dvh);width:var(--inspect-panel-width);max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:0;border:0;overflow:visible;background:transparent;color:#e4d5b5}
#player-inspect::backdrop{background:#000b}
.inspect-view{position:relative}
.inspect-panel{position:relative;width:100%;aspect-ratio:1106/850;background:url('img/personal_inventory.png') top center / 100% auto no-repeat}
.inspect-heading{position:absolute;top:calc(4.2% + 5px);left:10%;right:10%;height:10.4%;display:grid;align-content:center;gap:2px;text-align:center}
.inspect-heading h2,.inspect-heading p{margin:0;line-height:1.1}
.inspect-heading h2{color:#efd18a;font-size:clamp(12px,1.7vw,24px)}
.inspect-heading p{font-size:clamp(9px,1vw,15px)}
.inspect-panel .shop-image-close{right:1%;top:1.1%;width:5.4%;height:6.5%}
.inspect-item,#player-inspect .inspect-item{position:absolute;display:grid;place-items:center;padding:0;border:0;background:transparent;cursor:pointer}
.inspect-item img{display:block;height:100%;max-height:100%;object-fit:contain;pointer-events:none}
.inspect-item:is(:hover,:focus-visible){outline:1px solid #e4c580;outline-offset:-1px}
#inspect-tooltip{--tooltip-height-limit:calc(100dvh - 24px);position:absolute;left:min(calc(100% + 8px),calc((100vw + var(--inspect-panel-width)) / 2 - var(--tooltip-fit-width) - 12px));top:50%;translate:0 -50%;width:var(--tooltip-fit-width);max-width:calc(100vw - 24px);pointer-events:none;z-index:1}
#inspect-tooltip img{display:block;width:100%;height:auto}
@media(max-width:600px){#player-inspect{--inspect-panel-width:min(90vw,59dvh)}#inspect-tooltip{--tooltip-height-limit:calc(50dvh - var(--inspect-panel-width) * 850 / 2212 - 18px);top:calc(100% + 6px);left:50%;translate:-50% 0}}
#center-character-art.inspectable{pointer-events:auto;cursor:pointer}
/* Match the full inventory frame before showing only its upper equipment section. */
#player-inspect.docked-inspect{position:absolute;inset:var(--inventory-center) auto auto 1.5%;translate:0 -50%;width:calc(97% * .33);aspect-ratio:1106/1435;margin:0;z-index:7;max-width:none;max-height:none;pointer-events:none}
#player-inspect.docked-inspect .inspect-panel{pointer-events:auto}
#player-inspect.docked-inspect #inspect-tooltip,#camp-inventory-tooltip{--tooltip-height-limit:65dvh;position:absolute;top:50%;width:min(var(--tooltip-fit-width),92%);translate:0 -50%;pointer-events:none}
#player-inspect.docked-inspect #inspect-tooltip{left:calc(100% + 8px);right:auto}
#camp-inventory-tooltip{right:calc(33% + 8px);width:min(var(--tooltip-fit-width),30%)}
#camp-inventory-tooltip img{display:block;width:100%;height:auto}
.shop-game-stage{--inventory-offset:-144px;--inventory-center:calc(53.5% + var(--inventory-offset));position:relative;width:min(100vw,186.97dvh);aspect-ratio:3831/2049;isolation:isolate;overflow:hidden;background:#080909}
.shop-area-image{display:block;width:100%;height:100%;object-fit:contain}
@font-face{font-family:Exocet;src:url('assets/ui/exocet-light.woff') format('woff');font-weight:400;font-display:swap}
@font-face{font-family:Exocet;src:url('assets/ui/exocet-heavy.woff') format('woff');font-weight:700;font-display:swap}
/* Replace interface font families while preserving component sizes and chat typography. */
:where(body, body *):not(:where(#chat, #chat *, #in-game-chat-preview, #in-game-chat-preview *)) {
  font-family: Exocet, Georgia, serif !important;
}
.shop-game-header{position:absolute;z-index:4;top:2%;left:2%;right:1%;display:flex;justify-content:flex-end;pointer-events:none}
.shop-game-header>div{text-align:right;color:#cfb76e;text-shadow:0 1px 2px #000,0 0 5px #000}
.shop-game-header :is(time,h3,.market-location,#camp-terror-zone):not([hidden]){display:block;margin:0;color:inherit;font:small-caps clamp(9px,1vw,18px)/1.3 Georgia;letter-spacing:.11em}
.shop-game-header time{text-transform:uppercase}
.shop-game-header #camp-terror-zone:not([hidden]){color:#a44dff}
.shop-game-header button{pointer-events:auto}
#market-shop .shop-stash-hotspot{position:absolute;translate:-50% -50%;width:2.87%;height:5.2%;padding:0;border:0;border-image:none;background:transparent;box-shadow:none;cursor:pointer}
.shop-game-stage:has(> .shop-trade-view:not([hidden])) > :is(#camp-shop-chests,#camp-visitors){display:none}
#camp-visitors{position:absolute;inset:0;pointer-events:none}
#market-shop .camp-visitor{position:absolute;translate:-50% -100%;height:12.5%;width:auto;display:block;overflow:visible;padding:0;border:0;background:none;pointer-events:auto;cursor:context-menu}
.camp-visitor img{position:relative;display:block;width:100%;height:100%;object-fit:contain;pointer-events:none;filter:drop-shadow(2px 3px 2px #0009)}
.camp-visitor .camp-visitor-shadow{position:absolute;inset:0;opacity:.85;filter:brightness(0);transform-origin:50% 99%;transform:skewX(73deg) scaleY(.30)}
.camp-visitor:is(:hover,:focus-visible)::after{content:attr(data-visitor-name);position:absolute;left:50%;bottom:100%;translate:-50% 0;padding:2px 5px;color:#e4c580;font-size:clamp(9px,1vw,15px);text-shadow:0 1px 3px #000;white-space:nowrap;pointer-events:none}
.shop-stash-hotspot::before{content:'';position:absolute;inset:auto 4% -9% -85%;height:50%;transform:skewX(-25deg);background:radial-gradient(ellipse,#000b 15%,#0006 47%,transparent 72%);pointer-events:none}
.shop-chest-art{position:absolute;inset:0;background:url('img/chest.png') center / contain no-repeat;filter:saturate(.6) brightness(var(--chest-brightness,.85));pointer-events:none}
#camp-shop-chests > .shop-stash-hotspot:nth-child(n+6){--chest-brightness:.45}
.shop-stash-hotspot:is(:hover,:focus-visible) .shop-chest-art{filter:saturate(.6) brightness(1.55)}
#market-shop .shop-stash-hotspot:focus-visible{outline:2px solid #e4c580;outline-offset:2px}
#market-shop .shop-stash-hotspot:is(:hover,:focus-visible){z-index:2}
#market-shop .shop-stash-hotspot:is(:hover,:focus-visible)::after{content:attr(data-shop-name);position:absolute;bottom:calc(100% + 4px);left:0;padding:4px 7px;color:#e4c580;font:small-caps clamp(10px,1vw,16px) Georgia;text-shadow:0 1px 3px #000;white-space:nowrap;pointer-events:none}
:is(.shop-trade-view,#camp-inventory){position:absolute;inset:12% 1.5% 5%;translate:0 var(--inventory-offset);align-items:center;background:transparent}
.shop-trade-view{z-index:3;display:flex;justify-content:space-between;gap:1%}
#camp-inventory:not([hidden]){z-index:7;display:flex;justify-content:flex-end;pointer-events:none}
#camp-inventory .shop-inventory-panel{pointer-events:auto}
.shop-image-panel{position:relative;flex:none;width:33%;max-height:100%;aspect-ratio:1101/1435;align-self:center}
.shop-image-panel>img{display:block;width:100%;height:auto;pointer-events:none}
.shop-game-header :is(time,h3,.market-location,#camp-terror-zone):not([hidden]){font-variant:normal}
#market-shop .shop-stash-hotspot::after{font-family:Exocet,Georgia,serif;font-variant:normal}
.shop-image-panel :is(.shop-owner-name,.shop-inventory-name){position:absolute;top:6.1%;left:13%;right:13%;translate:0 -50%;margin:0;padding:1px 0;color:#d6be7a;text-align:center;text-shadow:0 1px 2px #000;font:700 clamp(10px,1.3vw,24px)/1.2 Georgia;letter-spacing:.09em;pointer-events:none}
.shop-inventory-panel{aspect-ratio:1106/1435}
:is(#shop-inventory-gold,#shop-stock-gold){position:absolute;left:41.7%;top:89.8%;width:22%;height:2.7%;display:flex;align-items:center;justify-content:center;color:#f5df9a;font:700 clamp(9px,1.2vw,18px) Georgia;white-space:nowrap}
#shop-stock-gold{left:41%;top:90.5%}
#shop-stock-tabs{position:absolute;inset:9.96% 8.7% auto 6.9%;height:3.8%;display:grid;grid-template-columns:repeat(5,1fr);gap:.4%}
#shop-stock-tabs button,#market-shop .shop-page-arrow{border:0;background:transparent;padding:0;cursor:pointer}
#shop-stock-tabs button:first-child{position:relative}
#shop-stock-tabs button:first-child::before{content:'';position:absolute;inset:2px 2px -12%;background:#0002;backdrop-filter:brightness(.8) saturate(.3);pointer-events:none}
#shop-stock-tabs button:is([aria-pressed='true'],:focus-visible,:hover),.shop-page-arrow:focus-visible{outline:1px solid #d6be7a;outline-offset:-2px;background:#e4c58018}
.shop-page-arrow{position:absolute;top:81.6%;width:5.8%;height:4.3%}
#market-shop .shop-page-arrow:disabled{cursor:default;background:#08080860}
#shop-page-prev{left:33.7%}
#shop-page-next{left:60.1%}
#shop-stock-page{position:absolute;inset:82.1% 40.05% auto 40.05%;height:3.1%;display:grid;place-items:center;background:#171614;color:#d6be7a;font:small-caps clamp(8px,1vw,18px) Georgia;white-space:nowrap}
.shop-game-stage:has(> .shop-trade-view:not([hidden])) > .shop-game-header{z-index:2}
.shop-image-close{position:absolute;right:1%;top:.7%;width:5%;height:3.5%;padding:0!important;background:transparent!important;border:0!important;color:transparent!important;cursor:pointer}
.shop-image-close:hover,.shop-image-close:focus-visible{outline:2px solid #e4c580;background:#f3c87133!important}
.shop-inspection{display:flex;flex-direction:column;align-items:stretch;gap:7px;width:29%;max-height:100%;overflow:auto;padding:10px;background:#090909ed;border:2px ridge #6b5a3a;box-shadow:0 5px 25px #000;text-align:center}
.shop-inspection #shop-selected-label{margin:0!important;font-size:clamp(15px,1.35vw,22px);letter-spacing:2px}
.shop-inspection #market-offer:not([hidden]){display:grid;justify-items:center;gap:2px}
#market-offer .shop-payment-row{position:relative;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:6px;width:min(100%,180px);padding:2px 8px;border:1px solid transparent;color:#e4c580;font-size:clamp(13px,1.2vw,19px);white-space:nowrap}
#market-offer .shop-payment-row span:first-of-type{text-align:right}
#market-offer .shop-payment-row span:nth-of-type(3){text-align:left}
#market-offer:has(.shop-payment-or){padding-inline:32px}
.shop-payment-or{position:absolute;left:calc(100% + 5px);top:50%;translate:0 -50%;color:#fff}
#market-offer label{cursor:pointer}
#market-offer label:has(input:checked){border-color:#e4c580;background:#e4c5801a}
#market-offer input{position:absolute;width:1px;height:1px;margin:0;opacity:0}
#market-offer label:has(input:focus-visible){outline:1px solid #e4c580;outline-offset:1px}
#shop-tooltip-price:empty,#market-purchase-status:empty{display:none}
#shop-item-tooltip{display:block;width:100%;height:auto;background:#060606}
.shop-tooltip{margin:0;background:#060606;border:1px solid #645638}.shop-tooltip figcaption{padding:9px;color:#dfc57b;font-size:clamp(11px,1vw,16px)}
.shop-inspection{--tooltip-height-limit:58dvh;position:absolute;left:34%;top:50%;translate:0 -50%;width:min(calc(var(--tooltip-fit-width) + 24px),64%);z-index:1}
.shop-inspection.owned-item-inspection{left:auto;right:34%}
.shop-inventory-rune{position:absolute;padding:2px}
.shop-inventory-rune img{display:block;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 2px 2px #000)}
.shop-rune-quantity{position:absolute;right:1px;bottom:1px;min-width:1.35em;padding:.08em .21em;color:#f5df9a;font:700 clamp(14px,1.3vw,21px)/1.15 Georgia;text-align:center;text-shadow:0 1px 2px #000,0 0 3px #000}
.shop-inspection #market-purchase-status{min-height:0;margin:0;font-size:clamp(10px,.85vw,14px);line-height:1.4}
.shop-inspection .btn{font-size:clamp(10px,1vw,16px);letter-spacing:1px}
.shop-item-hotspot{position:absolute;background:transparent!important;border:1px solid transparent!important;display:flex;align-items:end;justify-content:center;padding:2px!important;font:clamp(8px,.8vw,13px) Georgia;color:#f5df9a!important;text-shadow:0 1px 3px #000,1px 0 3px #000;cursor:pointer}
.shop-item-hotspot:hover,.shop-item-hotspot.selected,.shop-item-hotspot:focus-visible{border-color:#dfc57b!important;background:#d7b94d22!important;box-shadow:inset 0 0 12px #e5c97144}
.shop-item-hotspot img,.shop-owned-item img{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}
#market-shop .shop-owned-item{position:absolute;background:transparent;border:0;padding:0;cursor:pointer}
.shop-owned-item:is(:hover,:focus-visible,.selected){outline:none;filter:brightness(1.25)}
.shop-inspection.owned-item-inspection,
.owned-item-inspection .shop-tooltip,
.owned-item-inspection #shop-item-tooltip{background:transparent;border:0;box-shadow:none}
.shop-game-wallet{position:absolute;left:9%;right:9%;bottom:8%;background:#090909ed;border:1px solid #66573a;text-align:center;color:#e0c47e;font-size:clamp(8px,.85vw,14px);padding:4px}
@media(max-width:850px){.shop-game-header>div{padding:5px}.shop-game-header .market-location{font-size:7px;letter-spacing:1px}.shop-game-header button{font-size:9px;padding:5px}.shop-inspection{padding:5px;gap:4px}.shop-inspection #market-offer{padding:4px}.shop-inspection #market-offer strong{font-size:10px}.shop-inspection .market-stash-title{font-size:9px}.shop-inspection .mini-control{font-size:9px}.shop-game-wallet{padding:1px}}

/* v1.52: Original screenshot textures, scoped to the lobby. Frame image
   centers are deliberately omitted so original screenshot text never appears. */
.screen {
  --lobby-stone: url('assets/ui/stone-tile.png');
  --lobby-frame: url('assets/ui/panel-frame.png');
  --lobby-button: url('assets/ui/button-face.png');
  --lobby-button-frame: url('assets/ui/button-frame.png');
  background-color: #080909;
  background-image: linear-gradient(#0005, #0009), var(--lobby-stone);
  border: 6px ridge #42423c;
  box-shadow: inset 0 0 0 2px #080808, inset 0 0 40px #000;
}
.screen::before, .screen::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 5.6%;
  background: url('assets/ui/side-carving.png') center / 100% 100% no-repeat;
  pointer-events: none;
}
.screen::before { left: 0; }
.screen::after { right: 0; transform: scaleX(-1); }
.screen .panel {
  background-color: #101010;
  background-image: linear-gradient(90deg, #0005, transparent 40%, #0004), var(--lobby-stone);
  border-image: var(--lobby-frame) 44 / 18px / 0 stretch;
  box-shadow: inset 0 0 18px #000, 0 0 12px #000;
}
.screen .upper { grid-template-rows: minmax(0, 1fr); }
.screen .upper > .panel { min-height: 0; }
.screen :is(.bevel, .games, .settings, .character-roster, .game-settings-group) {
  background-color: #0b0b0b;
  background-image: linear-gradient(#0005, #0008), var(--lobby-stone);
  border-color: #6a6046;
  box-shadow: inset 0 0 12px #000, 0 1px 0 #aaa18b22;
}
.screen .chat-log {
  background-image: linear-gradient(#0008, #0009), var(--lobby-stone);
}
.screen .character-roster {
  --character-roster-image: url('assets/ui/characterselectscreen.png');
  background: linear-gradient(#0002, #0005), var(--character-roster-image) center / 100% 100% no-repeat;
}
.screen .character-roster:has(.character-entry.selected[data-expansion]) {
  --character-roster-image: url('assets/ui/characterselectscreenexp.png');
}
.character-sortbar #character-view-toggle {
  flex: none;
  width: 30px;
  padding-inline: 0;
  font: 18px/1 Georgia;
}
.character-roster[data-view='grid'] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 4px;
}
.screen .character-roster[data-view='grid'] .character-entry {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  grid-template-rows: 1fr auto 1fr;
  grid-template-areas: 'art info' 'art title' 'art badges';
  gap: 3px 6px;
  margin: 0;
  padding: 7px 8px 7px 1px;
}
.screen .character-roster[data-view='grid'] .character-entry:not(.selected) {
  border-color: transparent;
  box-shadow: none;
}
.character-roster[data-view='grid'] .character-info {
  grid-area: info;
  align-self: end;
  align-items: flex-start;
  text-align: left;
}
.character-roster[data-view='grid'] .character-index { display: none; }
.character-grid-art { display: none; }
.character-roster[data-view='grid'] :is(.character-portrait, .level-99-portrait) { display: none; }
.character-roster[data-view='grid'] .character-grid-art {
  display: block;
  grid-area: art;
  align-self: center;
  width: 100%;
  height: clamp(72px, 9vw, 124px);
  object-fit: contain;
  object-position: left bottom;
  pointer-events: none;
}
.character-roster[data-view='grid'] .character-grid-art:not([data-character-class='Warlock']) {
  translate: 20px 0;
}
.character-roster[data-view='grid'] .character-entry .character-title {
  grid-area: title;
  position: static;
}
.character-roster[data-view='grid'] .character-icons {
  grid-area: badges;
  position: static;
  align-self: start;
}
.character-roster[data-view='grid'] :is(.character-info, .character-title, .character-icons) {
  translate: -30px 0;
  white-space: nowrap;
}
.character-roster[data-view='grid'] .character-icons {
  flex-wrap: nowrap;
}
@media(max-width:500px) {
  .character-roster[data-view='grid'] { grid-template-columns: minmax(0, 1fr); }
}
.screen :is(.btn, .tab, .chat-section-tab, .character-mode, .detail-tab, .mini-control) {
  background-color: #24231f;
  background-image: linear-gradient(#ffffff0a, #0003 45%, #0009), var(--lobby-button);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  border-style: solid;
  border-color: #6d6046;
  text-shadow: 0 2px 2px #000;
  box-shadow: inset 0 1px 0 #b6afa14a, inset 0 -1px 2px #000, 0 1px 3px #0008;
}
.screen .btn {
  border-image: var(--lobby-button-frame) 12 / 5px / 0 stretch;
}
.screen :is(.tab, .chat-section-tab, .character-mode, .detail-tab).active,
.screen .mini-control[aria-pressed='true'] {
  background-image: linear-gradient(#aa8a403d, #0002 45%, #0007), var(--lobby-button);
  border-color: #b0985e;
  color: #f1dfb1;
  box-shadow: inset 0 -2px 0 #a78d55, inset 0 1px 0 #d3bc7959, 0 1px 3px #000;
}
.screen .mini-control[data-mode='non-tz'] {
  background-image: linear-gradient(#6085a94d, #0005), var(--lobby-button);
  border-color: #83a5c6;
}
.screen .panel :is(input, select, textarea) {
  background-image: linear-gradient(#000a, #000b), var(--lobby-stone);
  background-color: #090909;
  box-shadow: inset 0 2px 5px #000, 0 1px 0 #aaa18b22;
}
.screen select option { background: #151412; color: #e1d7bd; }
.screen .game-settings-group .description-field input {
  background-image: linear-gradient(#000a, #000b), var(--lobby-stone);
}
.screen .character-entry {
  background: transparent;
  border-color: #47453d;
  box-shadow: inset 0 1px 0 #aaa18b14;
}
.screen .character-entry.selected {
  background: transparent;
  border-color: #c7a35c;
  box-shadow: inset 0 0 12px #b8a16b22;
}
.screen .game-header {
  background: linear-gradient(#ffffff08, #0005);
  border-bottom: 1px solid #7a6b454d;
}
.screen .game { border-bottom-color: #6c665b40; }
.screen .game:hover, .screen .game.selected {
  background: linear-gradient(90deg, #b4a87b38, #6b624a24);
  box-shadow: inset 0 1px 0 #c7b98938, inset 0 -1px 0 #c7b98925;
}
.screen .character-stage {
  background-image: radial-gradient(ellipse at 50% 85%, #3d372b33, #000b 80%), var(--lobby-stone);
  border-image: var(--lobby-frame) 44 / 10px / 0 stretch;
  box-shadow: inset 0 0 35px #000;
}
.screen .char-name {
  background-image: linear-gradient(#000a, #000a), var(--lobby-stone);
  border-image: var(--lobby-button-frame) 12 / 5px / 0 stretch;
}
.screen .ornament {
  border: 0;
  background: url('assets/ui/blue-ornament.png') center / 106% 100% no-repeat;
  font-size: 0;
  box-shadow: 0 2px 8px #000;
}
.screen :is(.panel, .games, .settings, .character-roster, .friends-panel, .market-panel, .chat-log, .recent-deleted) {
  scrollbar-color: #75623d #11110e;
  scrollbar-width: thin;
}
@media(max-width:850px) {
  .screen .panel { border-image-width: 10px; }
  .screen .btn, .screen .char-name { border-image-width: 3px; }
  .screen .character-stage { border-image-width: 6px; }
}

/* v1.53: The original center display supplies the title, gothic frame,
   character preview, nameplate trim, and complete lower ornament. */
.screen .middle {
  top: 6px;
  background: url('assets/ui/center-panel.png') center / 100% 100% no-repeat;
}
.screen .middle .center-panel-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  transform: scale(1.02);
  pointer-events: none;
}
.screen .middle .logo { visibility: hidden; }
.screen .middle .character-stage {
  top: 23%;
  bottom: 26.1%;
  left: 8%;
  right: 8%;
  background: none;
  border: 0;
  box-shadow: none;
  pointer-events: none;
  container-type: size;
  align-items: flex-end;
}
#center-character-art {
  position: relative;
  width: auto;
  height: calc(var(--center-art-height, 90cqh) * var(--art-height-scale, 1));
  transform: translateY(var(--art-bottom-padding, 0%));
}
#center-character-art[data-character-class='Warlock'] {
  --center-art-height: 95cqh;
  translate: -30px 0;
}
#center-selected-thumbnail{position:absolute;right:calc(57% + .5in + var(--thumbnail-extra-offset,0px));bottom:0;width:auto;transform:translateY(var(--art-bottom-padding,0%));transform-origin:top left;z-index:1;pointer-events:none}
#center-character-art[data-character-class='Warlock'] + #center-selected-thumbnail{--thumbnail-extra-offset:30px}
.hardcore-art {
  filter: drop-shadow(0 0 3px #f33) drop-shadow(0 0 7px #c41919);
}
.level-99-art::before {
  content: '';
  position: absolute;
  inset: 5% 25% 0;
  border-radius: 50% / 10%;
  background: linear-gradient(90deg, transparent, #d3a34a40, transparent),
              radial-gradient(ellipse 50% 12% at 50% 94%, #ffd67756, transparent);
  mask-image: linear-gradient(transparent, #000 28%);
  pointer-events: none;
}
.screen .middle .character-stage.level-99-art::before {
  inset: -8% 14% -2%;
}
.screen:has(> .lobby-players:not([hidden])) > .upper {
  bottom: 14.3824%;
}
.screen > .lobby-players:not([hidden]) {
  position: absolute;
  z-index: 1;
  inset: 85.264% 5.9% 1.2%;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 42px) / 8);
  grid-template-rows: minmax(0, 1fr);
  gap: 6px;
  margin: 0;
  padding: 0 12px;
  background: url('assets/ui/lobby-player-strip.png') center bottom / auto 90% repeat-x;
  list-style: none;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
}
.screen > .lobby-players:active { cursor: grabbing; }
.lobby-players li {
  position: relative;
  min-height: 0;
  text-align: center;
  color: #e6d5ac;
  font: small-caps clamp(8px, .9vw, 14px) Georgia;
  text-shadow: 0 1px 3px #000;
}
.lobby-players img {
  position: absolute;
  bottom: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
}
.lobby-player-caption {
  position: absolute;
  inset: auto -3px 0;
  padding: 8px 2px 0;
  background: linear-gradient(transparent, #000c);
  line-height: 1;
}
.lobby-player-caption :is(span, small) {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lobby-player-caption small { color: #c2af87; }
.lobby-player-level {
  position: absolute;
  top: 4px;
  left: 50%;
  translate: -50% 0;
  padding: 3px 5px;
  background: #0b0b0de6;
  color: #f1dfb1;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
}
.lobby-players:not(:active) li:hover .lobby-player-level { opacity: 1; }
.screen .middle .char-name {
  top: 75.9%;
  bottom: auto;
  left: 16%;
  width: 68%;
  height: 5.9%;
  padding: 2px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #d5bf77;
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: clamp(12px, 1.95vw, 30px);
  line-height: 1;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.screen .middle .char-name small {
  font-size: clamp(9px, 1.3vw, 20px);
  font-variant: small-caps;
  letter-spacing: .14em;
  text-transform: none;
  margin-top: 2px;
}
.screen .middle #lobby-gem {
  position: absolute;
  z-index: 1;
  left: 50.8%;
  top: 91%;
  width: 11%;
  height: 5%;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.screen .middle #lobby-gem:is([data-server='Europe'],[data-server='Asia'])::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  backdrop-filter: hue-rotate(var(--gem-hue)) saturate(1.25);
  mask-image: radial-gradient(ellipse, #000 43%, transparent 72%);
}
.screen .middle #lobby-gem[data-server='Europe'] { --gem-hue: 105deg; }
.screen .middle #lobby-gem[data-server='Asia'] { --gem-hue: -105deg; }

@media(max-width:1980px) {
  .screen > .upper {
    top: calc(1.2% + 26px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .screen .middle { display: contents; }
  .screen .middle > :not(#lobby-gem, #main-menu-panel) { display: none; }
  .screen .middle #lobby-gem {
    top: -26px;
    left: 50%;
    width: 30px;
    height: 24px;
    transform: translateX(-50%);
    color: #81cfff;
    font: 19px/1 Georgia;
  }
  .screen .middle #lobby-gem[data-server='Europe'] { color: #ffa6d4; }
  .screen .middle #lobby-gem[data-server='Asia'] { color: #a8e488; }
  .screen .middle #lobby-gem::after { content: '\2699'; }
  .screen .middle #lobby-gem::before { display: none; }
}

/* v1.54: Structural boundaries recede behind the brighter controls. */
.screen { border-color: #292b28; }
.screen :is(.bevel, .games, .settings, .character-roster, .game-settings-group) {
  border-color: #39382f;
  box-shadow: inset 0 0 12px #000, 0 1px 0 #aaa18b0d;
}
.screen .panel :is(input, select, textarea) { border-color: #514a38; }
.screen .game-settings-group .description-field input { border-color: #46453e; }
.screen .character-entry { border-color: #32312c80; }
.screen .character-entry.selected { border-color: #c7a35c; }
.screen :is(.recent-deleted, .market-listing, .market-inventory, .market-item) {
  border-color: #39372e;
}
.screen .game-header { border-bottom-color: #514c343d; }
.screen .game { border-bottom-color: #514e452e; }

/* Shared channel colors for sender names and All-chat tags. */
#chat .channel-filtered{display:none}
#chat .channel-tag,#in-game-chat-preview .channel-tag{all:unset;display:none;color:var(--channel-color);font-family:Arial,sans-serif;line-height:1;text-align:center}
#chat .player-name,#chat .chat-self{color:var(--channel-color)}

#chat.all-channels .channel-tag{display:inline-block;width:1.2em;margin-right:.3em;cursor:help}
#chat.all-channels .channel-tag:enabled{cursor:pointer}
#chat .channel-tag:focus-visible{outline:1px solid currentColor;outline-offset:2px}

#chat .chat-timestamp{display:inline-block;color:#929292;font-size:.8em;font-variant-numeric:tabular-nums;margin-right:.55em;white-space:nowrap}

/* Opening cinematic and hold-to-connect interaction. */
body.intro-active{overflow:hidden;background:#000}
body.intro-active>.screen{visibility:hidden}
.intro-screen{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;background:#000;user-select:none;touch-action:none}
.intro-screen[hidden],.intro-screen video[hidden]{display:none!important}
.intro-screen video{position:absolute;width:100%;height:100%;object-fit:contain;pointer-events:none}
.intro-enter{position:absolute;bottom:7%;max-width:90%;padding:12px 24px;border:1px solid #8f784c;background:linear-gradient(to right,var(--hold-fill,#a58c563d) var(--hold-progress,0%),#080808b3 var(--hold-progress,0%));color:#e7d6ac;font:small-caps 18px Georgia;letter-spacing:2px;cursor:pointer;touch-action:none}
.intro-enter:focus-visible{outline:2px solid #e7d6ac;outline-offset:4px}
.intro-status{position:absolute;bottom:2%;color:#d2bc86;font:14px Georgia;text-align:center}

/* Keep the cinematic clear; the hold delay runs without a visible prompt. */
.intro-enter{opacity:0;bottom:0;left:0;width:100%;max-width:none;height:100%;padding:0;border:0;background:none}

.market-item-copy .market-server{color:#b8a16b;white-space:nowrap}

#join-loading{position:fixed;inset:0;width:100vw;height:100vh;max-width:none;max-height:none;margin:0;padding:0;border:0;background:#000;overflow:hidden}
#join-loading::backdrop{background:#000}
#join-loading video{display:block;width:100%;height:100%;object-fit:contain}

.market-name-button{padding:0;border:0;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer;text-decoration:underline;text-decoration-color:#75633c;text-underline-offset:3px}
.market-name-button:hover{color:#ffe3a0}
.market-name-button:focus-visible{outline:1px solid #dfc57b;outline-offset:3px}
#market-item-preview{--tooltip-height-limit:calc(100dvh - 32px);position:fixed;inset:auto;margin:0;width:min(calc(var(--tooltip-fit-width) + 16px),calc(100vw - 16px));max-width:none;padding:6px;background:#080808;border:2px ridge #a48a50;z-index:1000;box-shadow:0 4px 16px #0009}
#market-item-preview::backdrop{background:transparent}
#market-item-preview img{display:block;width:100%;height:auto}
:is(#market-item-preview,#inspect-tooltip,#camp-inventory-tooltip,.shop-inspection){--tooltip-fit-width:min(var(--tooltip-width),calc(var(--tooltip-height-limit) * var(--tooltip-aspect)),calc(100vw - 24px))}


/* Class portraits in online and offline character lists. */
.character-entry{flex-direction:row;align-items:center;gap:10px}
.character-portrait{display:block;width:44px;height:44px;flex:none;object-fit:cover;border:1px solid #766440;background:#090909}
.character-entry.selected .character-portrait{border-color:#c7a35c}
.character-info{display:flex;flex-direction:column;align-items:flex-start;min-width:0;text-align:left}
@media(max-width:850px){.character-entry{gap:6px}.character-portrait{width:30px;height:30px}}

#chat .private-outgoing .message-body{color:#ffc5ec}

/* Colored channel tabs wrap within the chat panel. */
.chat-actions{flex-wrap:wrap;justify-content:flex-end}
.chat-channel-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:3px;flex:1 0 100%;min-width:0}
.chat-channel-tab{flex:1 0 auto;padding:5px 7px;border:1px solid #4b4538;background:linear-gradient(#202124,#09090a);color:var(--channel-color);font:12px Georgia;cursor:pointer;white-space:nowrap}
.chat-channel-tab.active{background:#353025;border-color:var(--channel-color);box-shadow:inset 0 -2px var(--channel-color)}
.chat-channel-tab:hover{filter:brightness(1.3)}
.chat-channel-tab:focus-visible{outline:1px solid var(--channel-color);outline-offset:1px}
@media(max-width:850px){.chat-channel-tabs{gap:2px}.chat-channel-tab{font-size:9px;padding:3px 4px}}

/* Chat tools occupy the last column alongside the two channel rows. */
.chat-actions{display:grid;grid-template-columns:minmax(0,1fr) 30px;grid-template-rows:repeat(2,1fr);gap:3px;align-items:stretch}
.chat-channel-tabs{grid-column:1;grid-row:1 / 3}
.chat-actions #system-toggle{grid-column:2;grid-row:1}
.chat-actions #chat-filter-toggle{grid-column:2;grid-row:2}
.chat-actions :is(#system-toggle,#chat-filter-toggle){width:30px;height:auto;min-height:26px;padding:0;font:16px Arial;letter-spacing:0}
@media(max-width:850px){.chat-actions{grid-template-columns:minmax(0,1fr) 24px;gap:2px}.chat-actions :is(#system-toggle,#chat-filter-toggle){width:24px;min-height:21px;font-size:13px}}

/* Keep all channels and chat tools on one compact row. */
.chat-actions{grid-template-columns:minmax(0,1fr) 26px 26px;grid-template-rows:auto;gap:3px}
.chat-channel-tabs{grid-column:1;grid-row:1;grid-template-columns:repeat(8,minmax(0,1fr));gap:2px}
.chat-channel-tab{min-width:0;padding:5px 1px;font-size:10px;letter-spacing:0}
.chat-actions #system-toggle{grid-column:2;grid-row:1}
.chat-actions #chat-filter-toggle{grid-column:3;grid-row:1}
.chat-actions :is(#system-toggle,#chat-filter-toggle){width:26px;min-height:27px}
@media(max-width:850px){.chat-actions{grid-template-columns:minmax(0,1fr) 20px 20px;gap:2px}.chat-channel-tab{font-size:7px;padding:4px 0}.chat-actions :is(#system-toggle,#chat-filter-toggle){width:20px;min-height:22px;font-size:12px}.chat-actions #chat-filter-toggle svg{width:13px;height:13px}}

.chat-channel-tab{position:relative}
.channel-unread{position:absolute;top:1px;right:1px;z-index:1;min-width:13px;height:13px;padding:0 3px;border-radius:8px;background:#b93030;color:#fff;border:1px solid #e39275;font:bold 9px/11px Arial;text-align:center;pointer-events:none}
.channel-unread[hidden]{display:none}

.chat-channel-tabs,.chat-channel-tab{overflow:visible}

.chat-section-tab[data-chat-view="lobby"]{display:flex;align-items:center;justify-content:center;gap:6px}
.chat-private-unread,.request-count-badge{display:inline-flex;align-items:center;justify-content:center;min-width:17px;height:17px;padding:0 4px;border-radius:10px;color:#fff;border:1px solid;font:bold 10px Arial;letter-spacing:0}
.chat-private-unread{background:#8f3b76;border-color:#e69ccc}
.chat-private-unread[hidden]{display:none}

/* Online character mode icons, anchored to the roster card. */
.character-icons{position:absolute;top:3px;right:4px;display:flex;gap:2px;pointer-events:none}
.character-icons img{display:block;width:24px;height:24px;object-fit:contain}
.character-entry.has-character-icons{padding-right:56px}
@media(max-width:850px){.character-icons{top:2px;right:2px;gap:1px}.character-icons img{width:18px;height:18px}.character-entry.has-character-icons{padding-right:41px}}
.character-info .hardcore-character-name{color:#ff3333}

.market-search-controls{display:flex;align-items:stretch;gap:6px}.market-search-controls input{flex:1}.market-search-controls .mini-control{flex:none;height:auto}
.market-search-controls input{min-width:0}
#market-sort{position:relative;display:flex;flex:none}
#market-sort summary{display:grid;place-items:center;height:100%;list-style:none}
#market-sort summary::-webkit-details-marker{display:none}
.market-sort-options{position:absolute;z-index:5;top:calc(100% + 4px);right:0;min-width:90px;padding:3px;background:#151310;border:1px solid #645638}
.market-sort-options button{display:block;width:100%;padding:4px 8px;border:0;background:transparent;color:#e4c580;text-align:left;cursor:pointer}
.market-sort-options button:is(:hover,:focus-visible,[aria-pressed='true']){background:#43351f}



/* Transparent level 99 components overlay the existing roster geometry. */
.level-99 .character-info{position:relative}
.level-99-name{color:#efd18a;text-shadow:0 1px 2px #000}
.character-info .level-99-name.hardcore-character-name{color:#ff3333}
.level-99-portrait{position:relative;flex:none}
.level-99-portrait::after{content:'';position:absolute;z-index:1;inset:-8px;pointer-events:none;background:url('img/profile.png') center / 100% 100% no-repeat}
.level-99-portrait .character-portrait{position:relative;border-color:transparent}
.character-entry .level-99-honors{display:flex;align-items:center;gap:22px;padding-left:9px;white-space:nowrap}
.level-99-honor{position:relative;display:inline-block;color:#f0d69a;font:inherit;letter-spacing:inherit}
.level-99-honor::before,.level-99-honor::after{content:'';position:absolute;top:50%;width:12px;height:17px;transform:translateY(-50%);pointer-events:none;background:center / contain no-repeat}
.level-99-honor::before{left:-11px;background-image:url('img/left_dec.png')}
.level-99-honor::after{right:-11px;background-image:url('img/right_dec.png')}
.level-99-honor-class{color:#dac4f1}
@media(max-width:850px){.level-99-portrait::after{inset:-6px}.character-entry .level-99-honors{gap:17px;padding-left:7px}.level-99-honor::before,.level-99-honor::after{width:9px;height:13px}.level-99-honor::before{left:-8px}.level-99-honor::after{right:-8px}}
/* Expanding color bands flow from the center of each milestone label. */
@property --honor-flow{syntax:'<length>';inherits:false;initial-value:0px}
@supports (background-clip:text) or (-webkit-background-clip:text){
 .level-99-honor{
  --honor-color:#c09242;--honor-light:#fff0b8;
  background-image:repeating-radial-gradient(ellipse at center,var(--honor-color) calc(var(--honor-flow) - 48px),var(--honor-light) calc(var(--honor-flow) - 32px),var(--honor-color) calc(var(--honor-flow) - 16px),var(--honor-color) var(--honor-flow));
  -webkit-background-clip:text;background-clip:text;color:transparent;
  animation:honor-outward-flow 3s linear infinite;
 }
 .level-99-honor-class{--honor-color:#a875cd;--honor-light:#f4e1ff}
}
@keyframes honor-outward-flow{from{--honor-flow:0px}to{--honor-flow:48px}}
@media(prefers-reduced-motion:reduce){.level-99-honor{animation:none}}
.games-area > .settings{min-width:0;overflow-wrap:anywhere}.game-detail-players{list-style:none;padding:0;margin:0;color:#fff;font-size:14px}.game-detail-players li{margin:8px 0}.settings p{letter-spacing:1px}@media(max-width:850px){.game-detail-players{font-size:9px}.game-detail-players li{margin:5px 0}.detail-tab{font-size:9px}}

#tz-toggle{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;width:29px;padding:0;overflow:hidden}
#tz-toggle img{display:block;width:21px;height:21px;object-fit:contain;pointer-events:none}
#tz-toggle[data-mode="all"] img{filter:grayscale(1);opacity:.5}
#tz-toggle[data-mode="tz"] img{filter:drop-shadow(0 0 2px #e9bd59);opacity:1}
#tz-toggle[data-mode="non-tz"]{background:#18191a;border-color:#69583b}
#tz-toggle[data-mode="non-tz"] img{filter:grayscale(1);opacity:.65}
#tz-toggle[data-mode="non-tz"]::after{content:'';position:absolute;width:26px;height:2px;background:#f16b5c;box-shadow:0 0 2px #000;transform:rotate(-45deg);pointer-events:none}
@media(max-width:850px){#tz-toggle{width:21px}#tz-toggle img{width:15px;height:15px}#tz-toggle[data-mode="non-tz"]::after{width:19px}}
#age-filter-toggle{display:inline-flex;align-items:center;justify-content:center;flex:none;width:29px;padding:0;color:#e5c87d}
#age-filter-toggle svg{display:block;width:21px;height:21px;pointer-events:none}
#age-filter-toggle:not(.age-active) svg{filter:grayscale(1);opacity:.5}
#age-filter-toggle.age-active svg{filter:drop-shadow(0 0 2px #e9bd59);opacity:1}
@media(max-width:850px){#age-filter-toggle{width:21px}#age-filter-toggle svg{width:15px;height:15px}}
/* Match the search/activity group to the game list column below. */
.game-panel-inner{--game-details-width:calc(25% - 2px + 48px)}
.games-area{grid-template-columns:minmax(0,1fr) var(--game-details-width)}
.filterline{grid-template-columns:minmax(0,1fr) minmax(max-content,var(--game-details-width));gap:8px}
@media(max-width:850px){
 .game-panel-inner{--game-details-width:calc(25% - 2px + min(48px,8%))}
}
.game-search-filters{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:7px;min-width:0}
.game-search-filters > div{min-width:0}
#friends-filter-toggle{display:grid;place-items:center;flex:none;width:29px;padding:0;font:20px/1 Georgia}
#friends-filter-toggle[aria-pressed="false"]{color:#96938d}
#friends-filter-toggle[aria-pressed="true"]{color:#f1d08a}
.friends-filter-empty{margin:8px;color:#c3bdad}
@media(max-width:850px){#friends-filter-toggle{width:21px;font-size:15px}.friends-filter-empty{font-size:8px}}
.filterline .difficulty-controls{justify-content:flex-end;gap:3px}
@media(max-width:850px){.filterline .difficulty-controls{gap:2px}}
/* Incoming chat must not move the reader's position. */
#chat{overflow-anchor:none}

.game-name-text {
 display:block;
}
@media (hover:hover) and (prefers-reduced-motion:no-preference) {
 .game-name.name-overflows:hover .game-name-text {
  width:max-content;
  animation:scroll-game-name var(--name-scroll-time) linear .35s both;
 }
}
@keyframes scroll-game-name {
 to { transform:translateX(var(--name-offset)); }
}

/* Activity tabs use the full game-list width beneath Search. */
.game-search-filters{grid-template-columns:minmax(0,1fr);gap:5px}
.activity-filter-tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px;min-width:0}
.filterline{container-type:inline-size}
.filterline .difficulty-controls{position:relative;--filter-control-gap:5px}
#visible-game-count{position:absolute;right:calc(4 * (var(--game-filter-height) + var(--filter-control-gap)));bottom:0;width:max-content;min-width:var(--game-filter-height);padding-inline:5px;white-space:nowrap;pointer-events:none}
@container (max-width:440px){
 #visible-game-count{right:0;bottom:calc(var(--game-filter-height) + var(--filter-control-gap))}
}
.count-badge{display:inline-grid;place-items:center;min-width:2ch;padding:0 4px;border:1px solid #645638;background:#151310;color:#e4c580;font-size:clamp(10px,1vw,14px);font-variant-numeric:tabular-nums}
#channel-player-count{flex:none;align-self:stretch;height:auto;min-width:29px;padding-inline:5px;cursor:default}
.activity-filter-tab{min-width:0;padding:5px 1px;border:1px solid #4b4538;background:linear-gradient(#202124,#09090a);color:var(--activity-color);font:10px Georgia;letter-spacing:0;cursor:pointer;white-space:nowrap}
.activity-filter-tab.active{background:#353025;border-color:var(--activity-color);box-shadow:inset 0 -2px var(--activity-color)}
.activity-filter-tab:hover{filter:brightness(1.3)}
.activity-filter-tab:focus-visible{outline:1px solid var(--activity-color);outline-offset:1px}
@media(max-width:850px){.game-search-filters{gap:3px}.activity-filter-tab{font-size:7px;padding:4px 0}}

/* Open invitations read as normal messages with an inline join action. */

.chat-invite-game{display:inline;color:#d9c28a;font:inherit;margin-right:6px;overflow-wrap:anywhere}
#chat .chat-join-invite{display:inline-block;height:auto;padding:0 5px;font:inherit;line-height:1;vertical-align:baseline;white-space:nowrap}
#chat .chat-join-invite:disabled{opacity:.4;cursor:not-allowed}
.chat-input .chat-invite-action{font-size:12px;letter-spacing:0;padding:4px 7px}
.shop-game-header>.camp-actions{display:flex;gap:8px;padding:0;border:0;background:none;text-shadow:none}
.open-invite-dialog form{display:grid;gap:7px}
.open-invite-dialog label{color:#cbb782;font:small-caps 13px Georgia}
.open-invite-dialog select{width:100%;min-width:0;padding:8px;background:#09090a;color:#e4d5b5;border:1px solid #766747}
.open-invite-dialog input{margin:0 0 4px}
.open-invite-dialog #invite-status{min-height:1em;margin:0;color:#dec48a;font-size:12px}
.open-invite-dialog select:disabled{opacity:.65}
@media(max-width:850px){.chat-input .chat-invite-action{font-size:9px;padding:3px}.shop-game-header>.camp-actions{gap:4px}}

#market-shop.regular-game #camp-open-invite{display:none}

/* The supplied Esc artwork is the menu; transparent controls align to its buttons. */
#game-escape-menu{width:min(440px,86vw,62dvh);max-width:none;max-height:none;aspect-ratio:1063/1479;padding:0;border:0;background:transparent;overflow:visible;color:#fff}
#game-escape-menu::backdrop{background:#0009}
#game-escape-menu>img{display:block;width:100%;height:auto;pointer-events:none}
#game-escape-menu .escape-menu-hotspot{position:absolute;left:8.84%;width:82.22%;height:10.3%;padding:0;border:0;background:transparent;cursor:pointer;border-radius:5px}
#game-save-exit{top:46.65%}
#game-resume{top:58.25%}
#game-escape-menu .escape-menu-hotspot:hover{background:#e2bc6820;box-shadow:0 0 14px #d5ab4740}
#game-escape-menu .escape-menu-hotspot:focus-visible{outline:2px solid #e2c57b;outline-offset:2px}

#game-escape-menu:focus{outline:none}

.chat-invite-line{display:block;white-space:nowrap;max-width:100%}.chat-invite-line .chat-invite-game{display:inline-block;max-width:calc(100% - 5.5em);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}

.chat-invite-line .chat-invite-game{margin-left:6px;margin-right:0}

/* In-game chat shares the lobby's actual tabs, messages, filters, and composer. */

#in-game-chat{position:absolute;z-index:6;left:1.5%;bottom:18%;width: min(610px,55%);height:48%;min-height:180px;display:flex;flex-direction:column;padding:7px;border:1px solid #726343;background:#07080899;box-shadow:0 5px 18px #0005;font:13px Arial;color:#e6e3de}
.in-game-chat-heading{display:flex;align-items:center;gap:8px;flex:none;color:#cdb781;font:small-caps 12px Georgia;margin-bottom:7px}
.in-game-chat-heading #in-game-chat-status{flex:1;font:11px Arial;color:#b9cda0}
#in-game-chat-close{width:22px;height:22px;padding:0;line-height:18px}
#in-game-chat-content{display:flex;flex-direction:column;gap:5px;flex:1;min-height:0}
#in-game-chat .chat-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:3px;flex:none;min-height:27px}
#in-game-chat .chat-channel-tabs{grid-template-columns:repeat(8,minmax(0,1fr));gap:2px}
#in-game-chat .chat-channel-tab{font-size:12px;padding:5px 1px}
#in-game-chat #chat{flex:1;min-height:0;margin:0;padding:6px;border:0;background:#0002;box-shadow:none;font:17px/1.65 Arial;overflow:auto}
#in-game-chat #chat p{margin:0 0 4px}
#in-game-chat .chat-input{display:flex;height:auto;min-height:32px;gap:4px;flex:none}
#in-game-chat .chat-input .btn{padding:3px 6px;font:11px Georgia;letter-spacing:0;border-width:1px;white-space:nowrap}
#in-game-actions:not([hidden]){position:relative;display:flex;flex:none}
#in-game-actions summary{display:grid;place-items:center;list-style:none}
#in-game-actions summary::-webkit-details-marker{display:none}
.in-game-action-options{position:absolute;left:0;bottom:calc(100% + 4px);z-index:2;min-width:max-content;padding:3px;background:#151310;border:1px solid #645638}
.in-game-action-options .btn{display:block;width:100%;text-align:left}
#in-game-chat .chat-filter-panel{padding:6px;flex:none}
#in-game-chat .chat-filter-panel textarea{min-height:38px;max-height:65px}
#in-game-chat #chat .chat-invite-line{font:inherit}
#in-game-chat .chat-channel-tab[data-channel="Game"]{--channel-color:#e9d09c}
@media(max-width:850px){#in-game-chat{width:70%;height:52%;min-height:145px;padding:4px}#in-game-chat .chat-actions{grid-template-columns:minmax(0,1fr);min-height:22px}#in-game-chat .chat-channel-tab{font-size:10px;padding:4px 0}#in-game-chat #chat{font-size:14px}#in-game-chat .chat-input{min-height:26px}#in-game-chat .chat-input .btn{font-size:9px;padding:2px 4px}.in-game-chat-heading{margin-bottom:4px}}

#chat .player-connection-notice{color:var(--gold)}

/* Incoming messages can be read without opening chat controls or interrupting play. */
#in-game-chat-preview{position:absolute;z-index:5;left:1.5%;bottom:18%;width:min(610px,55%);max-height:28%;padding:6px 8px;overflow:hidden;background:#0003;color:#e6e3de;font:17px/1.65 Arial;text-shadow:0 1px 3px #000,0 0 3px #000;pointer-events:none}
#in-game-chat-preview p{margin:0 0 4px}
#in-game-chat-preview .player-name,#in-game-chat-preview .chat-self{color:var(--channel-color)}
#in-game-chat-preview .player-connection-notice{color:var(--gold)}
#in-game-chat-preview .channel-tag{display:inline-block;width:1.2em;margin-right:.3em}
#in-game-chat-preview .chat-timestamp{color:#aaa;font-size:.8em;margin-right:.55em;font-variant-numeric:tabular-nums}
#in-game-chat-preview .chat-invite-line{display:flex;align-items:center}
#in-game-chat-preview .chat-join-invite{display:inline-flex;flex:none;align-items:center;justify-content:center;height:auto;padding:1px 5px;line-height:1}
@media(max-width:850px){#in-game-chat-preview{width:70%;font-size:14px;padding:4px 6px}}

#chat-invite-draft{display:inline-flex;align-items:center;gap:5px;flex:0 1 auto;min-width:0;max-width:40%;padding:2px 5px;border:1px solid #806b3b;background:#211c13;color:#dbc489;font:11px Georgia}
#chat-build-draft:not([hidden]){display:inline-flex;align-items:center;gap:5px;flex:0 1 auto;min-width:0;max-width:40%;padding:2px 5px;border:1px solid #806b3b;background:#211c13;color:#dbc489;font:11px Georgia}
#chat-build-draft span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#chat-build-draft button{flex:none;padding:0 3px;border:0;background:none;color:#d7c39b;font:15px Arial;cursor:pointer}
#chat-invite-draft .draft-join-label{white-space:nowrap}
#in-game-chat #chat-invite-draft-remove{padding:0 3px;border:0;background:none;color:#d7c39b;font:15px Arial;cursor:pointer}
#in-game-invite[aria-pressed="true"]{border-color:#c7a35c;color:#f1d08a}
@media(max-width:850px){#chat-invite-draft{font-size:9px;gap:3px;padding:2px}}

#chat-send:disabled{color:#777;opacity:.45;cursor:not-allowed;filter:grayscale(1)}

/* Keep the routing tag visible while the message itself is being edited. */
.chat-composer-field{display:flex;align-items:center;flex:1;min-width:0;height:100%;border:1px solid #69583b;background:#080808;font:16px Arial}
#chat-composer-tag{flex:none;padding-left:6px;color:#c5ae77;white-space:nowrap;font:inherit}
#chat-form .chat-composer-field textarea{flex:1;min-width:0;width:auto;height:100%;margin:0;border:0;background:none;padding:4px 6px;font:inherit;line-height:1.2;color:#ddd;outline-offset:-2px;resize:none;white-space:pre;overflow:hidden}
#in-game-chat .chat-composer-field{height:auto;font-size:17px}
#in-game-chat #chat-form .chat-composer-field textarea{field-sizing:content;height:auto;min-height:calc(1lh + 8px);max-height:calc(2lh + 8px);white-space:pre-wrap;overflow-wrap:anywhere;overflow-y:auto}
@media(max-width:850px){.chat-composer-field{font-size:11px}#in-game-chat .chat-composer-field{font-size:14px}#chat-composer-tag{padding-left:4px}}

/* Achievement titles sit at the bottom right of each roster entry. */
.character-entry .character-title{position:absolute;right:9px;bottom:5px;margin:0;color:#bda56c;font-size:11px;line-height:1;pointer-events:none}
.character-entry.level-99 .character-title{color:#dac4f1}
@media(max-width:850px){.character-entry .character-title{right:5px;bottom:3px;font-size:8px}}

/* Full games remain selectable while the entire row is subdued. */
.game.full-game{opacity:.45}

#in-game-chat .in-game-chat-heading .mini-control{display:inline-flex;align-items:center;justify-content:center;flex:none;width:22px;min-width:22px;height:22px;padding:0}

/* In-game settings combine text size and the shared word filter. */
.in-game-text-size{display:none}
#in-game-chat .in-game-text-size{display:flex;align-items:center;gap:8px;margin-bottom:8px}
#in-game-chat-text-size{flex:1;min-width:0}
#in-game-chat-text-size-value{min-width:35px;color:#e6e3de}
#in-game-chat #chat,#in-game-chat .chat-input input,#in-game-chat .chat-composer-field,#in-game-chat-preview{font-size:var(--game-chat-size,17px)}
@media(max-width:850px){#in-game-chat #chat,#in-game-chat .chat-input input,#in-game-chat .chat-composer-field,#in-game-chat-preview{font-size:calc(var(--game-chat-size,17px) - 3px)}}

/* Keep channel colors when the shared tabs are inside the game dialog. */
#in-game-chat .chat-channel-tab{color:var(--channel-color);background:linear-gradient(#202124,#09090a);border:1px solid #4b4538}
#in-game-chat .chat-channel-tab.active{background:#353025;border-color:var(--channel-color);box-shadow:inset 0 -2px var(--channel-color)}

#in-game-chat .in-game-chat-heading > span:first-child{font-size:14px}

/* Keep the right-panel labels and controls readable at both breakpoints. */
.panel.right .fields {
  --game-field-height: 29px;
}
.panel.right .fields :is(input, .difficulty-buttons, .difficulty-button) {
  height: var(--game-field-height);
}
.panel.right .fields input {
  display: block;
}
.panel.right{font-size:18px}
.panel.right .tabs{height:41px;flex:none}
.panel.right .tabs > .tab{font-size:21px}
.panel.right .btn{font-size:17px}
.panel.right :is(.field label,.filterline label,.game-settings-group>summary){font-size:17px}
.panel.right :is(.field input,.filterline input,.filterline select,.create-option input[type=number]){font-size:17px}
.panel.right :is(.difficulty-button,.create-option,.create-options select){font-size:15px}
.panel.right .create-option label{white-space:normal}
.panel.right :is(.game,.game-header,.game-details-title,.detail-tab,.age-filter-panel,.age-filter-inputs input,.age-filter-inputs select,.friends-filter-empty){font-size:16px}
.panel.right :is(.game,.game-header){grid-template-columns:minmax(0,1fr) 80px 49px 55px 24px 19px;letter-spacing:0}
.game-tz img{display:block;width:1em;height:1em;object-fit:contain}
.panel.right #search{height:29px}
.panel.right .filterline{--game-filter-height:30px}
.panel.right :is(.activity-filter-tab,.difficulty-controls .mini-control){height:var(--game-filter-height)}
.panel.right .difficulty-controls .mini-control{width:var(--game-filter-height);min-width:0;padding:0;font-size:18px}
.panel.right .settings p{font-size:17px}
.game-detail-summary{display:flex;justify-content:space-evenly;gap:4px}
.game-detail-summary p{margin:0}
.panel.right :is(.settings h4,.settings strong,.game-detail-players){font-size:18px}
.panel.right .activity-filter-tab{font-size:14px;padding:6px 1px}
@media(max-width:850px){
 .panel.right .fields{--game-field-height:22px}
 .panel.right .tabs{height:29px}
 .panel.right .tabs > .tab{font-size:15px}
 .panel.right .btn{font-size:12px}
 .panel.right :is(.field label,.filterline label,.create-option,.create-options select){font-size:12px}
 .panel.right :is(.field input,.filterline input,.filterline select,.create-option input[type=number]){font-size:13px}
 .panel.right .description-field input{font-size:17px}
 .panel.right .difficulty-button{font-size:11px}
 .panel.right :is(.game,.game-header,.settings p,.friends-filter-empty){font-size:12px}
 .panel.right :is(.game,.game-header){grid-template-columns:minmax(0,1fr) 55px 34px 39px 16px 12px}
 .panel.right :is(.settings h4,.settings strong,.game-detail-players,.game-details-title,.detail-tab,.game-settings-group>summary){font-size:13px}
 .panel.right #search{height:22px}
 .panel.right .filterline{--game-filter-height:25px}
 .panel.right .difficulty-controls .mini-control{font-size:14px}
 .panel.right .activity-filter-tab{font-size:11px;padding-block:5px}
}

/* Larger left-panel labels and controls; chat messages and composer retain their sizes. */
.screen .panel:not(.right) :is(.server-row,.server-row select,.character-mode,.character-sortbar,.restore-character,.social-tab){font-size:16px}
.screen .panel:not(.right) .chat-section-tab{font-size:21px}
.screen .panel:not(.right) .character-entry{font-size:23px}
.screen .panel:not(.right) .character-entry small{font-size:19px}
.screen .panel:not(.right) :is(.friend-group-title,.friend-name){font-size:19px}
.screen .panel:not(.right) .deleted-character-entry small{font-size:15px}
.screen .panel:not(.right) .chat-section-tabs{height:38px;flex:none}
.screen .panel:not(.right) .server-row select{height:29px}
.screen .panel:not(.right) .btn{font-size:17px}
.screen .panel:not(.right) .server-menu-actions .mini-control{font-size:12px}
.screen .panel:not(.right) .chat-channel-tab{font-size:14px;min-height:28px}
.screen .panel:not(.right) .chat-actions select,.screen .panel:not(.right) .recent-deleted-title,.screen .panel:not(.right) .deleted-character-entry{font-size:15px}
.screen .panel:not(.right) .chat-actions .mini-control{font-size:13px}
.screen .panel:not(.right) .friends-panel{font-size:16px}
.friend .class-avatar{overflow:hidden;border:1px solid #5f7050;border-radius:3px}
.friend .class-avatar img{display:block;width:100%;height:100%;object-fit:cover}
.screen .panel:not(.right) .friend small{font-size:16px}
.screen .panel:not(.right) .chat-filter-panel label,.screen .panel:not(.right) .chat-filter-panel textarea{font-size:14px}
.screen .panel:not(.right) .chat-filter-panel small{font-size:13px}
.screen .panel:not(.right) .market-panel{font-size:14px}
.screen .panel:not(.right) .market-heading h2{font-size:22px}
.screen .panel:not(.right) .market-item h3{font-size:16px}
.screen .panel:not(.right) .market-item p,.screen .panel:not(.right) .market-item .mini-control{font-size:13px}
.screen .panel:not(.right) .market-listing .btn{font-size:14px}
@media(max-width:1100px){.screen .panel:not(.right) .server-menu-actions .mini-control{font-size:10px}}
@media(max-width:850px){
.screen .panel:not(.right) :is(.server-row,.server-row select,.character-mode,.social-tab){font-size:13px}
.screen .panel:not(.right) .chat-section-tab{font-size:15px}
.screen .panel:not(.right) .character-entry{font-size:18px}
.screen .panel:not(.right) .character-entry small{font-size:16px}
.screen .panel:not(.right) :is(.friend-group-title,.friend-name){font-size:14px}
.screen .panel:not(.right) .friend small{font-size:12px}
.screen .panel:not(.right) .chat-section-tabs{height:27px}
.screen .panel:not(.right) .server-row select{height:22px}
.screen .panel:not(.right) .btn{font-size:12px}
.screen .panel:not(.right) .chat-channel-tab{font-size:11px;min-height:22px}
.screen .panel:not(.right) .chat-actions select,.screen .panel:not(.right) .chat-actions .mini-control{font-size:10px}
.screen .panel:not(.right) .market-panel{font-size:12px}
.screen .panel:not(.right) .market-heading h2{font-size:16px}
.screen .panel:not(.right) .market-item h3{font-size:13px}
.screen .panel:not(.right) .market-item .mini-control{font-size:11px}
}

/* Server first, menu next, chat controls anchored to the right. */
.screen .panel:not(.right) .server-row{flex-wrap:nowrap;justify-content:flex-start;gap:5px}
.screen .panel:not(.right) .server-location{margin-left:0;gap:4px;flex:none}
.screen .panel:not(.right) .server-location select{width:90px}
#lobby-chat-tools{display:flex;align-items:center;gap:3px;margin-left:auto;flex:none}
#lobby-chat-tools[hidden]{display:none}
#lobby-chat-tools .mini-control{display:inline-flex;align-items:center;justify-content:center;width:25px;min-width:25px;padding:0}
.screen .panel:not(.right) .chat-actions{grid-template-columns:minmax(0,1fr)}
@media(max-width:850px){.screen .panel:not(.right) .server-location select{width:67px}#lobby-chat-tools .mini-control{width:20px;min-width:20px}}

/* Shared player communities keep a second destination tag in the composer. */
.community-tag{color:#64d6c6;white-space:nowrap}
#chat-community{flex:0 1 auto;max-width:145px;min-width:70px;width:auto;height:auto;margin:0;padding:2px;border:0;background:#111;color:#64d6c6;font:inherit}
#chat-community[hidden]{display:none}
.screen .panel:not(.right) .chat-channel-tabs,#in-game-chat .chat-channel-tabs{display:flex;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;min-width:0}
.screen .panel:not(.right) .chat-channel-tab,#in-game-chat .chat-channel-tab{flex:1 1 0;min-width:0;padding-left:5px;padding-right:5px}
.screen .panel:not(.right) .chat-channel-tab{min-width:max-content}

/* Social hub and its three sections. */
.social-panel{display:flex;flex-direction:column;flex:1;min-height:0;gap:9px}
.friends-section{display:flex;flex:1;min-height:0;flex-direction:column;gap:5px}
.friend-view-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;flex:none;align-self:center;width:max-content;max-width:100%}
.friend-activity-list{margin:0;padding:0;list-style:none}
.friend-activity-list li{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:7px 2px;border-bottom:1px solid #454239}
.friend-activity-list small{display:block;margin-top:3px;color:#b5aa93;overflow-wrap:anywhere}
.recent-player-presence[data-online='false']{background:transparent;border:1px solid #a6a4a0}
.friend-activity-list .btn{flex:none}
.friend-requests{margin-bottom:15px}
#clan-requests-heading{margin:0;color:#a0c999}
.clan-request-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:4px}
.clan-request-actions .btn{padding:3px 6px;letter-spacing:0}
.screen button:has(> .request-count-badges){display:flex;align-items:center;justify-content:center;gap:6px}
.request-count-badges{display:flex;flex:none;gap:2px;pointer-events:none}
.request-count-badges:not(:has(> :not([hidden]))){display:none}
.request-count-badge{background:#285c94;border-color:#6799cc}
.request-count-badge[data-request-kind='clan']{background:#356c40;border-color:#79a77e}
#friend-list:not([hidden]){display:flex;flex-direction:column;overflow:hidden;gap:8px}
.friend-list-scroll{flex:1;min-height:0;overflow:auto}
.friend-list-actions{flex:none}
.friend-list-actions .btn{width:100%}
#add-friend-dialog {
  width: min(590px, calc(100vw - 24px));
  aspect-ratio: 1181 / 485;
  padding: 0;
  border: 0;
  background: url('img/friend-button.png') center / 100% 100% no-repeat;
}
#add-friend-form { position: absolute; inset: 0; }
#add-friend-form :is(h3, label) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
#add-friend-form input {
  position: absolute;
  inset: 44.5% auto auto 22.8%;
  width: 55.4%;
  height: 13.6%;
  margin: 0;
  padding: 0 5px;
  border: 0;
  background: transparent;
  color: #f6e8c5;
  font-size: clamp(12px, 2.5vw, 18px);
}
#add-friend-form .delete-buttons { display: contents; }
#add-friend-form .delete-buttons button {
  position: absolute;
  top: 71.7%;
  width: 43%;
  height: 20%;
  padding: 0;
  border: 0;
  border-image: none;
  background: transparent;
  box-shadow: none;
  color: transparent;
  text-shadow: none;
}
#add-friend-form button[type='submit'] { left: 5.8%; }
#add-friend-cancel { left: 50.2%; }
#add-friend-form .delete-buttons button:hover { background: #ffe2a515; }
.social-panel[hidden],.social-content[hidden]{display:none!important}
:is(.social-tabs,.character-tabs){display:flex;gap:3px;flex:none;min-height:32px}
:is(.social-tab,.character-mode){flex:1;min-width:0;padding:5px 2px;border:2px ridge #4b4538;background:linear-gradient(#252629,#09090a);color:#bfb7a4;font:14px Georgia;cursor:pointer}
:is(.social-tab,.character-mode).active{background:#29251e;color:white;border-bottom-color:#a68d58}
:is(.social-tab,.character-mode):focus-visible{outline:1px solid var(--gold);outline-offset:1px}
.social-content{flex:1;min-height:0;overflow:auto;padding:10px;font:14px Arial}
.social-empty{color:#aaa;line-height:1.5}
.community-directory-search{display:grid;gap:5px;margin-bottom:10px;color:#c8b789}
.community-directory-search input{width:100%;padding:7px 8px;border:1px solid #655537;background:#12110e;color:#efe5ce;font:inherit}
.community-directory-search input:focus-visible{outline:1px solid #c8a757;outline-offset:1px}
.social-community[hidden]{display:none}
.social-community{
  display:grid;
  gap:9px;
  width:100%;
  min-height:104px;
  padding:12px;
  margin-bottom:8px;
  border:1px solid #4a4130;
  background:radial-gradient(ellipse at center,#18150f88,#090908ed),var(--lobby-stone) center / 170px auto repeat;
  color:#e3d9c3;
  font:inherit;
  text-align:left;
  cursor:pointer;
}
.social-community:hover{border-color:#887448}
.social-community:focus-visible{outline:1px solid var(--community-color);outline-offset:-3px}
.community-card-heading,.community-card-details{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:3px 10px}
.community-name{color:var(--community-color);font:small-caps bold 20px Georgia}
.community-card-description{line-height:1.4}
.community-card-details{padding-top:6px;border-top:1px solid #453d2c;color:#b7a67f;font-size:.85em}
.community-membership{color:#b7a67f;font-size:.85em}
.community-roster:not([hidden]){display:flex;flex-direction:column;height:100%;padding:0 4px}
.community-page-heading{flex:none;margin-top:12px;text-align:center}
.community-page-heading h3{margin:0;color:var(--community-color);font:small-caps bold clamp(20px,2vw,28px) Georgia}
.community-counts{margin:0;color:#b7a67f;font-size:.85em}
.community-membership-button{border:1px solid #766340;background:#242016;color:#ead6a6;padding:4px 8px;font:inherit;cursor:pointer}
.community-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-self:center;width:min(100%,330px);flex:none;gap:5px;margin-top:10px}
.community-tabs.clan-tabs{grid-template-columns:repeat(4,minmax(0,1fr));width:min(100%,440px)}
.community-tabs .btn,.community-back.btn,.friend-view-tabs .btn{flex:none;padding:4px 9px;letter-spacing:0}
.friend-view-tabs .btn{min-width:0;padding-inline:0;overflow-wrap:anywhere}
:is(.community-roster,.clan-browser) [role="tabpanel"][hidden]{display:none}
.community-roster-view{display:flex;flex-direction:column;flex:1;min-height:0;padding:8px 0}
.community-roster-footer{display:flex;align-items:center;flex:none;gap:8px;margin-top:auto;padding-top:6px;border-top:1px solid #454033}
.community-roster-summary{display:flex;align-items:center;gap:8px}
.community-roster-view[hidden]~.community-roster-footer .community-roster-summary{display:none}
.community-roster-footer .community-back{margin-left:auto}
.community-visibility.mini-control{display:grid;place-items:center;flex:none;width:29px;height:27px;padding:0}
.community-visibility[aria-pressed="false"] .community-eye-slash{display:none}
.community-ranks{--community-columns:minmax(0,1fr) clamp(46px,7vw,90px) clamp(48px,8vw,106px) 40px}
.clan-roster-view{--community-columns:minmax(0,1fr) clamp(43px,5vw,70px) clamp(48px,7vw,92px) clamp(44px,6vw,72px) 40px}
.clan-point-heading,.clan-point-value{text-align:right}
.clan-point-value{grid-column:4;grid-row:1 / 3;align-self:center;color:#c9bb96;font-size:.85em;font-variant-numeric:tabular-nums}
.community-ranks{display:grid;align-content:start;flex:1;min-height:0;overflow:auto;gap:8px}
.community-roster-columns{display:grid;grid-template-columns:var(--community-columns);align-items:center;gap:8px;padding:5px 6px 5px 10px;position:sticky;top:0;z-index:1;background:#18150f;color:#c8b789;font-size:.85em}
.community-member-search{display:flex;align-items:center;gap:6px;min-width:0}
.community-member-search input{width:100%;min-width:0;max-width:120px;padding:3px 4px;border:1px solid #655537;background:#12110e;color:#efe5ce;font:inherit}
.community-member-search input:focus-visible{outline:1px solid #c8a757}
.community-rank-groups{display:grid;gap:8px}
.community-member-empty{margin:0;padding:0 8px}
.community-ranks h4{margin:0 0 4px;padding-left:10px;color:var(--rank-color);font-size:1em}
.community-ranks ul{display:grid;gap:2px;margin:0;padding:0;list-style:none;color:#ddd}
.community-ranks .clan-member{
  grid-template-columns:var(--community-columns);
  gap:2px 8px;
  padding-block:4px;
  border:1px solid #35322b;
  border-left-width:2px;
  background:radial-gradient(ellipse at center,#17151166 0%,#100f0dc4 62%,#080807f2 100%),var(--lobby-stone) center / 140px auto repeat;
  box-shadow:inset 0 0 8px #0009;
}
.community-ranks .clan-member-name,.community-player-map,.community-player-mode{overflow-wrap:anywhere}
.community-player-mode,.community-player-map{grid-row:1 / 3;align-self:center;color:#c9bb96;font-size:.85em}
.community-player-mode{grid-column:2;display:flex;align-items:center;gap:3px}
.community-mode-icon{display:block;width:20px;height:20px;object-fit:contain}
.community-player-map{grid-column:3}
.community-news{display:grid;min-height:0;overflow:auto;gap:10px;margin-top:10px}
.community-news section,.community-settings{padding:8px;border:1px solid #454033;background:#13120e}
.community-news h4{margin:0 0 6px;color:#dfc489;font:small-caps 1.1em Georgia}
.community-activity{margin:0;padding:0;list-style:none;color:#c9bb96}
.community-activity li{padding:6px 0;border-bottom:1px solid #353025}
.community-activity li:last-child{border-bottom:0}
.clan-quest-materials{display:grid;gap:8px;margin:12px 0;padding:0;list-style:none}
.clan-quest-materials li{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;padding:7px 0;border-bottom:1px solid #353025}
.clan-quest-materials li>div{display:grid;gap:4px;color:#dfc489}
.clan-quest-materials span,.clan-quest-status{color:#b7a67f;font-size:.85em}
.clan-quest-materials progress{width:100%;height:7px;accent-color:#a7874c}
.clan-boss-quest .btn{padding:3px 6px;font-size:12px;letter-spacing:0}
.clan-boss-quest .btn:disabled{opacity:.45;cursor:default}
.community-announcement{margin:0;color:#ddd;line-height:1.4}
.community-announcement-author{margin:5px 0 0;color:#b7a67f;font-size:.85em}
.community-settings{margin-top:10px}
@media(max-width:850px){.social-panel{gap:4px}:is(.social-tabs,.character-tabs){min-height:24px}:is(.social-tab,.character-mode){font-size:10px}.social-content{padding:4px;font-size:12px}}

/* Item artwork in market listings. */
.market-item-icon{display:flex;align-items:center;justify-content:center;width:48px;min-height:48px}
.market-item-icon img{display:block;max-width:100%;max-height:64px;object-fit:contain}
@media(max-width:850px){.market-item-icon{width:32px;min-height:32px}.market-item-icon img{max-height:44px}}

.shop-inspection[hidden]{display:none!important}

.game-details-title{margin:0 0 12px;padding:5px 1px;color:#fff;font:small-caps 14px Georgia;letter-spacing:0}
@media(max-width:850px){.game-details-title{font-size:11px}}

/* Clan browser: fixed navigation with one flat, scrolling roster. */
#clan-panel.clan-browser{display:flex;flex-direction:column;overflow:hidden;--community-color:#c6ac67}
.clan-browser .community-settings{min-height:0;overflow:auto}
.clan-browser .community-settings .clan-structure{max-height:none}
.clan-roster-view .clan-navigation{flex:none}
.clan-navigation{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;margin-bottom:10px}
.clan-navigation button{display:flex;justify-content:space-between;align-items:center;gap:4px;min-width:0;border:1px solid #303e34;background:#111613;color:#b6c0b8;padding:7px 6px;cursor:pointer;font:12px Georgia;text-align:left}
.clan-navigation button[data-group="leadership"]{grid-column:2 / 5;grid-row:1;justify-content:center;gap:10px}
.clan-navigation button[data-group="all"]{grid-column:5;grid-row:1;justify-self:end;width:fit-content;justify-content:center;gap:8px;padding-left:8px;padding-right:8px}
.clan-navigation button:not([data-group="all"]):not([data-group="leadership"]){grid-row:2;position:relative;justify-content:center;text-align:center;padding-bottom:20px}
.clan-navigation button:not([data-group="all"]):not([data-group="leadership"]) span{position:absolute;right:5px;bottom:4px}
.clan-navigation button span{font:10px Arial;color:#999}
.clan-navigation button:hover{filter:brightness(1.25)}
.clan-navigation button:focus-visible{outline:1px solid #8fa892;outline-offset:1px}
.clan-list-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;border-bottom:1px solid #303e34;padding-bottom:7px;flex:none}
.clan-list-heading h4{margin:0;color:#ddd;font:14px Georgia}
.clan-list-heading>span{font-size:11px;color:#aaa}
.clan-members{list-style:none;margin:0;padding:0 5px 0 0;flex:1;min-height:0;overflow:auto}
.clan-member{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;padding:10px 5px;border-bottom:1px solid #252e28}
.clan-roster-view .clan-member{grid-template-columns:var(--community-columns)}
.clan-member:hover{background:#171e19}
.clan-member-name{color:#aec0b1;font-size:14px;overflow-wrap:anywhere}
.clan-member-status{font-size:10px;color:#777;align-self:center}
.clan-member-status.is-online{color:#8caf94}
.clan-member-rank{grid-column:1 / -1;color:#9eafa2;font-size:11px}
.clan-member small{grid-column:1 / -1;color:#aaa;font-size:11px;line-height:1.5}
.clan-empty{color:#aaa;font-size:12px}
.clan-empty[hidden]{display:none}
.clan-structure{flex:none;max-height:45%;overflow:auto;border-top:1px solid #303e34;color:#829687;font-size:11px}
.clan-structure summary{padding:8px 0;cursor:pointer}
.clan-structure table{width:100%;border-collapse:collapse;font-size:10px;color:#ccc}
.clan-structure th,.clan-structure td{padding:6px 3px;text-align:left;border-bottom:1px solid #323235}
.clan-structure tbody th{font-weight:normal}
.clan-structure tfoot{color:#8fa892}
@media(max-width:850px){.clan-navigation{gap:3px;margin-bottom:6px}.clan-navigation button{font-size:10px;padding:5px 4px}.clan-member{padding:7px 3px}.clan-member-name{font-size:12px}}

@media(max-width:850px){.clan-navigation button:not([data-group="all"]):not([data-group="leadership"]){padding-bottom:18px}}

.clan-member-character{color:#aaa;font-size:11px}

/* Each lower clan rank steps farther into the roster. */
.clan-member,.community-ranks h4{margin-left:calc(var(--roster-rank-depth,0) * 10px)}
@media(max-width:850px){.clan-member,.community-ranks h4{margin-left:calc(var(--roster-rank-depth,0) * 6px)}}

/* Green clan identity; rank labels retain six distinct colors. */
#clan-panel{border-color:#3a463d;background:linear-gradient(145deg,#131914,#0c100d 65%)}
.social-tab[data-social-view="clan"]{color:#95aa99}
.social-tab[data-social-view="clan"].active{background:#202c24;border-color:#3a463d;border-bottom-color:#8fa892;color:#bdccbf}
#clan-panel input:focus-visible,#clan-panel select:focus-visible{outline:1px solid #8fa892;outline-offset:1px}
#clan-panel [data-rank="Clan Leader"]{--rank-color:#f0cf78}
#clan-panel [data-rank="Deputy Leader"]{--rank-color:#e9a879}
#clan-panel [data-rank="Elder"]{--rank-color:#c1a3e8}
#clan-panel [data-rank="Division Leader"]{--rank-color:#8bbef0}
#clan-panel [data-rank="Squad Leader"]{--rank-color:#76cfc1}
#clan-panel [data-rank="Clan Member"]{--rank-color:#a4c9ab}
.clan-member-rank{color:var(--rank-color,#a4c9ab)}
.clan-member{border-left:2px solid var(--rank-color,#a4c9ab);padding-left:8px}
.clan-structure tbody th{color:var(--rank-color,#a4c9ab)}

/* Clan group buttons share one height and count placement. */
.clan-navigation{grid-auto-rows:32px}
.clan-navigation button[data-group="leadership"],.clan-navigation button:not([data-group="all"]):not([data-group="leadership"]){position:relative;height:100%;padding:3px 6px 11px;justify-content:center}
.clan-navigation button[data-group="leadership"] span{position:absolute;right:5px;bottom:4px}
@media(max-width:850px){.clan-navigation{grid-auto-rows:28px}.clan-navigation button[data-group="leadership"],.clan-navigation button:not([data-group="all"]):not([data-group="leadership"]){padding:2px 4px 10px}}

/* Gold-framed stone controls, matching the classic Send button. */
:is(.screen, .delete-dialog) :is(.btn, .mini-control, .difficulty-button, .delete-buttons button, .restore-character, .clan-navigation button) {
  border: 6px solid #806438;
  border-image: url('assets/ui/button-frame.png') 12 / 6px / 0 stretch;
  background-color: #24231f;
  background-image: radial-gradient(ellipse at center, #ffffff16 0%, #0002 35%, #000b 100%), url('assets/ui/button-face.png');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  box-shadow: inset 0 0 8px 2px #000c, 0 1px 3px #0009;
  text-shadow: 0 2px 2px #000;
}
:is(.screen, .delete-dialog) button:focus-visible {
  outline: 2px solid #d5b768;
  outline-offset: 2px;
}
.screen .difficulty-button.active,
.screen .mini-control[aria-pressed='true'] {
  background-image: radial-gradient(ellipse at center, #c29b4438 0%, #0003 45%, #000c 100%), url('assets/ui/button-face.png');
  color: #f1dfb1;
  box-shadow: inset 0 0 8px 2px #000c, inset 0 -1px 0 #b0985e, 0 1px 3px #0009;
}
.screen :is(.community-tabs .btn,.clan-navigation button,.friend-view-tabs .btn).active {
  color:#f1dfb1;
  box-shadow:inset 0 0 7px #a486476e;
}
.screen :is(.friend-view-tabs .btn,.difficulty-button,.community-tabs .btn,.clan-navigation button):not(.active) {
  position: relative;
  border-image-source: none;
  border-color: transparent;
}
.screen :is(.friend-view-tabs .btn,.difficulty-button,.community-tabs .btn,.clan-navigation button):not(.active)::before {
  content: '';
  position: absolute;
  inset: calc(-1 * var(--muted-frame-width, 6px));
  border: var(--muted-frame-width, 6px) solid transparent;
  border-image: url('assets/ui/button-frame.png') 12 / var(--muted-frame-width, 6px) / var(--muted-frame-outset, 0) stretch;
  filter: saturate(.5);
  pointer-events: none;
}
.screen :is(.difficulty-button,.clan-navigation button) { --muted-frame-width: 4px; }
.screen .fields .difficulty-button { --muted-frame-outset: 2px 0; }
.screen .mini-control[data-mode='non-tz'] {
  background-image: radial-gradient(ellipse at center, #6085a94d 0%, #0005 45%, #000c 100%), url('assets/ui/button-face.png');
}
/* Compact controls retain a substantial frame without crowding their labels. */
:is(.screen, .delete-dialog) :is(.mini-control, .difficulty-button, .restore-character, .clan-navigation button) {
  border-width: 4px;
  border-image-width: 4px;
}
.screen .fields .difficulty-button {
  border-image-outset: 2px 0;
}
.screen .filterline .difficulty-controls .mini-control {
  border-image-outset: 2px;
}
.screen .filterline .difficulty-controls {
  gap: var(--filter-control-gap);
}
.screen .actions :is(#create-game, #join-game),
.screen .character-actions :is(#new-character, #delete-character, #convert-character) {
  border: 0;
  border-image: none;
  background: url('img/big_button.png') center / 100% 100% no-repeat;
  box-shadow: none;
  color: #e6e3de;
  letter-spacing: 1.5px;
  text-shadow: 0 2px 3px #000;
}
.screen .actions :is(#create-game, #join-game) {
  width: 48%;
  min-height: 54px;
  aspect-ratio: 1000 / 256;
  padding: 10px 26px;
}
.screen :is(.actions, .character-actions) :is(#create-game, #join-game, #new-character, #delete-character, #convert-character):enabled:hover { filter: brightness(1.2); }
.screen :is(.actions, .character-actions) :is(#create-game, #join-game, #new-character, #delete-character, #convert-character):enabled:active { filter: brightness(.85); }
.character-actions {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
}
.screen .character-actions :is(#new-character, #delete-character, #convert-character) {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 4px 5px;
  font-size: 16px;
  letter-spacing: .5px;
}
.screen .actions #join-game:disabled,
.screen .character-actions #convert-character:disabled {
  filter: grayscale(1) brightness(.7);
  cursor: default;
}
@media(max-width:850px) {
  .screen .actions :is(#create-game, #join-game) { min-height: 34px; padding: 6px 17px; letter-spacing: .5px; }
  .screen .character-actions :is(#new-character, #delete-character, #convert-character) { min-height: 28px; padding: 3px; font-size: 12px; }
}

/* Tabs use fine gold edges and stone faces shaded toward the perimeter. */
.screen :is(.tab, .chat-section-tab, .chat-channel-tab, .social-tab, .character-mode, .detail-tab, .activity-filter-tab) {
  border: 1px solid #82704f;
  border-image: none;
  background-color: #191a1c;
  background-image: radial-gradient(ellipse at center, #ffffff08 0%, #0003 48%, #000c 100%), url('assets/ui/button-face.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px #000b, inset 0 0 9px #0009, 0 1px 2px #000;
  color: #899593;
  text-shadow: 0 2px 2px #000;
}
.screen :is(.tab, .chat-section-tab, .chat-channel-tab, .social-tab, .character-mode, .detail-tab, .activity-filter-tab).active {
  border-color: #b39b6e;
  background-image: radial-gradient(ellipse at center, #ffffff12 0%, #0002 48%, #000b 100%), url('assets/ui/button-face.png');
  box-shadow: inset 0 0 0 1px #0009, inset 0 0 9px #0008, inset 0 -1px 0 #c4b99a, 0 1px 2px #000;
  color: #f0eeea;
}
.screen :is(.chat-channel-tab, .activity-filter-tab) { color: var(--channel-color, var(--activity-color, #899593)); }
.screen :is(.chat-channel-tab, .activity-filter-tab).active { border-bottom-color: var(--channel-color, var(--activity-color, #c4b99a)); }

.screen .panel.right :is(.tab.active, .difficulty-button.active, .activity-filter-tab.active, .mini-control[aria-pressed='true']),
.screen .panel:not(.right) :is(.chat-section-tab.active, .chat-channel-tab.active, .character-mode.active, .social-tab.active, .mini-control[aria-pressed='true']) {
  filter: brightness(1.3);
}

/* Secondary lobby tabs show the weathered stone grain. */
.screen .panel:not(.right) :is(.social-tab,.character-mode,.chat-channel-tab) {
  background-image:radial-gradient(ellipse at center,#3b322328 0%,#211a1066 60%,#080705bd 100%),var(--lobby-stone);
  background-size:100% 100%,96px auto;
  background-repeat:no-repeat,repeat;
}
.screen .panel:not(.right) :is(.social-tab,.character-mode,.chat-channel-tab).active {
  background-image:radial-gradient(ellipse at center,#66503345 0%,#36291a55 60%,#100c08b3 100%),var(--lobby-stone);
}

/* Inset game frame and a separately framed Exit footer. */
.screen .panel.right { gap: 10px; }
.game-panel-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
  gap: 7px;
  padding: 8px;
  border: 1px solid #454239;
  box-shadow: 0 1px 0 #080808, 0 2px 0 #282824;
}
.exit-frame {
  flex: none;
  display: flex;
  padding: 4px;
  border: 1px solid #454239;
  background: #090909;
  box-shadow: 0 1px 0 #080808, 0 2px 0 #282824;
}
.screen .exit-frame .exit { width: 100%; margin: 0; }
.screen :is(.game-panel-inner > .tabs > .tab, .chat-section-tabs > .chat-section-tab, #create-game, #join-game, .exit-frame > .exit) {
  font-weight: 700;
}
.screen .actions :is(#create-game, #join-game) {
  flex: none;
  width: 43%;
  min-height: 46px;
  padding: 8px 22px;
  font-size: 24px;
}
@media(max-width:850px) {
  .screen .panel.right { gap: 7px; }
  .game-panel-inner { padding: 4px; gap: 4px; }
  .exit-frame { padding: 2px; }
  .screen .actions :is(#create-game, #join-game) { min-height: 29px; padding: 5px 14px; font-size: 16px; }
}

/* Lobby chat uses the same restrained inset frames as the game panel. */
.screen .panel:not(.right) .chat-log,
.screen .panel:not(.right) .chat-input {
  border: 1px solid #454239;
  border-image: none;
  box-shadow: 0 1px 0 #080808, 0 2px 0 #282824;
}
.screen .panel:not(.right) .chat-log { min-height: 0; }
.screen .panel:not(.right) .chat-input {
  flex-shrink: 0;
  padding: 3px;
  background: #090909;
  margin-top: 3px;
}

/* Center both composer buttons within their stone faces. */
.chat-input > .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1;
}
#exit-confirm-dialog {
  width: min(760px, calc(100vw - 32px));
  padding: clamp(22px, 4vw, 44px) 28px 22px;
  border: 10px solid #393a37;
  border-image: url('assets/ui/panel-frame.png') 44 / 18px / 0 stretch;
  background: linear-gradient(#0008, #0008), url('assets/ui/stone-tile.png');
  color: #eee8d8;
  box-shadow: inset 0 0 24px #000, 0 12px 60px #000;
  text-align: center;
}
#exit-confirm-dialog::backdrop { background: #000b; }
#exit-confirm-title {
  margin: 20px 0 64px;
  font: small-caps clamp(16px, 2vw, 23px) Georgia;
  letter-spacing: 2px;
  line-height: 1.5;
}
.exit-confirm-actions { display: flex; justify-content: center; gap: 12px; }
.exit-confirm-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48%;
  aspect-ratio: 1000 / 256;
  min-height: 52px;
  border: 0;
  padding: 10px 26px;
  background: url('img/big_button.png') center / 100% 100% no-repeat;
  color: #eee8d8;
  font: small-caps clamp(18px, 2.4vw, 28px) Georgia;
  text-shadow: 0 2px 3px #000;
  cursor: pointer;
}
.exit-confirm-actions button:hover { filter: brightness(1.2); }
.exit-confirm-actions button:focus-visible { outline: 2px solid #d5b768; outline-offset: 2px; }

#main-menu-panel {
  width: min(360px, calc(100vw - 32px));
  padding: 24px;
  border: 8px solid #393a37;
  border-image: url('assets/ui/panel-frame.png') 44 / 16px / 0 stretch;
  background: linear-gradient(#0007, #0009), url('assets/ui/stone-tile.png');
  box-shadow: inset 0 0 20px #000, 0 10px 40px #000;
}
#main-menu-panel:popover-open { display: flex; flex-direction: column; gap: 10px; }
#main-menu-panel::backdrop { background: #0007; }
#main-menu-panel button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 58px;
  aspect-ratio: 1000 / 256;
  padding: 10px 30px;
  border: 0;
  border-image: none;
  background: url('img/big_button.png') center / 100% 100% no-repeat;
  box-shadow: none;
  color: #eee8d8;
  font: small-caps 20px Georgia;
  letter-spacing: 1.5px;
  text-shadow: 0 2px 3px #000;
  cursor: pointer;
}
#main-menu-panel button:hover { filter: brightness(1.2); }

#main-menu-panel .server-location {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 8px 8px;
  color: #d5c7a4;
  font: small-caps 18px Georgia;
}
#main-menu-panel .server-location select {
  width: 140px;
  height: 32px;
  font: 15px Georgia;
}

.screen .character-footer .character-tools { width: 100%; align-items: center; }
.chat-filter-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #c3ad70; }
.chat-filter-heading #chat-filter-close { display: inline-flex; align-items: center; justify-content: center; padding: 0; width: 25px; height: 25px; font: 20px/1 Georgia; }

/* Chat visibility and word filters sit beside the left composer button. */
.screen .panel:not(.right) .chat-input #lobby-chat-tools {
  margin-left: 0;
  display: flex;
  align-items: stretch;
  gap: 3px;
  flex: none;
}
.screen .panel:not(.right) .chat-input #lobby-chat-tools[hidden] { display: none; }
.screen .panel:not(.right) .chat-input #lobby-chat-tools .mini-control {
  width: 29px;
  min-width: 29px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* Keep native select text legible inside the main menu. */
#main-menu-panel .server-location select {
  color: #e1d7bd;
  background: #111214;
  border: 1px solid #665a46;
  padding: 3px 7px;
  color-scheme: dark;
  opacity: 1;
}
#main-menu-panel {
  height: auto;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}
#main-menu-panel > * { flex-shrink: 0; }

/* Keep the main menu centered independently of the gem. */
#main-menu-panel {
  position: fixed;
  inset: 50% auto auto 50%;
  margin: 0;
  transform: translate(-50%, -50%);
}

/* Class portraits replace the roster's right-hand status text. */
.clan-member .clan-member-portrait {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid #3b403b;
  background: radial-gradient(#252b26, #101410);
  color: #626b63;
  box-shadow: inset 0 0 6px #0009;
  overflow: hidden;
}
.clan-member .clan-member-portrait.is-online { border-color: #64aa63; box-shadow: 0 0 4px #47864a44; }
:is(.community-ranks,.clan-roster-view) .clan-member .clan-member-portrait { width:40px;height:40px; }
.community-ranks .clan-member .clan-member-portrait { grid-column:4; }
.clan-roster-view .clan-member .clan-member-portrait { grid-column:5; }
.community-ranks .clan-member-portrait svg { width: 27px; height: 27px; }
.clan-member-portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.clan-member-portrait svg { width: 28px; height: 28px; }
.clan-member .clan-member-rank { grid-column: 1; }
@media(max-width:850px) {
  .clan-member .clan-member-portrait { width: 34px; height: 34px; }
  .clan-member-portrait svg { width: 23px; height: 23px; }
}

/* Richer clan colors and traditional lettering to match the lobby. */
#clan-panel {
  color: #d2c7ad;
  font-family: Georgia, 'Times New Roman', serif;
  border-color: #46543b;
  background: linear-gradient(135deg, #182015dd, #090e0bdd 70%), url('assets/ui/stone-tile.png');
}
#clan-panel .clan-list-heading > span { color: #baaa80; }
#clan-panel :is(input, select) { font-family: Georgia, 'Times New Roman', serif; color: #e0d6bd; }
#clan-panel input::placeholder { color: #9c957f; opacity: 1; }
#clan-panel .clan-list-heading h4 { color: #d9c594; font-variant: small-caps; letter-spacing: .6px; }
#clan-panel .clan-member-name { color: #d3c49c; font-family: Georgia, 'Times New Roman', serif; }
#clan-panel .clan-member-character { color: #b7ad91; font-family: Georgia, 'Times New Roman', serif; }
#clan-panel .clan-member-rank { font-family: Georgia, 'Times New Roman', serif; }
#clan-panel .clan-member { border-bottom-color: #303c29; }
#clan-panel .clan-member:hover { background: #25301b66; }
#clan-panel .clan-navigation button span { color: #c2ae7b; font-family: Georgia, 'Times New Roman', serif; }
#clan-panel [data-rank="Clan Leader"],.community-ranks [data-rank="Owner"] { --rank-color: #e8b943; }
#clan-panel [data-rank="Deputy Leader"] { --rank-color: #dc9050; }
#clan-panel [data-rank="Elder"],.community-ranks [data-rank="Moderator"] { --rank-color: #ad78dc; }
#clan-panel [data-rank="Division Leader"] { --rank-color: #579fdf; }
#clan-panel [data-rank="Squad Leader"] { --rank-color: #41bda4; }
#clan-panel [data-rank="Clan Member"],.community-ranks [data-rank="Member"] { --rank-color: #8fb45c; }
#clan-panel .clan-structure table { color: #cfc2a2; font-family: Georgia, 'Times New Roman', serif; }

.clan-member { cursor: context-menu; }
#clan-member-context {
  position: fixed;
  z-index: 1200;
  width: 205px;
  border: 2px ridge #756345;
  background: #10130f;
  box-shadow: 0 8px 24px #000b;
  font-family: Georgia, 'Times New Roman', serif;
}
#clan-member-context[hidden] { display: none; }
#clan-member-context button[hidden] { display: none; }
.clan-context-name { padding: 9px; border-bottom: 1px solid #554936; color: #dfcfaa; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#clan-member-context button {
  display: block;
  width: 100%;
  padding: 8px;
  border: 0;
  border-bottom: 1px solid #383b2f;
  background: linear-gradient(#25271e, #11140e);
  color: #c6a56b;
  font: small-caps 14px Georgia;
  letter-spacing: 1px;
  cursor: pointer;
}
#clan-member-context button:hover, #clan-member-context button:focus-visible { background: #3c3925; color: #fff0c9; outline: 1px solid #998052; outline-offset: -2px; }
#clan-member-context button:disabled,
#clan-member-context button:disabled:hover {
  color: #66685d;
  background: #141610;
  cursor: default;
  outline: none;
}

/* Match the clan roster to the lobby's charcoal stone palette. */
#clan-panel {
  border-color: #514b3d;
  background-color: #101010;
  background-image: linear-gradient(90deg, #0005, transparent 40%, #0004), url('assets/ui/stone-tile.png');
}
#clan-panel .clan-member { border-bottom-color: #35322b; }
#clan-panel .clan-member:hover { background: #75603a1f; }
#clan-panel :is(.clan-list-heading, .clan-structure) { border-color: #494336; }
#clan-panel .clan-navigation button {
  border-image-source: linear-gradient(145deg,#746447,#41392b 60%,#67583f);
  border-image-slice: 1;
}
#clan-panel .clan-structure { color: #b3a176; }

/* Community labels keep distinct colors, including existing message markup. */
#chat [data-community="Rushing"] .community-tag { color: #efbd68; }
#chat [data-community="Barbarian"] .community-tag { color: #e88777; }
#chat [data-community="Baal Runs"] .community-tag { color: #91c978; }
#chat [data-community="Sorceress"] .community-tag { color: #ab9bea; }
#chat [data-community="Holy Grail"] .community-tag { color: #e3ce84; }

#clan-panel .clan-branch-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: -3px 4px -3px 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #c6ac67;
  font: 16px Georgia;
  cursor: pointer;
  vertical-align: middle;
}
#clan-panel .clan-branch-toggle:hover { color: #fff0c9; }
#clan-panel .clan-branch-toggle:focus-visible { outline: 1px solid #998052; }
#clan-panel .clan-collapsible { cursor: pointer; }
#clan-panel .clan-collapsible:focus-visible { outline: 1px solid #998052; outline-offset: -1px; }

.market-item[data-item-type="set"] h3,
.market-item[data-item-type="set"] .market-name-button:hover { color: #00c400; }
.market-item[data-item-type="set"] .market-name-button { text-decoration-color: #3c7030; }

/* Seller identity and shop action share the compact right side of listings. */
.market-item { display:grid;grid-template-columns:auto minmax(0,1fr) auto;padding-top:6px;padding-bottom:6px;gap:7px; }
.market-item-prices { display:block;margin-top:3px;min-width:0;white-space:nowrap;overflow-x:auto;font-size:clamp(10px,.85vw,13px); }
.market-price-or { color:#fff; }
.market-seller-actions { display: flex; align-items: center; gap: 7px; flex: none; }
.market-seller { display: flex; flex-direction: column; align-items: center; width: 76px; min-width: 0; gap: 2px; text-align: center; }
.market-seller img { display: block; width: 32px; height: 32px; object-fit: cover; border: 1px solid #796b48; }
.market-seller-name { max-width: 100%; color: #c9bb98; font: 10px Georgia; overflow-wrap: anywhere; }
.market-seller-server { color: #918978; font: 9px Georgia; }
@media(max-width:850px) {
  .market-seller-actions { gap: 4px; }
  .market-seller { width: 57px; }
  .market-seller img { width: 26px; height: 26px; }
  .market-seller-name { font-size: 9px; }
  .market-seller-server { font-size: 8px; }
}
