/* Shared ICP navigation. Game buttons always use the existing save/exit flow. */
.horizon-nav{box-sizing:border-box;position:fixed;z-index:90;bottom:0;left:0;right:0;display:flex;justify-content:center;gap:4px;background:#102b30f5;border-top:1px solid #d8c49355;padding:6px max(12px,env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));backdrop-filter:blur(12px)}.horizon-nav a,.horizon-nav button{box-sizing:border-box;display:flex;align-items:center;justify-content:center;flex:1;max-width:180px;min-width:0;min-height:44px;border:0;border-radius:7px;padding:9px 7px;text-decoration:none;background:transparent;color:#d5e1d4;font:600 13px system-ui,sans-serif;cursor:pointer}.horizon-nav [aria-current=page]{background:#e6c584;color:#193937}.horizon-nav a:hover,.horizon-nav button:hover{background:#31514b;color:#f9e7c0}.horizon-nav :focus-visible{outline:2px solid #e6c584;outline-offset:1px}body:not(.horizon-game){padding-bottom:calc(76px + env(safe-area-inset-bottom))}.horizon-game .horizon-nav{display:none}
@media(max-width:800px){
 button,.icon-button,.map-button,.category-tabs button,.edit-tools button,.time-controls button,.zoom-tools button,#story-toggle,#close-modal,#military-close,.shop-tabs button,.track-filters button{min-height:44px;min-width:44px}
 input,select,textarea{font-size:16px}.horizon-game .horizon-nav{display:flex}.horizon-game .bottom-area{bottom:calc(62px + env(safe-area-inset-bottom));max-width:calc(100% - 16px)}.horizon-game #battle-bar{bottom:var(--dock-height,calc(214px + env(safe-area-inset-bottom)));max-height:35dvh;overflow:auto}.horizon-game #toast{bottom:calc(225px + env(safe-area-inset-bottom))}.horizon-game .world-tools{right:max(8px,env(safe-area-inset-right));max-width:140px}.horizon-game .world-tools .zoom-tools button{min-width:44px}.horizon-game #shop-character{min-width:44px;min-height:44px}.horizon-game .topbar{padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right));padding-top:max(8px,env(safe-area-inset-top))}.horizon-game .build-header{flex-wrap:wrap;height:auto;min-height:48px}.horizon-game .category-tabs{min-width:0;overflow-x:auto}.horizon-game .time-controls{flex-shrink:0}.horizon-game .map-status{flex-wrap:wrap;gap:5px}.horizon-game .population-pill{max-width:100%;font-size:11px}.horizon-game dialog{max-width:calc(100vw - 24px);max-height:calc(100dvh - 40px);overflow:auto}.horizon-game .modal-buttons{flex-wrap:wrap}.horizon-game .buildings{max-height:27dvh}.horizon-game .story-panel{max-height:40dvh;overflow:auto}.horizon-game .chapter-top{height:46px}.horizon-game #menu-button{right:10px}.horizon-game #sound-toggle{right:60px}.horizon-game .era-checklist-item>button{min-width:0;text-align:left}.horizon-game .story-panel.collapsed .era-checklist{display:none}.horizon-game .world-tools .minimap-wrap{display:none}.horizon-game .world-tools .map-button{min-width:44px;max-width:140px}.shop-tabs{overflow-x:auto}.product-card .price{font-size:22px}
}
@media(max-width:420px){.horizon-game .world-tools{max-width:129px;top:125px}.horizon-game .world-tools #journal-button,.horizon-game .world-tools #gather{font-size:11px}.horizon-game .bottom-area{left:8px;right:8px;width:auto}.horizon-game .time-controls{width:100%;justify-content:flex-end}.horizon-game .story-panel{top:125px;left:8px;width:154px}}
@media(max-height:600px) and (max-width:950px){.horizon-game .world-tools{max-height:calc(100dvh - 210px);overflow:auto}.horizon-game .story-panel{max-height:30dvh}.horizon-game .buildings{max-height:22dvh}}
/* Reserve two compact rows for city identity before chapter controls. */
@media(max-width:800px){
 .horizon-game .city-label{top:104px;left:8px;display:grid;grid-template-columns:minmax(0,1fr);gap:0;width:calc(100% - 154px);max-width:calc(100% - 154px);padding:0 8px 6px}
 .horizon-game .city-label .city-rule{display:none}
 .horizon-game .city-label #name-button{min-height:44px;min-width:0;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}
 .horizon-game .city-label #save-label{display:block;min-width:0;line-height:16px;font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .horizon-game .story-panel{top:180px;left:8px;max-width:calc(100% - 154px)}
}
