.play-tabbar{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));overflow:visible;padding:5px 6px calc(5px + var(--safe-b));gap:3px}
.play-tabbar .tab{min-width:0;min-height:48px;font-size:12px;border-radius:9px;border-bottom:0}
.play-tabbar .tab.active{background:#24403a;color:#fff4d8;box-shadow:inset 0 0 0 1px #6b9480}
.play-menu-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:12px;padding:20px 16px}
.play-menu-grid .play-menu-card{display:flex;flex-direction:column;align-items:flex-start;text-align:left;gap:12px;min-height:152px;margin:0;padding:18px;border:1px solid #4b5c50;border-radius:14px;background:radial-gradient(ellipse at 80% 0,#39574455,transparent 70%),#172723;color:#f4e7c9}
.play-menu-card img{width:50px;height:50px;object-fit:contain;filter:drop-shadow(0 4px 7px #0005)}
.play-menu-card b,.play-menu-card small{display:block}.play-menu-card b{font-size:17px}.play-menu-card small{font:12px/1.5 var(--sans);margin-top:5px;color:#b2c5b8}
.title-preview-option{width:100%;text-align:center}.title-preview-option summary{min-height:44px;padding:12px;cursor:pointer;font:13px var(--sans);color:#d3c3a6}.title-preview-option .btn{width:100%;margin-top:8px}
.combat-auxiliary{grid-column:1/-1;position:relative}.combat-auxiliary>summary{padding:8px 14px;min-height:38px;border:1px solid #47655d;border-radius:8px;text-align:center;font:12px var(--sans);color:#dbe9db;cursor:pointer;background:#162822}
.combat-auxiliary-tray{position:absolute;bottom:calc(100% + 8px);left:0;right:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:12px;border:1px solid #6a8b78;border-radius:12px;background:#132620f5;box-shadow:0 -8px 25px #0006;z-index:10}
.combat-auxiliary-tray label{display:flex;flex-direction:column;gap:4px;font:11px var(--sans);color:#d1decc}.combat-auxiliary-tray select{width:100%;min-height:42px;background:#253a31;color:#fff1d1;border:1px solid #6a8b78}
#screen-ar .ar-tools{grid-template-columns:1.25fr 1fr}#screen-ar .potion-control{display:block}#screen-ar .potion-control .btn{height:100%;width:100%}
#screen-ar .hud-bottom{gap:5px;padding-top:20px}#screen-ar .ar-hint{margin:0;font-size:11px}#screen-ar .capture-tools:has(>button:not([hidden])){margin-top:3px}
.play-menu-card:focus-visible,.combat-auxiliary summary:focus-visible,.title-preview-option summary:focus-visible{outline:3px solid #b5efd5;outline-offset:3px}
@media(max-height:720px){#screen-ar .hud-bottom{padding-top:12px}#screen-ar .player-combat-status{display:none}#screen-ar .player-skillbar .btn{min-height:42px}.combat-auxiliary>summary{min-height:34px;padding:7px}}
@media(prefers-reduced-motion:reduce){.play-menu-card img{filter:none}}

/* Direct spirit input owns the stage; preserved button fallbacks live in help. */
#screen-ar.ar-v47 .combat-primary-dock:not(:has(>button:not([hidden]))){display:none}
#screen-ar.ar-v47 .hud-bottom{grid-template-columns:minmax(0,1fr) auto}
#screen-ar.ar-v47 .hud-bottom .mind-wrap{grid-column:1/-1}
#screen-ar.ar-v47 .combat-auxiliary{grid-column:1}
#screen-ar.ar-v47 .combat-control-help{grid-column:2;position:relative}
#screen-ar.ar-v47 .combat-control-help>summary,#screen-ar.ar-v47 .combat-auxiliary>summary{min-height:44px;padding:12px 10px;font:12px/1.5 var(--sans);border:1px solid #567568;border-radius:8px;color:#e3eedf;background:#142b25;cursor:pointer}
#screen-ar.ar-v47 .combat-help-controls{position:absolute;bottom:calc(100% + 8px);right:0;width:min(290px,calc(100vw - 30px));max-height:55dvh;overflow:auto;padding:12px;background:#112820f7;border:1px solid #6e9b82;border-radius:12px;display:grid;gap:8px;z-index:32}
#screen-ar.ar-v47 .combat-help-controls p,#screen-ar.ar-v47 #body-motion-status{font:12px/1.5 var(--sans);color:#dceada;margin:0}
#screen-ar.ar-v47 .combat-help-controls .btn,#screen-ar.ar-v47 .combat-help-controls .combat-primary-action{min-height:44px;width:100%;position:relative;display:block;border:1px solid #91af96;border-radius:8px;background:#27473b;color:#fff0cd;padding:10px;font:700 13px/1.4 var(--sans)}
#screen-ar.ar-v47 .combat-help-controls .combat-primary-action:disabled{opacity:.5}
#screen-ar.ar-v47 .combat-help-controls .combat-primary-action::before,#screen-ar.ar-v47 .combat-help-controls .combat-primary-action::after{display:none}
#screen-ar.ar-v47 .combat-help-controls{grid-template-columns:minmax(0,1fr)}
#screen-ar.ar-v47 .combat-help-controls #btn-evade{grid-column:1}
#screen-ar.ar-v47 .combat-control-help>summary:focus-visible,#screen-ar.ar-v47 #ghost-wrap:focus-visible{outline:3px solid #b5efd5;outline-offset:3px}
#screen-ar.ar-v47 .ar-ghost-rarity{border:1px solid var(--rarity-color);color:var(--rarity-color);border-radius:6px;padding:2px 5px;white-space:nowrap;font:700 11px/1.3 var(--sans)}
#screen-ar.ar-v47 .ghost-title{flex-wrap:wrap;gap:4px}
#screen-ar.ar-v47 #ar-ghost-name{font-size:15px}
#screen-ar.ar-v47 #enemy-technique{font-size:12px}
#screen-ar.ar-v47 .ghost-wrap{min-width:96px;min-height:120px}
#screen-ar.ar-v47 .combat-auxiliary-tray{max-height:55dvh;overflow:auto}
#screen-ar.ar-v47 .combat-primary-dock:has(>#btn-capture:not([hidden])){left:auto;right:12px;width:100px;bottom:calc(130px + var(--safe-b));transform:none;display:block}
#screen-ar.ar-v47 .combat-primary-dock #btn-capture:not([hidden]){width:100px;height:100px}
@media(orientation:landscape) and (max-height:500px){#screen-ar.ar-v47 .hud-bottom{width:215px;left:auto;right:8px;padding:8px;gap:4px}#screen-ar.ar-v47 .combat-primary-dock:has(>#btn-capture:not([hidden])){bottom:150px;right:12px}#screen-ar.ar-v47 .combat-help-controls{max-height:65dvh}#screen-ar.ar-v47 #ar-ghost-name{font-size:13px}}

/* Dense fields keep distant encounters lightweight and nearby targets readable. */
.ghost-marker .gm.gm-distant{width:32px;height:40px;border:1px solid #92bfc98a;border-radius:8px;background:#132b2dd9;animation:none;filter:none;box-shadow:none}
.ghost-marker .gm.gm-distant img{display:block;width:30px;height:32px;object-fit:contain}
.ghost-marker .gm.gm-distant .gm-tier{bottom:-3px;font-size:8px;letter-spacing:-1px}
.ghost-marker .gm.gm-distant.capturable:after{width:12px;height:12px;font-size:8px;right:-3px;top:-3px}
.ghost-marker .gm.gm-distant.lured:after{display:none}
.ghost-marker .gm.gm-near{filter:drop-shadow(0 2px 5px #061416);animation:none}
.ghost-marker .gm-level{position:absolute;top:-8px;left:0;min-width:27px;padding:1px 3px;border-radius:4px;background:#101c20ec;color:#fff2d4;font:700 9px/1.2 sans-serif;text-align:center;white-space:nowrap}
/* Leaflet's panes must stay inside the map, below open inventory/activity panels. */
#screen-map{isolation:isolate}
.world-population{z-index:450}
.gps-status{position:absolute;top:calc(92px + var(--safe-t,0px));left:12px;right:12px;z-index:460;display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid #8d7959;border-radius:12px;background:#142822f5;color:#fff3d6;font:13px/1.5 var(--sans);box-shadow:0 3px 14px #0005}
.gps-status>span{flex:1;min-width:0;overflow-wrap:anywhere}
.gps-status .btn{flex:0 0 auto;min-height:44px;padding:8px;font-size:12px}
.gps-status .btn[hidden]{display:none}
.gps-status[data-state=ready]{border-color:#689c7a}
.gps-status[data-state=denied],.gps-status[data-state=pooraccuracy]{border-color:#d1a168}
#screen-map #radar{top:calc(190px + var(--safe-t,0px))}
#screen-map #world-population{top:calc(245px + var(--safe-t,0px))}
.gps-status .btn:focus-visible{outline:3px solid #b5efd5;outline-offset:2px}
@media(max-width:360px){.gps-status{align-items:stretch;flex-direction:column}.gps-status .btn{align-self:flex-end}#screen-map #radar{top:calc(250px + var(--safe-t,0px))}#screen-map #world-population{top:calc(305px + var(--safe-t,0px))}}
