/* A roomy phone layout layered over the shared desktop game. */
.mobile-menu-dialog{display:none}

@media(max-width:600px){
  body{padding-bottom:calc(132px + env(safe-area-inset-bottom))}
  .site-header{min-height:62px;flex-wrap:nowrap;gap:10px;padding:calc(11px + env(safe-area-inset-top)) 15px 10px}
  .brand{font-size:18px;gap:9px;min-width:0}
  .brand-icon{width:25px;height:32px;flex-shrink:0}
  .brand small,.main-nav{display:none}
  .header-actions{margin-left:auto;flex-shrink:0}
  .header-actions .icon-button{width:40px;height:40px}

  .main-shell{padding:12px 12px 0}
  .page-intro{display:block;margin:0 0 11px;padding:0}
  .page-intro>div:first-child{display:none}
  .level-card{width:100%;margin:0;padding:8px 10px;border:1px solid #3b4939;border-radius:13px;background:linear-gradient(105deg,#202d24,#19231e);gap:9px}
  .level-emblem{width:31px;height:31px;padding:6px;flex-shrink:0}
  .level-card>div{display:grid;grid-template-columns:auto 1fr;align-items:center;column-gap:8px;row-gap:6px;min-width:0;flex:1}
  .level-card small{font-size:9px;line-height:1;white-space:nowrap}
  .level-card strong{font-size:13px;line-height:1.25;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .level-track{grid-column:1/-1;width:100%;margin:0;height:5px}
  .level-card>span:last-child{display:block;margin:0;padding:5px 7px;border-radius:7px;background:#35432f;color:#f1c37e;font-size:11px;align-self:center}

  .stats-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-bottom:12px}
  .stat-card{display:flex;align-items:center;min-width:0;min-height:72px;padding:10px 11px;border-radius:13px;gap:9px}
  .stat-card.primary-stat{grid-column:1/-1;min-height:82px;padding:11px 14px;background:linear-gradient(110deg,#4b3a25,#2d3224 72%)}
  .stat-card>div{min-width:0}
  .stat-symbol{display:grid;width:34px;height:34px;padding:7px;flex:0 0 auto}
  .primary-stat .stat-symbol{width:40px;height:40px;padding:8px}
  .stat-label{display:block;min-height:0;font-size:11px;line-height:1.25;letter-spacing:.25px}
  .stat-number{display:flex;align-items:baseline;gap:5px;margin-top:6px;min-width:0}
  .stat-number strong{font-size:clamp(23px,7vw,31px);line-height:1;min-width:0;overflow:hidden;text-overflow:ellipsis}
  .primary-stat .stat-number strong{font-size:clamp(30px,9vw,39px)}
  .stat-number>span{display:block;margin:0;font-size:10px;white-space:nowrap}

  .radio-bar{display:flex;flex-wrap:nowrap;align-items:center;gap:8px;min-height:56px;margin-bottom:8px;padding:8px 10px;border-radius:13px}
  .radio-brand{min-width:0;flex:1}
  .radio-dial{width:31px;height:31px;font-size:18px;flex-shrink:0}
  .radio-brand strong{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .radio-meter,#radio-status{display:none}
  .radio-bar #music-toggle{min-height:40px;font-size:10px;padding:7px 9px;flex-shrink:0}
  .radio-volume,.radio-bar .library-button{display:none}

  .world-hud{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin:0 0 8px;padding:9px 10px;border-radius:13px}
  .world-weather{min-width:0}
  .weather-orb{width:36px;height:36px;font-size:22px;flex-shrink:0}
  .world-weather strong{font-size:12px;line-height:1.3}
  .world-weather span{font-size:10px;line-height:1.4;max-width:150px}
  .world-status{display:none}
  .explore-button{max-width:124px;min-height:42px;padding:8px 10px;font-size:10px;line-height:1.3;white-space:normal}

  .faction-bar{display:flex!important;grid-template-columns:none!important;flex-wrap:nowrap!important;gap:8px;margin:0 0 9px;padding:0 0 3px;overflow-x:auto;scroll-snap-type:x proximity;scrollbar-width:none;overscroll-behavior-x:contain}
  .faction-bar::-webkit-scrollbar{display:none}
  .faction-contact{flex:0 0 clamp(158px,47vw,188px);min-width:0;min-height:61px;padding:7px 9px;gap:7px;border-radius:10px;scroll-snap-align:start;font-size:11px;line-height:1.25}
  .faction-contact>svg{width:27px;height:27px;flex-shrink:0}
  .faction-contact>span{min-width:0}
  .faction-contact b{display:block;margin:3px 0 0;font-size:11px}
  .faction-contact .contact-chance{font-size:9px;line-height:1.35;margin-top:4px}

  .event-strip{position:relative;top:auto;z-index:4;width:100%;height:auto;min-height:82px;margin:0 0 11px;padding:12px 13px;gap:9px;box-shadow:0 8px 22px #08110a44}
  .event-strip.event-idle{display:none!important}
  .event-strip strong{font-size:17px;line-height:1.2}
  .event-strip small{font-size:8px}
  .event-strip #event-clock{font-size:20px}
  .event-strip button{min-height:42px;font-size:10px}

  .game-grid{gap:14px}
  .clicker-panel,.shop-panel,.barrio-log,.secondary-view{border-radius:19px}
  .clicker-panel{min-height:0;scroll-margin-top:74px}
  .panel-topline{min-height:58px;padding:15px 14px}
  .section-kicker{font-size:8px;letter-spacing:1px}
  .mini-pill{font-size:8px;padding:6px 8px}
  .clicker-panel .bottle-stage,.clicker-panel.has-event .bottle-stage{flex:0 0 clamp(300px,88vw,350px);height:clamp(300px,88vw,350px);min-height:clamp(300px,88vw,350px)}
  .bombona-button{width:clamp(190px,60vw,225px);height:clamp(255px,76vw,300px)}
  .orbit{width:min(82vw,310px);height:min(82vw,310px)}
  .orbit-two{width:min(64vw,242px);height:min(64vw,242px)}
  .floating-note{font-size:9px;line-height:1.3}
  .note-left{top:54px;left:10px}
  .note-right{right:10px;bottom:61px}
  .combo-display{left:10px;bottom:6px;gap:7px;padding:8px 9px}
  .combo-display>strong{font-size:25px}
  .combo-display>div{min-width:112px}
  .combo-display b{font-size:7px}
  .combo-display>div>span{font-size:8px}
  .stage-copy-region{min-height:168px}
  .clicker-copy{padding:23px 14px 20px}
  .clicker-copy h2{font-size:27px}
  .clicker-copy p{font-size:14px;line-height:1.55}
  .keyboard-hint{font-size:10px;line-height:1.6}
  .keyboard-hint kbd{display:none}
  .quote-strip{height:auto;min-height:66px;padding:14px}
  .quote-strip p{font-size:12px;line-height:1.5}
  .quote-author{font-size:9px}
  .street-controls{padding:13px 14px;gap:9px}
  .energy-meter>div:first-child{font-size:8px}
  .shield-button{min-height:44px;font-size:11px}

  .shop-panel{padding:21px 15px;scroll-margin-top:74px}
  .shop-heading h2{font-size:29px}
  .shop-description{font-size:14px;line-height:1.55}
  .shop-controls{margin-top:19px}
  .shop-controls>span{font-size:10px}
  .buy-quantity button{min-width:44px;min-height:40px;font-size:12px}
  .upgrade-card{min-height:88px;padding:13px 11px;gap:10px}
  .upgrade-icon{width:41px;height:41px;padding:8px}
  .upgrade-title h3{font-size:15px;line-height:1.25}
  .owned-count{font-size:10px}
  .upgrade-info p{display:block;font-size:11px;line-height:1.35}
  .upgrade-output{font-size:10px;line-height:1.35}
  .buy-button{min-width:78px;min-height:46px;font-size:12px;padding:9px 8px}
  .shop-footer{font-size:10px;line-height:1.5}

  .powers-section{margin-top:24px;scroll-margin-top:74px}
  .section-heading h2{font-size:24px;line-height:1.2}
  .section-heading p{font-size:12px;line-height:1.5}
  .power-card{display:block;padding:17px}
  .power-card h3{font-size:16px}
  .power-subtitle{font-size:10px}
  .power-card p{font-size:12px;line-height:1.55;margin:12px 0;min-height:0}
  .power-bottom{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:10px}
  .power-meta{font-size:9px;order:0}
  .power-button{width:auto;min-width:125px;min-height:44px;font-size:11px}
  .mission-card{padding:16px;gap:12px}
  .mission-copy h3{font-size:15px}
  .mission-copy p{font-size:11px;line-height:1.5}
  .mission-progress{width:100%;margin:5px 0 0}
  .mission-progress>div:first-child{font-size:10px}
  .mission-card .text-button{min-height:44px;font-size:11px}

  .secondary-view{padding:19px 15px}
  .secondary-view .section-heading h2{font-size:26px}
  .achievement-card{padding:16px 13px}
  .achievement-body h3{font-size:16px}
  .achievement-body p{font-size:12px;line-height:1.5}
  .achievement-bottom{font-size:10px;align-items:flex-end}
  .claim-button{min-height:44px;font-size:11px}
  .empire-stat span{font-size:12px}
  .production-row h3{font-size:14px}
  .production-row p{font-size:11px}
  .production-row>strong{font-size:12px}

  .mobile-dock{position:fixed;z-index:95;left:8px;right:8px;bottom:max(7px,env(safe-area-inset-bottom));display:block;padding:7px;border:1px solid #6d7f5e;background:#14221cf7;border-radius:18px;box-shadow:0 16px 42px #020805cc;backdrop-filter:blur(18px)}
  .mobile-wallet{display:grid;grid-template-columns:minmax(0,1.5fr) repeat(2,minmax(0,1fr));align-items:center;gap:5px;min-height:39px;margin-bottom:5px;padding:5px 7px;border:1px solid #43533d;border-radius:11px;background:#0d1813cc}
  .mobile-wallet>span{min-width:0;padding:0 7px;border-left:1px solid #34432f}
  .mobile-wallet>span:first-child{border-left:0}
  .mobile-wallet small{display:block;color:#91a487;font:700 8px/1.1 var(--font);letter-spacing:.8px}
  .mobile-wallet strong{display:inline-block;max-width:100%;overflow:hidden;text-overflow:ellipsis;color:#f4d092;font:600 16px/1.25 var(--display);vertical-align:bottom;white-space:nowrap}
  .mobile-wallet-main strong{font-size:20px;color:#ffd088}
  .mobile-wallet em{font-size:9px;color:#aab89e;font-style:normal;margin-left:3px}
  .mobile-dock-actions{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px}
  .mobile-dock button{min-width:0;min-height:48px;padding:4px 2px;border:0;border-radius:10px;background:transparent;color:#d7e0c4;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:17px}
  .mobile-dock button:active,.mobile-dock button.active{background:#3c503a;color:#ffd18f;scale:.97}
  .mobile-dock small{font:700 9px/1.15 var(--font);letter-spacing:0;white-space:nowrap}
  .mobile-dock [data-icon]{width:18px;height:18px}

  .mobile-menu-dialog{width:calc(100% - 24px);max-width:420px;margin:auto auto calc(122px + env(safe-area-inset-bottom));padding:18px;border:1px solid #718164;border-radius:22px;background:linear-gradient(150deg,#243229,#15231d);color:var(--text);box-shadow:0 24px 80px #000b}
  .mobile-menu-dialog[open]{display:block}
  .mobile-menu-dialog::backdrop{background:#07100bd6;backdrop-filter:blur(4px)}
  .mobile-menu-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
  .mobile-menu-heading span{font-size:9px;color:#9bad90;letter-spacing:1.2px}
  .mobile-menu-heading h2{font-size:24px;margin-top:3px}
  .mobile-menu-heading button{width:44px;height:44px;border:1px solid #53624c;border-radius:12px;background:#2d3b31;color:#e3e9d7;font-size:22px}
  .mobile-menu-grid{display:grid;grid-template-columns:1fr;gap:8px}
  .mobile-menu-grid button{display:grid;grid-template-columns:38px 1fr;column-gap:11px;align-items:center;min-height:67px;padding:11px 13px;text-align:left;border:1px solid #465541;border-radius:13px;background:#26342a;color:#edf0df}
  .mobile-menu-grid button>span{grid-row:1/3;width:30px;height:30px;padding:5px;color:#efc580}
  .mobile-menu-grid strong{font-size:14px}
  .mobile-menu-grid small{font-size:11px;line-height:1.35;color:#9eae98}
  .toast-stack{right:12px;left:12px;bottom:calc(129px + env(safe-area-inset-bottom))}
  .toast{font-size:13px;line-height:1.55}

  body:not([data-view="game"]) .page-intro,
  body:not([data-view="game"]) .stats-grid,
  body:not([data-view="game"]) .radio-bar,
  body:not([data-view="game"]) .world-hud,
  body:not([data-view="game"]) .faction-bar,
  body:not([data-view="game"]) .event-strip{display:none!important}
  body:not([data-view="game"]) .secondary-view{margin-top:0}
}

@media(max-width:360px){
  .site-header{padding-left:12px;padding-right:12px}
  .main-shell{padding-left:9px;padding-right:9px}
  .stat-card{padding:10px;gap:7px}
  .stat-symbol{width:30px;height:30px;padding:6px}
  .primary-stat .stat-symbol{width:40px;height:40px;padding:8px}
  .stat-label{font-size:10px}
  .world-weather span{max-width:118px}
  .explore-button{max-width:110px;font-size:10px}
  .faction-contact{flex-basis:154px}
  .upgrade-card{padding:12px 9px}
  .upgrade-icon{width:36px;height:38px;padding:7px}
  .buy-button{min-width:70px}
  .mobile-dock{left:5px;right:5px;padding:6px}
  .mobile-wallet>span{padding:0 5px}
  .mobile-wallet-main strong{font-size:18px}
  .mobile-dock small{font-size:8px}
}
