/* Little Big Fish — unified HUD and menu navigation refinements.
   Loaded last intentionally; replaces scattered viewport overrides without changing scene visuals. */
:root { --touch-target:44px; --hud-gap:10px; }
#gameplay .bottom-nav .ui-icon,
#gameplay .flow-tools .flow-art,
#gameplay .flow-tools .ui-icon { object-fit:contain; flex-shrink:0; }
#gameplay .flow-tools .tool-count { top:3px; right:3px; bottom:auto; min-width:20px; height:20px; display:grid; place-items:center; font-size:12px; }
#gameplay button:focus-visible, #modal button:focus-visible { outline:3px solid #448b87; outline-offset:2px; }
#modal.mockup-window .close { width:44px; height:44px; min-width:44px; min-height:44px; top:9px; right:9px; display:grid; place-items:center; padding:0; font-size:0; border:1px solid #d6e4dc!important; border-radius:12px!important; background:#fff!important; color:#36544e!important; box-shadow:none!important; line-height:1; }
#modal.mockup-window .close::after { content:""; width:18px; height:18px; background:currentColor; -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center/contain no-repeat; }
#modal.mockup-window:not(.view-catch):not(.view-haul):not(.view-story) .close { display:none!important; }
#modal.mockup-window .window-header { padding-right:58px; }
#modal.mockup-window .window-footer #flowBack { min-height:44px; display:inline-flex; align-items:center; gap:7px; }
#modal.mockup-window .window-footer #flowBack::before { content:"←"; font:600 20px/1 system-ui,sans-serif; }
#modal.mockup-window .window-footer button { min-height:44px; }
#modal.mockup-window .window-header h1 .ui-icon { width:26px; height:26px; object-fit:contain; }
#modal.mockup-window .shop-row>.flow-art, #modal.mockup-window .shop-row>.ui-icon { width:54px; height:54px; object-fit:contain; }
#modal.mockup-window .shop-row { gap:12px; }
#modal.mockup-window .flow-tabs button { min-height:44px; }
@media(max-width:900px) {
  #gameplay .nearby-map { right:12px; top:78px; width:136px; padding:7px; border-radius:12px; }
  #gameplay .nearby-map #miniMap { width:120px; height:120px; }
  #gameplay .nearby-map .map-legend { display:none; }
  #gameplay .flow-tools { left:12px; top:145px; gap:7px; }
  #gameplay .flow-tools button { width:60px; height:60px; min-height:60px; padding:7px; }
  #gameplay .flow-tools button .flow-art { width:38px; height:38px; }
  #gameplay .bottom-nav { display:grid!important; grid-template-columns:repeat(3,minmax(0,1fr))!important; grid-template-areas:"map hold market"!important; left:12px!important; right:12px!important; bottom:max(10px,env(safe-area-inset-bottom))!important; gap:8px!important; align-items:stretch; }
  #gameplay .bottom-nav>#map { grid-area:map; }
  #gameplay .bottom-nav>#holdButton { grid-area:hold; }
  #gameplay .bottom-nav>#returnMarket { grid-area:market; }
  #gameplay .bottom-nav>#bookButton, #gameplay .bottom-nav>#returnShop { display:none!important; }
  #gameplay .bottom-nav>button:not(#cast) { width:100%!important; min-width:0!important; height:56px!important; min-height:56px!important; display:flex!important; flex-direction:row!important; align-items:center; justify-content:center; padding:6px 8px!important; gap:6px!important; font-size:15px!important; white-space:normal; }
  #gameplay .bottom-nav .ui-icon { width:27px!important; height:27px!important; }
  #gameplay #map small { font-size:15px!important; }
  #gameplay button.cooler { display:flex!important; gap:6px; }
  #gameplay button.cooler .flow-art { width:28px!important; height:28px!important; display:block!important; }
  #gameplay button.cooler strong { font-size:15px!important; }
  #gameplay button.cooler small { display:none!important; }
  #gameplay .bottom-nav>#cast { position:fixed!important; grid-area:auto!important; left:auto!important; right:16px!important; bottom:86px!important; margin:0!important; width:78px!important; height:78px!important; min-height:78px!important; border-radius:50%!important; flex-direction:column!important; gap:0!important; z-index:7; }
  #gameplay #cast .flow-art { width:32px!important; height:32px!important; }
  #gameplay #cast b { font-size:17px!important; }
  #gameplay .joystick { bottom:94px!important; }
  #gameplay #weatherInfo { bottom:175px!important; }
  #gameplay #tutorial { left:82px!important; right:156px!important; top:105px!important; max-width:none!important; }
  #gameplay #storageNotice { bottom:160px!important; }
  #modal.mockup-window .window-header { padding-right:58px!important; }
  #modal.mockup-window .window-header>.ui-money { margin-right:4px; }
  #modal.mockup-window .shop-row { grid-template-columns:54px minmax(0,1fr) auto; min-height:88px; }
  #modal.mockup-window .shop-row>.flow-art { width:50px; height:50px; }
}
@media(max-width:480px) {
  #gameplay .flow-tools { top:128px; }
  #gameplay .nearby-map { width:116px; padding:6px; right:10px; top:79px; }
  #gameplay .nearby-map #miniMap { width:102px; height:102px; }
  #gameplay #tutorial { top:108px!important; left:82px!important; right:135px!important; font-size:12px; }
  #gameplay .bottom-nav { left:9px!important; right:9px!important; gap:6px!important; }
  #gameplay .bottom-nav>button:not(#cast) { padding:6px 4px!important; font-size:13px!important; }
  #gameplay button.cooler .flow-art { width:24px!important; height:24px!important; }
  #gameplay button.cooler strong { font-size:13px!important; }
  #gameplay .bottom-nav .ui-icon { width:24px!important; height:24px!important; }
  #gameplay #map small { font-size:13px!important; }
  #gameplay .bottom-nav>#cast { bottom:82px!important; }
  #modal.mockup-window .window-header h1 { font-size:21px!important; }
  #modal.mockup-window .window-content { padding:14px!important; }
  #modal.mockup-window .shop-row { grid-template-columns:45px minmax(0,1fr) auto; gap:8px; padding:10px; }
  #modal.mockup-window .shop-row>.flow-art { width:44px; height:44px; }
}
@media(max-width:360px) {
  #gameplay #tutorial { position:fixed; display:none!important; }
  #gameplay .bottom-nav>button:not(#cast) { font-size:12px!important; }
  #gameplay .bottom-nav .ui-icon { width:22px!important; height:22px!important; }
}


/* Second pass: icon semantics, menu density and restricted viewport composition. */
#gameplay #map img, #gameplay #holdButton img, #gameplay #returnMarket img,
#gameplay #cast img, #gameplay .flow-tools img {
  object-fit:contain!important; filter:none!important; image-rendering:auto!important;
}
#gameplay #map small, #gameplay #returnMarket span { display:inline!important; }
#gameplay #holdButton .flow-art { display:block!important; }
#gameplay .flow-tools button { border-radius:14px!important; }
#gameplay .flow-tools button[disabled] { opacity:.52; }
#gameplay .flow-tools button .tool-count { box-shadow:0 1px 4px #27423b21; }
#modal.mockup-window .window-header h1 { min-width:0; }
#modal.mockup-window .window-footer { gap:10px; }
#modal.mockup-window .window-footer button:only-child { min-width:120px; }
#modal.mockup-window .window-footer #flowBack { flex:0 0 auto; }
#modal.mockup-window .shop-row h2 { line-height:1.2; }
#modal.mockup-window .shop-row p { line-height:1.4; }
#modal.mockup-window .shop-row .shop-price { white-space:normal; }
#modal.mockup-window .close[aria-label] { touch-action:manipulation; }
@media(max-width:900px) {
  #gameplay .place-label { top:57px; left:14px; max-width:calc(100vw - 165px); }
  #gameplay .place-label strong { font-size:16px; }
  #gameplay .nearby-map { box-shadow:0 3px 10px #173c331c; }
  #gameplay .flow-tools button .tool-count { font-size:12px!important; }
  #gameplay #returnMarket span { display:inline!important; }
  #gameplay #map small { display:inline!important; }
  #gameplay #holdButton .flow-art { display:block!important; }
  #gameplay #weatherInfo { right:auto; left:14px; max-width:150px; }
  #gameplay #eventNotice, #gameplay #supplyPrompt, #gameplay #trapPrompt {
    max-width:calc(100vw - 24px); box-sizing:border-box;
  }
  #modal.mockup-window .window-footer { position:sticky; bottom:0; z-index:4; background:#fff; }
  #modal.mockup-window .window-content { overflow-y:auto; min-height:0; }
}
@media(max-width:700px) {
  #gameplay #cast { width:78px!important; height:78px!important; }
  #gameplay .flow-tools { top:136px!important; }
  #gameplay #tutorial { top:106px!important; left:80px!important; right:145px!important; padding:8px!important; }
  #gameplay #tutorial strong { font-size:13px!important; }
  #gameplay #tutorial p { font-size:12px!important; line-height:1.25!important; }
  #gameplay #tutorial>b { flex-shrink:0; }
  #gameplay #eventNotice { bottom:172px!important; right:10px!important; max-width:calc(100vw - 100px); }
  #gameplay #supplyPrompt { bottom:164px!important; }
  #gameplay #trapPrompt { bottom:165px!important; }
  #gameplay #storageNotice { bottom:170px!important; }
  #modal.mockup-window .window-footer { flex-wrap:wrap; }
  #modal.mockup-window .window-footer button { flex:1 1 auto; }
  #modal.mockup-window .flow-tabs { overflow-x:auto; scrollbar-width:thin; }
  #modal.mockup-window .flow-tabs button { flex:1 0 auto; padding-inline:12px; }
  #modal.mockup-window .window-header h1 .ui-icon { width:26px; height:26px; }
  #modal.mockup-window .window-header>.ui-money { font-size:14px; }
}
@media(max-width:480px) {
  #gameplay .hud { left:10px; right:10px; top:8px; }
  #gameplay .level-info { max-width:145px; }
  #gameplay #tutorial { top:103px!important; right:131px!important; left:76px!important; }
  #gameplay .nearby-map { top:86px; }
  #gameplay .flow-tools { top:153px!important; }
  #gameplay .flow-tools button { width:54px!important; height:54px!important; min-height:54px!important; }
  #gameplay .flow-tools button img { width:34px!important; height:34px!important; }
  #gameplay .bottom-nav>button:not(#cast) { gap:4px!important; }
  #gameplay #returnMarket span { font-size:13px; }
  #modal.mockup-window .window-header h1 { font-size:20px!important; }
  #modal.mockup-window .window-header>.ui-money { font-size:13px; }
  #modal.mockup-window .window-header { padding-right:48px!important; }
  #modal.mockup-window .window-footer { padding:10px!important; }
}
@media(max-width:380px) {
  #gameplay #tutorial { display:none!important; }
  #gameplay .place-label { top:53px; max-width:calc(100vw - 135px); }
  #gameplay .place-label small { display:none; }
  #gameplay .nearby-map { width:100px; padding:5px; }
  #gameplay .nearby-map #miniMap { width:88px; height:88px; }
  #gameplay .flow-tools { top:122px!important; }
  #gameplay #returnMarket span { font-size:12px; }
  #gameplay button.cooler strong { font-size:12px!important; }
}
@media(max-height:650px) and (max-width:900px) {
  #gameplay .nearby-map { width:96px; }
  #gameplay .nearby-map #miniMap { width:84px; height:84px; }
  #gameplay .flow-tools { top:95px!important; }
  #gameplay #tutorial { display:none!important; }
  #gameplay .place-label small { display:none; }
}
