.map-panel{position:relative}
.topbar{padding-right:12px}.phase-indicator{flex-direction:row;justify-content:flex-start}.mobile-utilities{position:absolute;top:8px;right:8px;z-index:22;display:flex;gap:4px}.mobile-utilities button{height:44px;min-height:44px;min-width:54px;padding:0 8px;background:#22382eee;border:1px solid #b4a16b99;color:#f0e0bd;border-radius:4px;font-size:12px}.mobile-utilities .map-turn-end{position:static;min-width:88px;font-size:12px}
.mobile-actions{position:absolute;z-index:23;width:204px;max-height:360px;padding:7px;border:1px solid #bdac7f;background:#1c322af7;border-radius:6px;box-shadow:0 5px 18px #0006;overflow-y:auto;touch-action:pan-y;flex:none}
.mobile-actions{pointer-events:none}.mobile-actions button,.mobile-actions input,.mobile-actions[data-mode=skill]{pointer-events:auto}.mobile-actions button:disabled{pointer-events:none}
#action-popup .commands{grid-template-columns:1fr 1fr;gap:5px}#action-popup .commands button{height:44px;padding:0 4px}#action-popup #cancel-command{grid-column:auto}.mobile-actions #detail-open{position:static;min-height:44px;background:#526044;border:1px solid #b2a275;color:#f1e4c6;font-size:13px}
.mobile-actions[data-mode=skill]{width:240px}.mobile-actions[data-mode=skillTarget]{width:220px}.mobile-actions[data-mode=attack]{width:180px}.mobile-actions[data-mode=attack] #detail-open,.mobile-actions[data-mode=skillTarget] #detail-open{display:none}.mobile-actions[data-mode=skill] #detail-open{display:none}
#skill-inspector #skill-details{grid-template-columns:1fr;gap:3px}#skill-menu button{min-width:100px}#mobile-use-skill{width:100%;margin-bottom:5px;min-height:44px}.mobile-target-info{font-size:12px;line-height:18px}.mobile-roster{padding-bottom:env(safe-area-inset-bottom,0px);height:calc(76px + env(safe-area-inset-bottom,0px))}.mobile-toast{position:absolute;bottom:80px;left:10px;right:10px;z-index:35;background:#21382ff2;border:1px solid #bca46b;padding:12px;font-size:13px;color:#f0e2c2;text-align:center;pointer-events:none}
.mobile-loading{position:fixed;inset:0;z-index:120;background:#13251ff5;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;color:#f1dfb9}.mobile-loading strong{font-family:Georgia,serif;font-size:25px;letter-spacing:.06em}.mobile-loading span{font-size:13px;color:#c3c5a9}.intro-skip{position:fixed;right:calc(10px + env(safe-area-inset-right,0px));bottom:calc(90px + env(safe-area-inset-bottom,0px));z-index:50;min-height:44px;padding:8px 14px;border:1px solid #baa36f;background:#20392ff0;color:#f3e5c2;border-radius:5px}

/* BGM preference is separate from all-audio MUTE and the volume sliders. */
.bgm-quick,.mobile-utilities .bgm-quick{min-width:44px;width:44px;min-height:44px;padding:6px;color:#f7efd6;background:#24483c;border:1px solid #bcaa6a;border-radius:8px;font-size:21px;touch-action:manipulation}
.bgm-quick[data-enabled="false"]{background:#182c26;color:#d1c9af;border-color:#817655}
#title-bgm-toggle{position:absolute;right:max(12px,env(safe-area-inset-right));top:max(12px,env(safe-area-inset-top));z-index:2}
#village-bgm-toggle{display:none;position:fixed;right:max(12px,env(safe-area-inset-right));top:max(8px,env(safe-area-inset-top));z-index:35}
body[data-scene="village"] #village-bgm-toggle{display:block}
.title-settings-card footer{flex-wrap:wrap}

/* Compact selection record below ROUND / PHASE; the MAP keeps its tile size. */
#mobile-summary{height:96px;min-height:96px;flex-shrink:0;grid-template-columns:88px minmax(0,1fr)}
#mobile-summary .mobile-bust{height:96px}
#mobile-summary .summary-info{padding:6px 9px 5px;min-width:0}
#mobile-summary .summary-heading{display:flex;align-items:baseline;gap:8px;margin:0 0 4px;min-width:0}
#mobile-summary .summary-heading h2{padding:0;margin:0;font-size:18px;line-height:22px;white-space:nowrap;letter-spacing:.02em;color:#403b2f}
#mobile-summary .summary-class{margin:0;font-size:11px;line-height:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#mobile-summary .summary-hp{font-size:11px;line-height:16px;gap:6px}
#mobile-summary .summary-hp span{white-space:nowrap;font-variant-numeric:tabular-nums}
#mobile-summary .summary-stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:2px 0;margin:4px 0 0;font-size:12px;line-height:18px}
#mobile-summary .summary-stats div{min-width:0;align-items:baseline;gap:3px;padding:0 6px;border-right:1px solid #a18c6555}
#mobile-summary .summary-stats div:nth-child(3n){border-right:0;padding-right:0}
#mobile-summary .summary-stats div:nth-child(3n+1){padding-left:0}
#mobile-summary .summary-stats dt{white-space:nowrap}
#mobile-summary .summary-stats dd{font-variant-numeric:tabular-nums}
#mobile-summary .summary-stats[data-primary="intelligence"] [data-stat="intelligence"]{color:#75401e;font-weight:700}
.mobile-actions[data-acted="true"]{width:104px}
#mobile-use-skill{border:1px solid #ffc675;border-radius:5px;background:#c66c22;color:#fff8e9;font-weight:700;box-shadow:0 2px 0 #703b1c}
#mobile-use-skill:not(:disabled):active{background:#a65217;box-shadow:none;transform:translateY(1px)}
#mobile-use-skill:focus-visible{outline:2px solid #ffe4b1;outline-offset:2px}
.enemy.has-monster-sprite .enemy-marker{display:none}
.monster-sprite{position:absolute;left:0;top:0;width:64px;height:64px;object-fit:contain;image-rendering:pixelated;pointer-events:none}
.enemy.has-monster-sprite .enemy-hp{position:absolute;top:-12px;right:0;z-index:1;pointer-events:none}
.enemy.has-monster-sprite .enemy-health-bar{position:absolute;left:9px;right:9px;top:63px;width:auto;pointer-events:none}
@media(max-width:370px){#mobile-summary{grid-template-columns:80px minmax(0,1fr)}#mobile-summary .summary-info{padding-left:7px;padding-right:7px}#mobile-summary .summary-heading{gap:6px}#mobile-summary .summary-heading h2{font-size:17px}#mobile-summary .summary-stats div{padding-left:5px;padding-right:5px}}
/* Compact adjacent commands, native sprite roster and visible preparation. */
.mobile-actions:not([data-mode="skill"]):not([data-mode="skillTarget"]){width:136px}
.mobile-actions{padding:5px}
#action-popup .commands button{font-size:11px;padding-left:2px;padding-right:2px}
#action-popup .commands button>span:first-child:not(#attack-label){display:none}
.party-sprite{object-fit:contain!important;object-position:50% 50%!important;transform:none!important;image-rendering:pixelated}
.mobile-loading progress{display:block;width:min(72vw,300px);height:12px;accent-color:#e6ac4a;margin-top:16px}
#loading-percent{font-variant-numeric:tabular-nums;color:#f5dfac;font-size:18px}
.turn-banner{position:fixed;inset:0;z-index:1300;display:grid;place-items:center;pointer-events:auto;background:linear-gradient(transparent 34%,#142725dc 42%,#142725dc 58%,transparent 66%);color:#ffe5a4}
.turn-banner strong{font-size:clamp(26px,7vw,48px);letter-spacing:.08em;text-shadow:0 2px 5px #000;animation:turn-appear .8s both}
.turn-banner[data-phase="enemy"]{color:#ffb6a5}
@keyframes turn-appear{0%{opacity:0;transform:translateX(-12px)}18%,80%{opacity:1;transform:none}100%{opacity:0;transform:translateX(12px)}}
@media(prefers-reduced-motion:reduce){.turn-banner strong{animation:none}}

/* Equal HP/EXP cells retain the 96px selection record. */
#mobile-summary .summary-heading{margin-bottom:2px}
#mobile-summary .summary-resources{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
#mobile-summary .summary-resource{display:block;min-width:0;font-size:10px;line-height:14px}
#mobile-summary .resource-label{display:flex;align-items:baseline;justify-content:space-between;gap:3px;white-space:nowrap;font-variant-numeric:tabular-nums}
#mobile-summary .summary-resource meter{display:block;width:100%;min-width:0;height:6px;margin:2px 0 0;border:0;border-radius:0;background:#d1c5a9;appearance:none;-webkit-appearance:none}
#mobile-summary .summary-hp meter::-webkit-meter-bar,#mobile-summary .summary-exp meter::-webkit-meter-bar{border:0;border-radius:0;background:#d1c5a9}
#mobile-summary .summary-hp meter::-webkit-meter-optimum-value{background:#748b58}
#mobile-summary .summary-exp meter::-webkit-meter-optimum-value{background:#478cae}
#mobile-summary .summary-hp meter::-moz-meter-bar{background:#748b58}
#mobile-summary .summary-exp meter::-moz-meter-bar{background:#478cae}
#mobile-summary .summary-stats{margin-top:4px;line-height:16px}
.mobile-actions[data-acted="true"]{width:104px}

.detail-stats [data-stat="exp"] dd{text-align:right}
.detail-exp-next{display:block;font-size:10px;font-weight:normal;color:#6c6555;line-height:13px}
.mobile-loading{z-index:2000}
