/* Independent touch presentation. PC keeps its keyboard command layout. */
#mobileDock,#mobileChat,#mobileMenuClose{display:none}
#battleTargets{display:none}
#app[data-layout=desktop] #layoutToggle{font-size:12px}
#app[data-layout=mobile]{min-height:360px;--dock:58px}
#app[data-layout=mobile] header{height:52px;padding:6px 8px;gap:6px}
#app[data-layout=mobile] header b{font-size:20px;letter-spacing:1px}
#app[data-layout=mobile] header>div{min-width:0;gap:8px}
#app[data-layout=mobile] #place{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#app[data-layout=mobile] header button{font-size:12px;padding:7px;min-height:36px}
#app[data-layout=mobile] #connection{display:none}
#app[data-layout=mobile] #mobileChat{display:block}
#app[data-layout=mobile] #help{display:none}
#app[data-layout=mobile] #objective{top:60px;left:8px;max-width:230px;max-height:58px;overflow:hidden;font-size:12px;padding:5px 8px;line-height:1.6;pointer-events:none}
#app[data-layout=mobile] #mobileDock{display:grid;position:absolute;bottom:0;left:0;right:0;grid-template-columns:repeat(4,1fr);gap:5px;padding:7px 8px max(7px,env(safe-area-inset-bottom));background:#101b2bef;z-index:6}
#app[data-layout=mobile] #mobileDock button{min-height:44px;font-size:14px}
#app[data-layout=mobile] #exploreNav{display:none}
#app[data-layout=mobile][data-menu=open] #exploreNav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));left:8px;right:8px;bottom:68px;max-width:none;max-height:65%;overflow:auto;padding:48px 12px 12px;background:#101b2bfa;border:2px solid #b9a479;z-index:9}
#app[data-layout=mobile] #exploreNav button{font-size:14px;padding:12px;min-height:46px}
#app[data-layout=mobile][data-menu=open] #mobileMenuClose{display:block;position:absolute;bottom:calc(68px + min(65%,500px));right:14px;z-index:10}
#app[data-layout=mobile] #touchControls{left:10px;right:10px;bottom:76px;display:flex;justify-content:space-between;align-items:end;pointer-events:none}
#app[data-layout=mobile] #touchControls>*{pointer-events:auto}
#app[data-layout=mobile] #pad{display:grid;grid-template-columns:repeat(3,48px);grid-template-rows:repeat(2,48px);gap:4px}
#app[data-layout=mobile] #pad button{font-size:22px;touch-action:none}
#app[data-layout=mobile] #interact{min-height:54px;min-width:105px;font-size:15px}
#app[data-layout=mobile] #interaction{left:50%;bottom:190px;max-width:90%;width:max-content;font-size:13px;padding:6px 10px}
#app[data-layout=mobile][data-battle] #chatPanel{display:none;left:8px;right:8px;top:58px;bottom:auto;width:auto;z-index:12;font-size:14px}
#app[data-layout=mobile][data-battle] #chatPanel[open]{display:block}
#app[data-layout=mobile] #chatMessages{height:180px;font-size:14px}
#app[data-layout=mobile] .chat-compose input{font-size:16px;min-height:44px}
#app[data-layout=mobile] .chat-compose button{min-height:44px}
#app[data-layout=mobile] #turnOrder{top:58px;left:8px;right:8px;height:54px;padding:4px;align-items:center;overflow-x:auto}
#app[data-layout=mobile] #turnOrder>b{display:none}
#app[data-layout=mobile] #turnOrder .turn{font-size:13px;min-width:64px;max-width:100px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:6px}
#app[data-layout=mobile] #turnOrder .turn small{display:none}
#app[data-layout=mobile] #turnBanner{top:118px;left:8px;right:8px;padding:6px 8px;max-height:42px;overflow:hidden;font-size:13px;white-space:nowrap;text-overflow:ellipsis}
#app[data-layout=mobile] #battleCommands{left:0;right:0;top:auto;bottom:0;width:auto;height:124px;padding:6px 8px max(8px,env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;overflow:visible;border:0;border-top:2px solid #a68e5a;z-index:7}
#app[data-layout=mobile] #actorName{display:none}
#app[data-layout=mobile] #battlePrompt{grid-column:1/-1;margin:0;font-size:14px;min-height:24px}
#app[data-layout=mobile] #battleCommands>[data-command]{display:block;font-size:14px;line-height:1.3;min-height:48px;padding:6px 2px;margin:0;overflow-wrap:anywhere}
#app[data-layout=mobile] #battleCommands .command-selected:before{content:''}
#app[data-layout=mobile] #battleBack{position:absolute;right:8px;bottom:132px;min-height:40px;z-index:10}
#app[data-layout=mobile] #battleSkills{position:absolute;bottom:178px;left:8px;right:8px;max-height:35dvh;overflow-y:auto;grid-template-columns:repeat(3,minmax(0,1fr));padding:8px;background:#111f30fa;border:2px solid #b9a479;z-index:9}
#app[data-layout=mobile] #battleSkills:empty{display:none}
#app[data-layout=mobile] #battleSkills button{min-height:86px;padding:6px;font-size:13px}
#app[data-layout=mobile] #battleSkills .icon{width:40px;height:40px}
#app[data-layout=mobile] #battleSkills small{font-size:12px}
#app[data-layout=mobile] #skillHint{display:none}
#app[data-layout=mobile] #battleTargets:not(:empty){display:flex;position:absolute;left:8px;right:8px;bottom:178px;gap:6px;flex-wrap:wrap;background:#102237f5;padding:10px;border:2px solid #8cc6e8;z-index:10}
#app[data-layout=mobile] #battleTargets button{flex:1;min-width:90px;min-height:46px;font-size:14px}
#app[data-layout=mobile] #partyHud{left:8px;right:8px;bottom:130px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;max-height:98px;overflow:hidden}
#app[data-layout=mobile] #partyHud .party-card{padding:5px 4px;overflow:hidden;min-width:0}
#app[data-layout=mobile] .party-card>b{font-size:13px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#app[data-layout=mobile] .party-card small{font-size:11px;white-space:nowrap}
#app[data-layout=mobile] .party-card small:last-child{display:none}
#app[data-layout=mobile] #battleLog{bottom:232px;left:8px;right:8px;max-width:none;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:3px 8px}
#app[data-layout=mobile] dialog{width:calc(100% - 12px);max-height:calc(100dvh - 16px);padding:14px;margin:auto}
#app[data-layout=mobile] .split,#app[data-layout=mobile] .inventory-layout{grid-template-columns:1fr}
#app[data-layout=mobile] .skill-tree{height:42dvh}
#app[data-layout=mobile] .details{position:static}
#app[data-layout=mobile] .cards{grid-template-columns:repeat(2,minmax(0,1fr))}
#app[data-layout=mobile] .admin-grid{grid-template-columns:1fr}
#app[data-layout=mobile] .character-slots{grid-template-columns:repeat(2,minmax(0,1fr))}
#app[data-layout=mobile] .start-card{width:100%;max-height:96dvh;padding:14px}
#app[data-layout=mobile] .character-card{min-height:190px}
#app[data-layout=mobile] .character-art{width:100px}
#app[data-layout=mobile] .selection-heading h1{font-size:24px}
@media(orientation:landscape) and (max-height:600px){#app[data-layout=mobile] #turnOrder{height:38px}#app[data-layout=mobile] #turnBanner{top:100px;max-width:65%}#app[data-layout=mobile] #battleCommands{left:auto;top:58px;right:6px;bottom:6px;width:220px;height:auto;display:flex;flex-wrap:wrap;align-content:start;overflow:auto}#app[data-layout=mobile] #battleCommands>[data-command]{width:calc(50% - 4px)}#app[data-layout=mobile] #battlePrompt{width:100%}#app[data-layout=mobile] #partyHud{right:240px;bottom:6px}#app[data-layout=mobile] #battleLog{right:240px;bottom:100px}#app[data-layout=mobile] #battleSkills,#app[data-layout=mobile] #battleTargets:not(:empty){position:static;max-height:55dvh;width:100%;grid-template-columns:repeat(2,1fr)}#app[data-layout=mobile] #battleBack{position:static;width:100%}}

#app[data-layout=mobile][data-menu=open] #mobileMenuClose{bottom:auto;top:120px;right:20px;min-height:44px;background:#403528}

#app[data-layout=mobile][data-menu=open] #mobileMenuClose{position:static;grid-column:1/-1;display:block;min-height:44px}#app[data-layout=mobile][data-menu=open] #exploreNav{padding-top:12px}

#dash{min-width:64px;min-height:48px;touch-action:manipulation}#dash[aria-pressed=true]{background:#695427;border-color:#e8c978;color:#fff2be}#app[data-layout=mobile] #dash{align-self:center;margin-left:auto;margin-right:8px}
