/* 手机荣耀战场：状态置顶、操作置底，棋盘独占中间视口。 */
#glory-mobile-dock[hidden],#glory-mobile-modal[hidden],#glory-mobile-menu[hidden],#glory-mobile-log[hidden]{display:none!important}
.gm-roster-info,.gm-brand{display:none}
body.glory-mobile{--gm-top:90px;--gm-bottom:144px;--gm-dock:110px;--panel-w:0px}
.glory-mobile #gl{left:env(safe-area-inset-left);top:var(--gm-top);width:calc(100% - env(safe-area-inset-left) - env(safe-area-inset-right));height:calc(100dvh - var(--gm-top) - var(--gm-bottom));touch-action:manipulation}
.glory-mobile #hud{inset:0 0 auto;left:0;width:100%;height:auto;min-height:86px;padding:calc(5px + env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) 6px max(8px,env(safe-area-inset-left));display:grid;grid-template-columns:1fr auto;gap:3px 6px;background:#151d16f7;border-bottom:1px solid #bda56944}
.glory-mobile #hud .hud-brand{position:static;display:flex;width:auto;padding:0;gap:8px;align-items:center;min-width:0;overflow:hidden}
.glory-mobile #hud .brand,.glory-mobile #hud .brand-sub{display:none}
.glory-mobile #inventory{position:static;font-size:10px;gap:9px;line-height:26px;padding:5px 10px;min-height:44px;border:1px solid #c8b27344;border-radius:9px;background:#1b261ee6}
.glory-mobile #inventory .item-icon{width:25px;height:25px}
.glory-mobile #inventory b{font-size:13px}
.glory-mobile .gm-brand{display:flex;align-items:center;gap:6px;white-space:nowrap;color:#e6d295}
.glory-mobile .gm-brand img{width:42px;height:30px;object-fit:contain}
.glory-mobile .gm-brand strong{font-size:14px;letter-spacing:1px}
.glory-mobile .gm-brand strong span{font-size:10px;margin-left:6px;font-weight:400;letter-spacing:0}
.glory-mobile #glory-mobile-menu{padding:4px 10px;min-height:34px;font-size:12px;letter-spacing:0;pointer-events:auto}
.glory-mobile #hud .stats{grid-column:1/-1;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;width:100%}
.glory-mobile #hud .stat{min-width:0;margin:0;text-align:center}
.glory-mobile #hud .stat label{font-size:10px;gap:3px;margin-bottom:1px;white-space:nowrap}
.glory-mobile #hud .stat b,.glory-mobile #hud .stat.big b{font-size:22px;line-height:24px}
.glory-mobile .hud-stat-icon{width:13px;height:13px}
.glory-mobile #right-panels{display:none}
#glory-mobile-mapbar{position:fixed;left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));top:calc(var(--gm-top) + 28px);z-index:31;display:flex;align-items:center;justify-content:space-between;gap:8px;pointer-events:none}
#glory-mobile-mapbar[hidden]{display:none!important}
#glory-mobile-log{pointer-events:auto;min-width:58px;min-height:44px;padding:7px 12px;border:1px solid #c8b27399;border-radius:9px;background:#1b261ef2;box-shadow:0 3px 12px #0005;color:#e9d498;font-size:12px;letter-spacing:0;touch-action:manipulation}
#glory-mobile-dock{position:fixed;inset:auto 0 0;z-index:30;background:#151e17fa;border-top:1px solid #c8b27355;padding:6px max(8px,env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));box-shadow:0 -6px 22px #0003;display:grid;grid-template-columns:repeat(2,minmax(0,1fr)) repeat(3,40px) repeat(2,minmax(0,1fr));grid-template-rows:44px 44px;gap:4px 3px}
/* 两行共用同一网格：掷骰居左、↑居中、攻击/结束居右；←↓→在其正下方。 */
#glory-mobile-actions,#glory-mobile-actions .actions,#glory-mobile-actions .action-item,
#glory-mobile-dock nav,#glory-mobile-facing,#glory-mobile-facing .face-wrap,#glory-mobile-facing .face-pad{display:contents}
#glory-mobile-actions button{width:100%;height:44px;min-width:0;padding:3px;font-size:12px;letter-spacing:0;white-space:nowrap;border-radius:6px;touch-action:manipulation}
#glory-mobile-actions .btn-hint,#glory-mobile-actions .sep,#glory-mobile-facing .face-label{display:none}
#glory-mobile-actions .roll-controls{grid-column:1 / span 3;grid-row:1;display:flex;gap:3px;min-width:0}
#glory-mobile-actions #btn-auto-roll{width:36px;flex:0 0 36px;padding:2px;font-size:11px}
#glory-mobile-actions #btn-roll{flex:1;width:0;display:flex;align-items:center;justify-content:center;gap:3px}
#glory-mobile-actions #btn-attack,#glory-mobile-actions #btn-end{grid-column:5 / span 3;grid-row:1;width:calc((100% - 4px) / 2)}
#glory-mobile-actions #btn-attack{justify-self:start}
#glory-mobile-actions #btn-end{justify-self:end}
#glory-mobile-actions .die-face{width:22px;height:22px;flex:0 0 22px;border-radius:5px}
#glory-mobile-actions #stat-dice{position:static;font-size:19px;width:auto;margin:0;transform:none}
#glory-mobile-dock nav>button{height:44px;min-width:0;padding:3px 0;font-size:11px;letter-spacing:0;background:transparent;border-color:#b7a26833;border-radius:6px;white-space:nowrap}
#glory-mobile-dock [data-gm="roster"]{grid-column:1;grid-row:2}
#gm-skill-slot{grid-column:2;grid-row:2;min-width:0}
#gm-skill-slot>button,#gm-mine-actions button{height:44px;width:100%;min-width:0;padding:3px 0;font-size:11px;letter-spacing:0;border-radius:6px;white-space:nowrap;touch-action:manipulation}
#gm-mine-actions{display:flex;gap:2px}
#gm-mine-actions button{flex:1;width:0;font-size:10px}
#gm-skill-slot [hidden]{display:none!important}
#glory-mobile-dock [data-gm="terrain"]{grid-column:6;grid-row:2}
#glory-mobile-dock [data-gm="codex"]{grid-column:7;grid-row:2}
#glory-mobile-facing button.dir{grid-area:auto;width:40px;height:44px;padding:0;font-size:24px;line-height:1;touch-action:manipulation}
#glory-mobile-facing button.k-up{grid-column:4;grid-row:1}
#glory-mobile-facing button.k-left{grid-column:3;grid-row:2}
#glory-mobile-facing button.k-down{grid-column:4;grid-row:2}
#glory-mobile-facing button.k-right{grid-column:5;grid-row:2}
#glory-mobile-dock nav button.gm-ready{color:#ffe29a;border-color:#c8b273;background:#80703933}
#glory-mobile-dock nav button[aria-expanded="true"]{background:#74603555;border-color:#d7bd75}
.glory-mobile #tip{left:0;bottom:var(--gm-dock);width:100%;height:34px;min-height:0;padding:4px 10px;display:flex;align-items:center;justify-content:center;font-size:12px!important;line-height:1.2;background:#151d16ee;overflow:auto;z-index:29;white-space:normal}
.glory-mobile .tip-line{white-space:normal;text-align:center;max-height:28px;overflow:auto;pointer-events:auto}
.glory-mobile #roster{display:none;inset:auto 0 calc(var(--gm-dock) + 34px);width:100%;height:164px;padding:7px 8px;gap:5px;border:1px solid #baa56b55;border-radius:14px 14px 0 0;background:#192219fa;z-index:28}
.glory-mobile.gm-roster-open #roster{display:flex}
.glory-mobile #roster .roster-head{gap:3px}
.glory-mobile #roster .roster-head-top{gap:5px}
.glory-mobile #roster .roster-head b{font-size:13px;letter-spacing:0;margin-right:auto}
.glory-mobile #roster .roster-hint{font-size:11px;line-height:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.glory-mobile .gm-roster-info{display:block}
.glory-mobile #roster .roster-head-top button{font-size:11px;letter-spacing:0;padding:3px 7px;min-height:30px}
.glory-mobile #roster-list{flex-direction:row;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;gap:6px;padding:1px 0 3px;touch-action:pan-x;min-height:0}
.glory-mobile .tank-card{flex:0 0 108px;display:grid;grid-template-columns:1fr auto;grid-template-rows:38px auto;padding:5px;gap:2px;scroll-snap-align:start;min-width:0}
.glory-mobile .tank-card .card-icon{width:62px;height:38px;background-color:transparent}
.glory-mobile .tank-card .card-body{grid-row:2;grid-column:1/-1}
.glory-mobile .tank-card .card-name{display:block;font-size:12px;white-space:nowrap;text-align:center}
.glory-mobile .tank-card .card-name i,.glory-mobile .tank-card .card-desc,.glory-mobile .card-deploy-hint,.glory-mobile #roster-foot{display:none!important}
.glory-mobile .tank-card .card-actions{grid-column:2;grid-row:1;align-self:start}
.glory-mobile .tank-card .card-state{font-size:9px;padding:1px 2px}
.glory-mobile .tank-card.pickable:hover{transform:none}
.glory-mobile #terrain-notice{left:50%;bottom:calc(var(--gm-bottom) + 8px);max-width:calc(100vw - 20px);white-space:normal;font-size:13px;padding:10px 12px;z-index:40}
#glory-mobile-modal{position:fixed;inset:0;z-index:80;background:#050b09aa;display:flex;align-items:flex-end;justify-content:center;padding:env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left)}
.gm-sheet{width:100%;max-width:640px;max-height:calc(100dvh - 28px - env(safe-area-inset-top));display:flex;flex-direction:column;background:#1b261e;border:1px solid #c8b27377;border-radius:18px 18px 0 0;box-shadow:0 -12px 60px #0006;padding:0 14px calc(14px + env(safe-area-inset-bottom));overflow:hidden}
.gm-sheet>header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid #c8b27333;flex-shrink:0}
.gm-sheet h2{font-size:17px;color:#e3ca86;margin:0}
#glory-mobile-close{min-height:40px;padding:6px 12px;font-size:13px;letter-spacing:0}
#glory-mobile-content{min-height:0;overflow:auto;overscroll-behavior:contain;padding-top:12px}
#glory-mobile-content>*:not(.gm-panel-active){display:none!important}
#glory-mobile-content #tank-inspector{position:static;width:100%;height:auto;max-height:none;overflow:visible;padding:0;border:0}
#glory-mobile-content #tank-inspector h2{font-size:22px}
#glory-mobile-content #model-stage{flex:0 0 150px;height:150px;min-height:120px;max-height:150px}
#glory-mobile-content #tank-description{font-size:13px!important;line-height:1.7!important}
#glory-mobile-content #tank-skills{margin-top:8px;padding-top:0}
#glory-mobile-content #skill-controls{min-height:0;margin-top:12px}
#glory-mobile-content .skill-button{min-height:46px;font-size:14px}
#glory-mobile-content #skill-feedback{font-size:12px}
#glory-mobile-content #game-log{height:min(60dvh,500px);width:100%;min-height:0}
#glory-mobile-content #game-log-list{font-size:13px}
#glory-mobile-content .log-entry{font-size:13px}
#glory-mobile-content #terrain-controls{width:100%;margin:0;padding:12px}
#glory-mobile-content .terrain-buttons button{width:100%;min-height:48px;font-size:14px}
#glory-mobile-content .terrain-buttons small{font-size:12px}
#glory-mobile-content #codex{position:static;width:100%;display:flex;flex-direction:column;gap:10px}
#glory-mobile-content .codex-buttons{order:-1;display:flex;gap:8px}
#glory-mobile-content .codex-buttons button{flex:1;min-height:42px;font-size:14px}
#glory-mobile-content #codex-panel,#glory-mobile-content #building-codex-panel{width:100%;max-height:56dvh;display:flex;flex-direction:column;overflow:hidden;margin:0}
#glory-mobile-content #codex .hidden{display:none}
#glory-mobile-content .codex-desc{font-size:13px;line-height:1.65}
#glory-mobile-content .codex-foot{display:none}
#glory-mobile-content .hud-utility{align-items:stretch;gap:20px;padding:10px 0}
#glory-mobile-content .hud-navigation{display:flex;gap:10px}
#glory-mobile-content .hud-navigation button{flex:1;min-height:46px;font-size:14px}
#glory-mobile-content #audio-controls{position:static;display:flex;gap:12px;background:none;font-size:14px;width:100%;padding:8px 0}
#glory-mobile-content #audio-controls button{min-height:44px;font-size:14px;padding:6px 10px}
#glory-mobile-content #audio-volume{flex:1;min-width:40px;height:44px}
@media(max-width:360px){
 #glory-mobile-dock{grid-template-columns:repeat(2,minmax(0,1fr)) repeat(3,38px) repeat(2,minmax(0,1fr))}
 #glory-mobile-facing button.dir{width:38px}
 #glory-mobile-actions button{font-size:11px}
 #glory-mobile-dock nav>button{font-size:10px}
 #glory-mobile-actions .die-face{width:20px;height:20px;flex-basis:20px}
 #glory-mobile-actions #stat-dice{font-size:17px}
}
@media(max-height:500px){
 .glory-mobile #hud{min-height:62px;padding-top:env(safe-area-inset-top);grid-template-columns:1fr auto}
 .glory-mobile #glory-mobile-menu{grid-column:2;grid-row:1}
 .glory-mobile #roster{height:132px}
 .glory-mobile #roster .roster-hint{display:none}
 #glory-mobile-content #model-stage{height:100px;min-height:100px;max-height:100px;flex-basis:100px}
}
