/* A small bottom dock leaves the battlefield open in either phone orientation. */
#game{padding:0;gap:0;grid-template:52px minmax(0,1fr) 54px/minmax(0,1fr)}header{grid-column:1;grid-row:1;padding:5px 12px}header .wordmark{font-size:23px}.resources{gap:20px}.resources strong{font-size:17px}.resources small{font-size:10px}header button{min-height:42px;width:42px}#field{grid-column:1;grid-row:2}#panel{grid-column:1;grid-row:3;border:1px solid #222;overflow:hidden;display:flex;flex-direction:column}#panel nav{display:flex;gap:2px;min-height:52px;height:52px;padding:3px 6px;border:0;flex-shrink:0}#panel nav button{flex:1;font-size:14px;min-height:44px;padding:4px;max-width:180px}#cards,#panel .tactical-orders,#panel .extra-orders,#panel .orders,#hint,.base-health{display:none!important}#game.dock-open{grid-template-rows:52px minmax(0,1fr) 194px}#game.dock-open #cards{display:flex!important;flex:1;min-height:0;overflow:auto;gap:8px;padding:6px 8px;max-height:none;align-items:stretch}.card{min-width:110px;max-width:130px;min-height:112px;flex-shrink:0;padding:5px}.card b{font-size:12px}.card .art{height:46px;width:58px}.card .cost{font-size:11px}#game.tools-open{grid-template-rows:52px minmax(0,1fr) 218px}#game.tools-open #panel .tactical-orders,#game.tools-open #panel .extra-orders,#game.tools-open #panel .orders{display:flex!important;gap:6px;padding:3px 8px;margin:0;flex:1;min-height:48px}#game.tools-open #panel button{min-height:44px}.extra-orders button,.orders button,.tactical-orders button{font-size:12px;flex:1}.field-tools{bottom:8px;left:8px;gap:2px}.field-tools button{width:40px;min-height:40px;font-size:21px}#zoomIn,#zoomOut{display:none}#minimap{width:88px;height:71px;bottom:8px;right:8px;border:2px solid #222;box-shadow:none;transform:none}#selection{bottom:8px;left:54px;max-width:180px;font-size:12px;padding:5px;pointer-events:none}#buildingActions{position:absolute;left:54px;bottom:8px;right:104px;max-width:480px;z-index:5;background:#fafafaf0 url('paper-ui.png') center/cover;border:1px solid #222;padding:5px;display:flex;flex-wrap:wrap;gap:4px}#buildingActions[hidden]{display:none}#buildingName{font-size:12px;flex-basis:100%;line-height:1.3}#buildingActions button{font-size:12px;min-height:44px;flex:1;white-space:nowrap;padding:4px 6px}#buildingActions button[hidden]{display:none}.has-building #selection{display:none!important}#production{max-width:115px!important;width:auto;right:8px;bottom:85px!important;padding:5px;font-size:12px;min-height:40px;line-height:1.2;pointer-events:auto}#superFire{left:54px;bottom:100px!important;width:145px;max-width:145px;padding:5px}#superFire small,#enemySuper small{display:none}#superFire strong,#enemySuper strong{font-size:14px}#enemySuper{right:8px;bottom:132px!important;width:145px;padding:5px}.mission,.wave{padding:4px 6px;clip-path:none;filter:none;box-shadow:none;background:#fafafac9}.mission{left:8px;top:8px}.wave{right:8px;top:8px;border:0}.wave button{min-height:32px;font-size:11px}.wave span{font-size:10px}.mission p{font-size:11px;max-width:260px}#notice{top:55px}#titleScreen{background-image:url('menu-inkfall.png');background-position:center;background-size:cover}#campaignDialog{background-image:linear-gradient(#f5f5f5dd,#f5f5f5f5),url('menu-inkfall.png');background-size:cover;background-position:center}.title-content{animation:title-arrive .65s ease-out}.title-actions button{transition:transform .15s,box-shadow .15s}.title-actions button:active{transform:rotate(-.5deg) translateY(2px)}
@media(max-width:600px){#game{grid-template-rows:48px minmax(0,1fr) 54px}#game.dock-open{grid-template-rows:48px minmax(0,1fr) 186px}#game.tools-open{grid-template-rows:48px minmax(0,1fr) 214px}header{padding:3px 7px}.resources{gap:12px}.resources strong{font-size:16px}.wordmark{font-size:20px!important}.resources div:nth-child(3){display:none}#panel nav button{font-size:13px}.mission p{max-width:185px}#buildingActions{right:8px;max-width:calc(100% - 62px)}.has-building #minimap{bottom:112px}.has-building #production{bottom:190px!important}#buildingActions button{font-size:12px}#buildingName{font-size:12px}#superFire{bottom:108px!important;width:125px}#enemySuper{width:125px}#campaignRadio{top:47px}}
@media(max-height:430px){#game{grid-template-rows:44px minmax(0,1fr) 50px}#game.dock-open{grid-template-rows:44px minmax(0,1fr) 158px}#game.tools-open{grid-template-rows:44px minmax(0,1fr) 200px}#panel nav{min-height:48px;height:48px}.card{min-height:96px}.card .art{height:32px}.mission{display:none}#buildingActions{bottom:5px}#campaignRadio{top:5px;left:8px;max-width:350px}#radioPortrait{width:65px}#campaignRadio{grid-template-columns:65px minmax(0,1fr)}}
@media(prefers-reduced-motion:reduce){.title-content,.title-actions button{animation:none;transition:none}}

#titleScreen{animation:menu-drift 24s ease-in-out infinite alternate}@keyframes menu-drift{from{background-position:50% 50%}to{background-position:52% 48%}}@media(prefers-reduced-motion:reduce){#titleScreen{animation:none;background-size:cover}}

/* Context commands replace the dock instead of covering the battlefield. */
#panel{position:relative}#buildingActions{position:static;inset:auto;max-width:none;width:100%;height:52px;min-height:52px;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;padding:3px;gap:3px;border:0;box-sizing:border-box;background:#fafafa}#buildingActions button{flex:1 0 auto;min-width:52px;max-width:105px;font-size:12px;min-height:44px;padding:3px 6px}#buildingActions #buildingBack{flex:0 0 36px;min-width:36px;font-size:25px}#buildingName{display:none}#game.has-building #panel nav{display:none}#game.has-building.dock-open #panel nav,#game.has-building.tools-open #panel nav{display:flex}#game.has-building.dock-open #buildingActions,#game.has-building.tools-open #buildingActions{display:none}.has-building #minimap{bottom:8px}#lanBadge,.wave,#selection{display:none!important}#production,.has-building #production{position:static!important;inset:auto!important;max-width:none!important;pointer-events:auto;font-size:12px;min-height:44px}#notice{pointer-events:none;max-width:70%}.mission{background:transparent;max-width:65%;pointer-events:none}.mission p{font-size:11px}#superFire{bottom:8px!important;left:54px;width:120px}#enemySuper{bottom:90px!important;right:8px;width:120px}#field.has-super #selection{display:none}#sound{width:100%}

#fieldActions{position:fixed;z-index:24;left:8px;bottom:130px;display:flex;flex-wrap:wrap;gap:4px;max-width:min(420px,calc(100vw - 120px));padding:5px;border:1px solid #222;background:#eeeef0ed;font-size:12px}#fieldActions[hidden]{display:none}#fieldActions button{min-height:44px;padding:5px 9px}#fieldActions b{flex-basis:100%}

#fieldActions{position:static;grid-column:1/-1;max-width:none;padding:3px 0 0;border:0;background:transparent;pointer-events:auto}body:has(#titleScreen:not([hidden])) #fieldActions{display:none}
