#language-switch{position:fixed;right:14px;top:6px;z-index:32;display:flex;align-items:center;gap:7px;font-size:11px}
#language-switch>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#language-switch select{padding:5px 8px;font-size:12px;min-height:30px;background:#172625ed}
#hud .top-right{top:42px}
html[data-language=en] h1{letter-spacing:2px}html[data-language=en] .top-center h2{letter-spacing:1px}
html[data-language=en] .skill small{font-size:9px;max-width:100%;overflow:hidden;text-overflow:ellipsis}
html[data-language=en] .menu-buttons button{letter-spacing:0}
#mobile-controls,#mobile-menu{display:none}
.mobile-help-note{display:none}
.legend-touch #world{touch-action:none}
.legend-touch button{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.legend-touch input,.legend-touch select,.legend-touch textarea{font-size:16px}
.legend-touch #hud .top-left{left:max(8px,env(safe-area-inset-left));top:max(8px,env(safe-area-inset-top));width:184px;padding:7px;gap:7px;z-index:2}
.legend-touch #portrait{width:30px;height:38px}
.legend-touch .identity{font-size:11px;margin-bottom:3px}.legend-touch .meter{height:12px;margin-top:3px}
.legend-touch .meter span{font-size:9px;line-height:12px}
.legend-touch #pauseButton{min-width:30px;min-height:30px;padding:3px}
.legend-touch .top-center{top:10px;left:50%;max-width:calc(100vw - 320px)}
.legend-touch .top-center h2{font-size:17px;margin:4px 0;letter-spacing:0}
.legend-touch .top-center #mapkind,.legend-touch #mapsub{display:none}
.legend-touch #language-switch{right:max(8px,env(safe-area-inset-right));top:max(8px,env(safe-area-inset-top))}
.legend-touch #language-switch select{min-height:38px}
.legend-touch #hud .top-right{top:51px;right:max(8px,env(safe-area-inset-right));padding:3px;background:none;border:0;box-shadow:none}
.legend-touch #minimap{width:110px;height:74px}
.legend-touch .mini-label button{min-height:32px}.legend-touch #position{display:none}
.legend-touch #tracker,.legend-touch #guide,.legend-touch #expedition-track{display:none!important}
.legend-touch #target{top:78px;max-width:200px;font-size:10px}
.legend-touch #combat-status{left:8px;right:auto;top:82px;max-width:190px;font-size:9px}
.legend-touch #interact{display:none}
.legend-touch #messages{display:none}.legend-touch #toast{top:145px;max-width:90vw;font-size:12px;z-index:5;padding:9px 12px}
.legend-touch .bottom{bottom:calc(134px + env(safe-area-inset-bottom));width:min(420px,calc(100vw - 220px));left:auto;right:max(8px,env(safe-area-inset-right));transform:none;pointer-events:none}
.legend-touch .bottom-meta{font-size:9px;min-height:20px;padding:2px;gap:5px;justify-content:flex-end;flex-wrap:wrap}
.legend-touch #zone-status,.legend-touch #savestatus,.legend-touch #footwork-status{display:none!important}
.legend-touch .actionbar.glass{padding:5px;gap:5px;flex-wrap:wrap;justify-content:flex-end;pointer-events:none;background:#101e22c7!important;border:1px solid #706348!important;border-image:none!important;overflow:visible}
.legend-touch .actionbar:before,.legend-touch .actionbar:after{display:none}
.legend-touch .actionbar button{pointer-events:auto}
.legend-touch #attackButton,.legend-touch .actionbar>.divider,.legend-touch .menu-buttons,.legend-touch #combat-hud-toggle{display:none!important}
.legend-touch .actionbar #skills{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;width:100%}
.legend-touch .actionbar .skill{width:100%;min-width:42px;height:56px;padding:3px 1px;min-height:44px;border:1px solid #84704c;border-image:none}
.legend-touch .actionbar .skill strong{width:26px;height:26px;font-size:0;line-height:26px}.legend-touch .actionbar .skill small{font-size:9px;line-height:16px;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.legend-touch .skill kbd,.legend-touch .skill-state{display:none}
.legend-touch .skill .cooldown{font-size:18px}
.legend-touch .actionbar>[data-potion],.legend-touch #returnButton{width:calc((100% - 10px)/3);height:48px}
.legend-touch .xp{margin:3px 0}.legend-touch .control-hint{display:none}
.legend-touch .bottom.combat-collapsed .actionbar,.legend-touch .bottom.combat-collapsed .xp{display:flex!important}
.legend-touch .bottom.combat-collapsed #skills{display:grid!important}
.legend-touch #mobile-controls{display:block;position:fixed;inset:0;z-index:12;pointer-events:none;user-select:none;-webkit-user-select:none}
#mobile-stick{position:absolute;bottom:calc(58px + env(safe-area-inset-bottom));left:max(16px,env(safe-area-inset-left));width:112px;height:112px;border:1px solid #d3b97d7a;border-radius:50%;background:radial-gradient(circle,#34493ad9,#0b171b9c);touch-action:none;pointer-events:auto;box-shadow:inset 0 0 16px #0009}
.mobile-stick-cross{position:absolute;inset:0;display:grid;place-items:center;font-size:62px;color:#d3b97d26}
#mobile-stick-knob{position:absolute;top:50%;left:50%;width:44px;height:44px;border-radius:50%;transform:translate(-50%,-50%);background:radial-gradient(circle,#a08d5dec,#4b5141d9);border:1px solid #e3d4a78a;pointer-events:none}
#mobile-stick small{position:absolute;top:100%;left:0;width:100%;text-align:center;color:#c9c9b9;font-size:10px;padding-top:3px}
.mobile-actions{position:absolute;right:max(8px,env(safe-area-inset-right));bottom:calc(66px + env(safe-area-inset-bottom));display:flex;gap:8px;align-items:center;pointer-events:auto}
#mobile-attack{display:grid;place-items:center;width:66px;height:66px;border-radius:50%;font-size:24px;padding:6px;touch-action:none;background:radial-gradient(circle,#756444e8,#273530ef);border-color:#d9bf7e9c;box-shadow:0 3px 15px #0007}
#mobile-attack span{font-size:10px;line-height:12px}#mobile-attack.pressed{background:#aa874b;color:#fff;box-shadow:0 0 16px #e1c68188}
#mobile-interact{width:66px;min-height:40px;padding:5px;font-size:11px}
.mobile-shortcuts{position:absolute;bottom:max(7px,env(safe-area-inset-bottom));left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));display:flex;justify-content:center;gap:7px;pointer-events:auto}
.mobile-shortcuts button{min-width:64px;min-height:40px;font-size:12px;padding:6px 12px;background:#172727ef}
.legend-touch #legend-chat{left:max(8px,env(safe-area-inset-left));right:auto;bottom:calc(225px + env(safe-area-inset-bottom))!important;width:min(300px,calc(100vw - 130px));max-width:none;z-index:13;max-height:35vh;font-size:11px}
.legend-touch #legend-chat .lc-heading{gap:5px}.legend-touch #legend-chat .lc-heading button{min-height:32px;font-size:10px}
.legend-touch #legend-chat.lc-folded{width:auto;max-width:calc(100vw - 140px)}
.legend-touch #legend-chat.lc-folded #lc-unread{display:none}
.legend-touch #legend-chat.lc-folded [data-chat-size]{display:none}
.legend-touch #legend-chat:not(.lc-folded){width:calc(100vw - 16px);max-height:55dvh;bottom:calc(225px + env(safe-area-inset-bottom))!important}
.legend-touch #lc-log{min-height:60px;max-height:22dvh}.legend-touch .lc-compose{flex-wrap:wrap}
.legend-touch .lc-compose input{min-width:90px}.legend-touch .lc-compose button,.legend-touch .lc-tabs button{min-height:36px}
.legend-touch-editing #legend-chat:not(.lc-folded){bottom:env(safe-area-inset-bottom)!important;max-height:70dvh}
.legend-touch-editing .bottom{display:none}
.legend-touch #modal{align-items:center;padding:max(6px,env(safe-area-inset-top)) max(6px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left))}
.legend-touch .panel{width:100%;max-width:900px;max-height:calc(100dvh - 12px);border-radius:6px}
.legend-touch .panel header{padding:8px 12px}.legend-touch .panel h2{font-size:20px;margin:5px 0;letter-spacing:0}
.legend-touch .panel header>button{min-width:44px;min-height:44px;flex-shrink:0}
.legend-touch #panel-content{padding:12px;min-height:0;overflow-x:hidden;-webkit-overflow-scrolling:touch}
.legend-touch #panel-content button{min-height:40px}.legend-touch .tabs{flex-wrap:wrap;gap:5px}
.legend-touch .row{flex-wrap:wrap;gap:8px}.legend-touch .row>div{min-width:0;overflow-wrap:anywhere}
.legend-touch .inventory-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.legend-touch .settings-row{gap:10px;flex-wrap:wrap}.legend-touch .settings-row input{width:min(200px,100%)}
.legend-touch .mobile-help-note{display:block;padding:12px;border:1px solid #d3b97d66;border-radius:4px;color:#d7c69a}
.legend-touch #mobile-menu:not([hidden]){display:grid;place-items:center;position:fixed;inset:0;z-index:31;padding:10px;background:#071317aa;backdrop-filter:blur(5px);pointer-events:auto}
#mobile-menu>section{width:min(460px,94vw);max-height:85dvh;overflow:auto;background:#152428;border:1px solid #857750;border-radius:6px;padding:12px}
#mobile-menu header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;color:#d3b97d}
#mobile-menu header button{width:44px;height:44px;font-size:24px;padding:0}
.mobile-menu-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.mobile-menu-list button{min-height:44px;font-size:12px;padding:8px}
@media(max-width:600px){
  body:not(.legend-touch) #selection,.legend-touch #selection{padding:16px;display:flex;flex-direction:column;overflow:auto;gap:20px;justify-content:flex-start}
  #selection .brand{margin-top:30px;width:100%}#selection .brand h1{font-size:32px;margin:12px 0;letter-spacing:1px}#selection .brand p{font-size:12px;line-height:1.8;margin:12px 0}
  #selection .select-card{width:100%;max-height:none;padding:18px}#selection footer{position:static;padding:10px;font-size:9px;gap:8px}
  .legend-touch .top-center{top:79px;left:8px;transform:none;max-width:calc(100vw - 140px);text-align:left}.legend-touch .top-center h2{font-size:15px}
  .legend-touch #target{top:112px;font-size:10px}.legend-touch #minimap{display:none}
  .legend-touch .bottom{width:calc(100vw - 220px);min-width:130px}
  .legend-touch .bottom-meta #wealth{font-size:8px}
  .legend-touch #combat-status{top:148px}
  .legend-touch .grid,.legend-touch .cm-layout{grid-template-columns:1fr!important}
  .legend-touch .stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .legend-touch .iw-layout{display:flex;flex-direction:column}.legend-touch .iw-preview{max-height:270px}
  .legend-touch .cm-list,.legend-touch .cm-detail{min-width:0;width:100%;max-width:100%}
}
@media(max-height:480px){
  .legend-touch #minimap{display:none}.legend-touch .top-center{top:12px}.legend-touch #target{top:76px}
  .legend-touch .bottom{width:min(390px,calc(100vw - 245px));bottom:calc(134px + env(safe-area-inset-bottom))}
  .legend-touch .actionbar #skills{grid-template-columns:repeat(6,minmax(0,1fr))}
  .legend-touch #legend-chat{bottom:calc(177px + env(safe-area-inset-bottom))!important;max-height:25dvh}
  .legend-touch #legend-chat:not(.lc-folded){width:min(400px,calc(100vw - 16px));bottom:calc(177px + env(safe-area-inset-bottom))!important}
  .legend-touch #interact{bottom:calc(167px + env(safe-area-inset-bottom))}
  .legend-touch .bottom-meta{display:none}.legend-touch .xp{display:none!important}
  .legend-touch #toast{top:100px}
}
.legend-touch .growth-layout,.legend-touch .regalia-layout{grid-template-columns:1fr!important;height:auto!important;min-height:0}
.legend-touch .growth-stage,.legend-touch .regalia-stage{min-height:300px;max-height:420px}
.legend-touch .growth-list,.legend-touch .regalia-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:none;gap:6px}
.legend-touch .growth-panel #panel-content,.legend-touch .commerce-panel #panel-content{overflow:auto!important;max-height:none!important}
.legend-touch .commerce-panel{max-height:calc(100dvh - 16px)!important}
.legend-touch .cm-layout{height:auto!important;min-height:0;overflow:visible!important}
.legend-touch .cm-list,.legend-touch .cm-detail{max-height:none!important;overflow:visible!important}
.legend-touch .iw-panel{max-height:calc(100dvh - 16px)!important}
.legend-touch .iw-panel #panel-content{overflow:auto!important;min-height:0}
.legend-touch .iw-panel>header h2{letter-spacing:0!important;overflow-wrap:anywhere}
.legend-touch .iw-panel #closePanel{min-width:44px;min-height:44px}
.legend-touch .iw-panel .iw-toolbar input,.legend-touch .iw-panel .iw-toolbar select{height:40px!important}
.legend-touch .iw-empty-glyph{font-size:13px;white-space:nowrap}
