/* v0.21.8 – Mobile Safari UI consolidation. Loaded LAST intentionally. */
/* Interactive fusion badge, full available width on desktop, keyboard focus visible. */
#canvasWrap #readyFusionIndicator{appearance:none;-webkit-appearance:none;cursor:pointer;pointer-events:auto!important;z-index:44;display:flex;align-items:center;justify-content:center;box-sizing:border-box;text-align:center;font-weight:900;white-space:nowrap;min-height:26px;width:clamp(98px,12%,174px);right:4px;bottom:4px;left:auto;border:1px solid #70caa4}
#canvasWrap #readyFusionIndicator[hidden]{display:none!important}
#canvasWrap #readyFusionIndicator:focus-visible{outline:2px solid #fff4ab;outline-offset:2px}
#canvasWrap #readyFusionIndicator:hover{background:#266356}
/* Always use the unoccupied side rail rather than painting over the active board; JS adds the precise coordinates. */
#canvasWrap .goal-target-list{box-sizing:border-box!important;max-width:none!important;min-width:0!important;overflow-x:hidden!important}
#canvasWrap .goal-target-chip{min-width:0!important;max-width:100%!important;box-sizing:border-box!important;overflow:hidden!important;white-space:nowrap!important}
#canvasWrap .goal-target-chip span{display:block!important;flex:0 1 auto!important;min-width:0!important;max-width:none!important;overflow:visible!important;text-overflow:clip!important;white-space:nowrap!important;word-break:keep-all!important}
/* On narrow rail keep readable characters; avoid using ellipsis for 3-character species names. */
@media (orientation:landscape) and (pointer:coarse) and (max-width:1280px){
 body>.app-shell .topbar{flex:0 0 35px!important;height:35px!important;min-height:35px!important;max-height:35px!important;overflow:hidden!important;padding:2px 4px!important;margin:0!important;box-sizing:border-box!important}
 body>.app-shell .topbar .top-stats{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:3px!important;width:100%!important;max-width:100%!important;min-width:0!important;height:100%!important;align-items:stretch!important}
 body>.app-shell .topbar .stat-chip{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:0!important;height:auto!important;min-height:0!important;max-height:100%!important;min-width:0!important;width:auto!important;overflow:hidden!important;padding:1px 2px!important;box-sizing:border-box!important}
 body>.app-shell .topbar .stat-label{display:block!important;font-size:clamp(7px,.9vw,10px)!important;line-height:1.05!important;letter-spacing:.04em!important;white-space:nowrap!important}
 body>.app-shell .topbar .stat-chip strong{display:block!important;font-size:clamp(11px,1.6vw,17px)!important;line-height:1.1!important;margin:0!important;padding:0!important;white-space:nowrap!important}
 body>.app-shell .topbar .stat-chip strong small{font-size:.68em!important;line-height:1!important}
 body>.app-shell .topbar .brand{display:none!important}
 /* Compact controls stay inside their box even with Korean strings. */
 body>.app-shell .battle-utility-panel{gap:3px!important}
 body>.app-shell .battle-utility-panel>.button{min-height:31px!important;padding:3px 2px!important;overflow:hidden!important}
 body>.app-shell .battle-utility-panel>.button>.utility-button-label{font-size:clamp(8px,1.05vw,11px)!important;line-height:1.17!important;overflow-wrap:anywhere!important}
 body>.app-shell .battle-utility-panel>.auto-wave-count{min-height:31px!important}
 /* Don't let prior Safari styles collapse the fullscreen label to zero width. */
 body>.app-shell .side-panel>.header-actions #fullscreenGameBtn{font-size:clamp(8px,1vw,10px)!important;color:#eafff6!important;visibility:visible!important;opacity:1!important}
 body>.app-shell .side-panel>.header-actions #fullscreenGameBtn .fullscreen-game-label{display:inline-block!important;visibility:visible!important;opacity:1!important;width:auto!important;min-width:0!important;font-size:inherit!important;line-height:1.15!important;white-space:nowrap!important}
 body>.app-shell .side-panel>.header-actions #fullscreenGameBtn .fullscreen-game-icon{display:none!important}
 /* Mobile Pokedex: centered title and compact cards. */
 #recipeModal .recipe-top{display:grid!important;grid-template-columns:65px minmax(0,1fr) 32px!important;align-items:start!important;column-gap:3px!important}
 #recipeModal .recipe-top>div{min-width:0!important;grid-column:2!important;text-align:center!important}
 #recipeModal .recipe-top h2{display:block!important;max-width:100%!important;text-align:center!important;font-size:clamp(14px,2.3vw,20px)!important;line-height:1.2!important;overflow:visible!important;text-overflow:clip!important}
 #recipeModal .recipe-top p{text-align:center!important;font-size:clamp(8px,1.2vw,11px)!important;line-height:1.25!important;margin:2px 0!important}
 #recipeModal .recipe-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;align-content:start!important;gap:5px!important}
 #recipeModal .recipe-card,#recipeModal .summon-only-card{min-width:0!important;margin:0!important;padding:5px!important;border-radius:8px!important;min-height:0!important;height:auto!important;max-height:none!important;box-sizing:border-box!important}
 #recipeModal .recipe-card .recipe-result{min-height:34px!important;padding-right:37px!important;gap:3px!important}
 #recipeModal .recipe-card .recipe-result img,#recipeModal .summon-only-card img{width:30px!important;height:30px!important;max-width:30px!important;max-height:30px!important;object-fit:contain!important}
 #recipeModal .recipe-card .recipe-goal-star{width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important;max-width:32px!important;max-height:32px!important;top:3px!important;right:3px!important}
 #recipeModal .recipe-card .recipe-goal-star img{width:32px!important;height:32px!important}
 #recipeModal .recipe-card .recipe-result strong{font-size:clamp(10px,1.3vw,12px)!important;line-height:1.15!important}
 #recipeModal .recipe-card .recipe-result small{font-size:clamp(8px,.95vw,10px)!important;line-height:1.15!important}
 #recipeModal .recipe-card .recipe-materials{gap:3px!important;margin:3px 0!important}
 #recipeModal .recipe-card .recipe-materials>*{min-width:0!important}
 #recipeModal .recipe-card .recipe-materials img{width:20px!important;height:20px!important;max-width:20px!important}
 #recipeModal .recipe-card .recipe-materials span,#recipeModal .recipe-card .recipe-materials b{font-size:clamp(8px,1vw,10px)!important}
 #recipeModal .recipe-card button:not(.recipe-goal-star){min-height:23px!important;padding:2px!important;font-size:clamp(8px,1vw,10px)!important}
 /* Research: all four items fit without a separate inner scroll under the 3x2 footer. */
 body>.app-shell .side-panel[data-view="research"] .research-panel{display:flex!important;flex-direction:column!important;gap:2px!important;overflow:hidden!important}
 body>.app-shell .side-panel[data-view="research"] .research-panel h2{font-size:clamp(10px,1.25vw,13px)!important;line-height:1.1!important;margin:1px 0!important;flex:none!important}
 body>.app-shell .side-panel[data-view="research"] .research-panel .type-hint{display:none!important}
 body>.app-shell .side-panel[data-view="research"] .research-list{display:grid!important;grid-template-columns:1fr!important;grid-template-rows:repeat(4,minmax(0,1fr))!important;gap:3px!important;min-height:0!important;max-height:none!important;height:auto!important;flex:1 1 auto!important;overflow:hidden!important}
 body>.app-shell .side-panel[data-view="research"] .research-item{display:flex!important;box-sizing:border-box!important;height:100%!important;min-height:0!important;max-height:none!important;padding:2px 3px!important;gap:3px!important;overflow:hidden!important}
 body>.app-shell .side-panel[data-view="research"] .research-symbol{width:23px!important;height:23px!important;flex:0 0 23px!important;min-width:23px!important}
 body>.app-shell .side-panel[data-view="research"] .research-symbol img{width:22px!important;height:22px!important}
 body>.app-shell .side-panel[data-view="research"] .research-detail{min-width:0!important;flex:1 1 auto!important}
 body>.app-shell .side-panel[data-view="research"] .research-detail strong{font-size:clamp(8px,1vw,10px)!important;line-height:1.12!important;white-space:normal!important}
 body>.app-shell .side-panel[data-view="research"] .research-detail small{font-size:clamp(7px,.8vw,9px)!important;line-height:1!important;white-space:normal!important}
 body>.app-shell .side-panel[data-view="research"] .research-price{flex:0 0 auto!important;font-size:clamp(8px,.85vw,10px)!important;white-space:nowrap!important}
 /* Fusion badge sits at the bottom of the right side rail, below the lowest unit. */
 #canvasWrap #readyFusionIndicator{bottom:2px!important;min-height:24px!important;max-height:27px!important;padding:3px!important;font-size:clamp(8px,1vw,10px)!important}
 #canvasWrap .goal-target-list{padding:3px!important;gap:3px!important}
 #canvasWrap .goal-target-chip{font-size:clamp(8px,.93vw,10px)!important;padding:2px!important;gap:2px!important}
 #canvasWrap .goal-target-chip img{width:16px!important;height:16px!important;flex-basis:16px!important}
}
@media (orientation:landscape) and (pointer:coarse) and (max-height:390px){
 body>.app-shell .topbar{flex-basis:29px!important;height:29px!important;min-height:29px!important;max-height:29px!important}
 body>.app-shell .side-panel>.header-actions{height:59px!important;min-height:59px!important;max-height:59px!important}
 body>.app-shell .side-panel{padding-bottom:65px!important}
}

#canvasWrap .goal-target-list{max-height:calc(100% - 49px)!important}
